mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 13:25:41 +02:00
Exit with non-0 return code if no tests were run
A new flag, `--allow-running-no-tests` was added to override this behaviour if exit code of 0 was desired. This change also made `-w NoTests` obsolete, and so it has been removed.
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
# Workaround for a peculiarity where CTest disregards the return code from a
|
||||
# test command if a PASS_REGULAR_EXPRESSION is also set
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_ARGV3} -w NoTests "___nonexistent_test___"
|
||||
RESULT_VARIABLE ret
|
||||
OUTPUT_VARIABLE out
|
||||
)
|
||||
|
||||
message("${out}")
|
||||
|
||||
if(NOT ${ret} MATCHES "^[0-9]+$")
|
||||
message(FATAL_ERROR "${ret}")
|
||||
endif()
|
||||
|
||||
if(${ret} EQUAL 0)
|
||||
message(FATAL_ERROR "Expected nonzero return code")
|
||||
elseif(${out} MATCHES "Helper failed with")
|
||||
message(FATAL_ERROR "Helper failed")
|
||||
endif()
|
Reference in New Issue
Block a user