From b45706b3f532f85525de5746f1f607ba2e57fc88 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Wed, 3 Sep 2025 20:13:45 -0700 Subject: 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 --- tools/slang-test/slang-test-main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') 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))) -- cgit v1.2.3