google / benchmark

A microbenchmark support library
Apache License 2.0
8.59k stars 1.57k forks source link

Issue 1734: Streams not flushed if not running actual benchmarks #1735

Closed bstordrup closed 5 months ago

bstordrup commented 5 months ago

If the call paths in RunSpecifiedBenchmarks do not go into internal::RunBenchmarks, the Out and Err streams are flushed before exiting.

LebedevRI commented 5 months ago

I suppose this makes sense, we can't quite be sure that std::endl is consistently used. But, let's streamline this: let's flush both streams, but only before exit/return.

bstordrup commented 5 months ago

Added some more calls to Out.flush() and Err.flush()

bstordrup commented 5 months ago

I noted that there is a complexity test failing, but not sure why.

bstordrup commented 5 months ago

@LebedevRI, you,re welcome... Just started to use the library - it's really cool.

LebedevRI commented 5 months ago

I'm not sure why those complexity_benchmark failures happen. Looks like there's some non-determinizm.