Developer’s API#

This is a placeholder for all generated APIs.

These should be organized using doxygen groups.

All APIs#

struct accept_many_t#
#include <catch_clara.hpp>
template<typename Matcher>
class AllMatchMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

inline AllMatchMatcher(Matcher matcher)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

Matcher m_matcher#
class AllTrueMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#
template<typename T>
struct always_false : public std::false_type#
template<typename Matcher>
class AnyMatchMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

inline AnyMatchMatcher(Matcher matcher)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

Matcher m_matcher#
class AnyTrueMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#
class Approx#
#include <catch_approx.hpp>

Public Functions

explicit Approx(double value)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline explicit Approx(T const &value)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline Approx &epsilon(T const &newEpsilon)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline Approx &margin(T const &newMargin)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline Approx operator()(T const &value) const#
Approx operator-() const#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline Approx &scale(T const &newScale)#
std::string toString() const#

Public Static Functions

static Approx custom()#

Private Functions

bool equalityComparisonImpl(double other) const#
void setEpsilon(double epsilon)#
void setMargin(double margin)#

Private Members

double m_epsilon#
double m_margin#
double m_scale#
double m_value#

Friends

template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator!=(Approx const &lhs, T const &rhs)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator!=(T const &lhs, Approx const &rhs)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator<=(Approx const &lhs, T const &rhs)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator<=(T const &lhs, Approx const &rhs)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator==(Approx const &lhs, const T &rhs)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator==(const T &lhs, Approx const &rhs)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator>=(Approx const &lhs, T const &rhs)#
template<typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline friend bool operator>=(T const &lhs, Approx const &rhs)#
template<typename T, typename AllocComp, typename AllocMatch>
class ApproxMatcher : public Catch::Matchers::MatcherBase<std::vector<T, AllocMatch>>#

Public Functions

inline ApproxMatcher(std::vector<T, AllocComp> const &comparator)#
inline virtual std::string describe() const override#
template<typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline ApproxMatcher &epsilon(T const &newEpsilon)#
template<typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline ApproxMatcher &margin(T const &newMargin)#
inline virtual bool match(std::vector<T, AllocMatch> const &v) const override#
template<typename = std::enable_if_t<std::is_constructible<double, T>::value>>
inline ApproxMatcher &scale(T const &newScale)#

Private Members

mutable Catch::Approx approx = Catch::Approx::custom()#
std::vector<T, AllocComp> const &m_comparator#
class Arg : public Catch::Clara::Detail::ParserRefImpl<Arg>#
#include <catch_clara.hpp>

Public Functions

virtual Detail::InternalParseResult parse(std::string const&, Detail::TokenStream const &tokens) const override#
class Args#
#include <catch_clara.hpp>

Public Functions

Args(int argc, char const *const *argv)#
Args(std::initializer_list<std::string> args)#
inline std::string const &exeName() const#

Private Members

std::vector<std::string> m_args#
std::string m_exeName#
template<typename T>
struct as#
class AssertionHandler#

Public Functions

AssertionHandler(StringRef macroName, SourceLineInfo const &lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition)#
inline ~AssertionHandler()#
auto allowThrows() const -> bool#
void complete()#
void handleExceptionNotThrownAsExpected()#
void handleExceptionThrownAsExpected()#
template<typename T>
inline void handleExpr(ExprLhs<T> const &expr)#
void handleExpr(ITransientExpression const &expr)#
void handleMessage(ResultWas::OfType resultType, StringRef message)#
void handleThrowingCallSkipped()#
void handleUnexpectedExceptionNotThrown()#
void handleUnexpectedInflightException()#

Private Members

AssertionInfo m_assertionInfo#
bool m_completed = false#
AssertionReaction m_reaction#
IResultCapture &m_resultCapture#
struct AssertionInfo#

Public Members

StringRef capturedExpression#
SourceLineInfo lineInfo#
StringRef macroName#
ResultDisposition::Flags resultDisposition#
class AssertionOrBenchmarkResult#

Represents either an assertion or a benchmark result to be handled by cumulative reporter later.

Public Functions

AssertionOrBenchmarkResult(AssertionStats const &assertion)#
AssertionOrBenchmarkResult(BenchmarkStats<> const &benchmark)#
AssertionStats const &asAssertion() const#
BenchmarkStats const &asBenchmark() const#
bool isAssertion() const#
bool isBenchmark() const#

Private Members

Optional<AssertionStats> m_assertion#
Optional<BenchmarkStats<>> m_benchmark#
struct AssertionReaction#

Public Members

bool shouldDebugBreak = false#
bool shouldSkip = false#
bool shouldThrow = false#
class AssertionResult#

Public Functions

AssertionResult() = delete#
AssertionResult(AssertionInfo const &info, AssertionResultData &&data)#
std::string getExpandedExpression() const#
std::string getExpression() const#
std::string getExpressionInMacro() const#
StringRef getMessage() const#
ResultWas::OfType getResultType() const#
SourceLineInfo getSourceInfo() const#
StringRef getTestMacroName() const#
bool hasExpandedExpression() const#
bool hasExpression() const#
bool hasMessage() const#
bool isOk() const#
bool succeeded() const#

Public Members

AssertionInfo m_info#
AssertionResultData m_resultData#
struct AssertionResultData#

Public Functions

AssertionResultData() = delete#
AssertionResultData(ResultWas::OfType _resultType, LazyExpression const &_lazyExpression)#
std::string reconstructExpression() const#

Public Members

LazyExpression lazyExpression#
std::string message#
mutable std::string reconstructedExpression#
ResultWas::OfType resultType#
struct AssertionStats#

Public Functions

AssertionStats(AssertionResult const &_assertionResult, std::vector<MessageInfo> const &_infoMessages, Totals const &_totals)#
AssertionStats(AssertionStats&&) = default#
AssertionStats(AssertionStats const&) = default#
AssertionStats &operator=(AssertionStats&&) = delete#
AssertionStats &operator=(AssertionStats const&) = delete#

Public Members

AssertionResult assertionResult#
std::vector<MessageInfo> infoMessages#
Totals totals#
class AutomakeReporter : public Catch::StreamingReporterBase#

Public Functions

inline AutomakeReporter(ReporterConfig &&_config)#
~AutomakeReporter() override#
virtual void skipTest(TestCaseInfo const &testInfo) override#

Called with test cases that are skipped due to the test run aborting.

NOT called for test cases that are explicitly skipped using the SKIP macro.

Deprecated - will be removed in the next major release.

