mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 14:50:10 -06:00
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
This commit is contained in:
@@ -242,7 +242,7 @@ Run Tests
|
||||
|
||||
This option tells CTest to run the tests which are listed in the given
|
||||
file. The file must contain one exact test name per line.
|
||||
Lines can be commented out using a ``#``.
|
||||
Lines that do not exactly match any test names are ignored.
|
||||
This option can be combined with the other options like
|
||||
``-R``, ``-E``, ``-L`` or ``-LE``.
|
||||
|
||||
@@ -254,7 +254,7 @@ Run Tests
|
||||
|
||||
This option tells CTest to NOT run the tests which are listed in the given
|
||||
file. The file must contain one exact test name per line.
|
||||
Lines can be commented out using a ``#``.
|
||||
Lines that do not exactly match any test names are ignored.
|
||||
This option can be combined with the other options like
|
||||
``-R``, ``-E``, ``-L`` or ``-LE``.
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
Test1
|
||||
|
||||
est
|
||||
Test11
|
||||
# Test11
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
Test1
|
||||
|
||||
est
|
||||
Test11
|
||||
# Test11
|
||||
|
||||
Reference in New Issue
Block a user