summaryrefslogtreecommitdiffstats
path: root/tools/slang-test/test-context.cpp
diff options
context:
space:
mode:
authorAnders Leino <aleino@nvidia.com>2025-02-13 08:31:24 +0200
committerGitHub <noreply@github.com>2025-02-13 06:31:24 +0000
commit8406b5647a61fb70be4e041a76c1b64b05a70452 (patch)
tree4bbc03e4c46779f1b8c5e8648410ad071aebab6b /tools/slang-test/test-context.cpp
parent74852ceb6b3bcc018042aba3e30933b7b6fc09ef (diff)
Migrate slang-test away from deprecated Slang API (#6343)
This helps to address #4760.
Diffstat (limited to 'tools/slang-test/test-context.cpp')
-rw-r--r--tools/slang-test/test-context.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp
index 685ee1f2e..096b16d7c 100644
--- a/tools/slang-test/test-context.cpp
+++ b/tools/slang-test/test-context.cpp
@@ -16,8 +16,6 @@ thread_local int slangTestThreadIndex = 0;
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)
// 10 mins(!). This seems to be the order of time needed for timeout on a CI ARM test system on
@@ -87,12 +85,7 @@ Result TestContext::init(const char* inExePath)
{
SlangGlobalSessionDesc desc = {};
desc.enableGLSL = true;
- slang_createGlobalSession2(&desc, &m_session);
-
- if (!m_session)
- {
- return SLANG_FAIL;
- }
+ slang::createGlobalSession(&desc, m_session.writeRef());
exePath = inExePath;
SLANG_RETURN_ON_FAIL(TestToolUtil::getExeDirectoryPath(inExePath, exeDirectoryPath));
SLANG_RETURN_ON_FAIL(TestToolUtil::getDllDirectoryPath(inExePath, dllDirectoryPath));
@@ -110,10 +103,6 @@ TestContext::~TestContext()
LanguageServerProtocol::ExitParams::methodName,
JSONValue::makeInt(0));
}
- if (m_session)
- {
- spDestroySession(m_session);
- }
}
TestContext::InnerMainFunc TestContext::getInnerMainFunc(const String& dirPath, const String& name)