Adding unit tests and executing them in ros2

asked 2019-06-18 05:58:19 -0500

SkandaNR gravatar image

Hello, I have a ros2(crystal) package and one node in it. The package structure is same as in https://index.ros.org/doc/ros2/Contributing/Developer-Guide/#package-layout. I need to add unit tests for the node. test folder contain test_copyright.py, test_flake8.py, test_pep257.py taken from https://github.com/ros2/ros2cli/tree/master/ros2msg/test.

Is there any documentation to understand these test files? Also is there any repo with unit tests for a node? (I prefer to have it with unittest python library).

It would be a greater help if anyone can share a template.

edit retag flag offensive close merge delete

Comments

Hi! did you find any good examples or a tutorial to understand unit test ?

ohmimi gravatar image ohmimi  ( 2022-04-15 04:29:46 -0500 )edit