From 271ae7165915cf9910e2de0224159ea0fdd8ce72 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Mon, 3 Apr 2023 11:46:03 +0800 Subject: Fix several silently failing tests (#2767) * Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests --------- Co-authored-by: Yong He --- tools/slang-test/slang-test-main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tools/slang-test/slang-test-main.cpp') diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 71f5c04bd..51c618187 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -3900,15 +3900,20 @@ static bool shouldRunTest( if(!endsWithAllowedExtension(context, filePath)) return false; - if( context->options.testPrefix ) + if(!context->options.testPrefixes.getCount()) { - if( strncmp(context->options.testPrefix, filePath.begin(), strlen(context->options.testPrefix)) != 0 ) + return true; + } + + // If we have prefixes, it has to match one of them + for(auto& p : context->options.testPrefixes) + { + if(filePath.startsWith(p)) { - return false; + return true; } } - - return true; + return false; } void getFilesInDirectory(String directoryPath, List& files) -- cgit v1.2.3