2
votes
Does rostest/gtest (ROS , CPP) provide any conditional compilaton flag?
Adding the following line in the CMakeLists.txt does the work:
if(CATKIN_ENABLE_TESTING)
add_compile_options(-DROSTEST)
...
endif()
1
vote
Path to colcon test output directory in a gtest
I went down a bit of a rabbit hole on this, and the best general solution I can come up with would rely on ament.
If you're adding the test using any of the ament CMake functions (i.e. anything other ...
1
vote
Path to colcon test output directory in a gtest
It's been suggested that I do:
#include <rclcpp/logging.hpp>
...
rclcpp::init(argc, argv);
...
directory = rclcpp::get_logging_directory().string()
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
gtest × 55ros × 45
rostest × 17
catkin × 14
ros2 × 9
unit-testing × 9
ros-kinetic × 5
cmake × 4
c++ × 3
catkin-make × 3
ros-fuerte × 3
rclcpp × 2
rosmake × 2
macos × 2
macos-lion × 2
colcon × 2
navigation × 1
ros-noetic × 1
ros-humble × 1
ros-melodic × 1
ament × 1
rosbag × 1
ubuntu × 1
ros-groovy × 1
ros-indigo × 1