tut logo

tut::test_runner Class Reference


Public Member Functions | Protected Types | Protected Attributes | Friends | List of all members
tut::test_runner Class Reference

#include <tut_runner.hpp>

Collaboration diagram for tut::test_runner:
Collaboration graph
[legend]

Public Member Functions

 test_runner ()
 
void clear_callbacks ()
 
void erase_callback (callback *cb)
 
const callbacks & get_callbacks () const
 
void insert_callback (callback *cb)
 
const groupnames list_groups () const
 
void register_group (const std::string &name, group_base *gr)
 
bool run_test (const std::string &group_name, int n, test_result &tr) const
 
void run_tests () const
 
void run_tests (const std::string &group_name) const
 
void set_callback (callback *cb)
 
void set_callbacks (const callbacks &cb)
 

Protected Types

typedef groups::const_iterator const_iterator
 
typedef std::map< std::string,
group_base * > 
groups
 
typedef groups::iterator iterator
 

Protected Attributes

callbacks callbacks_
 
groups groups_
 

Friends

class restartable_wrapper
 

Detailed Description

Test runner.

Constructor & Destructor Documentation

tut::test_runner::test_runner ( )
inline

Constructor

Member Function Documentation

void tut::test_runner::clear_callbacks ( )
inline

Remove all callback objects.

Referenced by set_callback().

void tut::test_runner::erase_callback ( callback cb)
inline

Remove callback object.

Parameters
cbcallback to remove
const callbacks& tut::test_runner::get_callbacks ( ) const
inline

Returns callback list.

Returns
callback list
void tut::test_runner::insert_callback ( callback cb)
inline

Add callback object.

Parameters
cbnew callback object

Referenced by set_callback().

const groupnames tut::test_runner::list_groups ( ) const
inline

Returns list of known test groups.

Returns
groups list

Referenced by tut::restartable_wrapper::list_groups(), and tut::tut_main().

void tut::test_runner::register_group ( const std::string &  name,
group_base gr 
)
inline

Stores another group for getting by name.

Parameters
namenew group object
grnew callback object

Referenced by tut::restartable_wrapper::register_group(), and tut::test_group< class, int >::test_group().

bool tut::test_runner::run_test ( const std::string &  group_name,
int  n,
test_result tr 
) const
inline

Runs one test in specified group.

Parameters
group_namegroup to test
nrun case in test
trresult of this case
Returns
true if test is ok, otherwise false

Referenced by tut::restartable_wrapper::run_tests(), and tut::tut_main().

void tut::test_runner::run_tests ( ) const
inline

Runs all tests in all groups.

Referenced by tut::tut_main().

void tut::test_runner::run_tests ( const std::string &  group_name) const
inline

Runs all tests in specified group.

Parameters
group_namegroup to test
void tut::test_runner::set_callback ( callback cb)
inline

Stores one callback object.

Parameters
cbnew callback object
Examples:
basic/main.cpp.

References clear_callbacks(), and insert_callback().

Here is the call graph for this function:

void tut::test_runner::set_callbacks ( const callbacks &  cb)
inline

Set callback list.

Parameters
cbnew callback list

The documentation for this class was generated from the following file:
All Rights Reserved. Generated on Wed Dec 18 2013 11:19:52 for TUT by doxygen 1.8.5