StringTest.cmake.in 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. set(MD5-BadArg1-RESULT 1)
  2. set(MD5-BadArg1-STDERR "string MD5 requires an output variable")
  3. set(MD5-BadArg2-RESULT 1)
  4. set(MD5-BadArg2-STDERR "string MD5 requires an output variable and an input string")
  5. set(MD5-BadArg4-RESULT 1)
  6. set(MD5-BadArg4-STDERR "string MD5 requires an output variable and an input string")
  7. set(MD5-Works-RESULT 0)
  8. set(MD5-Works-STDERR "10d20ddb981a6202b84aa1ce1cb7fce3")
  9. set(SHA1-Works-RESULT 0)
  10. set(SHA1-Works-STDERR "83f093e04289b21a9415f408ad50be8b57ad2f34")
  11. set(SHA224-Works-RESULT 0)
  12. set(SHA224-Works-STDERR "e995a7789922c4ef9279d94e763c8375934180a51baa7147bc48edf7")
  13. set(SHA256-Works-RESULT 0)
  14. set(SHA256-Works-STDERR "d1c5915d8b71150726a1eef75a29ec6bea8fd1bef6b7299ef8048760b0402025")
  15. set(SHA384-Works-RESULT 0)
  16. set(SHA384-Works-STDERR "1de9560b4e030e02051ea408200ffc55d70c97ac64ebf822461a5c786f495c36df43259b14483bc8d364f0106f4971ee")
  17. set(SHA512-Works-RESULT 0)
  18. set(SHA512-Works-STDERR "3982a1b4e651768bec70ab1fb97045cb7a659f4ba7203d501c52ab2e803071f9d5fd272022df15f27727fc67f8cd022e710e29010b2a9c0b467c111e2f6abf51")
  19. set(TIMESTAMP-BadArg1-RESULT 1)
  20. set(TIMESTAMP-BadArg1-STDERR "string sub-command TIMESTAMP requires at least one argument")
  21. set(TIMESTAMP-BadArg2-RESULT 1)
  22. set(TIMESTAMP-BadArg2-STDERR "string TIMESTAMP sub-command does not recognize option UTF")
  23. set(TIMESTAMP-BadArg3-RESULT 1)
  24. set(TIMESTAMP-BadArg3-STDERR "string sub-command TIMESTAMP takes at most three arguments")
  25. set(TIMESTAMP-DefaultFormatLocal-RESULT 0)
  26. set(TIMESTAMP-DefaultFormatLocal-STDERR "~[0-9]*-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]~")
  27. set(TIMESTAMP-DefaultFormatUTC-RESULT 0)
  28. set(TIMESTAMP-DefaultFormatUTC-STDERR "~[0-9]*-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]Z~")
  29. set(TIMESTAMP-CustomFormatLocal-RESULT 0)
  30. set(TIMESTAMP-CustomFormatLocal-STDERR "~([0-5][0-9])|60~")
  31. set(TIMESTAMP-CustomFormatUTC-RESULT 0)
  32. set(TIMESTAMP-CustomFormatUTC-STDERR "~([0-5][0-9])|60~")
  33. set(TIMESTAMP-UnknownSpecifier-RESULT 0)
  34. set(TIMESTAMP-UnknownSpecifier-STDERR "~%g~")
  35. set(TIMESTAMP-IncompleteSpecifier-RESULT 0)
  36. set(TIMESTAMP-IncompleteSpecifier-STDERR "~foobar%~")
  37. set(TIMESTAMP-AllSpecifiers-RESULT 0)
  38. set(TIMESTAMP-AllSpecifiers-STDERR "~[0-9]+(;[0-9]+)*~")
  39. include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
  40. check_cmake_test(String
  41. MD5-BadArg1
  42. MD5-BadArg2
  43. MD5-BadArg4
  44. MD5-Works
  45. SHA1-Works
  46. SHA224-Works
  47. SHA256-Works
  48. SHA384-Works
  49. SHA512-Works
  50. TIMESTAMP-BadArg1
  51. TIMESTAMP-BadArg2
  52. TIMESTAMP-BadArg3
  53. TIMESTAMP-DefaultFormatLocal
  54. TIMESTAMP-DefaultFormatUTC
  55. TIMESTAMP-CustomFormatLocal
  56. TIMESTAMP-CustomFormatUTC
  57. TIMESTAMP-UnknownSpecifier
  58. TIMESTAMP-IncompleteSpecifier
  59. TIMESTAMP-AllSpecifiers
  60. )
  61. # Execute each test listed in StringTestScript.cmake:
  62. #
  63. set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake")
  64. set(number_of_tests_expected 69)
  65. include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake")
  66. execute_all_script_tests(${scriptname} number_of_tests_executed)
  67. # And verify that number_of_tests_executed is at least as many as we know
  68. # about as of this writing...
  69. #
  70. message(STATUS "scriptname='${scriptname}'")
  71. message(STATUS "number_of_tests_executed='${number_of_tests_executed}'")
  72. message(STATUS "number_of_tests_expected='${number_of_tests_expected}'")
  73. if(number_of_tests_executed LESS number_of_tests_expected)
  74. message(FATAL_ERROR "error: some test cases were skipped")
  75. endif()