micro-test-plus 3.2.2
The µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::test_suite_base Class Reference

Base class for all test suites. More...

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

+ Inheritance diagram for micro_os_plus::micro_test_plus::test_suite_base:

Public Member Functions

 test_suite_base (const char *name)
 Construct a test suite.
 
 test_suite_base (const test_suite_base &)=delete
 
 test_suite_base (test_suite_base &&)=delete
 
virtual ~test_suite_base ()
 
void begin_test_case (const char *name)
 Mark the beginning of a named test case.
 
void begin_test_suite (void)
 Begin the execution of the test suite.
 
void end_test_case (void)
 Mark the end of a test case.
 
void end_test_suite (void)
 Mark the end of the test suite.
 
constexpr int failed_checks (void)
 Get the number of conditions that failed.
 
void increment_failed (void)
 Count one more failed test conditions.
 
void increment_successful (void)
 Count one more passed test conditions.
 
constexpr const char * name ()
 Get the suite name.
 
test_suite_baseoperator= (const test_suite_base &)=delete
 
test_suite_baseoperator= (test_suite_base &&)=delete
 
virtual void run (void)
 Run the sequence of test cases in the suite.
 
constexpr int successful_checks (void)
 Get the number of conditions that passed.
 
constexpr int test_cases (void)
 Get the number of test cases.
 
constexpr bool unused (void)
 If all counter are null, it is unused.
 
constexpr bool was_successful (void)
 Get the test suite result.
 

Public Attributes

struct { 
 
   int   failed_checks 
 
   int   successful_checks 
 
current_test_case 
 
bool process_deferred_begin = true
 

Protected Attributes

int failed_checks_ = 0
 Count of test conditions that failed.
 
const char * name_
 The test suite name.
 
int successful_checks_ = 0
 Count of test conditions that passed.
 
const char * test_case_name_
 The current test case name.
 
int test_cases_ = 0
 Count of test cases in the test suite.
 

Detailed Description

Base class for all test suites.

Definition at line 49 of file test-suite.h.

Constructor & Destructor Documentation

◆ test_suite_base() [1/3]

micro_os_plus::micro_test_plus::test_suite_base::test_suite_base ( const char * name)

Construct a test suite.

Parameters
[in]nameThe test suite name.

Definition at line 37 of file test-suite.cpp.

◆ test_suite_base() [2/3]

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

◆ test_suite_base() [3/3]

micro_os_plus::micro_test_plus::test_suite_base::test_suite_base ( test_suite_base && )
delete

◆ ~test_suite_base()

micro_os_plus::micro_test_plus::test_suite_base::~test_suite_base ( )
virtual

Definition at line 47 of file test-suite.cpp.

Member Function Documentation

◆ begin_test_case()

void micro_os_plus::micro_test_plus::test_suite_base::begin_test_case ( const char * name)

Mark the beginning of a named test case.

Parameters
[in]nameThe test case name.
Returns
Nothing.

Definition at line 78 of file test-suite.cpp.

◆ begin_test_suite()

void micro_os_plus::micro_test_plus::test_suite_base::begin_test_suite ( void )

Begin the execution of the test suite.

Parameters
None.
Returns
Nothing.

Definition at line 60 of file test-suite.cpp.

◆ end_test_case()

void micro_os_plus::micro_test_plus::test_suite_base::end_test_case ( void )

Mark the end of a test case.

Parameters
None.
Returns
Nothing.

Definition at line 94 of file test-suite.cpp.

◆ end_test_suite()

void micro_os_plus::micro_test_plus::test_suite_base::end_test_suite ( void )

Mark the end of the test suite.

Parameters
None.
Returns
Nothing.

Definition at line 68 of file test-suite.cpp.

◆ failed_checks()

int micro_os_plus::micro_test_plus::test_suite_base::failed_checks ( void )
inlinenodiscardconstexpr

Get the number of conditions that failed.

Parameters
None.
Returns
An integer with the number checks that failed.

Definition at line 150 of file test-suite.h.

◆ increment_failed()

void micro_os_plus::micro_test_plus::test_suite_base::increment_failed ( void )

Count one more failed test conditions.

Parameters
None.
Returns
Nothing.

Definition at line 107 of file test-suite.cpp.

◆ increment_successful()

void micro_os_plus::micro_test_plus::test_suite_base::increment_successful ( void )

Count one more passed test conditions.

Parameters
None.
Returns
Nothing.

Definition at line 100 of file test-suite.cpp.

◆ name()

const char * micro_os_plus::micro_test_plus::test_suite_base::name ( )
inlinenodiscardconstexpr

Get the suite name.

Parameters
None.
Returns
A pointer to the null terminated test suite name.

Definition at line 106 of file test-suite.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ run()

void micro_os_plus::micro_test_plus::test_suite_base::run ( void )
virtual

Run the sequence of test cases in the suite.

Parameters
None.
Returns
Nothing.

Reimplemented in micro_os_plus::micro_test_plus::test_suite.

Definition at line 52 of file test-suite.cpp.

◆ successful_checks()

int micro_os_plus::micro_test_plus::test_suite_base::successful_checks ( void )
inlinenodiscardconstexpr

Get the number of conditions that passed.

Parameters
None.
Returns
An integer with the number checks that passed.

Definition at line 138 of file test-suite.h.

◆ test_cases()

int micro_os_plus::micro_test_plus::test_suite_base::test_cases ( void )
inlinenodiscardconstexpr

Get the number of test cases.

Parameters
None.
Returns
An integer with the number of test cases.

Definition at line 162 of file test-suite.h.

◆ unused()

bool micro_os_plus::micro_test_plus::test_suite_base::unused ( void )
inlinenodiscardconstexpr

If all counter are null, it is unused.

Parameters
None.
Returns
True if the test suite is not used.

Definition at line 207 of file test-suite.h.

◆ was_successful()

bool micro_os_plus::micro_test_plus::test_suite_base::was_successful ( void )
inlinenodiscardconstexpr

Get the test suite result.

Parameters
None.
Returns
True if the test suite was successful.

Definition at line 194 of file test-suite.h.

Member Data Documentation

◆ [struct]

struct { ... } micro_os_plus::micro_test_plus::test_suite_base::current_test_case

◆ failed_checks

int micro_os_plus::micro_test_plus::test_suite_base::failed_checks ( void )

Definition at line 244 of file test-suite.h.

◆ failed_checks_

int micro_os_plus::micro_test_plus::test_suite_base::failed_checks_ = 0
protected

Count of test conditions that failed.

Definition at line 232 of file test-suite.h.

◆ name_

const char* micro_os_plus::micro_test_plus::test_suite_base::name_
protected

The test suite name.

Definition at line 217 of file test-suite.h.

◆ process_deferred_begin

bool micro_os_plus::micro_test_plus::test_suite_base::process_deferred_begin = true

Definition at line 240 of file test-suite.h.

◆ successful_checks

int micro_os_plus::micro_test_plus::test_suite_base::successful_checks ( void )

Definition at line 243 of file test-suite.h.

◆ successful_checks_

int micro_os_plus::micro_test_plus::test_suite_base::successful_checks_ = 0
protected

Count of test conditions that passed.

Definition at line 227 of file test-suite.h.

◆ test_case_name_

const char* micro_os_plus::micro_test_plus::test_suite_base::test_case_name_
protected

The current test case name.

Definition at line 222 of file test-suite.h.

◆ test_cases_

int micro_os_plus::micro_test_plus::test_suite_base::test_cases_ = 0
protected

Count of test cases in the test suite.

Definition at line 237 of file test-suite.h.


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