Add WORKING_DIRECTORY to CatchAddTests.cmake commands

This commit is contained in:
Rémy Salim 2020-10-01 11:23:14 +02:00 committed by Martin Hořeňovský
parent 7c75ecaef4
commit 44900d5371

View File

@ -36,6 +36,7 @@ execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
OUTPUT_VARIABLE output OUTPUT_VARIABLE output
RESULT_VARIABLE result RESULT_VARIABLE result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
) )
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising # Catch --list-test-names-only reports the number of tests, so 0 is... surprising
if(${result} EQUAL 0) if(${result} EQUAL 0)
@ -57,6 +58,7 @@ execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-reporters COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-reporters
OUTPUT_VARIABLE reporters_output OUTPUT_VARIABLE reporters_output
RESULT_VARIABLE reporters_result RESULT_VARIABLE reporters_result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
) )
if(${reporters_result} EQUAL 0) if(${reporters_result} EQUAL 0)
message(WARNING message(WARNING