tut::test_runner Class Reference

Test runner. More...

`#include <tut.h>`

Collaboration diagram for tut::test_runner:
[legend]

## Public Member Functions

| test_runner ()
| Constructor. More...
void | register_group (const std::string &name, group_base *gr)
| Stores another group for getting by name. More...
void | set_callback (callback *cb)
| Stores callback object. More...
callback & | get_callback () const
| Returns callback object. More...
const groupnames | list_groups () const
| Returns list of known test groups. More...
void | run_tests () const
| Runs all tests in all groups. More...
void | run_tests (const std::string &group_name) const
| Runs all tests in specified group. More...
test_result | run_test (const std::string &group_name, int n) const
| Runs one test in specified group. More...

## Protected Types

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

## Protected Attributes

groups | groups_
callback | default_callback_
callback * | callback_

## Detailed Description

Test runner.

## Member Typedef Documentation

## const_iterator

typedef groups::const_iterator tut::test_runner::const_iterator

protected

## groups

typedef std::map<std::string,group_base*> tut::test_runner::groups

protected

## iterator

typedef groups::iterator tut::test_runner::iterator

protected

## Constructor & Destructor Documentation

## test_runner()

tut::test_runner::test_runner | ( |  | ) |

inline

Constructor.

## Member Function Documentation

## get_callback()

callback& tut::test_runner::get_callback | ( |  | ) | const

inline

Returns callback object.

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

## list_groups()

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

inline

Returns list of known test groups.

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

## register_group()

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

inline

Stores another group for getting by name.

References wibble::iterator().

Referenced by tut::restartable_wrapper::register_group(), and tut::test_group< Data, MaxTestsInGroup >::test_group().

## run_test()

test_result tut::test_runner::run_test | ( | const std::string & | group_name,
|  | int | n
| ) |  | const

inline

Runs one test in specified group.

References tut::test_result::ex_ctor, tut::callback::group_completed(), tut::callback::group_started(), tut::test_result::result, tut::callback::run_completed(), tut::callback::run_started(), and tut::callback::test_completed().

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

## run_tests() [1/2]

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

inline

Runs all tests in all groups.

Parameters

  callback | Callback object if exists; null otherwise

References tut::callback::group_completed(), tut::callback::group_started(), tut::callback::run_completed(), and tut::callback::run_started().

Referenced by main().

## run_tests() [2/2]

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

inline

Runs all tests in specified group.

References tut::callback::group_completed(), tut::callback::group_started(), tut::callback::run_completed(), and tut::callback::run_started().

## set_callback()

void tut::test_runner::set_callback | ( | callback * | cb | ) |

inline

Stores callback object.

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

## Member Data Documentation

## callback_

callback* tut::test_runner::callback_

protected

## default_callback_

callback tut::test_runner::default_callback_

protected

## groups_

groups tut::test_runner::groups_

protected

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

- tut.h