scsl 1.0.1
Shimmering Clarity Standard Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sctest::Report Class Reference

A Report holds test run results. More...

#include <Report.h>

Public Member Functions

 Report ()
 Construct a new Report, zeroed out.
 
size_t Failing () const
 Failing returns the count of failed tests.
 
size_t Passing () const
 The number of tests that have passed successfully.
 
size_t Total () const
 The number of tests registered.
 
void Failed ()
 Report a test as having failed.
 
void Passed ()
 Report a test as having passed.
 
void AddTest (size_t testCount=0)
 Register more tests in the report.
 
void Reset (size_t testCount=0)
 Reset the internal state.
 
void Start ()
 Mark the start of test runs.
 
void End ()
 Mark the end of test runs.
 
std::chrono::duration< double, std::milli > Elapsed () const
 Retrieve how long the tests took to run.
 

Detailed Description

A Report holds test run results.

This is designed to work with SimpleSuite, but might be useful for other things.

Constructor & Destructor Documentation

◆ Report()

sctest::Report::Report ( )

Construct a new Report, zeroed out.

Member Function Documentation

◆ AddTest()

void sctest::Report::AddTest ( size_t  testCount = 0)

Register more tests in the report.

This is used to track the total number of tests in the report.

◆ Elapsed()

std::chrono::duration< double, std::milli > sctest::Report::Elapsed ( ) const

Retrieve how long the tests took to run.

This only makes sense to run after called to Start and End.

Returns
The number of milliseconds that have elapsed.

◆ End()

void sctest::Report::End ( )

Mark the end of test runs.

This is used for tracking how long the tests took to complete.

◆ Failed()

void sctest::Report::Failed ( )

Report a test as having failed.

◆ Failing()

size_t sctest::Report::Failing ( ) const

Failing returns the count of failed tests.

If a test is run and expected to pass, but fails, it is marked as failed. If a test is expected to fail, but passes, it is marked as failed.

Returns
The number of tests that failed.

◆ Passed()

void sctest::Report::Passed ( )

Report a test as having passed.

◆ Passing()

size_t sctest::Report::Passing ( ) const

The number of tests that have passed successfully.

◆ Reset()

void sctest::Report::Reset ( size_t  testCount = 0)

Reset the internal state.

All fields in the Report will be zeroed out.

Parameters
testCount

◆ Start()

void sctest::Report::Start ( )

Mark the start of test runs.

This is used for tracking how long the tests took to complete.

◆ Total()

size_t sctest::Report::Total ( ) const

The number of tests registered.


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