modm API documentation
unittest::Reporter Class Reference

Reporter. More...

#include <unittest/reporter.hpp>

Public Member Functions

 Reporter (modm::IODevice &device)
 Constructor. More...
 
void nextTestSuite (modm::accessor::Flash< char > name)
 Switch to the next test suite. More...
 
void nextTestFunction (modm::accessor::Flash< char > name)
 Switch to the next test function. More...
 
void reportPass ()
 Report a passed test. More...
 
modm::IOStreamreportFailure (unsigned int lineNumber)
 Reported a failed test. More...
 
uint8_t printSummary ()
 Writes a summary of all the tests. More...
 

Detailed Description

Reporter.

Used to generate the visible output.

Author
Fabian Greif

Constructor & Destructor Documentation

unittest::Reporter::Reporter ( modm::IODevice device)

Constructor.

Parameters
deviceIODevice used for printing

Member Function Documentation

void unittest::Reporter::nextTestFunction ( modm::accessor::Flash< char >  name)

Switch to the next test function.

Parameters
nameName of the test function
void unittest::Reporter::nextTestSuite ( modm::accessor::Flash< char >  name)

Switch to the next test suite.

Parameters
nameName of the test suite
uint8_t unittest::Reporter::printSummary ( )

Writes a summary of all the tests.

Basically the total number of failed and passed tests and then 'OK' if there was no failure or 'FAIL' otherwise.

Returns
0 if all tests passed
modm::IOStream & unittest::Reporter::reportFailure ( unsigned int  lineNumber)

Reported a failed test.

Generates a basic failure message, the returned stream can then be used to write some more specific information about the failure.

void unittest::Reporter::reportPass ( )

Report a passed test.

Doesn't generate any output, but increments the number of passed tests


The documentation for this class was generated from the following files: