1
0

WhileTest.cmake.in 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. set(NUMBERS "")
  2. set(COUNT 0)
  3. include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake")
  4. REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
  5. while(COUNT LESS 200)
  6. set(NUMBERS "${NUMBERS} ${COUNT}")
  7. set(COUNT "2${COUNT}")
  8. set(NCOUNT 3)
  9. while(NCOUNT LESS 31)
  10. set(NUMBERS "${NUMBERS} ${NCOUNT}")
  11. set(NCOUNT "${NCOUNT}0")
  12. endwhile()
  13. endwhile()
  14. if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30")
  15. message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'")
  16. endif()
  17. set(Missing-Argument-RESULT 1)
  18. set(Missing-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Argument.cmake:1 \\(while\\):.*while called with incorrect number of arguments.*")
  19. include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
  20. check_cmake_test(While
  21. Missing-Argument
  22. )
  23. set(Missing-Endwhile-RESULT 1)
  24. set(Missing-Endwhile-STDERR ".*CMake Error in (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Endwhile.cmake:.*A logical block opening on the line.*(${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Endwhile.cmake:1 \\(while\\).*is not closed\\..*")
  25. check_cmake_test(While
  26. Missing-Endwhile
  27. )
  28. set(Endwhile-Mismatch-RESULT 0)
  29. set(Endwhile-Mismatch-STDERR ".*CMake Warning \\(dev\\) in (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Mismatch.cmake:.*A logical block opening on the line.*(${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Mismatch.cmake:1 \\(while\\).*with mis-matching arguments\\..*")
  30. check_cmake_test(While
  31. Endwhile-Mismatch
  32. )
  33. set(Endwhile-Alone-RESULT 1)
  34. set(Endwhile-Alone-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Alone.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\.\n.*$")
  35. check_cmake_test(While
  36. Endwhile-Alone
  37. )
  38. set(Endwhile-Alone-Args-RESULT 1)
  39. set(Endwhile-Alone-Args-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Alone-Args.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\. Or its arguments did not.*$")
  40. check_cmake_test(While
  41. Endwhile-Alone-Args
  42. )