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>
12#include <boost/assert.hpp>
63 template <
class =
void>
73 template <
class FwdIter>
75 run(FwdIter first, FwdIter last);
84 template <
class FwdIter,
class Pred>
86 run_if(FwdIter first, FwdIter last, Pred pred = Pred{});
91 template <
class SequenceContainer>
93 run_each(SequenceContainer
const& c);
102 template <
class SequenceContainer,
class Pred>
104 run_each_if(SequenceContainer
const& c, Pred pred = Pred{});
153 template <
class =
void>
157 template <
class =
void>
161 template <
class =
void>
165 template <
class =
void>
188template <
class FwdIter>
193 for (; first != last; ++first)
194 failed =
run(*first) || failed;
198template <
class FwdIter,
class Pred>
203 for (; first != last; ++first)
205 failed =
run(*first) || failed;
209template <
class SequenceContainer>
214 for (
auto const& s : c)
215 failed =
run(s) || failed;
219template <
class SequenceContainer,
class Pred>
224 for (
auto const& s : c)
226 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.