AUnit  1.2.1
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
Public Types | Static Public Member Functions | List of all members
aunit::TestRunner Class Reference

The class that runs the various test cases defined by the test() and testing() macros. More...

#include <TestRunner.h>

Public Types

typedef uint8_t TimeoutType
 Integer type of the timeout parameter. More...
 

Static Public Member Functions

static void run ()
 Run all tests using the current runner. More...
 
static void list ()
 Print out the known tests. More...
 
static void exclude (const char *pattern)
 Exclude the tests which match the pattern. More...
 
static void exclude (const char *testClass, const char *pattern)
 Exclude the tests which match the pattern given by (testClass + "_" + pattern), the same concatenation rule used by the testF() macro. More...
 
static void include (const char *pattern)
 Include the tests which match the pattern. More...
 
static void include (const char *testClass, const char *pattern)
 Include the tests which match the pattern given by (testClass + "_" + pattern), the same concatenation rule used by the testF() macro. More...
 
static void setVerbosity (uint8_t verbosity)
 Set the verbosity flag. More...
 
static bool isVerbosity (uint8_t verbosity)
 Returns true if ANY of the bit flags of 'verbosity' is set. More...
 
static void setPrinter (Print *printer)
 Set the output printer. More...
 
static void setTimeout (TimeoutType seconds)
 Set test runner timeout across all tests, in seconds. More...
 

Detailed Description

The class that runs the various test cases defined by the test() and testing() macros.

It prints the summary of each test as well as the final summary of the entire run at the end. In the future, it may be possible to allow a different TestRunner to be used.

Definition at line 41 of file TestRunner.h.

Member Typedef Documentation

◆ TimeoutType

Integer type of the timeout parameter.

Seconds.

Definition at line 44 of file TestRunner.h.

Member Function Documentation

◆ exclude() [1/2]

static void aunit::TestRunner::exclude ( const char *  pattern)
inlinestatic

Exclude the tests which match the pattern.

Currently supports only a trailing '*'. For example, exclude("flash*").

Definition at line 56 of file TestRunner.h.

◆ exclude() [2/2]

static void aunit::TestRunner::exclude ( const char *  testClass,
const char *  pattern 
)
inlinestatic

Exclude the tests which match the pattern given by (testClass + "_" + pattern), the same concatenation rule used by the testF() macro.

Currently supports only a trailing '*'. For example, exclude("CustomTest", "flash*").

Definition at line 67 of file TestRunner.h.

◆ include() [1/2]

static void aunit::TestRunner::include ( const char *  pattern)
inlinestatic

Include the tests which match the pattern.

Currently supports only a trailing '*'. For example, include("flash*").

Definition at line 76 of file TestRunner.h.

◆ include() [2/2]

static void aunit::TestRunner::include ( const char *  testClass,
const char *  pattern 
)
inlinestatic

Include the tests which match the pattern given by (testClass + "_" + pattern), the same concatenation rule used by the testF() macro.

Currently supports only a trailing '*'. For example, include("CustomTest", "flash*").

Definition at line 86 of file TestRunner.h.

◆ isVerbosity()

static bool aunit::TestRunner::isVerbosity ( uint8_t  verbosity)
inlinestatic

Returns true if ANY of the bit flags of 'verbosity' is set.

Definition at line 97 of file TestRunner.h.

◆ list()

static void aunit::TestRunner::list ( )
inlinestatic

Print out the known tests.

For debugging only.

Definition at line 50 of file TestRunner.h.

◆ run()

static void aunit::TestRunner::run ( )
inlinestatic

Run all tests using the current runner.

Definition at line 47 of file TestRunner.h.

◆ setPrinter()

void aunit::TestRunner::setPrinter ( Print *  printer)
static

Set the output printer.

Definition at line 46 of file TestRunner.cpp.

◆ setTimeout()

static void aunit::TestRunner::setTimeout ( TimeoutType  seconds)
inlinestatic

Set test runner timeout across all tests, in seconds.

Set to 0 for infinite timeout. Useful for preventing testing() test cases that never end. This is a timeout for the TestRunner itself, not for individual tests.

Definition at line 110 of file TestRunner.h.

◆ setVerbosity()

static void aunit::TestRunner::setVerbosity ( uint8_t  verbosity)
inlinestatic

Set the verbosity flag.

Definition at line 92 of file TestRunner.h.


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