Further code cleanups and documentation.
- Coverity defects. - Documentation.
This commit is contained in:
@@ -45,6 +45,13 @@ Report::Failing() const
|
||||
}
|
||||
|
||||
|
||||
size_t
|
||||
Report::Passing() const
|
||||
{
|
||||
return this->passed;
|
||||
}
|
||||
|
||||
|
||||
size_t
|
||||
Report::Total() const
|
||||
{
|
||||
@@ -59,6 +66,13 @@ Report::Failed()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Report::Passed()
|
||||
{
|
||||
this->passed++;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Report::AddTest(size_t testCount)
|
||||
{
|
||||
@@ -71,6 +85,7 @@ Report::Reset(size_t testCount)
|
||||
{
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
this->total = testCount;
|
||||
this->passed = 0;
|
||||
this->failing = 0;
|
||||
|
||||
this->Start();
|
||||
@@ -105,13 +120,18 @@ operator<<(std::ostream &os, const Report &report)
|
||||
{
|
||||
auto elapsed = report.Elapsed();
|
||||
|
||||
os << report.Total() - report.Failing() << "/"
|
||||
os << report.Passing() << "/"
|
||||
<< report.Total() << " tests passed in "
|
||||
<< std::setw(3) << elapsed.count() << "ms";
|
||||
|
||||
auto failed = report.Failing();
|
||||
if (failed > 0) {
|
||||
os << " (" << failed << " tests failed)";
|
||||
}
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // end namespace sctest
|
||||
} // end namespace sctest
|
||||
|
||||
Reference in New Issue
Block a user