From ace4e334bc5fb299d2890b5e3f35dfd84ea32606 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 30 Nov 2021 16:34:52 -0500 Subject: 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. --- tools/slang-test/test-context.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tools/slang-test/test-context.cpp') diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp index eeb23b695..39dd52313 100644 --- a/tools/slang-test/test-context.cpp +++ b/tools/slang-test/test-context.cpp @@ -15,6 +15,12 @@ using namespace Slang; TestContext::TestContext() { m_session = nullptr; + + /// if we are testing on arm, debug, we may want to increase the connection timeout +#if (SLANG_PROCESSOR_ARM || SLANG_PROCESSOR_ARM_64) && defined(_DEBUG) + // 5 mins(!). This seems to be the order of time needed for timeout on a CI ARM test system on debug + connectionTimeOutInMs = 1000 * 60 * 5; +#endif } Result TestContext::init(const char* exePath) @@ -170,4 +176,25 @@ bool TestContext::canRunTestWithRenderApiFlags(Slang::RenderApiFlags requiredFla return (requiredFlags & options.enabledApis) == requiredFlags; } +SpawnType TestContext::getFinalSpawnType(SpawnType spawnType) +{ + if (spawnType == SpawnType::Default) + { + if (options.outputMode == TestOutputMode::Default) + { + return SpawnType::UseSharedLibrary; + } + else + { + return SpawnType::UseTestServer; + } + } + + // Just return whatever spawnType was passed in + return spawnType; +} +SpawnType TestContext::getFinalSpawnType() +{ + return getFinalSpawnType(options.defaultSpawnType); +} -- cgit v1.2.3