summaryrefslogtreecommitdiff
path: root/tools/slang-test/test-context.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-11-21 13:41:34 -0500
committerGitHub <noreply@github.com>2018-11-21 13:41:34 -0500
commite21d5ad650130631e17662ce8f22d15315ab597a (patch)
treea1f5053efebc6184d21b0151e38ba1a52e74b07c /tools/slang-test/test-context.cpp
parent9bb11b69a08c66e2857f439837e2253658aed9a4 (diff)
Feature/early depth stencil (#727)
* First pass support for early depth stencil. * Add a simple test to check if output has attributes. * Use cross compilation to test [earlydepthstencil] on glsl. * If target is dxil, use dxc to test against. Add hlsl to test earlydepthstencil against. * * Added spSessionHasCompileTargetSupport * Made slang-test use spSessionHasCompileTargetSupport to ignore tests that cannot run
Diffstat (limited to 'tools/slang-test/test-context.cpp')
-rw-r--r--tools/slang-test/test-context.cpp29
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
+}