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>
65 template <
class =
void>
75 template <
class FwdIter>
77 run(FwdIter first, FwdIter last);
86 template <
class FwdIter,
class Pred>
88 run_if(FwdIter first, FwdIter last, Pred pred = Pred{});
93 template <
class SequenceContainer>
95 run_each(SequenceContainer
const& c);
104 template <
class SequenceContainer,
class Pred>
106 run_each_if(SequenceContainer
const& c, Pred pred = Pred{});
155 template <
class =
void>
159 template <
class =
void>
163 template <
class =
void>
167 template <
class =
void>
190template <
class FwdIter>
195 for (; first != last; ++first)
196 failed =
run(*first) || failed;
200template <
class FwdIter,
class Pred>
205 for (; first != last; ++first)
207 failed =
run(*first) || failed;
211template <
class SequenceContainer>
216 for (
auto const& s : c)
217 failed =
run(s) || failed;
221template <
class SequenceContainer,
class Pred>
226 for (
auto const& s : c)
228 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.