dspp
Digital Signal Processing library for C++
 All Classes Namespaces Functions Variables Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
testing::DefaultReporter Class Reference

Reporter class that outputs a human readable format. More...

#include <benchtest.hpp>

Collaboration diagram for testing::DefaultReporter:
Collaboration graph
[legend]

Public Member Functions

 DefaultReporter (::std::ostream &ostream=::std::cout)
 Creates an instance which can optionally report somewhere other than STDOUT.
 

Protected Member Functions

virtual ::std::string Pluralize (size_t qty, const char *label=nullptr)
 Utility for adding "s", e.g., "case" becomes "cases" when not qty 1.
 
virtual void Start (size_t cases, size_t total_qty)
 Start is called before any tests are run.
 
virtual void End (long ms)
 End is called after all tests are run.
 
virtual void StartCase (size_t case_qty)
 StartCase is called before any tests in a case are run.
 
virtual void EndCase (long ms)
 EndCase is called after all tests in a case are finished.
 
virtual void Run ()
 Run is called once before each test.
 
virtual void Pass (long ms)
 Pass is called at the end of a test that didn't report failures.
 
virtual void Fail (long ms)
 Fail is called at the end of a test that failed.
 
virtual void Bench (long iterations, double us)
 Bench is called during test to report a benchmark time.
 
virtual void Print (::std::string message)
 Print is called with miscellaneous annotations for a human-readable report.
 
virtual void Trace (::std::string message, const char *file, long line)
 Trace is called to print each line in a scoped trace.
 
virtual void Error (::std::string message, const char *file, long line)
 Error is called for each failure during a test.
 

Protected Attributes

::std::ostream * ostream
 The ostream this instance was initialized to.
 
size_t cases
 Remember the number of cases passed to Start().
 
size_t total_qty
 Remember the total_qty of tests passed to Start().
 
size_t case_qty
 Remember the number of tests for the current test case.
 
::std::vector<::std::string > failures
 Remember the name of every failed test for the final report.
 

Additional Inherited Members

- Public Attributes inherited from testing::Reporter
class Info * test_info
 

Detailed Description

Reporter class that outputs a human readable format.