Call ament_add_pytest_test() only once for tracetools_test

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
Christophe Bedard 2020-04-02 11:25:51 -04:00
parent c3ea84b4b9
commit 49a75500bc

View file

@ -106,25 +106,10 @@ if(BUILD_TESTING)
endif()
find_package(ament_cmake_pytest REQUIRED)
# Run each test in its own pytest invocation
set(_tracetools_test_pytest_tests
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}
ament_add_pytest_test(${PROJECT_NAME} test
APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}
TIMEOUT 60
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endforeach()
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()
endif()