mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Fixup catch_discover_tests
Fixed its use of removed `--list-test-names-only` switch, and also updated the return code check to reflect changes in v3. Closes #1933
This commit is contained in:
parent
54882dbb11
commit
964303706a
@ -29,16 +29,11 @@ if(NOT EXISTS "${TEST_EXECUTABLE}")
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
|
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-tests --verbosity quiet
|
||||||
OUTPUT_VARIABLE output
|
OUTPUT_VARIABLE output
|
||||||
RESULT_VARIABLE result
|
RESULT_VARIABLE result
|
||||||
)
|
)
|
||||||
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
|
if(NOT ${result} EQUAL 0)
|
||||||
if(${result} EQUAL 0)
|
|
||||||
message(WARNING
|
|
||||||
"Test executable '${TEST_EXECUTABLE}' contains no tests!\n"
|
|
||||||
)
|
|
||||||
elseif(${result} LESS 0)
|
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"Error running test executable '${TEST_EXECUTABLE}':\n"
|
"Error running test executable '${TEST_EXECUTABLE}':\n"
|
||||||
" Result: ${result}\n"
|
" Result: ${result}\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user