Minimal example of node ROS and its testing
In this project we write tests C++ for our package. We create C++ Unit Tests, ROS Unit Tests.
C++ unit tests: These are the tests without ROS. This means that they are not meant to test any ROS-related issue. These tests are performed using the gtest framework.
ROS unit tests: These will test your ROS code related to a single node. They will start your node and test its external API, like published or subscribed topics, etc. These tests are performed using a combination of a rostest alongside a gtest.
This project is for testers in the ROS environment.
Install ROS Melodic: http://wiki.ros.org/Installation/Ubuntu
catkin_make
source devel/setup.bash start roscore rosrun rostest rostest_node
Unit tests: start roscore catkin_make run_tests