summaryrefslogtreecommitdiff
path: root/tools/slang-test
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-10-18 12:19:45 -0700
committerGitHub <noreply@github.com>2021-10-18 12:19:45 -0700
commit2f44d9e01234911dd563f0456b9d861fd8db286d (patch)
treee2727f31654ebc93bae6a1de4b25586be6fb9d10 /tools/slang-test
parent87e7c49fbfccd54be0d1cee61fba8f309b1f792e (diff)
GFX: implement mutable shader objects. (#1963)
* GFX: implement mutable shader objects. * Revert unnecessary changes * Revert more changes. * Fix clang errors. * Fix clang/gcc errors. * Fix clang errors. * Remove CPU test. * Fix after merge. * Fix after merge. * Remove gl test * Code review fixes. * Fixing all vk validation errors. * Flush test output more often. * Fix a crash in `specializeDynamicAssociatedTypeLookup`. * temporarily disable std-lib-serialize test to see what happens * Fix crashes. * Make sure cpu gfx unit tests are properly disabled on TeamCity. * Disable cpu test. * Fix. * Fix cuda. * Disable nv-ray-tracing-motion-blur Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/slang-test')
-rw-r--r--tools/slang-test/options.cpp4
-rw-r--r--tools/slang-test/options.h3
-rw-r--r--tools/slang-test/slang-test-main.cpp8
-rw-r--r--tools/slang-test/test-reporter.cpp4
4 files changed, 17 insertions, 2 deletions
diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp
index 27b759a0e..fa7f332b0 100644
--- a/tools/slang-test/options.cpp
+++ b/tools/slang-test/options.cpp
@@ -266,6 +266,10 @@ static bool _isSubCommand(const char* arg)
return res;
}
}
+ else if (strcmp(arg, "-skip-api-detection") == 0)
+ {
+ optionsOut->skipApiDetection = true;
+ }
else
{
stdError.print("unknown option '%s'\n", arg);
diff --git a/tools/slang-test/options.h b/tools/slang-test/options.h
index a8c2e3852..eacbc7acb 100644
--- a/tools/slang-test/options.h
+++ b/tools/slang-test/options.h
@@ -61,6 +61,9 @@ struct Options
// force generation of baselines for HLSL tests
bool generateHLSLBaselines = false;
+ // Whether to skip the step of creating test devices to check if an API is actually available.
+ bool skipApiDetection = false;
+
// Dump expected/actual output on failures, for debugging.
// This is especially intended for use in continuous
// integration builds.
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 6fb270c35..8f7c7e35b 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -897,6 +897,11 @@ static RenderApiFlags _getAvailableRenderApiFlags(TestContext* context)
// See if it's possible the api is available
if (RenderApiUtil::calcHasApi(apiType))
{
+ if (context->options.skipApiDetection)
+ {
+ availableRenderApiFlags |= RenderApiFlags(1) << int(apiType);
+ continue;
+ }
// Try starting up the device
CommandLine cmdLine;
cmdLine.setExecutablePath(Path::combine(context->options.binDir, String("render-test") + ProcessUtil::getExecutableSuffix()));
@@ -908,7 +913,6 @@ static RenderApiFlags _getAvailableRenderApiFlags(TestContext* context)
StringBuilder builder;
builder << "-" << RenderApiUtil::getApiName(apiType);
cmdLine.addArg(builder);
-
// Run the render-test tool and see if the device could startup
ExecuteResult exeRes;
if (SLANG_SUCCEEDED(spawnAndWaitSharedLibrary(context, "device-startup", cmdLine, exeRes))
@@ -3337,6 +3341,8 @@ static void _disableCPPBackends(TestContext* context)
for (auto passThru : cppPassThrus)
{
context->availableBackendFlags &= ~(PassThroughFlags(1) << int(passThru));
+ context->availableRenderApiFlags &= ~(RenderApiFlag::CPU);
+ context->options.enabledApis &= ~(RenderApiFlag::CPU);
}
}
diff --git a/tools/slang-test/test-reporter.cpp b/tools/slang-test/test-reporter.cpp
index 84bcaa32c..8000fd2a5 100644
--- a/tools/slang-test/test-reporter.cpp
+++ b/tools/slang-test/test-reporter.cpp
@@ -338,6 +338,7 @@ void TestReporter::_addResult(const TestInfo& info)
_appendTime(info.executionTime, buffer);
}
printf("%s test: '%S' %s\n", resultString, info.name.toWString().begin(), buffer.getBuffer());
+ fflush(stdout);
};
switch (m_outputMode)
@@ -498,7 +499,7 @@ void TestReporter::message(TestMessageType type, const String& message)
{
fputs(message.getBuffer(), stderr);
}
-
+ fflush(stderr);
// Just dump out if can dump out
return;
}
@@ -515,6 +516,7 @@ void TestReporter::message(TestMessageType type, const String& message)
{
fputs(message.getBuffer(), stderr);
}
+ fflush(stderr);
}
if (m_currentMessage.getLength() > 0)