Loading...
Searching...
No Matches
riot::testing::test_suite Class Reference

Test suite base class. More...

Detailed Description

Test suite base class.

Should not be instantiated directly. To customize a test suite with custom set_up and tear down methods, inherit from this class and override set_up() and/or tear_down(). They will before / after every test.

See also
TEST_SUITE(name) macro
TEST_SUITE_F(suite, name) macro
test_suite::set_up()
test_suite::tear_down()

Definition at line 83 of file cppunit_base.hpp.

#include <cppunit_base.hpp>

Public Member Functions

virtual void set_up ()
 method to run before each test
 
virtual void tear_down ()
 method to run after each test
 
virtual const char * get_name () const
 get the name of the test suite
 
virtual void run ()
 Run all tests in the suite.
 
void addTest (test *test)
 Run all tests in the suite.
 

Protected Attributes

bool suc = true
 Indicates success of all tests after running the suite.
 
std::array< test *, CPPUNIT_SUITE_CNTtests {}
 array of tests to run
 

Member Function Documentation

◆ addTest()

void riot::testing::test_suite::addTest ( test test)
inline

Run all tests in the suite.

Definition at line 120 of file cppunit_base.hpp.

◆ get_name()

virtual const char * riot::testing::test_suite::get_name ( ) const
inlinevirtual

get the name of the test suite

Returns
name string

Definition at line 102 of file cppunit_base.hpp.

◆ run()

virtual void riot::testing::test_suite::run ( )
inlinevirtual

Run all tests in the suite.

Definition at line 108 of file cppunit_base.hpp.

◆ set_up()

virtual void riot::testing::test_suite::set_up ( )
inlinevirtual

method to run before each test

Definition at line 91 of file cppunit_base.hpp.

◆ tear_down()

virtual void riot::testing::test_suite::tear_down ( )
inlinevirtual

method to run after each test

Definition at line 96 of file cppunit_base.hpp.

Field Documentation

◆ suc

bool riot::testing::test_suite::suc = true
protected

Indicates success of all tests after running the suite.

Definition at line 85 of file cppunit_base.hpp.

◆ tests

std::array<test*, CPPUNIT_SUITE_CNT> riot::testing::test_suite::tests {}
protected

array of tests to run

Definition at line 86 of file cppunit_base.hpp.


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