diff --git a/rcl/test/CMakeLists.txt b/rcl/test/CMakeLists.txt index 7c774db..98fb856 100644 --- a/rcl/test/CMakeLists.txt +++ b/rcl/test/CMakeLists.txt @@ -60,21 +60,23 @@ function(test_target_function) AMENT_DEPENDENCIES ${rmw_implementation} ) + set(SKIP_TEST "") # TODO(wjwwood): remove this when the graph API works properly for FastRTPS if( rmw_implementation STREQUAL "rmw_connext_dynamic_cpp" OR rmw_implementation STREQUAL "rmw_fastrtps_cpp" ) message(STATUS "Skipping test_graph${target_suffix} test.") - else() - rcl_add_custom_gtest(test_graph${target_suffix} - SRCS rcl/test_graph.cpp - ENV ${extra_test_env} - APPEND_LIBRARY_DIRS ${extra_lib_dirs} - LIBRARIES ${PROJECT_NAME}${target_suffix} ${extra_test_libraries} - AMENT_DEPENDENCIES ${rmw_implementation} "example_interfaces" "std_msgs" - ) + set(SKIP_TEST "SKIP_TEST") endif() + rcl_add_custom_gtest(test_graph${target_suffix} + SRCS rcl/test_graph.cpp + ENV ${extra_test_env} + APPEND_LIBRARY_DIRS ${extra_lib_dirs} + LIBRARIES ${PROJECT_NAME}${target_suffix} ${extra_test_libraries} + AMENT_DEPENDENCIES ${rmw_implementation} "example_interfaces" "std_msgs" + ${SKIP_TEST} + ) rcl_add_custom_gtest(test_rcl${target_suffix} SRCS rcl/test_rcl.cpp diff --git a/rcl/test/rcl_add_custom_gtest.cmake b/rcl/test/rcl_add_custom_gtest.cmake index f460a3f..78c8c95 100644 --- a/rcl/test/rcl_add_custom_gtest.cmake +++ b/rcl/test/rcl_add_custom_gtest.cmake @@ -51,7 +51,7 @@ include(CMakeParseArguments) # macro(rcl_add_custom_gtest target) cmake_parse_arguments(_ARG - "TRACE" + "SKIP_TEST;TRACE" "" "SRCS;ENV;APPEND_ENV;APPEND_LIBRARY_DIRS;INCLUDE_DIRS;LIBRARIES;AMENT_DEPENDENCIES" ${ARGN}) @@ -67,9 +67,14 @@ macro(rcl_add_custom_gtest target) if(_ARG_APPEND_LIBRARY_DIRS) set(_ARG_APPEND_LIBRARY_DIRS "APPEND_LIBRARY_DIRS" ${_ARG_APPEND_LIBRARY_DIRS}) endif() + if(_ARG_SKIP_TEST) + set(_ARG_SKIP_TEST "SKIP_TEST") + else() + set(_ARG_SKIP_TEST "") + endif() # Pass args along to ament_add_gtest(). - ament_add_gtest(${target} ${_ARG_SRCS} ${_ARG_ENV} ${_ARG_APPEND_ENV} ${_ARG_APPEND_LIBRARY_DIRS}) + ament_add_gtest(${target} ${_ARG_SRCS} ${_ARG_ENV} ${_ARG_APPEND_ENV} ${_ARG_APPEND_LIBRARY_DIRS} ${_ARG_SKIP_TEST}) # Check if the target was actually created. if(TARGET ${target}) if(_ARG_TRACE)