Skip to content

Commit e3e00ff

Browse files
Merge branch 'fix/perception_coverage_empty_tests' into 'master'
[multiple] Added empty test to Perception pkgs that didn't have it GitOrigin-RevId: 74cc619d9a88f9334b59a3a1d482e83264529ffb
1 parent fa0f362 commit e3e00ff

File tree

16 files changed

+357
-240
lines changed

16 files changed

+357
-240
lines changed

grid_map_core/CMakeLists.txt

+42-35
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(grid_map_core)
44
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
55

66
## Find catkin macros and libraries
7-
find_package(catkin REQUIRED COMPONENTS)
7+
find_package(catkin REQUIRED)
88

99
## Define Eigen addons.
1010
include(cmake/${PROJECT_NAME}-extras.cmake)
@@ -105,39 +105,46 @@ install(
105105
#############
106106

107107
if(CATKIN_ENABLE_TESTING)
108-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
109-
## Add gtest based cpp test target and link libraries
110-
catkin_add_gtest(${PROJECT_NAME}-test
111-
test/test_grid_map_core.cpp
112-
test/test_helpers.cpp
113-
test/CubicConvolutionInterpolationTest.cpp
114-
test/CubicInterpolationTest.cpp
115-
test/GridMapMathTest.cpp
116-
test/GridMapTest.cpp
117-
test/GridMapIteratorTest.cpp
118-
test/LineIteratorTest.cpp
119-
test/EllipseIteratorTest.cpp
120-
test/SubmapIteratorTest.cpp
121-
test/PolygonIteratorTest.cpp
122-
test/PolygonTest.cpp
123-
test/EigenPluginsTest.cpp
124-
test/SpiralIteratorTest.cpp
125-
test/SlidingWindowIteratorTest.cpp
108+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
109+
find_package(catkin REQUIRED)
110+
111+
## Add gtest based cpp test target and link libraries
112+
catkin_add_gtest(${PROJECT_NAME}-test
113+
test/test_grid_map_core.cpp
114+
test/test_helpers.cpp
115+
test/CubicConvolutionInterpolationTest.cpp
116+
test/CubicInterpolationTest.cpp
117+
test/GridMapMathTest.cpp
118+
test/GridMapTest.cpp
119+
test/GridMapIteratorTest.cpp
120+
test/LineIteratorTest.cpp
121+
test/EllipseIteratorTest.cpp
122+
test/SubmapIteratorTest.cpp
123+
test/PolygonIteratorTest.cpp
124+
test/PolygonTest.cpp
125+
test/EigenPluginsTest.cpp
126+
test/SpiralIteratorTest.cpp
127+
test/SlidingWindowIteratorTest.cpp
126128
)
127-
endif()
128-
129-
if(TARGET ${PROJECT_NAME}-test)
130-
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
131-
endif()
132-
133-
###################
134-
## Code_coverage ##
135-
###################
136-
137-
find_package(cmake_code_coverage QUIET)
138-
if(cmake_code_coverage_FOUND)
139-
add_gtest_coverage(
140-
TEST_BUILD_TARGETS
141-
${PROJECT_NAME}-test
129+
target_include_directories(${PROJECT_NAME}-test
130+
PRIVATE
131+
include
132+
PUBLIC SYSTEM
133+
${catkin_INCLUDE_DIRS}
134+
${EIGEN3_INCLUDE_DIR}
135+
)
136+
target_link_libraries(${PROJECT_NAME}-test
137+
${PROJECT_NAME}
142138
)
143-
endif(cmake_code_coverage_FOUND)
139+
140+
###################
141+
## Code_coverage ##
142+
###################
143+
find_package(cmake_code_coverage QUIET)
144+
if(cmake_code_coverage_FOUND)
145+
add_gtest_coverage(
146+
TEST_BUILD_TARGETS
147+
${PROJECT_NAME}-test
148+
)
149+
endif()
150+
endif()

grid_map_costmap_2d/CMakeLists.txt

+35-22
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ project(grid_map_costmap_2d)
44
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
55

66
## Find catkin macros and libraries
7-
find_package(catkin REQUIRED COMPONENTS
8-
grid_map_core
9-
costmap_2d
10-
tf
7+
find_package(catkin REQUIRED
8+
COMPONENTS
9+
grid_map_core
10+
costmap_2d
11+
tf
1112
)
1213

1314
## System dependencies are found with CMake's conventions
@@ -62,27 +63,39 @@ install(
6263

6364
if(CATKIN_ENABLE_TESTING)
6465
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
66+
67+
find_package(catkin REQUIRED
68+
COMPONENTS
69+
grid_map_core
70+
costmap_2d
71+
tf
72+
)
73+
6574
## Add gtest based cpp test target and link libraries
66-
catkin_add_gtest(
67-
${PROJECT_NAME}-test
75+
catkin_add_gtest(${PROJECT_NAME}-test
6876
test/test_grid_map_costmap_2d.cpp
6977
test/Costmap2DConverterTest.cpp
7078
)
7179
add_subdirectory(rostest)
72-
endif()
73-
74-
if(TARGET ${PROJECT_NAME}-test)
75-
target_link_libraries(${PROJECT_NAME}-test ${catkin_LIBRARIES})
76-
endif()
77-
78-
###################
79-
## Code_coverage ##
80-
###################
81-
82-
find_package(cmake_code_coverage QUIET)
83-
if(cmake_code_coverage_FOUND)
84-
add_gtest_coverage(
85-
TEST_BUILD_TARGETS
86-
${PROJECT_NAME}-test
80+
target_include_directories(${PROJECT_NAME}-test
81+
PRIVATE
82+
include
83+
PUBLIC SYSTEM
84+
${catkin_INCLUDE_DIRS}
85+
${EIGEN3_INCLUDE_DIR}
8786
)
88-
endif(cmake_code_coverage_FOUND)
87+
target_link_libraries(${PROJECT_NAME}-test
88+
${catkin_LIBRARIES}
89+
)
90+
91+
###################
92+
## Code_coverage ##
93+
###################
94+
find_package(cmake_code_coverage QUIET)
95+
if(cmake_code_coverage_FOUND)
96+
add_gtest_coverage(
97+
TEST_BUILD_TARGETS
98+
${PROJECT_NAME}-test
99+
)
100+
endif()
101+
endif()

grid_map_cv/CMakeLists.txt

+35-20
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,41 @@ install(
9494
#############
9595

9696
if(CATKIN_ENABLE_TESTING)
97-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
98-
## Add gtest based cpp test target and link libraries
99-
catkin_add_gtest(${PROJECT_NAME}-test
100-
test/test_grid_map_cv.cpp
101-
test/GridMapCvTest.cpp
102-
test/GridMapCvProcessingTest.cpp)
103-
endif()
104-
105-
if(TARGET ${PROJECT_NAME}-test)
106-
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
107-
endif()
97+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
10898

109-
###################
110-
## Code_coverage ##
111-
###################
99+
find_package(catkin REQUIRED
100+
COMPONENTS
101+
grid_map_core
102+
cv_bridge
103+
filters
104+
)
112105

113-
find_package(cmake_code_coverage QUIET)
114-
if(cmake_code_coverage_FOUND)
115-
add_gtest_coverage(
116-
TEST_BUILD_TARGETS
117-
${PROJECT_NAME}-test
106+
## Add gtest based cpp test target and link libraries
107+
catkin_add_gtest(${PROJECT_NAME}-test
108+
test/test_grid_map_cv.cpp
109+
test/GridMapCvTest.cpp
110+
test/GridMapCvProcessingTest.cpp
111+
)
112+
target_include_directories(${PROJECT_NAME}-test
113+
PRIVATE
114+
include
115+
PUBLIC SYSTEM
116+
${catkin_INCLUDE_DIRS}
117+
${EIGEN3_INCLUDE_DIR}
118118
)
119-
endif(cmake_code_coverage_FOUND)
119+
target_link_libraries(${PROJECT_NAME}-test
120+
${PROJECT_NAME}
121+
)
122+
123+
###################
124+
## Code_coverage ##
125+
###################
126+
find_package(cmake_code_coverage QUIET)
127+
if(cmake_code_coverage_FOUND)
128+
add_gtest_coverage(
129+
TEST_BUILD_TARGETS
130+
${PROJECT_NAME}-test
131+
)
132+
endif()
133+
endif()
134+

grid_map_demos/CMakeLists.txt

+20-3
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,34 @@ install(
227227
## Test ##
228228
##############
229229
if(CATKIN_ENABLE_TESTING)
230+
find_package(catkin REQUIRED
231+
COMPONENTS
232+
roscpp
233+
grid_map_core
234+
grid_map_ros
235+
grid_map_cv
236+
grid_map_filters
237+
grid_map_loader
238+
grid_map_msgs
239+
grid_map_octomap
240+
grid_map_rviz_plugin
241+
grid_map_visualization
242+
geometry_msgs
243+
sensor_msgs
244+
cv_bridge
245+
octomap_msgs
246+
filters
247+
)
248+
230249
catkin_add_gtest(test_${PROJECT_NAME}
231250
test/empty_test.cpp
232251
)
233-
234252
target_include_directories(test_${PROJECT_NAME}
235253
PRIVATE
236254
include
237255
SYSTEM PUBLIC
238256
${catkin_INCLUDE_DIRS}
239257
)
240-
241258
target_link_libraries(test_${PROJECT_NAME}
242259
${catkin_LIBRARIES}
243260
gtest_main
@@ -252,5 +269,5 @@ if(CATKIN_ENABLE_TESTING)
252269
TEST_BUILD_TARGETS
253270
test_${PROJECT_NAME}
254271
)
255-
endif(cmake_code_coverage_FOUND)
272+
endif()
256273
endif()

grid_map_filters/CMakeLists.txt

+18-21
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,28 @@ install(
125125
if (CATKIN_ENABLE_TESTING)
126126
find_package(catkin REQUIRED)
127127

128-
include_directories(
129-
include
130-
SYSTEM
131-
${catkin_INCLUDE_DIRS}
132-
${TBB_INCLUDE_DIRS}
133-
)
134-
135128
catkin_add_gtest(${PROJECT_NAME}-test
136129
test/test_grid_map_filters.cpp
137130
)
138-
131+
target_include_directories(${PROJECT_NAME}-test
132+
PRIVATE
133+
include
134+
PUBLIC SYSTEM
135+
${catkin_INCLUDE_DIRS}
136+
${TBB_INCLUDE_DIRS}
137+
)
139138
target_link_libraries(${PROJECT_NAME}-test
140139
${PROJECT_NAME}
141140
)
142-
endif()
143141

144-
145-
###################
146-
## Code_coverage ##
147-
###################
148-
149-
find_package(cmake_code_coverage QUIET)
150-
if(cmake_code_coverage_FOUND)
151-
add_gtest_coverage(
152-
TEST_BUILD_TARGETS
153-
${PROJECT_NAME}-test
154-
)
155-
endif(cmake_code_coverage_FOUND)
142+
###################
143+
## Code_coverage ##
144+
###################
145+
find_package(cmake_code_coverage QUIET)
146+
if(cmake_code_coverage_FOUND)
147+
add_gtest_coverage(
148+
TEST_BUILD_TARGETS
149+
${PROJECT_NAME}-test
150+
)
151+
endif()
152+
endif()

grid_map_filters/test/empty_test.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <gtest/gtest.h>
2+
3+
TEST(Placeholder, emptyTest) { // NOLINT
4+
ASSERT_TRUE(true);
5+
}

grid_map_loader/CMakeLists.txt

+18-20
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,25 @@ install(
7474
if (CATKIN_ENABLE_TESTING)
7575
find_package(catkin REQUIRED)
7676

77-
include_directories(
78-
include
79-
SYSTEM
80-
${catkin_INCLUDE_DIRS}
81-
${EIGEN3_INCLUDE_DIRS}
82-
)
83-
8477
catkin_add_gtest(${PROJECT_NAME}-test
8578
test/test_grid_map_loader.cpp
8679
)
87-
endif()
88-
89-
90-
###################
91-
## Code_coverage ##
92-
###################
93-
94-
find_package(cmake_code_coverage QUIET)
95-
if(cmake_code_coverage_FOUND)
96-
add_gtest_coverage(
97-
TEST_BUILD_TARGETS
98-
${PROJECT_NAME}-test
80+
target_include_directories(${PROJECT_NAME}-test
81+
PRIVATE
82+
include
83+
PUBLIC SYSTEM
84+
${catkin_INCLUDE_DIRS}
85+
${EIGEN3_INCLUDE_DIRS}
9986
)
100-
endif(cmake_code_coverage_FOUND)
87+
88+
###################
89+
## Code_coverage ##
90+
###################
91+
find_package(cmake_code_coverage QUIET)
92+
if(cmake_code_coverage_FOUND)
93+
add_gtest_coverage(
94+
TEST_BUILD_TARGETS
95+
${PROJECT_NAME}-test
96+
)
97+
endif()
98+
endif()

grid_map_loader/test/empty_test.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <gtest/gtest.h>
2+
3+
TEST(Placeholder, emptyTest) { // NOLINT
4+
ASSERT_TRUE(true);
5+
}

0 commit comments

Comments
 (0)