ROS node unit testing
The content in the wiki about "ROS node unit testing" is spread over a lot of pages which are hardly referencing each other e.g. rostest nodes (hztest, selftest, publishtest, paramtest) / mock_objects (provide mocks for a service server, a message subscriber and an actionlib server) / range tests (specific to the pandora platform) / integrating other test frameworks than gtest with rostest (for asserting or mocking). In addition it is not always clear if the pages contain information which are still valid e.g. the wiki page about interface_testing (last edited 2011-08-04) references a package "interface_tester" which seems to be not existing.
Are there any other resources (books, articles, open source code, etc.) where I can find information about the current state of the art of "ROS node unit testing" from a technical point of view (it is not about the methodical point of view aka what to test)?
- Are there test nodes in addition to the rostest nodes or mocking capabilities in addition to the mock_objects capabilities which can be used for ROS node level test doubles (dummy, fake, stub, mock, spy) for automated ROS node unit tests?
- Some ROS command line tools (e.g. rosmsg, rosnode, rossrv, rostopic) are used when debugging ROS nodes. Are they wrapped into rostest? Or is it common practice to use the equivalent functionality provided by the C++ API or Python API to setup automated ROS node unit tests?
- Are there libraries which provide commonly used, generic functionalities w.r.t. to ROS node level testing like assertion/exception matchers for google mock?
- How can catkin integrate with other unit test frameworks than gtest/nosetest (catkins gtest / nosetest integration -> catkin_add_gtest / catkin_add_nosetests)? E.g. by implementing a ROS wrapper, here for catch (catch-ros).
- How can catkin integrate with other mock frameworks than gmock?
rostest test nodes: hztest, paramtest and publishtest
diagnostics/selftest example - example of a self test with the diagnostics/self_test package (is no rostest test node)
Ros-Test-Example - Unit tests (class under test: topic publisher and subscriber) with gtest and node integration tests with rostest (used test nodes: hztest).
I know that you asked this a while ago, but you may get responses if you break this question into four separate questions (one for each bullet point). Or, if you have the answers now you can post them.
To some degree I have the answers and am going to add them to a GitBook page ( wiki.ros.org is not suitable for me due to several reasons).