scsl 1.0.1
Shimmering Clarity Standard Library
Loading...
Searching...
No Matches
Report.h
Go to the documentation of this file.
1
22
23#ifndef SCTEST_REPORT_H
24#define SCTEST_REPORT_H
25
26#include <chrono>
27
28namespace sctest {
29
34class Report {
35public:
38
46 size_t Failing() const;
47
49 size_t Passing() const;
50
52 size_t Total() const;
53
55 void Failed();
56
58 void Passed();
59
64 void AddTest(size_t testCount = 0);
65
71 void Reset(size_t testCount = 0);
72
76 void Start();
77
81 void End();
82
88 std::chrono::duration<double, std::milli>
89 Elapsed() const;
90private:
91 size_t failing;
92 size_t passed;
93 size_t total;
94
95 std::chrono::time_point<std::chrono::steady_clock> start;
96 std::chrono::time_point<std::chrono::steady_clock> end;
97};
98
99
100std::ostream &operator<<(std::ostream &os, const Report &report);
101} // end namespace sctest
102
103
104#endif
A Report holds test run results.
Definition Report.h:34
void Failed()
Report a test as having failed.
size_t Passing() const
The number of tests that have passed successfully.
std::chrono::duration< double, std::milli > Elapsed() const
Retrieve how long the tests took to run.
size_t Failing() const
Failing returns the count of failed tests.
void End()
Mark the end of test runs.
void Start()
Mark the start of test runs.
void Reset(size_t testCount=0)
Reset the internal state.
void Passed()
Report a test as having passed.
size_t Total() const
The number of tests registered.
void AddTest(size_t testCount=0)
Register more tests in the report.
Report()
Construct a new Report, zeroed out.
Shimmering Clarity testing library.
Definition sctest.h:34
std::ostream & operator<<(std::ostream &os, const Report &report)