fix(test): GUI tests don't work on Linux when using CTest in sub-repositories
Description
When using CTest to launch GUI tests in sub-repositories, it doesn't work on Linux: It instead simply ends successfully while not launching any GUI tests.
Steps to reproduce
- Go to any sub-repository that already has GUI tests
- Launch the GUI tests using
ctest -R guitest
. Notice that no GUI test actually ran, it ended immediately with no windows visible, yet it reports a success. - Launch the GUI tests by running the executable directly, using
bin/${nameOfTheGuiTest}
. Notice that the GUI test does run.
Functional specifications
GUI tests work normally, whether launching them with CTest or with the executable.
Technical specifications
There is a suspicious line in the exec_gui_tests.sh
script which is used by CTest to launch GUI tests: for test in $(./$1 --list | grep '^sight::');do
This usage of grep will filter out all possible GUI tests in repositories other than sight, thus no GUI tests will run. I don't remember why I grepped the line, maybe because the command outputted an undesirable line which messed up with the proper operation of the script. I tried without and everything seems to work fine, so I think it should be safe to simply delete it.
While it would work correctly on local, the reason I added this grep was because of GDB output. They needed to be grepped out else they would be mistaken as exotic test names such as "No", "process", "to" or "debug". I will replace the regular expression by "::", which should be more general.
Test plan
The GUI tests on Sight still work as usual for all configuration. The GUI tests on sub-repositories work.