If you're building ddterm from source, running
ninja test
or
meson test
in the build directory will run some basic tests (if necessary dependencies
are installed and detected by meson correctly).
tox allows more flexibility and more thorough testing. To see all available
tox commands/environments, run tox list.
-
Python 3
-
tox: https://tox.wiki/
-
PyGObject: https://pygobject.readthedocs.io/ or its build dependencies.
-
If running tests in containers - podman: https://podman.io/
tox -e images -- pull
tox -e images -- prune
Or to do both at the same time:
tox -e images -- pull --prune
tox [--sitepackages] -e pytest -- [--bundle=path] <other-options...>
Before running tests, you need to build the extension bundle.
You either have to specify the path to the built bundle:
--bundle=path/to/ddterm@amezin.github.com.shell-extension.zip
or run tox from meson devenv -C build-dir shell. If not using meson devenv
or --bundle=..., run tests against currently installed extension
(not possible with containers).
The path must be relative to the root of the repository (tox.ini directory).
Because of pytest CLI bugs,
--bundle path/to/ddterm@amezin.github.com.shell-extension.zip
might not work, but
--bundle=path/to/ddterm@amezin.github.com.shell-extension.zip will.
Without --sitepackages you'll have to install PyGObject's build dependencies,
and PyGObject will be automatically built from source.
--container=IMAGE - run tests using the specified container image IMAGE.
Can be repeated multiple times to run tests with multiple images.
IMAGE can be full image name, or a service name from compose.yaml.
--screenshot-always - take screenshots after every test. By default,
screenshots are taken only after failures.
To see all available options:
tox [--sitepackages] -e pytest -- --help
Test report is created as report.html in the tests directory.
You can also request a report in JUnit format by adding --junitxml=filename
option.
-
Window management: tests verify that for a specific combination of settings (window size, position, maximized/unmaximized flag) the window shows at the correct location and has the correct size. To reduce the number of settings combinations, pairwise testing (using PICT) is applied.
-
Basic memory leak tests.
Application's UI is (mostly) not covered, you'll have to test it manually.