test1.cmake 560 B

12345678910111213
  1. # This is run by test test1 in repeat-until-fail-cmake.cmake with cmake -P.
  2. # It reads the file TEST_OUTPUT_FILE and increments the number
  3. # found in the file by 1. When the number is 2, then the
  4. # code sends out a cmake error causing the test to fail
  5. # the second time it is run.
  6. message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}")
  7. file(READ "${TEST_OUTPUT_FILE}" COUNT)
  8. message("COUNT= ${COUNT}")
  9. math(EXPR COUNT "${COUNT} + 1")
  10. file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}")
  11. if(${COUNT} EQUAL 2)
  12. message(FATAL_ERROR "this test fails on the 2nd run")
  13. endif()