summaryrefslogtreecommitdiffstats
path: root/tools/slang-test/options.cpp
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-07-18 13:14:33 -0700
committerGitHub <noreply@github.com>2025-07-18 20:14:33 +0000
commit3df9fe8a8a1aa01db2651eacd1d8bec50d0ee90c (patch)
treeae5cac42509e4d1d0ca931e50992de8dab86f311 /tools/slang-test/options.cpp
parent70273599e2bb8a8e2b0f7b5e7ad47fe2f00b2b40 (diff)
Add comment support to expected-failure files in slang-test (#7817)
* Initial plan * Add comment support to expected-failure files in slang-test Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Diffstat (limited to 'tools/slang-test/options.cpp')
-rw-r--r--tools/slang-test/options.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp
index 65783477f..ec30262fc 100644
--- a/tools/slang-test/options.cpp
+++ b/tools/slang-test/options.cpp
@@ -434,7 +434,20 @@ static bool _isSubCommand(const char* arg)
StringUtil::split(text.getUnownedSlice(), '\n', lines);
for (auto line : lines)
{
- optionsOut->expectedFailureList.add(line);
+ // Remove comments (everything after '#' character)
+ auto trimmedLine = line;
+ auto commentIndex = line.indexOf('#');
+ if (commentIndex != -1)
+ {
+ trimmedLine = line.head(commentIndex);
+ }
+
+ // Trim whitespace and skip empty lines
+ trimmedLine = trimmedLine.trim();
+ if (trimmedLine.getLength() > 0)
+ {
+ optionsOut->expectedFailureList.add(trimmedLine);
+ }
}
}
else if (strcmp(arg, "-test-dir") == 0)