|
rippled
|
Unit test runner interface. More...
#include <runner.h>


Public Member Functions | |
| runner ()=default | |
| virtual | ~runner ()=default |
| runner (runner const &)=delete | |
| runner & | operator= (runner const &)=delete |
| void | arg (std::string const &s) |
| Set the argument string. | |
| std::string const & | arg () const |
| Returns the argument string. | |
| template<class = void> | |
| bool | run (suite_info const &s) |
| Run the specified suite. | |
| template<class FwdIter > | |
| bool | run (FwdIter first, FwdIter last) |
| Run a sequence of suites. | |
| template<class FwdIter , class Pred > | |
| bool | run_if (FwdIter first, FwdIter last, Pred pred=Pred{}) |
| Conditionally run a sequence of suites. | |
| template<class SequenceContainer > | |
| bool | run_each (SequenceContainer const &c) |
| Run all suites in a container. | |
| template<class SequenceContainer , class Pred > | |
| bool | run_each_if (SequenceContainer const &c, Pred pred=Pred{}) |
| Conditionally run suites in a container. | |
Protected Member Functions | |
| virtual void | on_suite_begin (suite_info const &) |
| Called when a new suite starts. | |
| virtual void | on_suite_end () |
| Called when a suite ends. | |
| virtual void | on_case_begin (std::string const &) |
| Called when a new case starts. | |
| virtual void | on_case_end () |
| Called when a new case ends. | |
| virtual void | on_pass () |
| Called for each passing condition. | |
| virtual void | on_fail (std::string const &) |
| Called for each failing condition. | |
| virtual void | on_log (std::string const &) |
| Called when a test logs output. | |
Private Member Functions | |
| template<class = void> | |
| void | testcase (std::string const &name) |
| template<class = void> | |
| void | pass () |
| template<class = void> | |
| void | fail (std::string const &reason) |
| template<class = void> | |
| void | log (std::string const &s) |
Private Attributes | |
| std::string | arg_ |
| bool | default_ = false |
| bool | failed_ = false |
| bool | cond_ = false |
| std::recursive_mutex | mutex_ |
Friends | |
| class | suite |
Unit test runner interface.
Derived classes can customize the reporting behavior. This interface is injected into the unit_test class to receive the results of the tests.
|
default |
|
virtualdefault |
|
delete |
| void beast::unit_test::runner::arg | ( | std::string const & | s | ) |
| std::string const & beast::unit_test::runner::arg | ( | ) | const |
| bool beast::unit_test::runner::run | ( | suite_info const & | s | ) |
| bool beast::unit_test::runner::run | ( | FwdIter | first, |
| FwdIter | last | ||
| ) |
Run a sequence of suites.
The expression FwdIter::value_type must be convertible to suite_info.
true if any conditions failed. | bool beast::unit_test::runner::run_if | ( | FwdIter | first, |
| FwdIter | last, | ||
| Pred | pred = Pred{} |
||
| ) |
Conditionally run a sequence of suites.
pred will be called as:
true if any conditions failed. | bool beast::unit_test::runner::run_each | ( | SequenceContainer const & | c | ) |
| bool beast::unit_test::runner::run_each_if | ( | SequenceContainer const & | c, |
| Pred | pred = Pred{} |
||
| ) |
Conditionally run suites in a container.
pred will be called as:
true if any conditions failed.
|
protectedvirtual |
Called when a new suite starts.
Reimplemented in ripple::test::multi_runner_child, beast::unit_test::recorder, and beast::unit_test::detail::reporter< class >.
|
protectedvirtual |
Called when a suite ends.
Reimplemented in beast::unit_test::recorder, beast::unit_test::detail::reporter< class >, and ripple::test::multi_runner_child.
|
protectedvirtual |
Called when a new case starts.
Reimplemented in beast::unit_test::recorder, beast::unit_test::detail::reporter< class >, and ripple::test::multi_runner_child.
|
protectedvirtual |
Called when a new case ends.
Reimplemented in beast::unit_test::recorder, beast::unit_test::detail::reporter< class >, and ripple::test::multi_runner_child.
|
protectedvirtual |
Called for each passing condition.
Reimplemented in beast::unit_test::recorder, beast::unit_test::detail::reporter< class >, and ripple::test::multi_runner_child.
|
protectedvirtual |
Called for each failing condition.
Reimplemented in beast::unit_test::recorder, beast::unit_test::detail::reporter< class >, and ripple::test::multi_runner_child.
|
protectedvirtual |
Called when a test logs output.
Reimplemented in beast::unit_test::recorder, beast::unit_test::detail::reporter< class >, and ripple::test::multi_runner_child.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |