stumpwm.stumpwm/tests/integration-tests
Axel Svensson 488200e9a0 Fix frame-head to work with iresize
setup-iresize can cause frame-head to be called with a head-frame
argument.
2022-11-10 20:57:03 +01:00
..
container-scripts Integration tests: Reproduce issue #993 2022-08-22 12:14:22 +02:00
stumpwm.d Integration tests: Add invariant checking 2022-08-21 09:29:45 +02:00
testcases Add failing integration test case test-basic-iresize 2022-11-10 20:57:03 +01:00
Dockerfile Integration tests: Various improvements and fixes 2022-08-16 12:50:23 +02:00
Makefile Integration tests: Add to CI workflow 2022-08-22 12:14:22 +02:00
README.md Integration tests: Fix README.md 2021-06-14 22:37:09 +02:00
script Integration tests: Add to CI workflow 2022-08-22 12:14:22 +02:00
tests-expected-to-fail Fix frame-head to work with iresize 2022-11-10 20:57:03 +01:00

Generative, end-to-end test suite for stumpwm

Why

A window manager's primary purpose is to interact with the windowing system and the user. Since (end-to-end) integration tests are the only kind that actually test this primary functionality, they are arguably the most important kind of tests for any window manager.

Property based testing, or generative testing, is an approach to partly automate bug finding. Rather than manually writing each test case, they are generated based on certain rules. When an automatically generated test case fails, it is investigated manually to confirm that the test is correct, and then committed to the repository. The repository therefore contains both

  1. individual test cases that have previously failed, to prevent regression
  2. rules to generate new test cases.

Generating and running tests

For usage help, run:

./script

When you run tests, the test results will be in testcases/*.results/. Successful tests will have a success file while failed tests will have a fail file containing a message. Usually, the stdout.txt and screenshot-*.png files will show the necessary details.

If you generate tests, they will be named testcases/generated-*.sh. If you want to commit a generated test to the repository, rename it first. It can also be a good idea to minimize the test, i.e. make it shorter while retaining the failure.

Development

The file container-scripts/generate-test-code contains the code and rules to generate a random test case.