QtRocket
 
Loading...
Searching...
No Matches
catch_amalgamated.cpp File Reference
#include "catch_amalgamated.hpp"
#include <vector>
#include <exception>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <numeric>
#include <random>
#include <limits>
#include <fstream>
#include <stack>
#include <iomanip>
#include <set>
#include <cctype>
#include <string>
#include <ostream>
#include <chrono>
#include <utility>
#include <stdexcept>
#include <cerrno>
#include <signal.h>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <sstream>
#include <iosfwd>
#include <ctime>
#include <iostream>
#include <cstdint>
#include <iterator>
#include <type_traits>
#include <regex>
#include <cfloat>
#include <map>
Include dependency graph for catch_amalgamated.cpp:

Classes

struct  Catch::Benchmark::Detail::do_nothing
 
struct  Catch::Benchmark::Detail::optimized_away_error
 
struct  Catch::Generators::RandomFloatingGenerator::PImpl
 
struct  Catch::SignalDefs
 
struct  Catch::ReporterRegistry::ReporterRegistryImpl
 
struct  Catch::StringStreams
 
struct  Catch::ColumnInfo
 
class  Catch::TablePrinter
 

Namespaces

namespace  Catch
 
namespace  Catch::Benchmark
 
namespace  Catch::Benchmark::Detail
 
namespace  Catch::literals
 
namespace  Catch::Detail
 
namespace  Catch::Generators
 
namespace  Catch::Generators::Detail
 
namespace  Catch::Clara
 
namespace  Catch::Clara::Detail
 
namespace  Catch::TestCaseTracking
 
namespace  Catch::TextFlow
 
namespace  Catch::Matchers
 
namespace  Catch::Matchers::Detail
 

Macros

#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
 

Typedefs

using Catch::RegistryHubSingleton = Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>
 

Enumerations

enum class  Catch::Matchers::Detail::FloatingPointKind : uint8_t { Catch::Matchers::Detail::Float , Catch::Matchers::Detail::Double }
 
enum class  Catch::Justification : uint8_t { Catch::Left , Catch::Right }
 

Functions

SampleAnalysis Catch::Benchmark::Detail::analyse (const IConfig &cfg, FDuration *first, FDuration *last)
 
void Catch::Benchmark::Detail::throw_optimized_away_error ()
 
double Catch::Benchmark::Detail::weighted_average_quantile (int k, int q, double *first, double *last)
 
OutlierClassification Catch::Benchmark::Detail::classify_outliers (double const *first, double const *last)
 
double Catch::Benchmark::Detail::mean (double const *first, double const *last)
 
double Catch::Benchmark::Detail::normal_cdf (double x)
 
double Catch::Benchmark::Detail::erfc_inv (double x)
 
double Catch::Benchmark::Detail::normal_quantile (double p)
 
Estimate< double > Catch::Benchmark::Detail::bootstrap (double confidence_level, double *first, double *last, sample const &resample, double(*estimator)(double const *, double const *))
 
bootstrap_analysis Catch::Benchmark::Detail::analyse_samples (double confidence_level, unsigned int n_resamples, double *first, double *last)
 
Approx Catch::literals::operator""_a (long double val)
 
Approx Catch::literals::operator""_a (unsigned long long val)
 
bool Catch::operator== (ProcessedReporterSpec const &lhs, ProcessedReporterSpec const &rhs)
 
std::uint32_t Catch::getSeed ()
 Returns Catch2's current RNG seed.
 
IRegistryHub const & Catch::getRegistryHub ()
 
IMutableRegistryHubCatch::getMutableRegistryHub ()
 
void Catch::cleanUp ()
 
std::string Catch::translateActiveException ()
 
bool Catch::operator< (Tag const &lhs, Tag const &rhs)
 
bool Catch::operator== (Tag const &lhs, Tag const &rhs)
 
Detail::unique_ptr< TestCaseInfoCatch::makeTestCaseInfo (StringRef _className, NameAndTags const &nameAndTags, SourceLineInfo const &_lineInfo)
 
bool Catch::operator< (TestCaseInfo const &lhs, TestCaseInfo const &rhs)
 
