|
xrpld
|
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 (SuiteInfo 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 | runIf (FwdIter first, FwdIter last, Pred pred=Pred{}) |
| Conditionally run a sequence of suites. | |
| template<class SequenceContainer> | |
| bool | runEach (SequenceContainer const &c) |
| Run all suites in a container. | |
| template<class SequenceContainer, class Pred> | |
| bool | runEachIf (SequenceContainer const &c, Pred pred=Pred{}) |
| Conditionally run suites in a container. | |
Protected Member Functions | |
| virtual void | onSuiteBegin (SuiteInfo const &) |
| Called when a new suite starts. | |
| virtual void | onSuiteEnd () |
| Called when a suite ends. | |
| virtual void | onCaseBegin (std::string const &) |
| Called when a new case starts. | |
| virtual void | onCaseEnd () |
| Called when a new case ends. | |
| virtual void | onPass () |
| Called for each passing condition. | |
| virtual void | onFail (std::string const &) |
| Called for each failing condition. | |
| virtual void | onLog (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 | ) |
|
nodiscard |
| bool beast::unit_test::Runner::run | ( | SuiteInfo const & | s | ) |
| bool beast::unit_test::Runner::run | ( | FwdIter | first, |
| FwdIter | last ) |
| bool beast::unit_test::Runner::runIf | ( | FwdIter | first, |
| FwdIter | last, | ||
| Pred | pred = Pred{} ) |
Conditionally run a sequence of suites.
pred will be called as:
| bool beast::unit_test::Runner::runEach | ( | SequenceContainer const & | c | ) |
| bool beast::unit_test::Runner::runEachIf | ( | SequenceContainer const & | c, |
| Pred | pred = Pred{} ) |
|
protectedvirtual |
Called when a new suite starts.
Reimplemented in beast::unit_test::detail::Reporter< class >, beast::unit_test::Recorder, and xrpl::test::MultiRunnerChild.
|
protectedvirtual |
Called when a suite ends.
Reimplemented in beast::unit_test::detail::Reporter< class >, beast::unit_test::Recorder, and xrpl::test::MultiRunnerChild.
|
protectedvirtual |
Called when a new case starts.
Reimplemented in beast::unit_test::detail::Reporter< class >, beast::unit_test::Recorder, and xrpl::test::MultiRunnerChild.
|
protectedvirtual |
Called when a new case ends.
Reimplemented in beast::unit_test::detail::Reporter< class >, beast::unit_test::Recorder, and xrpl::test::MultiRunnerChild.
|
protectedvirtual |
Called for each passing condition.
Reimplemented in beast::unit_test::detail::Reporter< class >, beast::unit_test::Recorder, and xrpl::test::MultiRunnerChild.
|
protectedvirtual |
Called for each failing condition.
Reimplemented in beast::unit_test::detail::Reporter< class >, beast::unit_test::Recorder, and xrpl::test::MultiRunnerChild.
|
protectedvirtual |
Called when a test logs output.
Reimplemented in beast::unit_test::detail::Reporter< class >, beast::unit_test::Recorder, and xrpl::test::MultiRunnerChild.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |