summaryrefslogtreecommitdiff
path: root/tools/slang-test
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-08-26 14:38:57 -0700
committerGitHub <noreply@github.com>2025-08-26 21:38:57 +0000
commit1681bc67fbae57b54b66c5dcfcbf315d1efa831b (patch)
treee4c1ed8d99000732debc960cec49460fa2c4dbde /tools/slang-test
parent4e9ee1dc80ce353640c1e2134249a1f93da9229a (diff)
Fail slang-test when VVL printed errors (#8280)
fixes https://github.com/shader-slang/slang/issues/8271 This PR does the following, - Fail slang-test when there are VVL error messages. - VVL error for `gfx-unit-test-tool/` were not captured properly by the debug callback. - Set an environment variable, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, for CI and VisualStudio project setup. - Ignores VVL error about NullHandle is used for the acceleration structure; a fix is at ToT of VVL and not available from release build yet. - Fix VVL error complaining about the varying inputs are not provided for the tests, `gfx-unit-test-tool/linkTimeTypeLayout.internal` and `gfx-unit-test-tool/linkTimeTypeLayoutNested.internal`. --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tools/slang-test')
-rw-r--r--tools/slang-test/slang-test-main.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 97c63c392..3f707b5e5 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -4848,6 +4848,13 @@ static SlangResult runUnitTestModule(
reporter->message(TestMessageType::RunError, "rpc failed");
}
+ // Check for VVL errors in unit tests
+ if (exeRes.debugLayer.getLength() > 0)
+ {
+ testResult = TestResult::Fail;
+ reporter->message(TestMessageType::TestFailure, exeRes.debugLayer);
+ }
+
// If the test fails, output any output - which might give information about
// individual tests that have failed.
if (testResult == TestResult::Fail)
@@ -4877,9 +4884,21 @@ static SlangResult runUnitTestModule(
// TODO(JS): Problem here could be exception not handled properly across
// shared library boundary.
testModule->setTestReporter(reporter);
+
+ // Clear any previous debug messages
+ coreDebugCallback.clear();
+
try
{
test.testFunc(&unitTestContext);
+
+ // Check for VVL errors after test completion
+ String debugMessages = coreDebugCallback.getString();
+ if (debugMessages.getLength() > 0)
+ {
+ reporter->message(TestMessageType::TestFailure, debugMessages);
+ reporter->addResult(TestResult::Fail);
+ }
}
catch (...)
{