7#include <xrpl/beast/unit_test/suite_info.h>
9#include <boost/assert.hpp>
64 template <
class =
void>
75 template <
class FwdIter>
77 run(FwdIter first, FwdIter last);
87 template <
class FwdIter,
class Pred>
89 runIf(FwdIter first, FwdIter last, Pred pred = Pred{});
95 template <
class SequenceContainer>
97 runEach(SequenceContainer
const& c);
107 template <
class SequenceContainer,
class Pred>
109 runEachIf(SequenceContainer
const& c, Pred pred = Pred{});
172 template <
class =
void>
176 template <
class =
void>
180 template <
class =
void>
184 template <
class =
void>
207template <
class FwdIter>
212 for (; first != last; ++first)
213 failed =
run(*first) || failed;
217template <
class FwdIter,
class Pred>
222 for (; first != last; ++first)
225 failed =
run(*first) || failed;
230template <
class SequenceContainer>
235 for (
auto const& s : c)
236 failed =
run(s) || failed;
240template <
class SequenceContainer,
class Pred>
245 for (
auto const& s : c)
248 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.