diff options
Diffstat (limited to 'tools/slang-test/test-context.cpp')
| -rw-r--r-- | tools/slang-test/test-context.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp index 158258873..b94435a8e 100644 --- a/tools/slang-test/test-context.cpp +++ b/tools/slang-test/test-context.cpp @@ -69,8 +69,8 @@ static void appendXmlEncode(const String& in, StringBuilder& out) } } -TestContext::TestContext(TestOutputMode outputMode) : - m_outputMode(outputMode) +TestContext::TestContext() : + m_outputMode(TestOutputMode::Default) { m_totalTestCount = 0; m_passedTestCount = 0; @@ -82,6 +82,29 @@ TestContext::TestContext(TestOutputMode outputMode) : m_inTest = false; m_dumpOutputOnFailure = false; m_isVerbose = false; + + m_session = nullptr; +} + +Result TestContext::init(TestOutputMode outputMode) +{ + m_outputMode = outputMode; + + m_session = spCreateSession(nullptr); + if (!m_session) + { + return SLANG_FAIL; + } + + return SLANG_OK; +} + +TestContext::~TestContext() +{ + if (m_session) + { + spDestroySession(m_session); + } } bool TestContext::canWriteStdError() const @@ -601,4 +624,4 @@ void TestContext::endSuite() } m_suiteStack.RemoveLast(); -}
\ No newline at end of file +} |
