diff options
| author | Martin Hořeňovský | 2025-07-10 23:40:16 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-07-10 23:51:31 +0200 |
| commit | b62413aee344b346d120ccdc676fedf4bd6233b3 (patch) | |
| tree | 194bca489bf0987d687562d9aa9923d0e9e3b967 /src | |
| parent | 3839e27f056cd975e5be2faa9adb5a8cf1f5dcf4 (diff) | |
| download | catch3-b62413aee344b346d120ccdc676fedf4bd6233b3.tar.gz | |
Add stream flushes after reporters print out the test run metadata.
This ensures that the test run metadata are printed even if the
process dies right after.
Closes #2964
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/reporters/catch_reporter_compact.cpp | 3 | ||||
| -rw-r--r-- | src/catch2/reporters/catch_reporter_console.cpp | 3 | ||||
| -rw-r--r-- | src/catch2/reporters/catch_reporter_tap.cpp | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/catch2/reporters/catch_reporter_compact.cpp b/src/catch2/reporters/catch_reporter_compact.cpp index 0f855944..6d2c8655 100644 --- a/src/catch2/reporters/catch_reporter_compact.cpp +++ b/src/catch2/reporters/catch_reporter_compact.cpp @@ -215,7 +215,8 @@ private: << m_config->testSpec() << '\n'; } - m_stream << "RNG seed: " << getSeed() << '\n'; + m_stream << "RNG seed: " << getSeed() << '\n' + << std::flush; } void CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) { diff --git a/src/catch2/reporters/catch_reporter_console.cpp b/src/catch2/reporters/catch_reporter_console.cpp index 9529f39a..518e57f8 100644 --- a/src/catch2/reporters/catch_reporter_console.cpp +++ b/src/catch2/reporters/catch_reporter_console.cpp @@ -529,7 +529,8 @@ void ConsoleReporter::testRunStarting(TestRunInfo const& _testRunInfo) { m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " << m_config->testSpec() << '\n'; } - m_stream << "Randomness seeded to: " << getSeed() << '\n'; + m_stream << "Randomness seeded to: " << getSeed() << '\n' + << std::flush; } void ConsoleReporter::lazyPrint() { diff --git a/src/catch2/reporters/catch_reporter_tap.cpp b/src/catch2/reporters/catch_reporter_tap.cpp index 67d406fb..d7e68bfd 100644 --- a/src/catch2/reporters/catch_reporter_tap.cpp +++ b/src/catch2/reporters/catch_reporter_tap.cpp @@ -196,7 +196,8 @@ namespace Catch { if ( m_config->testSpec().hasFilters() ) { m_stream << "# filters: " << m_config->testSpec() << '\n'; } - m_stream << "# rng-seed: " << m_config->rngSeed() << '\n'; + m_stream << "# rng-seed: " << m_config->rngSeed() << '\n' + << std::flush; } void TAPReporter::noMatchingTestCases( StringRef unmatchedSpec ) { |