From 5ce8d4c146fef7c8890cd40e112858db69702bd2 Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Wed, 14 Dec 2022 18:11:01 +0100 Subject: Shader cache improvements (#2564) * Make shader cache tests check the output buffer * Add shader cache eviction test * Cleanup comments * Improve TestReporter thread safety * Split lockFile test into two tests * Cleanup PersistentCache tests * Disable multi-threaded tests on aarch64 --- tools/slang-test/test-reporter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 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 ee8421e81..b2d0d1a54 100644 --- a/tools/slang-test/test-reporter.cpp +++ b/tools/slang-test/test-reporter.cpp @@ -140,18 +140,25 @@ void TestReporter::addResult(TestResult result) { assert(m_inTest); + std::lock_guard lock(m_mutex); + m_currentInfo.testResult = combine(m_currentInfo.testResult, result); m_numCurrentResults++; } void TestReporter::addExecutionTime(double time) { + std::lock_guard lock(m_mutex); + m_currentInfo.executionTime = time; } void TestReporter::addResultWithLocation(TestResult result, const char* testText, const char* file, int line) { assert(m_inTest); + + std::lock_guard lock(m_mutex); + m_numCurrentResults++; m_currentInfo.testResult = combine(m_currentInfo.testResult, result); @@ -505,8 +512,8 @@ void TestReporter::addTest(const String& testName, TestResult testResult) void TestReporter::message(TestMessageType type, const String& message) { - static std::mutex mutex; - std::lock_guard lock(mutex); + std::lock_guard lock(m_mutex); + if (type == TestMessageType::Info) { if (m_isVerbose && canWriteStdError()) -- cgit v1.2.3