8#ifndef BEAST_UNIT_TEST_RUNNER_H_INCLUDED
9#define BEAST_UNIT_TEST_RUNNER_H_INCLUDED
11#include <xrpl/beast/unit_test/suite_info.h>
13#include <boost/assert.hpp>
64 template <
class =
void>
74 template <
class FwdIter>
76 run(FwdIter first, FwdIter last);
85 template <
class FwdIter,
class Pred>
87 run_if(FwdIter first, FwdIter last, Pred pred = Pred{});
92 template <
class SequenceContainer>
94 run_each(SequenceContainer
const& c);
103 template <
class SequenceContainer,
class Pred>
105 run_each_if(SequenceContainer
const& c, Pred pred = Pred{});
154 template <
class =
void>
158 template <
class =
void>
162 template <
class =
void>
166 template <
class =
void>
189template <
class FwdIter>
194 for (; first != last; ++first)
195 failed =
run(*first) || failed;
199template <
class FwdIter,
class Pred>
204 for (; first != last; ++first)
206 failed =
run(*first) || failed;
210template <
class SequenceContainer>
215 for (
auto const& s : c)
216 failed =
run(s) || failed;
220template <
class SequenceContainer,
class Pred>
225 for (
auto const& s : c)
227 failed =
run(s) || failed;
Unit test runner interface.
virtual void on_suite_begin(suite_info const &)
Called when a new suite starts.
std::string const & arg() const
Returns the argument string.
virtual void on_pass()
Called for each passing condition.
bool run_each_if(SequenceContainer const &c, Pred pred=Pred{})
Conditionally run suites in a container.
virtual void on_fail(std::string const &)
Called for each failing condition.
void log(std::string const &s)
virtual ~runner()=default
runner & operator=(runner const &)=delete
void arg(std::string const &s)
Set the argument string.
runner(runner const &)=delete
virtual void on_case_end()
Called when a new case ends.
virtual void on_suite_end()
Called when a suite ends.
void fail(std::string const &reason)
std::recursive_mutex mutex_
void testcase(std::string const &name)
virtual void on_log(std::string const &)
Called when a test logs output.
bool run_if(FwdIter first, FwdIter last, Pred pred=Pred{})
Conditionally run a sequence of suites.
bool run_each(SequenceContainer const &c)
Run all suites in a container.
virtual void on_case_begin(std::string const &)
Called when a new case starts.
bool run(suite_info const &s)
Run the specified suite.
Associates a unit test type with metadata.
void run(runner &r) const
Run a new instance of the associated test suite.