Skip to content

Commit

Permalink
feat: isolate gtests in all packages
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime CLEMENT <[email protected]>
  • Loading branch information
maxime-clem committed May 9, 2022
1 parent 391ebac commit fdbe534
Show file tree
Hide file tree
Showing 55 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion common/autoware_auto_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})

if(BUILD_TESTING)
set(TEST_COMMON test_common_gtest)
ament_add_gtest(${TEST_COMMON}
ament_add_ros_isolated_gtest(${TEST_COMMON}
test/gtest_main.cpp
test/test_bool_comparisons.cpp
test/test_byte_reader.cpp
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<depend>builtin_interfaces</depend>
<depend>eigen</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>geometry_msgs</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(BUILD_TESTING)
test/src/test_common_2d.cpp
test/src/test_intersection.cpp
)
ament_add_gtest(${GEOMETRY_GTEST} ${GEOMETRY_SRC})
ament_add_ros_isolated_gtest(${GEOMETRY_GTEST} ${GEOMETRY_SRC})
target_compile_options(${GEOMETRY_GTEST} PRIVATE -Wno-conversion -Wno-sign-conversion)
target_include_directories(${GEOMETRY_GTEST} PRIVATE "test/include" "include")
ament_target_dependencies(${GEOMETRY_GTEST}
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_geometry/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<depend>autoware_auto_vehicle_msgs</depend>
<depend>geometry_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>osrf_testing_tools_cpp</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_tf2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(autoware_cmake REQUIRED)
autoware_package()

if(BUILD_TESTING)
ament_add_gtest(test_tf2_autoware_auto_msgs test/test_tf2_autoware_auto_msgs.cpp)
ament_add_ros_isolated_gtest(test_tf2_autoware_auto_msgs test/test_tf2_autoware_auto_msgs.cpp)
target_include_directories(test_tf2_autoware_auto_msgs PRIVATE "include")
ament_target_dependencies(test_tf2_autoware_auto_msgs
"autoware_auto_common"
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_tf2/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<depend>tf2_geometry_msgs</depend>
<depend>tf2_ros</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion common/autoware_point_types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include_directories(
)

if(BUILD_TESTING)
ament_add_gtest(test_autoware_point_types
ament_add_ros_isolated_gtest(test_autoware_point_types
test/test_point_types.cpp
)
target_include_directories(test_autoware_point_types
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_point_types/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<depend>pcl_ros</depend>
<depend>point_cloud_msg_wrapper</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>point_cloud_msg_wrapper</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion common/fake_test_node/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ autoware_package()
ament_auto_add_library(fake_test_node SHARED src/fake_test_node.cpp)

if(BUILD_TESTING)
ament_add_gtest(test_fake_test_node
ament_add_ros_isolated_gtest(test_fake_test_node
test/test_fake_test_node.cpp
)
add_dependencies(test_fake_test_node fake_test_node)
Expand Down
2 changes: 1 addition & 1 deletion common/fake_test_node/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<build_depend>autoware_cmake</build_depend>

<depend>ament_cmake_gtest</depend>
<depend>ament_cmake_ros</depend>
<depend>autoware_auto_common</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
Expand Down
2 changes: 1 addition & 1 deletion common/had_map_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<depend>lanelet2_io</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion common/interpolation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ament_auto_add_library(interpolation SHARED
if(BUILD_TESTING)
file(GLOB_RECURSE test_files test/**/*.cpp)

ament_add_gtest(test_interpolation ${test_files})
ament_add_ros_isolated_gtest(test_interpolation ${test_files})

target_link_libraries(test_interpolation
interpolation
Expand Down
2 changes: 1 addition & 1 deletion common/interpolation/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<depend>tier4_autoware_utils</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion common/motion_testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ autoware_package()
ament_auto_add_library(${PROJECT_NAME} SHARED src/motion_testing/motion_testing.cpp)

if(BUILD_TESTING)
ament_add_gtest(motion_testing_unit_tests
ament_add_ros_isolated_gtest(motion_testing_unit_tests
test/gtest_main.cpp
test/constant_trajectory.cpp
test/trajectory_checks.cpp)
Expand Down
2 changes: 1 addition & 1 deletion common/motion_testing/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<build_export_depend>autoware_auto_planning_msgs</build_export_depend>
<build_export_depend>autoware_auto_vehicle_msgs</build_export_depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion common/osqp_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(BUILD_TESTING)
test/test_csc_matrix_conv.cpp
)
set(TEST_OSQP_INTERFACE_EXE test_osqp_interface)
ament_add_gtest(${TEST_OSQP_INTERFACE_EXE} ${TEST_SOURCES})
ament_add_ros_isolated_gtest(${TEST_OSQP_INTERFACE_EXE} ${TEST_SOURCES})
target_link_libraries(${TEST_OSQP_INTERFACE_EXE} ${PROJECT_NAME})
endif()

Expand Down
2 changes: 1 addition & 1 deletion common/osqp_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>eigen</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion common/signal_processing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ament_auto_add_library(lowpass_filter_1d SHARED
)

if(BUILD_TESTING)
ament_add_gtest(test_signal_processing
ament_add_ros_isolated_gtest(test_signal_processing
test/src/lowpass_filter_1d_test.cpp
)
target_link_libraries(test_signal_processing
Expand Down
2 changes: 1 addition & 1 deletion common/signal_processing/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion common/tier4_api_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ autoware_package()

if(BUILD_TESTING)
include_directories(include)
ament_add_gtest(${PROJECT_NAME}_test test/test.cpp)
ament_add_ros_isolated_gtest(${PROJECT_NAME}_test test/test.cpp)
ament_target_dependencies(${PROJECT_NAME}_test rclcpp tier4_external_api_msgs)
endif()

Expand Down
2 changes: 1 addition & 1 deletion common/tier4_api_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<depend>rclcpp</depend>
<depend>tier4_external_api_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>rclcpp</test_depend>
Expand Down
4 changes: 2 additions & 2 deletions common/tier4_autoware_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ ament_auto_add_library(tier4_autoware_utils SHARED
)

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_cmake_ros REQUIRED)

file(GLOB_RECURSE test_files test/**/*.cpp)

ament_add_gtest(test_tier4_autoware_utils ${test_files})
ament_add_ros_isolated_gtest(test_tier4_autoware_utils ${test_files})

target_link_libraries(test_tier4_autoware_utils
tier4_autoware_utils
Expand Down
2 changes: 1 addition & 1 deletion common/tier4_autoware_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<depend>tier4_debug_msgs</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion common/time_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<build_depend>autoware_cmake</build_depend>
<build_depend>builtin_interfaces</build_depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion common/vehicle_constants_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
# if(BUILD_TESTING)
# set(TEST_SOURCES test/test_vehicle_constants_manager.cpp)
# set(TEST_VEHICLE_CONSTANTS_MANAGER_EXE test_vehicle_constants_manager)
# ament_add_gtest(${TEST_VEHICLE_CONSTANTS_MANAGER_EXE} ${TEST_SOURCES})
# ament_add_ros_isolated_gtest(${TEST_VEHICLE_CONSTANTS_MANAGER_EXE} ${TEST_SOURCES})
# target_link_libraries(${TEST_VEHICLE_CONSTANTS_MANAGER_EXE} ${PROJECT_NAME})
# endif()

Expand Down
2 changes: 1 addition & 1 deletion common/vehicle_constants_manager/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
4 changes: 2 additions & 2 deletions control/trajectory_follower/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if(BUILD_TESTING)
test/test_lowpass_filter.cpp
)
set(TEST_LATERAL_CONTROLLER_EXE test_lateral_controller)
ament_add_gtest(${TEST_LATERAL_CONTROLLER_EXE} ${TEST_LAT_SOURCES})
ament_add_ros_isolated_gtest(${TEST_LATERAL_CONTROLLER_EXE} ${TEST_LAT_SOURCES})
target_link_libraries(${TEST_LATERAL_CONTROLLER_EXE} ${LATERAL_CONTROLLER_LIB})

set(TEST_LON_SOURCES
Expand All @@ -82,7 +82,7 @@ if(BUILD_TESTING)
test/test_longitudinal_controller_utils.cpp
)
set(TEST_LONGITUDINAL_CONTROLLER_EXE test_longitudinal_controller)
ament_add_gtest(${TEST_LONGITUDINAL_CONTROLLER_EXE} ${TEST_LON_SOURCES})
ament_add_ros_isolated_gtest(${TEST_LONGITUDINAL_CONTROLLER_EXE} ${TEST_LON_SOURCES})
target_link_libraries(${TEST_LONGITUDINAL_CONTROLLER_EXE} ${LONGITUDINAL_CONTROLLER_LIB})
endif()

Expand Down
2 changes: 1 addition & 1 deletion control/trajectory_follower/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<depend>tf2</depend>
<depend>tf2_ros</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>eigen</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion control/vehicle_cmd_gate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rclcpp_components_register_node(vehicle_cmd_gate_node
)

if(BUILD_TESTING)
ament_add_gtest(test_vehicle_cmd_gate
ament_add_ros_isolated_gtest(test_vehicle_cmd_gate
test/src/test_main.cpp
test/src/test_vehicle_cmd_filter.cpp
)
Expand Down
2 changes: 1 addition & 1 deletion control/vehicle_cmd_gate/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<depend>tier4_vehicle_msgs</depend>
<depend>vehicle_info_util</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
4 changes: 2 additions & 2 deletions localization/ekf_localizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ament_auto_add_executable(ekf_localizer
ament_target_dependencies(ekf_localizer kalman_filter)

# if(BUILD_TESTING)
# find_package(ament_cmake_gtest REQUIRED)
# ament_add_gtest(ekf_localizer-test test/test_ekf_localizer.test
# find_package(ament_cmake_ros REQUIRED)
# ament_add_ros_isolated_gtest(ekf_localizer-test test/test_ekf_localizer.test
# test/src/test_ekf_localizer.cpp
# src/ekf_localizer.cpp
# src/kalman_filter/kalman_filter.cpp
Expand Down
2 changes: 1 addition & 1 deletion localization/ekf_localizer/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<depend>tier4_autoware_utils</depend>
<depend>tier4_debug_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion localization/stop_filter/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<depend>tf2</depend>
<depend>tier4_debug_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
10 changes: 5 additions & 5 deletions map/lanelet2_extension/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ target_link_libraries(autoware_lanelet2_validation
)

if(BUILD_TESTING)
ament_add_gtest(message_conversion-test test/src/test_message_conversion.cpp)
ament_add_ros_isolated_gtest(message_conversion-test test/src/test_message_conversion.cpp)
target_link_libraries(message_conversion-test lanelet2_extension_lib)
ament_add_gtest(projector-test test/src/test_projector.cpp)
ament_add_ros_isolated_gtest(projector-test test/src/test_projector.cpp)
target_link_libraries(projector-test lanelet2_extension_lib)
ament_add_gtest(query-test test/src/test_query.cpp)
ament_add_ros_isolated_gtest(query-test test/src/test_query.cpp)
target_link_libraries(query-test lanelet2_extension_lib)
ament_add_gtest(regulatory_elements-test test/src/test_regulatory_elements.cpp)
ament_add_ros_isolated_gtest(regulatory_elements-test test/src/test_regulatory_elements.cpp)
target_link_libraries(regulatory_elements-test lanelet2_extension_lib)
ament_add_gtest(utilities-test test/src/test_utilities.cpp)
ament_add_ros_isolated_gtest(utilities-test test/src/test_utilities.cpp)
target_link_libraries(utilities-test lanelet2_extension_lib)
endif()

Expand Down
2 changes: 1 addition & 1 deletion map/lanelet2_extension/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<depend>tier4_autoware_utils</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion perception/detected_object_feature_remover/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<depend>rclcpp_components</depend>
<depend>tier4_perception_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
4 changes: 2 additions & 2 deletions planning/behavior_velocity_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ rclcpp_components_register_node(behavior_velocity_planner

if(BUILD_TESTING)
# Gtest for utilization
ament_add_gtest(utilization-test
ament_add_ros_isolated_gtest(utilization-test
test/src/test_state_machine.cpp
test/src/test_arc_lane_util.cpp
test/src/test_utilization.cpp
Expand All @@ -67,7 +67,7 @@ if(BUILD_TESTING)
)

# Gtest for occlusion spot
ament_add_gtest(occlusion_spot-test
ament_add_ros_isolated_gtest(occlusion_spot-test
test/src/test_occlusion_spot_utils.cpp
test/src/test_risk_predictive_braking.cpp
test/src/test_grid_utils.cpp
Expand Down
2 changes: 1 addition & 1 deletion planning/behavior_velocity_planner/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<depend>vehicle_info_util</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion planning/costmap_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ rclcpp_components_register_node(costmap_generator_node
)

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_cmake_ros REQUIRED)
endif()

ament_auto_package(INSTALL_TO_SHARE launch)
2 changes: 1 addition & 1 deletion planning/costmap_generator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<depend>tf2_ros</depend>
<depend>tier4_planning_msgs</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
Loading

0 comments on commit fdbe534

Please sign in to comment.