Enforce consecutive execution order for gtest and rostest.
My ROS package contains two test executables, one gtest and one rostest. They are specified in the CMakeLists as, catkin_add_gtest(...)
and add_rostest_gtest(...)
respectively.
When performing catkin run_tests my_package --no-deps
, the rostest executable decides to run in the middle of the gtests. This is undesirable as the messages being published from one test could be received by another test.
Is there a way to ensure these tests are run consecutively?
Note: I tried using add_dependencies(my_gtest_target my_rostest_target)
, hoping it would force the gtest to execute before the rostest, but this makes no difference.
Looking at the build output, it seems two instances of run_tests.py are always run in parallel. One instance for gtest and one for rostest.
Note that unless the --reuse-master flag is passed to rostest, unlikely in your case since it is not the default, there is essentially a separate Ros master assigned to each test. See here for more details.
Since there are different Ros masters you won't be able to receive messages from a different test.