summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-08 21:07:36 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-08 21:25:33 (GMT)
commit1a4837641e8fad5d8a0c611ca1c70543c5748fe2 (patch)
tree7155dfda7d5000b14d5f9992a6d773103c371542 /Source/CTest
parentd52c66bfb3ec6bbf79fab9ef6ff4cdc9ba27a45b (diff)
downloadCMake-1a4837641e8fad5d8a0c611ca1c70543c5748fe2.zip
CMake-1a4837641e8fad5d8a0c611ca1c70543c5748fe2.tar.gz
CMake-1a4837641e8fad5d8a0c611ca1c70543c5748fe2.tar.bz2
ctest: Remove unnecessary and ambiguous tests-from-file comment syntax
Test names can contain `#`. Since we ignore lines that do not match any test names anyway, "commenting" can still work without explicit syntax. Also drop whitespace trimming for similar reasons. Fixes: #25741
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 63ff8d1..dae205c 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2037,12 +2037,9 @@ cm::optional<std::set<std::string>> cmCTestTestHandler::ReadTestListFile(
std::set<std::string> testNames;
std::string line;
while (cmSystemTools::GetLineFromStream(ifs, line)) {
- std::string trimmed = cmTrimWhitespace(line);
- if (trimmed.empty() || (trimmed[0] == '#')) {
- continue;
+ if (!line.empty()) {
+ testNames.insert(line);
}
-
- testNames.insert(trimmed);
}
result = std::move(testNames);
} else {