mirror of https://github.com/minetest/minetest.git
Flush stderr before printing to stdout
It's necessary to flush stderr before printing to stdout in adition to flushing stdout before printing to stderr, to make sure all output is ordered correctly.
This commit is contained in:
parent
ca092a85fd
commit
26f0187987
|
@ -239,10 +239,11 @@ bool run_tests()
|
|||
}
|
||||
|
||||
rawstream << "Catch test results: " << std::endl;
|
||||
// Catch prints out the results of this invocation.
|
||||
// Catch prints to stdout, whereas rawstream prints to
|
||||
// stderr. We have to flush stdout manually to make sure
|
||||
// they show up in the right order in the output.
|
||||
// Catch prints out the results of this invocation
|
||||
// to stdout, whereas rawstream prints to stderr.
|
||||
// We must flush the streams so they are ordered
|
||||
// correctly in the output.
|
||||
std::cerr.flush();
|
||||
auto num_catch_tests_failed = Catch::Session().run();
|
||||
std::cout.flush();
|
||||
// We count the all the Catch tests as one test for Minetest's own logging
|
||||
|
|
Loading…
Reference in New Issue