From 9b7a007c31072bc9aebd1134aa4f1bfd28a4c541 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 24 Feb 2021 15:43:43 -0800 Subject: Explicit swapchain interface in `gfx`. (#1726) * Explicit swapchain interface in `gfx`. * Correctly return nullptr when `IRenderer` creation failed. * Fix crashes on CUDA tests. * Cleanups. --- tools/slang-test/test-reporter.cpp | 48 +++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'tools/slang-test/test-reporter.cpp') diff --git a/tools/slang-test/test-reporter.cpp b/tools/slang-test/test-reporter.cpp index fd9748b28..4a7c76c4c 100644 --- a/tools/slang-test/test-reporter.cpp +++ b/tools/slang-test/test-reporter.cpp @@ -314,28 +314,38 @@ void TestReporter::_addResult(const TestInfo& info) m_testInfos.add(info); - // printf("OUTPUT_MODE: %d\n", options.outputMode); - switch (m_outputMode) + auto defaultOutputFunc = [](const TestInfo& info) { + char const* resultString = "UNEXPECTED"; + switch (info.testResult) + { + case TestResult::Fail: + resultString = "FAILED"; + break; + case TestResult::Pass: + resultString = "passed"; + break; + case TestResult::Ignored: + resultString = "ignored"; + break; default: + assert(!"unexpected"); + break; + } + + StringBuilder buffer; + if (info.executionTime > 0.0f) { - char const* resultString = "UNEXPECTED"; - switch (info.testResult) - { - case TestResult::Fail: resultString = "FAILED"; break; - case TestResult::Pass: resultString = "passed"; break; - case TestResult::Ignored: resultString = "ignored"; break; - default: - assert(!"unexpected"); - break; - } + _appendTime(info.executionTime, buffer); + } + printf("%s test: '%S' %s\n", resultString, info.name.toWString().begin(), buffer.getBuffer()); + }; - StringBuilder buffer; - if (info.executionTime > 0.0f) - { - _appendTime(info.executionTime, buffer); - } - printf("%s test: '%S' %s\n", resultString, info.name.toWString().begin(), buffer.getBuffer()); + switch (m_outputMode) + { + default: + { + defaultOutputFunc(info); break; } case TestOutputMode::TeamCity: @@ -464,7 +474,7 @@ void TestReporter::_addResult(const TestInfo& info) exeRes.standardError.begin()); #endif } - + defaultOutputFunc(info); break; } } -- cgit v1.2.3