-
Notifications
You must be signed in to change notification settings - Fork 213
Running Tests
Elliria edited this page Feb 19, 2025
·
18 revisions
The unit test suite has two additional requirements:
- Pytest - PyPi
- PyHamcrest - PyPi
Running the test suite is integrated into setup.py
. The tests can be run by executing python3 setup.py test
from the repository root directory.
You can try out the code by cloning it and testing it locally on your machine without having to install it. This is a great way to help the developers when they've created new features or fixed issues and would like feedback from users. It's also a great way to test out your own code if you'd like to do some AutoKey developing of your own.
- Prepare your system before cloning:
- Important - Make sure that AutoKey is or was installed on your computer (from your distribution's package manager, etc.) so that you'll already have all of its dependencies.
-
Optional - Configure git on your system:
- Configure your git username by replacing John with your username:
git config --global user.name "John"
- Configure your git user email by replacing John Doe's email address with yours:
git config --global user.email "john.doe@example.com"
- Configure your editor as nano instead of the default of vim:
git config --global core.editor "nano"
- Configure your pushes to tracking so that they'll go wherever they're being automatically tracked to go:
git config push.default tracking
- Configure your git username by replacing John with your username:
- Clone the repository:
- Open a terminal window on your computer in the directory in which you'd like to create the clone's subdirectory.
- Clone the repository with this command:
git clone https://github.com/autokey/autokey.git
- Run the clone:
- Run the clone manually:
- Change to the autokey directory that you just created:
cd autokey
- Change to the /lib directory:
cd lib
- Run the AutoKey module in either GTK or Qt mode:
- AutoKey GTK:
python3 -m autokey.gtkui
- AutoKey Qt:
python3 -m autokey.qtui
- AutoKey GTK:
- Change to the autokey directory that you just created:
- Run the clone from anywhere by replacing the example
~/Desktop/autokey
path with the path to your clone:- AutoKey GTK:
cd ~/Desktop/autokey; cd lib; python3 -m autokey.gtkui
- AutoKey Qt:
cd ~/Desktop/autokey; cd lib; python3 -m autokey.qtui
- Note that command-line options (like
-c
can be added to the end of any of those AutoKey commands.
- AutoKey GTK:
- Run the clone manually:
- When you're finished testing either of those clones, close AutoKey normally.
- If you're finished with all of your testing and would like to get rid of the clone, delete the clone's directory. Otherwise, you can keep it and use these steps again for further testing another time.
You can try out a pull-request by fetching the pull-request into a cloned copy of AutoKey:
- Create a virtual machine with an Ubuntu live CD in it.
- Boot into the Ubuntu live CD.
- Open a terminal window.
- Issue each of these commands, one after another, replacing each instance of 1004 below with the number of the pull-request that you'd like to test, and pressing the Enter or y key any time you're prompted with a Y/n question to accept all of the installations:
Note that if you want to test out building AutoKey, you'd want to add the
sudo apt-get update sudo apt-get install git sudo apt-get install python3-pip sudo apt-get install python3-venv sudo apt-get install libcairo2-dev cd Desktop git clone https://github.com/autokey/autokey.git cd autokey git fetch origin pull/1004/head:pull_1004 git checkout pull_1004 python3 -m venv venv source venv/bin/activate xargs -a apt-requirements.txt sudo apt install -y pip install -r pip-requirements.txt pip install packaging pip install packaging pyasyncore evdev cd lib # Run **autokey-gtk**: python3 -m autokey.gtkui -cl # Or Run **autokey-qt**: python3 -m autokey.qtui -cl
sudo apt-get install build-essential
command in along with the other installations.
-
Home
- About
- Beginners' Guide
- Documentation
- FAQ
- Administration
- Community
- Development
- Features