7#include <xrpl/beast/unit_test/suite_info.h>
9#include <boost/assert.hpp>
59 template <
class =
void>
69 template <
class FwdIter>
71 run(FwdIter first, FwdIter last);
80 template <
class FwdIter,
class Pred>
82 runIf(FwdIter first, FwdIter last, Pred pred = Pred{});
87 template <
class SequenceContainer>
89 runEach(SequenceContainer
const& c);
98 template <
class SequenceContainer,
class Pred>
100 runEachIf(SequenceContainer
const& c, Pred pred = Pred{});
149 template <
class =
void>
153 template <
class =
void>
157 template <
class =
void>
161 template <
class =
void>
184template <
class FwdIter>
189 for (; first != last; ++first)
190 failed =
run(*first) || failed;
194template <
class FwdIter,
class Pred>
199 for (; first != last; ++first)
202 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)
225 failed =
run(s) || failed;
bool runEachIf(SequenceContainer const &c, Pred pred=Pred{})
Conditionally run suites in a container.
void fail(std::string const &reason)
virtual ~Runner()=default
void testcase(std::string const &name)
virtual void onCaseBegin(std::string const &)
Called when a new case starts.
virtual void onSuiteEnd()
Called when a suite ends.
std::recursive_mutex mutex_
Runner(Runner const &)=delete
virtual void onLog(std::string const &)
Called when a test logs output.
bool runEach(SequenceContainer const &c)
Run all suites in a container.
bool run(SuiteInfo const &s)
Run the specified suite.
bool runIf(FwdIter first, FwdIter last, Pred pred=Pred{})
Conditionally run a sequence of suites.
void log(std::string const &s)
virtual void onCaseEnd()
Called when a new case ends.
virtual void onSuiteBegin(SuiteInfo const &)
Called when a new suite starts.
std::string const & arg() const
Returns the argument string.
void arg(std::string const &s)
Set the argument string.
virtual void onFail(std::string const &)
Called for each failing condition.
Runner & operator=(Runner const &)=delete
virtual void onPass()
Called for each passing condition.
Associates a unit test type with metadata.
void run(Runner &r) const
Run a new instance of the associated test suite.