Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NOCAPTURE option to ament_add_pytest_test #393

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Changes from all commits
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
10 changes: 9 additions & 1 deletion ament_cmake_pytest/cmake/ament_add_pytest_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# :param path: the path to a file or folder where ``pytest`` should be invoked
# on
# :type path: string
# :param NOCAPTURE: disable pytest output capturing.
# Sets the pytest option '-s'.
# :type NOCAPTURE: option
# :param SKIP_TEST: if set mark the test as being skipped
# :type SKIP_TEST: option
# :param PYTHON_EXECUTABLE: Python executable used to run the test.
Expand Down Expand Up @@ -48,7 +51,7 @@
#
function(ament_add_pytest_test testname path)
cmake_parse_arguments(ARG
"SKIP_TEST"
"NOCAPTURE;SKIP_TEST"
"PYTHON_EXECUTABLE;RUNNER;TIMEOUT;WERROR;WORKING_DIRECTORY"
"APPEND_ENV;APPEND_LIBRARY_DIRS;ENV"
${ARGN})
Expand Down Expand Up @@ -96,6 +99,11 @@ function(ament_add_pytest_test testname path)
"--junit-prefix=${PROJECT_NAME}"
)

if(ARG_NOCAPTURE)
# disable output capturing
list(APPEND cmd "-s")
endif()

if(ARG_WERROR)
# treat warnings as errors
list(APPEND cmd "-We")
Expand Down