5#ifndef BEAST_UNIT_TEST_RUNNER_H_INCLUDED
6#define BEAST_UNIT_TEST_RUNNER_H_INCLUDED
8#include <xrpl/beast/unit_test/suite_info.h>
10#include <boost/assert.hpp>
61 template <
class =
void>
71 template <
class FwdIter>
73 run(FwdIter first, FwdIter last);
82 template <
class FwdIter,
class Pred>
84 run_if(FwdIter first, FwdIter last, Pred pred = Pred{});
89 template <
class SequenceContainer>
91 run_each(SequenceContainer
const& c);
100 template <
class SequenceContainer,
class Pred>
102 run_each_if(SequenceContainer
const& c, Pred pred = Pred{});
151 template <
class =
void>
155 template <
class =
void>
159 template <
class =
void>
163 template <
class =
void>
186template <
class FwdIter>
191 for (; first != last; ++first)
192 failed =
run(*first) || failed;
196template <
class FwdIter,
class Pred>
201 for (; first != last; ++first)
203 failed =
run(*first) || failed;
207template <
class SequenceContainer>
212 for (
auto const& s : c)
213 failed =
run(s) || failed;
217template <
class SequenceContainer,
class Pred>
222 for (
auto const& s : c)
224 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.