ConsoleReporter's stream is not flushed before test execution
Describe the bug
Observed problem:
The time between the "Filters: " printout and the "Randomness seeded to: " printout for ConsoleReporter is long. The "Randomness seeded to: " is printed with the actual test output. When one of our test runs timed out, the random seed wasn't even printed at all.
Cause:
This seems to be because m_stream isn't flushed at the end of ConsoleReporter::testRunStarting(). I can not reproduce the issue when running the catch2 executable directly, but it happens when executing through our task runner Invoke, which essentially wraps the catch2 executable in a context.run() statement.
So yeah, it can be debated where the issue really lies, but I'm not sure Invoke or similar tools can do much to know when to output intermediate stream contents. Catch2 definitely knows when to output it's own metadata before any user code/test case is executed.
Expected behavior The filters, the random seed (and any other needed metadata about the test known beforehand) should be printed before the test is started, for reproducibility.
Reproduction steps I'm not sure ATM how to provide a small, contained example with Invoke wrapping the executable to reproduce this, but will try to assemble something...
Platform information:
- OS: Ubuntu 22.04.5 LTS
- Compiler+version: Ubuntu clang version 14.0.0-1ubuntu1.1
- Catch version: v3.5.0