From d74be321097093b994c9aed0bc2b54ad1276784d Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Tue, 22 Sep 2020 12:01:15 -0400 Subject: [PATCH] tests: Fix test override execution (#2512) --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 45e094b0..5dbc296a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -377,13 +377,13 @@ endif() # cmake 3.12 added list(transform prepend # but we can't use it yet -string(REPLACE "test_" "${CMAKE_CURRENT_BINARY_DIR}/test_" PYBIND11_BINARY_TEST_FILES +string(REPLACE "test_" "${CMAKE_CURRENT_SOURCE_DIR}/test_" PYBIND11_ABS_PYTEST_FILES "${PYBIND11_PYTEST_FILES}") # A single command to compile and run the tests add_custom_target( pytest - COMMAND ${PYTHON_EXECUTABLE} -m pytest ${PYBIND11_BINARY_PYTEST_FILES} + COMMAND ${PYTHON_EXECUTABLE} -m pytest ${PYBIND11_ABS_PYTEST_FILES} DEPENDS ${test_targets} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} USES_TERMINAL)