diff options
Diffstat (limited to 'Tests/ComplexOneConfig')
-rw-r--r-- | Tests/ComplexOneConfig/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/Executable/complex.cxx | 80 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/VarTests.cmake | 14 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/cmTestConfigure.h.in | 9 |
4 files changed, 5 insertions, 111 deletions
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/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 27d70ad..e904f28 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -635,86 +635,6 @@ int main() } // ---------------------------------------------------------------------- - // Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#ifndef FILENAME_VAR_PATH_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME is not defined."); -#else - if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0)) - { - cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } -#endif - -#ifndef FILENAME_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME, "VarTests.cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } - else - { - cmPassed("FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } -#endif - -#ifndef FILENAME_VAR_EXT - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT is not defined."); -#else - if(strcmp(FILENAME_VAR_EXT, ".cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } - else - { - cmPassed("FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } -#endif - -#ifndef FILENAME_VAR_NAME_WE - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME_WE, "VarTests") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } - else - { - cmPassed("FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } -#endif - -#ifndef PATH_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME is not defined."); -#else - if((strcmp(PATH_VAR_NAME, "Complex") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0)) - { - cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME == ", PATH_VAR_NAME); - } -#endif - - // ---------------------------------------------------------------------- // Test LOAD_CACHE #ifndef CACHE_TEST_VAR1 diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index 52ec1fc..70b803a 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/VarTests.cmake @@ -182,17 +182,3 @@ set(FOREACH_CONCAT "") foreach (INDEX a;b;c;d;e;f;g) set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") endforeach() - -# -# Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations -# -find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) - -get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) - -find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index 7741b6f..d7424b1 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -15,15 +15,6 @@ // Test WHILE #define WHILE_VALUE ${while_var} -// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}" -#define FILENAME_VAR_NAME "${FILENAME_VAR_NAME}" -#define FILENAME_VAR_EXT "${FILENAME_VAR_EXT}" -#define FILENAME_VAR_NAME_WE "${FILENAME_VAR_NAME_WE}" - -#define PATH_VAR_NAME "${PATH_VAR_NAME}" - // Test LOAD_CACHE #define CACHE_TEST_VAR1 "${CACHE_TEST_VAR1}" |