rostest file layout- can't find/tries to compile/no rule to make target, existing .test file
If I compile my test bench using rosbuild_add_gtest then roscore is normally not running, and the test fails to connect. Which is why I'm trying to setup an rostest file.
I have written a differential_drive.test file in differential_drive/smurf/ ie. differential_drive/smurf/differential_drive.test
FYI smurf directory name used to differentiate values, only for testing/debugging.
Just FYI ls output from differential_drive dir:
$ ls
bin build CMakeLists.txt launch lib mainpage.dox Makefile manifest.xml msg msg_gen smurf src test
I can successfully run this test using:
$ rostest smurf/differential_drive.test
... logging to /home/tobor/.ros/log/rostest-meltybrain-17188.log
[ROSUNIT] Outputting test results to /home/tobor/.ros/test_results/differential_drive/rostest-smurf_differential_drive.xml
testdifferential_drive_ros_tests ... ok
[ROSTEST]-----------------------------------------------------------------------
...
SUMMARY
* RESULT: SUCCESS
* TESTS: 6
* ERRORS: 0
* FAILURES: 0
rostest log file is in /home/tobor/.ros/log/rostest-meltybrain-17188.log
However I am having trouble setting up the CMakeLists.txt file to run this automatically.
Here are the relevent CMakeLists.txt lines:
rosbuild_add_executable(
test_2/differential_drive_ros_tests
TestRunner.cpp
...
)
rosbuild_add_gtest_build_flags(test_2/differential_drive_ros_tests)
rosbuild_add_rostest(smurf/differential_drive.test)
Some make test output:
[100%] Built target test_2/differential_drive_ros_tests
[100%] Built target tests
make[3]: *** No rule to make target '../test/smurf/differential_drive.test', needed by 'test/CMakeFiles/rostest_smurf_differential_drive.test'. Stop.
make[2]: *** [test/CMakeFiles/rostest_smurf_differential_drive.test.dir/all] Error 2
Any ideas?