scsl  1.1.1
Shimmering Clarity Standard Library
Report.h
Go to the documentation of this file.
1 
23 #ifndef SCTEST_REPORT_H
24 #define SCTEST_REPORT_H
25 
26 #include <chrono>
27 
28 namespace sctest {
29 
34 class Report {
35 public:
37  Report();
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;
90 private:
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 
100 std::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.
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.
std::chrono::duration< double, std::milli > Elapsed() const
Retrieve how long the tests took to run.
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)