virtual void testCaseEnded(TestCaseStats const &_testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

Public Static Functions

static inline std::string getDescription()#
struct AutoReg : public Catch::Detail::NonCopyable#

Public Functions

AutoReg(Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const &lineInfo, StringRef classOrMethod, NameAndTags const &nameAndTags) noexcept#
template<typename T = void>
class BasicResult : public Catch::Clara::Detail::ResultValueBase<void>#
#include <catch_clara.hpp>

Public Functions

template<typename U>
inline explicit BasicResult(BasicResult<U> const &other)#
inline auto errorMessage() const -> std::string const&#
inline explicit operator bool() const#
inline auto type() const -> ResultType#

Public Static Functions

static inline auto logicError(std::string &&message) -> BasicResult#
static inline auto ok() -> BasicResult#
template<typename U>
static inline auto ok(U const &value) -> BasicResult#
static inline auto runtimeError(std::string &&message) -> BasicResult#

Protected Functions

inline BasicResult(ResultType type, std::string &&message)#
inline virtual void enforceOk() const override#

Protected Attributes

std::string m_errorMessage#
ResultType m_type#
struct Benchmark#

Public Functions

inline Benchmark(std::string &&benchmarkName)#
template<class FUN>
inline Benchmark(std::string &&benchmarkName, FUN &&func)#
inline explicit operator bool()#
template<typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value, int> = 0>
inline Benchmark &operator=(Fun func)#
template<typename Clock>
inline ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const#
template<typename Clock = default_clock>
inline void run()#

Private Members

Detail::BenchmarkFunction fun#
std::string name#
struct BenchmarkFunction#

We need to reinvent std::function because every piece of code that might add overhead in a measurement context needs to have consistent performance characteristics so that we can account for it in the measurement.

Implementations of std::function with optimizations that aren’t always applicable, like small buffer optimizations, are not uncommon. This is effectively an implementation of std::function without any such optimizations; it may be slow, but it is consistently slow.

Public Functions

inline BenchmarkFunction()#
inline BenchmarkFunction(BenchmarkFunction &&that) noexcept#
inline BenchmarkFunction(BenchmarkFunction const &that)#
template<typename Fun, std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0>
inline BenchmarkFunction(Fun &&fun)#
inline void operator()(Chronometer meter) const#
inline BenchmarkFunction &operator=(BenchmarkFunction &&that) noexcept#
inline BenchmarkFunction &operator=(BenchmarkFunction const &that)#

Private Functions

template<typename T>
inline BenchmarkFunction(model<T> *c)#

Private Members

Catch::Detail::unique_ptr<callable> f#
struct BenchmarkInfo#

Public Members

double clockCost#
double clockResolution#
double estimatedDuration#
int iterations#
std::string name#
unsigned int resamples#
unsigned int samples#
template<class Duration>
struct BenchmarkStats#

Public Functions

template<typename Duration2>
inline operator BenchmarkStats<Duration2>() const#

Public Members

BenchmarkInfo info#
Benchmark::Estimate<Duration> mean#
Benchmark::OutlierClassification outliers#
double outlierVariance#
std::vector<Duration> samples#
Benchmark::Estimate<Duration> standardDeviation#
template<typename LhsT, typename RhsT>
class BinaryExpr : public Catch::ITransientExpression#

Public Functions

inline BinaryExpr(bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs)#
template<typename T>
inline auto operator!=(T) const -> BinaryExpr<LhsT, RhsT const&> const#
template<typename T>
inline auto operator&&(T) const -> BinaryExpr<LhsT, RhsT const&> const#
template<typename T>
inline auto operator<(T) const -> BinaryExpr<LhsT, RhsT const&> const#
template<typename T>
inline auto operator<=(T) const -> BinaryExpr<LhsT, RhsT const&> const#
template<typename T>
inline auto operator==(T) const -> BinaryExpr<LhsT, RhsT const&> const#
template<typename T>
inline auto operator>(T) const -> BinaryExpr<LhsT, RhsT const&> const#
template<typename T>
inline auto operator>=(T) const -> BinaryExpr<LhsT, RhsT const&> const#
template<typename T>
inline auto operator||(T) const -> BinaryExpr<LhsT, RhsT const&> const#

Private Functions

inline virtual void streamReconstructedExpression(std::ostream &os) const override#

Private Members

LhsT m_lhs#
StringRef m_op#
RhsT m_rhs#
struct bootstrap_analysis#
#include <catch_stats.hpp>

Public Members

Estimate<double> mean#
double outlier_variance#
Estimate<double> standard_deviation#
template<typename L>
struct BoundFlagLambda : public Catch::Clara::Detail::BoundFlagRefBase#
#include <catch_clara.hpp>

Public Functions

inline explicit BoundFlagLambda(L const &lambda)#
inline virtual auto setFlag(bool flag) -> ParserResult override#

Public Members

L m_lambda#
struct BoundFlagRef : public Catch::Clara::Detail::BoundFlagRefBase#
#include <catch_clara.hpp>

Public Functions

inline explicit BoundFlagRef(bool &ref)#
virtual ParserResult setFlag(bool flag) override#

Public Members

bool &m_ref#
struct BoundFlagRefBase : public Catch::Clara::Detail::BoundRef#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::BoundFlagLambda< L >, Catch::Clara::Detail::BoundFlagRef

Public Functions

virtual bool isFlag() const override#
virtual auto setFlag(bool flag) -> ParserResult = 0#
template<typename L>
struct BoundLambda : public Catch::Clara::Detail::BoundValueRefBase#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::BoundManyLambda< L >

Public Functions

inline explicit BoundLambda(L const &lambda)#
inline virtual auto setValue(std::string const &arg) -> ParserResult override#

Public Members

L m_lambda#
template<typename L>
struct BoundManyLambda : public Catch::Clara::Detail::BoundLambda<L>#
#include <catch_clara.hpp>

Public Functions

inline explicit BoundManyLambda(L const &lambda)#
inline virtual bool isContainer() const override#
struct BoundRef : public Catch::Detail::NonCopyable#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::BoundFlagRefBase, Catch::Clara::Detail::BoundValueRefBase

Public Functions

virtual ~BoundRef() = default#
virtual bool isContainer() const#
virtual bool isFlag() const#
template<typename T>
struct BoundValueRef : public Catch::Clara::Detail::BoundValueRefBase#
#include <catch_clara.hpp>

Public Functions

inline explicit BoundValueRef(T &ref)#
inline virtual ParserResult setValue(std::string const &arg) override#

Public Members

T &m_ref#
template<typename T>
struct BoundValueRef<std::vector<T>> : public Catch::Clara::Detail::BoundValueRefBase#
#include <catch_clara.hpp>

Public Functions

inline explicit BoundValueRef(std::vector<T> &ref)#
inline virtual auto isContainer() const -> bool override#
inline virtual auto setValue(std::string const &arg) -> ParserResult override#

Public Members

std::vector<T> &m_ref#
struct BoundValueRefBase : public Catch::Clara::Detail::BoundRef#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::BoundLambda< L >, Catch::Clara::Detail::BoundValueRef< T >, Catch::Clara::Detail::BoundValueRef< std::vector< T > >

Public Functions

virtual auto setValue(std::string const &arg) -> ParserResult = 0#
struct callable#

Public Functions

callable() = default#
callable(callable const&) = default#
virtual ~callable()#
virtual void call(Chronometer meter) const = 0#
virtual Catch::Detail::unique_ptr<callable> clone() const = 0#
callable &operator=(callable const&) = default#
class Capturer#
#include <catch_message.hpp>

Public Functions

Capturer(Capturer const&) = delete#
Capturer(StringRef macroName, SourceLineInfo const &lineInfo, ResultWas::OfType resultType, StringRef names)#
~Capturer()#
void captureValue(size_t index, std::string const &value)#
template<typename T>
inline void captureValues(size_t index, T const &value)#
template<typename T, typename ...Ts>
inline void captureValues(size_t index, T const &value, Ts const&... values)#
Capturer &operator=(Capturer const&) = delete#

Private Members

size_t m_captured = 0#
std::vector<MessageInfo> m_messages#
IResultCapture &m_resultCapture#
struct CasedString#

Public Functions

CasedString(std::string const &str, CaseSensitive caseSensitivity)#
std::string adjustString(std::string const &str) const#
StringRef caseSensitivitySuffix() const#

Public Members

CaseSensitive m_caseSensitivity#
std::string m_str#
struct CaseInsensitiveEqualTo#

Provides case-insensitive op== semantics when called.

Public Functions

bool operator()(StringRef lhs, StringRef rhs) const#
struct CaseInsensitiveLess#

Provides case-insensitive op< semantics when called.

Public Functions

bool operator()(StringRef lhs, StringRef rhs) const#
struct Catch_global_namespace_dummy#
#include <catch_tostring.hpp>
struct Chronometer#

Public Functions

inline Chronometer(Detail::ChronometerConcept &meter, int repeats_)#
template<typename Fun>
inline void measure(Fun &&fun)#
inline int runs() const#

Private Functions

template<typename Fun>
inline void measure(Fun &&fun, std::false_type)#
template<typename Fun>
inline void measure(Fun &&fun, std::true_type)#

Private Members

Detail::ChronometerConcept *impl#
int repeats#
struct ChronometerConcept#

Subclassed by Catch::Benchmark::Detail::ChronometerModel< Clock >

Public Functions

ChronometerConcept() = default#
ChronometerConcept(ChronometerConcept const&) = default#
virtual ~ChronometerConcept()#
virtual void finish() = 0#
ChronometerConcept &operator=(ChronometerConcept const&) = default#
virtual void start() = 0#
template<typename Clock>
struct ChronometerModel : public Catch::Benchmark::Detail::ChronometerConcept#

Public Functions

inline ClockDuration<Clock> elapsed() const#
inline virtual void finish() override#
inline virtual void start() override#

Public Members

TimePoint<Clock> finished#
TimePoint<Clock> started#
template<typename T>
class ChunkGenerator : public Catch::Generators::IGenerator<std::vector<T>>#

Public Functions

inline ChunkGenerator(size_t size, GeneratorWrapper<T> generator)#
inline virtual std::vector<T> const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

std::vector<T> m_chunk#
size_t m_chunk_size#
GeneratorWrapper<T> m_generator#
bool m_used_up = false#
struct Colour#

Public Types

enum Code#

Values:

enumerator None#
enumerator White#
enumerator Red#
enumerator Green#
enumerator Blue#
enumerator Cyan#
enumerator Yellow#
enumerator Grey#
enumerator Bright#
enumerator BrightRed#
enumerator BrightGreen#
enumerator LightGrey#
enumerator BrightWhite#
enumerator BrightYellow#
enumerator FileName#
enumerator Warning#
enumerator ResultError#
enumerator ResultSuccess#
enumerator ResultExpectedFailure#
enumerator Error#
enumerator Success#
enumerator Skip#
enumerator OriginalExpression#
enumerator ReconstructedExpression#
enumerator SecondaryText#
enumerator Headers#
class ColourGuard#

RAII wrapper around writing specific colour of text using specific colour impl into a stream.

Public Functions

ColourGuard(Colour::Code code, ColourImpl const *colour)#

Does not engage the guard/start the colour.

ColourGuard(ColourGuard &&rhs) noexcept#
ColourGuard(ColourGuard const &rhs) = delete#
~ColourGuard()#

Removes colour if the guard was engaged.

ColourGuard &engage(std::ostream &stream) &#

Explicitly engages colour for given stream.

The API based on operator<< should be preferred.

ColourGuard &&engage(std::ostream &stream) &&#

Explicitly engages colour for given stream.

The API based on operator<< should be preferred.

ColourGuard &operator=(ColourGuard &&rhs) noexcept#
ColourGuard &operator=(ColourGuard const &rhs) = delete#

Private Functions

void engageImpl(std::ostream &stream)#

Private Members

Colour::Code m_code#
ColourImpl const *m_colourImpl#
bool m_engaged = false#

Friends

inline friend std::ostream &operator<<(std::ostream &lhs, ColourGuard &&guard)#

Engages the guard and starts using colour.

inline friend std::ostream &operator<<(std::ostream &lhs, ColourGuard &guard)#

Engages the guard and starts using colour.

class ColourImpl#

Public Functions

inline ColourImpl(IStream *stream)#
virtual ~ColourImpl()#
ColourGuard guardColour(Colour::Code colourCode)#

Creates a guard object for given colour and this colour impl.

Important: the guard starts disengaged, and has to be engaged explicitly.

Protected Attributes

IStream *m_stream#

The associated stream of this ColourImpl instance.

Private Functions

virtual void use(Colour::Code colourCode) const = 0#
class Column#
#include <catch_textflow.hpp>

Represents a column of text with specific width and indentation.

When written out to a stream, it will perform linebreaking of the provided text so that the written lines fit within target width.

Public Types

using iterator = const_iterator#

Public Functions

inline explicit Column(std::string const &text)#
inline const_iterator begin() const#
inline const_iterator end() const#
inline Column &indent(size_t newIndent)#
inline Column &initialIndent(size_t newIndent)#
Columns operator+(Column const &other)#
inline size_t width() const#
inline Column &width(size_t newWidth)#

Private Members

size_t m_indent = 0#
size_t m_initialIndent = std::string::npos#
std::string m_string#
size_t m_width = CATCH_CONFIG_CONSOLE_WIDTH - 1#

Friends

friend std::ostream &operator<<(std::ostream &os, Column const &col)#
class Columns#
#include <catch_textflow.hpp>

Public Types

using const_iterator = iterator#

Public Functions

inline iterator begin() const#
inline iterator end() const#
Columns operator+(Column const &col)#
Columns &operator+=(Column const &col)#

Private Members

std::vector<Column> m_columns#

Friends

friend std::ostream &operator<<(std::ostream &os, Columns const &cols)#
class CompactReporter : public Catch::StreamingReporterBase#

Public Functions

~CompactReporter() override#
virtual void assertionEnded(AssertionStats const &_assertionStats) override#

Called after assertion was fully evaluated.

virtual void noMatchingTestCases(StringRef unmatchedSpec) override#

Called when no test cases match provided test spec.

virtual void sectionEnded(SectionStats const &_sectionStats) override#

Called after a SECTION has finished running.

inline StreamingReporterBase(ReporterConfig &&_config)#
virtual void testRunEnded(TestRunStats const &_testRunStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &_testInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Public Static Functions

static std::string getDescription()#
template<typename Result>
struct CompleteInvoker#

Public Static Functions

template<typename Fun, typename ...Args>
static inline Result invoke(Fun &&fun, Args&&... args)#
template<>
struct CompleteInvoker<void>#

Public Static Functions

template<typename Fun, typename ...Args>
static inline CompleteType_t<void> invoke(Fun &&fun, Args&&... args)#
template<typename T>
struct CompleteType#

Public Types

using type = T#
template<>
struct CompleteType<void>#
template<typename DerivedT>
class ComposableParserImpl : public Catch::Clara::Detail::ParserBase#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::ParserRefImpl< Opt >, Catch::Clara::Detail::ParserRefImpl< Arg >, Catch::Clara::Detail::ParserRefImpl< DerivedT >

Public Functions

template<typename T>
Parser operator|(T const &other) const#
template<typename T>
auto operator|(T const &other) const -> Parser
class Config : public Catch::IConfig#
#include <catch_config.hpp>

Public Functions

Config() = default#
Config(ConfigData const &data)#
~Config() override#
virtual int abortAfter() const override#
virtual bool allowThrows() const override#
virtual double benchmarkConfidenceInterval() const override#
virtual bool benchmarkNoAnalysis() const override#
virtual unsigned int benchmarkResamples() const override#
virtual unsigned int benchmarkSamples() const override#
virtual std::chrono::milliseconds benchmarkWarmupTime() const override#
virtual ColourMode defaultColourMode() const override#
std::vector<ProcessedReporterSpec> const &getProcessedReporterSpecs() const#
std::vector<ReporterSpec> const &getReporterSpecs() const#
virtual std::vector<std::string> const &getSectionsToRun() const override#
virtual std::vector<std::string> const &getTestsOrTags() const override#
virtual bool hasTestFilters() const override#
virtual bool includeSuccessfulResults() const override#
bool listListeners() const#
bool listReporters() const#
bool listTags() const#
bool listTests() const#
virtual double minDuration() const override#
virtual StringRef name() const override#
virtual uint32_t rngSeed() const override#
virtual TestRunOrder runOrder() const override#
virtual unsigned int shardCount() const override#
virtual unsigned int shardIndex() const override#
virtual bool shouldDebugBreak() const override#
virtual ShowDurations showDurations() const override#
bool showHelp() const#
virtual bool showInvisibles() const override#
virtual bool skipBenchmarks() const override#
virtual TestSpec const &testSpec() const override#
virtual Verbosity verbosity() const override#
virtual bool warnAboutMissingAssertions() const override#
virtual bool warnAboutUnmatchedTestSpecs() const override#
virtual bool zeroTestsCountAsSuccess() const override#

Private Functions

void readBazelEnvVars()#

Private Members

ConfigData m_data#
bool m_hasTestFilters = false#
std::vector<ProcessedReporterSpec> m_processedReporterSpecs#
TestSpec m_testSpec#
struct ConfigData#
#include <catch_config.hpp>

Public Members

int abortAfter = -1#
bool allowZeroTests = false#
double benchmarkConfidenceInterval = 0.95#
bool benchmarkNoAnalysis = false#
unsigned int benchmarkResamples = 100000#
unsigned int benchmarkSamples = 100#
std::chrono::milliseconds::rep benchmarkWarmupTime = 100#
ColourMode defaultColourMode = ColourMode::PlatformDefault#
std::string defaultOutputFilename#
bool filenamesAsTags = false#
bool libIdentify = false#
bool listListeners = false#
bool listReporters = false#
bool listTags = false#
bool listTests = false#
double minDuration = -1#
std::string name#
bool noThrow = false#
std::string processName#
std::vector<ReporterSpec> reporterSpecifications#
uint32_t rngSeed = generateRandomSeed(GenerateFrom::Default)#
TestRunOrder runOrder = TestRunOrder::Declared#
std::vector<std::string> sectionsToRun#
unsigned int shardCount = 1#
unsigned int shardIndex = 0#
bool shouldDebugBreak = false#
ShowDurations showDurations = ShowDurations::DefaultForReporter#
bool showHelp = false#
bool showInvisibles = false#
bool showSuccessfulTests = false#
bool skipBenchmarks = false#
std::vector<std::string> testsOrTags#
Verbosity verbosity = Verbosity::Normal#
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never#
WarnAbout::What warnings = WarnAbout::Nothing#
template<class...>
struct conjunction : public std::true_type#
template<class B1>
struct conjunction<B1> : public B1#
template<class B1, class ...Bn>
struct conjunction<B1, Bn...> : public std::conditional_t<bool(B1::value), conjunction<Bn...>, B1>#
class ConsoleReporter : public Catch::StreamingReporterBase#

Public Functions

ConsoleReporter(ReporterConfig &&config)#
~ConsoleReporter() override#
virtual void assertionEnded(AssertionStats const &_assertionStats) override#

Called after assertion was fully evaluated.

virtual void assertionStarting(AssertionInfo const&) override#

Called before assertion success/failure is evaluated.

virtual void benchmarkEnded(BenchmarkStats<> const &stats) override#

Called with the benchmark results if benchmark successfully finishes.

virtual void benchmarkFailed(StringRef error) override#

Called if running the benchmarks fails for any reason.

virtual void benchmarkPreparing(StringRef name) override#

Called when user-code is being probed before the actual benchmark runs.

virtual void benchmarkStarting(BenchmarkInfo const &info) override#

Called after probe but before the user-code is being benchmarked.

virtual void noMatchingTestCases(StringRef unmatchedSpec) override#

Called when no test cases match provided test spec.

virtual void reportInvalidTestSpec(StringRef arg) override#

Called for all invalid test specs from the cli.

virtual void sectionEnded(SectionStats const &_sectionStats) override#

Called after a SECTION has finished running.

virtual void sectionStarting(SectionInfo const &_sectionInfo) override#

Called when a SECTION is being entered. Not called for skipped sections.

virtual void testCaseEnded(TestCaseStats const &_testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &_testRunStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &_testRunInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Public Static Functions

static std::string getDescription()#

Private Functions

void lazyPrint()#
void lazyPrintRunInfo()#
void lazyPrintWithoutClosingBenchmarkTable()#
void printClosedHeader(std::string const &_name)#
void printHeaderString(std::string const &_string, std::size_t indent = 0)#
void printOpenHeader(std::string const &_name)#
void printTestCaseAndSectionHeader()#
void printTotalsDivider(Totals const &totals)#

Private Members

bool m_headerPrinted = false#
Detail::unique_ptr<TablePrinter> m_tablePrinter#
bool m_testRunInfoPrinted = false#
class const_iterator#
#include <catch_textflow.hpp>

Iterates “lines” in Column and return sthem.

Public Types

using difference_type = std::ptrdiff_t#
using iterator_category = std::forward_iterator_tag#
using pointer = value_type*#
using reference = value_type&#
using value_type = std::string#

Public Functions

explicit const_iterator(Column const &column)#
inline bool operator!=(const_iterator const &other) const#
std::string operator*() const#
const_iterator &operator++()#
const_iterator operator++(int)#
inline bool operator==(const_iterator const &other) const#

Private Functions

inline const_iterator(Column const &column, EndTag)#
std::string addIndentAndSuffix(size_t position, size_t length) const#
void calcLength()#
size_t indentSize() const#

Private Members

friend Column
bool m_addHyphen = false#
Column const &m_column#
size_t m_lineLength = 0#
size_t m_lineStart = 0#
size_t m_parsedTo = 0#
template<typename T, typename Equality>
class ContainsElementMatcher : public Catch::Matchers::MatcherGenericBase#

Matcher for checking that an element in range is equal to specific element.

Public Functions

template<typename T2, typename Equality2>
inline ContainsElementMatcher(T2 &&target, Equality2 &&predicate)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

T m_desired#
Equality m_eq#
template<typename T, typename AllocComp, typename AllocMatch>
class ContainsMatcher : public Catch::Matchers::MatcherBase<std::vector<T, AllocMatch>>#

Public Functions

inline ContainsMatcher(std::vector<T, AllocComp> const &comparator)#
inline virtual std::string describe() const override#
inline virtual bool match(std::vector<T, AllocMatch> const &v) const override#

Private Members

std::vector<T, AllocComp> const &m_comparator#
template<typename Matcher>
class ContainsMatcherMatcher : public Catch::Matchers::MatcherGenericBase#

Meta-matcher for checking that an element in a range matches a specific matcher.

Public Functions

inline ContainsMatcherMatcher(Matcher matcher)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

Matcher m_matcher#
class Context#
#include <catch_context.hpp>

Public Functions

inline IConfig const *getConfig() const#
inline IResultCapture *getResultCapture() const#
void setConfig(IConfig const *config)#
void setResultCapture(IResultCapture *resultCapture)#

Private Members

IConfig const *m_config = nullptr#
IResultCapture *m_resultCapture = nullptr#

Private Static Functions

static void createContext()#

Private Static Attributes

static CATCH_EXPORT Context * currentContext   = nullptr

Friends

friend void cleanUpContext()#
friend Context const &getCurrentContext()#
friend Context &getCurrentMutableContext()#
struct Counts#
#include <catch_totals.hpp>

Public Functions

bool allOk() const#
bool allPassed() const#
Counts &operator+=(Counts const &other)#
Counts operator-(Counts const &other) const#
std::uint64_t total() const#

Public Members

std::uint64_t failed = 0#
std::uint64_t failedButOk = 0#
std::uint64_t passed = 0#
std::uint64_t skipped = 0#
class CumulativeReporterBase : public Catch::ReporterBase#

Utility base for reporters that need to handle all results at once.

It stores tree of all test cases, sections and assertions, and after the test run is finished, calls into testRunEndedCumulative to pass the control to the deriving class.

If you are deriving from this class and override any testing related member functions, you should first call into the base’s implementation to avoid breaking the tree construction.

Due to the way this base functions, it has to expand assertions up-front, even if they are later unused (e.g. because the deriving reporter does not report successful assertions, or because the deriving reporter does not use assertion expansion at all). Derived classes can use two customization points, m_shouldStoreSuccesfulAssertions and m_shouldStoreFailedAssertions, to disable the expansion and gain extra performance. Accessing the assertion expansions if it wasn’t stored is UB.

Subclassed by Catch::JunitReporter, Catch::SonarQubeReporter

Public Types

using TestCaseNode = Node<TestCaseStats, SectionNode>#
using TestRunNode = Node<TestRunStats, TestCaseNode>#

Public Functions

inline CumulativeReporterBase(ReporterConfig &&_config)#
~CumulativeReporterBase() override#
virtual void assertionEnded(AssertionStats const &assertionStats) override#

Called after assertion was fully evaluated.

inline virtual void assertionStarting(AssertionInfo const&) override#

Called before assertion success/failure is evaluated.

virtual void benchmarkEnded(BenchmarkStats<> const &benchmarkStats) override#

Called with the benchmark results if benchmark successfully finishes.

inline virtual void benchmarkFailed(StringRef) override#

Called if running the benchmarks fails for any reason.

inline virtual void benchmarkPreparing(StringRef) override#

Called when user-code is being probed before the actual benchmark runs.

inline virtual void benchmarkStarting(BenchmarkInfo const&) override#

Called after probe but before the user-code is being benchmarked.

inline virtual void fatalErrorEncountered(StringRef) override#

Called if a fatal error (signal/structured exception) occurred.

inline virtual void noMatchingTestCases(StringRef) override#

Called when no test cases match provided test spec.

inline virtual void reportInvalidTestSpec(StringRef) override#

Called for all invalid test specs from the cli.

virtual void sectionEnded(SectionStats const &sectionStats) override#

Called after a SECTION has finished running.

virtual void sectionStarting(SectionInfo const &sectionInfo) override#

Called when a SECTION is being entered. Not called for skipped sections.

inline virtual void skipTest(TestCaseInfo const&) override#

Called with test cases that are skipped due to the test run aborting.

NOT called for test cases that are explicitly skipped using the SKIP macro.

Deprecated - will be removed in the next major release.

virtual void testCaseEnded(TestCaseStats const &testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

inline virtual void testCasePartialEnded(TestCaseStats const&, uint64_t) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

inline virtual void testCasePartialStarting(TestCaseInfo const&, uint64_t) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

inline virtual void testCaseStarting(TestCaseInfo const&) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &testRunStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunEndedCumulative() = 0#

Customization point: called after last test finishes (testRunEnded has been handled)

inline virtual void testRunStarting(TestRunInfo const&) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Protected Attributes

bool m_shouldStoreFailedAssertions = true#

Should the cumulative base store the assertion expansion for failed assertions?

bool m_shouldStoreSuccesfulAssertions = true#

Should the cumulative base store the assertion expansion for successful assertions?

Detail::unique_ptr<TestRunNode> m_testRun#

The root node of the test run tree.

Private Members

SectionNode *m_deepestSection = nullptr#
Detail::unique_ptr<SectionNode> m_rootSection#
std::vector<SectionNode*> m_sectionStack#
std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases#
struct Decomposer#

Friends

template<typename T, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<T>>::value, int> = 0>
inline friend auto operator<=(Decomposer&&, T &&lhs) -> ExprLhs<T const&>#
template<typename T, std::enable_if_t<std::is_arithmetic<T>::value, int> = 0>
inline friend auto operator<=(Decomposer&&, T value) -> ExprLhs<T>#
template<class...>
struct disjunction : public std::false_type#
template<class B1>
struct disjunction<B1> : public B1#
template<class B1, class ...Bn>
struct disjunction<B1, Bn...> : public std::conditional_t<bool(B1::value), B1, disjunction<Bn...>>#
struct do_nothing#

Public Functions

inline void operator()() const#
class EndsWithMatcher : public Catch::Matchers::StringMatcherBase#

Public Functions

EndsWithMatcher(CasedString const &comparator)#
virtual bool match(std::string const &source) const override#
struct EndTag#
struct EndTag#
struct EnumInfo#

Public Functions

~EnumInfo()#
StringRef lookup(int value) const#

Public Members

StringRef m_name#
std::vector<std::pair<int, StringRef>> m_values#
class EnumValuesRegistry : public Catch::IMutableEnumValuesRegistry#

Private Functions

virtual EnumInfo const &registerEnum(StringRef enumName, StringRef allEnums, std::vector<int> const &values) override#

Private Members

std::vector<Catch::Detail::unique_ptr<EnumInfo>> m_enumInfos#
template<typename Clock>
struct Environment#

Public Types

using clock_type = Clock#

Public Members

EnvironmentEstimate<FloatDuration<Clock>> clock_cost#
EnvironmentEstimate<FloatDuration<Clock>> clock_resolution#
template<typename Duration>
struct EnvironmentEstimate#

Public Functions

template<typename Duration2>
inline operator EnvironmentEstimate<Duration2>() const#

Public Members

Duration mean#
OutlierClassification outliers#
template<typename T, typename AllocComp, typename AllocMatch>
class EqualsMatcher : public Catch::Matchers::MatcherBase<std::vector<T, AllocMatch>>#

Public Functions

inline EqualsMatcher(std::vector<T, AllocComp> const &comparator)#
inline virtual std::string describe() const override#
inline virtual bool match(std::vector<T, AllocMatch> const &v) const override#

Private Members

std::vector<T, AllocComp> const &m_comparator#
class ErrnoGuard#

Simple RAII class that stores the value of errno at construction and restores it at destruction.

Public Functions

ErrnoGuard()#
~ErrnoGuard()#

Private Members

int m_oldErrno#
template<typename Duration>
struct Estimate#
#include <catch_estimate.hpp>

Public Functions

template<typename Duration2>
inline operator Estimate<Duration2>() const#

Public Members

double confidence_interval#
Duration lower_bound#
Duration point#
Duration upper_bound#
class EventListenerBase : public Catch::IEventListener#

Base class to simplify implementing listeners.

Provides empty default implementation for all IEventListener member functions, so that a listener implementation can pick which member functions it actually cares about.

Public Functions

virtual void assertionEnded(AssertionStats const &assertionStats) override#

Called after assertion was fully evaluated.

virtual void assertionStarting(AssertionInfo const &assertionInfo) override#

Called before assertion success/failure is evaluated.

virtual void benchmarkEnded(BenchmarkStats<> const &benchmarkStats) override#

Called with the benchmark results if benchmark successfully finishes.

virtual void benchmarkFailed(StringRef error) override#

Called if running the benchmarks fails for any reason.

virtual void benchmarkPreparing(StringRef name) override#

Called when user-code is being probed before the actual benchmark runs.

virtual void benchmarkStarting(BenchmarkInfo const &benchmarkInfo) override#

Called after probe but before the user-code is being benchmarked.

virtual void fatalErrorEncountered(StringRef error) override#

Called if a fatal error (signal/structured exception) occurred.

inline IEventListener(IConfig const *config)#
virtual void listListeners(std::vector<ListenerDescription> const &descriptions) override#

Writes out the provided listeners descriptions using reporter-specific format.

virtual void listReporters(std::vector<ReporterDescription> const &descriptions) override#

Writes out information about provided reporters using reporter-specific format.

virtual void listTags(std::vector<TagInfo> const &tagInfos) override#

Writes out information about the provided tags using reporter-specific format.

virtual void listTests(std::vector<TestCaseHandle> const &tests) override#

Writes out information about provided tests using reporter-specific format.

virtual void noMatchingTestCases(StringRef unmatchedSpec) override#

Called when no test cases match provided test spec.

virtual void reportInvalidTestSpec(StringRef unmatchedSpec) override#

Called for all invalid test specs from the cli.

virtual void sectionEnded(SectionStats const &sectionStats) override#

Called after a SECTION has finished running.

virtual void sectionStarting(SectionInfo const &sectionInfo) override#

Called when a SECTION is being entered. Not called for skipped sections.

virtual void skipTest(TestCaseInfo const &testInfo) override#

Called with test cases that are skipped due to the test run aborting.

NOT called for test cases that are explicitly skipped using the SKIP macro.

Deprecated - will be removed in the next major release.

virtual void testCaseEnded(TestCaseStats const &testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testCasePartialEnded(TestCaseStats const &testCaseStats, uint64_t partNumber) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void testCasePartialStarting(TestCaseInfo const &testInfo, uint64_t partNumber) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void testCaseStarting(TestCaseInfo const &testInfo) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &testRunStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &testRunInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

class EventListenerFactory#

Public Functions

virtual ~EventListenerFactory()#
virtual IEventListenerPtr create(IConfig const *config) const = 0#
virtual std::string getDescription() const = 0#

Return listener’s description if available.

virtual StringRef getName() const = 0#

Return a meaningful name for the listener, e.g. its type name.

class ExceptionMessageMatcher : public Catch::Matchers::MatcherBase<std::exception>#

Public Functions

inline ExceptionMessageMatcher(std::string const &message)#
virtual std::string describe() const override#
virtual bool match(std::exception const &ex) const override#

Private Members

std::string m_message#
template<typename StringMatcherType>
class ExceptionMessageMatchesMatcher : public Catch::Matchers::MatcherBase<std::exception>#

Public Functions

inline ExceptionMessageMatchesMatcher(StringMatcherType matcher)#
inline virtual std::string describe() const override#
inline virtual bool match(std::exception const &ex) const override#

Private Members

StringMatcherType m_matcher#
template<typename T>
class ExceptionTranslator : public Catch::IExceptionTranslator#

Public Functions

inline ExceptionTranslator(std::string (*translateFunction)(T const&))#
inline std::string translate(ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd) const override#

Protected Attributes

std::string (*m_translateFunction)(T const&)#
class ExceptionTranslatorRegistrar#

Public Functions

template<typename T>
inline ExceptionTranslatorRegistrar(std::string (*translateFunction)(T const&))#
class ExceptionTranslatorRegistry : public Catch::IExceptionTranslatorRegistry#

Public Functions

~ExceptionTranslatorRegistry() override#
void registerTranslator(Detail::unique_ptr<IExceptionTranslator> &&translator)#
virtual std::string translateActiveException() const override#

Private Members

ExceptionTranslators m_translators#
template<typename Duration>
struct ExecutionPlan#

Public Functions

template<typename Duration2>
inline operator ExecutionPlan<Duration2>() const#
template<typename Clock>
inline std::vector<FloatDuration<Clock>> run(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const#

Public Members

Detail::BenchmarkFunction benchmark#
Duration estimated_duration#
int iterations_per_sample#
int warmup_iterations#
Duration warmup_time#
class ExeName : public Catch::Clara::Detail::ComposableParserImpl<ExeName>#
#include <catch_clara.hpp>

Public Functions

ExeName()#
template<typename LambdaT>
inline explicit ExeName(LambdaT const &lambda)#
explicit ExeName(std::string &ref)#
inline std::string const &name() const#
virtual Detail::InternalParseResult parse(std::string const&, Detail::TokenStream const &tokens) const override#
Detail::ParserResult set(std::string const &newName)#

Private Members

std::shared_ptr<std::string> m_name#
std::shared_ptr<Detail::BoundValueRefBase> m_ref#
template<typename LhsT>
class ExprLhs#

Public Functions

inline explicit ExprLhs(LhsT lhs)#
inline auto makeUnaryExpr() const -> UnaryExpr<LhsT>#

Private Members

LhsT m_lhs#

Friends

template<typename RhsT>
inline friend auto operator&&(ExprLhs&&, RhsT&&) -> BinaryExpr<LhsT, RhsT const&>#
template<typename RhsT>
inline friend auto operator||(ExprLhs&&, RhsT&&) -> BinaryExpr<LhsT, RhsT const&>#
struct fake_arg#
#include <catch_clara.hpp>

Public Functions

template<typename T>
operator T()#
class FatalConditionHandler#

Wrapper for platform-specific fatal error (signals/SEH) handlers.

Tries to be cooperative with other handlers, and not step over other handlers. This means that unknown structured exceptions are passed on, previous signal handlers are called, and so on.

Can only be instantiated once, and assumes that once a signal is caught, the binary will end up terminating. Thus, there

Public Functions

FatalConditionHandler()#
~FatalConditionHandler()#
inline void disengage() noexcept#
inline void engage()#

Private Functions

void disengage_platform() noexcept#
void engage_platform()#

Private Members

bool m_started = false#
class FatalConditionHandlerGuard#

Simple RAII guard for (dis)engaging the FatalConditionHandler.

Public Functions

inline FatalConditionHandlerGuard(FatalConditionHandler *handler)#
inline ~FatalConditionHandlerGuard()#

Private Members

FatalConditionHandler *m_handler#
struct Filter#

Public Functions

bool matches(TestCaseInfo const &testCase) const#
void serializeTo(std::ostream &out) const#

Serializes this filter into a string that would be parsed into an equivalent filter.

Public Members

std::vector<Detail::unique_ptr<Pattern>> m_forbidden#
std::vector<Detail::unique_ptr<Pattern>> m_required#

Friends

inline friend std::ostream &operator<<(std::ostream &out, Filter const &f)#
template<typename T, typename Predicate>
class FilterGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

template<typename P = Predicate>
inline FilterGenerator(P &&pred, GeneratorWrapper<T> &&generator)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

GeneratorWrapper<T> m_generator#
Predicate m_predicate#
struct FilterMatch#

Public Members

std::string name#
std::vector<TestCaseHandle const*> tests#
template<typename T>
class FixedValuesGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

inline FixedValuesGenerator(std::initializer_list<T> values)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

size_t m_idx = 0#
std::vector<T> m_values#
class GeneratorException : public std::exception#

Public Functions

inline GeneratorException(const char *msg)#
const char *what() const noexcept final override#

Private Members

const char *const m_msg = ""#
template<typename T>
class Generators : public Catch::Generators::IGenerator<T>#

Public Functions

template<typename ...Gs>
inline Generators(Gs&&... moreGenerators)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Functions

inline void add_generator(GeneratorWrapper<T> &&generator)#
inline void add_generator(T &&val)#
inline void add_generator(T const &val)#
template<typename U>
inline std::enable_if_t<!std::is_same<std::decay_t<U>, T>::value> add_generator(U &&val)#
template<typename U>
inline void add_generators(U &&valueOrGenerator)#
template<typename U, typename ...Gs>
inline void add_generators(U &&valueOrGenerator, Gs&&... moreGenerators)#

Private Members

size_t m_current = 0#
std::vector<GeneratorWrapper<T>> m_generators#
class GeneratorUntypedBase#

Subclassed by Catch::Generators::IGenerator< Float >, Catch::Generators::IGenerator< std::vector< T > >, Catch::Generators::IGenerator< Integer >, Catch::Generators::IGenerator< T >

Public Functions

GeneratorUntypedBase() = default#
GeneratorUntypedBase(GeneratorUntypedBase const&) = default#
virtual ~GeneratorUntypedBase()#
bool countedNext()#

Attempts to move the generator to the next element.

Serves as a non-virtual interface to next, so that the top level interface can provide sanity checking and shared features.

As with next, returns true iff the move succeeded and the generator has new valid element to provide.

StringRef currentElementAsString() const#

Returns generator’s current element as user-friendly string.

By default returns string equivalent to calling Catch::Detail::stringify on the current element, but generators can customize their implementation as needed.

Not thread-safe due to internal caching.

The returned ref is valid only until the generator instance is destructed, or it moves onto the next element, whichever comes first.

inline std::size_t currentElementIndex() const#
GeneratorUntypedBase &operator=(GeneratorUntypedBase const&) = default#

Private Functions

virtual bool next() = 0#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

virtual std::string stringifyImpl() const = 0#

Customization point for currentElementAsString

Private Members

std::size_t m_currentElementIndex = 0#
mutable std::string m_stringReprCache#
template<typename T>
class GeneratorWrapper#

Public Functions

inline GeneratorWrapper(GeneratorPtr<T> generator)#
inline GeneratorWrapper(IGenerator<T> *generator)#

Takes ownership of the passed pointer.

inline T const &get() const#
inline bool next()#

Private Members

GeneratorPtr<T> m_generator#
template<typename T, typename = void>
struct has_description : public std::false_type#
template<typename T>
struct has_description<T, void_t<decltype(T::getDescription())>> : public std::true_type#
class HasSizeMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

inline explicit HasSizeMatcher(std::size_t target_size)#
virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

std::size_t m_target_size#
struct Help : public Catch::Clara::Opt#
#include <catch_clara.hpp>

Public Functions

Help(bool &showHelpFlag)#
struct HelpColumns#
#include <catch_clara.hpp>

Public Members

std::string left#
std::string right#
class IConfig : public Catch::Detail::NonCopyable#

Subclassed by Catch::Config

Public Functions

virtual ~IConfig()#
virtual int abortAfter() const = 0#
virtual bool allowThrows() const = 0#
virtual double benchmarkConfidenceInterval() const = 0#
virtual bool benchmarkNoAnalysis() const = 0#
virtual unsigned int benchmarkResamples() const = 0#
virtual unsigned int benchmarkSamples() const = 0#
virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0#
virtual ColourMode defaultColourMode() const = 0#
virtual std::vector<std::string> const &getSectionsToRun() const = 0#
virtual std::vector<std::string> const &getTestsOrTags() const = 0#
virtual bool hasTestFilters() const = 0#
virtual bool includeSuccessfulResults() const = 0#
virtual double minDuration() const = 0#
virtual StringRef name() const = 0#
virtual uint32_t rngSeed() const = 0#
virtual TestRunOrder runOrder() const = 0#
virtual unsigned int shardCount() const = 0#
virtual unsigned int shardIndex() const = 0#
virtual bool shouldDebugBreak() const = 0#
virtual ShowDurations showDurations() const = 0#
virtual bool showInvisibles() const = 0#
virtual bool skipBenchmarks() const = 0#
virtual TestSpec const &testSpec() const = 0#
virtual Verbosity verbosity() const = 0#
virtual bool warnAboutMissingAssertions() const = 0#
virtual bool warnAboutUnmatchedTestSpecs() const = 0#
virtual bool zeroTestsCountAsSuccess() const = 0#
class IEventListener#

The common base for all reporters and event listeners.

Implementing classes must also implement:

//! User-friendly description of the reporter/listener type
static std::string getDescription()
Generally shouldn’t be derived from by users of Catch2 directly, instead they should derive from one of the utility bases that derive from this class.

Subclassed by Catch::EventListenerBase, Catch::MultiReporter, Catch::ReporterBase

Public Functions

inline IEventListener(IConfig const *config)#
virtual ~IEventListener()#
virtual void assertionEnded(AssertionStats const &assertionStats) = 0#

Called after assertion was fully evaluated.

virtual void assertionStarting(AssertionInfo const &assertionInfo) = 0#

Called before assertion success/failure is evaluated.

virtual void benchmarkEnded(BenchmarkStats<> const &benchmarkStats) = 0#

Called with the benchmark results if benchmark successfully finishes.

virtual void benchmarkFailed(StringRef benchmarkName) = 0#

Called if running the benchmarks fails for any reason.

virtual void benchmarkPreparing(StringRef benchmarkName) = 0#

Called when user-code is being probed before the actual benchmark runs.

virtual void benchmarkStarting(BenchmarkInfo const &benchmarkInfo) = 0#

Called after probe but before the user-code is being benchmarked.

virtual void fatalErrorEncountered(StringRef error) = 0#

Called if a fatal error (signal/structured exception) occurred.

inline ReporterPreferences const &getPreferences() const#
virtual void listListeners(std::vector<ListenerDescription> const &descriptions) = 0#

Writes out the provided listeners descriptions using reporter-specific format.

virtual void listReporters(std::vector<ReporterDescription> const &descriptions) = 0#

Writes out information about provided reporters using reporter-specific format.

virtual void listTags(std::vector<TagInfo> const &tags) = 0#

Writes out information about the provided tags using reporter-specific format.

virtual void listTests(std::vector<TestCaseHandle> const &tests) = 0#

Writes out information about provided tests using reporter-specific format.

virtual void noMatchingTestCases(StringRef unmatchedSpec) = 0#

Called when no test cases match provided test spec.

virtual void reportInvalidTestSpec(StringRef invalidArgument) = 0#

Called for all invalid test specs from the cli.

virtual void sectionEnded(SectionStats const &sectionStats) = 0#

Called after a SECTION has finished running.

virtual void sectionStarting(SectionInfo const &sectionInfo) = 0#

Called when a SECTION is being entered. Not called for skipped sections.

virtual void skipTest(TestCaseInfo const &testInfo) = 0#

Called with test cases that are skipped due to the test run aborting.

NOT called for test cases that are explicitly skipped using the SKIP macro.

Deprecated - will be removed in the next major release.

virtual void testCaseEnded(TestCaseStats const &testCaseStats) = 0#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testCasePartialEnded(TestCaseStats const &testCaseStats, uint64_t partNumber) = 0#

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void testCasePartialStarting(TestCaseInfo const &testInfo, uint64_t partNumber) = 0#

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void testCaseStarting(TestCaseInfo const &testInfo) = 0#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &testRunStats) = 0#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &testRunInfo) = 0#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Protected Attributes

IConfig const *m_config#

The test run’s config as filled in from CLI and defaults.

ReporterPreferences m_preferences#

Derived classes can set up their preferences here.

class IExceptionTranslator#

Public Functions

virtual ~IExceptionTranslator()#
virtual std::string translate(ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd) const = 0#
class IExceptionTranslatorRegistry#

Subclassed by Catch::ExceptionTranslatorRegistry

Public Functions

virtual ~IExceptionTranslatorRegistry()#
virtual std::string translateActiveException() const = 0#
template<typename T>
class IGenerator : public Catch::Generators::GeneratorUntypedBase#

Subclassed by Catch::Generators::FilterGenerator< T, Predicate >, Catch::Generators::FixedValuesGenerator< T >, Catch::Generators::Generators< T >, Catch::Generators::IteratorGenerator< T >, Catch::Generators::MapGenerator< T, U, Func >, Catch::Generators::RangeGenerator< T >, Catch::Generators::RepeatGenerator< T >, Catch::Generators::SingleValueGenerator< T >, Catch::Generators::TakeGenerator< T >

Public Types

using type = T#

Public Functions

IGenerator() = default#
IGenerator(IGenerator const&) = default#
~IGenerator() override = default#
virtual T const &get() const = 0#
IGenerator &operator=(IGenerator const&) = default#

Private Functions

inline virtual std::string stringifyImpl() const override#

Customization point for currentElementAsString

class IGeneratorTracker#

Public Functions

virtual ~IGeneratorTracker()#
virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0#
virtual auto hasGenerator() const -> bool = 0#
virtual void setGenerator(Generators::GeneratorBasePtr &&generator) = 0#
class IMutableEnumValuesRegistry#

Subclassed by Catch::Detail::EnumValuesRegistry

Public Functions

virtual ~IMutableEnumValuesRegistry()#
template<typename E>
inline Detail::EnumInfo const &registerEnum(StringRef enumName, StringRef allEnums, std::initializer_list<E> values)#
virtual Detail::EnumInfo const &registerEnum(StringRef enumName, StringRef allEnums, std::vector<int> const &values) = 0#
class IMutableRegistryHub#

Public Functions

virtual ~IMutableRegistryHub()#
virtual IMutableEnumValuesRegistry &getMutableEnumValuesRegistry() = 0#
virtual void registerListener(Detail::unique_ptr<EventListenerFactory> factory) = 0#
virtual void registerReporter(std::string const &name, IReporterFactoryPtr factory) = 0#
virtual void registerStartupException() noexcept = 0#
virtual void registerTagAlias(std::string const &alias, std::string const &tag, SourceLineInfo const &lineInfo) = 0#
virtual void registerTest(Detail::unique_ptr<TestCaseInfo> &&testInfo, Detail::unique_ptr<ITestInvoker> &&invoker) = 0#
virtual void registerTranslator(Detail::unique_ptr<IExceptionTranslator> &&translator) = 0#
class IRegistryHub#

Public Functions

virtual ~IRegistryHub()#
virtual IExceptionTranslatorRegistry const &getExceptionTranslatorRegistry() const = 0#
virtual ReporterRegistry const &getReporterRegistry() const = 0#
virtual StartupExceptionRegistry const &getStartupExceptionRegistry() const = 0#
virtual ITagAliasRegistry const &getTagAliasRegistry() const = 0#
virtual ITestCaseRegistry const &getTestCaseRegistry() const = 0#
class IReporterFactory#

Subclassed by Catch::ReporterFactory< T >

Public Functions

virtual ~IReporterFactory()#
virtual IEventListenerPtr create(ReporterConfig &&config) const = 0#
virtual std::string getDescription() const = 0#
class IResultCapture#

Subclassed by Catch::RunContext

Public Functions

virtual ~IResultCapture()#
virtual IGeneratorTracker *acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const &lineInfo) = 0#
virtual void assertionPassed() = 0#
virtual void benchmarkEnded(BenchmarkStats<> const &stats) = 0#
virtual void benchmarkFailed(StringRef error) = 0#
virtual void benchmarkPreparing(StringRef name) = 0#
virtual void benchmarkStarting(BenchmarkInfo const &info) = 0#
virtual IGeneratorTracker *createGeneratorTracker(StringRef generatorName, SourceLineInfo lineInfo, Generators::GeneratorBasePtr &&generator) = 0#
virtual void emplaceUnscopedMessage(MessageBuilder &&builder) = 0#
virtual void exceptionEarlyReported() = 0#
virtual std::string getCurrentTestName() const = 0#
virtual const AssertionResult *getLastResult() const = 0#
virtual void handleExpr(AssertionInfo const &info, ITransientExpression const &expr, AssertionReaction &reaction) = 0#
virtual void handleFatalErrorCondition(StringRef message) = 0#
virtual void handleIncomplete(AssertionInfo const &info) = 0#
virtual void handleMessage(AssertionInfo const &info, ResultWas::OfType resultType, StringRef message, AssertionReaction &reaction) = 0#
virtual void handleNonExpr(AssertionInfo const &info, ResultWas::OfType resultType, AssertionReaction &reaction) = 0#
virtual void handleUnexpectedExceptionNotThrown(AssertionInfo const &info, AssertionReaction &reaction) = 0#
virtual void handleUnexpectedInflightException(AssertionInfo const &info, std::string &&message, AssertionReaction &reaction) = 0#
virtual bool lastAssertionPassed() = 0#
virtual void notifyAssertionStarted(AssertionInfo const &info) = 0#
virtual void popScopedMessage(MessageInfo const &message) = 0#
virtual void pushScopedMessage(MessageInfo const &message) = 0#
virtual void sectionEnded(SectionEndInfo &&endInfo) = 0#
virtual void sectionEndedEarly(SectionEndInfo &&endInfo) = 0#
virtual bool sectionStarted(StringRef sectionName, SourceLineInfo const &sectionLineInfo, Counts &assertions) = 0#
template<typename T>
struct is_callable#
template<typename Fun, typename ...Args>
struct is_callable<Fun(Args...)> : public decltypeis_callable_tester::test<Fun, Args...>#
#include <catch_meta.hpp>
struct is_callable_tester#
#include <catch_meta.hpp>

Public Static Functions

template<typename...>
static std::false_type test(...)#
template<typename Fun, typename... Args> static true_given< decltype(std::declval< Fun >)(std::declval< Args >)...))> test (int)
template<typename T>
struct is_range : public Catch::Detail::is_range_impl<T>#
#include <catch_tostring.hpp>
template<typename T, typename = void>
struct is_range_impl : public std::false_type#
#include <catch_tostring.hpp>

Subclassed by Catch::is_range< T >

template<typename T>
struct is_range_impl<T, void_t<decltype(begin(std::declval<T>()))>> : public std::true_type#
#include <catch_tostring.hpp>
template<typename T, typename U>
struct is_related : public std::is_same<std::decay_t<T>, std::decay_t<U>>#
template<typename F, typename = void>
struct is_unary_function : public std::false_type#
#include <catch_clara.hpp>
template<typename F>
struct is_unary_function<F, Catch::Detail::void_t<decltype(std::declval<F>()(fake_arg()))>> : public std::true_type#
#include <catch_clara.hpp>
class IsEmptyMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#
struct ISingleton#

Subclassed by Catch::Singleton< SingletonImplT, InterfaceT, MutableInterfaceT >

Public Functions

virtual ~ISingleton()#
class IsNaNMatcher : public Catch::Matchers::MatcherBase<double>#

Public Functions

IsNaNMatcher() = default#
virtual std::string describe() const override#
virtual bool match(double const &matchee) const override#
template<typename T>
class IsStreamInsertable#
#include <catch_tostring.hpp>

Public Static Attributes

static const bool value = decltype(test<std::ostream, const T&>(0))::value#

Private Static Functions

template<typename, typename>
static auto test(...) -> std::false_type#
template<typename Stream, typename U>
static auto test(int) -> decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type())#
class IStream#
#include <catch_istream.hpp>

Public Functions

virtual ~IStream()#
inline virtual bool isConsole() const#

Best guess on whether the instance is writing to a console (e.g.

via stdout/stderr)

This is useful for e.g. Win32 colour support, because the Win32 API manipulates console directly, unlike POSIX escape codes, that can be written anywhere.

Due to variety of ways to change where the stdout/stderr is actually being written, users should always assume that the answer might be wrong.

virtual std::ostream &stream() = 0#
class ITagAliasRegistry#

Subclassed by Catch::TagAliasRegistry

Public Functions

virtual ~ITagAliasRegistry()#
virtual std::string expandAliases(std::string const &unexpandedTestSpec) const = 0#
virtual TagAlias const *find(std::string const &alias) const = 0#

Public Static Functions

static ITagAliasRegistry const &get()#
class iterator#
#include <catch_textflow.hpp>

Public Types

using difference_type = std::ptrdiff_t#
using iterator_category = std::forward_iterator_tag#
using pointer = value_type*#
using reference = value_type&#
using value_type = std::string#

Public Functions

explicit iterator(Columns const &columns)#
inline auto operator!=(iterator const &other) const -> bool#
std::string operator*() const#
iterator &operator++()#
iterator operator++(int)#
inline auto operator==(iterator const &other) const -> bool#

Private Functions

iterator(Columns const &columns, EndTag)#

Private Members

friend Columns
size_t m_activeIterators#
std::vector<Column> const &m_columns#
std::vector<Column::const_iterator> m_iterators#
template<typename T>
class IteratorGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

template<typename InputIterator, typename InputSentinel>
inline IteratorGenerator(InputIterator first, InputSentinel last)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

size_t m_current = 0#
std::vector<T> m_elems#
class ITestCaseRegistry#

Subclassed by Catch::TestRegistry

Public Functions

virtual ~ITestCaseRegistry()#
virtual std::vector<TestCaseInfo*> const &getAllInfos() const = 0#
virtual std::vector<TestCaseHandle> const &getAllTests() const = 0#
virtual std::vector<TestCaseHandle> const &getAllTestsSorted(IConfig const &config) const = 0#
class ITestInvoker#

Subclassed by Catch::TestInvokerAsMethod< C >

Public Functions

virtual ~ITestInvoker()#
virtual void invoke() const = 0#
class ITracker#

Subclassed by Catch::TestCaseTracking::TrackerBase

Public Functions

inline ITracker(NameAndLocation &&nameAndLoc, ITracker *parent)#
virtual ~ITracker()#
void addChild(ITrackerPtr &&child)#

Register a nested ITracker.

virtual void close() = 0#
virtual void fail() = 0#
ITracker *findChild(NameAndLocationRef const &nameAndLocation)#

Returns ptr to specific child if register with this tracker.

Returns nullptr if not found.

inline bool hasChildren() const#

Have any children been added?

bool hasStarted() const#

Returns true iff tracker has started.

virtual bool isComplete() const = 0#

Returns true if tracker run to completion (successfully or not)

virtual bool isGeneratorTracker() const#

Returns true if the instance is a generator tracker.

Subclasses should override to true if they are, replaces RTTI for internal debug checks.

bool isOpen() const#

Returns true if tracker has started but hasn’t been completed.

virtual bool isSectionTracker() const#

Returns true if the instance is a section tracker.

Subclasses should override to true if they are, replaces RTTI for internal debug checks.

inline bool isSuccessfullyCompleted() const#

Returns true if tracker run to completion successfully.

void markAsNeedingAnotherRun()#
inline NameAndLocation const &nameAndLocation() const#
void openChild()#

Marks tracker as executing a child, doing se recursively up the tree.

inline ITracker *parent() const#

Protected Types

enum CycleState#

Values:

enumerator NotStarted#
enumerator Executing#
enumerator ExecutingChildren#
enumerator NeedsAnotherRun#
enumerator CompletedSuccessfully#
enumerator Failed#

Protected Attributes

Children m_children#
ITracker *m_parent = nullptr#
CycleState m_runState = NotStarted#

Private Types

using Children = std::vector<ITrackerPtr>#

Private Members

NameAndLocation m_nameAndLocation#
class ITransientExpression#

Subclassed by Catch::BinaryExpr< LhsT, RhsT >, Catch::MatchExpr< ArgT, MatcherT >, Catch::UnaryExpr< LhsT >

Public Functions

ITransientExpression() = default#
inline ITransientExpression(bool isBinaryExpression, bool result)#
ITransientExpression(ITransientExpression const&) = default#
virtual ~ITransientExpression()#
inline auto getResult() const -> bool#
inline auto isBinaryExpression() const -> bool#
ITransientExpression &operator=(ITransientExpression const&) = default#
virtual void streamReconstructedExpression(std::ostream &os) const = 0#

Private Members

bool m_isBinaryExpression#
bool m_result#

Friends

inline friend std::ostream &operator<<(std::ostream &out, ITransientExpression const &expr)#
class JunitReporter : public Catch::CumulativeReporterBase#

Public Functions

JunitReporter(ReporterConfig &&_config)#
~JunitReporter() override = default#
virtual void assertionEnded(AssertionStats const &assertionStats) override#

Called after assertion was fully evaluated.

virtual void testCaseEnded(TestCaseStats const &testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testCaseStarting(TestCaseInfo const &testCaseInfo) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEndedCumulative() override#

Customization point: called after last test finishes (testRunEnded has been handled)

virtual void testRunStarting(TestRunInfo const &runInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Public Static Functions

static std::string getDescription()#

Private Functions

void writeAssertion(AssertionStats const &stats)#
void writeAssertions(SectionNode const &sectionNode)#
void writeRun(TestRunNode const &testRunNode, double suiteTime)#
void writeSection(std::string const &className, std::string const &rootName, SectionNode const &sectionNode, bool testOkToFail)#
void writeTestCase(TestCaseNode const &testCaseNode)#

Private Members

bool m_okToFail = false#
std::string stdErrForSuite#
std::string stdOutForSuite#
Timer suiteTimer#
unsigned int unexpectedExceptions = 0#
XmlWriter xml#
template<typename ReturnType>
struct LambdaInvoker#
#include <catch_clara.hpp>

Public Static Functions

template<typename L, typename ArgType>
static inline auto invoke(L const &lambda, ArgType const &arg) -> ParserResult#
template<>
struct LambdaInvoker<void>#
#include <catch_clara.hpp>

Public Static Functions

template<typename L, typename ArgType>
static inline auto invoke(L const &lambda, ArgType const &arg) -> ParserResult#
class LazyExpression#

Public Functions

inline LazyExpression(bool isNegated)#
LazyExpression(LazyExpression const &other) = default#
inline explicit operator bool() const#
LazyExpression &operator=(LazyExpression const&) = delete#

Private Members

bool m_isNegated#
ITransientExpression const *m_transientExpression = nullptr#

Friends

friend class AssertionHandler
friend struct AssertionStats
friend auto operator<<(std::ostream &os, LazyExpression const &lazyExpr) -> std::ostream&#
friend class RunContext
struct LeakDetector#

Public Functions

LeakDetector()#
~LeakDetector()#
struct lineOfChars#

Public Functions

inline constexpr lineOfChars(char c_)#

Public Members

char c#

Friends

friend std::ostream &operator<<(std::ostream &out, lineOfChars value)#
struct ListenerDescription#
#include <catch_list.hpp>

Public Members

std::string description#
StringRef name#
template<typename T>
class ListenerRegistrar#

Public Functions

inline ListenerRegistrar(StringRef listenerName)#
template<typename...>
struct make_void#

Public Types

using type = void#
template<typename T, typename U, typename Func>
class MapGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

template<typename F2 = Func>
inline MapGenerator(F2 &&function, GeneratorWrapper<U> &&generator)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

T m_cache#
Func m_function#
GeneratorWrapper<U> m_generator#
template<typename ArgT>
class MatchAllOf : public Catch::Matchers::MatcherBase<ArgT>#
#include <catch_matchers.hpp>

Public Functions

MatchAllOf() = default#
MatchAllOf(MatchAllOf&&) = default#
MatchAllOf(MatchAllOf const&) = delete#
inline virtual std::string describe() const override#
inline virtual bool match(ArgT const &arg) const override#
MatchAllOf &operator=(MatchAllOf&&) = default#
MatchAllOf &operator=(MatchAllOf const&) = delete#

Private Members

std::vector<MatcherBase<ArgT> const*> m_matchers#

Friends

inline friend MatchAllOf operator&&(MatchAllOf &&lhs, MatcherBase<ArgT> const &rhs)#
inline friend MatchAllOf operator&&(MatcherBase<ArgT> const &lhs, MatchAllOf &&rhs)#
template<typename ...MatcherTs>
class MatchAllOfGeneric : public Catch::Matchers::MatcherGenericBase#

Public Functions

MatchAllOfGeneric(MatchAllOfGeneric&&) = default#
MatchAllOfGeneric(MatchAllOfGeneric const&) = delete#
inline MatchAllOfGeneric(MatcherTs const&... matchers)#
inline explicit MatchAllOfGeneric(std::array<void const*, sizeof...(MatcherTs)> matchers)#
inline virtual std::string describe() const override#
template<typename Arg>
inline bool match(Arg &&arg) const#
MatchAllOfGeneric &operator=(MatchAllOfGeneric&&) = default#
MatchAllOfGeneric &operator=(MatchAllOfGeneric const&) = delete#

Public Members

std::array<void const*, sizeof...(MatcherTs)> m_matchers#

Friends

template<typename ...MatchersRHS>
inline friend MatchAllOfGeneric<MatcherTs..., MatchersRHS...> operator&&(MatchAllOfGeneric<MatcherTs...> &&lhs, MatchAllOfGeneric<MatchersRHS...> &&rhs)#

Avoids type nesting for GenericAllOf && GenericAllOf case.

template<typename MatcherRHS>
inline friend std::enable_if_t<is_matcher<MatcherRHS>::value, MatchAllOfGeneric<MatcherTs..., MatcherRHS>> operator&&(MatchAllOfGeneric<MatcherTs...> &&lhs, MatcherRHS const &rhs)#

Avoids type nesting for GenericAllOf && some matcher case.

template<typename MatcherLHS>
inline friend std::enable_if_t<is_matcher<MatcherLHS>::value, MatchAllOfGeneric<MatcherLHS, MatcherTs...>> operator&&(MatcherLHS const &lhs, MatchAllOfGeneric<MatcherTs...> &&rhs)#

Avoids type nesting for some matcher && GenericAllOf case.

template<typename ArgT>
class MatchAnyOf : public Catch::Matchers::MatcherBase<ArgT>#
#include <catch_matchers.hpp>

Public Functions

MatchAnyOf() = default#
MatchAnyOf(MatchAnyOf&&) = default#
MatchAnyOf(MatchAnyOf const&) = delete#
inline virtual std::string describe() const override#
inline virtual bool match(ArgT const &arg) const override#
MatchAnyOf &operator=(MatchAnyOf&&) = default#
MatchAnyOf &operator=(MatchAnyOf const&) = delete#

Private Members

std::vector<MatcherBase<ArgT> const*> m_matchers#

Friends

inline friend MatchAnyOf operator||(MatchAnyOf &&lhs, MatcherBase<ArgT> const &rhs)#
inline friend MatchAnyOf operator||(MatcherBase<ArgT> const &lhs, MatchAnyOf &&rhs)#
template<typename ...MatcherTs>
class MatchAnyOfGeneric : public Catch::Matchers::MatcherGenericBase#

Public Functions

MatchAnyOfGeneric(MatchAnyOfGeneric&&) = default#
MatchAnyOfGeneric(MatchAnyOfGeneric const&) = delete#
inline MatchAnyOfGeneric(MatcherTs const&... matchers)#
inline explicit MatchAnyOfGeneric(std::array<void const*, sizeof...(MatcherTs)> matchers)#
inline virtual std::string describe() const override#
template<typename Arg>
inline bool match(Arg &&arg) const#
MatchAnyOfGeneric &operator=(MatchAnyOfGeneric&&) = default#
MatchAnyOfGeneric &operator=(MatchAnyOfGeneric const&) = delete#

Public Members

std::array<void const*, sizeof...(MatcherTs)> m_matchers#

Friends

template<typename ...MatchersRHS>
inline friend MatchAnyOfGeneric<MatcherTs..., MatchersRHS...> operator||(MatchAnyOfGeneric<MatcherTs...> &&lhs, MatchAnyOfGeneric<MatchersRHS...> &&rhs)#

Avoids type nesting for GenericAnyOf || GenericAnyOf case.

template<typename MatcherRHS>
inline friend std::enable_if_t<is_matcher<MatcherRHS>::value, MatchAnyOfGeneric<MatcherTs..., MatcherRHS>> operator||(MatchAnyOfGeneric<MatcherTs...> &&lhs, MatcherRHS const &rhs)#

Avoids type nesting for GenericAnyOf || some matcher case.

template<typename MatcherLHS>
inline friend std::enable_if_t<is_matcher<MatcherLHS>::value, MatchAnyOfGeneric<MatcherLHS, MatcherTs...>> operator||(MatcherLHS const &lhs, MatchAnyOfGeneric<MatcherTs...> &&rhs)#

Avoids type nesting for some matcher || GenericAnyOf case.

template<typename T>
class MatcherBase : public Catch::Matchers::MatcherUntypedBase#
#include <catch_matchers.hpp>

Subclassed by Catch::Matchers::PredicateMatcher< T, Predicate >

Public Functions

virtual bool match(T const &arg) const = 0#
class MatcherGenericBase : public Catch::Matchers::MatcherUntypedBase#

Subclassed by Catch::Matchers::AllMatchMatcher< Matcher >, Catch::Matchers::AllTrueMatcher, Catch::Matchers::AnyMatchMatcher< Matcher >, Catch::Matchers::AnyTrueMatcher, Catch::Matchers::ContainsElementMatcher< T, Equality >, Catch::Matchers::ContainsMatcherMatcher< Matcher >, Catch::Matchers::Detail::MatchAllOfGeneric< MatcherTs >, Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherTs >, Catch::Matchers::Detail::MatchNotOfGeneric< MatcherT >, Catch::Matchers::HasSizeMatcher, Catch::Matchers::IsEmptyMatcher, Catch::Matchers::NoneMatchMatcher< Matcher >, Catch::Matchers::NoneTrueMatcher, Catch::Matchers::RangeEqualsMatcher< TargetRangeLike, Equality >, Catch::Matchers::SizeMatchesMatcher< Matcher >, Catch::Matchers::UnorderedRangeEqualsMatcher< TargetRangeLike, Equality >

Public Functions

MatcherGenericBase() = default#
MatcherGenericBase(MatcherGenericBase&&) = default#
MatcherGenericBase(MatcherGenericBase const&) = default#
~MatcherGenericBase() override#
MatcherGenericBase &operator=(MatcherGenericBase&&) = delete#
MatcherGenericBase &operator=(MatcherGenericBase const&) = delete#
class MatcherUntypedBase#
#include <catch_matchers.hpp>

Subclassed by Catch::Matchers::MatcherBase< double >, Catch::Matchers::MatcherBase< std::string >, Catch::Matchers::MatcherBase< std::vector< T, AllocMatch > >, Catch::Matchers::MatcherBase< std::vector< T, Alloc > >, Catch::Matchers::MatcherBase< ArgT >, Catch::Matchers::MatcherBase< std::exception >, Catch::Matchers::MatcherBase< T >, Catch::Matchers::MatcherGenericBase

Public Functions

MatcherUntypedBase() = default#
MatcherUntypedBase(MatcherUntypedBase&&) = default#
MatcherUntypedBase(MatcherUntypedBase const&) = default#
MatcherUntypedBase &operator=(MatcherUntypedBase&&) = delete#
MatcherUntypedBase &operator=(MatcherUntypedBase const&) = delete#
std::string toString() const#

Protected Functions

virtual ~MatcherUntypedBase()#
virtual std::string describe() const = 0#

Protected Attributes

mutable std::string m_cachedToString#
template<typename ArgT, typename MatcherT>
class MatchExpr : public Catch::ITransientExpression#

Public Functions

inline MatchExpr(ArgT &&arg, MatcherT const &matcher)#
inline virtual void streamReconstructedExpression(std::ostream &os) const override#

Private Members

ArgT &&m_arg#
MatcherT const &m_matcher#
template<typename ArgT>
class MatchNotOf : public Catch::Matchers::MatcherBase<ArgT>#
#include <catch_matchers.hpp>

Public Functions

inline explicit MatchNotOf(MatcherBase<ArgT> const &underlyingMatcher)#
inline virtual std::string describe() const override#
inline virtual bool match(ArgT const &arg) const override#

Private Members

MatcherBase<ArgT> const &m_underlyingMatcher#
template<typename MatcherT>
class MatchNotOfGeneric : public Catch::Matchers::MatcherGenericBase#

Public Functions

inline explicit MatchNotOfGeneric(MatcherT const &matcher)#
MatchNotOfGeneric(MatchNotOfGeneric&&) = default#
MatchNotOfGeneric(MatchNotOfGeneric const&) = delete#
inline virtual std::string describe() const override#
template<typename Arg>
inline bool match(Arg &&arg) const#
MatchNotOfGeneric &operator=(MatchNotOfGeneric&&) = default#
MatchNotOfGeneric &operator=(MatchNotOfGeneric const&) = delete#

Private Members

MatcherT const &m_matcher#

Friends

inline friend MatcherT const &operator!(MatchNotOfGeneric<MatcherT> const &matcher)#

Negating negation can just unwrap and return underlying matcher.

struct MessageBuilder : public Catch::MessageStream#
#include <catch_message.hpp>

Public Functions

inline MessageBuilder(StringRef macroName, SourceLineInfo const &lineInfo, ResultWas::OfType type)#
template<typename T>
inline MessageBuilder &&operator<<(T const &value) &&#

Public Members

MessageInfo m_info#
struct MessageInfo#

Public Functions

MessageInfo(StringRef _macroName, SourceLineInfo const &_lineInfo, ResultWas::OfType _type)#
inline bool operator<(MessageInfo const &other) const#
inline bool operator==(MessageInfo const &other) const#

Public Members

SourceLineInfo lineInfo#
StringRef macroName#
std::string message#
unsigned int sequence#
ResultWas::OfType type#

Private Static Attributes

static unsigned int globalCount = 0#
struct MessageStream#
#include <catch_message.hpp>

Subclassed by Catch::MessageBuilder

Public Functions

template<typename T>
inline MessageStream &operator<<(T const &value)#

Public Members

ReusableStringStream m_stream#
template<typename Fun>
struct model : public Catch::Benchmark::Detail::BenchmarkFunction::callable#

Public Functions

inline model(Fun &&fun_)#
inline model(Fun const &fun_)#
inline void call(Chronometer meter) const override#
inline void call(Chronometer meter, std::false_type) const#
inline void call(Chronometer meter, std::true_type) const#
inline Catch::Detail::unique_ptr<callable> clone() const override#

Public Members

Fun fun#
class MultiReporter : public Catch::IEventListener#

Public Functions

void addListener(IEventListenerPtr &&listener)#
void addReporter(IEventListenerPtr &&reporter)#
virtual void assertionEnded(AssertionStats const &assertionStats) override#

Called after assertion was fully evaluated.

virtual void assertionStarting(AssertionInfo const &assertionInfo) override#

Called before assertion success/failure is evaluated.

virtual void benchmarkEnded(BenchmarkStats<> const &benchmarkStats) override#

Called with the benchmark results if benchmark successfully finishes.

virtual void benchmarkFailed(StringRef error) override#

Called if running the benchmarks fails for any reason.

virtual void benchmarkPreparing(StringRef name) override#

Called when user-code is being probed before the actual benchmark runs.

virtual void benchmarkStarting(BenchmarkInfo const &benchmarkInfo) override#

Called after probe but before the user-code is being benchmarked.

virtual void fatalErrorEncountered(StringRef error) override#

Called if a fatal error (signal/structured exception) occurred.

inline IEventListener(IConfig const *config)#
virtual void listListeners(std::vector<ListenerDescription> const &descriptions) override#

Writes out the provided listeners descriptions using reporter-specific format.

virtual void listReporters(std::vector<ReporterDescription> const &descriptions) override#

Writes out information about provided reporters using reporter-specific format.

virtual void listTags(std::vector<TagInfo> const &tags) override#

Writes out information about the provided tags using reporter-specific format.

virtual void listTests(std::vector<TestCaseHandle> const &tests) override#

Writes out information about provided tests using reporter-specific format.

virtual void noMatchingTestCases(StringRef unmatchedSpec) override#

Called when no test cases match provided test spec.

virtual void reportInvalidTestSpec(StringRef arg) override#

Called for all invalid test specs from the cli.

virtual void sectionEnded(SectionStats const &sectionStats) override#

Called after a SECTION has finished running.

virtual void sectionStarting(SectionInfo const &sectionInfo) override#

Called when a SECTION is being entered. Not called for skipped sections.

virtual void skipTest(TestCaseInfo const &testInfo) override#

Called with test cases that are skipped due to the test run aborting.

NOT called for test cases that are explicitly skipped using the SKIP macro.

Deprecated - will be removed in the next major release.

virtual void testCaseEnded(TestCaseStats const &testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testCasePartialEnded(TestCaseStats const &testInfo, uint64_t partNumber) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void testCasePartialStarting(TestCaseInfo const &testInfo, uint64_t partNumber) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

virtual void testCaseStarting(TestCaseInfo const &testInfo) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &testRunStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &testRunInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Private Functions

void updatePreferences(IEventListener const &reporterish)#

Private Members

bool m_haveNoncapturingReporters = false#
size_t m_insertedListeners = 0#
std::vector<IEventListenerPtr> m_reporterLikes#
struct NameAndLocation#

Public Functions

NameAndLocation(std::string &&_name, SourceLineInfo const &_location)#

Public Members

SourceLineInfo location#
std::string name#

Friends

inline friend bool operator!=(NameAndLocation const &lhs, NameAndLocation const &rhs)#
inline friend bool operator==(NameAndLocation const &lhs, NameAndLocation const &rhs)#
struct NameAndLocationRef#

This is a variant of NameAndLocation that does not own the name string.

This avoids extra allocations when trying to locate a tracker by its name and location, as long as we make sure that trackers only keep around the owning variant.

Public Functions

inline constexpr NameAndLocationRef(StringRef name_, SourceLineInfo location_)#

Public Members

SourceLineInfo location#
StringRef name#

Friends

inline friend bool operator==(NameAndLocation const &lhs, NameAndLocationRef const &rhs)#
inline friend bool operator==(NameAndLocationRef const &lhs, NameAndLocation const &rhs)#
struct NameAndTags#

Public Functions

inline constexpr NameAndTags(StringRef name_ = StringRef(), StringRef tags_ = StringRef()) noexcept#

Public Members

StringRef name#
StringRef tags#
class NamePattern : public Catch::TestSpec::Pattern#

Public Functions

explicit NamePattern(std::string const &name, std::string const &filterString)#
bool matches(TestCaseInfo const &testCase) const override#

Private Functions

void serializeTo(std::ostream &out) const override#

Private Members

WildcardPattern m_wildcardPattern#
template<class B>
struct negation : public std::integral_constant<bool, !bool(B::value)>#
template<typename T, typename ChildNodeT>
struct Node#

Public Types

using ChildNodes = std::vector<Detail::unique_ptr<ChildNodeT>>#

Public Functions

inline explicit Node(T const &_value)#

Public Members

ChildNodes children#
T value#
class NonCopyable#

Deriving classes become noncopyable and nonmovable.

Subclassed by Catch::AutoReg, Catch::Clara::Detail::BoundRef, Catch::IConfig, Catch::ReusableStringStream, Catch::Section, Catch::Session, Catch::TestCaseInfo

Protected Functions

NonCopyable() noexcept = default#

Private Functions

NonCopyable(NonCopyable&&) = delete#
NonCopyable(NonCopyable const&) = delete#
NonCopyable &operator=(NonCopyable&&) = delete#
NonCopyable &operator=(NonCopyable const&) = delete#
template<typename Matcher>
class NoneMatchMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

inline NoneMatchMatcher(Matcher matcher)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

Matcher m_matcher#
class NoneTrueMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#
template<typename Clock>
struct now#
#include <catch_clock.hpp>

Public Functions

inline TimePoint<Clock> operator()() const#
template<typename T, bool Destruct>
struct ObjectStorage#

Public Functions

ObjectStorage() = default#
inline ObjectStorage(const ObjectStorage &other)#
inline ObjectStorage(ObjectStorage &&other)#
inline ~ObjectStorage()#
template<typename ...Args>
inline void construct(Args&&... args)#
template<bool AllowManualDestruction = !Destruct>
inline std::enable_if_t<AllowManualDestruction> destruct()#

Private Functions

template<typename U>
inline void destruct_on_exit(std::enable_if_t<Destruct, U>* = nullptr)#
template<typename U>
inline void destruct_on_exit(std::enable_if_t<!Destruct, U>* = nullptr)#
inline T &stored_object()#
inline T const &stored_object() const#

Private Members

unsigned char data[sizeof(T)] = {}#
class Opt : public Catch::Clara::Detail::ParserRefImpl<Opt>#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Help

Public Functions

template<typename LambdaT>
inline Opt(accept_many_t, LambdaT const &ref, std::string const &hint)#
explicit Opt(bool &ref)#
template<typename LambdaT>
inline explicit Opt(LambdaT const &ref)#
template<typename LambdaT, typename = typename std::enable_if_t<Detail::is_unary_function<LambdaT>::value>>
inline Opt(LambdaT const &ref, std::string const &hint)#
template<typename T, typename = typename std::enable_if_t<!Detail::is_unary_function<T>::value>>
inline Opt(T &ref, std::string const &hint)#
std::vector<Detail::HelpColumns> getHelpColumns() const#
bool isMatch(std::string const &optToken) const#
inline auto operator[](std::string const &optName) -> Opt&#
virtual Detail::InternalParseResult parse(std::string const&, Detail::TokenStream const &tokens) const override#
virtual Detail::Result validate() const override#

Protected Attributes

std::vector<std::string> m_optNames#
struct optimized_away_error : public std::exception#

Public Functions

const char *what() const noexcept override#
template<typename T>
class Optional#
#include <catch_optional.hpp>

Public Functions

inline Optional()#
inline Optional(Optional &&_other)#
inline Optional(Optional const &_other)#
inline Optional(T &&_value)#
inline Optional(T const &_value)#
inline ~Optional()#
inline bool none() const#
inline explicit operator bool() const#
inline bool operator!() const#
inline T &operator*()#
inline T const &operator*() const#
inline T *operator->()#
inline const T *operator->() const#
inline Optional &operator=(Optional &&_other)#
inline Optional &operator=(Optional const &_other)#
inline Optional &operator=(T &&_value)#
inline Optional &operator=(T const &_value)#
inline void reset()#
inline bool some() const#
inline T valueOr(T const &defaultValue) const#

Private Members

T *nullableValue#
char storage[sizeof(T)]#

Friends

inline friend bool operator!=(Optional const &a, Optional const &b)#
inline friend bool operator==(Optional const &a, Optional const &b)#
struct OutlierClassification#

Public Functions

inline int total() const#

Public Members

int high_mild = 0#
int high_severe = 0#
int low_mild = 0#
int low_severe = 0#
int samples_seen = 0#
class Parser : private Catch::Clara::Detail::ParserBase#
#include <catch_clara.hpp>

Public Functions

std::vector<Detail::HelpColumns> getHelpColumns() const#
template<typename T>
inline auto operator|(T const &other) const -> Parser#
inline auto operator|=(Arg const &arg) -> Parser&#
inline auto operator|=(ExeName const &exeName) -> Parser&#
inline auto operator|=(Opt const &opt) -> Parser&#
Parser &operator|=(Parser const &other)#
virtual Detail::InternalParseResult parse(std::string const &exeName, Detail::TokenStream const &tokens) const override#
virtual Detail::Result validate() const override#
void writeToStream(std::ostream &os) const#

Private Members

std::vector<Arg> m_args#
mutable ExeName m_exeName#
std::vector<Opt> m_options#

Friends

inline friend auto operator<<(std::ostream &os, Parser const &parser) -> std::ostream&#
class ParserBase#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::ComposableParserImpl< ExeName >, Catch::Clara::Detail::ComposableParserImpl< DerivedT >, Catch::Clara::Parser

Public Functions

virtual ~ParserBase() = default#
virtual size_t cardinality() const#
InternalParseResult parse(Args const &args) const#
virtual auto parse(std::string const &exeName, TokenStream const &tokens) const -> InternalParseResult = 0#
inline virtual auto validate() const -> Result#
template<typename DerivedT>
class ParserRefImpl : public Catch::Clara::Detail::ComposableParserImpl<DerivedT>#
#include <catch_clara.hpp>

Public Functions

template<typename LambdaT>
inline ParserRefImpl(accept_many_t, LambdaT const &ref, std::string const &hint)#
template<typename LambdaT, typename = typename std::enable_if_t<Detail::is_unary_function<LambdaT>::value>>
inline ParserRefImpl(LambdaT const &ref, std::string const &hint)#
template<typename T, typename = typename std::enable_if_t<!Detail::is_unary_function<T>::value>>
inline ParserRefImpl(T &ref, std::string const &hint)#
inline virtual auto cardinality() const -> size_t override#
inline std::string const &hint() const#
inline auto isOptional() const -> bool#
inline auto operator()(std::string const &description) -> DerivedT&#
inline auto optional() -> DerivedT&#
inline auto required() -> DerivedT&#

Protected Functions

inline explicit ParserRefImpl(std::shared_ptr<BoundRef> const &ref)#

Protected Attributes

std::string m_description#
std::string m_hint#
Optionality m_optionality = Optionality::Optional#
std::shared_ptr<BoundRef> m_ref#
class ParseState#
#include <catch_clara.hpp>

Public Functions

ParseState(ParseResultType type, TokenStream const &remainingTokens)#
inline TokenStream const &remainingTokens() const#
inline ParseResultType type() const#

Private Members

TokenStream m_remainingTokens#
ParseResultType m_type#
class Pattern#

Public Functions

explicit Pattern(std::string const &name)#
virtual ~Pattern()#
virtual bool matches(TestCaseInfo const &testCase) const = 0#
std::string const &name() const#

Private Functions

virtual void serializeTo(std::ostream &out) const = 0#

Private Members

std::string const m_name#

Friends

inline friend std::ostream &operator<<(std::ostream &out, Pattern const &pattern)#
class pluralise#

Helper for streaming a “count [maybe-plural-of-label]” human-friendly string.

Usage example:

std::cout << "Found " << pluralise(count, "error") << '\n';

Important: The provided string must outlive the instance

Public Functions

inline constexpr pluralise(std::uint64_t count, StringRef label)#

Private Members

std::uint64_t m_count#
StringRef m_label#

Friends

friend std::ostream &operator<<(std::ostream &os, pluralise const &pluraliser)#
template<typename T, typename Predicate>
class PredicateMatcher : public Catch::Matchers::MatcherBase<T>#

Public Functions

inline PredicateMatcher(Predicate &&elem, std::string const &descr)#
inline virtual std::string describe() const override#
inline virtual bool match(T const &item) const override#

Private Members

std::string m_description#
Predicate m_predicate#
struct ProcessedReporterSpec#
#include <catch_config.hpp>

ReporterSpec but with the defaults filled in.

Like ReporterSpec, the semantics are unchecked.

Public Members

ColourMode colourMode#
std::map<std::string, std::string> customOptions#
std::string name#
std::string outputFilename#

Friends

inline friend bool operator!=(ProcessedReporterSpec const &lhs, ProcessedReporterSpec const &rhs)#
friend bool operator==(ProcessedReporterSpec const &lhs, ProcessedReporterSpec const &rhs)#
template<typename Float>
class RandomFloatingGenerator : public Catch::Generators::IGenerator<Float>#

Public Functions

inline RandomFloatingGenerator(Float a, Float b, std::uint32_t seed)#
inline virtual Float const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

Float m_current_number#
std::uniform_real_distribution<Float> m_dist#
Catch::SimplePcg32 m_rng#
template<typename Integer>
class RandomIntegerGenerator : public Catch::Generators::IGenerator<Integer>#

Public Functions

inline RandomIntegerGenerator(Integer a, Integer b, std::uint32_t seed)#
inline virtual Integer const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

Integer m_current_number#
std::uniform_int_distribution<Integer> m_dist#
Catch::SimplePcg32 m_rng#
template<typename TargetRangeLike, typename Equality>
class RangeEqualsMatcher : public Catch::Matchers::MatcherGenericBase#

Matcher for checking that an element contains the same elements in the same order.

Public Functions

template<typename TargetRangeLike2, typename Equality2>
inline RangeEqualsMatcher(TargetRangeLike2 &&range, Equality2 &&predicate)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

TargetRangeLike m_desired#
Equality m_predicate#
template<typename T>
class RangeGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

inline RangeGenerator(T const &start, T const &end)#
inline RangeGenerator(T const &start, T const &end, T const &step)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

T m_current#
T m_end#
bool m_positive#
T m_step#
template<class Ratio>
struct ratio_string#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string symbol()#
template<>
struct ratio_string<std::atto>#
#include <catch_tostring.hpp>

Public Static Functions

static inline char symbol()#
template<>
struct ratio_string<std::femto>#
#include <catch_tostring.hpp>

Public Static Functions

static inline char symbol()#
template<>
struct ratio_string<std::micro>#
#include <catch_tostring.hpp>

Public Static Functions

static inline char symbol()#
template<>
struct ratio_string<std::milli>#
#include <catch_tostring.hpp>

Public Static Functions

static inline char symbol()#
template<>
struct ratio_string<std::nano>#
#include <catch_tostring.hpp>

Public Static Functions

static inline char symbol()#
template<>
struct ratio_string<std::pico>#
#include <catch_tostring.hpp>

Public Static Functions

static inline char symbol()#
class RedirectedStdErr#

Public Functions

RedirectedStdErr()#
auto str() const -> std::string#

Private Members

RedirectedStream m_cerr#
RedirectedStream m_clog#
ReusableStringStream m_rss#
class RedirectedStdOut#

Public Functions

RedirectedStdOut()#
auto str() const -> std::string#

Private Members

RedirectedStream m_cout#
ReusableStringStream m_rss#
class RedirectedStream#

Public Functions

RedirectedStream(std::ostream &originalStream, std::ostream &redirectionStream)#
~RedirectedStream()#

Private Members

std::ostream &m_originalStream#
std::streambuf *m_prevBuf#
std::ostream &m_redirectionStream#
class RedirectedStreams#

Public Functions

RedirectedStreams(RedirectedStreams&&) = delete#
RedirectedStreams(RedirectedStreams const&) = delete#
RedirectedStreams(std::string &redirectedCout, std::string &redirectedCerr)#
~RedirectedStreams()#
RedirectedStreams &operator=(RedirectedStreams&&) = delete#
RedirectedStreams &operator=(RedirectedStreams const&) = delete#

Private Members

std::string &m_redirectedCerr#
std::string &m_redirectedCout#
RedirectedStdErr m_redirectedStdErr#
RedirectedStdOut m_redirectedStdOut#
class RegexMatcher : public Catch::Matchers::MatcherBase<std::string>#

Public Functions

RegexMatcher(std::string regex, CaseSensitive caseSensitivity)#
virtual std::string describe() const override#
virtual bool match(std::string const &matchee) const override#

Private Members

CaseSensitive m_caseSensitivity#
std::string m_regex#
struct RegistrarForTagAliases#

Public Functions

RegistrarForTagAliases(char const *alias, char const *tag, SourceLineInfo const &lineInfo)#
template<typename Fun>
struct repeater#
#include <catch_repeat.hpp>

Public Functions

inline void operator()(int k) const#

Public Members

Fun fun#
template<typename T>
class RepeatGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

inline RepeatGenerator(size_t repeats, GeneratorWrapper<T> &&generator)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

size_t m_current_repeat = 0#
GeneratorWrapper<T> m_generator#
size_t m_repeat_index = 0#
mutable std::vector<T> m_returned#
size_t m_target_repeats#
class ReporterBase : public Catch::IEventListener#

This is the base class for all reporters.

If are writing a reporter, you must derive from this type, or one of the helper reporter bases that are derived from this type.

ReporterBase centralizes handling of various common tasks in reporters, like storing the right stream for the reporters to write to, and providing the default implementation of the different listing events.

Subclassed by Catch::CumulativeReporterBase, Catch::StreamingReporterBase

Public Functions

ReporterBase(ReporterConfig &&config)#
~ReporterBase() override#
virtual void listListeners(std::vector<ListenerDescription> const &descriptions) override#

Provides a simple default listing of listeners.

Looks similarly to listing of reporters, but with listener type instead of reporter name.

virtual void listReporters(std::vector<ReporterDescription> const &descriptions) override#

Provides a simple default listing of reporters.

Should look roughly like the reporter listing in v2 and earlier versions of Catch2.

virtual void listTags(std::vector<TagInfo> const &tags) override#

Provides a simple default listing of tags.

Should look roughly like the tag listing in v2 and earlier versions of Catch2.

virtual void listTests(std::vector<TestCaseHandle> const &tests) override#

Provides a simple default listing of tests.

Should look roughly like the test listing in v2 and earlier versions of Catch2. Especially supports low-verbosity listing that mimics the old --list-test-names-only output.

Protected Attributes

Detail::unique_ptr<ColourImpl> m_colour#

Colour implementation this reporter was configured for.

std::map<std::string, std::string> m_customOptions#

The custom reporter options user passed down to the reporter.

std::ostream &m_stream#

Cached output stream from m_wrapped_stream to reduce number of indirect calls needed to write output.

Detail::unique_ptr<IStream> m_wrapped_stream#

The stream wrapper as passed to us by outside code.

struct ReporterConfig#

Public Functions

ReporterConfig(IConfig const *_fullConfig, Detail::unique_ptr<IStream> _stream, ColourMode colourMode, std::map<std::string, std::string> customOptions)#
ReporterConfig(ReporterConfig&&) = default#
~ReporterConfig()#
ColourMode colourMode() const#
std::map<std::string, std::string> const &customOptions() const#
IConfig const *fullConfig() const#
ReporterConfig &operator=(ReporterConfig&&) = default#
Detail::unique_ptr<IStream> takeStream() &&#

Private Members

ColourMode m_colourMode#
std::map<std::string, std::string> m_customOptions#
IConfig const *m_fullConfig#
Detail::unique_ptr<IStream> m_stream#
struct ReporterDescription#
#include <catch_list.hpp>

Public Members

std::string description#
std::string name#
template<typename T>
class ReporterFactory : public Catch::IReporterFactory#

Private Functions

inline virtual IEventListenerPtr create(ReporterConfig &&config) const override#
inline virtual std::string getDescription() const override#
struct ReporterPreferences#

By setting up its preferences, a reporter can modify Catch2’s behaviour in some regards, e.g.

it can request Catch2 to capture writes to stdout/stderr during test execution, and pass them to the reporter.

Public Members

bool shouldRedirectStdOut = false#

Catch2 should redirect writes to stdout and pass them to the reporter.

bool shouldReportAllAssertions = false#

Catch2 should call Reporter::assertionEnded even for passing assertions.

template<typename T>
class ReporterRegistrar#

Public Functions

inline explicit ReporterRegistrar(std::string const &name)#
class ReporterRegistry#

Public Functions

ReporterRegistry()#
~ReporterRegistry()#
IEventListenerPtr create(std::string const &name, ReporterConfig &&config) const#
std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess> const &getFactories() const#
std::vector<Detail::unique_ptr<EventListenerFactory>> const &getListeners() const#
void registerListener(Detail::unique_ptr<EventListenerFactory> factory)#
void registerReporter(std::string const &name, IReporterFactoryPtr factory)#

Private Members

Detail::unique_ptr<ReporterRegistryImpl> m_impl#
struct ReporterRegistryImpl#

Public Members

std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess> factories#
std::vector<Detail::unique_ptr<EventListenerFactory>> listeners#
class ReporterSpec#

Structured reporter spec that a reporter can be created from.

Parsing has been validated, but semantics have not. This means e.g. that the colour mode is known to Catch2, but it might not be compiled into the binary, and the output filename might not be openable.

Public Functions

ReporterSpec(std::string name, Optional<std::string> outputFileName, Optional<ColourMode> colourMode, std::map<std::string, std::string> customOptions)#
inline Optional<ColourMode> const &colourMode() const#
inline std::map<std::string, std::string> const &customOptions() const#
inline std::string const &name() const#
inline Optional<std::string> const &outputFile() const#

Private Members

Optional<ColourMode> m_colourMode#
std::map<std::string, std::string> m_customOptions#
std::string m_name#
Optional<std::string> m_outputFileName#

Friends

inline friend bool operator!=(ReporterSpec const &lhs, ReporterSpec const &rhs)#
friend bool operator==(ReporterSpec const &lhs, ReporterSpec const &rhs)#
class ResultBase#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::ResultValueBase< T >, Catch::Clara::Detail::ResultValueBase< void >

Protected Functions

ResultBase(ResultBase&&) = default#
ResultBase(ResultBase const&) = default#
inline ResultBase(ResultType type)#
virtual ~ResultBase()#
virtual void enforceOk() const = 0#
ResultBase &operator=(ResultBase&&) = default#
ResultBase &operator=(ResultBase const&) = default#

Protected Attributes

ResultType m_type#
struct ResultDisposition#

Public Types

enum Flags#

Values:

enumerator Normal#
enumerator ContinueOnFailure#
enumerator FalseTest#
enumerator SuppressFail#
template<typename T>
class ResultValueBase : public Catch::Clara::Detail::ResultBase#
#include <catch_clara.hpp>

Public Functions

inline auto value() const -> T const&#

Protected Functions

inline ResultValueBase(ResultType type)#
inline ResultValueBase(ResultType, T const &value)#
inline ResultValueBase(ResultValueBase const &other)#
inline ~ResultValueBase() override#
inline auto operator=(ResultValueBase const &other) -> ResultValueBase&#

Protected Attributes

union Catch::Clara::Detail::ResultValueBase::[anonymous] [anonymous]#
template<>
class ResultValueBase<void> : public Catch::Clara::Detail::ResultBase#
#include <catch_clara.hpp>

Subclassed by Catch::Clara::Detail::BasicResult< T >

Protected Functions

ResultBase(ResultBase&&) = default#
ResultBase(ResultBase const&) = default#
inline ResultBase(ResultType type)#
struct ResultWas#

Public Types

enum OfType#

Values:

enumerator Unknown#
enumerator Ok#
enumerator Info#
enumerator Warning#
enumerator ExplicitSkip#
enumerator FailureBit#
enumerator ExpressionFailed#
enumerator ExplicitFailure#
enumerator Exception#
enumerator ThrewException#
enumerator DidntThrowException#
enumerator FatalErrorCondition#
class ReusableStringStream : private Catch::Detail::NonCopyable#

Public Functions

ReusableStringStream()#
~ReusableStringStream()#
inline auto get() -> std::ostream&#
template<typename T>
inline auto operator<<(T const &value) -> ReusableStringStream&#
std::string str() const#

Returns the serialized state.

void str(std::string const &str)#

Sets internal state to str

Private Members

std::size_t m_index#
std::ostream *m_oss#
class RunContext : public Catch::IResultCapture#

Public Functions

explicit RunContext(IConfig const *_config, IEventListenerPtr &&reporter)#
RunContext(RunContext const&) = delete#
~RunContext() override#
bool aborting() const#
virtual IGeneratorTracker *acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const &lineInfo) override#
virtual void assertionPassed() override#
virtual void benchmarkEnded(BenchmarkStats<> const &stats) override#
virtual void benchmarkFailed(StringRef error) override#
virtual void benchmarkPreparing(StringRef name) override#
virtual void benchmarkStarting(BenchmarkInfo const &info) override#
virtual IGeneratorTracker *createGeneratorTracker(StringRef generatorName, SourceLineInfo lineInfo, Generators::GeneratorBasePtr &&generator) override#
virtual void emplaceUnscopedMessage(MessageBuilder &&builder) override#
virtual void exceptionEarlyReported() override#
virtual std::string getCurrentTestName() const override#
virtual const AssertionResult *getLastResult() const override#
virtual void handleExpr(AssertionInfo const &info, ITransientExpression const &expr, AssertionReaction &reaction) override#
virtual void handleFatalErrorCondition(StringRef message) override#
virtual void handleIncomplete(AssertionInfo const &info) override#
virtual void handleMessage(AssertionInfo const &info, ResultWas::OfType resultType, StringRef message, AssertionReaction &reaction) override#
virtual void handleNonExpr(AssertionInfo const &info, ResultWas::OfType resultType, AssertionReaction &reaction) override#
virtual void handleUnexpectedExceptionNotThrown(AssertionInfo const &info, AssertionReaction &reaction) override#
virtual void handleUnexpectedInflightException(AssertionInfo const &info, std::string &&message, AssertionReaction &reaction) override#
virtual bool lastAssertionPassed() override#
virtual void notifyAssertionStarted(AssertionInfo const &info) override#
RunContext &operator=(RunContext const&) = delete#
virtual void popScopedMessage(MessageInfo const &message) override#
virtual void pushScopedMessage(MessageInfo const &message) override#
Totals runTest(TestCaseHandle const &testCase)#
virtual void sectionEnded(SectionEndInfo &&endInfo) override#
virtual void sectionEndedEarly(SectionEndInfo &&endInfo) override#
virtual bool sectionStarted(StringRef sectionName, SourceLineInfo const &sectionLineInfo, Counts &assertions) override#

Private Functions

void assertionEnded(AssertionResult &&result)#
void handleUnfinishedSections()#
void invokeActiveTestCase()#
void populateReaction(AssertionReaction &reaction)#
void reportExpr(AssertionInfo const &info, ResultWas::OfType resultType, ITransientExpression const *expr, bool negated)#
void resetAssertionInfo()#
void runCurrentTest(std::string &redirectedCout, std::string &redirectedCerr)#
bool testForMissingAssertions(Counts &assertions)#

Private Members

std::vector<ITracker*> m_activeSections#
TestCaseHandle const *m_activeTestCase = nullptr#
IConfig const *m_config#
FatalConditionHandler m_fatalConditionhandler#
bool m_includeSuccessfulResults#
AssertionInfo m_lastAssertionInfo#
bool m_lastAssertionPassed = false#
Optional<AssertionResult> m_lastResult#
std::vector<MessageInfo> m_messages#
std::vector<ScopedMessage> m_messageScopes#
IEventListenerPtr m_reporter#
TestRunInfo m_runInfo#
bool m_shouldReportUnexpected = true#
ITracker *m_testCaseTracker = nullptr#
Totals m_totals#
TrackerContext m_trackerContext#
std::vector<SectionEndInfo> m_unfinishedSections#
template<typename Duration>
struct SampleAnalysis#

Public Functions

template<typename Duration2>
inline operator SampleAnalysis<Duration2>() const#

Public Members

Estimate<Duration> mean#
double outlier_variance#
OutlierClassification outliers#
std::vector<Duration> samples#
Estimate<Duration> standard_deviation#
class ScopedElement#

Public Functions

ScopedElement(ScopedElement &&other) noexcept#
ScopedElement(XmlWriter *writer, XmlFormatting fmt)#
~ScopedElement()#
ScopedElement &operator=(ScopedElement &&other) noexcept#
ScopedElement &writeAttribute(StringRef name, StringRef attribute)#
template<typename T, typename = typename std::enable_if_t<!std::is_convertible<T, StringRef>::value>>
inline ScopedElement &writeAttribute(StringRef name, T const &attribute)#
ScopedElement &writeText(StringRef text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent)#

Private Members

XmlFormatting m_fmt#
XmlWriter *m_writer = nullptr#
class ScopedMessage#
#include <catch_message.hpp>

Public Functions

explicit ScopedMessage(MessageBuilder &&builder)#
ScopedMessage(ScopedMessage &&old) noexcept#
ScopedMessage(ScopedMessage &duplicate) = delete#
~ScopedMessage()#

Public Members

MessageInfo m_info#
bool m_moved = false#
class Section : private Catch::Detail::NonCopyable#
#include <catch_section.hpp>

Public Functions

Section(SectionInfo &&info)#
Section(SourceLineInfo const &_lineInfo, StringRef _name, const char*const = nullptr)#
~Section()#
explicit operator bool() const#

Private Members

Counts m_assertions#
SectionInfo m_info#
bool m_sectionIncluded#
Timer m_timer#
struct SectionEndInfo#

Public Members

double durationInSeconds#
Counts prevAssertions#
SectionInfo sectionInfo#
struct SectionInfo#

Public Functions

inline SectionInfo(SourceLineInfo const &_lineInfo, std::string _name, const char*const = nullptr)#

Public Members

SourceLineInfo lineInfo#
std::string name#
struct SectionNode#

Public Functions

inline explicit SectionNode(SectionStats const &_stats)#
bool hasAnyAssertions() const#
inline bool operator==(SectionNode const &other) const#

Public Members

std::vector<Detail::AssertionOrBenchmarkResult> assertionsAndBenchmarks#
std::vector<Detail::unique_ptr<SectionNode>> childSections#
SectionStats stats#
std::string stdErr#
std::string stdOut#
struct SectionStats#

Public Functions

SectionStats(SectionInfo &&_sectionInfo, Counts const &_assertions, double _durationInSeconds, bool _missingAssertions)#

Public Members

Counts assertions#
double durationInSeconds#
bool missingAssertions#
SectionInfo sectionInfo#
class SectionTracker : public Catch::TestCaseTracking::TrackerBase#

Public Functions

SectionTracker(NameAndLocation &&nameAndLocation, TrackerContext &ctx, ITracker *parent)#
void addInitialFilters(std::vector<std::string> const &filters)#
void addNextFilters(std::vector<StringRef> const &filters)#
inline std::vector<StringRef> const &getFilters() const#

Returns filters active in this tracker.

virtual bool isComplete() const override#

Returns true if tracker run to completion (successfully or not)

virtual bool isSectionTracker() const override#

Returns true if the instance is a section tracker.

Subclasses should override to true if they are, replaces RTTI for internal debug checks.

StringRef trimmedName() const#

Returns whitespace-trimmed name of the tracked section.

void tryOpen()#

Public Static Functions

static SectionTracker &acquire(TrackerContext &ctx, NameAndLocationRef const &nameAndLocation)#

Private Members

std::vector<StringRef> m_filters#
StringRef m_trimmed_name#
class Session : private Catch::Detail::NonCopyable#
#include <catch_session.hpp>

Public Functions

Session()#
~Session()#
int applyCommandLine(int argc, char const *const *argv)#
Clara::Parser const &cli() const#
void cli(Clara::Parser const &newParser)#
Config &config()#
ConfigData &configData()#
void libIdentify()#
int run()#
template<typename CharT>
inline int run(int argc, CharT const *const argv[])#
void showHelp() const#
void useConfigData(ConfigData const &configData)#

Private Functions

int runInternal()#

Private Members

Clara::Parser m_cli#
Detail::unique_ptr<Config> m_config#
ConfigData m_configData#
bool m_startupExceptions = false#
class SimplePcg32#

Public Types

using result_type = std::uint32_t#

Public Functions

inline SimplePcg32()#
explicit SimplePcg32(result_type seed_)#
void discard(uint64_t skip)#
result_type operator()()#
void seed(result_type seed_)#

Public Static Functions

static inline constexpr result_type() max ()
static inline constexpr result_type() min ()

Private Types

using state_type = std::uint64_t#

Private Members

std::uint64_t m_state#

Private Static Attributes

static const std::uint64_t s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL#

Friends

friend bool operator!=(SimplePcg32 const &lhs, SimplePcg32 const &rhs)#
friend bool operator==(SimplePcg32 const &lhs, SimplePcg32 const &rhs)#
template<typename SingletonImplT, typename InterfaceT = SingletonImplT, typename MutableInterfaceT = InterfaceT>
class Singleton : private SingletonImplT, public Catch::ISingleton#

Public Static Functions

static inline auto get() -> InterfaceT const&#
static inline auto getMutable() -> MutableInterfaceT&#

Private Static Functions

static inline auto getInternal() -> Singleton*#
template<typename T>
class SingleValueGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

inline SingleValueGenerator(T &&value)#
inline SingleValueGenerator(T const &value)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

T m_value#
template<typename Matcher>
class SizeMatchesMatcher : public Catch::Matchers::MatcherGenericBase#

Public Functions

inline explicit SizeMatchesMatcher(Matcher m)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

Matcher m_matcher#
class SonarQubeReporter : public Catch::CumulativeReporterBase#

Public Functions

inline SonarQubeReporter(ReporterConfig &&config)#
~SonarQubeReporter() override = default#
inline virtual void testRunEndedCumulative() override#

Customization point: called after last test finishes (testRunEnded has been handled)

virtual void testRunStarting(TestRunInfo const &testRunInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

void writeAssertion(AssertionStats const &stats, bool okToFail)#
void writeAssertions(SectionNode const &sectionNode, bool okToFail)#
void writeRun(TestRunNode const &groupNode)#
void writeSection(std::string const &rootName, SectionNode const &sectionNode, bool okToFail)#
void writeTestCase(TestCaseNode const &testCaseNode)#
void writeTestFile(StringRef filename, std::vector<TestCaseNode const*> const &testCaseNodes)#

Public Static Functions

static inline std::string getDescription()#

Private Members

XmlWriter xml#
struct SourceLineInfo#

Public Functions

SourceLineInfo() = delete#
inline constexpr SourceLineInfo(char const *_file, std::size_t _line) noexcept#
bool operator<(SourceLineInfo const &other) const noexcept#
bool operator==(SourceLineInfo const &other) const noexcept#

Public Members

char const *file#
std::size_t line#

Friends

friend std::ostream &operator<<(std::ostream &os, SourceLineInfo const &info)#
class StartsWithMatcher : public Catch::Matchers::StringMatcherBase#

Public Functions

StartsWithMatcher(CasedString const &comparator)#
virtual bool match(std::string const &source) const override#
class StartupExceptionRegistry#

Public Functions

void add(std::exception_ptr const &exception) noexcept#
std::vector<std::exception_ptr> const &getExceptions() const noexcept#

Private Members

std::vector<std::exception_ptr> m_exceptions#
struct StreamEndStop#

Public Functions

inline constexpr StringRef operator+() const#

Friends

template<typename T> inline friend constexpr friend T const  & operator+ (T const &value, StreamEndStop)
class StreamingReporterBase : public Catch::ReporterBase#

Subclassed by Catch::AutomakeReporter, Catch::CompactReporter, Catch::ConsoleReporter, Catch::TAPReporter, Catch::TeamCityReporter, Catch::XmlReporter

Public Functions

inline StreamingReporterBase(ReporterConfig &&_config)#
~StreamingReporterBase() override#
inline virtual void assertionEnded(AssertionStats const&) override#

Called after assertion was fully evaluated.

inline virtual void assertionStarting(AssertionInfo const&) override#

Called before assertion success/failure is evaluated.

inline virtual void benchmarkEnded(BenchmarkStats<> const&) override#

Called with the benchmark results if benchmark successfully finishes.

inline virtual void benchmarkFailed(StringRef) override#

Called if running the benchmarks fails for any reason.

inline virtual void benchmarkPreparing(StringRef) override#

Called when user-code is being probed before the actual benchmark runs.

inline virtual void benchmarkStarting(BenchmarkInfo const&) override#

Called after probe but before the user-code is being benchmarked.

inline virtual void fatalErrorEncountered(StringRef) override#

Called if a fatal error (signal/structured exception) occurred.

inline virtual void noMatchingTestCases(StringRef) override#

Called when no test cases match provided test spec.

inline virtual void reportInvalidTestSpec(StringRef) override#

Called for all invalid test specs from the cli.

inline virtual void sectionEnded(SectionStats const&) override#

Called after a SECTION has finished running.

inline virtual void sectionStarting(SectionInfo const &_sectionInfo) override#

Called when a SECTION is being entered. Not called for skipped sections.

inline virtual void skipTest(TestCaseInfo const&) override#

Called with test cases that are skipped due to the test run aborting.

NOT called for test cases that are explicitly skipped using the SKIP macro.

Deprecated - will be removed in the next major release.

inline virtual void testCaseEnded(TestCaseStats const&) override#

Called once for each TEST_CASE, no matter how many times it is entered.

inline virtual void testCasePartialEnded(TestCaseStats const&, uint64_t) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

inline virtual void testCasePartialStarting(TestCaseInfo const&, uint64_t) override#

Called every time a TEST_CASE is entered, including repeats (due to sections)

inline virtual void testCaseStarting(TestCaseInfo const &_testInfo) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const&) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &_testRunInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Protected Attributes

TestCaseInfo const *currentTestCaseInfo = nullptr#
TestRunInfo currentTestRunInfo = {"test run has not started yet"_sr}#
std::vector<SectionInfo> m_sectionStack#

Stack of all active sections in the current test case.

class StringContainsMatcher : public Catch::Matchers::StringMatcherBase#

Public Functions

StringContainsMatcher(CasedString const &comparator)#
virtual bool match(std::string const &source) const override#
class StringEqualsMatcher : public Catch::Matchers::StringMatcherBase#

Public Functions

StringEqualsMatcher(CasedString const &comparator)#
virtual bool match(std::string const &source) const override#
template<typename T, typename = void>
struct StringMaker#
#include <catch_tostring.hpp>

Public Static Functions

template<typename Fake = T>
static inline std::enable_if_t<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string> convert(const Fake &value)#
template<typename Fake = T>
static inline std::enable_if_t<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string> convert(const Fake &value)#
template<>
struct StringMaker<bool>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(bool b)#
template<>
struct StringMaker<Catch::Approx>#
#include <catch_approx.hpp>

Public Static Functions

static std::string convert(Catch::Approx const &value)#
template<>
struct StringMaker<char*>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(char *str)#
template<>
struct StringMaker<char>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(char c)#
template<>
struct StringMaker<char const*>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(char const *str)#
template<size_t SZ>
struct StringMaker<char[SZ]>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(char const *str)#
template<>
struct StringMaker<double>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(double value)#

Public Static Attributes

static CATCH_EXPORT int precision   = 10
template<>
struct StringMaker<float>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(float value)#

Public Static Attributes

static CATCH_EXPORT int precision   = 5
template<>
struct StringMaker<int>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(int value)#
template<>
struct StringMaker<long>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(long value)#
template<>
struct StringMaker<long long>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(long long value)#
template<typename R, typename C>
struct StringMaker<R C::*>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(R C::* p)#
template<typename R>
struct StringMaker<R, std::enable_if_t<is_range<R>::value && !::Catch::Detail::IsStreamInsertable<R>::value>>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(R const &range)#
template<>
struct StringMaker<signed char>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(signed char c)#
template<size_t SZ>
struct StringMaker<signed char[SZ]>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(signed char const *str)#
template<typename Value, typename Ratio>
struct StringMaker<std::chrono::duration<Value, Ratio>>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(std::chrono::duration<Value, Ratio> const &duration)#
template<typename Value>
struct StringMaker<std::chrono::duration<Value, std::ratio<1>>>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(std::chrono::duration<Value, std::ratio<1>> const &duration)#
template<typename Value>
struct StringMaker<std::chrono::duration<Value, std::ratio<3600>>>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(std::chrono::duration<Value, std::ratio<3600>> const &duration)#
template<typename Value>
struct StringMaker<std::chrono::duration<Value, std::ratio<60>>>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(std::chrono::duration<Value, std::ratio<60>> const &duration)#
template<typename Clock, typename Duration>
struct StringMaker<std::chrono::time_point<Clock, Duration>>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(std::chrono::time_point<Clock, Duration> const &time_point)#
template<typename Duration>
struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(std::chrono::time_point<std::chrono::system_clock, Duration> const &time_point)#
template<>
struct StringMaker<std::nullptr_t>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(std::nullptr_t)#
template<>
struct StringMaker<std::string>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(const std::string &str)#
template<typename T>
struct StringMaker<T*>#
#include <catch_tostring.hpp>

Public Static Functions

template<typename U>
static inline std::string convert(U *p)#
template<typename T, size_t SZ>
struct StringMaker<T[SZ]>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(T const (&arr)[SZ])#
template<>
struct StringMaker<unsigned char>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(unsigned char c)#
template<size_t SZ>
struct StringMaker<unsigned char[SZ]>#
#include <catch_tostring.hpp>

Public Static Functions

static inline std::string convert(unsigned char const *str)#
template<>
struct StringMaker<unsigned int>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(unsigned int value)#
template<>
struct StringMaker<unsigned long>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(unsigned long value)#
template<>
struct StringMaker<unsigned long long>#
#include <catch_tostring.hpp>

Public Static Functions

static std::string convert(unsigned long long value)#
class StringMatcherBase : public Catch::Matchers::MatcherBase<std::string>#

Subclassed by Catch::Matchers::EndsWithMatcher, Catch::Matchers::StartsWithMatcher, Catch::Matchers::StringContainsMatcher, Catch::Matchers::StringEqualsMatcher

Public Functions

StringMatcherBase(StringRef operation, CasedString const &comparator)#
virtual std::string describe() const override#

Protected Attributes

CasedString m_comparator#
StringRef m_operation#
class StringRef#

A non-owning string class (similar to the forthcoming std::string_view) Note that, because a StringRef may be a substring of another string, it may not be null terminated.

Public Types

using const_iterator = const char*#
using size_type = std::size_t#

Public Functions

constexpr StringRef() noexcept = default#
StringRef(char const *rawChars) noexcept#
inline constexpr StringRef(char const *rawChars, size_type size) noexcept#
inline StringRef(std::string const &stdString) noexcept#
inline constexpr const_iterator begin() const#
int compare(StringRef rhs) const#

Provides a three-way comparison with rhs.

Returns negative number if lhs < rhs, 0 if lhs == rhs, and a positive number if lhs > rhs

inline constexpr char const *data() const noexcept#
inline constexpr auto empty() const noexcept -> bool#
inline constexpr const_iterator end() const#
inline explicit operator std::string() const#
inline auto operator!=(StringRef other) const noexcept -> bool#
bool operator<(StringRef rhs) const noexcept#
inline auto operator==(StringRef other) const noexcept -> bool#
inline constexpr auto operator[](size_type index) const noexcept -> char#
inline constexpr auto size() const noexcept -> size_type#
inline constexpr StringRef substr(size_type start, size_type length) const noexcept#

Private Members

size_type m_size = 0#
char const *m_start = s_empty#

Private Static Attributes

static constexpr char const *const s_empty = ""#

Friends

friend std::string operator+(StringRef lhs, StringRef rhs)#
friend std::string &operator+=(std::string &lhs, StringRef sr)#
friend std::ostream &operator<<(std::ostream &os, StringRef sr)#
struct StringStreams#

Public Functions

inline auto add() -> std::size_t#
inline void release(std::size_t index)#

Public Members

std::ostringstream m_referenceStream#
std::vector<Detail::unique_ptr<std::ostringstream>> m_streams#
std::vector<std::size_t> m_unused#
class TablePrinter#

Public Functions

inline TablePrinter(std::ostream &os, std::vector<ColumnInfo> columnInfos)#
inline void close()#
inline auto columnInfos() const -> std::vector<ColumnInfo> const&#
inline void open()#

Private Members

std::vector<ColumnInfo> m_columnInfos#
int m_currentColumn = -1#
bool m_isOpen = false#
std::ostream &m_os#
ReusableStringStream m_oss#

Friends

inline friend TablePrinter &operator<<(TablePrinter &tp, ColumnBreak)#
inline friend TablePrinter &operator<<(TablePrinter &tp, RowBreak)#
template<typename T>
inline friend TablePrinter &operator<<(TablePrinter &tp, T const &value)#
struct Tag#

A view of a tag string that provides case insensitive comparisons.

Note that in Catch2 internals, the square brackets around tags are not a part of tag’s representation, so e.g. “[cool-tag]” is represented as “cool-tag” internally.

Public Functions

inline constexpr Tag(StringRef original_)#

Public Members

StringRef original#

Friends

friend bool operator<(Tag const &lhs, Tag const &rhs)#
friend bool operator==(Tag const &lhs, Tag const &rhs)#
struct TagAlias#

Public Functions

inline TagAlias(std::string const &_tag, SourceLineInfo _lineInfo)#

Public Members

SourceLineInfo lineInfo#
std::string tag#
class TagAliasRegistry : public Catch::ITagAliasRegistry#

Public Functions

~TagAliasRegistry() override#
void add(std::string const &alias, std::string const &tag, SourceLineInfo const &lineInfo)#
virtual std::string expandAliases(std::string const &unexpandedTestSpec) const override#
virtual TagAlias const *find(std::string const &alias) const override#

Private Members

std::map<std::string, TagAlias> m_registry#
struct TagInfo#
#include <catch_list.hpp>

Public Functions

void add(StringRef spelling)#
std::string all() const#

Public Members

std::size_t count = 0#
std::set<StringRef> spellings#
class TagPattern : public Catch::TestSpec::Pattern#

Public Functions

explicit TagPattern(std::string const &tag, std::string const &filterString)#
bool matches(TestCaseInfo const &testCase) const override#

Private Functions

void serializeTo(std::ostream &out) const override#

Private Members

std::string m_tag#
template<typename T>
class TakeGenerator : public Catch::Generators::IGenerator<T>#

Public Functions

inline TakeGenerator(size_t target, GeneratorWrapper<T> &&generator)#
inline virtual T const &get() const override#
inline virtual bool next() override#

Attempts to move the generator to the next element.

Returns true iff the move succeeded (and a valid element can be retrieved).

Private Members

GeneratorWrapper<T> m_generator#
size_t m_returned = 0#
size_t m_target#
class TAPReporter : public Catch::StreamingReporterBase#

Public Functions

inline TAPReporter(ReporterConfig &&config)#
~TAPReporter() override = default#
virtual void assertionEnded(AssertionStats const &_assertionStats) override#

Called after assertion was fully evaluated.

virtual void noMatchingTestCases(StringRef unmatchedSpec) override#

Called when no test cases match provided test spec.

virtual void testRunEnded(TestRunStats const &_testRunStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &testInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Public Static Functions

static inline std::string getDescription()#

Private Members

std::size_t counter = 0#
class TeamCityReporter : public Catch::StreamingReporterBase#

Public Functions

inline TeamCityReporter(ReporterConfig &&_config)#
~TeamCityReporter() override#
virtual void assertionEnded(AssertionStats const &assertionStats) override#

Called after assertion was fully evaluated.

inline virtual void sectionStarting(SectionInfo const &sectionInfo) override#

Called when a SECTION is being entered. Not called for skipped sections.

virtual void testCaseEnded(TestCaseStats const &testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testCaseStarting(TestCaseInfo const &testInfo) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &testGroupStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &groupInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

Public Static Functions

static inline std::string getDescription()#

Private Functions

void printSectionHeader(std::ostream &os)#

Private Members

bool m_headerPrintedForThisSection = false#
Timer m_testTimer#
class TestCaseHandle#

Wrapper over the test case information and the test case invoker.

Does not own either, and is specifically made to be cheap to copy around.

Public Functions

inline TestCaseHandle(TestCaseInfo *info, ITestInvoker *invoker)#
TestCaseInfo const &getTestCaseInfo() const#
inline void invoke() const#

Private Members

TestCaseInfo *m_info#
ITestInvoker *m_invoker#
struct TestCaseInfo : public Catch::Detail::NonCopyable#

Various metadata about the test case.

A test case is uniquely identified by its (class)name and tags combination, with source location being ignored, and other properties being determined from tags.

Tags are kept sorted.

Public Functions

TestCaseInfo(StringRef _className, NameAndTags const &_tags, SourceLineInfo const &_lineInfo)#
void addFilenameTag()#
bool expectedToFail() const#
bool isHidden() const#
bool okToFail() const#
std::string tagsAsString() const#
bool throws() const#

Public Members

StringRef className#
SourceLineInfo lineInfo#
std::string name#
TestCaseProperties properties = TestCaseProperties::None#
std::vector<Tag> tags#

Private Functions

void internalAppendTag(StringRef tagString)#

Private Members

std::string backingTags#

Friends

friend bool operator<(TestCaseInfo const &lhs, TestCaseInfo const &rhs)#

Orders by name, classname and tags.

class TestCaseInfoHasher#

Public Types

using hash_t = std::uint64_t#

Public Functions

TestCaseInfoHasher(hash_t seed)#
uint32_t operator()(TestCaseInfo const &t) const#

Private Members

hash_t m_seed#
struct TestCaseStats#

Public Functions

TestCaseStats(TestCaseInfo const &_testInfo, Totals const &_totals, std::string &&_stdOut, std::string &&_stdErr, bool _aborting)#

Public Members

bool aborting#
std::string stdErr#
std::string stdOut#
TestCaseInfo const *testInfo#
Totals totals#
struct TestFailureException#

Used to signal that an assertion macro failed.

template<typename C>
class TestInvokerAsMethod : public Catch::ITestInvoker#

Public Functions

inline TestInvokerAsMethod(void (C::* testAsMethod)()) noexcept#
inline virtual void invoke() const override#

Private Members

void (C::* m_testAsMethod)()#
class TestRegistry : public Catch::ITestCaseRegistry#

Public Functions

~TestRegistry() override = default#
virtual std::vector<TestCaseInfo*> const &getAllInfos() const override#
virtual std::vector<TestCaseHandle> const &getAllTests() const override#
virtual std::vector<TestCaseHandle> const &getAllTestsSorted(IConfig const &config) const override#
void registerTest(Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker)#

Private Members

mutable TestRunOrder m_currentSortOrder = TestRunOrder::Declared#
std::vector<TestCaseHandle> m_handles#
std::vector<Detail::unique_ptr<ITestInvoker>> m_invokers#
std::vector<Detail::unique_ptr<TestCaseInfo>> m_owned_test_infos#
mutable std::vector<TestCaseHandle> m_sortedFunctions#
std::vector<TestCaseInfo*> m_viewed_test_infos#
struct TestRunInfo#

Public Functions

inline constexpr TestRunInfo(StringRef _name)#

Public Members

StringRef name#
struct TestRunStats#

Public Functions

TestRunStats(TestRunInfo const &_runInfo, Totals const &_totals, bool _aborting)#

Public Members

bool aborting#
TestRunInfo runInfo#
Totals totals#
struct TestSkipException#

Used to signal that the remainder of a test should be skipped.

class TestSpec#

Public Types

using Matches = std::vector<FilterMatch>#
using vectorStrings = std::vector<std::string>#

Public Functions

const vectorStrings &getInvalidSpecs() const#
bool hasFilters() const#
bool matches(TestCaseInfo const &testCase) const#
Matches matchesByFilter(std::vector<TestCaseHandle> const &testCases, IConfig const &config) const#

Private Functions

void serializeTo(std::ostream &out) const#

Serializes this test spec into a string that would be parsed into equivalent test spec.

Private Members

std::vector<Filter> m_filters#
std::vector<std::string> m_invalidSpecs#

Private Static Functions

static std::string extractFilterName(Filter const &filter)#

Friends

inline friend std::ostream &operator<<(std::ostream &out, TestSpec const &spec)#
friend class TestSpecParser
class TestSpecParser#

Public Functions

TestSpecParser(ITagAliasRegistry const &tagAliases)#
TestSpecParser &parse(std::string const &arg)#
TestSpec testSpec()#

Private Types

enum Mode#

Values:

enumerator None#
enumerator Name#
enumerator QuotedName#
enumerator Tag#
enumerator EscapedName#

Private Functions

inline void addCharToPattern(char c)#
void addFilter()#
void addNamePattern()#
void addTagPattern()#
void endMode()#
void escape()#
bool isControlChar(char c) const#
std::string preprocessPattern()#
void processNameChar(char c)#
bool processNoneChar(char c)#
bool processOtherChar(char c)#
void revertBackToLastMode()#
void saveLastMode()#
bool separate()#
void startNewMode(Mode mode)#
bool visitChar(char c)#

Private Members

Mode lastMode = None#
std::string m_arg#
TestSpec::Filter m_currentFilter#
std::vector<std::size_t> m_escapeChars#
bool m_exclusion = false#
Mode m_mode = None#
std::string m_patternName#
std::size_t m_pos = 0#
std::size_t m_realPatternPos = 0#
std::string m_substring#
ITagAliasRegistry const *m_tagAliases = nullptr#
TestSpec m_testSpec#
class Timer#
#include <catch_timer.hpp>

Public Functions

auto getElapsedMicroseconds() const -> uint64_t#
auto getElapsedMilliseconds() const -> unsigned int#
auto getElapsedNanoseconds() const -> uint64_t#
auto getElapsedSeconds() const -> double#
void start()#

Private Members

uint64_t m_nanoseconds = 0#
template<typename Duration, typename Result>
struct Timing#
#include <catch_timing.hpp>

Public Members

Duration elapsed#
int iterations#
Result result#
struct Token#
#include <catch_clara.hpp>

Public Members

std::string token#
TokenType type#
class TokenStream#
#include <catch_clara.hpp>

Public Functions

explicit TokenStream(Args const &args)#
TokenStream(Iterator it, Iterator itEnd)#
inline size_t count() const#
inline explicit operator bool() const#
inline Token operator*() const#
TokenStream &operator++()#
inline Token const *operator->() const#

Private Types

using Iterator = std::vector<std::string>::const_iterator#

Private Functions

void loadBuffer()#

Private Members

Iterator it#
Iterator itEnd#
std::vector<Token> m_tokenBuffer#
struct Totals#
#include <catch_totals.hpp>

Public Functions

Totals delta(Totals const &prevTotals) const#
Totals &operator+=(Totals const &other)#
Totals operator-(Totals const &other) const#

Public Members

Counts assertions#
Counts testCases#
class TrackerBase : public Catch::TestCaseTracking::ITracker#

Subclassed by Catch::TestCaseTracking::SectionTracker

Public Functions

TrackerBase(NameAndLocation &&nameAndLocation, TrackerContext &ctx, ITracker *parent)#
virtual void close() override#
virtual void fail() override#
virtual bool isComplete() const override#

Returns true if tracker run to completion (successfully or not)

void open()#

Protected Attributes

TrackerContext &m_ctx#

Private Functions

void moveToParent()#
void moveToThis()#
class TrackerContext#

Public Functions

void completeCycle()#
bool completedCycle() const#
inline ITracker &currentTracker()#
void setCurrentTracker(ITracker *tracker)#
inline void startCycle()#
ITracker &startRun()#

Private Types

enum RunState#

Values:

enumerator NotStarted#
enumerator Executing#
enumerator CompletedCycle#

Private Members

ITracker *m_currentTracker = nullptr#
ITrackerPtr m_rootTracker#
RunState m_runState = NotStarted#
template<typename>
struct true_given : public std::true_type#
#include <catch_meta.hpp>
template<>
struct type#
class TypedListenerFactory : public Catch::EventListenerFactory#

Public Functions

inline TypedListenerFactory(StringRef listenerName)#
inline IEventListenerPtr create(IConfig const *config) const override#
inline std::string getDescription() const override#
inline StringRef getName() const override#

Private Functions

inline std::string getDescriptionImpl(std::false_type) const#
inline std::string getDescriptionImpl(std::true_type) const#

Private Members

StringRef m_listenerName#
template<typename LhsT>
class UnaryExpr : public Catch::ITransientExpression#

Public Functions

inline explicit UnaryExpr(LhsT lhs)#

Private Functions

inline virtual void streamReconstructedExpression(std::ostream &os) const override#

Private Members

LhsT m_lhs#
template<typename L>
struct UnaryLambdaTraits#
#include <catch_clara.hpp>
template<typename ClassT, typename ReturnT, typename ...Args>
struct UnaryLambdaTraits<ReturnT (ClassT::*)(Args...) const>#
#include <catch_clara.hpp>

Public Static Attributes

static const bool isValid = false#
template<typename ClassT, typename ReturnT, typename ArgT>
struct UnaryLambdaTraits<ReturnT (ClassT::*)(ArgT) const>#
#include <catch_clara.hpp>

Public Types

using ArgType = std::remove_const_t<std::remove_reference_t<ArgT>>#
using ReturnType = ReturnT#

Public Static Attributes

static const bool isValid = true#
template<typename T>
class unique_ptr#

A reimplementation of std::unique_ptr for improved compilation performance.

Does not support arrays nor custom deleters.

Public Functions

inline constexpr unique_ptr(std::nullptr_t = nullptr)#
inline explicit constexpr unique_ptr(T *ptr)#
inline unique_ptr(unique_ptr &&rhs) noexcept#
unique_ptr(unique_ptr const&) = delete#
template<typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
inline unique_ptr(unique_ptr<U> &&from)#
inline ~unique_ptr()#
inline T *get()#
inline T const *get() const#
inline explicit operator bool() const#
inline T &operator*()#
inline T const &operator*() const#
inline T const *operator->() const noexcept#
inline T *operator->() noexcept#
inline unique_ptr &operator=(unique_ptr &&rhs) noexcept#
unique_ptr &operator=(unique_ptr const&) = delete#
template<typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
inline unique_ptr &operator=(unique_ptr<U> &&from)#
inline T *release()#
inline void reset(T *ptr = nullptr)#

Private Members

T *m_ptr#

Friends

inline friend void swap(unique_ptr &lhs, unique_ptr &rhs)#
template<typename T, typename AllocComp, typename AllocMatch>
class UnorderedEqualsMatcher : public Catch::Matchers::MatcherBase<std::vector<T, AllocMatch>>#

Public Functions

inline UnorderedEqualsMatcher(std::vector<T, AllocComp> const &target)#
inline virtual std::string describe() const override#
inline virtual bool match(std::vector<T, AllocMatch> const &vec) const override#

Private Members

std::vector<T, AllocComp> const &m_target#
template<typename TargetRangeLike, typename Equality>
class UnorderedRangeEqualsMatcher : public Catch::Matchers::MatcherGenericBase#

Matcher for checking that an element contains the same elements (but not necessarily in the same order)

Public Functions

template<typename TargetRangeLike2, typename Equality2>
inline UnorderedRangeEqualsMatcher(TargetRangeLike2 &&range, Equality2 &&predicate)#
inline virtual std::string describe() const override#
template<typename RangeLike>
inline bool match(RangeLike &&rng) const#

Private Members

TargetRangeLike m_desired#
Equality m_predicate#
template<typename T, typename Alloc>
class VectorContainsElementMatcher : public Catch::Matchers::MatcherBase<std::vector<T, Alloc>>#

Public Functions

inline VectorContainsElementMatcher(T const &comparator)#
inline virtual std::string describe() const override#
inline virtual bool match(std::vector<T, Alloc> const &v) const override#

Private Members

T const &m_comparator#
struct Version#
#include <catch_version.hpp>

Public Functions

Version(unsigned int _majorVersion, unsigned int _minorVersion, unsigned int _patchNumber, char const *const _branchName, unsigned int _buildNumber)#
Version(Version const&) = delete#
Version &operator=(Version const&) = delete#

Public Members

char const *const branchName#
unsigned int const buildNumber#
unsigned int const majorVersion#
unsigned int const minorVersion#
unsigned int const patchNumber#

Friends

friend std::ostream &operator<<(std::ostream &os, Version const &version)#
struct WaitForKeypress#

Public Types

enum When#

Values:

enumerator Never#
enumerator BeforeStart#
enumerator BeforeExit#
enumerator BeforeStartAndExit#
struct WarnAbout#

Public Types

enum What#

Values:

enumerator Nothing#
enumerator NoAssertions#

A test case or leaf section did not run any assertions.

enumerator UnmatchedTestSpec#

A command line test spec matched no test cases.

class WildcardPattern#

Public Functions

WildcardPattern(std::string const &pattern, CaseSensitive caseSensitivity)#
bool matches(std::string const &str) const#

Private Types

enum WildcardPosition#

Values:

enumerator NoWildcard#
enumerator WildcardAtStart#
enumerator WildcardAtEnd#
enumerator WildcardAtBothEnds#

Private Functions

std::string normaliseString(std::string const &str) const#

Private Members

CaseSensitive m_caseSensitivity#
std::string m_pattern#
WildcardPosition m_wildcard = NoWildcard#
class WithinAbsMatcher : public Catch::Matchers::MatcherBase<double>#

Public Functions

WithinAbsMatcher(double target, double margin)#
virtual std::string describe() const override#
virtual bool match(double const &matchee) const override#

Private Members

double m_margin#
double m_target#
class WithinRelMatcher : public Catch::Matchers::MatcherBase<double>#

Public Functions

WithinRelMatcher(double target, double epsilon)#
virtual std::string describe() const override#
virtual bool match(double const &matchee) const override#

Private Members

double m_epsilon#
double m_target#
class WithinUlpsMatcher : public Catch::Matchers::MatcherBase<double>#

Public Functions

WithinUlpsMatcher(double target, uint64_t ulps, Detail::FloatingPointKind baseType)#
virtual std::string describe() const override#
virtual bool match(double const &matchee) const override#

Private Members

double m_target#
Detail::FloatingPointKind m_type#
uint64_t m_ulps#
class XmlEncode#

Helper for XML-encoding text (escaping angle brackets, quotes, etc)

Note: doesn’t take ownership of passed strings, and thus the encoded string must outlive the encoding instance.

Public Types

enum ForWhat#

Values:

enumerator ForTextNodes#
enumerator ForAttributes#

Public Functions

XmlEncode(StringRef str, ForWhat forWhat = ForTextNodes)#
void encodeTo(std::ostream &os) const#

Private Members

ForWhat m_forWhat#
StringRef m_str#

Friends

friend std::ostream &operator<<(std::ostream &os, XmlEncode const &xmlEncode)#
class XmlReporter : public Catch::StreamingReporterBase#

Public Functions

XmlReporter(ReporterConfig &&_config)#
~XmlReporter() override#
virtual void assertionEnded(AssertionStats const &assertionStats) override#

Called after assertion was fully evaluated.

virtual void assertionStarting(AssertionInfo const&) override#

Called before assertion success/failure is evaluated.

virtual void benchmarkEnded(BenchmarkStats<> const&) override#

Called with the benchmark results if benchmark successfully finishes.

virtual void benchmarkFailed(StringRef error) override#

Called if running the benchmarks fails for any reason.

virtual void benchmarkPreparing(StringRef name) override#

Called when user-code is being probed before the actual benchmark runs.

virtual void benchmarkStarting(BenchmarkInfo const&) override#

Called after probe but before the user-code is being benchmarked.

virtual std::string getStylesheetRef() const#
virtual void listListeners(std::vector<ListenerDescription> const &descriptions) override#

Provides a simple default listing of listeners.

Looks similarly to listing of reporters, but with listener type instead of reporter name.

virtual void listReporters(std::vector<ReporterDescription> const &descriptions) override#

Provides a simple default listing of reporters.

Should look roughly like the reporter listing in v2 and earlier versions of Catch2.

virtual void listTags(std::vector<TagInfo> const &tags) override#

Provides a simple default listing of tags.

Should look roughly like the tag listing in v2 and earlier versions of Catch2.

virtual void listTests(std::vector<TestCaseHandle> const &tests) override#

Provides a simple default listing of tests.

Should look roughly like the test listing in v2 and earlier versions of Catch2. Especially supports low-verbosity listing that mimics the old --list-test-names-only output.

virtual void sectionEnded(SectionStats const &sectionStats) override#

Called after a SECTION has finished running.

virtual void sectionStarting(SectionInfo const &sectionInfo) override#

Called when a SECTION is being entered. Not called for skipped sections.

virtual void testCaseEnded(TestCaseStats const &testCaseStats) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testCaseStarting(TestCaseInfo const &testInfo) override#

Called once for each TEST_CASE, no matter how many times it is entered.

virtual void testRunEnded(TestRunStats const &testRunStats) override#

Called once after all tests in a testing run are finished.

Not called if tests weren’t run (e.g. only listings happened)

virtual void testRunStarting(TestRunInfo const &testInfo) override#

Called once in a testing run before tests are started.

Not called if tests won’t be run (e.g. only listing will happen)

void writeSourceInfo(SourceLineInfo const &sourceInfo)#

Public Static Functions

static std::string getDescription()#

Private Members

int m_sectionDepth = 0#
Timer m_testCaseTimer#
XmlWriter m_xml#
class XmlWriter#

Public Functions

XmlWriter(std::ostream &os)#
XmlWriter(XmlWriter const&) = delete#
~XmlWriter()#
XmlWriter &endElement(XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent)#
void ensureTagClosed()#
XmlWriter &operator=(XmlWriter const&) = delete#
ScopedElement scopedElement(std::string const &name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent)#
XmlWriter &startElement(std::string const &name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent)#
XmlWriter &writeAttribute(StringRef name, bool attribute)#

Writes the attribute as “true/false”.

XmlWriter &writeAttribute(StringRef name, char const *attribute)#

The attribute content is XML-encoded.

XmlWriter &writeAttribute(StringRef name, StringRef attribute)#

The attribute content is XML-encoded.

template<typename T, typename = typename std::enable_if_t<!std::is_convertible<T, StringRef>::value>>
inline XmlWriter &writeAttribute(StringRef name, T const &attribute)#

The attribute value must provide op<<(ostream&, T).

The resulting serialization is XML-encoded

XmlWriter &writeComment(StringRef text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent)#

Writes XML comment as “<!– text –>”.

void writeStylesheetRef(StringRef url)#
XmlWriter &writeText(StringRef text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent)#

Writes escaped text in a element.

Private Functions

void applyFormatting(XmlFormatting fmt)#
void newlineIfNecessary()#
void writeDeclaration()#

Private Members

std::string m_indent#
bool m_needsNewline = false#
std::ostream &m_os#
bool m_tagIsOpen = false#
std::vector<std::string> m_tags#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace Catch#

Typedefs

using exceptionTranslateFunction = std::string (*)()#
using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>#
template<typename Func, typename ...U>
using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::result_of_t<Func(U...)>>>#
typedef Detail::unique_ptr<IEventListener> IEventListenerPtr#
typedef Detail::unique_ptr<IReporterFactory> IReporterFactoryPtr#
using RegistryHubSingleton = Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>#
using StringMatcher = Matchers::MatcherBase<std::string>#

Enums

enum class CaseSensitive#

Values:

enumerator Yes#
enumerator No#
enum class ColourMode : std::uint8_t#

Values:

enumerator PlatformDefault#

Let Catch2 pick implementation based on platform detection.

enumerator ANSI#

Use ANSI colour code escapes.

enumerator Win32#

Use Win32 console colour API.

enumerator None#

Don’t use any colour.

enum class GenerateFrom#

Values:

enumerator Time#
enumerator RandomDevice#
enumerator Default#

Currently equivalent to RandomDevice, but can change at any point.

enum class ShowDurations#

Values:

enumerator DefaultForReporter#
enumerator Always#
enumerator Never#
enum class TestCaseProperties : uint8_t#

Values:

enumerator None#
enumerator IsHidden#
enumerator ShouldFail#
enumerator MayFail#
enumerator Throws#
enumerator NonPortable#
enumerator Benchmark#
enum class TestRunOrder#

Values:

enumerator Declared#
enumerator LexicographicallySorted#
enumerator Randomized#
enum class Verbosity#

Values:

enumerator Quiet#
enumerator Normal#
enumerator High#
enum class XmlFormatting#

Values:

enumerator None#
enumerator Indent#
enumerator Newline#

Functions

void addSingleton(ISingleton *singleton)#
std::ostream &cerr()#
void cleanUp()#
void cleanUpContext()#
void cleanupSingletons()#
std::ostream &clog()#
bool contains(std::string const &s, std::string const &infix)#
std::ostream &cout()#
template<typename Container>
Container createShard(Container const &container, std::size_t const shardCount, std::size_t const shardIndex)#
void defaultListListeners(std::ostream &out, std::vector<ListenerDescription> const &descriptions)#

Lists listeners descriptions to the provided stream in user-friendly format.

void defaultListReporters(std::ostream &out, std::vector<ReporterDescription> const &descriptions, Verbosity verbosity)#

Lists reporter descriptions to the provided stream in user-friendly format.

Used as the default listing implementation by the first party reporter bases. The output should be backwards compatible with the output of Catch2 v2 binaries.

void defaultListTags(std::ostream &out, std::vector<TagInfo> const &tags, bool isFiltered)#

Lists tag information to the provided stream in user-friendly format.

Used as the default listing implementation by the first party reporter bases. The output should be backwards compatible with the output of Catch2 v2 binaries.

void defaultListTests(std::ostream &out, ColourImpl *streamColour, std::vector<TestCaseHandle> const &tests, bool isFiltered, Verbosity verbosity)#

Lists test case information to the provided stream in user-friendly format.

Used as the default listing implementation by the first party reporter bases. The output is backwards compatible with the output of Catch2 v2 binaries, and also supports the format specific to the old --list-test-names-only option, for people who used it in integrations.

bool endsWith(std::string const &s, char suffix)#
bool endsWith(std::string const &s, std::string const &suffix)#
std::vector<TestCaseHandle> filterTests(std::vector<TestCaseHandle> const &testCases, TestSpec const &testSpec, IConfig const &config)#
void formatReconstructedExpression(std::ostream &os, std::string const &lhs, StringRef op, std::string const &rhs)#
std::uint32_t generateRandomSeed(GenerateFrom from)#
std::vector<TestCaseHandle> const &getAllTestCasesSorted(IConfig const &config)#
inline Context const &getCurrentContext()#
Context &getCurrentMutableContext()#
std::string getFormattedDuration(double duration)#
IMutableRegistryHub &getMutableRegistryHub()#
IRegistryHub const &getRegistryHub()#
IResultCapture &getResultCapture()#
std::uint32_t getSeed()#

Returns Catch2’s current RNG seed.

void handleExceptionMatchExpr(AssertionHandler &handler, std::string const &str)#
void handleExceptionMatchExpr(AssertionHandler &handler, StringMatcher const &matcher)#
bool isColourImplAvailable(ColourMode colourSelection)#

Checks if specific colour impl has been compiled into the binary.

bool isDebuggerActive()#
inline bool isFalseTest(int flags)#
bool isJustInfo(int flags)#
bool isnan(double d)#
bool isnan(float f)#
bool isOk(ResultWas::OfType resultType)#
bool isThrowSafe(TestCaseHandle const &testCase, IConfig const &config)#
Version const &libraryVersion()#
bool list(IEventListener &reporter, Config const &config)#
Detail::unique_ptr<ColourImpl> makeColourImpl(ColourMode colourSelection, IStream *stream)#

Provides ColourImpl based on global config and target compilation platform.

Clara::Parser makeCommandLineParser(ConfigData &config)#
template<typename ArgT, typename MatcherT>
auto makeMatchExpr(ArgT &&arg, MatcherT const &matcher) -> MatchExpr<ArgT, MatcherT>#
auto makeStream(std::string const &filename) -> Detail::unique_ptr<IStream>#

Creates a stream wrapper that writes to specific file.

Also recognizes 4 special filenames

  • - for stdout

  • stdout for stdout

  • stderr for stderr

  • debug for platform specific debugging output

Throws:

if – passed an unrecognized %-prefixed stream

Detail::unique_ptr<TestCaseInfo> makeTestCaseInfo(StringRef _className, NameAndTags const &nameAndTags, SourceLineInfo const &_lineInfo)#
Detail::unique_ptr<ITestInvoker> makeTestInvoker(void (*testAsFunction)())#
template<typename C>
Detail::unique_ptr<ITestInvoker> makeTestInvoker(void (C::* testAsMethod)())#
bool operator!=(SimplePcg32 const &lhs, SimplePcg32 const &rhs)#
constexpr auto operator""_sr(char const *rawChars, std::size_t size) noexcept -> StringRef#
XmlFormatting operator&(XmlFormatting lhs, XmlFormatting rhs)#
std::string operator+(StringRef lhs, StringRef rhs)#
auto operator+=(std::string &lhs, StringRef rhs) -> std::string&#
bool operator<(Tag const &lhs, Tag const &rhs)#
bool operator<(TestCaseInfo const &lhs, TestCaseInfo const &rhs)#
auto operator<<(std::ostream &os, LazyExpression const &lazyExpr) -> std::ostream&#
std::ostream &operator<<(std::ostream &os, pluralise const &pluraliser)#
std::ostream &operator<<(std::ostream &os, SourceLineInfo const &info)#
auto operator<<(std::ostream &os, StringRef str) -> std::ostream&#
std::ostream &operator<<(std::ostream &os, Version const &version)#
std::ostream &operator<<(std::ostream &os, XmlEncode const &xmlEncode)#
std::ostream &operator<<(std::ostream &out, lineOfChars value)#
bool operator==(ProcessedReporterSpec const &lhs, ProcessedReporterSpec const &rhs)#
bool operator==(ReporterSpec const &lhs, ReporterSpec const &rhs)#
bool operator==(SimplePcg32 const &lhs, SimplePcg32 const &rhs)#
bool operator==(Tag const &lhs, Tag const &rhs)#
ResultDisposition::Flags operator|(ResultDisposition::Flags lhs, ResultDisposition::Flags rhs)#
XmlFormatting operator|(XmlFormatting lhs, XmlFormatting rhs)#
Optional<ReporterSpec> parseReporterSpec(StringRef reporterSpec)#

Parses provided reporter spec string into.

Returns empty optional on errors, e.g.

  • field that is not first and not a key+value pair

  • duplicated keys in kv pair

  • unknown catch reporter option

  • empty key/value in an custom kv pair

Optional<unsigned int> parseUInt(std::string const &input, int base = 10)#

Parses unsigned int from the input, using provided base.

Effectively a wrapper around std::stoul but with better error checking e.g. “-1” is rejected, instead of being parsed as UINT_MAX.

void printTestRunTotals(std::ostream &stream, ColourImpl &streamColour, Totals const &totals)#

Prints test run totals to the provided stream in user-friendly format.

Used by the console and compact reporters.

template<typename Range>
std::string rangeToString(Range const &range)#
template<typename Allocator>
std::string rangeToString(std::vector<bool, Allocator> const &v)#
bool replaceInPlace(std::string &str, std::string const &replaceThis, std::string const &withThis)#
unsigned int rngSeed()#
void seedRng(IConfig const &config)#
std::string serializeFilters(std::vector<std::string> const &filters)#
SimplePcg32 &sharedRng()#
bool shouldContinueOnFailure(int flags)#
bool shouldShowDuration(IConfig const &config, double duration)#

Should the reporter show duration of test given current configuration?

bool shouldSuppressFailure(int flags)#
std::vector<TestCaseHandle> sortTests(IConfig const &config, std::vector<TestCaseHandle> const &unsortedTestCases)#
std::vector<StringRef> splitStringRef(StringRef str, char delimiter)#
bool startsWith(std::string const &s, std::string const &prefix)#
bool startsWith(StringRef s, char prefix)#
void throw_domain_error(std::string const &msg)#
template<typename Ex>
void throw_exception(Ex const &e)#
void throw_logic_error(std::string const &msg)#
void throw_runtime_error(std::string const &msg)#
void throw_test_failure_exception()#

Outlines throwing of TestFailureException into a single TU.

Also handles CATCH_CONFIG_DISABLE_EXCEPTIONS for callers.

void throw_test_skip_exception()#

Outlines throwing of TestSkipException into a single TU.

Also handles CATCH_CONFIG_DISABLE_EXCEPTIONS for callers.

template<typename T>
std::string to_string(T const &t)#
char toLower(char c)#
std::string toLower(std::string const &s)#
void toLowerInPlace(std::string &s)#
std::string translateActiveException()#
std::string trim(std::string const &str)#

Returns a new string without whitespace at the start/end.

StringRef trim(StringRef ref)#

Returns a substring of the original ref without whitespace. Beware lifetimes!

template<typename FP>
uint64_t ulpDistance(FP lhs, FP rhs)#

Calculates the ULP distance between two floating point numbers.

The ULP distance of two floating point numbers is the count of valid floating point numbers representable between them.

There are some exceptions between how this function counts the distance, and the interpretation of the standard as implemented. by e.g. nextafter. For this function it always holds that:

  • (x == y) => ulpDistance(x, y) == 0 (so ulpDistance(-0, 0) == 0)

  • ulpDistance(maxFinite, INF) == 1

  • ulpDistance(x, -x) == 2 * ulpDistance(x, 0)

Pre:

!isnan( lhs )

Pre:

!isnan( rhs )

Pre:

floating point numbers are represented in IEEE-754 format

bool uncaught_exceptions()#
void writeToDebugConsole(std::string const &text)#

Variables

static CATCH_INTERNAL_START_WARNINGS_SUPPRESSION CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS LeakDetector leakDetector
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#

Enums

enum class Justification#

Values:

enumerator Left#
enumerator Right#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace Benchmark#

Typedefs

template<typename Clock>
using ClockDuration = typename Clock::duration#
using default_clock = std::chrono::steady_clock#
template<typename T>
using destructable_object = Detail::ObjectStorage<T, false>#
template<typename Clock>
using FloatDuration = std::chrono::duration<double, typename Clock::period>#
using fp_seconds = std::chrono::duration<double, std::ratio<1>>#
template<typename T>
using storage_for = Detail::ObjectStorage<T, true>#
template<typename Clock>
using TimePoint = typename Clock::time_point#
template<typename Clock, typename Func, typename ...Args>
using TimingOf = Timing<ClockDuration<Clock>, Detail::CompleteType_t<FunctionReturnType<Func, Args...>>>#

Functions

template<typename T>
inline void deoptimize_value(T &&x)#
template<typename Fn, typename ...Args>
inline auto invoke_deoptimized(Fn &&fn, Args&&... args) -> std::enable_if_t<!std::is_same<void, decltype(fn(args...))>::value>#
template<typename Fun>
Detail::CompleteType_t<FunctionReturnType<Fun>> user_code(Fun &&fun)#
namespace Detail#

Typedefs

template<typename T>
using CompleteType_t = typename CompleteType<T>::type#
template<typename Clock, typename Fun>
using run_for_at_least_argument_t = std::conditional_t<is_callable<Fun(Chronometer)>::value, Chronometer, int>#
using sample = std::vector<double>#

Functions

template<typename Duration, typename Iterator>
SampleAnalysis<Duration> analyse(const IConfig &cfg, Environment<Duration>, Iterator first, Iterator last)#
bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last)#
template<typename Estimator>
Estimate<double> bootstrap(double confidence_level, std::vector<double>::iterator first, std::vector<double>::iterator last, sample const &resample, Estimator &&estimator)#
OutlierClassification classify_outliers(std::vector<double>::const_iterator first, std::vector<double>::const_iterator last)#
template<typename Fun, typename ...Args>
CompleteType_t<FunctionReturnType<Fun, Args...>> complete_invoke(Fun &&fun, Args&&... args)#
bool directCompare(double lhs, double rhs)#
double erfc_inv(double x)#
template<typename Clock>
EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_cost(FloatDuration<Clock> resolution)#
template<typename Clock>
EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_resolution(int iterations)#
template<typename Estimator>
sample jackknife(Estimator &&estimator, std::vector<double>::iterator first, std::vector<double>::iterator last)#
double mean(std::vector<double>::const_iterator first, std::vector<double>::const_iterator last)#
template<typename Clock, typename Fun, typename ...Args>
TimingOf<Clock, Fun, Args...> measure(Fun &&fun, Args&&... args)#
template<typename Clock>
Environment<FloatDuration<Clock>> measure_environment()#
template<typename Clock, typename Fun>
TimingOf<Clock, Fun, int> measure_one(Fun &&fun, int iters, std::false_type)#
template<typename Clock, typename Fun>
TimingOf<Clock, Fun, Chronometer> measure_one(Fun &&fun, int iters, std::true_type)#
inline double normal_cdf(double x)#
double normal_quantile(double p)#
template<typename Fun>
repeater<std::decay_t<Fun>> repeat(Fun &&fun)#
template<typename Clock>
std::vector<double> resolution(int k)#
template<typename Clock, typename Fun>
TimingOf<Clock, Fun, run_for_at_least_argument_t<Clock, Fun>> run_for_at_least(ClockDuration<Clock> how_long, const int initial_iterations, Fun &&fun)#
void throw_optimized_away_error()#
template<typename Clock>
int warmup()#
double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last)#

Variables

constexpr auto clock_cost_estimation_iterations = 10000#
constexpr auto clock_cost_estimation_tick_limit = 100000#
constexpr auto clock_cost_estimation_time = std::chrono::milliseconds(10)#
constexpr auto clock_cost_estimation_time_limit = std::chrono::seconds(1)#
constexpr auto clock_resolution_estimation_time = std::chrono::milliseconds(500)#
constexpr auto minimum_ticks = 1000#
constexpr auto warmup_iterations = 10000#
constexpr auto warmup_seed = 10000#
constexpr auto warmup_time = std::chrono::milliseconds(100)#
namespace [anonymous]#
namespace Clara#

Enums

enum class ParseResultType#

Values:

enumerator Matched#
enumerator NoMatch#
enumerator ShortCircuitAll#
enumerator ShortCircuitSame#

Variables

constexpr accept_many_t accept_many = {}#
namespace Detail#

Typedefs

using InternalParseResult = BasicResult<ParseState>#
using ParserResult = BasicResult<ParseResultType>#
using Result = BasicResult<void>#

Enums

enum class Optionality#

Values:

enumerator Optional#
enumerator Required#
enum class ResultType#

Denotes type of a parsing result.

Values:

enumerator Ok#

No errors.

enumerator LogicError#

Error in user-specified arguments for construction.

enumerator RuntimeError#

Error in parsing inputs.

enum class TokenType#

Values:

enumerator Option#
enumerator Argument#

Functions

ParserResult convertInto(std::string const &source, bool &target)#
ParserResult convertInto(std::string const &source, std::string &target)#
template<typename T>
ParserResult convertInto(std::string const &source, T &target)#
template<typename ArgType, typename L>
auto invokeLambda(L const &lambda, std::string const &arg) -> ParserResult#
namespace Detail#

Typedefs

template<typename ...Ts>
using void_t = typename make_void<Ts...>::type#

Functions

inline std::size_t catch_strnlen(const char *str, std::size_t n)#
template<typename ForwardIter1, typename Sentinel1, typename ForwardIter2, typename Sentinel2, typename Comparator>
bool check_element_counts(ForwardIter1 first_1, const Sentinel1 end_1, ForwardIter2 first_2, const Sentinel2 end_2, Comparator cmp)#
std::string convertIntoString(StringRef string)#

Encases string in quotes, and escapes invisibles if user requested it via CLI.

std::string convertIntoString(StringRef string, bool escapeInvisibles)#

Encases `string in quotes, and optionally escapes invisibles.

uint64_t convertToBits(double d)#
uint32_t convertToBits(float f)#
template<typename E>
std::string convertUnknownEnumToString(E e)#
template<typename T>
std::enable_if_t<!std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value, std::string> convertUnstreamable(T const&)#
template<typename T>
std::enable_if_t<!std::is_enum<T>::value && std::is_base_of<std::exception, T>::value, std::string> convertUnstreamable(T const &ex)#
template<typename T>
std::enable_if_t<std::is_enum<T>::value, std::string> convertUnstreamable(T const &value)#
template<typename ForwardIter, typename Sentinel, typename T, typename Comparator>
std::ptrdiff_t count_sentinel(ForwardIter start, Sentinel sentinel, T const &value, Comparator cmp)#
template<typename T, std::size_t N>
constexpr bool empty(const T (&)[N]) noexcept#
template<typename Container>
constexpr auto empty(Container const &cont) -> decltype(cont.empty())#
template<typename T>
constexpr bool empty(std::initializer_list<T> list) noexcept#
template<typename ForwardIter, typename Sentinel, typename T, typename Comparator>
ForwardIter find_sentinel(ForwardIter start, Sentinel sentinel, T const &value, Comparator cmp)#
char const *getEnv(char const *varName)#

Wrapper over std::getenv that compiles on UWP (and always returns nullptr there)

template<typename ForwardIter1, typename Sentinel1, typename ForwardIter2, typename Sentinel2, typename Comparator>
bool is_permutation(ForwardIter1 first_1, const Sentinel1 end_1, ForwardIter2 first_2, const Sentinel2 end_2, Comparator cmp)#
template<typename T, typename ...Args>
unique_ptr<T> make_unique(Args&&... args)#
Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo(StringRef enumName, StringRef allValueNames, std::vector<int> const &values)#
std::vector<StringRef> parseEnums(StringRef enums)#
template<typename InputIterator, typename Sentinel = InputIterator>
std::string rangeToString(InputIterator first, Sentinel last)#
template<typename T>
std::string rawMemoryToString(const T &object)#
std::string rawMemoryToString(const void *object, std::size_t size)#
void registerListenerImpl(Detail::unique_ptr<EventListenerFactory> listenerFactory)#

Actually registers the factory, independent on listener’s concrete type.

void registerReporterImpl(std::string const &name, IReporterFactoryPtr reporterPtr)#

Indirection for reporter registration, so that the error handling is independent on the reporter’s concrete type.

void registerTranslatorImpl(Detail::unique_ptr<IExceptionTranslator> &&translator)#
template<typename ForwardIter>
std::ptrdiff_t sentinel_distance(ForwardIter first, ForwardIter last)#
template<typename ForwardIter, typename Sentinel>
std::enable_if_t<!std::is_same<ForwardIter, Sentinel>::value, std::ptrdiff_t> sentinel_distance(ForwardIter iter, const Sentinel sentinel)#
template<typename T, std::size_t N>
constexpr std::size_t size(const T (&)[N]) noexcept#
template<typename Container>
constexpr auto size(Container const &cont) -> decltype(cont.size())#
std::vector<std::string> splitReporterSpec(StringRef reporterSpec)#

Splits the reporter spec into reporter name and kv-pair options.

template<typename T>
std::string stringify(const T &e)#
Optional<ColourMode> stringToColourMode(StringRef colourMode)#

Variables

constexpr StringRef unprintableString = "{?}"_sr#
namespace [anonymous]#
namespace [anonymous]#
namespace [anonymous]#
namespace Generators#

Typedefs

typedef Catch::Detail::unique_ptr<GeneratorUntypedBase> GeneratorBasePtr#
template<typename T>
using GeneratorPtr = Catch::Detail::unique_ptr<IGenerator<T>>#

Functions

IGeneratorTracker *acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const &lineInfo)#
template<typename T>
GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T> &&generator)#
IGeneratorTracker *createGeneratorTracker(StringRef generatorName, SourceLineInfo lineInfo, GeneratorBasePtr &&generator)#
template<typename T, typename Predicate>
GeneratorWrapper<T> filter(Predicate &&pred, GeneratorWrapper<T> &&generator)#
template<typename Container, typename ResultType = typename Container::value_type>
GeneratorWrapper<ResultType> from_range(Container const &cnt)#
template<typename InputIterator, typename InputSentinel, typename ResultType = typename std::iterator_traits<InputIterator>::value_type>
GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to)#
template<typename L> auto generate (StringRef generatorName, SourceLineInfo const &lineInfo, L const &generatorExpression) -> typename decltype(generatorExpression())::type
template<typename T, typename U, typename ...Gs>
auto makeGenerators(as<T>, U &&val, Gs&&... moreGenerators) -> Generators<T>#
template<typename T>
auto makeGenerators(GeneratorWrapper<T> &&generator) -> Generators<T>#
template<typename T, typename ...Gs>
auto makeGenerators(GeneratorWrapper<T> &&generator, Gs&&... moreGenerators) -> Generators<T>#
template<typename T, typename ...Gs>
auto makeGenerators(T &&val, Gs&&... moreGenerators) -> Generators<std::decay_t<T>>#
template<typename Func, typename U, typename T = FunctionReturnType<Func, U>>
GeneratorWrapper<T> map(Func &&function, GeneratorWrapper<U> &&generator)#
template<typename T>
std::enable_if_t<std::is_integral<T>::value, GeneratorWrapper<T>> random(T a, T b)#
template<typename T>
std::enable_if_t<std::is_floating_point<T>::value, GeneratorWrapper<T>> random(T a, T b)#
template<typename T>
GeneratorWrapper<T> range(T const &start, T const &end)#
template<typename T>
GeneratorWrapper<T> range(T const &start, T const &end, T const &step)#
template<typename T>
GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T> &&generator)#
template<typename ...Ts>
GeneratorWrapper<std::tuple<std::decay_t<Ts>...>> table(std::initializer_list<std::tuple<std::decay_t<Ts>...>> tuples)#
template<typename T>
GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T> &&generator)#
template<typename T, typename DecayedT = std::decay_t<T>>
GeneratorWrapper<DecayedT> value(T &&value)#
template<typename T>
GeneratorWrapper<T> values(std::initializer_list<T> values)#
namespace [anonymous]#
namespace Detail#

Functions

std::uint32_t getSeed()#
void throw_generator_exception(char const *msg)#

Throws GeneratorException with the provided message.

namespace literals#

Functions

Approx operator""_a(long double val)#
Approx operator""_a(unsigned long long val)#
namespace Matchers#

Functions

template<typename Matcher>
AllMatchMatcher<Matcher> AllMatch(Matcher &&matcher)#
AllTrueMatcher AllTrue()#
template<typename Matcher>
AnyMatchMatcher<Matcher> AnyMatch(Matcher &&matcher)#
AnyTrueMatcher AnyTrue()#
template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
ApproxMatcher<T, AllocComp, AllocMatch> Approx(std::vector<T, AllocComp> const &comparator)#

Creates a matcher that matches vectors that comparator as an element.

template<typename Matcher>
std::enable_if_t<Detail::is_matcher<Matcher>::value, ContainsMatcherMatcher<Matcher>> Contains(Matcher &&matcher)#

Creates a matcher that checks whether a range contains element matching a matcher.

template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
ContainsMatcher<T, AllocComp, AllocMatch> Contains(std::vector<T, AllocComp> const &comparator)#

Creates a matcher that matches vectors that contain all elements in comparator

template<typename T>
std::enable_if_t<!Detail::is_matcher<T>::value, ContainsElementMatcher<T, std::equal_to<>>> Contains(T &&elem)#

Creates a matcher that checks whether a range contains a specific element.

Uses std::equal_to to do the comparison

template<typename T, typename Equality>
ContainsElementMatcher<T, Equality> Contains(T &&elem, Equality &&eq)#

Creates a matcher that checks whether a range contains a specific element.

Uses eq to do the comparisons, the element is provided on the rhs

StringContainsMatcher ContainsSubstring(std::string const &str, CaseSensitive caseSensitivity = CaseSensitive::Yes)#

Creates matcher that accepts strings that contain str

EndsWithMatcher EndsWith(std::string const &str, CaseSensitive caseSensitivity = CaseSensitive::Yes)#

Creates matcher that accepts strings that end with str

StringEqualsMatcher Equals(std::string const &str, CaseSensitive caseSensitivity = CaseSensitive::Yes)#

Creates matcher that accepts strings that are exactly equal to str

template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
EqualsMatcher<T, AllocComp, AllocMatch> Equals(std::vector<T, AllocComp> const &comparator)#

Creates a matcher that matches vectors that are exactly equal to comparator

IsEmptyMatcher IsEmpty()#

Creates a matcher that accepts empty ranges/containers.

IsNaNMatcher IsNaN()#
RegexMatcher Matches(std::string const &regex, CaseSensitive caseSensitivity = CaseSensitive::Yes)#

Creates matcher that accepts strings matching regex

ExceptionMessageMatcher Message(std::string const &message)#

Creates a matcher that checks whether a std derived exception has the provided message.

template<typename StringMatcherType>
ExceptionMessageMatchesMatcher<StringMatcherType> MessageMatches(StringMatcherType &&matcher)#

Creates a matcher that checks whether a message from an std derived exception matches a provided matcher.

template<typename Matcher>
NoneMatchMatcher<Matcher> NoneMatch(Matcher &&matcher)#
NoneTrueMatcher NoneTrue()#
template<typename T>
Detail::MatchNotOf<T> operator!(MatcherBase<T> const &matcher)#
template<typename MatcherT>
std::enable_if_t<Detail::is_generic_matcher<MatcherT>::value, Detail::MatchNotOfGeneric<MatcherT>> operator!(MatcherT const &matcher)#

Wrap provided generic matcher in generic negator.

template<typename ArgLHS, typename MatcherRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>> operator&&(MatcherBase<ArgLHS> const &lhs, MatcherRHS const &rhs)#
template<typename T>
Detail::MatchAllOf<T> operator&&(MatcherBase<T> const &lhs, MatcherBase<T> const &rhs)#
template<typename MatcherLHS, typename ArgRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>> operator&&(MatcherLHS const &lhs, MatcherBase<ArgRHS> const &rhs)#
template<typename MatcherLHS, typename MatcherRHS>
std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherRHS>> operator&&(MatcherLHS const &lhs, MatcherRHS const &rhs)#
template<typename ArgLHS, typename MatcherRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>> operator||(MatcherBase<ArgLHS> const &lhs, MatcherRHS const &rhs)#
template<typename T>
Detail::MatchAnyOf<T> operator||(MatcherBase<T> const &lhs, MatcherBase<T> const &rhs)#
template<typename MatcherLHS, typename ArgRHS>
std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>> operator||(MatcherLHS const &lhs, MatcherBase<ArgRHS> const &rhs)#
template<typename MatcherLHS, typename MatcherRHS>
std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherRHS>> operator||(MatcherLHS const &lhs, MatcherRHS const &rhs)#
template<typename T, typename Pred>
PredicateMatcher<T, Pred> Predicate(Pred &&predicate, std::string const &description = "")#

Creates a matcher that calls delegates match to the provided predicate.

The user has to explicitly specify the argument type to the matcher

template<typename RangeLike>
std::enable_if_t<!Detail::is_matcher<RangeLike>::value, RangeEqualsMatcher<RangeLike, std::equal_to<>>> RangeEquals(RangeLike &&range)#

Creates a matcher that checks if all elements in a range are equal to all elements in another range.

Uses std::equal_to to do the comparison

template<typename RangeLike, typename Equality>
RangeEqualsMatcher<RangeLike, Equality> RangeEquals(RangeLike &&range, Equality &&predicate)#

Creates a matcher that checks if all elements in a range are equal to all elements in another range.

Uses to provided predicate predicate to do the comparisons

template<typename Matcher>
std::enable_if_t<Detail::is_matcher<Matcher>::value, SizeMatchesMatcher<Matcher>> SizeIs(Matcher &&m)#
HasSizeMatcher SizeIs(std::size_t sz)#

Creates a matcher that accepts ranges/containers with specific size.

StartsWithMatcher StartsWith(std::string const &str, CaseSensitive caseSensitivity = CaseSensitive::Yes)#

Creates matcher that accepts strings that start with str

template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
UnorderedEqualsMatcher<T, AllocComp, AllocMatch> UnorderedEquals(std::vector<T, AllocComp> const &target)#

Creates a matcher that matches vectors that is equal to target modulo permutation.

template<typename RangeLike>
std::enable_if_t<!Detail::is_matcher<RangeLike>::value, UnorderedRangeEqualsMatcher<RangeLike, std::equal_to<>>> UnorderedRangeEquals(RangeLike &&range)#

Creates a matcher that checks if all elements in a range are equal to all elements in another range, in some permutation.

Uses std::equal_to to do the comparison

template<typename RangeLike, typename Equality>
UnorderedRangeEqualsMatcher<RangeLike, Equality> UnorderedRangeEquals(RangeLike &&range, Equality &&predicate)#

Creates a matcher that checks if all elements in a range are equal to all elements in another range, in some permutation.

Uses to provided predicate predicate to do the comparisons

template<typename T, typename Alloc = std::allocator<T>>
VectorContainsElementMatcher<T, Alloc> VectorContains(T const &comparator)#

Creates a matcher that matches vectors that contain comparator as an element.

WithinAbsMatcher WithinAbs(double target, double margin)#

Creates a matcher that accepts numbers within certain range of target.

WithinRelMatcher WithinRel(double target)#

Creates a matcher that accepts doubles within 100*DBL_EPS relative range of target.

WithinRelMatcher WithinRel(double target, double eps)#

Creates a matcher that accepts doubles within certain relative range of target.

WithinRelMatcher WithinRel(float target)#

Creates a matcher that accepts floats within 100*FLT_EPS relative range of target.

WithinRelMatcher WithinRel(float target, float eps)#

Creates a matcher that accepts doubles within certain relative range of target.

WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff)#

Creates a matcher that accepts doubles within certain ULP range of target.

WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff)#

Creates a matcher that accepts floats within certain ULP range of target.

namespace Detail#

Typedefs

template<typename ...Ts>
using are_generic_matchers = Catch::Detail::conjunction<is_generic_matcher<Ts>...>#
template<typename T>
using is_generic_matcher = std::is_base_of<Catch::Matchers::MatcherGenericBase, std::remove_cv_t<std::remove_reference_t<T>>>#
template<typename T>
using is_matcher = std::is_base_of<Catch::Matchers::MatcherUntypedBase, std::remove_cv_t<std::remove_reference_t<T>>>#

Enums

enum class FloatingPointKind : uint8_t#

Values:

enumerator Float#
enumerator Double#

Functions

template<std::size_t N, std::size_t M>
std::array<void const*, N + M> array_cat(std::array<void const*, N> &&lhs, std::array<void const*, M> &&rhs)#
template<std::size_t N>
std::array<void const*, N + 1> array_cat(std::array<void const*, N> &&lhs, void const *rhs)#
template<std::size_t N>
std::array<void const*, N + 1> array_cat(void const *lhs, std::array<void const*, N> &&rhs)#
template<typename ...MatcherTs, std::size_t... Idx>
std::string describe_multi_matcher(StringRef combine, std::array<void const*, sizeof...(MatcherTs)> const &matchers, std::index_sequence<Idx...>)#
std::string describe_multi_matcher(StringRef combine, std::string const *descriptions_begin, std::string const *descriptions_end)#
std::string finalizeDescription(const std::string &desc)#
template<std::size_t N, typename Arg>
bool match_all_of(Arg&&, std::array<void const*, N> const&, std::index_sequence<>)#
template<typename T, typename ...MatcherTs, std::size_t N, typename Arg, std::size_t Idx, std::size_t... Indices>
bool match_all_of(Arg &&arg, std::array<void const*, N> const &matchers, std::index_sequence<Idx, Indices...>)#
template<std::size_t N, typename Arg>
bool match_any_of(Arg&&, std::array<void const*, N> const&, std::index_sequence<>)#
template<typename T, typename ...MatcherTs, std::size_t N, typename Arg, std::size_t Idx, std::size_t... Indices>
bool match_any_of(Arg &&arg, std::array<void const*, N> const &matchers, std::index_sequence<Idx, Indices...>)#
template<typename ArgT>
MatchAllOf<ArgT> operator&&(MatchAllOf<ArgT> const &lhs, MatcherBase<ArgT> const &rhs) = delete#

lvalue overload is intentionally deleted, users should not be trying to compose stored composition matchers

template<typename ArgT>
MatchAllOf<ArgT> operator&&(MatcherBase<ArgT> const &lhs, MatchAllOf<ArgT> const &rhs) = delete#

lvalue overload is intentionally deleted, users should not be trying to compose stored composition matchers

template<typename ArgT>
MatchAnyOf<ArgT> operator||(MatchAnyOf<ArgT> const &lhs, MatcherBase<ArgT> const &rhs) = delete#

lvalue overload is intentionally deleted, users should not be trying to compose stored composition matchers

template<typename ArgT>
MatchAnyOf<ArgT> operator||(MatcherBase<ArgT> const &lhs, MatchAnyOf<ArgT> const &rhs) = delete#

lvalue overload is intentionally deleted, users should not be trying to compose stored composition matchers

namespace TestCaseTracking#

Typedefs

using ITrackerPtr = Catch::Detail::unique_ptr<ITracker>#
namespace TextFlow#

Functions

std::ostream &operator<<(std::ostream &os, Column const &col)#
std::ostream &operator<<(std::ostream &os, Columns const &cols)#
Column Spacer(size_t spaceWidth)#

Creates a column that serves as an empty space of specific width.

namespace decltypeis_callable_tester#
namespace mpl_#
namespace std#

STL namespace.

file catch_benchmark.hpp
#include <catch2/catch_user_config.hpp>
#include <algorithm>
#include <chrono>
#include <exception>
#include <functional>
#include <string>
#include <vector>
#include <cmath>

Defines

BENCHMARK(...)#
BENCHMARK_ADVANCED(name)#
INTERNAL_CATCH_BENCHMARK(BenchmarkName, name, benchmarkIndex)#
INTERNAL_CATCH_BENCHMARK_ADVANCED(BenchmarkName, name)#
INTERNAL_CATCH_GET_1_ARG(arg1, arg2, ...)#
INTERNAL_CATCH_GET_2_ARG(arg1, arg2, ...)#
file catch_benchmark_all.hpp

This is a convenience header for Catch2’s benchmarking.

It includes all of Catch2 headers related to benchmarking.

Generally the Catch2 users should use specific includes they need, but this header can be used instead for ease-of-experimentation, or just plain convenience, at the cost of (significantly) increased compilation times.

When a new header is added to either the benchmark folder, or to the corresponding internal (detail) subfolder, it should be added here.

file catch_chronometer.cpp
file catch_chronometer.hpp
file catch_clock.hpp
#include <chrono>
#include <ratio>
file catch_constructor.hpp
#include <type_traits>
file catch_environment.hpp
file catch_estimate.hpp
file catch_execution_plan.hpp
#include <vector>
file catch_optimizer.hpp
#include <type_traits>
file catch_outlier_classification.hpp
file catch_sample_analysis.hpp
#include <vector>
file catch_analyse.hpp
#include <vector>
file catch_benchmark_function.cpp
file catch_benchmark_function.hpp
#include <type_traits>
file catch_benchmark_stats.hpp
#include <string>
#include <vector>
file catch_benchmark_stats_fwd.hpp
#include <chrono>
file catch_complete_invoke.hpp
file catch_estimate_clock.hpp
#include <algorithm>
#include <vector>
#include <cmath>
file catch_measure.hpp
file catch_repeat.hpp
#include <type_traits>
file catch_run_for_at_least.cpp
#include <exception>
file catch_run_for_at_least.hpp
#include <type_traits>
file catch_stats.cpp
#include <cassert>
#include <cstddef>
#include <numeric>
#include <random>
file catch_stats.hpp
#include <algorithm>
#include <vector>
#include <cmath>
file catch_timing.hpp
#include <type_traits>
file catch_all.hpp

This is a convenience header for Catch2.

It includes all of Catch2 headers.

Generally the Catch2 users should use specific includes they need, but this header can be used instead for ease-of-experimentation, or just plain convenience, at the cost of (significantly) increased compilation times.

When a new header is added to either the top level folder, or to the corresponding internal subfolder, it should be added here. Headers added to the various subparts (e.g. matchers, generators, etc…), should go their respective catch-all headers.

file catch_approx.cpp
#include <cmath>
#include <limits>
file catch_approx.hpp
#include <type_traits>
file catch_assertion_info.hpp
file catch_assertion_result.cpp
file catch_assertion_result.hpp
#include <string>
file catch_config.cpp
#include <catch2/catch_user_config.hpp>
#include <fstream>
file catch_config.hpp
#include <chrono>
#include <map>
#include <string>
#include <vector>
file catch_get_random_seed.cpp
file catch_get_random_seed.hpp
#include <cstdint>
file catch_message.cpp
#include <cassert>
#include <stack>
file catch_message.hpp
#include <string>
#include <vector>

Defines

CAPTURE(...)#
INFO(msg)#
INTERNAL_CATCH_CAPTURE(varName, macroName, ...)#
INTERNAL_CATCH_INFO(macroName, log)#
INTERNAL_CATCH_MSG(macroName, messageType, resultDisposition, ...)#
INTERNAL_CATCH_UNSCOPED_INFO(macroName, log)#
UNSCOPED_INFO(msg)#
WARN(msg)#
file catch_registry_hub.cpp
#include <exception>
file catch_section_info.hpp
#include <string>
file catch_session.cpp
#include <algorithm>
#include <cassert>
#include <exception>
#include <iomanip>
#include <set>
file catch_session.hpp
file catch_tag_alias.hpp
#include <string>
file catch_tag_alias_autoregistrar.cpp
file catch_tag_alias_autoregistrar.hpp

Defines

CATCH_REGISTER_TAG_ALIAS(alias, spec)#
file catch_template_test_macros.hpp

Defines

TEMPLATE_LIST_TEST_CASE(...)#
TEMPLATE_LIST_TEST_CASE_METHOD(className, ...)#
TEMPLATE_PRODUCT_TEST_CASE(...)#
TEMPLATE_PRODUCT_TEST_CASE_METHOD(className, ...)#
TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(className, ...)#
TEMPLATE_PRODUCT_TEST_CASE_SIG(...)#
TEMPLATE_TEST_CASE(...)#
TEMPLATE_TEST_CASE_METHOD(className, ...)#
TEMPLATE_TEST_CASE_METHOD_SIG(className, ...)#
TEMPLATE_TEST_CASE_SIG(...)#
file catch_test_case_info.cpp
#include <cassert>
#include <cctype>
#include <algorithm>
file catch_test_case_info.hpp
#include <cstdint>
#include <string>
#include <vector>
file catch_test_macros.hpp
#include <catch2/catch_user_config.hpp>

Defines

AND_GIVEN(desc)#
AND_THEN(desc)#
AND_WHEN(desc)#
CHECK(...)#
CHECK_FALSE(...)#
CHECK_NOFAIL(...)#
CHECK_NOTHROW(...)#
CHECK_THROWS(...)#
CHECK_THROWS_AS(expr, exceptionType)#
CHECKED_ELSE(...)#
CHECKED_IF(...)#
DYNAMIC_SECTION(...)#
FAIL(...)#
FAIL_CHECK(...)#
GIVEN(desc)#
METHOD_AS_TEST_CASE(method, ...)#
REGISTER_TEST_CASE(Function, ...)#
REQUIRE(...)#
REQUIRE_FALSE(...)#
REQUIRE_NOTHROW(...)#
REQUIRE_THROWS(...)#
REQUIRE_THROWS_AS(expr, exceptionType)#
SCENARIO(...)#
SCENARIO_METHOD(className, ...)#
SECTION(...)#
SKIP(...)#
STATIC_CHECK(...)#
STATIC_CHECK_FALSE(...)#
STATIC_REQUIRE(...)#
STATIC_REQUIRE_FALSE(...)#
SUCCEED(...)#
TEST_CASE(...)#
TEST_CASE_METHOD(className, ...)#
THEN(desc)#
WHEN(desc)#
file catch_test_spec.cpp
#include <algorithm>
#include <string>
#include <vector>
#include <ostream>
file catch_test_spec.hpp
#include <iosfwd>
#include <string>
#include <vector>
file catch_timer.cpp
#include <chrono>
file catch_timer.hpp
#include <cstdint>
file catch_tostring.cpp
#include <cmath>
#include <iomanip>
file catch_tostring.hpp
#include <vector>
#include <cstddef>
#include <type_traits>
#include <string>
#include <ctime>
#include <ratio>
#include <chrono>

Defines

CATCH_REGISTER_ENUM(enumName, ...)#
INTERNAL_CATCH_REGISTER_ENUM(enumName, ...)#

Functions

std::ostream &operator<<(std::ostream&, Catch_global_namespace_dummy)#
file catch_totals.cpp
file catch_totals.hpp
#include <cstdint>
file catch_translate_exception.cpp
file catch_translate_exception.hpp
#include <exception>

Defines

CATCH_TRANSLATE_EXCEPTION(signature)#
INTERNAL_CATCH_TRANSLATE_EXCEPTION(signature)#
INTERNAL_CATCH_TRANSLATE_EXCEPTION2(translatorName, signature)#
file catch_version.cpp
#include <ostream>
file catch_version.hpp
#include <iosfwd>
file catch_version_macros.hpp

Defines

CATCH_VERSION_MAJOR#
CATCH_VERSION_MINOR#
CATCH_VERSION_PATCH#
file catch_generator_exception.cpp
file catch_generator_exception.hpp
#include <exception>
file catch_generators.cpp
file catch_generators.hpp
#include <vector>
#include <tuple>

Defines

CATCH_INTERNAL_GENERATOR_STRINGIZE(...)#
CATCH_INTERNAL_GENERATOR_STRINGIZE_IMPL(...)#
GENERATE(...)#
GENERATE_COPY(...)#
GENERATE_REF(...)#
file catch_generators_adapters.hpp
#include <cassert>
file catch_generators_all.hpp

This is a convenience header for Catch2’s Generator support.

It includes all of Catch2 headers related to generators.

Generally the Catch2 users should use specific includes they need, but this header can be used instead for ease-of-experimentation, or just plain convenience, at the cost of (significantly) increased compilation times.

When a new header is added to either the generators folder, or to the corresponding internal subfolder, it should be added here.

file catch_generators_random.cpp
file catch_generators_random.hpp
#include <random>
file catch_generators_range.hpp
#include <iterator>
#include <type_traits>
file catch_interfaces_all.hpp

This is a convenience header for Catch2’s interfaces.

It includes all of Catch2 headers related to interfaces.

Generally the Catch2 users should use specific includes they need, but this header can be used instead for ease-of-experimentation, or just plain convenience, at the cost of somewhat increased compilation times.

When a new header is added to either the interfaces folder, or to the corresponding internal subfolder, it should be added here.

file catch_interfaces_capture.cpp
file catch_interfaces_capture.hpp
#include <string>
#include <chrono>
file catch_interfaces_config.cpp
file catch_interfaces_config.hpp
#include <chrono>
#include <iosfwd>
#include <string>
#include <vector>
file catch_interfaces_enum_values_registry.hpp
#include <vector>
file catch_interfaces_exception.cpp
file catch_interfaces_exception.hpp
#include <string>
#include <vector>
file catch_interfaces_generatortracker.cpp
#include <string>
file catch_interfaces_generatortracker.hpp
#include <string>
file catch_interfaces_registry_hub.cpp
file catch_interfaces_registry_hub.hpp
#include <string>
file catch_interfaces_reporter.cpp
#include <algorithm>
#include <cassert>
#include <iomanip>
file catch_interfaces_reporter.hpp
#include <map>
#include <string>
#include <vector>
#include <iosfwd>
file catch_interfaces_reporter_factory.cpp
file catch_interfaces_reporter_factory.hpp
#include <string>
file catch_interfaces_tag_alias_registry.hpp
#include <string>
file catch_interfaces_test_invoker.hpp
file catch_interfaces_testcase.cpp
file catch_interfaces_testcase.hpp
#include <vector>
file catch_assertion_handler.cpp
file catch_assertion_handler.hpp
#include <string>
file catch_case_insensitive_comparisons.cpp
#include <algorithm>
file catch_case_insensitive_comparisons.hpp
file catch_case_sensitive.hpp
file catch_clara.cpp
#include <algorithm>
#include <ostream>
file catch_clara.hpp
#include <cassert>
#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
file catch_commandline.cpp
#include <fstream>
#include <string>
file catch_commandline.hpp
file catch_compare_traits.hpp
#include <type_traits>

Defines

CATCH_DEFINE_COMPARABLE_TRAIT(id, op)#
file catch_compiler_capabilities.hpp
#include <catch2/catch_user_config.hpp>

Defines

CATCH_CATCH_ALL#
CATCH_CATCH_ANON(type)#
CATCH_CONFIG_CPP11_TO_STRING#
CATCH_CONFIG_DISABLE_EXCEPTIONS#
CATCH_CONFIG_GETENV#
CATCH_CONFIG_GLOBAL_NEXTAFTER#
CATCH_CONFIG_POSIX_SIGNALS#
CATCH_EXPORT#
CATCH_INTERNAL_CONFIG_GETENV#
CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER#
CATCH_INTERNAL_CONFIG_POSIX_SIGNALS#
CATCH_INTERNAL_IGNORE_BUT_WARN(...)#
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION#
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION#
CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS#
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS#
CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS#
CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS#
CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT#
CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS#
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS#
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS#
CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS#
CATCH_TRY#
file catch_config_android_logwrite.hpp
#include <catch2/catch_user_config.hpp>

Wrapper for ANDROID_LOGWRITE configuration option.

We want to default to enabling it when compiled for android, but users of the library should also be able to disable it if they want to.

file catch_config_counter.hpp
#include <catch2/catch_user_config.hpp>

Wrapper for the CONFIG configuration option.

When generating internal unique names, there are two options. Either we mix in the current line number, or mix in an incrementing number. We prefer the latter, using __COUNTER__, but users might want to use the former.

Defines

CATCH_CONFIG_COUNTER#
CATCH_INTERNAL_CONFIG_COUNTER#
file catch_config_static_analysis_support.hpp
#include <catch2/catch_user_config.hpp>

Wrapper for the STATIC_ANALYSIS_SUPPORT configuration option.

Some of Catch2’s macros can be defined differently to work better with static analysis tools, like clang-tidy or coverity. Currently the main use case is to show that SECTIONs are executed exclusively, and not all in one run of a TEST_CASE.

file catch_config_uncaught_exceptions.hpp
#include <catch2/catch_user_config.hpp>
#include <exception>

Wrapper for UNCAUGHT_EXCEPTIONS configuration option.

For some functionality, Catch2 requires to know whether there is an active exception. Because std::uncaught_exception is deprecated in C++17, we want to use std::uncaught_exceptions if possible.

file catch_config_wchar.hpp
#include <catch2/catch_user_config.hpp>

Wrapper for the WCHAR configuration option.

We want to support platforms that do not provide wchar_t, so we sometimes have to disable providing wchar_t overloads through Catch2, e.g. the StringMaker specialization for std::wstring.

Defines

CATCH_CONFIG_WCHAR#
file catch_console_colour.cpp
#include <cassert>
#include <ostream>
#include <utility>
file catch_console_colour.hpp
#include <iosfwd>
#include <cstdint>
file catch_console_width.hpp
#include <catch2/catch_user_config.hpp>

Defines

CATCH_CONFIG_CONSOLE_WIDTH#
file catch_container_nonmembers.hpp
#include <cstddef>
#include <initializer_list>

Defines

CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS#
file catch_context.cpp
file catch_context.hpp
file catch_debug_console.cpp
#include <catch2/catch_user_config.hpp>
#include <ostream>
file catch_debug_console.hpp
#include <string>
file catch_debugger.cpp
file catch_debugger.hpp

Defines

CATCH_BREAK_INTO_DEBUGGER()#
file catch_decomposer.cpp
file catch_decomposer.hpp
#include <type_traits>
#include <iosfwd>

Defines

CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR(id, op)#
CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR(id, op)#
CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(op)#
file catch_enforce.cpp
#include <stdexcept>
file catch_enforce.hpp
#include <exception>

Defines

CATCH_ENFORCE(condition, ...)#
CATCH_ERROR(...)#
CATCH_INTERNAL_ERROR(...)#
CATCH_MAKE_MSG(...)#
CATCH_RUNTIME_ERROR(...)#
file catch_enum_values_registry.cpp
#include <cassert>
file catch_enum_values_registry.hpp
#include <vector>
file catch_errno_guard.cpp
#include <cerrno>
file catch_errno_guard.hpp
file catch_exception_translator_registry.cpp
#include <exception>
file catch_exception_translator_registry.hpp
#include <vector>
#include <string>
file catch_fatal_condition_handler.cpp
#include <algorithm>

This file provides platform specific implementations of FatalConditionHandler.

This means that there is a lot of conditional compilation, and platform specific code. Currently, Catch2 supports a dummy handler (if no handler is desired), and 2 platform specific handlers:

  • Windows’ SEH

  • POSIX signals

Consequently, various pieces of code below are compiled if either of the platform specific handlers is enabled, or if none of them are enabled. It is assumed that both cannot be enabled at the same time, and doing so should cause a compilation error.

If another platform specific handler is added, the compile guards below will need to be updated taking these assumptions into account.

file catch_fatal_condition_handler.hpp
#include <cassert>
file catch_floating_point_helpers.cpp
#include <cstring>
file catch_floating_point_helpers.hpp
#include <cassert>
#include <cmath>
#include <cstdint>
#include <utility>
#include <limits>
file catch_getenv.cpp
#include <cstdlib>
file catch_getenv.hpp
file catch_is_permutation.hpp
#include <algorithm>
#include <iterator>
file catch_istream.cpp
#include <cstdio>
#include <fstream>
#include <sstream>
#include <vector>
file catch_istream.hpp
#include <iosfwd>
#include <cstddef>
#include <ostream>
#include <string>
file catch_lazy_expr.cpp
file catch_lazy_expr.hpp
#include <iosfwd>
file catch_leak_detector.cpp
#include <catch2/catch_user_config.hpp>
file catch_leak_detector.hpp
file catch_list.cpp
file catch_list.hpp
#include <set>
#include <string>
file catch_logical_traits.hpp
#include <type_traits>
file catch_main.cpp

Functions

int main(int argc, char *argv[])#
file catch_message_info.cpp
file catch_message_info.hpp
#include <string>
file catch_meta.hpp
#include <type_traits>
file catch_move_and_forward.hpp
#include <type_traits>

Defines

CATCH_FORWARD(...)#

Replacement for std::forward with better compile time performance.

CATCH_MOVE(...)#

Replacement for std::move with better compile time performance.

file catch_noncopyable.hpp
file catch_optional.hpp
#include <cassert>
file catch_output_redirect.cpp
#include <cstdio>
#include <cstring>
#include <sstream>
file catch_output_redirect.hpp
#include <cstdio>
#include <iosfwd>
#include <string>
file catch_parse_numbers.cpp
#include <limits>
#include <stdexcept>
file catch_parse_numbers.hpp
#include <string>
file catch_platform.hpp
file catch_polyfills.cpp
#include <catch2/catch_user_config.hpp>
#include <cmath>
file catch_polyfills.hpp
file catch_preprocessor.hpp

Defines

CATCH_DEFER(id)#
CATCH_EMPTY()#
CATCH_REC_END(...)#
CATCH_REC_GET_END(...)#
CATCH_REC_GET_END1(...)#
CATCH_REC_GET_END2()#
CATCH_REC_LIST(f, ...)#
CATCH_REC_LIST0(f, x, peek, ...)#
CATCH_REC_LIST0_UD(f, userdata, x, peek, ...)#
CATCH_REC_LIST1(f, x, peek, ...)#
CATCH_REC_LIST1_UD(f, userdata, x, peek, ...)#
CATCH_REC_LIST2(f, x, peek, ...)#
CATCH_REC_LIST2_UD(f, userdata, x, peek, ...)#
CATCH_REC_LIST_UD(f, userdata, ...)#
CATCH_REC_NEXT(test, next)#
CATCH_REC_NEXT0(test, next, ...)#
CATCH_REC_NEXT1(test, next)#
CATCH_REC_OUT#
CATCH_RECURSE(...)#
CATCH_RECURSION_LEVEL0(...)#
CATCH_RECURSION_LEVEL1(...)#
CATCH_RECURSION_LEVEL2(...)#
CATCH_RECURSION_LEVEL3(...)#
CATCH_RECURSION_LEVEL4(...)#
CATCH_RECURSION_LEVEL5(...)#
INTERNAL_CATCH_DECLARE_SIG_TEST(TestName, ...)#
INTERNAL_CATCH_DECLARE_SIG_TEST0(TestName)#
INTERNAL_CATCH_DECLARE_SIG_TEST1(TestName, signature)#
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, ...)#
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0(TestName, ClassName)#
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1(TestName, ClassName, signature)#
INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X(TestName, ClassName, signature, ...)#
INTERNAL_CATCH_DECLARE_SIG_TEST_X(TestName, signature, ...)#
INTERNAL_CATCH_DEFINE_SIG_TEST(TestName, ...)#
INTERNAL_CATCH_DEFINE_SIG_TEST0(TestName)#
INTERNAL_CATCH_DEFINE_SIG_TEST1(TestName, signature)#
INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, ...)#
INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0(TestName)#
INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1(TestName, signature)#
INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X(TestName, signature, ...)#
INTERNAL_CATCH_DEFINE_SIG_TEST_X(TestName, signature, ...)#
INTERNAL_CATCH_MAKE_NAMESPACE(name)#
INTERNAL_CATCH_MAKE_NAMESPACE2(...)#
INTERNAL_CATCH_MAKE_TYPE_LIST(...)#
INTERNAL_CATCH_MAKE_TYPE_LIST2(...)#
INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)#
INTERNAL_CATCH_NTTP_0#
INTERNAL_CATCH_NTTP_1(signature, ...)#
INTERNAL_CATCH_NTTP_GEN(...)#
INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, ...)#
INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, ...)#
INTERNAL_CATCH_NTTP_REGISTER(TestFunc, signature, ...)#
INTERNAL_CATCH_NTTP_REGISTER0(TestFunc, signature)#
INTERNAL_CATCH_NTTP_REGISTER_METHOD(TestName, signature, ...)#
INTERNAL_CATCH_NTTP_REGISTER_METHOD0(TestName, signature, ...)#
INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9)#
INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10)#
INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0)#
INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1)#
INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2)#
INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3)#
INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4)#
INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5)#
INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6)#
INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7)#
INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8)#
INTERNAL_CATCH_REMOVE_PARENS_GEN(...)#
INTERNAL_CATCH_STRINGIZE(...)#
INTERNAL_CATCH_STRINGIZE2(...)#
INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param)#
INTERNAL_CATCH_TYPE_GEN#
INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)#
file catch_preprocessor_internal_stringify.hpp
#include <catch2/catch_user_config.hpp>

Defines

CATCH_INTERNAL_STRINGIFY(...)#
file catch_preprocessor_remove_parens.hpp

Defines

INTERNAL_CATCH_DEF(...)#
INTERNAL_CATCH_EXPAND1(param)#
INTERNAL_CATCH_EXPAND2(...)#
INTERNAL_CATCH_NOINTERNAL_CATCH_DEF#
INTERNAL_CATCH_REMOVE_PARENS(...)#
file catch_random_number_generator.cpp
file catch_random_number_generator.hpp
#include <cstdint>
file catch_random_seed_generation.cpp
#include <ctime>
#include <random>
file catch_random_seed_generation.hpp
#include <cstdint>
file catch_reporter_registry.cpp
file catch_reporter_registry.hpp
#include <map>
#include <string>
#include <vector>
file catch_reporter_spec_parser.cpp
#include <algorithm>
file catch_reporter_spec_parser.hpp
#include <map>
#include <string>
#include <vector>
file catch_result_type.cpp
file catch_result_type.hpp
file catch_reusable_string_stream.cpp
#include <cstdio>
#include <sstream>
#include <vector>
file catch_reusable_string_stream.hpp
#include <iosfwd>
#include <cstddef>
#include <ostream>
#include <string>
file catch_run_context.cpp
#include <catch2/catch_user_config.hpp>
#include <cassert>
#include <algorithm>
file catch_run_context.hpp
#include <string>
file catch_section.cpp
file catch_section.hpp

Defines

INTERNAL_CATCH_DYNAMIC_SECTION(...)#
INTERNAL_CATCH_SECTION(...)#
file catch_sharding.hpp
#include <cmath>
#include <algorithm>
file catch_singletons.cpp
#include <vector>
file catch_singletons.hpp
file catch_source_line_info.cpp
#include <cstring>
#include <ostream>
file catch_source_line_info.hpp
#include <cstddef>
#include <iosfwd>

Defines

CATCH_INTERNAL_LINEINFO#
file catch_startup_exception_registry.cpp
#include <catch2/catch_user_config.hpp>
file catch_startup_exception_registry.hpp
#include <vector>
#include <exception>
file catch_stdstreams.cpp
#include <catch2/catch_user_config.hpp>
#include <iostream>
file catch_stdstreams.hpp
#include <iosfwd>
file catch_stream_end_stop.hpp
file catch_string_manip.cpp
#include <ostream>
#include <cstring>
#include <cctype>
#include <vector>
file catch_string_manip.hpp
#include <cstdint>
#include <string>
#include <iosfwd>
#include <vector>
file catch_stringref.cpp
#include <algorithm>
#include <ostream>
#include <cstring>
#include <cstdint>
file catch_stringref.hpp
#include <cstddef>
#include <string>
#include <iosfwd>
#include <cassert>
#include <cstring>

Functions

constexpr auto operator""_catch_sr(char const *rawChars, std::size_t size) noexcept -> Catch::StringRef#
file catch_tag_alias_registry.cpp
file catch_tag_alias_registry.hpp
#include <map>
#include <string>
file catch_template_test_registry.hpp

Defines

INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList)#
INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)#
INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD(ClassName, Name, Tags, TmplList)#
INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, TmplList)#
INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)#
INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList)#
INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD(ClassName, Name, Tags, ...)#
INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)#
INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(ClassName, Name, Tags, Signature, ...)#
INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)#
INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...)#
INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, Signature, ...)#
INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD(ClassName, Name, Tags, ...)#
INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, ...)#
INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG(ClassName, Name, Tags, Signature, ...)#
INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...)#
file catch_test_case_info_hasher.cpp
file catch_test_case_info_hasher.hpp
#include <cstdint>
file catch_test_case_registry_impl.cpp
#include <algorithm>
#include <set>
file catch_test_case_registry_impl.hpp
#include <vector>
file catch_test_case_tracker.cpp
#include <algorithm>
#include <cassert>
file catch_test_case_tracker.hpp
#include <string>
#include <vector>
file catch_test_failure_exception.cpp
#include <catch2/catch_user_config.hpp>
file catch_test_failure_exception.hpp
file catch_test_macro_impl.hpp
#include <catch2/catch_user_config.hpp>

Defines

INTERNAL_CATCH_CATCH(handler)#
INTERNAL_CATCH_ELSE(macroName, resultDisposition, ...)#
INTERNAL_CATCH_IF(macroName, resultDisposition, ...)#
INTERNAL_CATCH_NO_THROW(macroName, resultDisposition, ...)#
INTERNAL_CATCH_REACT(handler)#
INTERNAL_CATCH_TEST(macroName, resultDisposition, ...)#
INTERNAL_CATCH_THROWS(macroName, resultDisposition, ...)#
INTERNAL_CATCH_THROWS_AS(macroName, exceptionType, resultDisposition, expr)#
INTERNAL_CATCH_THROWS_STR_MATCHES(macroName, resultDisposition, matcher, ...)#
INTERNAL_CATCH_TRY#
file catch_test_registry.cpp
#include <algorithm>
#include <iterator>
file catch_test_registry.hpp

Defines

INTERNAL_CATCH_METHOD_AS_TEST_CASE(QualifiedMethod, ...)#
INTERNAL_CATCH_REGISTER_TESTCASE(Function, ...)#
INTERNAL_CATCH_TEST_CASE_METHOD(ClassName, ...)#
INTERNAL_CATCH_TEST_CASE_METHOD2(TestName, ClassName, ...)#
INTERNAL_CATCH_TESTCASE(...)#
INTERNAL_CATCH_TESTCASE2(TestName, ...)#
file catch_test_run_info.hpp
file catch_test_spec_parser.cpp
file catch_test_spec_parser.hpp
#include <vector>
#include <string>
file catch_textflow.cpp
#include <algorithm>
#include <cstring>
#include <ostream>
file catch_textflow.hpp
#include <cassert>
#include <string>
#include <vector>
file catch_to_string.hpp
#include <string>
file catch_uncaught_exceptions.cpp
#include <catch2/catch_user_config.hpp>
#include <exception>
file catch_uncaught_exceptions.hpp
file catch_unique_name.hpp

Defines

INTERNAL_CATCH_UNIQUE_NAME(name)#
INTERNAL_CATCH_UNIQUE_NAME_LINE(name, line)#
INTERNAL_CATCH_UNIQUE_NAME_LINE2(name, line)#
file catch_unique_ptr.hpp
#include <cassert>
#include <type_traits>
file catch_void_type.hpp
file catch_wildcard_pattern.cpp
file catch_wildcard_pattern.hpp
#include <string>
file catch_windows_h_proxy.hpp
file catch_xmlwriter.cpp
#include <cstdint>
#include <iomanip>
#include <type_traits>
file catch_xmlwriter.hpp
#include <iosfwd>
#include <vector>
file catch_matchers.cpp
file catch_matchers.hpp
#include <string>
#include <vector>

Defines

CHECK_THAT(arg, matcher)#
CHECK_THROWS_MATCHES(expr, exceptionType, matcher)#
CHECK_THROWS_WITH(expr, matcher)#
REQUIRE_THAT(arg, matcher)#
REQUIRE_THROWS_MATCHES(expr, exceptionType, matcher)#
REQUIRE_THROWS_WITH(expr, matcher)#
file catch_matchers_all.hpp

This is a convenience header for Catch2’s Matcher support.

It includes all of Catch2 headers related to matchers.

Generally the Catch2 users should use specific includes they need, but this header can be used instead for ease-of-experimentation, or just plain convenience, at the cost of increased compilation times.

When a new header is added to either the matchers folder, or to the corresponding internal subfolder, it should be added here.

file catch_matchers_container_properties.cpp
file catch_matchers_container_properties.hpp
file catch_matchers_contains.hpp
#include <algorithm>
#include <functional>
file catch_matchers_exception.cpp
file catch_matchers_exception.hpp
file catch_matchers_floating_point.cpp
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdint>
#include <sstream>
#include <iomanip>
#include <limits>
file catch_matchers_floating_point.hpp
file catch_matchers_predicate.cpp
file catch_matchers_predicate.hpp
#include <string>
file catch_matchers_quantifiers.cpp
file catch_matchers_quantifiers.hpp
file catch_matchers_range_equals.hpp
#include <algorithm>
#include <utility>
file catch_matchers_string.cpp
#include <regex>
file catch_matchers_string.hpp
#include <string>
file catch_matchers_templated.cpp
file catch_matchers_templated.hpp
#include <array>
#include <algorithm>
#include <string>
#include <type_traits>
file catch_matchers_vector.hpp
#include <algorithm>
file catch_matchers_impl.cpp
file catch_matchers_impl.hpp
#include <string>

Defines

INTERNAL_CATCH_THROWS_MATCHES(macroName, exceptionType, resultDisposition, matcher, ...)#
INTERNAL_CHECK_THAT(macroName, matcher, resultDisposition, arg)#
file catch_reporter_automake.cpp
#include <ostream>
file catch_reporter_automake.hpp
#include <string>
file catch_reporter_common_base.cpp
file catch_reporter_common_base.hpp
#include <map>
#include <string>
file catch_reporter_compact.cpp
#include <ostream>
file catch_reporter_compact.hpp
file catch_reporter_console.cpp
#include <cstdio>
file catch_reporter_console.hpp
file catch_reporter_cumulative_base.cpp
#include <algorithm>
#include <cassert>
file catch_reporter_cumulative_base.hpp
#include <string>
#include <vector>
file catch_reporter_event_listener.cpp
file catch_reporter_event_listener.hpp
file catch_reporter_helpers.cpp
#include <algorithm>
#include <cfloat>
#include <cstdio>
#include <ostream>
#include <iomanip>
file catch_reporter_helpers.hpp
#include <iosfwd>
#include <string>
#include <vector>
file catch_reporter_junit.cpp
#include <cassert>
#include <ctime>
#include <algorithm>
#include <iomanip>
file catch_reporter_junit.hpp
file catch_reporter_multi.cpp
#include <ostream>
file catch_reporter_multi.hpp
file catch_reporter_registrars.cpp
file catch_reporter_registrars.hpp
#include <type_traits>

Defines

CATCH_REGISTER_LISTENER(listenerType)#
CATCH_REGISTER_REPORTER(name, reporterType)#
file catch_reporter_sonarqube.cpp
#include <map>
file catch_reporter_sonarqube.hpp
file catch_reporter_streaming_base.cpp
file catch_reporter_streaming_base.hpp
#include <vector>
file catch_reporter_tap.cpp
#include <algorithm>
#include <ostream>
file catch_reporter_tap.hpp
file catch_reporter_teamcity.cpp
#include <cassert>
#include <ostream>
file catch_reporter_teamcity.hpp
#include <cstring>
file catch_reporter_xml.cpp
file catch_reporter_xml.hpp
file catch_reporters_all.hpp

This is a convenience header for Catch2’s Reporter support.

It includes all of Catch2 headers related to reporters, including all reporters.

Generally the Catch2 users should use specific includes they need, but this header can be used instead for ease-of-experimentation, or just plain convenience, at the cost of (significantly) increased compilation times.

When a new header (reporter) is added to either the reporter folder, or to the corresponding internal subfolder, it should be added here.

dir src/catch2/benchmark
dir src/catch2
dir src/catch2/benchmark/detail
dir src/catch2/generators
dir src/catch2/interfaces
dir src/catch2/internal
dir src/catch2/matchers/internal
dir src/catch2/matchers
dir src/catch2/reporters
dir src