summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-09-03 20:13:45 -0700
committerGitHub <noreply@github.com>2025-09-04 03:13:45 +0000
commitb45706b3f532f85525de5746f1f607ba2e57fc88 (patch)
tree565085f6d40bc60fddd027cf765e73fff77106c6 /tools
parenta766d27447aa0fcf69334c0467d9b1124892e180 (diff)
Handle slang-test command comments better (#8363)
Before this PR only the following was a valid line without any white-space character nor additional `/` character, ``` //TEST: ``` This PR is to allow slang-test to handle the following variants of the test command comments, ``` ///TEST: // TEST: // TEST: ////// TEST: ``` This PR revealed a regression on two tests: - tests/cpp-compiler/c-compile-shared-library.c (cpu) - tests/cpp-compiler/cpp-compile-shared-library.cpp (cpu) They are disabled as a part of this PR. And there is a new github issue to track it later, - https://github.com/shader-slang/slang/issues/8362
Diffstat (limited to 'tools')
-rw-r--r--tools/slang-test/slang-test-main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 351875aeb..87441c6c4 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -575,6 +575,13 @@ static SlangResult _gatherTestsForFile(
continue;
}
+ // Skip any extra slashes and spaces to handle malformed directives like ///TEST or // TEST
+ while (*cursor == '/')
+ {
+ cursor++;
+ }
+ skipHorizontalSpace(&cursor);
+
UnownedStringSlice command;
if (SLANG_FAILED(_extractCommand(&cursor, command)))