From 503e849005bf207a7e785876843e022dfe560473 Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Tue, 27 Jun 2023 00:30:35 -0500 Subject: [PATCH 1/2] Allow disabling tests with CATKIN_ENABLE_TESTING --- laser_scan_matcher/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/laser_scan_matcher/CMakeLists.txt b/laser_scan_matcher/CMakeLists.txt index ce20592..b90f3aa 100644 --- a/laser_scan_matcher/CMakeLists.txt +++ b/laser_scan_matcher/CMakeLists.txt @@ -68,5 +68,7 @@ install(FILES laser_scan_matcher_nodelet.xml install(DIRECTORY demo DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -add_rostest(test/run.test) -add_rostest(test/covariance.test) +if(CATKIN_ENABLE_TESTING) + add_rostest(test/run.test) + add_rostest(test/covariance.test) +endif() From 018d67a90efbfa518afa25c7866b2cac0e282b25 Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Tue, 27 Jun 2023 00:43:31 -0500 Subject: [PATCH 2/2] Only load rostest when tests are enabled --- laser_scan_matcher/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/laser_scan_matcher/CMakeLists.txt b/laser_scan_matcher/CMakeLists.txt index b90f3aa..bea0c44 100644 --- a/laser_scan_matcher/CMakeLists.txt +++ b/laser_scan_matcher/CMakeLists.txt @@ -13,7 +13,7 @@ set( ROS_CXX_DEPENDENCIES nav_msgs) # Find catkin and all required ROS components -find_package(catkin REQUIRED COMPONENTS ${ROS_CXX_DEPENDENCIES} rostest) +find_package(catkin REQUIRED COMPONENTS ${ROS_CXX_DEPENDENCIES}) find_package(PCL REQUIRED QUIET) # Find csm project @@ -69,6 +69,7 @@ install(DIRECTORY demo DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) if(CATKIN_ENABLE_TESTING) + find_package(rostest) add_rostest(test/run.test) add_rostest(test/covariance.test) endif()