check.cmake 1.01 KB
Newer Older
1 2
if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
  include(${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
3 4 5
  if(RunCMake_TEST_FAILED)
    return()
  endif()
6 7 8
  foreach(exe IN LISTS check_exes)
    execute_process(COMMAND ${exe} RESULT_VARIABLE res)
    if(NOT res EQUAL ${check_step})
9
      string(APPEND RunCMake_TEST_FAILED "
10 11 12 13 14 15 16 17 18
 '${exe}' returned '${res}' but expected '${check_step}'
")
    endif()
  endforeach()
  foreach(p IN LISTS check_pairs)
    if("${p}" MATCHES "^(.*)\\|(.*)$")
      set(lhs "${CMAKE_MATCH_1}")
      set(rhs "${CMAKE_MATCH_2}")
      if(NOT EXISTS "${lhs}")
19
        string(APPEND RunCMake_TEST_FAILED "
20 21 22
 '${lhs}' missing
")
      elseif(NOT EXISTS "${rhs}")
23
        string(APPEND RunCMake_TEST_FAILED "
24 25 26
 '${rhs}' missing
")
      elseif(NOT "${lhs}" IS_NEWER_THAN "${rhs}")
27
        string(APPEND RunCMake_TEST_FAILED "
28 29 30 31 32 33 34 35 36 37
 '${lhs}' is not newer than '${rhs}'
")
      endif()
    endif()
  endforeach()
else()
  set(RunCMake_TEST_FAILED "
 '${RunCMake_TEST_BINARY_DIR}/check-debug.cmake' missing
")
endif()