File: WarnAboutNoTests.cmake

package info (click to toggle)
log4cplus 2.0.8-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,592 kB
  • sloc: cpp: 53,091; sh: 10,537; ansic: 1,845; python: 1,226; perl: 263; makefile: 209; xml: 85; objc: 59
file content (19 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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()