Move test environment setup into the test files
Currently the Meson bits of the Weston test suite encode almost everything about how each test should be run: compositor command line arguments, environment variables, related files. That is inconvenient to maintain, the test setup is split between the test .c
file and meson.build
. The Meson code as it is written right now is also painful to deal with.
In autotools era there was another reason why the test setup sucked: it was very very hard to run a test manually, for example with GDB. The autotools test harness had a hideous bash script to set up everything. Meson helps a lot there with meson test --gdb
and --wrapper
and what not, so that part should no longer be an issue. We don't have the bash script, but the meson.build
today does pretty much the same thing.
With autotools, we also had a trick to get compositor command line arguments from the test .c
file: run the test executable with --params
and it prints what it wants in the compositor command line. That feature is no longer used with Meson due to difficulties in running a program before it has been compiled.
The main idea here is to change the tests such that the test program is the entry point, not the compositor. !230 (merged) turns Weston frontend into a library we can link into a test program and then just call wet_main()
to run the compositor with any arguments and environment we want. The arguments would be kept in the test .c
file in their proper context. This would also make it easier to run certain tests multiple times with different compositor options (e.g. pixman renderer and GL renderer).
In the end, all tests should be launched the same way, regardless if they were stand-alone test programs, compositor plugins, Wayland clients, or a combination of a plugin and a client.