summaryrefslogtreecommitdiffstats
path: root/tools/slang-test/slang-test-main.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-11-30 16:34:52 -0500
committerGitHub <noreply@github.com>2021-11-30 16:34:52 -0500
commitace4e334bc5fb299d2890b5e3f35dfd84ea32606 (patch)
tree9a18aa01dda4c8e8b7305bddfd7009fdb8e11a95 /tools/slang-test/slang-test-main.cpp
parentdd18f2bff2abd13548742e30c25a31b9ea9a0cbd (diff)
Use test-server on CI (#2034)
* #include an absolute path didn't work - because paths were taken to always be relative. * Vary what SpawnType is used, if one isn't explicitly set. * Terminate on linux if exec fails. * Use a more sophisticated sleeping mechanism. * Attempt to make CI tests to work on aarch64 debug. Small fixes.
Diffstat (limited to 'tools/slang-test/slang-test-main.cpp')
-rw-r--r--tools/slang-test/slang-test-main.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index ac8ec0e10..e734e1c4c 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -674,7 +674,7 @@ static Result _executeRPC(TestContext* context, SpawnType spawnType, const Unown
SLANG_RETURN_ON_FAIL(rpcConnection->sendCall(method, rttiInfo, args));
// Wait for the result
- rpcConnection->waitForResult(context->timeOutInMs);
+ rpcConnection->waitForResult(context->connectionTimeOutInMs);
if (!rpcConnection->hasMessage())
{
@@ -1057,14 +1057,17 @@ ToolReturnCode spawnAndWait(TestContext* context, const String& testPath, SpawnT
const auto& options = context->options;
+ const auto finalSpawnType = context->getFinalSpawnType(spawnType);
+
SlangResult spawnResult = SLANG_FAIL;
- switch (spawnType)
+ switch (finalSpawnType)
{
case SpawnType::UseExe:
{
spawnResult = spawnAndWaitExe(context, testPath, cmdLine, outExeRes);
break;
}
+ case SpawnType::Default:
case SpawnType::UseSharedLibrary:
{
spawnResult = spawnAndWaitSharedLibrary(context, testPath, cmdLine, outExeRes);
@@ -1073,7 +1076,7 @@ ToolReturnCode spawnAndWait(TestContext* context, const String& testPath, SpawnT
case SpawnType::UseFullyIsolatedTestServer:
case SpawnType::UseTestServer:
{
- spawnResult = spawnAndWaitTestServer(context, spawnType, testPath, cmdLine, outExeRes);
+ spawnResult = spawnAndWaitTestServer(context, finalSpawnType, testPath, cmdLine, outExeRes);
break;
}
default: break;
@@ -3601,7 +3604,8 @@ SlangResult innerMain(int argc, char** argv)
{
SlangSession* session = context.getSession();
- StdWriters::getOut().print("Supported backends:");
+ auto out = StdWriters::getOut();
+ out.print("Supported backends:");
for (int i = 0; i < SLANG_PASS_THROUGH_COUNT_OF; ++i)
{
@@ -3624,11 +3628,11 @@ SlangResult innerMain(int argc, char** argv)
SLANG_ASSERT(passThroughCategories[i] == nullptr);
passThroughCategories[i] = categorySet.add(buf.getBuffer() + 1, fullTestCategory);
- StdWriters::getOut().write(buf.getBuffer(), buf.getLength());
+ out.write(buf.getBuffer(), buf.getLength());
}
}
- StdWriters::getOut().print("\n");
+ out.print("\n");
}
// Working out what renderApis is worked on on demand through
@@ -3727,18 +3731,20 @@ SlangResult innerMain(int argc, char** argv)
TestReporter::SuiteScope suiteScope(&reporter, "unit tests");
TestReporter::set(&reporter);
+ const auto spawnType = context.getFinalSpawnType();
+
// Run the unit tests
{
TestOptions testOptions;
testOptions.categories.add(unitTestCategory);
testOptions.categories.add(smokeTestCategory);
- runUnitTestModule(&context, testOptions, context.options.defaultSpawnType, "slang-unit-test-tool");
+ runUnitTestModule(&context, testOptions, spawnType, "slang-unit-test-tool");
}
{
TestOptions testOptions;
testOptions.categories.add(unitTestCategory);
- runUnitTestModule(&context, testOptions, context.options.defaultSpawnType, "gfx-unit-test-tool");
+ runUnitTestModule(&context, testOptions, spawnType, "gfx-unit-test-tool");
}
TestReporter::set(nullptr);