Further code cleanups and documentation.

- Coverity defects.
- Documentation.
This commit is contained in:
2023-10-20 01:31:06 -07:00
parent 2a23d2e204
commit 4eb4008130
16 changed files with 254 additions and 99 deletions

View File

@@ -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