fix(ci): unit tests are not launched
Description
The code with flock
was wrong, and the test was not executed. I restored the initial code, which should be safe.
Also, I think there was another specific bug with viz_scene3d test. Even on my computer, it crashed after destroying the first Ogre::Root
. Indeed we chose to create and destroy it after each test. This problem is thus independent from the display number of xvfb-run
since it does succeed to create an OpenGL context once but somehow fails to create a second. I assume xvfb-run
might be buggy regarding this initialization code.
As a workaround, I propose to create a single Ogre::Root
for the whole test suite. There are 3 ways to achieve this:
- create and destroy the
Ogre::Root
in a static singleton. That crashes, becauseOgre::Root
fails to destroy properly after themain()
function.
- create and destroy the
Ogre::Root
in an initialize/uninitialize function inside themain
function. We do not have such a system today. - create and destroy the
Ogre::Root
in a plugin, which somehow mimics the previous solution, but we already have the system in place.
So I implemented the third solution and introduced a new module sight::module::viz::scene3d::test
to this end.
Closes #713 (closed)
How to test it?
You can manually modify the code at the end of template_test.sh.in
to force the usage of xfvb-run
when running ctest -jN
and verify it never crashes because a display number is already in use.