diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst index 5a6f5cfb0f..82ab716435 100644 --- a/Help/policy/CMP0053.rst +++ b/Help/policy/CMP0053.rst @@ -1,6 +1,9 @@ CMP0053 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + .. versionadded:: 3.1 Simplify variable reference and escape sequence evaluation. @@ -45,7 +48,5 @@ variable references and escape sequences. The ``NEW`` behavior is to use the simpler variable expansion and escape sequence evaluation rules. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1 -.. |WARNS_OR_DOES_NOT_WARN| replace:: warns -.. include:: STANDARD_ADVICE.txt - -.. include:: DEPRECATED.txt +.. |WARNED_OR_DID_NOT_WARN| replace:: warned +.. include:: REMOVED_EPILOGUE.txt diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 2eeb375cf4..e470a99f3f 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -2,7 +2,6 @@ # file Copyright.txt or https://cmake.org/licensing for details. cmake_policy(PUSH) -cmake_policy(SET CMP0053 NEW) cmake_policy(SET CMP0054 NEW) # Function to parse implicit linker options. diff --git a/Modules/CMakeParseLibraryArchitecture.cmake b/Modules/CMakeParseLibraryArchitecture.cmake index f7a4b29c34..37990e12b7 100644 --- a/Modules/CMakeParseLibraryArchitecture.cmake +++ b/Modules/CMakeParseLibraryArchitecture.cmake @@ -2,7 +2,6 @@ # file Copyright.txt or https://cmake.org/licensing for details. cmake_policy(PUSH) -cmake_policy(SET CMP0053 NEW) cmake_policy(SET CMP0054 NEW) # Function parse implicit linker options. diff --git a/Modules/Internal/CMakeDetermineLinkerId.cmake b/Modules/Internal/CMakeDetermineLinkerId.cmake index 45499a5e37..d52d5940bf 100644 --- a/Modules/Internal/CMakeDetermineLinkerId.cmake +++ b/Modules/Internal/CMakeDetermineLinkerId.cmake @@ -7,7 +7,6 @@ # CMAKE__COMPILER_LINKER_VERSION cmake_policy(PUSH) -cmake_policy(SET CMP0053 NEW) cmake_policy(SET CMP0054 NEW) function(cmake_determine_linker_id lang linker) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7f41557ca2..6752537487 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -29,7 +29,6 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" -#include "cmCommandArgumentParserHelper.h" #include "cmCustomCommand.h" #include "cmCustomCommandLines.h" #include "cmCustomCommandTypes.h" @@ -108,8 +107,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars(); - this->SuppressSideEffects = false; - // Setup the default include complaint regular expression (match nothing). this->ComplainFileRegularExpression = "^$"; @@ -117,7 +114,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, this->cmDefineRegex.compile("#([ \t]*)cmakedefine[ \t]+([A-Za-z_0-9]*)"); this->cmDefine01Regex.compile("#([ \t]*)cmakedefine01[ \t]+([A-Za-z_0-9]*)"); - this->cmAtVarRegex.compile("(@[A-Za-z_0-9/.+-]+@)"); this->cmNamedCurly.compile("^[A-Za-z0-9/_.+-]+{"); this->StateSnapshot = @@ -2354,7 +2350,7 @@ cmValue cmMakefile::GetDefinition(const std::string& name) const } #ifndef CMAKE_BOOTSTRAP cmVariableWatch* vv = this->GetVariableWatch(); - if (vv && !this->SuppressSideEffects) { + if (vv) { bool const watch_function_executed = vv->VariableAccessed(name, def ? cmVariableWatch::VARIABLE_READ_ACCESS @@ -2398,11 +2394,6 @@ const std::string& cmMakefile::ExpandVariablesInString( std::string& source, bool escapeQuotes, bool noEscapes, bool atOnly, const char* filename, long line, bool removeEmpty, bool replaceAt) const { - bool compareResults = false; - MessageType mtype = MessageType::LOG; - std::string errorstr; - std::string original; - // Sanity check the @ONLY mode. if (atOnly && (!noEscapes || !removeEmpty)) { // This case should never be called. At-only is for @@ -2413,163 +2404,20 @@ const std::string& cmMakefile::ExpandVariablesInString( return source; } - // Variables used in the WARN case. - std::string newResult; - std::string newErrorstr; - MessageType newError = MessageType::LOG; - - switch (this->GetPolicyStatus(cmPolicies::CMP0053)) { - case cmPolicies::WARN: { - // Save the original string for the warning. - original = source; - newResult = source; - compareResults = true; - // Suppress variable watches to avoid calling hooks twice. Suppress new - // dereferences since the OLD behavior is still what is actually used. - this->SuppressSideEffects = true; - newError = this->ExpandVariablesInStringNew( - newErrorstr, newResult, escapeQuotes, noEscapes, atOnly, filename, - line, replaceAt); - this->SuppressSideEffects = false; - CM_FALLTHROUGH; - } - case cmPolicies::OLD: - mtype = this->ExpandVariablesInStringOld(errorstr, source, escapeQuotes, - noEscapes, atOnly, filename, - line, removeEmpty, true); - break; - // Messaging here would be *very* verbose. - case cmPolicies::NEW: - mtype = this->ExpandVariablesInStringNew(errorstr, source, escapeQuotes, - noEscapes, atOnly, filename, - line, replaceAt); - break; - } - - // If it's an error in either case, just report the error... + std::string errorstr; + MessageType mtype = this->ExpandVariablesInStringImpl( + errorstr, source, escapeQuotes, noEscapes, atOnly, filename, line, + replaceAt); if (mtype != MessageType::LOG) { if (mtype == MessageType::FATAL_ERROR) { cmSystemTools::SetFatalErrorOccurred(); } this->IssueMessage(mtype, errorstr); } - // ...otherwise, see if there's a difference that needs to be warned about. - else if (compareResults && (newResult != source || newError != mtype)) { - auto msg = - cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0053), '\n'); - - std::string msg_input = original; - cmSystemTools::ReplaceString(msg_input, "\n", "\n "); - - std::string msg_old = source; - cmSystemTools::ReplaceString(msg_old, "\n", "\n "); - - msg += cmStrCat("For input:\n '", msg_input, "'\n", - "the old evaluation rules produce:\n '", msg_old, "'\n"); - - if (newError == mtype) { - std::string msg_new = newResult; - cmSystemTools::ReplaceString(msg_new, "\n", "\n "); - msg += - cmStrCat("but the new evaluation rules produce:\n '", msg_new, "'\n"); - } else { - std::string msg_err = newErrorstr; - cmSystemTools::ReplaceString(msg_err, "\n", "\n "); - msg += cmStrCat("but the new evaluation rules produce an error:\n ", - msg_err, '\n'); - } - - msg += - "Using the old result for compatibility since the policy is not set."; - - this->IssueMessage(MessageType::AUTHOR_WARNING, msg); - } return source; } -MessageType cmMakefile::ExpandVariablesInStringOld( - std::string& errorstr, std::string& source, bool escapeQuotes, - bool noEscapes, bool atOnly, const char* filename, long line, - bool removeEmpty, bool replaceAt) const -{ - // Fast path strings without any special characters. - if (source.find_first_of("$@\\") == std::string::npos) { - return MessageType::LOG; - } - - // Special-case the @ONLY mode. - if (atOnly) { - // Store an original copy of the input. - std::string input = source; - - // Start with empty output. - source.clear(); - - // Look for one @VAR@ at a time. - const char* in = input.c_str(); - while (this->cmAtVarRegex.find(in)) { - // Get the range of the string to replace. - const char* first = in + this->cmAtVarRegex.start(); - const char* last = in + this->cmAtVarRegex.end(); - - // Store the unchanged part of the string now. - source.append(in, first - in); - - // Lookup the definition of VAR. - std::string var(first + 1, last - first - 2); - if (cmValue val = this->GetDefinition(var)) { - // Store the value in the output escaping as requested. - if (escapeQuotes) { - source.append(cmEscapeQuotes(*val)); - } else { - source.append(*val); - } - } - - // Continue looking for @VAR@ further along the string. - in = last; - } - - // Append the rest of the unchanged part of the string. - source.append(in); - - return MessageType::LOG; - } - - // This method replaces ${VAR} and @VAR@ where VAR is looked up - // with GetDefinition(), if not found in the map, nothing is expanded. - // It also supports the $ENV{VAR} syntax where VAR is looked up in - // the current environment variables. - - cmCommandArgumentParserHelper parser; - parser.SetMakefile(this); - parser.SetLineFile(line, filename); - parser.SetEscapeQuotes(escapeQuotes); - parser.SetNoEscapeMode(noEscapes); - parser.SetReplaceAtSyntax(replaceAt); - parser.SetRemoveEmpty(removeEmpty); - int res = parser.ParseString(source, 0); - const char* emsg = parser.GetError(); - MessageType mtype = MessageType::LOG; - if (res && !emsg[0]) { - source = parser.GetResult(); - } else { - // Construct the main error message. - std::string error = "Syntax error in cmake code "; - if (filename && line > 0) { - // This filename and line number may be more specific than the - // command context because one command invocation can have - // arguments on multiple lines. - error += cmStrCat("at\n ", filename, ':', line, '\n'); - } - error += cmStrCat("when parsing string\n ", source, '\n', emsg); - mtype = MessageType::FATAL_ERROR; - errorstr = std::move(error); - } - return mtype; -} - enum t_domain { NORMAL, @@ -2680,7 +2528,7 @@ cm::optional cmMakefile::DeferGetCall(std::string const& id) const return call; } -MessageType cmMakefile::ExpandVariablesInStringNew( +MessageType cmMakefile::ExpandVariablesInStringImpl( std::string& errorstr, std::string& source, bool escapeQuotes, bool noEscapes, bool atOnly, const char* filename, long line, bool replaceAt) const @@ -2743,7 +2591,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew( } else { varresult = *value; } - } else if (!this->SuppressSideEffects) { + } else { this->MaybeWarnUninitialized(lookup, filename); } result.replace(var.loc, result.size() - var.loc, varresult); @@ -2859,7 +2707,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew( cmValue def = this->GetDefinition(variable); if (def) { varresult = *def; - } else if (!this->SuppressSideEffects) { + } else { this->MaybeWarnUninitialized(variable, filename); } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 78a485d9df..d05421f59c 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -1197,7 +1197,6 @@ private: mutable cmsys::RegularExpression cmDefineRegex; mutable cmsys::RegularExpression cmDefine01Regex; - mutable cmsys::RegularExpression cmAtVarRegex; mutable cmsys::RegularExpression cmNamedCurly; std::vector UnConfiguredDirectories; @@ -1239,19 +1238,11 @@ private: class BuildsystemFileScope; friend class BuildsystemFileScope; - // CMP0053 == old - MessageType ExpandVariablesInStringOld(std::string& errorstr, - std::string& source, - bool escapeQuotes, bool noEscapes, - bool atOnly, const char* filename, - long line, bool removeEmpty, - bool replaceAt) const; - // CMP0053 == new - MessageType ExpandVariablesInStringNew(std::string& errorstr, - std::string& source, - bool escapeQuotes, bool noEscapes, - bool atOnly, const char* filename, - long line, bool replaceAt) const; + MessageType ExpandVariablesInStringImpl(std::string& errorstr, + std::string& source, + bool escapeQuotes, bool noEscapes, + bool atOnly, const char* filename, + long line, bool replaceAt) const; bool ValidateCustomCommand(const cmCustomCommandLines& commandLines) const; @@ -1270,6 +1261,5 @@ private: std::set WarnedCMP0074; std::set WarnedCMP0144; bool IsSourceFileTryCompile; - mutable bool SuppressSideEffects; ImportedTargetScope CurrentImportedTargetScope = ImportedTargetScope::Local; }; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index f5d7d41e83..0ca09a9644 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -158,7 +158,7 @@ class cmMakefile; 3, 1, 0, NEW) \ SELECT(POLICY, CMP0053, \ "Simplify variable reference and escape sequence evaluation.", 3, 1, \ - 0, WARN) \ + 0, NEW) \ SELECT( \ POLICY, CMP0054, \ "Only interpret if() arguments as variables or keywords when unquoted.", \ diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in index 5f8b1117d2..6a94cc5852 100644 --- a/Tests/CMakeTests/StringTest.cmake.in +++ b/Tests/CMakeTests/StringTest.cmake.in @@ -84,7 +84,7 @@ check_cmake_test(String # Execute each test listed in StringTestScript.cmake: # set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake") -set(number_of_tests_expected 74) +set(number_of_tests_expected 72) include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake") execute_all_script_tests(${scriptname} number_of_tests_executed) diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index e069897b6b..7c4585791b 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -1,8 +1,6 @@ message(STATUS "testname='${testname}'") -function(test_configure_line_number EXPRESSION POLICY) - cmake_policy(PUSH) - cmake_policy(SET CMP0053 ${POLICY}) +function(test_configure_line_number EXPRESSION) string(CONFIGURE "${EXPRESSION}" v) # line should indicate string() call math(EXPR vplus3 "${v} + 3") @@ -10,7 +8,6 @@ function(test_configure_line_number EXPRESSION POLICY) message(SEND_ERROR "Couldn't configure CMAKE_CURRENT_LIST_LINE, evaluated into '${v}'") endif() message(STATUS "v='${v}'") - cmake_policy(POP) endfunction() if(testname STREQUAL empty) # fail @@ -45,16 +42,10 @@ elseif(testname STREQUAL configure_escape_quotes) # pass string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES) message(STATUS "v='${v}'") -elseif(testname STREQUAL configure_line_number_CMP0053_old) # pass - test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" OLD) - -elseif(testname STREQUAL configure_line_number_CMP0053_new) # pass +elseif(testname STREQUAL configure_line_number_curly) # pass test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" NEW) -elseif(testname STREQUAL configure_line_number_CMP0053_old_use_at) # pass - test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" OLD) - -elseif(testname STREQUAL configure_line_number_CMP0053_new_use_at) # pass +elseif(testname STREQUAL configure_line_number_at) # pass test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" NEW) elseif(testname STREQUAL configure_bogus) # fail diff --git a/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt b/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt deleted file mode 100644 index 2a0ddbaafa..0000000000 --- a/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt +++ /dev/null @@ -1,13 +0,0 @@ -^CMake Deprecation Warning at CMP0053-OLD.cmake:1 \(cmake_policy\): - The OLD behavior for policy CMP0053 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -called ---><--$ diff --git a/Tests/RunCMake/CMP0053/CMP0053-OLD.cmake b/Tests/RunCMake/CMP0053/CMP0053-OLD.cmake deleted file mode 100644 index 41f534746b..0000000000 --- a/Tests/RunCMake/CMP0053/CMP0053-OLD.cmake +++ /dev/null @@ -1,8 +0,0 @@ -cmake_policy(SET CMP0053 OLD) - -function (watch_callback) - message("called") -endfunction () - -variable_watch(test watch_callback) -message("-->${test}<--") diff --git a/Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt b/Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt deleted file mode 100644 index 836b0ffe92..0000000000 --- a/Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^called ---><--$ diff --git a/Tests/RunCMake/CMP0053/CMP0053-WARN.cmake b/Tests/RunCMake/CMP0053/CMP0053-WARN.cmake deleted file mode 100644 index b010d1319e..0000000000 --- a/Tests/RunCMake/CMP0053/CMP0053-WARN.cmake +++ /dev/null @@ -1,6 +0,0 @@ -function (watch_callback) - message("called") -endfunction () - -variable_watch(test watch_callback) -message("-->${test}<--") diff --git a/Tests/RunCMake/CMP0053/CMakeLists.txt b/Tests/RunCMake/CMP0053/CMakeLists.txt index 3482e6baf2..c814f14935 100644 --- a/Tests/RunCMake/CMP0053/CMakeLists.txt +++ b/Tests/RunCMake/CMP0053/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0053/RunCMakeTest.cmake b/Tests/RunCMake/CMP0053/RunCMakeTest.cmake index de58c25723..6880ea0745 100644 --- a/Tests/RunCMake/CMP0053/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0053/RunCMakeTest.cmake @@ -1,6 +1,3 @@ include(RunCMake) -set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON) -run_cmake(CMP0053-OLD) run_cmake(CMP0053-NEW) -run_cmake(CMP0053-WARN) diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index b0833d3f54..5423702739 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19) # CMP0053 +cmake_minimum_required(VERSION 3.19) include(RunCMake) diff --git a/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake index ec3e4d46de..f8f0c8f9f0 100644 --- a/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake +++ b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake @@ -1,4 +1 @@ -cmake_policy(SET CMP0053 OLD) -message(STATUS "'${uninitialized_variable}'") -cmake_policy(SET CMP0053 NEW) message(STATUS "'${uninitialized_variable}'") diff --git a/Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt b/Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt index 41ba09898e..623b86dfb0 100644 --- a/Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt +++ b/Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt @@ -1,52 +1,22 @@ -^CMake Warning \(dev\) at warn-uninitialized.cmake:3 \(set\): - uninitialized variable 'OLD_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES' -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at warn-uninitialized.cmake:4 \(set\): - uninitialized variable 'OLD_WARN_FROM_NORMAL_CMAKE_FILE_IN_ATS' -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at warn-uninitialized.cmake:5 \(string\): - uninitialized variable 'OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES' -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at warn-uninitialized.cmake:7 \(configure_file\): - uninitialized variable 'OLD_WARN_FROM_CONFIGURE_FILE_INSIDE_AT' -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at warn-uninitialized.cmake:8 \(string\): - uninitialized variable 'OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_AT' -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at warn-uninitialized.cmake:13 \(set\): +CMake Warning \(dev\) at warn-uninitialized.cmake:1 \(set\): uninitialized variable 'NEW_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES' Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. -CMake Warning \(dev\) at warn-uninitialized.cmake:14 \(string\): +CMake Warning \(dev\) at warn-uninitialized.cmake:2 \(string\): uninitialized variable 'NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES' Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. -CMake Warning \(dev\) at warn-uninitialized.cmake:16 \(configure_file\): +CMake Warning \(dev\) at warn-uninitialized.cmake:4 \(configure_file\): uninitialized variable 'NEW_WARN_FROM_CONFIGURE_FILE_INSIDE_AT' Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. -CMake Warning \(dev\) at warn-uninitialized.cmake:17 \(string\): +CMake Warning \(dev\) at warn-uninitialized.cmake:5 \(string\): uninitialized variable 'NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_AT' Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CommandLine/warn-uninitialized.cmake b/Tests/RunCMake/CommandLine/warn-uninitialized.cmake index ff65c1631c..41636549ba 100644 --- a/Tests/RunCMake/CommandLine/warn-uninitialized.cmake +++ b/Tests/RunCMake/CommandLine/warn-uninitialized.cmake @@ -1,18 +1,5 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0053 OLD) -set(FOO "${OLD_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}") -set(FOO "@OLD_WARN_FROM_NORMAL_CMAKE_FILE_IN_ATS@") -string(CONFIGURE "\${OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT1) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file1.in "\@OLD_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@") -configure_file(${CMAKE_CURRENT_BINARY_DIR}/file1.in file1.out) -string(CONFIGURE "\@OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_AT\@" OUT2) -cmake_policy(POP) - -cmake_policy(PUSH) -cmake_policy(SET CMP0053 NEW) set(FOO "${NEW_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}") string(CONFIGURE "\${NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT3) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file2.in "\@NEW_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@") configure_file(${CMAKE_CURRENT_BINARY_DIR}/file2.in file2.out) string(CONFIGURE "@NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_AT@" OUT4) -cmake_policy(POP) diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt b/Tests/RunCMake/Syntax/At-stderr.txt similarity index 100% rename from Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt rename to Tests/RunCMake/Syntax/At-stderr.txt diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake b/Tests/RunCMake/Syntax/At.cmake similarity index 83% rename from Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake rename to Tests/RunCMake/Syntax/At.cmake index 40dbe46c59..e8df7cd5e5 100644 --- a/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake +++ b/Tests/RunCMake/Syntax/At.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0053 NEW) - set(right "wrong") set(var "\${right}") # Not expanded here with the new policy. diff --git a/Tests/RunCMake/Syntax/AtWithVariable-stderr.txt b/Tests/RunCMake/Syntax/AtWithVariable-stderr.txt index 5dcd4d7a13..cbd1be4722 100644 --- a/Tests/RunCMake/Syntax/AtWithVariable-stderr.txt +++ b/Tests/RunCMake/Syntax/AtWithVariable-stderr.txt @@ -1 +1 @@ --->wrong<-- +-->\${right}<-- diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt deleted file mode 100644 index 0dde1bc5ec..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Deprecation Warning at CMP0053-At-OLD.cmake:1 \(cmake_policy\): - The OLD behavior for policy CMP0053 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ --->wrong<--$ diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake b/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake deleted file mode 100644 index 666f107b8d..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake +++ /dev/null @@ -1,9 +0,0 @@ -cmake_policy(SET CMP0053 OLD) - -set(right "wrong") -set(var "\${right}") -# Expanded here with the old policy. -set(ref "@var@") - -string(CONFIGURE "${ref}" output) -message("-->${output}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt deleted file mode 100644 index ec3702115d..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt +++ /dev/null @@ -1,27 +0,0 @@ -^CMake Warning \(dev\) at CMP0053-At-WARN-newlines.cmake:4 \(set\): - Policy CMP0053 is not set: Simplify variable reference and escape sequence - evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the - cmake_policy command to set the policy and suppress this warning. - - For input: - - ' - @var@ - ' - - the old evaluation rules produce: - - ' - \${right} - ' - - but the new evaluation rules produce: - - ' - @var@ - ' - - Using the old result for compatibility since the policy is not set. -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/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake deleted file mode 100644 index c493505b1a..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(right "wrong") -set(var "\${right}") -# Expanded here with the old policy. -set(ref " -@var@ -") diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt deleted file mode 100644 index 697b7b38ab..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt +++ /dev/null @@ -1,21 +0,0 @@ -^CMake Warning \(dev\) at CMP0053-At-WARN.cmake:4 \(set\): - Policy CMP0053 is not set: Simplify variable reference and escape sequence - evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the - cmake_policy command to set the policy and suppress this warning. - - For input: - - '@var@' - - the old evaluation rules produce: - - '\${right}' - - but the new evaluation rules produce: - - '@var@' - - Using the old result for compatibility since the policy is not set. -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/RunCMake/Syntax/CMP0053-At-WARN.cmake b/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake deleted file mode 100644 index 19c7f53394..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(right "wrong") -set(var "\${right}") -# Expanded here with the old policy. -set(ref "@var@") diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt deleted file mode 100644 index 141d66d1e9..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt +++ /dev/null @@ -1,24 +0,0 @@ -^CMake Deprecation Warning at CMP0053-Dollar-OLD.cmake:1 \(cmake_policy\): - The OLD behavior for policy CMP0053 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ --->value<-- -CMake Error at CMP0053-Dollar-OLD.cmake:6 \(message\): - Syntax error in cmake code at - - .*CMP0053-Dollar-OLD.cmake:6 - - when parsing string - - -->\${\$}<-- - - syntax error, unexpected \$, expecting } \(6\) -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake b/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake deleted file mode 100644 index 647f4648ba..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake +++ /dev/null @@ -1,6 +0,0 @@ -cmake_policy(SET CMP0053 OLD) - -set($ value) -set(dollar $) -message("-->${${dollar}}<--") -message("-->${$}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt deleted file mode 100644 index 09c7e7c7c6..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt +++ /dev/null @@ -1,56 +0,0 @@ -^CMake Warning \(dev\) at CMP0053-NUL.cmake:1 \(set\): - Policy CMP0053 is not set: Simplify variable reference and escape sequence - evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the - cmake_policy command to set the policy and suppress this warning. - - For input: - - '\\0' - - the old evaluation rules produce: - - '' - - but the new evaluation rules produce an error: - - Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:1 - when parsing string - \\0 - Invalid character escape '\\0'. - - Using the old result for compatibility since the policy is not set. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at CMP0053-NUL.cmake:2 \(set\): - Policy CMP0053 is not set: Simplify variable reference and escape sequence - evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the - cmake_policy command to set the policy and suppress this warning. - - For input: - - '\\0' - - the old evaluation rules produce: - - '' - - but the new evaluation rules produce an error: - - Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:2 - when parsing string - \\0 - Invalid character escape '\\0'. - - Using the old result for compatibility since the policy is not set. -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/RunCMake/Syntax/CMP0053-NUL.cmake b/Tests/RunCMake/Syntax/CMP0053-NUL.cmake deleted file mode 100644 index 9ae0906802..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NUL.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(qnul "\0") -set(nul \0) -message(-->${nul}<--) -message(-->${qnul}<--) -message("-->${nul}<--") -message("-->${qnul}<--") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt deleted file mode 100644 index 9575778513..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at CMP0053-NameWithCarriageReturn.cmake:2 \(message\): - message called with incorrect number of arguments -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake deleted file mode 100644 index b8a403d181..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message(${var\rwith\rcarriagereturn}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake deleted file mode 100644 index bb0d93f09d..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message("${var\rwith\rcarriagereturn}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt deleted file mode 100644 index df67d37fe8..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at CMP0053-NameWithEscapedSpaces.cmake:2 \(message\): - message called with incorrect number of arguments -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake deleted file mode 100644 index 805b2ca6f6..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message(${var\ with\ escaped\ space}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake deleted file mode 100644 index 58d8e8ff72..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message("${var\ with\ escaped\ space}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt deleted file mode 100644 index 059044fb8c..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at CMP0053-NameWithEscapedTabs.cmake:2 \(message\): - message called with incorrect number of arguments -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake deleted file mode 100644 index 214ab5de2e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message(${var\ with\ escaped\ tab}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake deleted file mode 100644 index aa5123f56e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message("${var\ with\ escaped\ tab}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt deleted file mode 100644 index 41f86e69bd..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at CMP0053-NameWithNewline.cmake:2 \(message\): - message called with incorrect number of arguments -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake deleted file mode 100644 index 45b532e103..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message(${var\nwith\nnewline}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake deleted file mode 100644 index 6fe568db27..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message("${var\nwith\nnewline}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt deleted file mode 100644 index 95e8684c9a..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at CMP0053-NameWithSpaces.cmake:2 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake:2 - - when parsing string - - \${var - - There is an unterminated variable reference. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake deleted file mode 100644 index dae7d25489..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message(${var with space}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt deleted file mode 100644 index c4f3cfe913..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at CMP0053-NameWithSpacesQuoted.cmake:2 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake:2 - - when parsing string - - \${var with space} - - Invalid character \(' '\) in a variable name: 'var' -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake deleted file mode 100644 index e252cff574..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message("${var with space}") diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt deleted file mode 100644 index b1678b3831..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at CMP0053-NameWithTabs.cmake:2 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake:2 - - when parsing string - - \${var - - There is an unterminated variable reference. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake deleted file mode 100644 index 45e30457fd..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message(${var with tab}) diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt deleted file mode 100644 index 78adb5e21f..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at CMP0053-NameWithTabsQuoted.cmake:2 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake:2 - - when parsing string - - \${var with tab} - - Invalid character \(' '\) in a variable name: 'var' -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake deleted file mode 100644 index 498675fe48..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0053 NEW) -message("${var with tab}") diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt deleted file mode 100644 index c7069390da..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt +++ /dev/null @@ -1,28 +0,0 @@ -^CMake Warning \(dev\) at CMP0053-WARN.cmake:2 \(message\): - Policy CMP0053 is not set: Simplify variable reference and escape sequence - evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the - cmake_policy command to set the policy and suppress this warning. - - For input: - - '\\' - - the old evaluation rules produce: - - '\\' - - but the new evaluation rules produce an error: - - Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/CMP0053-WARN.cmake:2 - when parsing string - \\ - Invalid character escape '\\' \(at end of input\). - - Using the old result for compatibility since the policy is not set. -Call Stack \(most recent call first\): - CMP0053-WARN.cmake:5 \(escape\) - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -\\$ diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN.cmake b/Tests/RunCMake/Syntax/CMP0053-WARN.cmake deleted file mode 100644 index 6e8b07bbee..0000000000 --- a/Tests/RunCMake/Syntax/CMP0053-WARN.cmake +++ /dev/null @@ -1,5 +0,0 @@ -macro (escape str) - message("${str}") -endmacro () - -escape("\\") diff --git a/Tests/RunCMake/Syntax/CMakeLists.txt b/Tests/RunCMake/Syntax/CMakeLists.txt index 2897109554..bf2ef1506e 100644 --- a/Tests/RunCMake/Syntax/CMakeLists.txt +++ b/Tests/RunCMake/Syntax/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW-stderr.txt b/Tests/RunCMake/Syntax/Dollar-stderr.txt similarity index 100% rename from Tests/RunCMake/Syntax/CMP0053-Dollar-NEW-stderr.txt rename to Tests/RunCMake/Syntax/Dollar-stderr.txt diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW.cmake b/Tests/RunCMake/Syntax/Dollar.cmake similarity index 71% rename from Tests/RunCMake/Syntax/CMP0053-Dollar-NEW.cmake rename to Tests/RunCMake/Syntax/Dollar.cmake index b81fd56eb4..6b87064d5d 100644 --- a/Tests/RunCMake/Syntax/CMP0053-Dollar-NEW.cmake +++ b/Tests/RunCMake/Syntax/Dollar.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0053 NEW) - set($ value) set(dollar $) message("-->${${dollar}}<--") diff --git a/Tests/RunCMake/Syntax/Escape2-stderr.txt b/Tests/RunCMake/Syntax/Escape2-stderr.txt index cc3bdf07b0..7f10c3cce2 100644 --- a/Tests/RunCMake/Syntax/Escape2-stderr.txt +++ b/Tests/RunCMake/Syntax/Escape2-stderr.txt @@ -1,7 +1,7 @@ -CMake Error at Escape2.cmake:4 \(message\): +CMake Error at Escape2.cmake:2 \(message\): Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/Escape2.cmake:4 + .*/Tests/RunCMake/Syntax/Escape2.cmake:2 when parsing string @@ -9,5 +9,5 @@ CMake Error at Escape2.cmake:4 \(message\): Invalid character escape '\\' \(at end of input\). Call Stack \(most recent call first\): - Escape2.cmake:7 \(escape\) + Escape2.cmake:5 \(escape\) CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/Escape2.cmake b/Tests/RunCMake/Syntax/Escape2.cmake index 078a822892..6e8b07bbee 100644 --- a/Tests/RunCMake/Syntax/Escape2.cmake +++ b/Tests/RunCMake/Syntax/Escape2.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0053 NEW) - macro (escape str) message("${str}") endmacro () diff --git a/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in index d1d908cbbc..9e59b78fda 100644 --- a/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in +++ b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in @@ -1,7 +1,7 @@ -CMake Error at EscapeChar-@char@-@testnum@.cmake:3 \(message\): +CMake Error at EscapeChar-@char@-@testnum@.cmake:1 \(message\): Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/EscapeChar-@char@-@testnum@.cmake:3 + .*/Tests/RunCMake/Syntax/EscapeChar-@char@-@testnum@.cmake:1 when parsing string diff --git a/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in index 6f265e5b22..2c3bc73755 100644 --- a/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in +++ b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in @@ -1,3 +1 @@ -cmake_policy(SET CMP0053 NEW) - message("-->\@char@<--") diff --git a/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake index e9c568da05..1965791052 100644 --- a/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake +++ b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake @@ -1,5 +1,3 @@ -cmake_policy(SET CMP0053 NEW) - set("semicolon;in;name" semicolon) set("dollar$in$name" dollar) set("brace{in}name" brace) diff --git a/Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt b/Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt index 077272d4b4..bb8f5c62d9 100644 --- a/Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt +++ b/Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt @@ -1 +1,2 @@ --->"<-- +^-->\\"<-- +-->\\"<--$ diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt index 71b9c3cbde..c999d3ef46 100644 --- a/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt @@ -1,12 +1,4 @@ ^CMake Error at NameWithCarriageReturn.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake:1 - - when parsing string - - \${var\\rwith\\rcarriagereturn} - - syntax error, unexpected cal_SYMBOL, expecting } \(6\) + message called with incorrect number of arguments Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt deleted file mode 100644 index c43e1be972..0000000000 --- a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at NameWithCarriageReturnQuoted.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake:1 - - when parsing string - - \${var\\rwith\\rcarriagereturn} - - syntax error, unexpected cal_SYMBOL, expecting } \(6\) -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt index 3a2613592b..f286a26092 100644 --- a/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt @@ -1,12 +1,4 @@ ^CMake Error at NameWithEscapedSpaces.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake:1 - - when parsing string - - \${var\\ with\\ escaped\\ space} - - syntax error, unexpected cal_SYMBOL, expecting } \(6\) + message called with incorrect number of arguments Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt deleted file mode 100644 index 0f40649c58..0000000000 --- a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at NameWithEscapedSpacesQuoted.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake:1 - - when parsing string - - \${var\\ with\\ escaped\\ space} - - syntax error, unexpected cal_SYMBOL, expecting } \(6\) -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt index d7fc38a0a6..5a41740f6b 100644 --- a/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt @@ -1,12 +1,4 @@ ^CMake Error at NameWithEscapedTabs.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake:1 - - when parsing string - - \${var\\ with\\ escaped\\ tab} - - Invalid escape sequence \\.? + message called with incorrect number of arguments Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt deleted file mode 100644 index 915dbaa477..0000000000 --- a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at NameWithEscapedTabsQuoted.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake:1 - - when parsing string - - \${var\\ with\\ escaped\\ tab} - - Invalid escape sequence \\.? -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt b/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt index 77bd470fab..7091970872 100644 --- a/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt @@ -1,12 +1,4 @@ ^CMake Error at NameWithNewline.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithNewline.cmake:1 - - when parsing string - - \${var\\nwith\\nnewline} - - syntax error, unexpected cal_SYMBOL, expecting } \(6\) + message called with incorrect number of arguments Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt deleted file mode 100644 index 1d14b1d466..0000000000 --- a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Error at NameWithNewlineQuoted.cmake:1 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake:1 - - when parsing string - - \${var\\nwith\\nnewline} - - syntax error, unexpected cal_SYMBOL, expecting } \(6\) -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt index 71e8db307e..44e0a81bb0 100644 --- a/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt @@ -7,6 +7,6 @@ \${var - syntax error, unexpected end of file, expecting } \(6\) + There is an unterminated variable reference. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt index 6e3744a622..4a129327c8 100644 --- a/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt @@ -7,6 +7,6 @@ \${var with space} - syntax error, unexpected cal_SYMBOL, expecting } \(3\) + Invalid character \(' '\) in a variable name: 'var' Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt index 84ccdbee30..b5f3348119 100644 --- a/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt @@ -7,6 +7,6 @@ \${var - syntax error, unexpected end of file, expecting } \(6\) + There is an unterminated variable reference. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt index e18268ac50..0757300ffc 100644 --- a/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt +++ b/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt @@ -7,6 +7,6 @@ \${var with tab} - syntax error, unexpected cal_SYMBOL, expecting } \(3\) + Invalid character \(' '\) in a variable name: 'var' Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/ParenInENV-result.txt b/Tests/RunCMake/Syntax/ParenInENV-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/ParenInENV-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-result.txt b/Tests/RunCMake/Syntax/ParenInENV1-result.txt similarity index 100% rename from Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-result.txt rename to Tests/RunCMake/Syntax/ParenInENV1-result.txt diff --git a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInENV1-stderr.txt similarity index 66% rename from Tests/RunCMake/Syntax/ParenInENV-stderr.txt rename to Tests/RunCMake/Syntax/ParenInENV1-stderr.txt index 24c810bef0..443ac7a651 100644 --- a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt +++ b/Tests/RunCMake/Syntax/ParenInENV1-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at ParenInENV.cmake:2: +CMake Warning \(dev\) at ParenInENV1.cmake:2: Syntax Warning in cmake code at column 21 Argument not separated from preceding token by whitespace. @@ -6,15 +6,15 @@ Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. -CMake Error at ParenInENV.cmake:2 \(message\): +CMake Error at ParenInENV1.cmake:2 \(message\): Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2 + .*/Tests/RunCMake/Syntax/ParenInENV1.cmake:2 when parsing string -->\$ENV{e - syntax error, unexpected end of file, expecting } \(10\) + There is an unterminated variable reference\. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/ParenInENV.cmake b/Tests/RunCMake/Syntax/ParenInENV1.cmake similarity index 100% rename from Tests/RunCMake/Syntax/ParenInENV.cmake rename to Tests/RunCMake/Syntax/ParenInENV1.cmake diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInENV2-stderr.txt similarity index 100% rename from Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt rename to Tests/RunCMake/Syntax/ParenInENV2-stderr.txt diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake b/Tests/RunCMake/Syntax/ParenInENV2.cmake similarity index 62% rename from Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake rename to Tests/RunCMake/Syntax/ParenInENV2.cmake index b5cdf0fd1d..53c5e2b1a5 100644 --- a/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake +++ b/Tests/RunCMake/Syntax/ParenInENV2.cmake @@ -1,3 +1,2 @@ -cmake_policy(SET CMP0053 NEW) set("ENV{e(x)}" value) message(-->$ENV{e\(x\)}<--) diff --git a/Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt deleted file mode 100644 index 7020c7e738..0000000000 --- a/Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt +++ /dev/null @@ -1 +0,0 @@ --->value<-- diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt b/Tests/RunCMake/Syntax/ParenInQuotedENV1-result.txt similarity index 100% rename from Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt rename to Tests/RunCMake/Syntax/ParenInQuotedENV1-result.txt diff --git a/Tests/RunCMake/Syntax/ParenInQuotedENV1-stderr.txt b/Tests/RunCMake/Syntax/ParenInQuotedENV1-stderr.txt new file mode 100644 index 0000000000..7803634deb --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenInQuotedENV1-stderr.txt @@ -0,0 +1,13 @@ +^CMake Error at ParenInQuotedENV1\.cmake:2 \(message\): + Syntax error in cmake code at + + [^ +]*/Tests/RunCMake/Syntax/ParenInQuotedENV1\.cmake:2 + + when parsing string + + -->\$ENV{e\(x\)}<-- + + Invalid character \('\('\) in a variable name: 'e' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/ParenInQuotedENV.cmake b/Tests/RunCMake/Syntax/ParenInQuotedENV1.cmake similarity index 100% rename from Tests/RunCMake/Syntax/ParenInQuotedENV.cmake rename to Tests/RunCMake/Syntax/ParenInQuotedENV1.cmake diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInQuotedENV2-stderr.txt similarity index 100% rename from Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt rename to Tests/RunCMake/Syntax/ParenInQuotedENV2-stderr.txt diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake b/Tests/RunCMake/Syntax/ParenInQuotedENV2.cmake similarity index 63% rename from Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake rename to Tests/RunCMake/Syntax/ParenInQuotedENV2.cmake index 5559d4b9d8..0a836d06e1 100644 --- a/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake +++ b/Tests/RunCMake/Syntax/ParenInQuotedENV2.cmake @@ -1,3 +1,2 @@ -cmake_policy(SET CMP0053 NEW) set("ENV{e(x)}" value) message("-->$ENV{e\(x\)}<--") diff --git a/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt index 0a6b60fb9e..8fb5650939 100644 --- a/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt +++ b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt @@ -1,7 +1,7 @@ -CMake Error at ParenInVarName0.cmake:4 \(message\): +CMake Error at ParenInVarName0.cmake:2 \(message\): Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:4 + .*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:2 when parsing string diff --git a/Tests/RunCMake/Syntax/ParenInVarName0.cmake b/Tests/RunCMake/Syntax/ParenInVarName0.cmake index f863d20c62..3e93d4eb4b 100644 --- a/Tests/RunCMake/Syntax/ParenInVarName0.cmake +++ b/Tests/RunCMake/Syntax/ParenInVarName0.cmake @@ -1,4 +1,2 @@ -cmake_policy(SET CMP0053 NEW) - set("e(x)" value) message("-->${e(x)}<--") diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-result.txt b/Tests/RunCMake/Syntax/ParenInVarName1-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/ParenInVarName1-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt deleted file mode 100644 index 18ca946fd9..0000000000 --- a/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -CMake Error at ParenInVarName1.cmake:4 \(message\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/ParenInVarName1.cmake:4 - - when parsing string - - -->\${e\(x\)}<-- - - syntax error, unexpected cal_SYMBOL, expecting } \(6\) -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/ParenInVarName1.cmake b/Tests/RunCMake/Syntax/ParenInVarName1.cmake deleted file mode 100644 index 9fdc87bbfc..0000000000 --- a/Tests/RunCMake/Syntax/ParenInVarName1.cmake +++ /dev/null @@ -1,4 +0,0 @@ -cmake_policy(SET CMP0053 OLD) - -set("{e(x)}" value) -message("-->${e(x)}<--") diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index 8f944b29e2..2817f764f3 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -1,19 +1,10 @@ include(RunCMake) -set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON) run_cmake(BOM-UTF-8) run_cmake(BOM-UTF-16-LE) run_cmake(BOM-UTF-16-BE) run_cmake(BOM-UTF-32-LE) run_cmake(BOM-UTF-32-BE) -run_cmake(CMP0053-At-OLD) -run_cmake(CMP0053-At-NEW) -run_cmake(CMP0053-At-WARN) -run_cmake(CMP0053-At-WARN-newlines) -run_cmake(CMP0053-WARN) -run_cmake(CMP0053-NUL) -run_cmake(CMP0053-ParenInENV) -run_cmake(CMP0053-ParenInQuotedENV) run_cmake(CommandSpaces) run_cmake(CommandTabs) run_cmake(CommandNewlines) @@ -65,11 +56,9 @@ run_cmake(ParenNoSpace0) run_cmake(ParenNoSpace1) run_cmake(ParenNoSpace2) run_cmake(ParenInVarName0) -run_cmake(ParenInVarName1) run_cmake(UnterminatedCall1) run_cmake(UnterminatedCall2) run_cmake(UnterminatedString) -run_cmake(UnterminatedBrace0) run_cmake(UnterminatedBrace1) run_cmake(UnterminatedBracket0) run_cmake(UnterminatedBracket1) @@ -80,14 +69,17 @@ run_cmake(ImproperNesting) run_cmake(ExpandInAt) run_cmake(EscapedAt) run_cmake(EscapeQuotes) +run_cmake(At) run_cmake(AtWithVariable) run_cmake(AtWithVariableEmptyExpansion) run_cmake(AtWithVariableAtOnly) run_cmake(AtWithVariableEmptyExpansionAtOnly) run_cmake(AtWithVariableFile) run_cmake(AtWithVariableAtOnlyFile) -run_cmake(ParenInENV) -run_cmake(ParenInQuotedENV) +run_cmake(ParenInENV1) +run_cmake(ParenInENV2) +run_cmake(ParenInQuotedENV1) +run_cmake(ParenInQuotedENV2) # Variable name tests run_cmake(NameWithSpaces) @@ -102,20 +94,7 @@ run_cmake(NameWithNewlineQuoted) run_cmake(NameWithCarriageReturnQuoted) run_cmake(NameWithEscapedSpacesQuoted) run_cmake(NameWithEscapedTabsQuoted) -run_cmake(CMP0053-NameWithSpaces) -run_cmake(CMP0053-NameWithTabs) -run_cmake(CMP0053-NameWithNewline) -run_cmake(CMP0053-NameWithCarriageReturn) -run_cmake(CMP0053-NameWithEscapedSpaces) -run_cmake(CMP0053-NameWithEscapedTabs) -run_cmake(CMP0053-NameWithSpacesQuoted) -run_cmake(CMP0053-NameWithTabsQuoted) -run_cmake(CMP0053-NameWithNewlineQuoted) -run_cmake(CMP0053-NameWithCarriageReturnQuoted) -run_cmake(CMP0053-NameWithEscapedSpacesQuoted) -run_cmake(CMP0053-NameWithEscapedTabsQuoted) -run_cmake(CMP0053-Dollar-OLD) -run_cmake(CMP0053-Dollar-NEW) +run_cmake(Dollar) # Variable special types run_cmake(QueryCache) diff --git a/Tests/RunCMake/Syntax/Unquoted2.cmake b/Tests/RunCMake/Syntax/Unquoted2.cmake index d94057d903..4f8ffb28b2 100644 --- a/Tests/RunCMake/Syntax/Unquoted2.cmake +++ b/Tests/RunCMake/Syntax/Unquoted2.cmake @@ -1,3 +1 @@ -cmake_policy(SET CMP0053 NEW) - message(\[[Unquoted Bracket Argument 1]]) diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt deleted file mode 100644 index c7238df5b2..0000000000 --- a/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -CMake Error at UnterminatedBrace0.cmake:1 \(set\): - Syntax error in cmake code at - - .*/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake:1 - - when parsing string - - \${ - - syntax error, unexpected end of file, expecting } \(3\) -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake deleted file mode 100644 index 09af0cea65..0000000000 --- a/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake +++ /dev/null @@ -1 +0,0 @@ -set(var "${") diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt index 4df56d1e30..745a651d0c 100644 --- a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt +++ b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt @@ -1,7 +1,7 @@ -CMake Error at UnterminatedBrace1.cmake:2 \(set\): +CMake Error at UnterminatedBrace1.cmake:1 \(set\): Syntax error in cmake code at - .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:2 + .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:1 when parsing string diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake index db39af7269..09af0cea65 100644 --- a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake +++ b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake @@ -1,2 +1 @@ -cmake_policy(SET CMP0053 NEW) set(var "${") diff --git a/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake b/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake index 151b907aaf..2f9fc7de13 100644 --- a/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake +++ b/Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0053 NEW) include(RunCMake) run_cmake(VsDotnetSdkStartupObject) diff --git a/Tests/RunCMake/VsNugetPackageRestore/RunCMakeTest.cmake b/Tests/RunCMake/VsNugetPackageRestore/RunCMakeTest.cmake index 625167c063..8ca966fc58 100644 --- a/Tests/RunCMake/VsNugetPackageRestore/RunCMakeTest.cmake +++ b/Tests/RunCMake/VsNugetPackageRestore/RunCMakeTest.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0053 NEW) include(RunCMake) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VsNugetPackageRestore) diff --git a/Tests/RunCMake/cmake_language/defer_call-stderr.txt b/Tests/RunCMake/cmake_language/defer_call-stderr.txt index 7e8d8ca153..d1ae0d79b5 100644 --- a/Tests/RunCMake/cmake_language/defer_call-stderr.txt +++ b/Tests/RunCMake/cmake_language/defer_call-stderr.txt @@ -1,13 +1,4 @@ -^CMake Deprecation Warning at defer_call/CMakeLists.txt:[0-9]+ \(cmake_policy\): - The OLD behavior for policy CMP0053 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -+ -CMake Warning at defer_call/CMakeLists.txt:3 \(message\): +^CMake Warning at defer_call/CMakeLists.txt:2 \(message\): Double-Deferred Warning In Subdirectory: '[^']*/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt:DEFERRED:id3' diff --git a/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt b/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt index 544b9f48db..ea299852c1 100644 --- a/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt +++ b/Tests/RunCMake/cmake_language/defer_call/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0053 OLD) cmake_language(DEFER ID id1 CALL message STATUS "Deferred Message In Subdirectory: '${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}'") cmake_language(DEFER ID id2 CALL cmake_language DEFER ID id3 CALL