Merge branch 'one-tracetools-test-pytest-call' into 'master'

Call ament_add_pytest_test() only once for tracetools_test

See merge request micro-ROS/ros_tracing/ros2_tracing!165
This commit is contained in:
Christophe Bedard 2020-04-21 13:43:10 +00:00
commit 14776ec7e5

View file

@ -106,25 +106,10 @@ if(BUILD_TESTING)
endif() endif()
find_package(ament_cmake_pytest REQUIRED) find_package(ament_cmake_pytest REQUIRED)
# Run each test in its own pytest invocation ament_add_pytest_test(${PROJECT_NAME} test
set(_tracetools_test_pytest_tests APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}
test/test_intra.py
test/test_node.py
test/test_publisher.py
test/test_service.py
test/test_subscription.py
test/test_timer.py
)
foreach(_test_path ${_tracetools_test_pytest_tests})
get_filename_component(_test_name ${_test_path} NAME_WE)
ament_add_pytest_test(${_test_name} ${_test_path}
PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}"
APPEND_ENV AMENT_PREFIX_PATH=${ament_index_build_path}
PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}
TIMEOUT 60 TIMEOUT 60
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
)
endforeach()
endif() endif()
endif() endif()