Commit 99f338eb authored by Martin Marinov's avatar Martin Marinov

Flush the test stream after each result output to make sure results are not...

Flush the test stream after each result output to make sure results are not lost in the event of a crash
parent cc7bc52a
......@@ -141,7 +141,7 @@ void Object::add(const Result& _rslt, const String& _data)
static std::mutex mtx; //synchronize access to the checksum report stream
std::lock_guard<std::mutex> lock(mtx);
static Base::OutputStreamAdaptT<std::ofstream> test_str(REPORT_FILENAME);
static Base::OutputStreamAdaptT<std::ofstream> test_strm(REPORT_FILENAME);
static bool tag_out = false;
#ifdef DEB_ON
......@@ -151,7 +151,7 @@ void Object::add(const Result& _rslt, const String& _data)
if (prev_call_stck != call_stck)
{
test_str << call_stck << Base::LF;
test_strm << call_stck << Base::LF;
prev_call_stck = call_stck;
}
#endif//DEB_ON
......@@ -159,9 +159,10 @@ void Object::add(const Result& _rslt, const String& _data)
if (!tag_out)
{
tag_out = true;
test_str << REPORT_LEVEL_TAG << LEVEL_TEXT[run_lvl] << Base::LF;
test_strm << REPORT_LEVEL_TAG << LEVEL_TEXT[run_lvl] << Base::LF;
}
test_str << _rslt << " " << name() << ": " << _data << Base::LF;
test_strm << _rslt << " " << name() << ": " << _data << Base::LF;
test_strm.stream().flush();
}
}//Checksum
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment