Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ament_cmake_test/cmake/ament_add_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function(ament_add_test testname)
cmake_parse_arguments(ARG
"GENERATE_RESULT_FOR_RETURN_CODE_ZERO;SKIP_TEST"
"OUTPUT_FILE;RESULT_FILE;RUNNER;SKIP_RETURN_CODE;TIMEOUT;WORKING_DIRECTORY"
"APPEND_ENV;APPEND_LIBRARY_DIRS;COMMAND;ENV"
"APPEND_ENV;APPEND_LIBRARY_DIRS;COMMAND;ENV;ISOLATE_TEST"
Comment thread
adityapande-1995 marked this conversation as resolved.
Outdated
${ARGN})
if(ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "ament_add_test() called with unused arguments: "
Expand Down Expand Up @@ -84,8 +84,13 @@ function(ament_add_test testname)
endif()

get_executable_path(python_interpreter Python3::Interpreter BUILD)
if(ISOLATE_TEST AND UNIX)
set(isolate_test_prefix "{python_interpreter}" "-m" "linux_isolate_process")
else()
set(isolate_test_prefix "")
endif()
# wrap command with run_test script to ensure test result generation
set(cmd_wrapper "${python_interpreter}" "-u" "${ARG_RUNNER}"
set(cmd_wrapper "${isolate_test_prefix}" "${python_interpreter}" "-u" "${ARG_RUNNER}"
Comment thread
adityapande-1995 marked this conversation as resolved.
Outdated
"${ARG_RESULT_FILE}"
"--package-name" "${PROJECT_NAME}")
if(ARG_SKIP_TEST)
Expand Down
1 change: 1 addition & 0 deletions ament_cmake_test/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<buildtool_depend>ament_cmake_python</buildtool_depend>

<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>
<buildtool_export_depend>linux_isolate_process</buildtool_export_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down