From 964303706a409848b64bad5380618f19ac4f3242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 19 May 2020 20:20:16 +0200 Subject: [PATCH] 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 --- extras/CatchAddTests.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake index 156d55ff..01c01386 100644 --- a/extras/CatchAddTests.cmake +++ b/extras/CatchAddTests.cmake @@ -29,16 +29,11 @@ if(NOT EXISTS "${TEST_EXECUTABLE}") ) endif() 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 RESULT_VARIABLE result ) -# Catch --list-test-names-only reports the number of tests, so 0 is... surprising -if(${result} EQUAL 0) - message(WARNING - "Test executable '${TEST_EXECUTABLE}' contains no tests!\n" - ) -elseif(${result} LESS 0) +if(NOT ${result} EQUAL 0) message(FATAL_ERROR "Error running test executable '${TEST_EXECUTABLE}':\n" " Result: ${result}\n"