Skip to content

Commit

Permalink
Run tests in current binary directory, not global source directory (#206
Browse files Browse the repository at this point in the history
)

Switch to CMAKE_CURRENT_BINARY_DIR for consistency with CTest

Signed-off-by: Dan Rose <dan@digilabs.io>
  • Loading branch information
rotu authored and dirk-thomas committed Nov 22, 2019
1 parent 6897b0a commit 83e1b81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ament_cmake_test/cmake/ament_add_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
# :param TIMEOUT: the test timeout in seconds, default: 60
# :type TIMEOUT: integer
# :param WORKING_DIRECTORY: the working directory for invoking the
# command in, default: CMAKE_SOURCE_DIR
# command in, default: CMAKE_CURRENT_BINARY_DIR
# :type WORKING_DIRECTORY: string
# :param GENERATE_RESULT_FOR_RETURN_CODE_ZERO: generate a test result
# file when the command invocation returns with code zero
# command in, default: CMAKE_SOURCE_DIR
# command in, default: FALSE
# :type GENERATE_RESULT_FOR_RETURN_CODE_ZERO: option
# :param SKIP_TEST: if set mark the test as being skipped
# :type SKIP_TEST: option
Expand Down Expand Up @@ -77,7 +77,7 @@ function(ament_add_test testname)
"valid number and greater than zero")
endif()
if(NOT ARG_WORKING_DIRECTORY)
set(ARG_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
set(ARG_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()

# wrap command with run_test script to ensure test result generation
Expand Down

0 comments on commit 83e1b81

Please sign in to comment.