Show ROS_DEBUG ROS_INFO with catkin_make run_tests
Hi!
I create a minimal example in order to illustrate my question. If i do the following small testcase:
class SimpleTest : public ::testing::Test
{
protected:
virtual void SetUp(){return;}
virtual void TearDown() {}
};
TEST_F(SimpleTest, OutputTest)
{
ROS_DEBUG("Test Debug");
ROS_INFO("Test Info");
ROS_ERROR("Test Error");
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "simple_test");
ros::NodeHandle node_handle;
if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug) )
ros::console::notifyLoggerLevelsChanged();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
if I run the test with
catkin_make run_tests
it will only display the output from ROS_ERROR.
However if I run it via rostest and --text
rostest --text hello_world simple.test
it will show the output from ROS_DEBUG and ROS_INFO.
I would like to achieve the same output with catkin_make run_tests. So far I have trouble even understanding what is happening here and how the output can be different since essentially the same executable is called.
Any hints/recommendations?