Skip to content

Commit

Permalink
Reduce the number of tests we run (#1096)
Browse files Browse the repository at this point in the history
* Don't run test_arguments for all RMWs.

There is absolutely no calls to the RMW layer in that
code, so there is no need to run it more than once.

This should help to slightly speed up rcl tests.

* Don't run test_time for all RMWs.

The APIs here never hit the RMW layer at all, so there
is no reason to run these tests more than once.

This should help to speed up rcl tests.

* Don't run test_lexer for all RMWs.

This code never hits the RMW layer, so there is no reason
to run it more than once.

This will help speed up RCL test times.

* Don't run test_lexer_lookahead for all RMWs.

This code never hits the RMW layer, so there is no reason
to run it for all of the RMWs.

This will help to speed up RCL test times.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Aug 25, 2023
1 parent f11fcaa commit 7fb6da3
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 192 deletions.
11 changes: 0 additions & 11 deletions rcl/src/rcl/arguments.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@
#include "rcutils/logging.h"
#include "rcutils/logging_macros.h"
#include "rcutils/strdup.h"
#include "rmw/validate_namespace.h"
#include "rmw/validate_node_name.h"

#ifdef __cplusplus
extern "C"
{
#endif

/// Parse an argument that may or may not be a remap rule.
/**
Expand Down Expand Up @@ -2072,8 +2065,4 @@ _rcl_allocate_initialized_arguments_impl(rcl_arguments_t * args, rcl_allocator_t
return RCL_RET_OK;
}

#ifdef __cplusplus
}
#endif

/// \endcond // Internal Doxygen documentation
61 changes: 28 additions & 33 deletions rcl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ function(test_target_function)
AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp" "test_msgs"
)

rcl_add_custom_gtest(test_time${target_suffix}
SRCS rcl/test_time.cpp
ENV ${rmw_implementation_env_var} ${memory_tools_ld_preload_env_var}
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
LIBRARIES ${PROJECT_NAME} osrf_testing_tools_cpp::memory_tools
AMENT_DEPENDENCIES ${rmw_implementation}
)

rcl_add_custom_gtest(test_timer${target_suffix}
SRCS rcl/test_timer.cpp
ENV ${rmw_implementation_env_var}
Expand All @@ -94,22 +86,6 @@ function(test_target_function)
AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp"
)

rcl_add_custom_gtest(test_lexer${target_suffix}
SRCS rcl/test_lexer.cpp
ENV ${rmw_implementation_env_var}
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
LIBRARIES ${PROJECT_NAME}
AMENT_DEPENDENCIES ${rmw_implementation}
)

rcl_add_custom_gtest(test_lexer_lookahead${target_suffix}
SRCS rcl/test_lexer_lookahead.cpp
ENV ${rmw_implementation_env_var}
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
LIBRARIES ${PROJECT_NAME}
AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp"
)

rcl_add_custom_gtest(test_graph${target_suffix}
SRCS rcl/test_graph.cpp
ENV ${rmw_implementation_env_var}
Expand Down Expand Up @@ -170,15 +146,6 @@ function(test_target_function)
TIMEOUT 240 # Large timeout to wait for fault injection tests
)

rcl_add_custom_gtest(test_arguments${target_suffix}
SRCS rcl/test_arguments.cpp
ENV ${rmw_implementation_env_var}
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../src/rcl/
LIBRARIES ${PROJECT_NAME} osrf_testing_tools_cpp::memory_tools
AMENT_DEPENDENCIES "osrf_testing_tools_cpp" "rcpputils"
)

rcl_add_custom_gtest(test_remap${target_suffix}
SRCS rcl/test_remap.cpp
ENV ${rmw_implementation_env_var}
Expand Down Expand Up @@ -422,6 +389,34 @@ target_link_libraries(wait_for_entity_helpers PRIVATE

call_for_each_rmw_implementation(test_target)

rcl_add_custom_gtest(test_arguments
SRCS rcl/test_arguments.cpp
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../src/rcl/
LIBRARIES ${PROJECT_NAME} osrf_testing_tools_cpp::memory_tools
AMENT_DEPENDENCIES "osrf_testing_tools_cpp" "rcpputils"
)

rcl_add_custom_gtest(test_time
SRCS rcl/test_time.cpp
ENV ${memory_tools_ld_preload_env_var}
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
LIBRARIES ${PROJECT_NAME} osrf_testing_tools_cpp::memory_tools
)

rcl_add_custom_gtest(test_lexer
SRCS rcl/test_lexer.cpp
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
LIBRARIES ${PROJECT_NAME}
)

rcl_add_custom_gtest(test_lexer_lookahead
SRCS rcl/test_lexer_lookahead.cpp
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
LIBRARIES ${PROJECT_NAME}
AMENT_DEPENDENCIES "osrf_testing_tools_cpp"
)

rcl_add_custom_gtest(test_validate_enclave_name
SRCS rcl/test_validate_enclave_name.cpp
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
Expand Down
Loading

0 comments on commit 7fb6da3

Please sign in to comment.