cmake/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake

10 lines
247 B
CMake
Raw Normal View History

2020-08-30 11:54:41 +02:00
include("${COUNT_FILE}" OPTIONAL)
if(NOT COUNT)
set(COUNT 0)
endif()
math(EXPR COUNT "${COUNT} + 1")
file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
if(NOT COUNT EQUAL 2)
message(FATAL_ERROR "this test passes only on the 2nd run")
endif()