std::string Catch::Detail::convertIntoString (StringRef string, bool escapeInvisibles)
 Encases `string in quotes, and optionally escapes invisibles.
 
std::string Catch::Detail::convertIntoString (StringRef string)
 Encases string in quotes, and escapes invisibles if user requested it via CLI.
 
std::string Catch::Detail::rawMemoryToString (const void *object, std::size_t size)
 
void Catch::Detail::registerTranslatorImpl (Detail::unique_ptr< IExceptionTranslator > &&translator)
 
std::ostream & Catch::operator<< (std::ostream &os, Version const &version)
 
Version const & Catch::libraryVersion ()
 
void Catch::Generators::Detail::throw_generator_exception (char const *msg)
 Throws GeneratorException with the provided message.
 
IGeneratorTrackerCatch::Generators::acquireGeneratorTracker (StringRef generatorName, SourceLineInfo const &lineInfo)
 
IGeneratorTrackerCatch::Generators::createGeneratorTracker (StringRef generatorName, SourceLineInfo lineInfo, GeneratorBasePtr &&generator)
 
std::uint32_t Catch::Generators::Detail::getSeed ()
 
void Catch::handleExceptionMatchExpr (AssertionHandler &handler, std::string const &str)
 
ParserResult Catch::Clara::Detail::convertInto (std::string const &source, std::string &target)
 
ParserResult Catch::Clara::Detail::convertInto (std::string const &source, bool &target)
 
Clara::Parser Catch::makeCommandLineParser (ConfigData &config)
 
Detail::unique_ptr< ColourImpl > Catch::makeColourImpl (ColourMode colourSelection, IStream *stream)
 
bool Catch::isColourImplAvailable (ColourMode colourSelection)
 
void Catch::cleanUpContext ()
 
ContextCatch::getCurrentMutableContext ()
 
SimplePcg32Catch::sharedRng ()
 
void Catch::writeToDebugConsole (std::string const &text)
 
bool Catch::isDebuggerActive ()
 
void Catch::formatReconstructedExpression (std::ostream &os, std::string const &lhs, StringRef op, std::string const &rhs)
 
void Catch::throw_exception (std::exception const &e)
 
void Catch::throw_logic_error (std::string const &msg)
 
void Catch::throw_domain_error (std::string const &msg)
 
void Catch::throw_runtime_error (std::string const &msg)
 
std::vector< StringRefCatch::Detail::parseEnums (StringRef enums)
 
Catch::Detail::unique_ptr< EnumInfoCatch::Detail::makeEnumInfo (StringRef enumName, StringRef allValueNames, std::vector< int > const &values)
 
static void Catch::restorePreviousSignalHandlers () noexcept
 
static void Catch::handleSignal (int sig)
 
uint32_t Catch::Detail::convertToBits (float f)
 
uint64_t Catch::Detail::convertToBits (double d)
 
bool Catch::Detail::directCompare (float lhs, float rhs)
 
bool Catch::Detail::directCompare (double lhs, double rhs)
 
char const * Catch::Detail::getEnv (char const *varName)
 
auto Catch::makeStream (std::string const &filename) -> Detail::unique_ptr< IStream >
 
auto Catch::operator<< (std::ostream &os, LazyExpression const &lazyExpr) -> std::ostream &
 
bool Catch::list (IEventListener &reporter, Config const &config)
 
int main (int argc, char *argv[])
 
bool Catch::isRedirectAvailable (OutputRedirect::Kind kind)
 
Detail::unique_ptr< OutputRedirect > Catch::makeOutputRedirect (bool actual)
 
RedirectGuard Catch::scopedActivate (OutputRedirect &redirectImpl)
 
RedirectGuard Catch::scopedDeactivate (OutputRedirect &redirectImpl)
 
Optional< unsigned int > Catch::parseUInt (std::string const &input, int base)
 
bool Catch::isnan (float f)
 
bool Catch::isnan (double d)
 
float Catch::nextafter (float x, float y)
 
double Catch::nextafter (double x, double y)
 
bool Catch::operator== (SimplePcg32 const &lhs, SimplePcg32 const &rhs)
 
bool Catch::operator!= (SimplePcg32 const &lhs, SimplePcg32 const &rhs)
 
std::uint32_t Catch::generateRandomSeed (GenerateFrom from)
 
std::vector< std::string > Catch::Detail::splitReporterSpec (StringRef reporterSpec)
 Splits the reporter spec into reporter name and kv-pair options.
 
Optional< ColourModeCatch::Detail::stringToColourMode (StringRef colourMode)
 
bool Catch::operator== (ReporterSpec const &lhs, ReporterSpec const &rhs)
 
Optional< ReporterSpecCatch::parseReporterSpec (StringRef reporterSpec)
 
IResultCaptureCatch::getResultCapture ()
 
void Catch::seedRng (IConfig const &config)
 
unsigned int Catch::rngSeed ()
 
void Catch::addSingleton (ISingleton *singleton)
 
void Catch::cleanupSingletons ()
 
std::ostream & Catch::operator<< (std::ostream &os, SourceLineInfo const &info)
 
std::ostream & Catch::cout ()
 
std::ostream & Catch::cerr ()
 
std::ostream & Catch::clog ()
 
bool Catch::startsWith (std::string const &s, std::string const &prefix)
 
bool Catch::startsWith (StringRef s, char prefix)
 
bool Catch::endsWith (std::string const &s, std::string const &suffix)
 
bool Catch::endsWith (std::string const &s, char suffix)
 
bool Catch::contains (std::string const &s, std::string const &infix)
 
void Catch::toLowerInPlace (std::string &s)
 
std::string Catch::toLower (std::string const &s)
 
char Catch::toLower (char c)
 
std::string Catch::trim (std::string const &str)
 
StringRef Catch::trim (StringRef ref)
 
bool Catch::replaceInPlace (std::string &str, std::string const &replaceThis, std::string const &withThis)
 
std::vector< StringRefCatch::splitStringRef (StringRef str, char delimiter)
 
std::ostream & Catch::operator<< (std::ostream &os, pluralise const &pluraliser)
 
auto Catch::operator<< (std::ostream &os, StringRef str) -> std::ostream &
 
std::string Catch::operator+ (StringRef lhs, StringRef rhs)
 
auto Catch::operator+= (std::string &lhs, StringRef rhs) -> std::string &
 
std::vector< TestCaseHandleCatch::sortTests (IConfig const &config, std::vector< TestCaseHandle > const &unsortedTestCases)
 
bool Catch::isThrowSafe (TestCaseHandle const &testCase, IConfig const &config)
 
std::vector< TestCaseHandleCatch::filterTests (std::vector< TestCaseHandle > const &testCases, TestSpec const &testSpec, IConfig const &config)
 
std::vector< TestCaseHandle > const & Catch::getAllTestCasesSorted (IConfig const &config)
 
void Catch::throw_test_failure_exception ()
 
void Catch::throw_test_skip_exception ()
 
Detail::unique_ptr< ITestInvokerCatch::makeTestInvoker (void(*testAsFunction)())
 
static bool Catch::TextFlow::isBoundary (AnsiSkippingString const &line, AnsiSkippingString::const_iterator it)
 
std::ostream & Catch::TextFlow::operator<< (std::ostream &os, Column const &col)
 
Column Catch::TextFlow::Spacer (size_t spaceWidth)
 
std::ostream & Catch::TextFlow::operator<< (std::ostream &os, Columns const &cols)
 
Columns Catch::TextFlow::operator+ (Column const &lhs, Column const &rhs)
 
Columns Catch::TextFlow::operator+ (Column &&lhs, Column &&rhs)
 
Columns & Catch::TextFlow::operator+= (Columns &lhs, Column const &rhs)
 
Columns & Catch::TextFlow::operator+= (Columns &lhs, Column &&rhs)
 
Columns Catch::TextFlow::operator+ (Columns const &lhs, Column const &rhs)
 
Columns Catch::TextFlow::operator+ (Columns &&lhs, Column &&rhs)
 
bool Catch::uncaught_exceptions ()
 
std::ostream & Catch::operator<< (std::ostream &os, XmlEncode const &xmlEncode)
 
IsEmptyMatcher Catch::Matchers::IsEmpty ()
 
HasSizeMatcher Catch::Matchers::SizeIs (std::size_t sz)
 
ExceptionMessageMatcher Catch::Matchers::Message (std::string const &message)
 
WithinUlpsMatcher Catch::Matchers::WithinULP (double target, uint64_t maxUlpDiff)
 
WithinUlpsMatcher Catch::Matchers::WithinULP (float target, uint64_t maxUlpDiff)
 
WithinAbsMatcher Catch::Matchers::WithinAbs (double target, double margin)
 
WithinRelMatcher Catch::Matchers::WithinRel (double target, double eps)
 
WithinRelMatcher Catch::Matchers::WithinRel (double target)
 
WithinRelMatcher Catch::Matchers::WithinRel (float target, float eps)
 
WithinRelMatcher Catch::Matchers::WithinRel (float target)
 
IsNaNMatcher Catch::Matchers::IsNaN ()
 
AllTrueMatcher Catch::Matchers::AllTrue ()
 
NoneTrueMatcher Catch::Matchers::NoneTrue ()
 
AnyTrueMatcher Catch::Matchers::AnyTrue ()
 
StringEqualsMatcher Catch::Matchers::Equals (std::string const &str, CaseSensitive caseSensitivity)
 
StringContainsMatcher Catch::Matchers::ContainsSubstring (std::string const &str, CaseSensitive caseSensitivity)
 
EndsWithMatcher Catch::Matchers::EndsWith (std::string const &str, CaseSensitive caseSensitivity)
 
StartsWithMatcher Catch::Matchers::StartsWith (std::string const &str, CaseSensitive caseSensitivity)
 
RegexMatcher Catch::Matchers::Matches (std::string const &regex, CaseSensitive caseSensitivity)
 
std::string Catch::Matchers::Detail::describe_multi_matcher (StringRef combine, std::string const *descriptions_begin, std::string const *descriptions_end)
 
void Catch::handleExceptionMatchExpr (AssertionHandler &handler, StringMatcher const &matcher)
 
std::string Catch::getFormattedDuration (double duration)
 
bool Catch::shouldShowDuration (IConfig const &config, double duration)
 
std::string Catch::serializeFilters (std::vector< std::string > const &filters)
 
std::ostream & Catch::operator<< (std::ostream &out, lineOfChars value)
 
void Catch::defaultListReporters (std::ostream &out, std::vector< ReporterDescription > const &descriptions, Verbosity verbosity)
 
void Catch::defaultListListeners (std::ostream &out, std::vector< ListenerDescription > const &descriptions)
 
void Catch::defaultListTags (std::ostream &out, std::vector< TagInfo > const &tags, bool isFiltered)
 
void Catch::defaultListTests (std::ostream &out, ColourImpl *streamColour, std::vector< TestCaseHandle > const &tests, bool isFiltered, Verbosity verbosity)
 
void Catch::printTestRunTotals (std::ostream &stream, ColourImpl &streamColour, Totals const &totals)
 
static void Catch::writeCounts (JsonObjectWriter &&writer, Counts const &counts)
 
void Catch::Detail::registerReporterImpl (std::string const &name, IReporterFactoryPtr reporterPtr)
 
void Catch::Detail::registerListenerImpl (Detail::unique_ptr< EventListenerFactory > listenerFactory)
 

Variables

int Catch::StringMaker< float >::precision = std::numeric_limits<float>::max_digits10
 
int Catch::StringMaker< double >::precision = std::numeric_limits<double>::max_digits10
 
static SignalDefs Catch::signalDefs []
 
static char * Catch::altStackMem = nullptr
 
static std::size_t Catch::altStackSize = 0
 
static stack_t Catch::oldSigStack {}
 
static struct sigaction Catch::oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)] {}
 
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION static CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS LeakDetector Catch::leakDetector
 

Detailed Description

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.

Macro Definition Documentation

◆ CATCH_WINDOWS_H_PROXY_HPP_INCLUDED

#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )
Here is the call graph for this function: