summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-11 22:10:28 (GMT)
committerBrad King <brad.king@kitware.com>2011-01-11 22:10:28 (GMT)
commit729db484efac18194076c4020fe9b6a87f24ed22 (patch)
tree7a38ff11f778e7eb94f0844f563d62b096f03882 /Tests
parent89c25443a62de7a06fc0daa9f552a70aa9692aa0 (diff)
downloadCMake-729db484efac18194076c4020fe9b6a87f24ed22.zip
CMake-729db484efac18194076c4020fe9b6a87f24ed22.tar.gz
CMake-729db484efac18194076c4020fe9b6a87f24ed22.tar.bz2
Fix ArgumentExpansion test expected results
Teach the ArgumentExpansion test to expect flattened lists as has always been the case in the CMake language. Now that the test should pass enable the failure regex even when CMAKE_STRICT is not on. Replace the reference to the old ArgumentExpansion test behavior in the workaround comment in cmMakefile::TryCompile with a full inline explanation.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ArgumentExpansion/CMakeLists.txt13
-rw-r--r--Tests/CMakeLists.txt6
2 files changed, 9 insertions, 10 deletions
diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt
index 6201706..a24636f 100644
--- a/Tests/ArgumentExpansion/CMakeLists.txt
+++ b/Tests/ArgumentExpansion/CMakeLists.txt
@@ -16,11 +16,11 @@ function (argument_tester expected expected_len)
list(GET ARGN ${i} argn_value)
list(GET ${expected} ${i} expected_value)
- if (NOT ${argn_value} STREQUAL ${expected_value})
+ if (NOT "${argn_value}" STREQUAL "${expected_value}")
message(STATUS "Unexpected: Argument ${i} doesn't match")
message(STATUS " Expected: ${expected_value}")
message(STATUS " Received: ${argn_value}")
- endif (NOT ${argn_value} STREQUAL ${expected_value})
+ endif ()
math(EXPR i "${i} + 1")
endwhile (i LESS ${argn_len})
@@ -50,10 +50,11 @@ set(nested_list_arg_test
"${multiple_arg_test}"
"first arg"
"second arg")
-message(STATUS "Test: Nested list argument")
-argument_tester(nested_list_arg_test 3 ${nested_list_arg_test})
+message(STATUS "Test: Nested list argument flattens")
+argument_tester(nested_list_arg_test 4 ${nested_list_arg_test})
set(semicolon_arg_test
"pre\;post")
-message(STATUS "Test: Semicolon argument")
-argument_tester(semicolon_arg_test 1 ${semicolon_arg_test})
+set(semicolon_arg_test_flat "pre;post")
+message(STATUS "Test: Semicolon argument flattens")
+argument_tester(semicolon_arg_test_flat 2 ${semicolon_arg_test})
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 02d393b..27cff3f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -383,10 +383,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin"
)
- IF(CMAKE_STRICT)
- SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES
- FAIL_REGULAR_EXPRESSION "Unexpected: ")
- ENDIF(CMAKE_STRICT)
+ SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES
+ FAIL_REGULAR_EXPRESSION "Unexpected: ")
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion")
ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND}