From e5ca59b456d3a1a51d0b5387ec9d04a51beaa0be Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 14 Jul 2015 09:41:05 -0400 Subject: [PATCH] Tests: Move command failure cases into RunCMake infrastructure Move failure cases from the CMake.{If,List,While,GetProperty} tests over to the RunCMake.{if,list,while,get_property} tests to use the more modern infrastructure. This also avoids using REGEX_ESCAPE_STRING to try to regex-match full paths. --- Tests/CMakeTests/GetPropertyTest.cmake.in | 96 ------------------- Tests/CMakeTests/IfTest.cmake.in | 11 --- Tests/CMakeTests/ListTest.cmake.in | 53 ---------- Tests/CMakeTests/WhileTest.cmake.in | 40 -------- Tests/RegexEscapeString.cmake | 4 - Tests/RunCMake/CMakeLists.txt | 1 + .../get_property/BadArgument-result.txt | 1 + .../get_property/BadArgument-stderr.txt | 4 + .../get_property/BadArgument.cmake} | 0 .../get_property/BadDirectory-result.txt | 1 + .../get_property/BadDirectory-stderr.txt | 6 ++ .../get_property/BadDirectory.cmake} | 0 .../RunCMake/get_property/BadScope-result.txt | 1 + .../RunCMake/get_property/BadScope-stderr.txt | 5 + .../get_property/BadScope.cmake} | 0 .../get_property/BadTarget-result.txt | 1 + .../get_property/BadTarget-stderr.txt | 5 + .../get_property/BadTarget.cmake} | 0 .../RunCMake/get_property/BadTest-result.txt | 1 + .../RunCMake/get_property/BadTest-stderr.txt | 4 + .../get_property/BadTest.cmake} | 0 .../get_property/GlobalName-result.txt | 1 + .../get_property/GlobalName-stderr.txt | 4 + .../get_property/GlobalName.cmake} | 0 .../get_property/MissingArgument-result.txt | 1 + .../get_property/MissingArgument-stderr.txt | 4 + .../get_property/MissingArgument.cmake} | 0 .../RunCMake/get_property/NoCache-result.txt | 1 + .../RunCMake/get_property/NoCache-stderr.txt | 4 + .../get_property/NoCache.cmake} | 0 .../get_property/NoProperty-result.txt | 1 + .../get_property/NoProperty-stderr.txt | 4 + .../get_property/NoProperty.cmake} | 0 .../RunCMake/get_property/NoSource-result.txt | 1 + .../RunCMake/get_property/NoSource-stderr.txt | 4 + .../get_property/NoSource.cmake} | 0 .../RunCMake/get_property/NoTarget-result.txt | 1 + .../RunCMake/get_property/NoTarget-stderr.txt | 4 + .../get_property/NoTarget.cmake} | 0 Tests/RunCMake/get_property/NoTest-result.txt | 1 + Tests/RunCMake/get_property/NoTest-stderr.txt | 4 + .../get_property/NoTest.cmake} | 0 .../RunCMake/get_property/RunCMakeTest.cmake | 14 +++ .../get_property/VariableName-result.txt | 1 + .../get_property/VariableName-stderr.txt | 4 + .../get_property/VariableName.cmake} | 0 Tests/RunCMake/if/InvalidArgument1-result.txt | 1 + Tests/RunCMake/if/InvalidArgument1-stderr.txt | 8 ++ .../if/InvalidArgument1.cmake} | 0 Tests/RunCMake/if/RunCMakeTest.cmake | 1 + .../RunCMake/list/GET-CMP0007-WARN-stderr.txt | 8 ++ .../list/GET-CMP0007-WARN.cmake} | 1 + .../RunCMake/list/GET-InvalidIndex-result.txt | 1 + .../RunCMake/list/GET-InvalidIndex-stderr.txt | 4 + .../list/GET-InvalidIndex.cmake} | 0 .../list/INSERT-InvalidIndex-result.txt | 1 + .../list/INSERT-InvalidIndex-stderr.txt | 4 + .../list/INSERT-InvalidIndex.cmake} | 0 .../list/InvalidSubcommand-result.txt | 1 + .../list/InvalidSubcommand-stderr.txt | 4 + .../list/InvalidSubcommand.cmake} | 0 .../list/LENGTH-TooManyArguments-result.txt | 1 + .../list/LENGTH-TooManyArguments-stderr.txt | 4 + .../list/LENGTH-TooManyArguments.cmake} | 0 Tests/RunCMake/list/NoArguments-result.txt | 1 + Tests/RunCMake/list/NoArguments-stderr.txt | 4 + .../list/NoArguments.cmake} | 0 .../list/REMOVE_AT-InvalidIndex-result.txt | 1 + .../list/REMOVE_AT-InvalidIndex-stderr.txt | 4 + .../list/REMOVE_AT-InvalidIndex.cmake} | 0 .../list/REMOVE_AT-NotList-result.txt | 1 + .../list/REMOVE_AT-NotList-stderr.txt | 4 + .../list/REMOVE_AT-NotList.cmake} | 0 .../list/REMOVE_DUPLICATES-NotList-result.txt | 1 + .../list/REMOVE_DUPLICATES-NotList-stderr.txt | 4 + .../list/REMOVE_DUPLICATES-NotList.cmake} | 0 ...OVE_DUPLICATES-TooManyArguments-result.txt | 1 + ...OVE_DUPLICATES-TooManyArguments-stderr.txt | 4 + .../REMOVE_DUPLICATES-TooManyArguments.cmake} | 0 .../list/REMOVE_ITEM-NotList-result.txt | 1 + .../list/REMOVE_ITEM-NotList-stderr.txt | 4 + .../list/REMOVE_ITEM-NotList.cmake} | 0 .../RunCMake/list/REVERSE-NotList-result.txt | 1 + .../RunCMake/list/REVERSE-NotList-stderr.txt | 4 + .../list/REVERSE-NotList.cmake} | 0 .../list/REVERSE-TooManyArguments-result.txt | 1 + .../list/REVERSE-TooManyArguments-stderr.txt | 4 + .../list/REVERSE-TooManyArguments.cmake} | 0 Tests/RunCMake/list/RunCMakeTest.cmake | 19 ++++ Tests/RunCMake/list/SORT-NotList-result.txt | 1 + Tests/RunCMake/list/SORT-NotList-stderr.txt | 4 + .../list/SORT-NotList.cmake} | 0 .../list/SORT-TooManyArguments-result.txt | 1 + .../list/SORT-TooManyArguments-stderr.txt | 4 + .../list/SORT-TooManyArguments.cmake} | 0 Tests/RunCMake/while/CMakeLists.txt | 3 + Tests/RunCMake/while/EndAlone-result.txt | 1 + Tests/RunCMake/while/EndAlone-stderr.txt | 5 + .../while/EndAlone.cmake} | 0 Tests/RunCMake/while/EndAloneArgs-result.txt | 1 + Tests/RunCMake/while/EndAloneArgs-stderr.txt | 5 + .../while/EndAloneArgs.cmake} | 0 Tests/RunCMake/while/EndMismatch-stderr.txt | 13 +++ .../while/EndMismatch.cmake} | 0 Tests/RunCMake/while/EndMissing-result.txt | 1 + Tests/RunCMake/while/EndMissing-stderr.txt | 6 ++ .../while/EndMissing.cmake} | 0 .../RunCMake/while/MissingArgument-result.txt | 1 + .../RunCMake/while/MissingArgument-stderr.txt | 4 + .../while/MissingArgument.cmake} | 0 Tests/RunCMake/while/RunCMakeTest.cmake | 7 ++ 111 files changed, 239 insertions(+), 204 deletions(-) delete mode 100644 Tests/RegexEscapeString.cmake create mode 100644 Tests/RunCMake/get_property/BadArgument-result.txt create mode 100644 Tests/RunCMake/get_property/BadArgument-stderr.txt rename Tests/{CMakeTests/GetProperty-Bad-Argument.cmake => RunCMake/get_property/BadArgument.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/BadDirectory-result.txt create mode 100644 Tests/RunCMake/get_property/BadDirectory-stderr.txt rename Tests/{CMakeTests/GetProperty-Bad-Directory.cmake => RunCMake/get_property/BadDirectory.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/BadScope-result.txt create mode 100644 Tests/RunCMake/get_property/BadScope-stderr.txt rename Tests/{CMakeTests/GetProperty-Bad-Scope.cmake => RunCMake/get_property/BadScope.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/BadTarget-result.txt create mode 100644 Tests/RunCMake/get_property/BadTarget-stderr.txt rename Tests/{CMakeTests/GetProperty-Bad-Target.cmake => RunCMake/get_property/BadTarget.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/BadTest-result.txt create mode 100644 Tests/RunCMake/get_property/BadTest-stderr.txt rename Tests/{CMakeTests/GetProperty-Bad-Test.cmake => RunCMake/get_property/BadTest.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/GlobalName-result.txt create mode 100644 Tests/RunCMake/get_property/GlobalName-stderr.txt rename Tests/{CMakeTests/GetProperty-Global-Name.cmake => RunCMake/get_property/GlobalName.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/MissingArgument-result.txt create mode 100644 Tests/RunCMake/get_property/MissingArgument-stderr.txt rename Tests/{CMakeTests/GetProperty-Missing-Argument.cmake => RunCMake/get_property/MissingArgument.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/NoCache-result.txt create mode 100644 Tests/RunCMake/get_property/NoCache-stderr.txt rename Tests/{CMakeTests/GetProperty-No-Cache.cmake => RunCMake/get_property/NoCache.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/NoProperty-result.txt create mode 100644 Tests/RunCMake/get_property/NoProperty-stderr.txt rename Tests/{CMakeTests/GetProperty-No-Property.cmake => RunCMake/get_property/NoProperty.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/NoSource-result.txt create mode 100644 Tests/RunCMake/get_property/NoSource-stderr.txt rename Tests/{CMakeTests/GetProperty-No-Source.cmake => RunCMake/get_property/NoSource.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/NoTarget-result.txt create mode 100644 Tests/RunCMake/get_property/NoTarget-stderr.txt rename Tests/{CMakeTests/GetProperty-No-Target.cmake => RunCMake/get_property/NoTarget.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/NoTest-result.txt create mode 100644 Tests/RunCMake/get_property/NoTest-stderr.txt rename Tests/{CMakeTests/GetProperty-No-Test.cmake => RunCMake/get_property/NoTest.cmake} (100%) create mode 100644 Tests/RunCMake/get_property/VariableName-result.txt create mode 100644 Tests/RunCMake/get_property/VariableName-stderr.txt rename Tests/{CMakeTests/GetProperty-Variable-Name.cmake => RunCMake/get_property/VariableName.cmake} (100%) create mode 100644 Tests/RunCMake/if/InvalidArgument1-result.txt create mode 100644 Tests/RunCMake/if/InvalidArgument1-stderr.txt rename Tests/{CMakeTests/If-Invalid-Argument.cmake => RunCMake/if/InvalidArgument1.cmake} (100%) create mode 100644 Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt rename Tests/{CMakeTests/List-Get-CMP0007-Warn.cmake => RunCMake/list/GET-CMP0007-WARN.cmake} (86%) create mode 100644 Tests/RunCMake/list/GET-InvalidIndex-result.txt create mode 100644 Tests/RunCMake/list/GET-InvalidIndex-stderr.txt rename Tests/{CMakeTests/List-Get-Invalid-Index.cmake => RunCMake/list/GET-InvalidIndex.cmake} (100%) create mode 100644 Tests/RunCMake/list/INSERT-InvalidIndex-result.txt create mode 100644 Tests/RunCMake/list/INSERT-InvalidIndex-stderr.txt rename Tests/{CMakeTests/List-Insert-Invalid-Index.cmake => RunCMake/list/INSERT-InvalidIndex.cmake} (100%) create mode 100644 Tests/RunCMake/list/InvalidSubcommand-result.txt create mode 100644 Tests/RunCMake/list/InvalidSubcommand-stderr.txt rename Tests/{CMakeTests/List-Invalid-Subcommand.cmake => RunCMake/list/InvalidSubcommand.cmake} (100%) create mode 100644 Tests/RunCMake/list/LENGTH-TooManyArguments-result.txt create mode 100644 Tests/RunCMake/list/LENGTH-TooManyArguments-stderr.txt rename Tests/{CMakeTests/List-Length-Too-Many-Arguments.cmake => RunCMake/list/LENGTH-TooManyArguments.cmake} (100%) create mode 100644 Tests/RunCMake/list/NoArguments-result.txt create mode 100644 Tests/RunCMake/list/NoArguments-stderr.txt rename Tests/{CMakeTests/List-No-Arguments.cmake => RunCMake/list/NoArguments.cmake} (100%) create mode 100644 Tests/RunCMake/list/REMOVE_AT-InvalidIndex-result.txt create mode 100644 Tests/RunCMake/list/REMOVE_AT-InvalidIndex-stderr.txt rename Tests/{CMakeTests/List-Remove_At-Invalid-Index.cmake => RunCMake/list/REMOVE_AT-InvalidIndex.cmake} (100%) create mode 100644 Tests/RunCMake/list/REMOVE_AT-NotList-result.txt create mode 100644 Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt rename Tests/{CMakeTests/List-Remove_At-Nonexistent-List.cmake => RunCMake/list/REMOVE_AT-NotList.cmake} (100%) create mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt create mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt rename Tests/{CMakeTests/List-Remove_Duplicates-Nonexistent-List.cmake => RunCMake/list/REMOVE_DUPLICATES-NotList.cmake} (100%) create mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-result.txt create mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-stderr.txt rename Tests/{CMakeTests/List-Remove_Duplicates-Too-Many-Arguments.cmake => RunCMake/list/REMOVE_DUPLICATES-TooManyArguments.cmake} (100%) create mode 100644 Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt create mode 100644 Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt rename Tests/{CMakeTests/List-Remove_Item-Nonexistent-List.cmake => RunCMake/list/REMOVE_ITEM-NotList.cmake} (100%) create mode 100644 Tests/RunCMake/list/REVERSE-NotList-result.txt create mode 100644 Tests/RunCMake/list/REVERSE-NotList-stderr.txt rename Tests/{CMakeTests/List-Reverse-Nonexistent-List.cmake => RunCMake/list/REVERSE-NotList.cmake} (100%) create mode 100644 Tests/RunCMake/list/REVERSE-TooManyArguments-result.txt create mode 100644 Tests/RunCMake/list/REVERSE-TooManyArguments-stderr.txt rename Tests/{CMakeTests/List-Reverse-Too-Many-Arguments.cmake => RunCMake/list/REVERSE-TooManyArguments.cmake} (100%) create mode 100644 Tests/RunCMake/list/SORT-NotList-result.txt create mode 100644 Tests/RunCMake/list/SORT-NotList-stderr.txt rename Tests/{CMakeTests/List-Sort-Nonexistent-List.cmake => RunCMake/list/SORT-NotList.cmake} (100%) create mode 100644 Tests/RunCMake/list/SORT-TooManyArguments-result.txt create mode 100644 Tests/RunCMake/list/SORT-TooManyArguments-stderr.txt rename Tests/{CMakeTests/List-Sort-Too-Many-Arguments.cmake => RunCMake/list/SORT-TooManyArguments.cmake} (100%) create mode 100644 Tests/RunCMake/while/CMakeLists.txt create mode 100644 Tests/RunCMake/while/EndAlone-result.txt create mode 100644 Tests/RunCMake/while/EndAlone-stderr.txt rename Tests/{CMakeTests/While-Endwhile-Alone.cmake => RunCMake/while/EndAlone.cmake} (100%) create mode 100644 Tests/RunCMake/while/EndAloneArgs-result.txt create mode 100644 Tests/RunCMake/while/EndAloneArgs-stderr.txt rename Tests/{CMakeTests/While-Endwhile-Alone-Args.cmake => RunCMake/while/EndAloneArgs.cmake} (100%) create mode 100644 Tests/RunCMake/while/EndMismatch-stderr.txt rename Tests/{CMakeTests/While-Endwhile-Mismatch.cmake => RunCMake/while/EndMismatch.cmake} (100%) create mode 100644 Tests/RunCMake/while/EndMissing-result.txt create mode 100644 Tests/RunCMake/while/EndMissing-stderr.txt rename Tests/{CMakeTests/While-Missing-Endwhile.cmake => RunCMake/while/EndMissing.cmake} (100%) create mode 100644 Tests/RunCMake/while/MissingArgument-result.txt create mode 100644 Tests/RunCMake/while/MissingArgument-stderr.txt rename Tests/{CMakeTests/While-Missing-Argument.cmake => RunCMake/while/MissingArgument.cmake} (100%) create mode 100644 Tests/RunCMake/while/RunCMakeTest.cmake diff --git a/Tests/CMakeTests/GetPropertyTest.cmake.in b/Tests/CMakeTests/GetPropertyTest.cmake.in index e99193eb1..1ad895657 100644 --- a/Tests/CMakeTests/GetPropertyTest.cmake.in +++ b/Tests/CMakeTests/GetPropertyTest.cmake.in @@ -1,5 +1,3 @@ -include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") - get_property(FOO_BRIEF GLOBAL PROPERTY FOO BRIEF_DOCS) get_property(FOO_FULL GLOBAL PROPERTY FOO FULL_DOCS) @@ -16,97 +14,3 @@ get_property(result VARIABLE PROPERTY test_var) if(NOT result STREQUAL "alpha") message(SEND_ERROR "bad value of VARIABLE PROPERTY test_var: got '${result}' instead of 'alpha'") endif() - -include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") -REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") - -set(Missing-Argument-RESULT 1) -set(Missing-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Missing-Argument.cmake:1 \\(get_property\\):.*get_property called with incorrect number of arguments.*") - -check_cmake_test(GetProperty - Missing-Argument -) - -set(Bad-Scope-RESULT 1) -set(Bad-Scope-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Scope.cmake:1 \\(get_property\\):.*get_property given invalid scope FOO\\..*") - -check_cmake_test(GetProperty - Bad-Scope -) - -set(Bad-Argument-RESULT 1) -set(Bad-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Argument.cmake:1 \\(get_property\\):.*get_property given invalid argument \"FOO\"\\..*") - -check_cmake_test(GetProperty - Bad-Argument -) - -set(No-Property-RESULT 1) -set(No-Property-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Property.cmake:1 \\(get_property\\):.*get_property not given a PROPERTY argument\\..*") - -check_cmake_test(GetProperty - No-Property -) - -set(Global-Name-RESULT 1) -set(Global-Name-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Global-Name.cmake:1 \\(get_property\\):.*get_property given name for GLOBAL scope\\..*") - -check_cmake_test(GetProperty - Global-Name -) - -set(Bad-Directory-RESULT 1) -set(Bad-Directory-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Directory.cmake:1 \\(get_property\\):.*get_property DIRECTORY scope provided but requested directory was not.*found\\..*") - -check_cmake_test(GetProperty - Bad-Directory -) - -set(No-Target-RESULT 1) -set(No-Target-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Target.cmake:1 \\(get_property\\):.*get_property not given name for TARGET scope\\..*") - -check_cmake_test(GetProperty - No-Target -) - -set(Bad-Target-RESULT 1) -set(Bad-Target-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Target.cmake:1 \\(get_property\\):.*get_property could not find TARGET FOO\\..*") - -check_cmake_test(GetProperty - Bad-Target -) - -set(No-Source-RESULT 1) -set(No-Source-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Source.cmake:1 \\(get_property\\):.*get_property not given name for SOURCE scope\\..*") - -check_cmake_test(GetProperty - No-Source -) - -set(No-Test-RESULT 1) -set(No-Test-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Test.cmake:1 \\(get_property\\):.*get_property not given name for TEST scope\\..*") - -check_cmake_test(GetProperty - No-Test -) - -set(Bad-Test-RESULT 1) -set(Bad-Test-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Test.cmake:1 \\(get_property\\):.*get_property given TEST name that does not exist: FOO.*") - -check_cmake_test(GetProperty - Bad-Test -) - -set(Variable-Name-RESULT 1) -set(Variable-Name-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Variable-Name.cmake:1 \\(get_property\\):.*get_property given name for VARIABLE scope\\..*") - -check_cmake_test(GetProperty - Variable-Name -) - -set(No-Cache-RESULT 1) -set(No-Cache-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Cache.cmake:1 \\(get_property\\):.*get_property not given name for CACHE scope\\..*") - -check_cmake_test(GetProperty - No-Cache -) diff --git a/Tests/CMakeTests/IfTest.cmake.in b/Tests/CMakeTests/IfTest.cmake.in index 74b8e32b5..e5211b4fa 100644 --- a/Tests/CMakeTests/IfTest.cmake.in +++ b/Tests/CMakeTests/IfTest.cmake.in @@ -7,9 +7,6 @@ foreach(_arg "" 0 1 2 ${TRUE_NAMES} ${FALSE_NAMES}) set(VAR_${_arg} "${_arg}") endforeach() -include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") -REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") - macro(test_vars _old) # Variables set to false or not set. foreach(_var "" 0 ${FALSE_NAMES} UNDEFINED) @@ -159,11 +156,3 @@ foreach(_bad 2x -2x) endforeach() test_vars("") - -set(Invalid-Argument-RESULT 1) -set(Invalid-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?If-Invalid-Argument.cmake:1 \\(if\\):.*Unknown arguments specified.*") - -include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") -check_cmake_test(If - Invalid-Argument -) diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index 77c34a9c4..76f5e4f6a 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,8 +1,5 @@ include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") -include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") -REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") - macro(TEST command expected) if("x${result}" STREQUAL "x${expected}") #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") @@ -103,9 +100,6 @@ TEST("REVERSE empty result" "") list(SORT result) TEST("SORT empty result" "") -set(No-Arguments-RESULT 1) -set(No-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-No-Arguments.cmake:1 \\(list\\):.*list must be called with at least two arguments.*") - # these trigger top-level condition foreach(cmd IN ITEMS Append Find Get Insert Length Reverse Remove_At Remove_Duplicates Remove_Item Sort) set(${cmd}-No-Arguments-RESULT 1) @@ -132,53 +126,6 @@ foreach(cmd IN ITEMS Find Get Insert Length Remove_At Remove_Item) check_cmake_test_single(List "${cmd}-List-Only" "${_test_file_name}") endforeach() -set(Length-Too-Many-Arguments-RESULT 1) -set(Length-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Length-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command LENGTH requires two arguments.*") - -set(Reverse-Too-Many-Arguments-RESULT 1) -set(Reverse-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Reverse-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REVERSE only takes one argument.*") - -set(Remove_Duplicates-Too-Many-Arguments-RESULT 1) -set(Remove_Duplicates-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Remove_Duplicates-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REMOVE_DUPLICATES only takes one argument.*") - -set(Sort-Too-Many-Arguments-RESULT 1) -set(Sort-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Sort-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command SORT only takes one argument.*") - -set(Invalid-Subcommand-RESULT 1) -set(Invalid-Subcommand-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Invalid-Subcommand.cmake:1 \\(list\\):.*list does not recognize sub-command NO_SUCH_SUBCOMMAND.*") - -foreach(cmd Get Insert Remove_At) - set(${cmd}-Invalid-Index-RESULT 1) - set(${cmd}-Invalid-Index-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-${cmd}-Invalid-Index.cmake:2 \\(list\\):.*list index: 3 out of range \\(-3, 2\\).*") -endforeach() - -foreach(cmd Remove_Item Reverse Remove_Duplicates Sort Remove_At) - string(TOUPPER ${cmd} Cmd) - set(${cmd}-Nonexistent-List-RESULT 1) - set(${cmd}-Nonexistent-List-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-${cmd}-Nonexistent-List.cmake:2 \\(list\\):.*sub-command ${Cmd} requires list to be present.*") -endforeach() - -set(Get-CMP0007-Warn-RESULT 0) -set(Get-CMP0007-Warn-STDERR ".*CMake Warning \\(dev\\) at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Get-CMP0007-Warn.cmake:3 \\(list\\):.*Policy CMP0007 is not set:.*") - -check_cmake_test(List - No-Arguments - Length-Too-Many-Arguments - Reverse-Too-Many-Arguments - Remove_Duplicates-Too-Many-Arguments - Sort-Too-Many-Arguments - Invalid-Subcommand - Get-Invalid-Index - Insert-Invalid-Index - Remove_Item-Nonexistent-List - Reverse-Nonexistent-List - Remove_Duplicates-Nonexistent-List - Sort-Nonexistent-List - Remove_At-Nonexistent-List - Remove_At-Invalid-Index - Get-CMP0007-Warn -) - set(thelist "" NEW OLD) foreach (_pol ${thelist}) diff --git a/Tests/CMakeTests/WhileTest.cmake.in b/Tests/CMakeTests/WhileTest.cmake.in index d4cf7d7dc..cc22978ce 100644 --- a/Tests/CMakeTests/WhileTest.cmake.in +++ b/Tests/CMakeTests/WhileTest.cmake.in @@ -1,9 +1,6 @@ set(NUMBERS "") set(COUNT 0) -include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") -REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") - while(COUNT LESS 200) set(NUMBERS "${NUMBERS} ${COUNT}") set(COUNT "2${COUNT}") @@ -18,40 +15,3 @@ endwhile() if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30") message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'") endif() - - -set(Missing-Argument-RESULT 1) -set(Missing-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Argument.cmake:1 \\(while\\):.*while called with incorrect number of arguments.*") - -include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") -check_cmake_test(While - Missing-Argument -) - -set(Missing-Endwhile-RESULT 1) -set(Missing-Endwhile-STDERR ".*CMake Error in (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Endwhile.cmake:.*A logical block opening on the line.*(${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Endwhile.cmake:1 \\(while\\).*is not closed\\..*") - -check_cmake_test(While - Missing-Endwhile -) - -set(Endwhile-Mismatch-RESULT 0) -set(Endwhile-Mismatch-STDERR ".*CMake Warning \\(dev\\) in (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Mismatch.cmake:.*A logical block opening on the line.*(${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Mismatch.cmake:1 \\(while\\).*with mis-matching arguments\\..*") - -check_cmake_test(While - Endwhile-Mismatch -) - -set(Endwhile-Alone-RESULT 1) -set(Endwhile-Alone-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Alone.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\.\n.*$") - -check_cmake_test(While - Endwhile-Alone -) - -set(Endwhile-Alone-Args-RESULT 1) -set(Endwhile-Alone-Args-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Alone-Args.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\. Or its arguments did not.*$") - -check_cmake_test(While - Endwhile-Alone-Args -) diff --git a/Tests/RegexEscapeString.cmake b/Tests/RegexEscapeString.cmake deleted file mode 100644 index 92aed17b1..000000000 --- a/Tests/RegexEscapeString.cmake +++ /dev/null @@ -1,4 +0,0 @@ -macro(REGEX_ESCAPE_STRING _OUT _IN) - # Escape special regex metacharacters with a backslash - string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") -endmacro() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b90eff65e..3746a7c21 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -191,6 +191,7 @@ add_RunCMake_test(try_compile) add_RunCMake_test(try_run) add_RunCMake_test(set) add_RunCMake_test(variable_watch) +add_RunCMake_test(while) add_RunCMake_test(CMP0004) add_RunCMake_test(TargetPolicies) add_RunCMake_test(alias_targets) diff --git a/Tests/RunCMake/get_property/BadArgument-result.txt b/Tests/RunCMake/get_property/BadArgument-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/BadArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/BadArgument-stderr.txt b/Tests/RunCMake/get_property/BadArgument-stderr.txt new file mode 100644 index 000000000..37c44775c --- /dev/null +++ b/Tests/RunCMake/get_property/BadArgument-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at BadArgument.cmake:1 \(get_property\): + get_property given invalid argument "FOO". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Bad-Argument.cmake b/Tests/RunCMake/get_property/BadArgument.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Bad-Argument.cmake rename to Tests/RunCMake/get_property/BadArgument.cmake diff --git a/Tests/RunCMake/get_property/BadDirectory-result.txt b/Tests/RunCMake/get_property/BadDirectory-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/BadDirectory-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/BadDirectory-stderr.txt b/Tests/RunCMake/get_property/BadDirectory-stderr.txt new file mode 100644 index 000000000..98464f8dc --- /dev/null +++ b/Tests/RunCMake/get_property/BadDirectory-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at BadDirectory.cmake:1 \(get_property\): + get_property DIRECTORY scope provided but requested directory was not + found. This could be because the directory argument was invalid or, it is + valid but has not been processed yet. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Bad-Directory.cmake b/Tests/RunCMake/get_property/BadDirectory.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Bad-Directory.cmake rename to Tests/RunCMake/get_property/BadDirectory.cmake diff --git a/Tests/RunCMake/get_property/BadScope-result.txt b/Tests/RunCMake/get_property/BadScope-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/BadScope-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/BadScope-stderr.txt b/Tests/RunCMake/get_property/BadScope-stderr.txt new file mode 100644 index 000000000..4cc32c87b --- /dev/null +++ b/Tests/RunCMake/get_property/BadScope-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at BadScope.cmake:1 \(get_property\): + get_property given invalid scope FOO. Valid scopes are GLOBAL, DIRECTORY, + TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Bad-Scope.cmake b/Tests/RunCMake/get_property/BadScope.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Bad-Scope.cmake rename to Tests/RunCMake/get_property/BadScope.cmake diff --git a/Tests/RunCMake/get_property/BadTarget-result.txt b/Tests/RunCMake/get_property/BadTarget-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/BadTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/BadTarget-stderr.txt b/Tests/RunCMake/get_property/BadTarget-stderr.txt new file mode 100644 index 000000000..45a0df6c9 --- /dev/null +++ b/Tests/RunCMake/get_property/BadTarget-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at BadTarget.cmake:1 \(get_property\): + get_property could not find TARGET FOO. Perhaps it has not yet been + created. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Bad-Target.cmake b/Tests/RunCMake/get_property/BadTarget.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Bad-Target.cmake rename to Tests/RunCMake/get_property/BadTarget.cmake diff --git a/Tests/RunCMake/get_property/BadTest-result.txt b/Tests/RunCMake/get_property/BadTest-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/BadTest-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/BadTest-stderr.txt b/Tests/RunCMake/get_property/BadTest-stderr.txt new file mode 100644 index 000000000..819c0704a --- /dev/null +++ b/Tests/RunCMake/get_property/BadTest-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at BadTest.cmake:1 \(get_property\): + get_property given TEST name that does not exist: FOO +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Bad-Test.cmake b/Tests/RunCMake/get_property/BadTest.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Bad-Test.cmake rename to Tests/RunCMake/get_property/BadTest.cmake diff --git a/Tests/RunCMake/get_property/GlobalName-result.txt b/Tests/RunCMake/get_property/GlobalName-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/GlobalName-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/GlobalName-stderr.txt b/Tests/RunCMake/get_property/GlobalName-stderr.txt new file mode 100644 index 000000000..a7d4971c2 --- /dev/null +++ b/Tests/RunCMake/get_property/GlobalName-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at GlobalName.cmake:1 \(get_property\): + get_property given name for GLOBAL scope. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Global-Name.cmake b/Tests/RunCMake/get_property/GlobalName.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Global-Name.cmake rename to Tests/RunCMake/get_property/GlobalName.cmake diff --git a/Tests/RunCMake/get_property/MissingArgument-result.txt b/Tests/RunCMake/get_property/MissingArgument-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/MissingArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/MissingArgument-stderr.txt b/Tests/RunCMake/get_property/MissingArgument-stderr.txt new file mode 100644 index 000000000..87227127a --- /dev/null +++ b/Tests/RunCMake/get_property/MissingArgument-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at MissingArgument.cmake:1 \(get_property\): + get_property called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Missing-Argument.cmake b/Tests/RunCMake/get_property/MissingArgument.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Missing-Argument.cmake rename to Tests/RunCMake/get_property/MissingArgument.cmake diff --git a/Tests/RunCMake/get_property/NoCache-result.txt b/Tests/RunCMake/get_property/NoCache-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/NoCache-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/NoCache-stderr.txt b/Tests/RunCMake/get_property/NoCache-stderr.txt new file mode 100644 index 000000000..defafb62d --- /dev/null +++ b/Tests/RunCMake/get_property/NoCache-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NoCache.cmake:1 \(get_property\): + get_property not given name for CACHE scope. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-No-Cache.cmake b/Tests/RunCMake/get_property/NoCache.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-No-Cache.cmake rename to Tests/RunCMake/get_property/NoCache.cmake diff --git a/Tests/RunCMake/get_property/NoProperty-result.txt b/Tests/RunCMake/get_property/NoProperty-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/NoProperty-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/NoProperty-stderr.txt b/Tests/RunCMake/get_property/NoProperty-stderr.txt new file mode 100644 index 000000000..0ef147fdb --- /dev/null +++ b/Tests/RunCMake/get_property/NoProperty-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NoProperty.cmake:1 \(get_property\): + get_property not given a PROPERTY argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-No-Property.cmake b/Tests/RunCMake/get_property/NoProperty.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-No-Property.cmake rename to Tests/RunCMake/get_property/NoProperty.cmake diff --git a/Tests/RunCMake/get_property/NoSource-result.txt b/Tests/RunCMake/get_property/NoSource-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/NoSource-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/NoSource-stderr.txt b/Tests/RunCMake/get_property/NoSource-stderr.txt new file mode 100644 index 000000000..59fd0add7 --- /dev/null +++ b/Tests/RunCMake/get_property/NoSource-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NoSource.cmake:1 \(get_property\): + get_property not given name for SOURCE scope. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-No-Source.cmake b/Tests/RunCMake/get_property/NoSource.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-No-Source.cmake rename to Tests/RunCMake/get_property/NoSource.cmake diff --git a/Tests/RunCMake/get_property/NoTarget-result.txt b/Tests/RunCMake/get_property/NoTarget-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/NoTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/NoTarget-stderr.txt b/Tests/RunCMake/get_property/NoTarget-stderr.txt new file mode 100644 index 000000000..a0e1a9440 --- /dev/null +++ b/Tests/RunCMake/get_property/NoTarget-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NoTarget.cmake:1 \(get_property\): + get_property not given name for TARGET scope. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-No-Target.cmake b/Tests/RunCMake/get_property/NoTarget.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-No-Target.cmake rename to Tests/RunCMake/get_property/NoTarget.cmake diff --git a/Tests/RunCMake/get_property/NoTest-result.txt b/Tests/RunCMake/get_property/NoTest-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/NoTest-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/NoTest-stderr.txt b/Tests/RunCMake/get_property/NoTest-stderr.txt new file mode 100644 index 000000000..c90a0ffc2 --- /dev/null +++ b/Tests/RunCMake/get_property/NoTest-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NoTest.cmake:1 \(get_property\): + get_property not given name for TEST scope. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-No-Test.cmake b/Tests/RunCMake/get_property/NoTest.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-No-Test.cmake rename to Tests/RunCMake/get_property/NoTest.cmake diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake index e420b5b13..00eef34c0 100644 --- a/Tests/RunCMake/get_property/RunCMakeTest.cmake +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -8,3 +8,17 @@ run_cmake(source_properties) run_cmake(target_properties) run_cmake(test_properties) run_cmake(DebugConfigurations) + +run_cmake(MissingArgument) +run_cmake(GlobalName) +run_cmake(BadTest) +run_cmake(BadTarget) +run_cmake(BadScope) +run_cmake(BadDirectory) +run_cmake(BadArgument) +run_cmake(VariableName) +run_cmake(NoTest) +run_cmake(NoTarget) +run_cmake(NoSource) +run_cmake(NoProperty) +run_cmake(NoCache) diff --git a/Tests/RunCMake/get_property/VariableName-result.txt b/Tests/RunCMake/get_property/VariableName-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_property/VariableName-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_property/VariableName-stderr.txt b/Tests/RunCMake/get_property/VariableName-stderr.txt new file mode 100644 index 000000000..e9f382759 --- /dev/null +++ b/Tests/RunCMake/get_property/VariableName-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at VariableName.cmake:1 \(get_property\): + get_property given name for VARIABLE scope. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/GetProperty-Variable-Name.cmake b/Tests/RunCMake/get_property/VariableName.cmake similarity index 100% rename from Tests/CMakeTests/GetProperty-Variable-Name.cmake rename to Tests/RunCMake/get_property/VariableName.cmake diff --git a/Tests/RunCMake/if/InvalidArgument1-result.txt b/Tests/RunCMake/if/InvalidArgument1-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/if/InvalidArgument1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/if/InvalidArgument1-stderr.txt b/Tests/RunCMake/if/InvalidArgument1-stderr.txt new file mode 100644 index 000000000..bf2a994e1 --- /dev/null +++ b/Tests/RunCMake/if/InvalidArgument1-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error at InvalidArgument1.cmake:1 \(if\): + if given arguments: + + "NOT" "foo" "bar" "STREQUAL" "foo bar" + + Unknown arguments specified +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/If-Invalid-Argument.cmake b/Tests/RunCMake/if/InvalidArgument1.cmake similarity index 100% rename from Tests/CMakeTests/If-Invalid-Argument.cmake rename to Tests/RunCMake/if/InvalidArgument1.cmake diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake index b5546a7ee..2c0c4d7fc 100644 --- a/Tests/RunCMake/if/RunCMakeTest.cmake +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(InvalidArgument1) run_cmake(IsDirectory) run_cmake(IsDirectoryLong) run_cmake(elseif-message) diff --git a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt new file mode 100644 index 000000000..a0f883780 --- /dev/null +++ b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt @@ -0,0 +1,8 @@ +^CMake Warning \(dev\) at GET-CMP0007-WARN.cmake:4 \(list\): + Policy CMP0007 is not set: list command no longer ignores empty elements. + Run "cmake --help-policy CMP0007" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. List has value = + \[;NEW;OLD\]. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/CMakeTests/List-Get-CMP0007-Warn.cmake b/Tests/RunCMake/list/GET-CMP0007-WARN.cmake similarity index 86% rename from Tests/CMakeTests/List-Get-CMP0007-Warn.cmake rename to Tests/RunCMake/list/GET-CMP0007-WARN.cmake index 0a9264fdc..833f35204 100644 --- a/Tests/CMakeTests/List-Get-CMP0007-Warn.cmake +++ b/Tests/RunCMake/list/GET-CMP0007-WARN.cmake @@ -1,3 +1,4 @@ +cmake_policy(VERSION 2.4) set(thelist "" NEW OLD) list(GET thelist 1 thevalue) diff --git a/Tests/RunCMake/list/GET-InvalidIndex-result.txt b/Tests/RunCMake/list/GET-InvalidIndex-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/GET-InvalidIndex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/GET-InvalidIndex-stderr.txt b/Tests/RunCMake/list/GET-InvalidIndex-stderr.txt new file mode 100644 index 000000000..0409464be --- /dev/null +++ b/Tests/RunCMake/list/GET-InvalidIndex-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at GET-InvalidIndex.cmake:2 \(list\): + list index: 3 out of range \(-3, 2\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Get-Invalid-Index.cmake b/Tests/RunCMake/list/GET-InvalidIndex.cmake similarity index 100% rename from Tests/CMakeTests/List-Get-Invalid-Index.cmake rename to Tests/RunCMake/list/GET-InvalidIndex.cmake diff --git a/Tests/RunCMake/list/INSERT-InvalidIndex-result.txt b/Tests/RunCMake/list/INSERT-InvalidIndex-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/INSERT-InvalidIndex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/INSERT-InvalidIndex-stderr.txt b/Tests/RunCMake/list/INSERT-InvalidIndex-stderr.txt new file mode 100644 index 000000000..6e15c0b43 --- /dev/null +++ b/Tests/RunCMake/list/INSERT-InvalidIndex-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at INSERT-InvalidIndex.cmake:2 \(list\): + list index: 3 out of range \(-3, 2\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Insert-Invalid-Index.cmake b/Tests/RunCMake/list/INSERT-InvalidIndex.cmake similarity index 100% rename from Tests/CMakeTests/List-Insert-Invalid-Index.cmake rename to Tests/RunCMake/list/INSERT-InvalidIndex.cmake diff --git a/Tests/RunCMake/list/InvalidSubcommand-result.txt b/Tests/RunCMake/list/InvalidSubcommand-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/InvalidSubcommand-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/InvalidSubcommand-stderr.txt b/Tests/RunCMake/list/InvalidSubcommand-stderr.txt new file mode 100644 index 000000000..74703d249 --- /dev/null +++ b/Tests/RunCMake/list/InvalidSubcommand-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at InvalidSubcommand.cmake:1 \(list\): + list does not recognize sub-command NO_SUCH_SUBCOMMAND +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Invalid-Subcommand.cmake b/Tests/RunCMake/list/InvalidSubcommand.cmake similarity index 100% rename from Tests/CMakeTests/List-Invalid-Subcommand.cmake rename to Tests/RunCMake/list/InvalidSubcommand.cmake diff --git a/Tests/RunCMake/list/LENGTH-TooManyArguments-result.txt b/Tests/RunCMake/list/LENGTH-TooManyArguments-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/LENGTH-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/LENGTH-TooManyArguments-stderr.txt b/Tests/RunCMake/list/LENGTH-TooManyArguments-stderr.txt new file mode 100644 index 000000000..239e70874 --- /dev/null +++ b/Tests/RunCMake/list/LENGTH-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at LENGTH-TooManyArguments.cmake:1 \(list\): + list sub-command LENGTH requires two arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Length-Too-Many-Arguments.cmake b/Tests/RunCMake/list/LENGTH-TooManyArguments.cmake similarity index 100% rename from Tests/CMakeTests/List-Length-Too-Many-Arguments.cmake rename to Tests/RunCMake/list/LENGTH-TooManyArguments.cmake diff --git a/Tests/RunCMake/list/NoArguments-result.txt b/Tests/RunCMake/list/NoArguments-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/NoArguments-stderr.txt b/Tests/RunCMake/list/NoArguments-stderr.txt new file mode 100644 index 000000000..6fdf9cc0b --- /dev/null +++ b/Tests/RunCMake/list/NoArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NoArguments.cmake:1 \(list\): + list must be called with at least two arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-No-Arguments.cmake b/Tests/RunCMake/list/NoArguments.cmake similarity index 100% rename from Tests/CMakeTests/List-No-Arguments.cmake rename to Tests/RunCMake/list/NoArguments.cmake diff --git a/Tests/RunCMake/list/REMOVE_AT-InvalidIndex-result.txt b/Tests/RunCMake/list/REMOVE_AT-InvalidIndex-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_AT-InvalidIndex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REMOVE_AT-InvalidIndex-stderr.txt b/Tests/RunCMake/list/REMOVE_AT-InvalidIndex-stderr.txt new file mode 100644 index 000000000..6f5887538 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_AT-InvalidIndex-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REMOVE_AT-InvalidIndex.cmake:2 \(list\): + list index: 3 out of range \(-3, 2\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Remove_At-Invalid-Index.cmake b/Tests/RunCMake/list/REMOVE_AT-InvalidIndex.cmake similarity index 100% rename from Tests/CMakeTests/List-Remove_At-Invalid-Index.cmake rename to Tests/RunCMake/list/REMOVE_AT-InvalidIndex.cmake diff --git a/Tests/RunCMake/list/REMOVE_AT-NotList-result.txt b/Tests/RunCMake/list/REMOVE_AT-NotList-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_AT-NotList-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt new file mode 100644 index 000000000..d6e8d85f5 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REMOVE_AT-NotList.cmake:2 \(list\): + list sub-command REMOVE_AT requires list to be present. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Remove_At-Nonexistent-List.cmake b/Tests/RunCMake/list/REMOVE_AT-NotList.cmake similarity index 100% rename from Tests/CMakeTests/List-Remove_At-Nonexistent-List.cmake rename to Tests/RunCMake/list/REMOVE_AT-NotList.cmake diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt new file mode 100644 index 000000000..96f3446ff --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REMOVE_DUPLICATES-NotList.cmake:2 \(list\): + list sub-command REMOVE_DUPLICATES requires list to be present. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Remove_Duplicates-Nonexistent-List.cmake b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake similarity index 100% rename from Tests/CMakeTests/List-Remove_Duplicates-Nonexistent-List.cmake rename to Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-result.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-stderr.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-stderr.txt new file mode 100644 index 000000000..f5c871111 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REMOVE_DUPLICATES-TooManyArguments.cmake:1 \(list\): + list sub-command REMOVE_DUPLICATES only takes one argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Remove_Duplicates-Too-Many-Arguments.cmake b/Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments.cmake similarity index 100% rename from Tests/CMakeTests/List-Remove_Duplicates-Too-Many-Arguments.cmake rename to Tests/RunCMake/list/REMOVE_DUPLICATES-TooManyArguments.cmake diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt b/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt new file mode 100644 index 000000000..c32a4c055 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REMOVE_ITEM-NotList.cmake:2 \(list\): + list sub-command REMOVE_ITEM requires list to be present. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Remove_Item-Nonexistent-List.cmake b/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake similarity index 100% rename from Tests/CMakeTests/List-Remove_Item-Nonexistent-List.cmake rename to Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake diff --git a/Tests/RunCMake/list/REVERSE-NotList-result.txt b/Tests/RunCMake/list/REVERSE-NotList-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/REVERSE-NotList-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REVERSE-NotList-stderr.txt b/Tests/RunCMake/list/REVERSE-NotList-stderr.txt new file mode 100644 index 000000000..e9dcc06b3 --- /dev/null +++ b/Tests/RunCMake/list/REVERSE-NotList-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REVERSE-NotList.cmake:2 \(list\): + list sub-command REVERSE requires list to be present. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Reverse-Nonexistent-List.cmake b/Tests/RunCMake/list/REVERSE-NotList.cmake similarity index 100% rename from Tests/CMakeTests/List-Reverse-Nonexistent-List.cmake rename to Tests/RunCMake/list/REVERSE-NotList.cmake diff --git a/Tests/RunCMake/list/REVERSE-TooManyArguments-result.txt b/Tests/RunCMake/list/REVERSE-TooManyArguments-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/REVERSE-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REVERSE-TooManyArguments-stderr.txt b/Tests/RunCMake/list/REVERSE-TooManyArguments-stderr.txt new file mode 100644 index 000000000..7dabd9d3c --- /dev/null +++ b/Tests/RunCMake/list/REVERSE-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REVERSE-TooManyArguments.cmake:1 \(list\): + list sub-command REVERSE only takes one argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Reverse-Too-Many-Arguments.cmake b/Tests/RunCMake/list/REVERSE-TooManyArguments.cmake similarity index 100% rename from Tests/CMakeTests/List-Reverse-Too-Many-Arguments.cmake rename to Tests/RunCMake/list/REVERSE-TooManyArguments.cmake diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake index 555051de0..25d6a0367 100644 --- a/Tests/RunCMake/list/RunCMakeTest.cmake +++ b/Tests/RunCMake/list/RunCMakeTest.cmake @@ -3,3 +3,22 @@ include(RunCMake) run_cmake(EmptyGet0) run_cmake(EmptyRemoveAt0) run_cmake(EmptyInsert-1) + +run_cmake(NoArguments) +run_cmake(InvalidSubcommand) +run_cmake(GET-CMP0007-WARN) + +run_cmake(GET-InvalidIndex) +run_cmake(INSERT-InvalidIndex) +run_cmake(REMOVE_AT-InvalidIndex) + +run_cmake(LENGTH-TooManyArguments) +run_cmake(REMOVE_DUPLICATES-TooManyArguments) +run_cmake(REVERSE-TooManyArguments) +run_cmake(SORT-TooManyArguments) + +run_cmake(REMOVE_AT-NotList) +run_cmake(REMOVE_DUPLICATES-NotList) +run_cmake(REMOVE_ITEM-NotList) +run_cmake(REVERSE-NotList) +run_cmake(SORT-NotList) diff --git a/Tests/RunCMake/list/SORT-NotList-result.txt b/Tests/RunCMake/list/SORT-NotList-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/SORT-NotList-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/SORT-NotList-stderr.txt b/Tests/RunCMake/list/SORT-NotList-stderr.txt new file mode 100644 index 000000000..396c5b57d --- /dev/null +++ b/Tests/RunCMake/list/SORT-NotList-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at SORT-NotList.cmake:2 \(list\): + list sub-command SORT requires list to be present. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Sort-Nonexistent-List.cmake b/Tests/RunCMake/list/SORT-NotList.cmake similarity index 100% rename from Tests/CMakeTests/List-Sort-Nonexistent-List.cmake rename to Tests/RunCMake/list/SORT-NotList.cmake diff --git a/Tests/RunCMake/list/SORT-TooManyArguments-result.txt b/Tests/RunCMake/list/SORT-TooManyArguments-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/list/SORT-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/SORT-TooManyArguments-stderr.txt b/Tests/RunCMake/list/SORT-TooManyArguments-stderr.txt new file mode 100644 index 000000000..d3fad6068 --- /dev/null +++ b/Tests/RunCMake/list/SORT-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at SORT-TooManyArguments.cmake:1 \(list\): + list sub-command SORT only takes one argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/List-Sort-Too-Many-Arguments.cmake b/Tests/RunCMake/list/SORT-TooManyArguments.cmake similarity index 100% rename from Tests/CMakeTests/List-Sort-Too-Many-Arguments.cmake rename to Tests/RunCMake/list/SORT-TooManyArguments.cmake diff --git a/Tests/RunCMake/while/CMakeLists.txt b/Tests/RunCMake/while/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/while/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/while/EndAlone-result.txt b/Tests/RunCMake/while/EndAlone-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/while/EndAlone-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/while/EndAlone-stderr.txt b/Tests/RunCMake/while/EndAlone-stderr.txt new file mode 100644 index 000000000..cd9868722 --- /dev/null +++ b/Tests/RunCMake/while/EndAlone-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at EndAlone.cmake:1 \(endwhile\): + endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE + structure. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/While-Endwhile-Alone.cmake b/Tests/RunCMake/while/EndAlone.cmake similarity index 100% rename from Tests/CMakeTests/While-Endwhile-Alone.cmake rename to Tests/RunCMake/while/EndAlone.cmake diff --git a/Tests/RunCMake/while/EndAloneArgs-result.txt b/Tests/RunCMake/while/EndAloneArgs-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/while/EndAloneArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/while/EndAloneArgs-stderr.txt b/Tests/RunCMake/while/EndAloneArgs-stderr.txt new file mode 100644 index 000000000..a8c043d0f --- /dev/null +++ b/Tests/RunCMake/while/EndAloneArgs-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at EndAloneArgs.cmake:1 \(endwhile\): + endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE + structure. Or its arguments did not match the opening WHILE command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/While-Endwhile-Alone-Args.cmake b/Tests/RunCMake/while/EndAloneArgs.cmake similarity index 100% rename from Tests/CMakeTests/While-Endwhile-Alone-Args.cmake rename to Tests/RunCMake/while/EndAloneArgs.cmake diff --git a/Tests/RunCMake/while/EndMismatch-stderr.txt b/Tests/RunCMake/while/EndMismatch-stderr.txt new file mode 100644 index 000000000..d7439e8fc --- /dev/null +++ b/Tests/RunCMake/while/EndMismatch-stderr.txt @@ -0,0 +1,13 @@ +^CMake Warning \(dev\) at EndMismatch.cmake:3 \(include\): + A logical block opening on the line + + .*/Tests/RunCMake/while/EndMismatch.cmake:1 \(while\) + + closes on the line + + .*/Tests/RunCMake/while/EndMismatch.cmake:2 \(endwhile\) + + with mis-matching arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/CMakeTests/While-Endwhile-Mismatch.cmake b/Tests/RunCMake/while/EndMismatch.cmake similarity index 100% rename from Tests/CMakeTests/While-Endwhile-Mismatch.cmake rename to Tests/RunCMake/while/EndMismatch.cmake diff --git a/Tests/RunCMake/while/EndMissing-result.txt b/Tests/RunCMake/while/EndMissing-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/while/EndMissing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/while/EndMissing-stderr.txt b/Tests/RunCMake/while/EndMissing-stderr.txt new file mode 100644 index 000000000..099a8b273 --- /dev/null +++ b/Tests/RunCMake/while/EndMissing-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at CMakeLists.txt:3 \(include\): + A logical block opening on the line + + .*/Tests/RunCMake/while/EndMissing.cmake:1 \(while\) + + is not closed.$ diff --git a/Tests/CMakeTests/While-Missing-Endwhile.cmake b/Tests/RunCMake/while/EndMissing.cmake similarity index 100% rename from Tests/CMakeTests/While-Missing-Endwhile.cmake rename to Tests/RunCMake/while/EndMissing.cmake diff --git a/Tests/RunCMake/while/MissingArgument-result.txt b/Tests/RunCMake/while/MissingArgument-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/while/MissingArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/while/MissingArgument-stderr.txt b/Tests/RunCMake/while/MissingArgument-stderr.txt new file mode 100644 index 000000000..7ff0971f4 --- /dev/null +++ b/Tests/RunCMake/while/MissingArgument-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at MissingArgument.cmake:1 \(while\): + while called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/CMakeTests/While-Missing-Argument.cmake b/Tests/RunCMake/while/MissingArgument.cmake similarity index 100% rename from Tests/CMakeTests/While-Missing-Argument.cmake rename to Tests/RunCMake/while/MissingArgument.cmake diff --git a/Tests/RunCMake/while/RunCMakeTest.cmake b/Tests/RunCMake/while/RunCMakeTest.cmake new file mode 100644 index 000000000..7da80ace3 --- /dev/null +++ b/Tests/RunCMake/while/RunCMakeTest.cmake @@ -0,0 +1,7 @@ +include(RunCMake) + +run_cmake(MissingArgument) +run_cmake(EndMissing) +run_cmake(EndMismatch) +run_cmake(EndAlone) +run_cmake(EndAloneArgs)