ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How can I integrate Python rosunit unit tests into the cmake build?

asked 2017-10-16 02:46:41 -0500

thinwybk gravatar image

updated 2017-10-17 01:11:52 -0500

I would like to run rosunit Python unit tests as part of make test in the CI environment. In the wiki and in the catkin docs it is recommended to use cmake_add_nodetest() for that. Is cmake_add_nosetest() specific to nosetest or can it used with the plain unittest test runner as well/instead? (I know that rosunit depends on unittest. I didn't recognize a dependency from nosetest.) If it's possible: Could you guide me to an integration example in the ROS code base?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-16 17:23:47 -0500

tfoote gravatar image

nosetest is a test runner. It will collect and run detected unittest test cases found in the test files. See:

edit flag offensive delete link more


Sorry, my question is not precise enough. I was interested in if I can use only nosetest 's test runner or any other as well (e.g. the one of unittest).

thinwybk gravatar image thinwybk  ( 2017-10-17 01:11:12 -0500 )edit

It's likely you could add integration for it but it's not currently supported.

tfoote gravatar image tfoote  ( 2017-10-18 18:17:33 -0500 )edit

Ok. If I would like to add integration where in the sources I should dive into first?

thinwybk gravatar image thinwybk  ( 2017-10-19 02:37:51 -0500 )edit

I would look inside catkin and make a parallel function like catkin_add_nosetests:

tfoote gravatar image tfoote  ( 2017-10-19 17:43:11 -0500 )edit

Question Tools



Asked: 2017-10-16 02:46:41 -0500

Seen: 522 times

Last updated: Oct 17 '17