diff options
Diffstat (limited to 'tools/slang-test/test-reporter.cpp')
| -rw-r--r-- | tools/slang-test/test-reporter.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/slang-test/test-reporter.cpp b/tools/slang-test/test-reporter.cpp index 352245028..3aba10566 100644 --- a/tools/slang-test/test-reporter.cpp +++ b/tools/slang-test/test-reporter.cpp @@ -3,6 +3,7 @@ #include "../../source/core/slang-process-util.h" #include "../../source/core/slang-string-util.h" +#include "options.h" #include <mutex> #include <stdio.h> @@ -91,7 +92,7 @@ TestReporter::TestReporter() m_inTest = false; m_dumpOutputOnFailure = false; - m_isVerbose = false; + m_verbosity = VerbosityLevel::Info; } Result TestReporter::init( @@ -371,8 +372,17 @@ void TestReporter::_addResult(TestInfo info) m_testInfos.add(info); - auto defaultOutputFunc = [](const TestInfo& info) + auto defaultOutputFunc = [this](const TestInfo& info) { + // Skip output for passed/ignored tests if verbosity < Info + if (m_verbosity < VerbosityLevel::Info) + { + if (info.testResult == TestResult::Pass || info.testResult == TestResult::Ignored) + { + return; + } + } + char const* resultString = "UNEXPECTED"; switch (info.testResult) { @@ -589,7 +599,7 @@ void TestReporter::message(TestMessageType type, const String& message) if (type == TestMessageType::Info) { - if (m_isVerbose && canWriteStdError()) + if (m_verbosity == VerbosityLevel::Verbose && canWriteStdError()) { fputs(message.getBuffer(), stderr); } |
