WhileTest.cmake.in 1.9 KB

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