summaryrefslogtreecommitdiffstats
path: root/Source/cmTestGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-27 13:26:21 (GMT)
committerCraig Scott <craig.scott@crascit.com>2020-07-27 22:04:11 (GMT)
commit5fc5f4d26ed0736f4023d1aa1de2aa24d4df15af (patch)
treed315e0d18b95daeea9374e40af817b8bc277bf0c /Source/cmTestGenerator.cxx
parent16327086f020e5a2f4267e327e27b50b73e131ca (diff)
downloadCMake-5fc5f4d26ed0736f4023d1aa1de2aa24d4df15af.zip
CMake-5fc5f4d26ed0736f4023d1aa1de2aa24d4df15af.tar.gz
CMake-5fc5f4d26ed0736f4023d1aa1de2aa24d4df15af.tar.bz2
add_test: Revert "Allow special characters in test name"
Revert commit f84af8e270 (add_test: Allow special characters in test name, 2020-05-16, v3.18.0-rc1~142^2). Unfortunately the fix breaks projects that were working around the limitation with manual escaping. The fix can be re-introduced with a policy in a future version. Also add a 3.18.1 release note explaining the change. Fixes: #21017, #20965 Issue: #19391
Diffstat (limited to 'Source/cmTestGenerator.cxx')
-rw-r--r--Source/cmTestGenerator.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index e10a8e2..af91177 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -77,7 +77,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
cmGeneratorExpression ge(this->Test->GetBacktrace());
// Start the test command.
- os << indent << "add_test(\"" << this->Test->GetName() << "\" ";
+ os << indent << "add_test(" << this->Test->GetName() << " ";
// Evaluate command line arguments
std::vector<std::string> argv =
@@ -127,8 +127,8 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
os << ")\n";
// Output properties for the test.
- os << indent << "set_tests_properties(\"" << this->Test->GetName()
- << "\" PROPERTIES ";
+ os << indent << "set_tests_properties(" << this->Test->GetName()
+ << " PROPERTIES ";
for (auto const& i : this->Test->GetProperties().GetList()) {
os << " " << i.first << " "
<< cmOutputConverter::EscapeForCMake(
@@ -140,8 +140,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os, Indent indent)
{
- os << indent << "add_test(\"" << this->Test->GetName()
- << "\" NOT_AVAILABLE)\n";
+ os << indent << "add_test(" << this->Test->GetName() << " NOT_AVAILABLE)\n";
}
bool cmTestGenerator::NeedsScriptNoConfig() const
@@ -161,8 +160,9 @@ void cmTestGenerator::GenerateOldStyle(std::ostream& fout, Indent indent)
std::string exe = command[0];
cmSystemTools::ConvertToUnixSlashes(exe);
- fout << indent << "add_test(\"" << this->Test->GetName() << "\" \"" << exe
- << "\"";
+ fout << indent;
+ fout << "add_test(";
+ fout << this->Test->GetName() << " \"" << exe << "\"";
for (std::string const& arg : cmMakeRange(command).advance(1)) {
// Just double-quote all arguments so they are re-parsed