Skip to content

Commit

Permalink
Run relevant test_tracetools tests with all instrumented rmw impls
Browse files Browse the repository at this point in the history
This is equivalent to #116 but for Iron.

Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
  • Loading branch information
christophebedard committed Aug 22, 2024
1 parent b723505 commit 8337476
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions test_tracetools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ if(BUILD_TESTING)
# Only run tracing tests if instrumentation and tracepoints are included
if(NOT TRACETOOLS_TRACEPOINTS_EXCLUDED)
find_package(ament_cmake_pytest REQUIRED)
find_package(rmw_implementation_cmake REQUIRED)

# Tests to run with the default rmw implementation, which should not matter
set(_test_tracetools_pytest_tests
test/test_buffer.py
test/test_executor.py
test/test_intra.py
test/test_intra_pub_sub.py
test/test_lifecycle_node.py
test/test_node.py
test/test_pub_sub.py
test/test_publisher.py
test/test_service.py
test/test_subscription.py
test/test_timer.py
)
foreach(_test_path ${_test_tracetools_pytest_tests})
Expand All @@ -154,6 +154,34 @@ if(BUILD_TESTING)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endforeach()

# Tests to run with all instrumented/supported rmw implementations
set(_test_tracetools_pytest_tests_multi_rmw
test/test_pub_sub.py
test/test_publisher.py
test/test_subscription.py
)
set(_test_tracetools_rmw_implementations
rmw_cyclonedds_cpp
rmw_fastrtps_cpp
)
get_available_rmw_implementations(rmw_implementations)
foreach(_test_path ${_test_tracetools_pytest_tests_multi_rmw})
get_filename_component(_test_name ${_test_path} NAME_WE)
foreach(rmw_implementation ${_test_tracetools_rmw_implementations})
if(rmw_implementation IN_LIST rmw_implementations)
ament_add_pytest_test(${_test_name}__${rmw_implementation} ${_test_path}
ENV RMW_IMPLEMENTATION=${rmw_implementation}
APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}
TIMEOUT 60
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
else()
message(
"rmw implementation '${rmw_implementation}' not available for test '${_test_name}'")
endif()
endforeach()
endforeach()
endif()
endif()

Expand Down

0 comments on commit 8337476

Please sign in to comment.