Skip to content

Commit 5d05613

Browse files
authored
[launch_testing_ament_cmake] Add test label (#584)
* Add test label Signed-off-by: Keisuke Shima <[email protected]> * Add launch_test_arguments Signed-off-by: Keisuke Shima <[email protected]>
1 parent 8006dfa commit 5d05613

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

launch_testing_ament_cmake/cmake/add_launch_test.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ macro(parse_launch_test_arguments namespace filename)
5252
cmake_parse_arguments(${namespace}
5353
""
5454
"TARGET;TIMEOUT;PYTHON_EXECUTABLE"
55-
"ARGS"
55+
"ARGS;LABELS"
5656
${ARGN})
5757

5858
if(NOT ${namespace}_TIMEOUT)
@@ -89,6 +89,10 @@ macro(parse_launch_test_arguments namespace filename)
8989
string(REPLACE "/" "_" ${namespace}_TARGET ${${namespace}_TARGET})
9090
endif()
9191

92+
if(NOT ${namespace}_LABELS)
93+
set(${namespace}_LABELS "launch_test")
94+
endif()
95+
9296
set(${namespace}_RESULT_FILE "${AMENT_TEST_RESULTS_DIR}/${PROJECT_NAME}/${${namespace}_TARGET}.xunit.xml")
9397
endmacro()
9498

@@ -104,6 +108,8 @@ endmacro()
104108
# :type PYTHON_EXECUTABLE: string
105109
# :param TIMEOUT: The test timeout in seconds
106110
# :type TIMEOUT: integer
111+
# :param LABELS: The test labels
112+
# :type LABELS: string
107113
# :param ARGS: Launch arguments to pass to the launch test
108114
# :type ARGS: string
109115
function(add_launch_test filename)
@@ -130,6 +136,11 @@ function(add_launch_test filename)
130136
TIMEOUT "${_launch_test_TIMEOUT}"
131137
${_launch_test_UNPARSED_ARGUMENTS}
132138
)
139+
set_tests_properties(
140+
"${_launch_test_TARGET}"
141+
PROPERTIES
142+
LABELS "${_launch_test_LABELS}"
143+
)
133144
endfunction()
134145

135146
macro(rostest__strip_prefix var prefix)

0 commit comments

Comments
 (0)