Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::TestReport Struct Reference

Collects multiple TestCase and reports their results. More...

#include <Testing.h>

Public Member Functions

 TestReport (Console &console, int argc, const char **argv)
 Build from a console and executable arguments. More...
 
int getTestReturnCode () const
 Gets return code for this process. More...
 

Public Attributes

Consoleconsole
 The passed in console object where to print results. More...
 
StringView libraryRootDirectory
 Path to sources directory for library. More...
 
StringView executableFile
 Path to current executable. More...
 
StringView applicationRootDirectory
 Path to application (on macOS is different from executable path) More...
 
bool abortOnFirstFailedTest = true
 If true will abort after first failed test. More...
 
bool debugBreakOnFailedTest = true
 If true will issue a debugger halt when a test fails. More...
 
bool quietMode = false
 If true will not print recaps at start or end of the test. More...
 

Friends

struct TestCase
 

Detailed Description

Collects multiple TestCase and reports their results.

This is passed as argument to SC::TestCase derived classes, and contains handle to globals like a console, paths to the library and application root, path to executable etc.

Constructor & Destructor Documentation

◆ TestReport()

SC::TestReport::TestReport ( Console console,
int  argc,
const char **  argv 
)

Build from a console and executable arguments.

Parameters
consoleA Console object where to print test results
argcNumber of command line arguments
argvCommand line arguments Arguments

Member Function Documentation

◆ getTestReturnCode()

int SC::TestReport::getTestReturnCode ( ) const

Gets return code for this process.

Returns
-1 if tests are failed, 0 if tests are successful

Member Data Documentation

◆ abortOnFirstFailedTest

bool SC::TestReport::abortOnFirstFailedTest = true

If true will abort after first failed test.

◆ applicationRootDirectory

StringView SC::TestReport::applicationRootDirectory

Path to application (on macOS is different from executable path)

◆ console

Console& SC::TestReport::console

The passed in console object where to print results.

◆ debugBreakOnFailedTest

bool SC::TestReport::debugBreakOnFailedTest = true

If true will issue a debugger halt when a test fails.

◆ executableFile

StringView SC::TestReport::executableFile

Path to current executable.

◆ libraryRootDirectory

StringView SC::TestReport::libraryRootDirectory

Path to sources directory for library.

◆ quietMode

bool SC::TestReport::quietMode = false

If true will not print recaps at start or end of the test.


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