micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::test_runner Class Reference

The test runner. It maintains a list of test suites which automatically register themselves in their constructors. More...

#include <micro-os-plus/micro-test-plus.h>

Public Member Functions

 test_runner ()
 
 test_runner (const test_runner &)=delete
 
 test_runner (test_runner &&)=delete
 
 ~test_runner ()=default
 
void abort (void)
 
int exit_code (void)
 Return 0 if the all tests were successful, 1 otherwise.
 
void initialize (int argc, char *argv[], const char *name)
 Pass the main arguments explicitly, if the default constructor was used.
 
constexpr const char * name (void)
 
test_runneroperator= (const test_runner &)=delete
 
test_runneroperator= (test_runner &&)=delete
 
void register_test_suite (test_suite_base *suite)
 Called by test suite constructors to register them to the runner.
 

Protected Attributes

int argc_ = 0
 
char ** argv_ = nullptr
 
const char * default_suite_name_ = "Test"
 
test_suite_basedefault_test_suite_
 Pointer to the default test suite which groups the main tests.
 
std::vector< test_suite_base * > * suites_
 Pointer to array of registered test suites. Statically initialised to zero as BSS, such that test suites defined as static objects in different compilation units can be automatically executed.
 

Detailed Description

The test runner. It maintains a list of test suites which automatically register themselves in their constructors.

Definition at line 51 of file test-runner.h.

Constructor & Destructor Documentation

◆ test_runner() [1/3]

micro_os_plus::micro_test_plus::test_runner::test_runner ( )

Definition at line 41 of file test-runner.cpp.

◆ test_runner() [2/3]

micro_os_plus::micro_test_plus::test_runner::test_runner ( const test_runner & )
delete

◆ test_runner() [3/3]

micro_os_plus::micro_test_plus::test_runner::test_runner ( test_runner && )
delete

◆ ~test_runner()

micro_os_plus::micro_test_plus::test_runner::~test_runner ( )
default

Member Function Documentation

◆ abort()

void micro_os_plus::micro_test_plus::test_runner::abort ( void )

Definition at line 192 of file test-runner.cpp.

◆ exit_code()

int micro_os_plus::micro_test_plus::test_runner::exit_code ( void )

Return 0 if the all tests were successful, 1 otherwise.

Definition at line 147 of file test-runner.cpp.

◆ initialize()

void micro_os_plus::micro_test_plus::test_runner::initialize ( int argc,
char * argv[],
const char * name )

Pass the main arguments explicitly, if the default constructor was used.

Definition at line 53 of file test-runner.cpp.

◆ name()

constexpr const char * micro_os_plus::micro_test_plus::test_runner::name ( void )
inlineconstexpr

Definition at line 89 of file test-runner.h.

◆ operator=() [1/2]

test_runner & micro_os_plus::micro_test_plus::test_runner::operator= ( const test_runner & )
delete

◆ operator=() [2/2]

test_runner & micro_os_plus::micro_test_plus::test_runner::operator= ( test_runner && )
delete

◆ register_test_suite()

void micro_os_plus::micro_test_plus::test_runner::register_test_suite ( test_suite_base * suite)

Called by test suite constructors to register them to the runner.

Definition at line 178 of file test-runner.cpp.

Member Data Documentation

◆ argc_

int micro_os_plus::micro_test_plus::test_runner::argc_ = 0
protected

Definition at line 98 of file test-runner.h.

◆ argv_

char** micro_os_plus::micro_test_plus::test_runner::argv_ = nullptr
protected

Definition at line 99 of file test-runner.h.

◆ default_suite_name_

const char* micro_os_plus::micro_test_plus::test_runner::default_suite_name_ = "Test"
protected

Definition at line 101 of file test-runner.h.

◆ default_test_suite_

test_suite_base* micro_os_plus::micro_test_plus::test_runner::default_test_suite_
protected

Pointer to the default test suite which groups the main tests.

Definition at line 107 of file test-runner.h.

◆ suites_

std::vector<test_suite_base*>* micro_os_plus::micro_test_plus::test_runner::suites_
protected

Pointer to array of registered test suites. Statically initialised to zero as BSS, such that test suites defined as static objects in different compilation units can be automatically executed.

Definition at line 115 of file test-runner.h.


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