mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
FileStream: enable automatic flushing
when a test executable is killed by a signal (e.g. when executed by ctest with timeout), the reporter files are not flushed. this can lead to incomplete (or empty) report files. to avoid this we enable automatic flushing via `std::unitbuf` compare #663
This commit is contained in:
parent
dea1a6abd9
commit
359542d53e
@ -78,6 +78,7 @@ namespace Detail {
|
||||
FileStream( std::string const& filename ) {
|
||||
m_ofs.open( filename.c_str() );
|
||||
CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' );
|
||||
m_ofs << std::unitbuf;
|
||||
}
|
||||
~FileStream() override = default;
|
||||
public: // IStream
|
||||
|
Loading…
Reference in New Issue
Block a user