EscapeCharsDisallowed.cmake 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. set(disallowed_chars
  2. a b c d e f g h i j l m o p q s u v w x y z
  3. A B C D E F G H I J L M N O P Q R S T U V W X Y Z
  4. 0 1 2 3 4 5 6 6 7 8 9)
  5. set(testnum 0)
  6. configure_file(
  7. "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
  8. "${RunCMake_BINARY_DIR}/CMakeLists.txt"
  9. COPYONLY)
  10. foreach (char IN LISTS disallowed_chars)
  11. configure_file(
  12. "${RunCMake_SOURCE_DIR}/EscapeChar-char.cmake.in"
  13. "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}.cmake"
  14. @ONLY)
  15. configure_file(
  16. "${RunCMake_SOURCE_DIR}/EscapeChar-char-stderr.txt.in"
  17. "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-stderr.txt"
  18. @ONLY)
  19. configure_file(
  20. "${RunCMake_SOURCE_DIR}/EscapeChar-char-result.txt"
  21. "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-result.txt"
  22. COPYONLY)
  23. math(EXPR testnum "${testnum} + 1")
  24. endforeach ()
  25. function (run_tests)
  26. set(GENERATED_RUNCMAKE_TESTS TRUE)
  27. # Find the tests in the binary directory.
  28. set(RunCMake_SOURCE_DIR "${RunCMake_BINARY_DIR}")
  29. set(testnum 0)
  30. foreach (char IN LISTS disallowed_chars)
  31. run_cmake("EscapeChar-${char}-${testnum}")
  32. math(EXPR testnum "${testnum} + 1")
  33. endforeach ()
  34. endfunction ()
  35. run_tests()