summaryrefslogtreecommitdiffstats
path: root/tools/test-server
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test-server')
-rw-r--r--tools/test-server/test-server-main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/test-server/test-server-main.cpp b/tools/test-server/test-server-main.cpp
index a2f7f8153..e98be6e5a 100644
--- a/tools/test-server/test-server-main.cpp
+++ b/tools/test-server/test-server-main.cpp
@@ -10,7 +10,10 @@
#include "../../source/core/slang-string.h"
#include "../../source/core/slang-test-tool-util.h"
#include "../../source/core/slang-writer.h"
+#include "../render-test/slang-support.h"
+#include "gfx-unit-test/gfx-test-util.h"
#include "slang-com-helper.h"
+#include "slang-rhi.h"
#include "test-server-diagnostics.h"
#include "unit-test/slang-unit-test.h"
@@ -422,6 +425,9 @@ SlangResult TestServer::_executeUnitTest(const JSONRPCCall& call)
}
TestReporter testReporter;
+ renderer_test::CoreDebugCallback coreDebugCallback;
+ renderer_test::CoreToRHIDebugBridge rhiDebugCallback;
+ rhiDebugCallback.setCoreCallback(&coreDebugCallback);
testModule->setTestReporter(&testReporter);
@@ -438,6 +444,7 @@ SlangResult TestServer::_executeUnitTest(const JSONRPCCall& call)
unitTestContext.enabledApis = RenderApiFlags(args.enabledApis);
unitTestContext.executableDirectory = m_exeDirectory.getBuffer();
unitTestContext.enableDebugLayers = args.enableDebugLayers;
+ unitTestContext.debugCallback = &rhiDebugCallback;
auto testCount = testModule->getTestCount();
SLANG_ASSERT(testIndex >= 0 && testIndex < testCount);
@@ -455,6 +462,7 @@ SlangResult TestServer::_executeUnitTest(const JSONRPCCall& call)
TestServerProtocol::ExecutionResult result;
result.result = SLANG_OK;
+ result.debugLayer = coreDebugCallback.getString();
if (testReporter.m_failCount > 0)
{
@@ -508,6 +516,7 @@ SlangResult TestServer::_executeTool(const JSONRPCCall& call)
StdWriters stdWriters;
StringBuilder stdOut;
StringBuilder stdError;
+ renderer_test::CoreDebugCallback debugCallback;
// Make writer/s act as if they are the console.
RefPtr<StringWriter> stdOutWriter(new StringWriter(&stdOut, WriterFlag::IsConsole));
@@ -515,6 +524,7 @@ SlangResult TestServer::_executeTool(const JSONRPCCall& call)
stdWriters.setWriter(SLANG_WRITER_CHANNEL_STD_ERROR, stdErrorWriter);
stdWriters.setWriter(SLANG_WRITER_CHANNEL_STD_OUTPUT, stdOutWriter);
+ stdWriters.setDebugCallback(&debugCallback);
// HACK, to make behavior the same as previously
if (args.toolName == "slangc")
@@ -529,6 +539,7 @@ SlangResult TestServer::_executeTool(const JSONRPCCall& call)
result.result = funcRes;
result.stdError = stdError;
result.stdOut = stdOut;
+ result.debugLayer = debugCallback.getString();
result.returnCode = int32_t(TestToolUtil::getReturnCode(result.result));
return m_connection->sendResult(&result, id);