From 3df9fe8a8a1aa01db2651eacd1d8bec50d0ee90c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 18 Jul 2025 13:14:33 -0700 Subject: 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> --- tools/slang-test/options.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tools') 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) -- cgit v1.2.3