diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2013-06-02 19:42:10 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2013-06-02 20:18:19 (GMT) |
commit | cd4451d1e738a729a1a8d0ed34b544cada1de078 (patch) | |
tree | 099468fd2b338fd193ccf9dd5c1701245d3e1a1f /Tests | |
parent | a4d8c64d10105fd4448ffde6a5d2fb74c1bb4f57 (diff) | |
download | CMake-cd4451d1e738a729a1a8d0ed34b544cada1de078.zip CMake-cd4451d1e738a729a1a8d0ed34b544cada1de078.tar.gz CMake-cd4451d1e738a729a1a8d0ed34b544cada1de078.tar.bz2 |
replace string(... MATCHES "^const$) with string(... STREQUAL "const")
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Complex/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/SimpleInstall/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/SimpleInstallS2/CMakeLists.txt | 2 |
4 files changed, 12 insertions, 18 deletions
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 048f966..50dccbe 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -45,12 +45,12 @@ endmacro() TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) - if("${ARGV}" MATCHES "^1;2;3$") + if("${ARGV}" STREQUAL "1;2;3") message(STATUS "ARGV works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") endif() - if("${ARGN}" MATCHES "^2;3$") + if("${ARGN}" STREQUAL "2;3") message(STATUS "ARGN works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") @@ -163,7 +163,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" STREQUAL "ABCDEFG\n") else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") endif() @@ -177,7 +177,7 @@ endif() # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# if("${RESULT}" MATCHES "^0$") +# if("${RESULT}" STREQUAL "0") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") # else() @@ -387,10 +387,7 @@ if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - set(STRING_REGEX_PASSED 1) -endif() -if(NOT STRING_REGEX_PASSED) +if(NOT RESULT STREQUAL "a[b]c[d]e") message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index b0748fe..cbb4286 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -45,12 +45,12 @@ endmacro() TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) - if("${ARGV}" MATCHES "^1;2;3$") + if("${ARGV}" STREQUAL "1;2;3") message(STATUS "ARGV works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") endif() - if("${ARGN}" MATCHES "^2;3$") + if("${ARGN}" STREQUAL "2;3") message(STATUS "ARGN works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") @@ -163,7 +163,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" STREQUAL "ABCDEFG\n") else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") endif() @@ -177,7 +177,7 @@ endif() # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# if("${RESULT}" MATCHES "^0$") +# if("${RESULT}" STREQUAL "0") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") # else() @@ -357,10 +357,7 @@ if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - set(STRING_REGEX_PASSED 1) -endif() -if(NOT STRING_REGEX_PASSED) +if(NOT RESULT STREQUAL "a[b]c[d]e") message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index 479d6ec..b969bfd 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -122,7 +122,7 @@ if(STAGE2) RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + if(NOT "${SAMPLE_SCRIPT_RESULT}" STREQUAL "0") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") endif() diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index 479d6ec..b969bfd 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -122,7 +122,7 @@ if(STAGE2) RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + if(NOT "${SAMPLE_SCRIPT_RESULT}" STREQUAL "0") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") endif() |