15#ifndef CATCH_AMALGAMATED_HPP_INCLUDED
16#define CATCH_AMALGAMATED_HPP_INCLUDED
33#ifndef CATCH_ALL_HPP_INCLUDED
34#define CATCH_ALL_HPP_INCLUDED
51#ifndef CATCH_BENCHMARK_ALL_HPP_INCLUDED
52#define CATCH_BENCHMARK_ALL_HPP_INCLUDED
58#ifndef CATCH_BENCHMARK_HPP_INCLUDED
59#define CATCH_BENCHMARK_HPP_INCLUDED
63#ifndef CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
64#define CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
84#ifndef CATCH_PLATFORM_HPP_INCLUDED
85#define CATCH_PLATFORM_HPP_INCLUDED
90# ifndef __has_extension
91# define __has_extension(x) 0
93# include <TargetConditionals.h>
94# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \
95 (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1)
96# define CATCH_PLATFORM_MAC
97# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1)
98# define CATCH_PLATFORM_IPHONE
101#elif defined(linux) || defined(__linux) || defined(__linux__)
102# define CATCH_PLATFORM_LINUX
104#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
105# define CATCH_PLATFORM_WINDOWS
107# if defined( WINAPI_FAMILY ) && ( WINAPI_FAMILY == WINAPI_FAMILY_APP )
108# define CATCH_PLATFORM_WINDOWS_UWP
111#elif defined(__ORBIS__) || defined(__PROSPERO__)
112# define CATCH_PLATFORM_PLAYSTATION
120# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
121# define CATCH_CPP17_OR_GREATER
124# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
125# define CATCH_CPP20_OR_GREATER
132#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) && !defined(__NVCOMPILER)
133# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
134# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
138# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
139 _Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
141# define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
142 _Pragma( "GCC diagnostic ignored \"-Wunused-result\"" )
144# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
145 _Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" )
147# define CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
148 _Pragma( "GCC diagnostic ignored \"-Wuseless-cast\"" )
150# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
151 _Pragma( "GCC diagnostic ignored \"-Wshadow\"" )
153# define CATCH_INTERNAL_CONFIG_USE_BUILTIN_CONSTANT_P
157#if defined(__NVCOMPILER)
158# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "diag push" )
159# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "diag pop" )
160# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "diag_suppress declared_but_not_referenced" )
163#if defined(__CUDACC__) && !defined(__clang__)
164# ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
166# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic push" )
167# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic pop" )
168# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" )
170# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "diag_suppress 177" )
176#if defined(__clang__) && !defined(_MSC_VER)
177# define CATCH_INTERNAL_CONFIG_USE_BUILTIN_CONSTANT_P
178# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
179# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
182#if defined(__clang__)
184# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
185 _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
186 _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
188# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
189 _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
191# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
192 _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
194# if (__clang_major__ >= 20)
195# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
196 _Pragma( "clang diagnostic ignored \"-Wvariadic-macro-arguments-omitted\"" )
197# elif (__clang_major__ == 19)
198# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
199 _Pragma( "clang diagnostic ignored \"-Wc++20-extensions\"" )
201# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
202 _Pragma(
"clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
205# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
206 _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
208# define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \
209 _Pragma( "clang diagnostic ignored \"-Wcomma\"" )
211# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
212 _Pragma( "clang diagnostic ignored \"-Wshadow\"" )
232#if defined( __ibmxl__ ) || defined( __CUDACC__ ) || defined( __NVCOMPILER )
233# define CATCH_INTERNAL_CONFIG_NO_USE_BUILTIN_CONSTANT_P
240#if defined( CATCH_PLATFORM_WINDOWS ) || \
241 defined( CATCH_PLATFORM_PLAYSTATION ) || \
242 defined( __CYGWIN__ ) || \
243 defined( __QNX__ ) || \
244 defined( __EMSCRIPTEN__ ) || \
245 defined( __DJGPP__ ) || \
247# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
249# define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
254#if defined( CATCH_PLATFORM_WINDOWS_UWP ) || \
255 defined( CATCH_PLATFORM_PLAYSTATION ) || \
256 defined( _GAMING_XBOX )
257# define CATCH_INTERNAL_CONFIG_NO_GETENV
259# define CATCH_INTERNAL_CONFIG_GETENV
264#if defined(__ANDROID__)
265# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
270#if defined(__MINGW32__)
271# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
276#if defined(__ORBIS__)
277# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
289# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
290 && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
292# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
303# if !defined( __CUDACC__ )
304# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
305 __pragma( warning( push ) )
306# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
307 __pragma( warning( pop ) )
312# if defined(CATCH_PLATFORM_WINDOWS_UWP)
313# define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32
315# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
321# if !defined(__clang__)
322# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
323# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
329#if defined(_REENTRANT) || defined(_MSC_VER)
331# define CATCH_INTERNAL_CONFIG_USE_ASYNC
336#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
337# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
343#if defined(__BORLANDC__)
344 #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
352#if defined(UNDER_RTSS) || defined(RTX64_BUILD)
353 #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
354 #define CATCH_INTERNAL_CONFIG_NO_ASYNC
355 #define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32
358#if !defined(_GLIBCXX_USE_C99_MATH_TR1)
359#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
363#if defined(__has_include)
365 #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
366 # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
370 # if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
371 # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
375 # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
377 # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0)
378 # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
383 # if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
384 # if defined(__clang__) && (__clang_major__ < 8)
388 # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
389 # define CATCH_CONFIG_NO_CPP17_VARIANT
391 # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
394 # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
400#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
401# define CATCH_CONFIG_WINDOWS_SEH
404#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
405# define CATCH_CONFIG_POSIX_SIGNALS
408#if defined(CATCH_INTERNAL_CONFIG_GETENV) && !defined(CATCH_INTERNAL_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_GETENV)
409# define CATCH_CONFIG_GETENV
412#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
413# define CATCH_CONFIG_CPP11_TO_STRING
416#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
417# define CATCH_CONFIG_CPP17_OPTIONAL
420#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
421# define CATCH_CONFIG_CPP17_STRING_VIEW
424#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
425# define CATCH_CONFIG_CPP17_VARIANT
428#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
429# define CATCH_CONFIG_CPP17_BYTE
433#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
434# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
437#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE)
438# define CATCH_CONFIG_NEW_CAPTURE
441#if !defined( CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED ) && \
442 !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS ) && \
443 !defined( CATCH_CONFIG_NO_DISABLE_EXCEPTIONS )
444# define CATCH_CONFIG_DISABLE_EXCEPTIONS
447#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
448# define CATCH_CONFIG_POLYFILL_ISNAN
451#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
452# define CATCH_CONFIG_USE_ASYNC
455#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
456# define CATCH_CONFIG_GLOBAL_NEXTAFTER
462#if defined( CATCH_INTERNAL_CONFIG_USE_BUILTIN_CONSTANT_P ) && \
463 !defined( CATCH_INTERNAL_CONFIG_NO_USE_BUILTIN_CONSTANT_P ) && !defined(CATCH_CONFIG_USE_BUILTIN_CONSTANT_P)
464#define CATCH_CONFIG_USE_BUILTIN_CONSTANT_P
467#if defined( CATCH_CONFIG_USE_BUILTIN_CONSTANT_P ) && \
468 !defined( CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P )
469# define CATCH_INTERNAL_IGNORE_BUT_WARN( ... ) \
470 (void)__builtin_constant_p( __VA_ARGS__ )
473# define CATCH_INTERNAL_IGNORE_BUT_WARN( ... )
478#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION)
479# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
481#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION)
482# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
484#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
485# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
487#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
488# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
490#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT)
491# define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT
493#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS)
494# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
496#if !defined(CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS)
497# define CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS
499#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
500# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
502#if !defined( CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS )
503# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
505#if !defined( CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS )
506# define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS
508#if !defined( CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS )
509# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS
512#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
513# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
514#elif defined(__clang__) && (__clang_major__ < 5)
515# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
519#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
520#define CATCH_TRY if ((true))
521#define CATCH_CATCH_ALL if ((false))
522#define CATCH_CATCH_ANON(type) if ((false))
525#define CATCH_CATCH_ALL catch (...)
526#define CATCH_CATCH_ANON(type) catch (type)
529#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
530#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
533#if defined( CATCH_PLATFORM_WINDOWS ) && \
534 !defined( CATCH_CONFIG_COLOUR_WIN32 ) && \
535 !defined( CATCH_CONFIG_NO_COLOUR_WIN32 ) && \
536 !defined( CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 )
537# define CATCH_CONFIG_COLOUR_WIN32
540#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \
541 !defined( CATCH_CONFIG_STATIC )
542# ifdef Catch2_EXPORTS
545# define CATCH_EXPORT __declspec( dllimport )
554#ifndef CATCH_CONTEXT_HPP_INCLUDED
555#define CATCH_CONTEXT_HPP_INCLUDED
560 class IResultCapture;
604#ifndef CATCH_MOVE_AND_FORWARD_HPP_INCLUDED
605#define CATCH_MOVE_AND_FORWARD_HPP_INCLUDED
607#include <type_traits>
610#define CATCH_MOVE(...) static_cast<std::remove_reference_t<decltype(__VA_ARGS__)>&&>(__VA_ARGS__)
613#define CATCH_FORWARD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__)
618#ifndef CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED
619#define CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED
647#ifndef CATCH_UNIQUE_NAME_HPP_INCLUDED
648#define CATCH_UNIQUE_NAME_HPP_INCLUDED
662#ifndef CATCH_CONFIG_COUNTER_HPP_INCLUDED
663#define CATCH_CONFIG_COUNTER_HPP_INCLUDED
666#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L )
667 #define CATCH_INTERNAL_CONFIG_COUNTER
670#if defined( CATCH_INTERNAL_CONFIG_COUNTER ) && \
671 !defined( CATCH_CONFIG_NO_COUNTER ) && \
672 !defined( CATCH_CONFIG_COUNTER )
673# define CATCH_CONFIG_COUNTER
678#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
679#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
680#ifdef CATCH_CONFIG_COUNTER
681# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
683# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
689#ifndef CATCH_INTERFACES_CAPTURE_HPP_INCLUDED
690#define CATCH_INTERFACES_CAPTURE_HPP_INCLUDED
696#ifndef CATCH_STRINGREF_HPP_INCLUDED
697#define CATCH_STRINGREF_HPP_INCLUDED
719 static constexpr char const*
const s_empty =
"";
727 StringRef(
char const* rawChars ) noexcept;
735 :
m_start( stdString.c_str() ),
736 m_size( stdString.size() )
739 explicit operator std::string()
const {
745 return m_size == other.m_size
749 return !(*
this == other);
760 constexpr auto empty() const noexcept ->
bool {
772 const auto shortened_size =
m_size - start;
773 return StringRef(
m_start + start, (shortened_size < length) ? shortened_size : length);
780 constexpr char const*
data() const noexcept {
802 constexpr auto operator ""_sr(
char const* rawChars, std::size_t size )
noexcept ->
StringRef {
807constexpr auto operator ""_catch_sr(
char const* rawChars, std::size_t size )
noexcept ->
Catch::StringRef {
814#ifndef CATCH_RESULT_TYPE_HPP_INCLUDED
815#define CATCH_RESULT_TYPE_HPP_INCLUDED
860 static_cast<int>( rhs ) );
875#ifndef CATCH_UNIQUE_PTR_HPP_INCLUDED
876#define CATCH_UNIQUE_PTR_HPP_INCLUDED
879#include <type_traits>
889 template <
typename T>
900 template <typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
905 template <typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
907 reset(from.release());
920 reset(rhs.release());
960 explicit operator bool()
const {
965 auto temp = lhs.
m_ptr;
972 template <
typename T>
973 class unique_ptr<T[]>;
975 template <
typename T,
typename... Args>
987#ifndef CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED
988#define CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED
994#ifndef CATCH_CLOCK_HPP_INCLUDED
995#define CATCH_CLOCK_HPP_INCLUDED
1000 namespace Benchmark {
1004 template <
typename Clock>
1018 template <
typename Duration = Benchmark::FDuration>
1019 struct BenchmarkStats;
1055 Counts& assertions ) = 0;
1086 std::string&& message,
1093 std::string&& message,
1119#ifndef CATCH_INTERFACES_CONFIG_HPP_INCLUDED
1120#define CATCH_INTERFACES_CONFIG_HPP_INCLUDED
1124#ifndef CATCH_NONCOPYABLE_HPP_INCLUDED
1125#define CATCH_NONCOPYABLE_HPP_INCLUDED
1235#ifndef CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED
1236#define CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED
1243 class TestCaseHandle;
1244 struct TestCaseInfo;
1245 class ITestCaseRegistry;
1246 class IExceptionTranslatorRegistry;
1247 class IExceptionTranslator;
1248 class ReporterRegistry;
1249 class IReporterFactory;
1250 class ITagAliasRegistry;
1252 class IMutableEnumValuesRegistry;
1253 struct SourceLineInfo;
1255 class StartupExceptionRegistry;
1256 class EventListenerFactory;
1295#ifndef CATCH_BENCHMARK_STATS_HPP_INCLUDED
1296#define CATCH_BENCHMARK_STATS_HPP_INCLUDED
1302#ifndef CATCH_ESTIMATE_HPP_INCLUDED
1303#define CATCH_ESTIMATE_HPP_INCLUDED
1306 namespace Benchmark {
1307 template <
typename Type>
1322#ifndef CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED
1323#define CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED
1326 namespace Benchmark {
1362 template <
class Dummy>
1381#ifndef CATCH_ENVIRONMENT_HPP_INCLUDED
1382#define CATCH_ENVIRONMENT_HPP_INCLUDED
1386 namespace Benchmark {
1403#ifndef CATCH_EXECUTION_PLAN_HPP_INCLUDED
1404#define CATCH_EXECUTION_PLAN_HPP_INCLUDED
1410#ifndef CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED
1411#define CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED
1417#ifndef CATCH_CHRONOMETER_HPP_INCLUDED
1418#define CATCH_CHRONOMETER_HPP_INCLUDED
1424#ifndef CATCH_OPTIMIZER_HPP_INCLUDED
1425#define CATCH_OPTIMIZER_HPP_INCLUDED
1427#if defined(_MSC_VER) || defined(__IAR_SYSTEMS_ICC__)
1432#include <type_traits>
1435 namespace Benchmark {
1436#if defined(__GNUC__) || defined(__clang__)
1437 template <
typename T>
1438 inline void keep_memory(T* p) {
1439 asm volatile(
"" : :
"g"(p) :
"memory");
1441 inline void keep_memory() {
1442 asm volatile(
"" : : :
"memory");
1446 inline void optimizer_barrier() { keep_memory(); }
1448#elif defined(_MSC_VER) || defined(__IAR_SYSTEMS_ICC__)
1450#if defined(_MSVC_VER)
1451#pragma optimize("", off)
1452#elif defined(__IAR_SYSTEMS_ICC__)
1454#pragma optimize=disable
1456 template <
typename T>
1457 inline void keep_memory(T* p) {
1459 *
reinterpret_cast<char volatile*
>(p) = *
reinterpret_cast<char const volatile*
>(p);
1462#if defined(_MSVC_VER)
1463#pragma optimize("", on)
1467 inline void optimizer_barrier() {
1468 std::atomic_thread_fence(std::memory_order_seq_cst);
1474 template <
typename T>
1479 template <
typename Fn,
typename... Args>
1480 inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<!std::is_same<void,
decltype(fn(args...))>::value> {
1484 template <
typename Fn,
typename... Args>
1485 inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<std::is_same<void,
decltype(fn(args...))>::value> {
1494#ifndef CATCH_META_HPP_INCLUDED
1495#define CATCH_META_HPP_INCLUDED
1497#include <type_traits>
1504 template <
typename Fun,
typename... Args>
1506 template <
typename...>
1510 template <
typename T>
1513 template <
typename Fun,
typename... Args>
1514 struct is_callable<Fun(Args...)> : decltype(is_callable_tester::test<Fun, Args...>(0)) {};
1517#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
1520 template <
typename Func,
typename... U>
1521 using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U...>>>;
1523 template <
typename Func,
typename... U>
1536 namespace Benchmark {
1547 template <
typename Clock>
1553 return std::chrono::duration_cast<std::chrono::nanoseconds>(
1564 template <
typename Fun>
1574 template <
typename Fun>
1576 measure([&fun](
int) {
return fun(); }, std::true_type());
1579 template <
typename Fun>
1581 Detail::optimizer_barrier();
1585 Detail::optimizer_barrier();
1596#include <type_traits>
1599 namespace Benchmark {
1601 template <
typename T,
typename U>
1603 : std::is_same<std::decay_t<T>, std::decay_t<U>> {};
1622 template <
typename Fun>
1643 template <
typename Fun,
1644 std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value,
int> = 0>
1671#ifndef CATCH_REPEAT_HPP_INCLUDED
1672#define CATCH_REPEAT_HPP_INCLUDED
1674#include <type_traits>
1677 namespace Benchmark {
1679 template <
typename Fun>
1682 for (
int i = 0; i < k; ++i) {
1688 template <
typename Fun>
1701#ifndef CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
1702#define CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
1708#ifndef CATCH_MEASURE_HPP_INCLUDED
1709#define CATCH_MEASURE_HPP_INCLUDED
1715#ifndef CATCH_COMPLETE_INVOKE_HPP_INCLUDED
1716#define CATCH_COMPLETE_INVOKE_HPP_INCLUDED
1720 namespace Benchmark {
1722 template <
typename T>
1727 template <
typename T>
1730 template <
typename Result>
1732 template <
typename Fun,
typename... Args>
1733 static Result
invoke(Fun&& fun, Args&&... args) {
1739 template <
typename Fun,
typename... Args>
1747 template <
typename Fun,
typename... Args>
1754 template <
typename Fun>
1766#ifndef CATCH_TIMING_HPP_INCLUDED
1767#define CATCH_TIMING_HPP_INCLUDED
1770#include <type_traits>
1773 namespace Benchmark {
1774 template <
typename Result>
1780 template <
typename Func,
typename... Args>
1788 namespace Benchmark {
1790 template <
typename Clock,
typename Fun,
typename... Args>
1792 auto start = Clock::now();
1794 auto end = Clock::now();
1795 auto delta = end - start;
1804#include <type_traits>
1809 template <
typename Clock,
typename Fun>
1813 template <
typename Clock,
typename Fun>
1821 template <
typename Clock,
typename Fun>
1828 template <
typename Clock,
typename Fun>
1831 const int initial_iterations,
1833 auto iters = initial_iterations;
1834 while (iters < (1 << 30)) {
1861 template <
typename Clock>
1865 std::chrono::duration_cast<IDuration>(
warmup_time ),
1870 std::vector<FDuration> times;
1872 times.reserve( num_samples );
1873 for (
size_t i = 0; i < num_samples; ++i ) {
1877 if ( sample_time < FDuration::zero() ) {
1878 sample_time = FDuration::zero();
1893#ifndef CATCH_ESTIMATE_CLOCK_HPP_INCLUDED
1894#define CATCH_ESTIMATE_CLOCK_HPP_INCLUDED
1900#ifndef CATCH_STATS_HPP_INCLUDED
1901#define CATCH_STATS_HPP_INCLUDED
1907 namespace Benchmark {
1919 double mean(
double const* first,
double const* last );
1932 double ( *estimator )(
double const*,
double const* ) );
1941 unsigned int n_resamples,
1955 namespace Benchmark {
1957 template <
typename Clock>
1959 const size_t points =
static_cast<size_t>( k + 1 );
1962 std::vector<TimePoint<Clock>> times(points);
1963 for (
auto& time : times ) {
1964 time = Clock::now();
1967 std::vector<double> deltas;
1968 deltas.reserve(
static_cast<size_t>(k));
1969 for (
size_t idx = 1; idx < points; ++idx ) {
1970 deltas.push_back(
static_cast<double>(
1971 ( times[idx] - times[idx - 1] ).count() ) );
1987 template <
typename Clock>
1992 template <
typename Clock>
2001 template <
typename Clock>
2003 auto time_limit = (std::min)(
2006 auto time_clock = [](
int k) {
2008 for (
int i = 0; i < k; ++i) {
2009 volatile auto ignored = Clock::now();
2017 std::vector<double> times;
2018 int nsamples =
static_cast<int>(std::ceil(time_limit / r.elapsed));
2019 times.reserve(
static_cast<size_t>(nsamples));
2020 for (
int s = 0; s < nsamples; ++s ) {
2021 times.push_back(
static_cast<double>(
2022 ( time_clock( r.iterations ) / r.iterations )
2031 template <
typename Clock>
2033#if defined(__clang__)
2034# pragma clang diagnostic push
2035# pragma clang diagnostic ignored "-Wexit-time-destructors"
2038#if defined(__clang__)
2039# pragma clang diagnostic pop
2061#ifndef CATCH_ANALYSE_HPP_INCLUDED
2062#define CATCH_ANALYSE_HPP_INCLUDED
2068#ifndef CATCH_SAMPLE_ANALYSIS_HPP_INCLUDED
2069#define CATCH_SAMPLE_ANALYSIS_HPP_INCLUDED
2075 namespace Benchmark {
2092 namespace Benchmark {
2094 SampleAnalysis analyse(
const IConfig &cfg, FDuration* first, FDuration* last);
2113 template <
class FUN>
2117 template <
typename Clock>
2120 auto run_time = std::max(min_time, std::chrono::duration_cast<
decltype(min_time)>(cfg.
benchmarkWarmupTime()));
2122 int new_iters =
static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed));
2126 template <
typename Clock = default_clock>
2128 static_assert( Clock::is_steady,
2129 "Benchmarking clock should be steady" );
2142 plan.estimated_duration.count(),
2143 plan.iterations_per_sample,
2144 cfg->benchmarkSamples(),
2145 cfg->benchmarkResamples(),
2146 env.clock_resolution.mean.count(),
2147 env.clock_cost.mean.count()
2156 auto analysis =
Detail::analyse(*cfg, samples.data(), samples.data() + samples.size());
2160 getResultCapture().benchmarkFailed(
"Benchmark failed due to failed assertion"_sr);
2165 std::rethrow_exception(std::current_exception());
2170 template <typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value,
int> = 0>
2173 if (!cfg->skipBenchmarks()) {
2180 explicit operator bool() {
2191#define INTERNAL_CATCH_GET_1_ARG(arg1, arg2, ...) arg1
2192#define INTERNAL_CATCH_GET_2_ARG(arg1, arg2, ...) arg2
2194#define INTERNAL_CATCH_BENCHMARK(BenchmarkName, name, benchmarkIndex)\
2195 if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
2196 BenchmarkName = [&](int benchmarkIndex)
2198#define INTERNAL_CATCH_BENCHMARK_ADVANCED(BenchmarkName, name)\
2199 if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
2202#if defined(CATCH_CONFIG_PREFIX_ALL)
2204#define CATCH_BENCHMARK(...) \
2205 INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
2206#define CATCH_BENCHMARK_ADVANCED(name) \
2207 INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name)
2211#define BENCHMARK(...) \
2212 INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
2213#define BENCHMARK_ADVANCED(name) \
2214 INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name)
2223#ifndef CATCH_CONSTRUCTOR_HPP_INCLUDED
2224#define CATCH_CONSTRUCTOR_HPP_INCLUDED
2227#include <type_traits>
2230 namespace Benchmark {
2232 template <
typename T,
bool Destruct>
2249 template <
typename... Args>
2255 template <
bool AllowManualDestruction = !Destruct>
2263 template <
typename U>
2266 template <
typename U>
2269#if defined( __GNUC__ ) && __GNUC__ <= 6
2270# pragma GCC diagnostic push
2271# pragma GCC diagnostic ignored "-Wstrict-aliasing"
2276 return *
reinterpret_cast<T const*
>(
data );
2278#if defined( __GNUC__ ) && __GNUC__ <= 6
2279# pragma GCC diagnostic pop
2282 alignas( T )
unsigned char data[
sizeof( T )]{};
2286 template <
typename T>
2289 template <
typename T>
2299#ifndef CATCH_APPROX_HPP_INCLUDED
2300#define CATCH_APPROX_HPP_INCLUDED
2304#ifndef CATCH_TOSTRING_HPP_INCLUDED
2305#define CATCH_TOSTRING_HPP_INCLUDED
2310#include <type_traits>
2324#ifndef CATCH_CONFIG_WCHAR_HPP_INCLUDED
2325#define CATCH_CONFIG_WCHAR_HPP_INCLUDED
2331#if defined(__DJGPP__)
2332# define CATCH_INTERNAL_CONFIG_NO_WCHAR
2335#if !defined( CATCH_INTERNAL_CONFIG_NO_WCHAR ) && \
2336 !defined( CATCH_CONFIG_NO_WCHAR ) && \
2337 !defined( CATCH_CONFIG_WCHAR )
2338# define CATCH_CONFIG_WCHAR
2344#ifndef CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED
2345#define CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED
2363 std::string
str()
const;
2365 void str(std::string
const&
str);
2367#if defined(__GNUC__) && !defined(__clang__)
2368#pragma GCC diagnostic push
2370#pragma GCC diagnostic ignored "-Wpragmas"
2375#pragma GCC diagnostic ignored "-Waddress"
2376#pragma GCC diagnostic ignored "-Wnonnull-compare"
2379 template<
typename T>
2385#if defined(__GNUC__) && !defined(__clang__)
2386#pragma GCC diagnostic pop
2395#ifndef CATCH_VOID_TYPE_HPP_INCLUDED
2396#define CATCH_VOID_TYPE_HPP_INCLUDED
2402 template <
typename...>
2405 template <
typename... Ts>
2415#ifndef CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
2416#define CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
2440 template<
typename E>
2442 static_assert(
sizeof(int) >=
sizeof(E),
"Cannot serialize enum to int");
2443 std::vector<int> intValues;
2444 intValues.reserve( values.size() );
2445 for(
auto enumValue : values )
2446 intValues.push_back(
static_cast<int>( enumValue ) );
2455#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
2456#include <string_view>
2460#pragma warning(push)
2461#pragma warning(disable:4180)
2476 auto ret = std::char_traits<char>::find(str, n,
'\0');
2477 if (ret !=
nullptr) {
2478 return static_cast<std::size_t
>(ret - str);
2494 template<
typename T>
2499 template<
typename T>
2501 template<
typename Stream,
typename U>
2503 ->
decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type());
2505 template<
typename,
typename>
2506 static auto test(...)->std::false_type;
2512 template<
typename E>
2515 template<
typename T>
2517 !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value,
2521 template<
typename T>
2523 !std::is_enum<T>::value && std::is_base_of<std::exception, T>::value,
2529 template<
typename T>
2531 std::is_enum<T>::value,
2536#if defined(_MANAGED)
2538 template<
typename T>
2539 std::string clrReferenceToString( T^ ref ) {
2541 return std::string(
"null");
2542 auto bytes = System::Text::Encoding::UTF8->GetBytes(ref->ToString());
2543 cli::pin_ptr<System::Byte> p = &bytes[0];
2544 return std::string(
reinterpret_cast<char const *
>(p), bytes->Length);
2551 template <
typename T,
typename =
void>
2553 template <
typename Fake = T>
2555 std::enable_if_t<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>
2560 rss.operator<<(value);
2564 template <
typename Fake = T>
2566 std::enable_if_t<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>
2568#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
2571 return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
2580 template <
typename T>
2582 return ::Catch::StringMaker<std::remove_cv_t<std::remove_reference_t<T>>>::convert(e);
2585 template<
typename E>
2587 return ::Catch::Detail::stringify(
static_cast<std::underlying_type_t<E>
>(e));
2590#if defined(_MANAGED)
2591 template <
typename T>
2592 std::string stringify( T^ e ) {
2593 return ::Catch::StringMaker<T^>::convert(e);
2603 static std::string
convert(
const std::string& str);
2606#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
2609 static std::string convert(std::string_view str);
2619 static std::string
convert(
char * str);
2622#if defined(CATCH_CONFIG_WCHAR)
2625 static std::string
convert(
const std::wstring& wstr);
2628# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
2631 static std::string convert(std::wstring_view str);
2641 static std::string
convert(
wchar_t * str);
2654 static std::string
convert(
signed char const* str) {
2655 auto reinterpreted =
reinterpret_cast<char const*
>(str);
2662 static std::string
convert(
unsigned char const* str) {
2663 auto reinterpreted =
reinterpret_cast<char const*
>(str);
2669#if defined(CATCH_CONFIG_CPP17_BYTE)
2671 struct StringMaker<std::byte> {
2672 static std::string convert(std::byte value);
2677 static std::string
convert(
int value);
2681 static std::string
convert(
long value);
2697 static std::string
convert(
unsigned long long value);
2703 using namespace std::string_literals;
2704 return b ?
"true"s :
"false"s;
2710 static std::string
convert(
char c);
2724 using namespace std::string_literals;
2731 static std::string
convert(
float value);
2737 static std::string
convert(
double value);
2741 template <
typename T>
2743 template <
typename U>
2746 return ::Catch::Detail::rawMemoryToString(p);
2753 template <
typename R,
typename C>
2757 return ::Catch::Detail::rawMemoryToString(p);
2764#if defined(_MANAGED)
2765 template <
typename T>
2766 struct StringMaker<T^> {
2767 static std::string convert( T^ ref ) {
2768 return ::Catch::Detail::clrReferenceToString(ref);
2774 template<
typename InputIterator,
typename Sentinel = InputIterator>
2778 if (first != last) {
2780 for (++first; first != last; ++first)
2794#if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS)
2795# define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
2796# define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
2797# define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
2798# define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
2802#if defined(CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER)
2805 template<
typename T1,
typename T2>
2806 struct StringMaker<std::pair<T1, T2> > {
2807 static std::string convert(
const std::pair<T1, T2>& pair) {
2808 ReusableStringStream rss;
2820#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
2823 template<
typename T>
2824 struct StringMaker<std::optional<T> > {
2825 static std::string convert(
const std::optional<T>& optional) {
2826 if (optional.has_value()) {
2827 return ::Catch::Detail::stringify(*optional);
2834 struct StringMaker<std::nullopt_t> {
2835 static std::string convert(
const std::nullopt_t&) {
2843#if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER)
2850 bool = (N < std::tuple_size<Tuple>::value)
2852 struct TupleElementPrinter {
2853 static void print(
const Tuple& tuple, std::ostream& os) {
2854 os << (N ?
", " :
" ")
2856 TupleElementPrinter<Tuple, N + 1>::print(tuple, os);
2864 struct TupleElementPrinter<Tuple, N, false> {
2865 static void print(
const Tuple&, std::ostream&) {}
2871 template<
typename ...Types>
2872 struct StringMaker<std::tuple<Types...>> {
2873 static std::string convert(
const std::tuple<Types...>& tuple) {
2874 ReusableStringStream rss;
2876 Detail::TupleElementPrinter<std::tuple<Types...>>::print(tuple, rss.get());
2884#if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_VARIANT)
2888 struct StringMaker<std::monostate> {
2889 static std::string convert(
const std::monostate&) {
2894 template<
typename... Elements>
2895 struct StringMaker<std::variant<Elements...>> {
2896 static std::string convert(
const std::variant<Elements...>& variant) {
2897 if (variant.valueless_by_exception()) {
2898 return "{valueless variant}";
2901 [](
const auto& value) {
2902 return ::Catch::Detail::stringify(value);
2918 template <
typename T,
typename =
void>
2921 template <
typename T>
2925 template <
typename T>
2928#if defined(_MANAGED)
2929 template <
typename T>
2931 static const bool value =
false;
2935 template<
typename Range>
2937 return ::Catch::Detail::rangeToString( begin( range ), end( range ) );
2941 template<
typename Allocator>
2957 template<
typename R>
2958 struct StringMaker<R, std::enable_if_t<is_range<R>::value && !::Catch::Detail::IsStreamInsertable<R>::value>> {
2964 template <
typename T,
size_t SZ>
2982template <
class Ratio>
2986 rss <<
'[' << Ratio::num <<
'/'
2987 << Ratio::den <<
']';
3019 template<
typename Value,
typename Ratio>
3021 static std::string
convert(std::chrono::duration<Value, Ratio>
const& duration) {
3027 template<
typename Value>
3029 static std::string
convert(std::chrono::duration<Value, std::ratio<1>>
const& duration) {
3031 rss << duration.count() <<
" s";
3035 template<
typename Value>
3037 static std::string
convert(std::chrono::duration<Value, std::ratio<60>>
const& duration) {
3039 rss << duration.count() <<
" m";
3043 template<
typename Value>
3045 static std::string
convert(std::chrono::duration<Value, std::ratio<3600>>
const& duration) {
3047 rss << duration.count() <<
" h";
3055 template<
typename Clock,
typename Duration>
3057 static std::string
convert(std::chrono::time_point<Clock, Duration>
const& time_point) {
3058 return ::Catch::Detail::stringify(time_point.time_since_epoch()) +
" since epoch";
3062 template<
typename Duration>
3063 struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>> {
3064 static std::string
convert(std::chrono::time_point<std::chrono::system_clock, Duration>
const& time_point) {
3065 auto converted = std::chrono::system_clock::to_time_t(time_point);
3068 std::tm timeInfo = {};
3069 const auto err = gmtime_s(&timeInfo, &converted);
3071 return "gmtime from provided timepoint has failed. This "
3072 "happens e.g. with pre-1970 dates using Microsoft libc";
3075 std::tm* timeInfo = std::gmtime(&converted);
3078 auto const timeStampSize =
sizeof(
"2017-01-16T17:06:45Z");
3079 char timeStamp[timeStampSize];
3080 const char *
const fmt =
"%Y-%m-%dT%H:%M:%SZ";
3083 std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
3085 std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
3087 return std::string(timeStamp, timeStampSize - 1);
3093#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
3095 template<> struct StringMaker<enumName> { \
3096 static std::string convert( enumName value ) { \
3097 static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
3098 return static_cast<std::string>(enumInfo.lookup( static_cast<int>( value ) )); \
3103#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
3111#include <type_traits>
3124 explicit Approx (
double value );
3130 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3132 Approx approx(
static_cast<double>(value) );
3139 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3144 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3145 friend bool operator == (
const T& lhs,
Approx const& rhs ) {
3146 auto lhs_v =
static_cast<double>(lhs);
3150 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3151 friend bool operator == (
Approx const& lhs,
const T& rhs ) {
3155 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3156 friend bool operator != ( T
const& lhs,
Approx const& rhs ) {
3160 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3161 friend bool operator != (
Approx const& lhs, T
const& rhs ) {
3165 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3166 friend bool operator <= ( T
const& lhs,
Approx const& rhs ) {
3167 return static_cast<double>(lhs) < rhs.
m_value || lhs == rhs;
3170 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3171 friend bool operator <= (
Approx const& lhs, T
const& rhs ) {
3172 return lhs.
m_value <
static_cast<double>(rhs) || lhs == rhs;
3175 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3176 friend bool operator >= ( T
const& lhs,
Approx const& rhs ) {
3177 return static_cast<double>(lhs) > rhs.
m_value || lhs == rhs;
3180 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3181 friend bool operator >= (
Approx const& lhs, T
const& rhs ) {
3182 return lhs.
m_value >
static_cast<double>(rhs) || lhs == rhs;
3185 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3187 const auto epsilonAsDouble =
static_cast<double>(newEpsilon);
3192 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3194 const auto marginAsDouble =
static_cast<double>(newMargin);
3199 template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
3201 m_scale =
static_cast<double>(newScale);
3205 std::string toString()
const;
3215 Approx operator ""_a(
long double val);
3216 Approx operator ""_a(
unsigned long long val);
3229#ifndef CATCH_ASSERTION_INFO_HPP_INCLUDED
3230#define CATCH_ASSERTION_INFO_HPP_INCLUDED
3234#ifndef CATCH_SOURCE_LINE_INFO_HPP_INCLUDED
3235#define CATCH_SOURCE_LINE_INFO_HPP_INCLUDED
3260#define CATCH_INTERNAL_LINEINFO \
3261 ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
3281#ifndef CATCH_ASSERTION_RESULT_HPP_INCLUDED
3282#define CATCH_ASSERTION_RESULT_HPP_INCLUDED
3286#ifndef CATCH_LAZY_EXPR_HPP_INCLUDED
3287#define CATCH_LAZY_EXPR_HPP_INCLUDED
3293 class ITransientExpression;
3309 constexpr explicit operator bool()
const {
3366#ifndef CATCH_CASE_SENSITIVE_HPP_INCLUDED
3367#define CATCH_CASE_SENSITIVE_HPP_INCLUDED
3378#ifndef CATCH_CONFIG_HPP_INCLUDED
3379#define CATCH_CONFIG_HPP_INCLUDED
3383#ifndef CATCH_TEST_SPEC_HPP_INCLUDED
3384#define CATCH_TEST_SPEC_HPP_INCLUDED
3387#pragma clang diagnostic push
3388#pragma clang diagnostic ignored "-Wpadded"
3393#ifndef CATCH_WILDCARD_PATTERN_HPP_INCLUDED
3394#define CATCH_WILDCARD_PATTERN_HPP_INCLUDED
3412 bool matches( std::string
const& str )
const;
3415 std::string normaliseString( std::string
const& str )
const;
3431 struct TestCaseInfo;
3432 class TestCaseHandle;
3441 std::string
const&
name()
const;
3456 explicit NamePattern( std::string
const&
name, std::string
const& filterString );
3459 void serializeTo( std::ostream& out )
const override;
3466 explicit TagPattern( std::string
const& tag, std::string
const& filterString );
3469 void serializeTo( std::ostream& out )
const override;
3489 static std::string extractFilterName( Filter
const& filter );
3494 std::vector<TestCaseHandle const*>
tests;
3521#pragma clang diagnostic pop
3527#ifndef CATCH_OPTIONAL_HPP_INCLUDED
3528#define CATCH_OPTIONAL_HPP_INCLUDED
3536 template<
typename T>
3565 if ( &_other !=
this ) {
3572 if ( &_other !=
this ) {
3611 explicit operator bool()
const {
3638#ifndef CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED
3639#define CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED
3652 std::uint32_t generateRandomSeed(GenerateFrom from);
3659#ifndef CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED
3660#define CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED
3669 enum class ColourMode : std::uint8_t;
3673 std::vector<std::string> splitReporterSpec( StringRef reporterSpec );
3675 Optional<ColourMode> stringToColourMode( StringRef colourMode );
3696 return !( lhs == rhs );
3704 std::map<std::string, std::string> customOptions );
3729 Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec );
3758 return !( lhs == rhs );
3822 std::vector<ProcessedReporterSpec>
const&
3843 uint32_t
rngSeed()
const override;
3872#ifndef CATCH_GET_RANDOM_SEED_HPP_INCLUDED
3873#define CATCH_GET_RANDOM_SEED_HPP_INCLUDED
3879 std::uint32_t getSeed();
3885#ifndef CATCH_MESSAGE_HPP_INCLUDED
3886#define CATCH_MESSAGE_HPP_INCLUDED
3902#ifndef CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED
3903#define CATCH_CONFIG_PREFIX_MESSAGES_HPP_INCLUDED
3906#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_PREFIX_MESSAGES)
3907 #define CATCH_CONFIG_PREFIX_MESSAGES
3913#ifndef CATCH_STREAM_END_STOP_HPP_INCLUDED
3914#define CATCH_STREAM_END_STOP_HPP_INCLUDED
3926 template <
typename T>
3937#ifndef CATCH_MESSAGE_INFO_HPP_INCLUDED
3938#define CATCH_MESSAGE_INFO_HPP_INCLUDED
3975 struct SourceLineInfo;
3976 class IResultCapture;
3980 template<
typename T>
3993 m_info(macroName, lineInfo, type) {}
3995 template<
typename T>
4027 void captureValue(
size_t index, std::string
const& value );
4029 template<
typename T>
4034 template<
typename T,
typename... Ts>
4044#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
4046 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
4047 catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
4048 catchAssertionHandler.complete(); \
4052#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
4053 Catch::Capturer varName( macroName##_catch_sr, \
4054 CATCH_INTERNAL_LINEINFO, \
4055 Catch::ResultWas::Info, \
4056 #__VA_ARGS__##_catch_sr ); \
4057 varName.captureValues( 0, __VA_ARGS__ )
4060#define INTERNAL_CATCH_INFO( macroName, log ) \
4061 const Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
4064#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
4065 Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
4068#if defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE)
4070 #define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
4071 #define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
4072 #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
4073 #define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", __VA_ARGS__ )
4075#elif defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE)
4077 #define CATCH_INFO( msg ) (void)(0)
4078 #define CATCH_UNSCOPED_INFO( msg ) (void)(0)
4079 #define CATCH_WARN( msg ) (void)(0)
4080 #define CATCH_CAPTURE( ... ) (void)(0)
4082#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE)
4084 #define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
4085 #define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
4086 #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
4087 #define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", __VA_ARGS__ )
4089#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE)
4091 #define INFO( msg ) (void)(0)
4092 #define UNSCOPED_INFO( msg ) (void)(0)
4093 #define WARN( msg ) (void)(0)
4094 #define CAPTURE( ... ) (void)(0)
4104#ifndef CATCH_SECTION_INFO_HPP_INCLUDED
4105#define CATCH_SECTION_INFO_HPP_INCLUDED
4109#ifndef CATCH_TOTALS_HPP_INCLUDED
4110#define CATCH_TOTALS_HPP_INCLUDED
4120 std::uint64_t
total()
const;
4153 const char*
const =
nullptr ):
4173#ifndef CATCH_SESSION_HPP_INCLUDED
4174#define CATCH_SESSION_HPP_INCLUDED
4178#ifndef CATCH_COMMANDLINE_HPP_INCLUDED
4179#define CATCH_COMMANDLINE_HPP_INCLUDED
4183#ifndef CATCH_CLARA_HPP_INCLUDED
4184#define CATCH_CLARA_HPP_INCLUDED
4186#if defined( __clang__ )
4187# pragma clang diagnostic push
4188# pragma clang diagnostic ignored "-Wweak-vtables"
4189# pragma clang diagnostic ignored "-Wshadow"
4190# pragma clang diagnostic ignored "-Wdeprecated"
4193#if defined( __GNUC__ )
4194# pragma GCC diagnostic push
4195# pragma GCC diagnostic ignored "-Wsign-conversion"
4198#ifndef CLARA_CONFIG_OPTIONAL_TYPE
4199# ifdef __has_include
4200# if __has_include( <optional>) && __cplusplus >= 201703L
4202# define CLARA_CONFIG_OPTIONAL_TYPE std::optional
4213#include <type_traits>
4235 template <
typename T>
4239 template <
typename F,
typename =
void>
4242 template <
typename F>
4246 std::declval<F>()( fake_arg() ) )
4248 > : std::true_type {};
4252 template <
typename L>
4256 template <
typename ClassT,
typename ReturnT,
typename...
Args>
4261 template <
typename ClassT,
typename ReturnT,
typename ArgT>
4264 using ArgType = std::remove_const_t<std::remove_reference_t<ArgT>>;
4282 using Iterator = std::vector<StringRef>::const_iterator;
4292 explicit operator bool()
const {
4337 template <
typename T>
4405 template <
typename T =
void>
4408 template <
typename U>
4415 template <
typename U>
4429 explicit operator bool()
const {
4452 std::string&& message ):
4488 template <
typename T>
4490 std::stringstream ss( source );
4494 "Unable to convert '" + source +
4495 "' to destination type" );
4501 std::string& target );
4502 ParserResult convertInto( std::string
const& source,
bool& target );
4504#ifdef CLARA_CONFIG_OPTIONAL_TYPE
4505 template <
typename T>
4506 auto convertInto( std::string
const& source,
4507 CLARA_CONFIG_OPTIONAL_TYPE<T>& target )
4510 auto result = convertInto( source, temp );
4520 virtual bool isFlag()
const;
4528 bool isFlag()
const override;
4541 template <
typename T>
4554 m_ref.push_back( temp );
4569 std::is_same<ReturnType, ParserResult>::value,
4570 "Lambda must return void or clara::ParserResult" );
4572 template <
typename L,
typename ArgType>
4573 static auto invoke( L
const& lambda, ArgType
const& arg )
4575 return lambda( arg );
4580 template <
typename L,
typename ArgType>
4581 static auto invoke( L
const& lambda, ArgType
const& arg )
4588 template <
typename ArgType,
typename L>
4593 return !result ? result
4595 L>::ReturnType>::invoke( lambda, temp );
4603 "Supplied lambda must take exactly one argument" );
4623 "Supplied lambda must take exactly one argument" );
4625 std::is_same<typename UnaryLambdaTraits<L>::ArgType,
4627 "flags must be boolean" );
4634 L>::ReturnType>::invoke(
m_lambda, flag );
4644 virtual auto parse( std::string
const& exeName,
4652 template <
typename DerivedT>
4655 template <
typename T>
4660 template <
typename DerivedT>
4672 template <
typename LambdaT>
4679 template <
typename T,
4680 typename =
typename std::enable_if_t<
4686 template <
typename LambdaT,
4687 typename =
typename std::enable_if_t<
4695 return static_cast<DerivedT&
>( *this );
4699 return static_cast<DerivedT&&
>( *this );
4704 return static_cast<DerivedT&
>( *this );
4709 return static_cast<DerivedT&
>( *this );
4717 if (
m_ref->isContainer() )
4732 using ParserRefImpl::ParserRefImpl;
4733 using ParserBase::parse;
4736 parse(std::string
const&,
4746 template <
typename LambdaT>
4747 explicit Opt(LambdaT
const& ref) :
4749 std::make_shared<
Detail::BoundFlagLambda<LambdaT>>(ref)) {}
4751 explicit Opt(
bool& ref);
4753 template <
typename LambdaT,
4754 typename =
typename std::enable_if_t<
4759 template <
typename LambdaT>
4763 template <
typename T,
4764 typename =
typename std::enable_if_t<
4782 using ParserBase::parse;
4785 parse(std::string
const&,
4794 std::shared_ptr<Detail::BoundValueRefBase>
m_ref;
4798 explicit ExeName(std::string& ref);
4800 template <
typename LambdaT>
4802 m_ref = std::make_shared<Detail::BoundLambda<LambdaT>>(lambda);
4808 parse(std::string
const&,
4845 template <
typename T>
4852 template <
typename T>
4858 std::vector<Detail::HelpColumns> getHelpColumns()
const;
4860 void writeToStream(std::ostream& os)
const;
4864 parser.writeToStream(os);
4870 using ParserBase::parse;
4872 parse(std::string
const& exeName,
4885 Args(
int argc,
char const*
const* argv);
4887 Args(std::initializer_list<StringRef> args);
4895 Help(
bool& showHelpFlag);
4902 template <
typename DerivedT>
4903 template <
typename T>
4906 return Parser() |
static_cast<DerivedT const&
>(*this) | other;
4913#if defined( __clang__ )
4914# pragma clang diagnostic pop
4917#if defined( __GNUC__ )
4918# pragma GCC diagnostic pop
4927 Clara::Parser makeCommandLineParser( ConfigData& config );
4945 #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
4951 template<
typename CharT>
4952 int run(
int argc, CharT
const *
const argv[]) {
4956 if (returnCode == 0)
4981#ifndef CATCH_TAG_ALIAS_HPP_INCLUDED
4982#define CATCH_TAG_ALIAS_HPP_INCLUDED
5004#ifndef CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
5005#define CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
5016#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \
5017 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5018 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
5019 namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \
5020 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
5025#ifndef CATCH_TEMPLATE_TEST_MACROS_HPP_INCLUDED
5026#define CATCH_TEMPLATE_TEST_MACROS_HPP_INCLUDED
5032#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ < 10
5033#pragma GCC diagnostic ignored "-Wparentheses"
5039#ifndef CATCH_TEST_MACROS_HPP_INCLUDED
5040#define CATCH_TEST_MACROS_HPP_INCLUDED
5044#ifndef CATCH_TEST_MACRO_IMPL_HPP_INCLUDED
5045#define CATCH_TEST_MACRO_IMPL_HPP_INCLUDED
5049#ifndef CATCH_ASSERTION_HANDLER_HPP_INCLUDED
5050#define CATCH_ASSERTION_HANDLER_HPP_INCLUDED
5054#ifndef CATCH_DECOMPOSER_HPP_INCLUDED
5055#define CATCH_DECOMPOSER_HPP_INCLUDED
5059#ifndef CATCH_COMPARE_TRAITS_HPP_INCLUDED
5060#define CATCH_COMPARE_TRAITS_HPP_INCLUDED
5063#include <type_traits>
5068#if defined( __GNUC__ ) && !defined( __clang__ )
5069# pragma GCC diagnostic push
5072# pragma GCC diagnostic ignored "-Wbool-compare"
5075# pragma GCC diagnostic ignored "-Wextra"
5078# pragma GCC diagnostic ignored "-Wfloat-equal"
5081#if defined( __clang__ )
5082# pragma clang diagnostic push
5085# pragma clang diagnostic ignored "-Wfloat-equal"
5088#define CATCH_DEFINE_COMPARABLE_TRAIT( id, op ) \
5089 template <typename, typename, typename = void> \
5090 struct is_##id##_comparable : std::false_type {}; \
5091 template <typename T, typename U> \
5092 struct is_##id##_comparable< \
5095 void_t<decltype( std::declval<T>() op std::declval<U>() )>> \
5096 : std::true_type {}; \
5097 template <typename, typename = void> \
5098 struct is_##id##_0_comparable : std::false_type {}; \
5099 template <typename T> \
5100 struct is_##id##_0_comparable<T, \
5101 void_t<decltype( std::declval<T>() op 0 )>> \
5102 : std::true_type {};
5112#undef CATCH_DEFINE_COMPARABLE_TRAIT
5114#if defined( __GNUC__ ) && !defined( __clang__ )
5115# pragma GCC diagnostic pop
5117#if defined( __clang__ )
5118# pragma clang diagnostic pop
5128#ifndef CATCH_LOGICAL_TRAITS_HPP_INCLUDED
5129#define CATCH_LOGICAL_TRAITS_HPP_INCLUDED
5131#include <type_traits>
5136#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510
5138 using std::conjunction;
5139 using std::disjunction;
5140 using std::negation;
5146 template <
class B1,
class... Bn>
5148 : std::conditional_t<bool( B1::value ), conjunction<Bn...>, B1> {};
5152 template <
class B1,
class... Bn>
5154 : std::conditional_t<bool( B1::value ), B1, disjunction<Bn...>> {};
5157 struct negation : std::integral_constant<bool, !bool(B::value)> {};
5166#include <type_traits>
5250#pragma warning(push)
5251#pragma warning(disable:4389)
5252#pragma warning(disable:4018)
5253#pragma warning(disable:4312)
5254#pragma warning(disable:4180)
5255#pragma warning(disable:4800)
5259# pragma clang diagnostic push
5260# pragma clang diagnostic ignored "-Wsign-compare"
5261# pragma clang diagnostic ignored "-Wnon-virtual-dtor"
5262#elif defined __GNUC__
5263# pragma GCC diagnostic push
5264# pragma GCC diagnostic ignored "-Wsign-compare"
5265# pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
5268#if defined(CATCH_CPP20_OR_GREATER) && __has_include(<compare>)
5270# if defined( __cpp_lib_three_way_comparison ) && \
5271 __cpp_lib_three_way_comparison >= 201907L
5272# define CATCH_CONFIG_CPP20_COMPARE_OVERLOADS
5280 template <
typename T>
5288 template <
typename T>
5290 : std::integral_constant<bool, std::is_arithmetic<T>{}> {};
5292#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS )
5296 struct capture_by_value<std::weak_ordering> : std::true_type {};
5298 struct capture_by_value<std::partial_ordering> : std::true_type {};
5301 template <
typename T>
5315 virtual void streamReconstructedExpression( std::ostream& os )
const;
5331 void formatReconstructedExpression( std::ostream &os, std::string
const& lhs, StringRef op, std::string
const& rhs );
5333 template<
typename LhsT,
typename RhsT>
5352 template<
typename T>
5355 "chained comparisons are not supported inside assertions, "
5356 "wrap the expression inside parentheses, or decompose it");
5359 template<
typename T>
5362 "chained comparisons are not supported inside assertions, "
5363 "wrap the expression inside parentheses, or decompose it");
5366 template<
typename T>
5369 "chained comparisons are not supported inside assertions, "
5370 "wrap the expression inside parentheses, or decompose it");
5373 template<
typename T>
5376 "chained comparisons are not supported inside assertions, "
5377 "wrap the expression inside parentheses, or decompose it");
5380 template<
typename T>
5383 "chained comparisons are not supported inside assertions, "
5384 "wrap the expression inside parentheses, or decompose it");
5387 template<
typename T>
5390 "chained comparisons are not supported inside assertions, "
5391 "wrap the expression inside parentheses, or decompose it");
5394 template<
typename T>
5397 "chained comparisons are not supported inside assertions, "
5398 "wrap the expression inside parentheses, or decompose it");
5401 template<
typename T>
5404 "chained comparisons are not supported inside assertions, "
5405 "wrap the expression inside parentheses, or decompose it");
5409 template<
typename LhsT>
5425 template<
typename LhsT>
5431#define CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( id, op ) \
5432 template <typename RhsT> \
5433 constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \
5434 -> std::enable_if_t< \
5435 Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
5436 Detail::negation<capture_by_value< \
5437 Detail::RemoveCVRef_t<RhsT>>>>::value, \
5438 BinaryExpr<LhsT, RhsT const&>> { \
5440 static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5442 template <typename RhsT> \
5443 constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
5444 -> std::enable_if_t< \
5445 Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
5446 capture_by_value<RhsT>>::value, \
5447 BinaryExpr<LhsT, RhsT>> { \
5449 static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5451 template <typename RhsT> \
5452 constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
5453 -> std::enable_if_t< \
5454 Detail::conjunction< \
5455 Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
5456 Detail::is_eq_0_comparable<LhsT>, \
5458 Detail::disjunction<std::is_same<RhsT, int>, \
5459 std::is_same<RhsT, long>>>::value, \
5460 BinaryExpr<LhsT, RhsT>> { \
5461 if ( rhs != 0 ) { throw_test_failure_exception(); } \
5463 static_cast<bool>( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \
5465 template <typename RhsT> \
5466 constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
5467 -> std::enable_if_t< \
5468 Detail::conjunction< \
5469 Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
5470 Detail::is_eq_0_comparable<RhsT>, \
5472 Detail::disjunction<std::is_same<LhsT, int>, \
5473 std::is_same<LhsT, long>>>::value, \
5474 BinaryExpr<LhsT, RhsT>> { \
5475 if ( lhs.m_lhs != 0 ) { throw_test_failure_exception(); } \
5476 return { static_cast<bool>( 0 op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5482 #undef CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR
5485#define CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( id, op ) \
5486 template <typename RhsT> \
5487 constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \
5488 -> std::enable_if_t< \
5489 Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
5490 Detail::negation<capture_by_value< \
5491 Detail::RemoveCVRef_t<RhsT>>>>::value, \
5492 BinaryExpr<LhsT, RhsT const&>> { \
5494 static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5496 template <typename RhsT> \
5497 constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
5498 -> std::enable_if_t< \
5499 Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
5500 capture_by_value<RhsT>>::value, \
5501 BinaryExpr<LhsT, RhsT>> { \
5503 static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5505 template <typename RhsT> \
5506 constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
5507 -> std::enable_if_t< \
5508 Detail::conjunction< \
5509 Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
5510 Detail::is_##id##_0_comparable<LhsT>, \
5511 std::is_same<RhsT, int>>::value, \
5512 BinaryExpr<LhsT, RhsT>> { \
5513 if ( rhs != 0 ) { throw_test_failure_exception(); } \
5515 static_cast<bool>( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \
5517 template <typename RhsT> \
5518 constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
5519 -> std::enable_if_t< \
5520 Detail::conjunction< \
5521 Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
5522 Detail::is_##id##_0_comparable<RhsT>, \
5523 std::is_same<LhsT, int>>::value, \
5524 BinaryExpr<LhsT, RhsT>> { \
5525 if ( lhs.m_lhs != 0 ) { throw_test_failure_exception(); } \
5526 return { static_cast<bool>( 0 op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5534 #undef CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR
5537#define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR( op ) \
5538 template <typename RhsT> \
5539 constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \
5540 -> std::enable_if_t< \
5541 !capture_by_value<Detail::RemoveCVRef_t<RhsT>>::value, \
5542 BinaryExpr<LhsT, RhsT const&>> { \
5544 static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5546 template <typename RhsT> \
5547 constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
5548 -> std::enable_if_t<capture_by_value<RhsT>::value, \
5549 BinaryExpr<LhsT, RhsT>> { \
5551 static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
5558 #undef CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR
5560 template<
typename RhsT>
5563 "operator&& is not supported inside assertions, "
5564 "wrap the expression inside parentheses, or decompose it");
5567 template<
typename RhsT>
5570 "operator|| is not supported inside assertions, "
5571 "wrap the expression inside parentheses, or decompose it");
5580 template <
typename T,
5581 std::enable_if_t<!capture_by_value<Detail::RemoveCVRef_t<T>>::value,
5587 template <
typename T,
5588 std::enable_if_t<capture_by_value<T>::value,
int> = 0>
5600# pragma clang diagnostic pop
5601#elif defined __GNUC__
5602# pragma GCC diagnostic pop
5636 template<
typename T>
5644 void handleExceptionThrownAsExpected();
5645 void handleUnexpectedExceptionNotThrown();
5646 void handleExceptionNotThrownAsExpected();
5647 void handleThrowingCallSkipped();
5648 void handleUnexpectedInflightException();
5653 auto allowThrows() const ->
bool;
5663#ifndef CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED
5664#define CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED
5667#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
5668 #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__##_catch_sr
5670 #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"_catch_sr
5677#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ <= 9
5678 #pragma GCC diagnostic ignored "-Wparentheses"
5681#if !defined(CATCH_CONFIG_DISABLE)
5683#if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
5688#define INTERNAL_CATCH_TRY
5689#define INTERNAL_CATCH_CATCH( capturer )
5693#define INTERNAL_CATCH_TRY try
5694#define INTERNAL_CATCH_CATCH( handler ) catch(...) { (handler).handleUnexpectedInflightException(); }
5699#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
5702 CATCH_INTERNAL_IGNORE_BUT_WARN(__VA_ARGS__); \
5703 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
5704 INTERNAL_CATCH_TRY { \
5705 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5706 CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
5707 catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
5708 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
5709 } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
5710 catchAssertionHandler.complete(); \
5711 } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) )
5715#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
5716 INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
5717 if( Catch::getResultCapture().lastAssertionPassed() )
5720#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
5721 INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
5722 if( !Catch::getResultCapture().lastAssertionPassed() )
5725#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
5727 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
5729 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5730 CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
5731 static_cast<void>(__VA_ARGS__); \
5732 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
5733 catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
5736 catchAssertionHandler.handleUnexpectedInflightException(); \
5738 catchAssertionHandler.complete(); \
5742#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
5744 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
5745 if( catchAssertionHandler.allowThrows() ) \
5747 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5748 CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
5749 CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
5750 static_cast<void>(__VA_ARGS__); \
5751 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
5752 catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
5755 catchAssertionHandler.handleExceptionThrownAsExpected(); \
5758 catchAssertionHandler.handleThrowingCallSkipped(); \
5759 catchAssertionHandler.complete(); \
5763#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
5765 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
5766 if( catchAssertionHandler.allowThrows() ) \
5768 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5769 CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
5770 CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
5771 static_cast<void>(expr); \
5772 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
5773 catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
5775 catch( exceptionType const& ) { \
5776 catchAssertionHandler.handleExceptionThrownAsExpected(); \
5779 catchAssertionHandler.handleUnexpectedInflightException(); \
5782 catchAssertionHandler.handleThrowingCallSkipped(); \
5783 catchAssertionHandler.complete(); \
5790#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
5792 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
5793 if( catchAssertionHandler.allowThrows() ) \
5795 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5796 CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
5797 CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
5798 static_cast<void>(__VA_ARGS__); \
5799 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
5800 catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
5803 Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher ); \
5806 catchAssertionHandler.handleThrowingCallSkipped(); \
5807 catchAssertionHandler.complete(); \
5815#ifndef CATCH_SECTION_HPP_INCLUDED
5816#define CATCH_SECTION_HPP_INCLUDED
5830#ifndef CATCH_CONFIG_STATIC_ANALYSIS_SUPPORT_HPP_INCLUDED
5831#define CATCH_CONFIG_STATIC_ANALYSIS_SUPPORT_HPP_INCLUDED
5834#if defined(__clang_analyzer__) || defined(__COVERITY__)
5835 #define CATCH_INTERNAL_CONFIG_STATIC_ANALYSIS_SUPPORT
5838#if defined( CATCH_INTERNAL_CONFIG_STATIC_ANALYSIS_SUPPORT ) && \
5839 !defined( CATCH_CONFIG_NO_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT ) && \
5840 !defined( CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT )
5841# define CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT
5848#ifndef CATCH_TIMER_HPP_INCLUDED
5849#define CATCH_TIMER_HPP_INCLUDED
5876 const char*
const =
nullptr );
5880 explicit operator bool()
const;
5892#if !defined(CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT)
5893# define INTERNAL_CATCH_SECTION( ... ) \
5894 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5895 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
5896 if ( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( \
5897 catch_internal_Section ) = \
5898 Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) \
5899 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
5901# define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \
5902 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5903 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
5904 if ( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( \
5905 catch_internal_Section ) = \
5906 Catch::SectionInfo( \
5907 CATCH_INTERNAL_LINEINFO, \
5908 ( Catch::ReusableStringStream() << __VA_ARGS__ ) \
5910 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
5924 int GetNewSectionHint( StringRef,
const char*
const =
nullptr );
5929# define INTERNAL_CATCH_SECTION( ... ) \
5930 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5931 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
5932 CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
5933 if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \
5934 catchInternalSectionHint, \
5935 catchInternalSectionHint = \
5936 Catch::Detail::GetNewSectionHint(__VA_ARGS__); \
5937 catchInternalPreviousSectionHint == __LINE__ ) \
5938 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
5940# define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \
5941 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
5942 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
5943 CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
5944 if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \
5945 catchInternalSectionHint, \
5946 catchInternalSectionHint = Catch::Detail::GetNewSectionHint( \
5947 ( Catch::ReusableStringStream() << __VA_ARGS__ ).str()); \
5948 catchInternalPreviousSectionHint == __LINE__ ) \
5949 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
5957#ifndef CATCH_TEST_REGISTRY_HPP_INCLUDED
5958#define CATCH_TEST_REGISTRY_HPP_INCLUDED
5962#ifndef CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED
5963#define CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED
5980#ifndef CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED
5981#define CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED
5983#define INTERNAL_CATCH_EXPAND1( param ) INTERNAL_CATCH_EXPAND2( param )
5984#define INTERNAL_CATCH_EXPAND2( ... ) INTERNAL_CATCH_NO##__VA_ARGS__
5985#define INTERNAL_CATCH_DEF( ... ) INTERNAL_CATCH_DEF __VA_ARGS__
5986#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
5988#define INTERNAL_CATCH_REMOVE_PARENS( ... ) \
5989 INTERNAL_CATCH_EXPAND1( INTERNAL_CATCH_DEF __VA_ARGS__ )
5996#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 5
5997#pragma GCC diagnostic ignored "-Wunused-variable"
6017Detail::unique_ptr<ITestInvoker> makeTestInvoker(
void(*testAsFunction)() );
6024template <
typename C>
6066#if defined(CATCH_CONFIG_DISABLE)
6067 #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
6068 static inline void TestName()
6069 #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
6071 struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
6075 void TestName::test()
6079#if !defined(CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT)
6082 #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
6083 static void TestName(); \
6084 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6085 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6086 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6087 namespace{ const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } \
6088 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6089 static void TestName()
6090 #define INTERNAL_CATCH_TESTCASE( ... ) \
6091 INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__ )
6110static int catchInternalSectionHint = 0;
6112# define INTERNAL_CATCH_TESTCASE2( fname, ... ) \
6113 static void fname( int ); \
6114 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6115 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6116 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6117 static const Catch::Detail::DummyUse INTERNAL_CATCH_UNIQUE_NAME( \
6118 dummyUser )( &(fname), Catch::NameAndTags{ __VA_ARGS__ } ); \
6119 CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
6120 static void fname( [[maybe_unused]] int catchInternalSectionHint ) \
6121 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
6122# define INTERNAL_CATCH_TESTCASE( ... ) \
6123 INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ), __VA_ARGS__ )
6129 #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
6130 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6131 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6132 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6134 struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
6137 const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \
6138 Catch::makeTestInvoker( &TestName::test ), \
6139 CATCH_INTERNAL_LINEINFO, \
6140 #ClassName##_catch_sr, \
6141 Catch::NameAndTags{ __VA_ARGS__ } ); \
6143 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6144 void TestName::test()
6145 #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
6146 INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ )
6149 #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( TestName, ClassName, ... ) \
6150 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6151 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6152 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6154 struct TestName : INTERNAL_CATCH_REMOVE_PARENS( ClassName ) { \
6155 void test() const; \
6157 const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \
6158 Catch::makeTestInvokerFixture( &TestName::test ), \
6159 CATCH_INTERNAL_LINEINFO, \
6160 #ClassName##_catch_sr, \
6161 Catch::NameAndTags{ __VA_ARGS__ } ); \
6163 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6164 void TestName::test() const
6165 #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( ClassName, ... ) \
6166 INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ )
6170 #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
6171 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6172 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6173 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6175 const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \
6176 Catch::makeTestInvoker( &QualifiedMethod ), \
6177 CATCH_INTERNAL_LINEINFO, \
6178 "&" #QualifiedMethod##_catch_sr, \
6179 Catch::NameAndTags{ __VA_ARGS__ } ); \
6181 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
6185 #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
6187 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6188 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6189 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6190 Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); \
6191 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6203#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
6205 #define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
6206 #define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
6208 #define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
6209 #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
6210 #define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
6212 #define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6213 #define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
6214 #define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
6215 #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
6216 #define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
6218 #define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6219 #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
6220 #define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6222 #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
6223 #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
6224 #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
6225 #define CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ )
6226 #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
6227 #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
6228 #define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
6229 #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
6230 #define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6231 #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6232 #define CATCH_SKIP( ... ) INTERNAL_CATCH_MSG( "SKIP", Catch::ResultWas::ExplicitSkip, Catch::ResultDisposition::Normal, __VA_ARGS__ )
6235 #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
6236 #define CATCH_STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ )
6237 #define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
6238 #define CATCH_STATIC_CHECK( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ )
6239 #define CATCH_STATIC_CHECK_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
6241 #define CATCH_STATIC_REQUIRE( ... ) CATCH_REQUIRE( __VA_ARGS__ )
6242 #define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ )
6243 #define CATCH_STATIC_CHECK( ... ) CATCH_CHECK( __VA_ARGS__ )
6244 #define CATCH_STATIC_CHECK_FALSE( ... ) CATCH_CHECK_FALSE( __VA_ARGS__ )
6249 #define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
6250 #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
6251 #define CATCH_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
6252 #define CATCH_AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
6253 #define CATCH_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
6254 #define CATCH_AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
6255 #define CATCH_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
6256 #define CATCH_AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
6258#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
6260 #define CATCH_REQUIRE( ... ) (void)(0)
6261 #define CATCH_REQUIRE_FALSE( ... ) (void)(0)
6263 #define CATCH_REQUIRE_THROWS( ... ) (void)(0)
6264 #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
6265 #define CATCH_REQUIRE_NOTHROW( ... ) (void)(0)
6267 #define CATCH_CHECK( ... ) (void)(0)
6268 #define CATCH_CHECK_FALSE( ... ) (void)(0)
6269 #define CATCH_CHECKED_IF( ... ) if (__VA_ARGS__)
6270 #define CATCH_CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
6271 #define CATCH_CHECK_NOFAIL( ... ) (void)(0)
6273 #define CATCH_CHECK_THROWS( ... ) (void)(0)
6274 #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
6275 #define CATCH_CHECK_NOTHROW( ... ) (void)(0)
6277 #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
6278 #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
6279 #define CATCH_METHOD_AS_TEST_CASE( method, ... )
6280 #define CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
6281 #define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0)
6282 #define CATCH_SECTION( ... )
6283 #define CATCH_DYNAMIC_SECTION( ... )
6284 #define CATCH_FAIL( ... ) (void)(0)
6285 #define CATCH_FAIL_CHECK( ... ) (void)(0)
6286 #define CATCH_SUCCEED( ... ) (void)(0)
6287 #define CATCH_SKIP( ... ) (void)(0)
6289 #define CATCH_STATIC_REQUIRE( ... ) (void)(0)
6290 #define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0)
6291 #define CATCH_STATIC_CHECK( ... ) (void)(0)
6292 #define CATCH_STATIC_CHECK_FALSE( ... ) (void)(0)
6295 #define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
6296 #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className )
6297 #define CATCH_GIVEN( desc )
6298 #define CATCH_AND_GIVEN( desc )
6299 #define CATCH_WHEN( desc )
6300 #define CATCH_AND_WHEN( desc )
6301 #define CATCH_THEN( desc )
6302 #define CATCH_AND_THEN( desc )
6304#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
6306 #define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
6307 #define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
6309 #define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
6310 #define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
6311 #define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
6313 #define CHECK( ... ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6314 #define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
6315 #define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
6316 #define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
6317 #define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
6319 #define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6320 #define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
6321 #define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6323 #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
6324 #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
6325 #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
6326 #define TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ )
6327 #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
6328 #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
6329 #define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
6330 #define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
6331 #define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6332 #define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
6333 #define SKIP( ... ) INTERNAL_CATCH_MSG( "SKIP", Catch::ResultWas::ExplicitSkip, Catch::ResultDisposition::Normal, __VA_ARGS__ )
6336 #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
6337 #define STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
6338 #define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
6339 #define STATIC_CHECK( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
6340 #define STATIC_CHECK_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
6342 #define STATIC_REQUIRE( ... ) REQUIRE( __VA_ARGS__ )
6343 #define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ )
6344 #define STATIC_CHECK( ... ) CHECK( __VA_ARGS__ )
6345 #define STATIC_CHECK_FALSE( ... ) CHECK_FALSE( __VA_ARGS__ )
6349 #define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
6350 #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
6351 #define GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
6352 #define AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
6353 #define WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
6354 #define AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
6355 #define THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
6356 #define AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
6358#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
6360 #define REQUIRE( ... ) (void)(0)
6361 #define REQUIRE_FALSE( ... ) (void)(0)
6363 #define REQUIRE_THROWS( ... ) (void)(0)
6364 #define REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
6365 #define REQUIRE_NOTHROW( ... ) (void)(0)
6367 #define CHECK( ... ) (void)(0)
6368 #define CHECK_FALSE( ... ) (void)(0)
6369 #define CHECKED_IF( ... ) if (__VA_ARGS__)
6370 #define CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
6371 #define CHECK_NOFAIL( ... ) (void)(0)
6373 #define CHECK_THROWS( ... ) (void)(0)
6374 #define CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
6375 #define CHECK_NOTHROW( ... ) (void)(0)
6377 #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__)
6378 #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
6379 #define METHOD_AS_TEST_CASE( method, ... )
6380 #define TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__)
6381 #define REGISTER_TEST_CASE( Function, ... ) (void)(0)
6382 #define SECTION( ... )
6383 #define DYNAMIC_SECTION( ... )
6384 #define FAIL( ... ) (void)(0)
6385 #define FAIL_CHECK( ... ) (void)(0)
6386 #define SUCCEED( ... ) (void)(0)
6387 #define SKIP( ... ) (void)(0)
6389 #define STATIC_REQUIRE( ... ) (void)(0)
6390 #define STATIC_REQUIRE_FALSE( ... ) (void)(0)
6391 #define STATIC_CHECK( ... ) (void)(0)
6392 #define STATIC_CHECK_FALSE( ... ) (void)(0)
6395 #define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ) )
6396 #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className )
6398 #define GIVEN( desc )
6399 #define AND_GIVEN( desc )
6400 #define WHEN( desc )
6401 #define AND_WHEN( desc )
6402 #define THEN( desc )
6403 #define AND_THEN( desc )
6412#ifndef CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED
6413#define CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED
6417#ifndef CATCH_PREPROCESSOR_HPP_INCLUDED
6418#define CATCH_PREPROCESSOR_HPP_INCLUDED
6421#if defined(__GNUC__)
6423#pragma GCC system_header
6427#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__
6428#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__)))
6429#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__)))
6430#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__)))
6431#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__)))
6432#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__)))
6434#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6435#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__
6437#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__)))
6438#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__))
6440#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__)
6443#define CATCH_REC_END(...)
6444#define CATCH_REC_OUT
6446#define CATCH_EMPTY()
6447#define CATCH_DEFER(id) id CATCH_EMPTY()
6449#define CATCH_REC_GET_END2() 0, CATCH_REC_END
6450#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2
6451#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1
6452#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT
6453#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0)
6454#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next)
6456#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
6457#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ )
6458#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
6460#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
6461#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ )
6462#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
6467#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
6469#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
6471#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__)
6472#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6473#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__
6474#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param))
6477#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__)
6478#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__
6479#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1)
6482#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__
6483#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name)
6485#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6486#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>())
6487#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))
6489#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>()))
6490#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)))
6493#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\
6494 CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__)
6496#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0)
6497#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1)
6498#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2)
6499#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3)
6500#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4)
6501#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5)
6502#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6)
6503#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7)
6504#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8)
6505#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9)
6506#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10)
6508#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
6510#define INTERNAL_CATCH_TYPE_GEN\
6511 template<typename...> struct TypeList {};\
6512 template<typename...Ts>\
6513 constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
6514 template<template<typename...> class...> struct TemplateTypeList{};\
6515 template<template<typename...> class...Cs>\
6516 constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
6517 template<typename...>\
6519 template<typename...>\
6521 template<template<typename...> class, typename...>\
6523 template<template<typename...> class, typename>\
6526 template<typename T> \
6527 struct append<T> { using type = T; };\
6528 template< template<typename...> class L1, typename...E1, template<typename...> class L2, typename...E2, typename...Rest>\
6529 struct append<L1<E1...>, L2<E2...>, Rest...> { using type = typename append<L1<E1...,E2...>, Rest...>::type; };\
6530 template< template<typename...> class L1, typename...E1, typename...Rest>\
6531 struct append<L1<E1...>, TypeList<mpl_::na>, Rest...> { using type = L1<E1...>; };\
6533 template< template<typename...> class Container, template<typename...> class List, typename...elems>\
6534 struct rewrap<TemplateTypeList<Container>, List<elems...>> { using type = TypeList<Container<elems...>>; };\
6535 template< template<typename...> class Container, template<typename...> class List, class...Elems, typename...Elements>\
6536 struct rewrap<TemplateTypeList<Container>, List<Elems...>, Elements...> { using type = typename append<TypeList<Container<Elems...>>, typename rewrap<TemplateTypeList<Container>, Elements...>::type>::type; };\
6538 template<template <typename...> class Final, template< typename...> class...Containers, typename...Types>\
6539 struct create<Final, TemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<TemplateTypeList<Containers>, Types...>::type...>::type; };\
6540 template<template <typename...> class Final, template <typename...> class List, typename...Ts>\
6541 struct convert<Final, List<Ts...>> { using type = typename append<Final<>,TypeList<Ts>...>::type; };
6543#define INTERNAL_CATCH_NTTP_1(signature, ...)\
6544 template<INTERNAL_CATCH_REMOVE_PARENS(signature)> struct Nttp{};\
6545 template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6546 constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> { return {}; } \
6547 template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...> struct NttpTemplateTypeList{};\
6548 template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Cs>\
6549 constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList<Cs...> { return {}; } \
6551 template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6552 struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>> { using type = TypeList<Container<__VA_ARGS__>>; };\
6553 template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature), typename...Elements>\
6554 struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>, Elements...> { using type = typename append<TypeList<Container<__VA_ARGS__>>, typename rewrap<NttpTemplateTypeList<Container>, Elements...>::type>::type; };\
6555 template<template <typename...> class Final, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Containers, typename...Types>\
6556 struct create<Final, NttpTemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<NttpTemplateTypeList<Containers>, Types...>::type...>::type; };
6558#define INTERNAL_CATCH_DECLARE_SIG_TEST0(TestName)
6559#define INTERNAL_CATCH_DECLARE_SIG_TEST1(TestName, signature)\
6560 template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6561 static void TestName()
6562#define INTERNAL_CATCH_DECLARE_SIG_TEST_X(TestName, signature, ...)\
6563 template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6564 static void TestName()
6566#define INTERNAL_CATCH_DEFINE_SIG_TEST0(TestName)
6567#define INTERNAL_CATCH_DEFINE_SIG_TEST1(TestName, signature)\
6568 template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6569 static void TestName()
6570#define INTERNAL_CATCH_DEFINE_SIG_TEST_X(TestName, signature,...)\
6571 template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6572 static void TestName()
6574#define INTERNAL_CATCH_NTTP_REGISTER0(TestFunc, signature)\
6575 template<typename Type>\
6576 void reg_test(TypeList<Type>, Catch::NameAndTags nameAndTags)\
6578 Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<Type>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
6581#define INTERNAL_CATCH_NTTP_REGISTER(TestFunc, signature, ...)\
6582 template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6583 void reg_test(Nttp<__VA_ARGS__>, Catch::NameAndTags nameAndTags)\
6585 Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<__VA_ARGS__>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
6588#define INTERNAL_CATCH_NTTP_REGISTER_METHOD0(TestName, signature, ...)\
6589 template<typename Type>\
6590 void reg_test(TypeList<Type>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
6592 Catch::AutoReg( Catch::makeTestInvoker(&TestName<Type>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
6595#define INTERNAL_CATCH_NTTP_REGISTER_METHOD(TestName, signature, ...)\
6596 template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
6597 void reg_test(Nttp<__VA_ARGS__>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
6599 Catch::AutoReg( Catch::makeTestInvoker(&TestName<__VA_ARGS__>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
6602#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0(TestName, ClassName)
6603#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1(TestName, ClassName, signature)\
6604 template<typename TestType> \
6605 struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<TestType> { \
6609#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X(TestName, ClassName, signature, ...)\
6610 template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
6611 struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<__VA_ARGS__> { \
6615#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0(TestName)
6616#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1(TestName, signature)\
6617 template<typename TestType> \
6618 void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<TestType>::test()
6619#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X(TestName, signature, ...)\
6620 template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
6621 void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<__VA_ARGS__>::test()
6623#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6624#define INTERNAL_CATCH_NTTP_0
6625#define INTERNAL_CATCH_NTTP_GEN(...) INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__),INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_0)
6626#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0)(TestName, __VA_ARGS__)
6627#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0)(TestName, ClassName, __VA_ARGS__)
6628#define INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD0, INTERNAL_CATCH_NTTP_REGISTER_METHOD0)(TestName, __VA_ARGS__)
6629#define INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER0, INTERNAL_CATCH_NTTP_REGISTER0)(TestFunc, __VA_ARGS__)
6630#define INTERNAL_CATCH_DEFINE_SIG_TEST(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST1, INTERNAL_CATCH_DEFINE_SIG_TEST0)(TestName, __VA_ARGS__)
6631#define INTERNAL_CATCH_DECLARE_SIG_TEST(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST1, INTERNAL_CATCH_DECLARE_SIG_TEST0)(TestName, __VA_ARGS__)
6632#define INTERNAL_CATCH_REMOVE_PARENS_GEN(...) INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_REMOVE_PARENS_11_ARG,INTERNAL_CATCH_REMOVE_PARENS_10_ARG,INTERNAL_CATCH_REMOVE_PARENS_9_ARG,INTERNAL_CATCH_REMOVE_PARENS_8_ARG,INTERNAL_CATCH_REMOVE_PARENS_7_ARG,INTERNAL_CATCH_REMOVE_PARENS_6_ARG,INTERNAL_CATCH_REMOVE_PARENS_5_ARG,INTERNAL_CATCH_REMOVE_PARENS_4_ARG,INTERNAL_CATCH_REMOVE_PARENS_3_ARG,INTERNAL_CATCH_REMOVE_PARENS_2_ARG,INTERNAL_CATCH_REMOVE_PARENS_1_ARG)(__VA_ARGS__)
6634#define INTERNAL_CATCH_NTTP_0(signature)
6635#define INTERNAL_CATCH_NTTP_GEN(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1,INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_0)( __VA_ARGS__))
6636#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0)(TestName, __VA_ARGS__))
6637#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0)(TestName, ClassName, __VA_ARGS__))
6638#define INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD0, INTERNAL_CATCH_NTTP_REGISTER_METHOD0)(TestName, __VA_ARGS__))
6639#define INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER0, INTERNAL_CATCH_NTTP_REGISTER0)(TestFunc, __VA_ARGS__))
6640#define INTERNAL_CATCH_DEFINE_SIG_TEST(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST1, INTERNAL_CATCH_DEFINE_SIG_TEST0)(TestName, __VA_ARGS__))
6641#define INTERNAL_CATCH_DECLARE_SIG_TEST(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST1, INTERNAL_CATCH_DECLARE_SIG_TEST0)(TestName, __VA_ARGS__))
6642#define INTERNAL_CATCH_REMOVE_PARENS_GEN(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_REMOVE_PARENS_11_ARG,INTERNAL_CATCH_REMOVE_PARENS_10_ARG,INTERNAL_CATCH_REMOVE_PARENS_9_ARG,INTERNAL_CATCH_REMOVE_PARENS_8_ARG,INTERNAL_CATCH_REMOVE_PARENS_7_ARG,INTERNAL_CATCH_REMOVE_PARENS_6_ARG,INTERNAL_CATCH_REMOVE_PARENS_5_ARG,INTERNAL_CATCH_REMOVE_PARENS_4_ARG,INTERNAL_CATCH_REMOVE_PARENS_3_ARG,INTERNAL_CATCH_REMOVE_PARENS_2_ARG,INTERNAL_CATCH_REMOVE_PARENS_1_ARG)(__VA_ARGS__))
6651#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 5
6652#pragma GCC diagnostic ignored "-Wunused-variable"
6655#if defined(CATCH_CONFIG_DISABLE)
6656 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( TestName, TestFunc, Name, Tags, Signature, ... ) \
6657 INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature))
6658 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
6660 namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
6661 INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
6664 INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
6666 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6667 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
6668 INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ )
6670 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
6671 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
6674 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6675 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
6676 INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ )
6678 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
6679 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) )
6682 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6683 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
6684 INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
6686 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
6687 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
6690 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6691 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
6692 INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
6694 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
6695 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
6701 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, Signature, ... )\
6702 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6703 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6704 CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
6705 CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
6706 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6707 CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \
6708 INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
6710 namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
6711 INTERNAL_CATCH_TYPE_GEN\
6712 INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
6713 INTERNAL_CATCH_NTTP_REG_GEN(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))\
6714 template<typename...Types> \
6718 constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; \
6719 using expander = size_t[]; \
6720 (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... }; \
6723 static const int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
6724 TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
6729 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6730 INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))
6732#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6733 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
6734 INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ )
6736 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
6737 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
6740#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6741 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
6742 INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ )
6744 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
6745 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) )
6748 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \
6749 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6750 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6751 CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
6752 CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
6753 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6754 CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \
6755 template<typename TestType> static void TestFuncName(); \
6757 namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
6758 INTERNAL_CATCH_TYPE_GEN \
6759 INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
6760 template<typename... Types> \
6762 void reg_tests() { \
6764 using expander = size_t[]; \
6765 constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
6766 constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
6767 constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
6768 (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };\
6771 static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
6772 using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
6779 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6780 template<typename TestType> \
6781 static void TestFuncName()
6783#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6784 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
6785 INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
6787 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
6788 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T, __VA_ARGS__ ) )
6791#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6792 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
6793 INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__)
6795 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
6796 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) )
6799 #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\
6800 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6801 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6802 CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
6803 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6804 CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \
6805 template<typename TestType> static void TestFunc(); \
6807 namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
6808 INTERNAL_CATCH_TYPE_GEN\
6809 template<typename... Types> \
6811 void reg_tests() { \
6813 using expander = size_t[]; \
6814 (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... };\
6817 static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
6818 using TestInit = typename convert<TestName, TmplList>::type; \
6824 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6825 template<typename TestType> \
6826 static void TestFunc()
6828 #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList) \
6829 INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, TmplList )
6832 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
6833 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6834 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6835 CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
6836 CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
6837 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6839 namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
6840 INTERNAL_CATCH_TYPE_GEN\
6841 INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
6842 INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
6843 INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))\
6844 template<typename...Types> \
6845 struct TestNameClass{\
6848 constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
6849 using expander = size_t[];\
6850 (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... }; \
6853 static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
6854 TestNameClass<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
6859 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6860 INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
6862#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6863 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
6864 INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
6866 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
6867 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
6870#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6871 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
6872 INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
6874 #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
6875 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
6878 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\
6879 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6880 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6881 CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
6882 CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
6883 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6884 template<typename TestType> \
6885 struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
6889 namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) {\
6890 INTERNAL_CATCH_TYPE_GEN \
6891 INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
6892 template<typename...Types>\
6893 struct TestNameClass{\
6895 std::size_t index = 0;\
6896 using expander = std::size_t[];\
6897 constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
6898 constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
6899 constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
6900 (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... }; \
6903 static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
6904 using TestInit = typename create<TestNameClass, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type;\
6911 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6912 template<typename TestType> \
6913 void TestName<TestType>::test()
6915#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6916 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
6917 INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T, __VA_ARGS__ )
6919 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
6920 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) )
6923#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6924 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
6925 INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature, __VA_ARGS__ )
6927 #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
6928 INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) )
6931 #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, TmplList) \
6932 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
6933 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
6934 CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
6935 CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
6936 CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \
6937 template<typename TestType> \
6938 struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
6942 namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
6943 INTERNAL_CATCH_TYPE_GEN\
6944 template<typename...Types>\
6945 struct TestNameClass{\
6948 using expander = size_t[];\
6949 (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName##_catch_sr, Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... }; \
6952 static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
6953 using TestInit = typename convert<TestNameClass, TmplList>::type;\
6959 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
6960 template<typename TestType> \
6961 void TestName<TestType>::test()
6963#define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD(ClassName, Name, Tags, TmplList) \
6964 INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, TmplList )
6970#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
6972 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6973 #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
6974 #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
6975 #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
6976 #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
6977 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
6978 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
6979 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
6980 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
6981 #define CATCH_TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
6982 #define CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
6984 #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
6985 #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
6986 #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
6987 #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
6988 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
6989 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
6990 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
6991 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
6992 #define CATCH_TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
6993 #define CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
6996#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
6998 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
6999 #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
7000 #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
7001 #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
7002 #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
7004 #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
7005 #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
7006 #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
7007 #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
7011 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
7012 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
7013 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
7014 #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
7015 #define CATCH_TEMPLATE_LIST_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE(__VA_ARGS__)
7016 #define CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
7018#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
7020 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
7021 #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
7022 #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
7023 #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
7024 #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
7025 #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
7026 #define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
7027 #define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
7028 #define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
7029 #define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
7030 #define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
7032 #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
7033 #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
7034 #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
7035 #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
7036 #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
7037 #define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
7038 #define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
7039 #define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
7040 #define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
7041 #define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
7044#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
7046 #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
7047 #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
7048 #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
7049 #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
7050 #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
7052 #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
7053 #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
7054 #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
7055 #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
7059 #define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
7060 #define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
7061 #define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
7062 #define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
7063 #define TEMPLATE_LIST_TEST_CASE( ... ) TEMPLATE_TEST_CASE(__VA_ARGS__)
7064 #define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
7072#ifndef CATCH_TEST_CASE_INFO_HPP_INCLUDED
7073#define CATCH_TEST_CASE_INFO_HPP_INCLUDED
7082#pragma clang diagnostic push
7083#pragma clang diagnostic ignored "-Wpadded"
7101 friend bool operator< (
Tag const& lhs,
Tag const& rhs );
7134 bool throws()
const;
7191 Detail::unique_ptr<TestCaseInfo>
7192 makeTestCaseInfo( StringRef className,
7193 NameAndTags
const& nameAndTags,
7194 SourceLineInfo
const& lineInfo );
7198#pragma clang diagnostic pop
7204#ifndef CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED
7205#define CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED
7209#ifndef CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
7210#define CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
7225 virtual std::string
translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd )
const = 0;
7242 void registerTranslatorImpl(
7243 Detail::unique_ptr<IExceptionTranslator>&& translator );
7247 template<
typename T>
7255 std::string
translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd )
const override {
7256#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
7259 std::rethrow_exception(std::current_exception());
7261 return (*it)->translate( it+1, itEnd );
7263 catch( T
const& ex ) {
7267 return "You should never get here!";
7276 template<
typename T>
7280 translateFunction ) );
7287#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
7288 static std::string translatorName( signature ); \
7289 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
7290 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
7291 namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); } \
7292 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
7293 static std::string translatorName( signature )
7295#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
7297#if defined(CATCH_CONFIG_DISABLE)
7298 #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( translatorName, signature) \
7299 static std::string translatorName( signature )
7304#if !defined(CATCH_CONFIG_DISABLE)
7305#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
7307#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
7314#ifndef CATCH_VERSION_HPP_INCLUDED
7315#define CATCH_VERSION_HPP_INCLUDED
7325 Version(
unsigned int _majorVersion,
7326 unsigned int _minorVersion,
7327 unsigned int _patchNumber,
7328 char const *
const _branchName,
7329 unsigned int _buildNumber );
7348#ifndef CATCH_VERSION_MACROS_HPP_INCLUDED
7349#define CATCH_VERSION_MACROS_HPP_INCLUDED
7351#define CATCH_VERSION_MAJOR 3
7352#define CATCH_VERSION_MINOR 8
7353#define CATCH_VERSION_PATCH 1
7371#ifndef CATCH_GENERATORS_ALL_HPP_INCLUDED
7372#define CATCH_GENERATORS_ALL_HPP_INCLUDED
7376#ifndef CATCH_GENERATOR_EXCEPTION_HPP_INCLUDED
7377#define CATCH_GENERATOR_EXCEPTION_HPP_INCLUDED
7394 const char* what() const noexcept override final;
7402#ifndef CATCH_GENERATORS_HPP_INCLUDED
7403#define CATCH_GENERATORS_HPP_INCLUDED
7407#ifndef CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED
7408#define CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED
7415 namespace Generators {
7471 StringRef currentElementAsString()
const;
7500 void throw_generator_exception(
char const * msg);
7504 template<
typename T>
7507 return ::Catch::Detail::stringify(
get() );
7515 virtual T
const&
get()
const = 0;
7519 template <
typename T>
7522 template <
typename T>
7541 template<
typename T>
7552 T
const&
get()
const override {
7560 template<
typename T>
7562 static_assert(!std::is_same<T, bool>::value,
7563 "FixedValuesGenerator does not support bools because of std::vector<bool>"
7564 "specialization, use SingleValue Generator instead.");
7570 T
const&
get()
const override {
7579 template <
typename T,
typename DecayedT = std::decay_t<T>>
7585 template <
typename T>
7590 template<
typename T>
7604 template <
typename U>
7605 std::enable_if_t<!std::is_same<std::decay_t<U>, T>
::value>
7614 template <
typename U,
typename... Gs>
7621 template <
typename... Gs>
7627 T
const&
get()
const override {
7636 if (!current_status) {
7644 template <
typename... Ts>
7645 GeneratorWrapper<std::tuple<std::decay_t<Ts>...>>
7646 table( std::initializer_list<std::tuple<std::decay_t<Ts>...>> tuples ) {
7647 return values<std::tuple<Ts...>>( tuples );
7651 template <
typename T>
7654 template<
typename T,
typename... Gs>
7658 template<
typename T>
7662 template<
typename T,
typename... Gs>
7666 template<
typename T,
typename U,
typename... Gs>
7675 GeneratorBasePtr&& generator );
7677 template<
typename L>
7679 using UnderlyingType =
typename decltype(generatorExpression())::type;
7689 generatorExpression() ) );
7693 return generator.get();
7699#define CATCH_INTERNAL_GENERATOR_STRINGIZE_IMPL( ... ) #__VA_ARGS__##_catch_sr
7700#define CATCH_INTERNAL_GENERATOR_STRINGIZE(...) CATCH_INTERNAL_GENERATOR_STRINGIZE_IMPL(__VA_ARGS__)
7702#define GENERATE( ... ) \
7703 Catch::Generators::generate( CATCH_INTERNAL_GENERATOR_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
7704 CATCH_INTERNAL_LINEINFO, \
7705 [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
7706#define GENERATE_COPY( ... ) \
7707 Catch::Generators::generate( CATCH_INTERNAL_GENERATOR_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
7708 CATCH_INTERNAL_LINEINFO, \
7709 [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
7710#define GENERATE_REF( ... ) \
7711 Catch::Generators::generate( CATCH_INTERNAL_GENERATOR_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
7712 CATCH_INTERNAL_LINEINFO, \
7713 [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
7718#ifndef CATCH_GENERATORS_ADAPTERS_HPP_INCLUDED
7719#define CATCH_GENERATORS_ADAPTERS_HPP_INCLUDED
7725namespace Generators {
7727 template <
typename T>
7737 assert(target != 0 &&
"Empty generators are not allowed");
7739 T
const&
get()
const override {
7758 template <
typename T>
7764 template <
typename T,
typename Predicate>
7769 template <
typename P = Predicate>
7777 auto has_initial_value = next();
7778 if (!has_initial_value) {
7779 Detail::throw_generator_exception(
"No valid value found in filtered generator");
7784 T
const&
get()
const override {
7799 template <
typename T,
typename Predicate>
7804 template <
typename T>
7806 static_assert(!std::is_same<T, bool>::value,
7807 "RepeatGenerator currently does not support bools"
7808 "because of std::vector<bool> specialization");
7819 assert(
m_target_repeats > 0 &&
"Repeat generator must repeat at least once");
7822 T
const&
get()
const override {
7855 template <
typename T>
7860 template <
typename T,
typename U,
typename Func>
7868 template <
typename F2 = Func>
7875 T
const&
get()
const override {
7887 template <
typename Func,
typename U,
typename T = FunctionReturnType<Func, U>>
7894 template <
typename T,
typename U,
typename Func>
7895 GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
7896 return GeneratorWrapper<T>(
7901 template <
typename T>
7922 std::vector<T>
const&
get()
const override {
7937 template <
typename T>
7951#ifndef CATCH_GENERATORS_RANDOM_HPP_INCLUDED
7952#define CATCH_GENERATORS_RANDOM_HPP_INCLUDED
7956#ifndef CATCH_RANDOM_NUMBER_GENERATOR_HPP_INCLUDED
7957#define CATCH_RANDOM_NUMBER_GENERATOR_HPP_INCLUDED
7984 void seed(result_type seed_);
7985 void discard(uint64_t skip);
7987 result_type operator()();
8002 static const std::uint64_t
s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL;
8011#ifndef CATCH_UNIFORM_INTEGER_DISTRIBUTION_HPP_INCLUDED
8012#define CATCH_UNIFORM_INTEGER_DISTRIBUTION_HPP_INCLUDED
8017#ifndef CATCH_RANDOM_INTEGER_HELPERS_HPP_INCLUDED
8018#define CATCH_RANDOM_INTEGER_HELPERS_HPP_INCLUDED
8023#include <type_traits>
8030#if defined( __SIZEOF_INT128__ )
8031# define CATCH_CONFIG_INTERNAL_UINT128
8035#elif defined( _MSC_VER ) && defined( _M_X64 )
8036# define CATCH_CONFIG_INTERNAL_MSVC_UMUL128
8039#if defined( CATCH_CONFIG_INTERNAL_UINT128 ) && \
8040 !defined( CATCH_CONFIG_NO_UINT128 ) && \
8041 !defined( CATCH_CONFIG_UINT128 )
8042#define CATCH_CONFIG_UINT128
8045#if defined( CATCH_CONFIG_INTERNAL_MSVC_UMUL128 ) && \
8046 !defined( CATCH_CONFIG_NO_MSVC_UMUL128 ) && \
8047 !defined( CATCH_CONFIG_MSVC_UMUL128 )
8048# define CATCH_CONFIG_MSVC_UMUL128
8056 template <std::
size_t>
8057 struct SizedUnsignedType;
8058#define SizedUnsignedTypeHelper( TYPE ) \
8060 struct SizedUnsignedType<sizeof( TYPE )> { \
8061 using type = TYPE; \
8068#undef SizedUnsignedTypeHelper
8070 template <std::
size_t sz>
8071 using SizedUnsignedType_t =
typename SizedUnsignedType<sz>::type;
8073 template <
typename T>
8074 using DoubleWidthUnsignedType_t = SizedUnsignedType_t<2 *
sizeof( T )>;
8076 template <
typename T>
8077 struct ExtendedMultResult {
8080 constexpr bool operator==( ExtendedMultResult
const& rhs )
const {
8081 return upper == rhs.upper && lower == rhs.lower;
8091 constexpr ExtendedMultResult<std::uint64_t>
8092 extendedMultPortable(std::uint64_t lhs, std::uint64_t rhs) {
8093#define CarryBits( x ) ( x >> 32 )
8094#define Digits( x ) ( x & 0xFF'FF'FF'FF )
8095 std::uint64_t lhs_low = Digits( lhs );
8096 std::uint64_t rhs_low = Digits( rhs );
8097 std::uint64_t low_low = ( lhs_low * rhs_low );
8101 std::uint64_t high_low =
8105 std::uint64_t low_high =
8106 ( lhs_low *
CarryBits( rhs ) ) + Digits( high_low );
8109 ( low_high << 32 ) | Digits( low_low ) };
8115 inline ExtendedMultResult<std::uint64_t>
8116 extendedMult( std::uint64_t lhs, std::uint64_t rhs ) {
8117#if defined( CATCH_CONFIG_UINT128 )
8118 auto result = __uint128_t( lhs ) * __uint128_t( rhs );
8119 return {
static_cast<std::uint64_t
>( result >> 64 ),
8120 static_cast<std::uint64_t
>( result ) };
8121#elif defined( CATCH_CONFIG_MSVC_UMUL128 )
8123 std::uint64_t low = _umul128( lhs, rhs, &high );
8124 return { high, low };
8126 return extendedMultPortable( lhs, rhs );
8131 template <
typename UInt>
8132 constexpr ExtendedMultResult<UInt> extendedMult( UInt lhs, UInt rhs ) {
8133 static_assert( std::is_unsigned<UInt>::value,
8134 "extendedMult can only handle unsigned integers" );
8135 static_assert(
sizeof( UInt ) <
sizeof( std::uint64_t ),
8136 "Generic extendedMult can only handle types smaller "
8138 using WideType = DoubleWidthUnsignedType_t<UInt>;
8140 auto result = WideType( lhs ) * WideType( rhs );
8142 static_cast<UInt
>( result >> ( CHAR_BIT *
sizeof( UInt ) ) ),
8143 static_cast<UInt
>( result & UInt( -1 ) ) };
8147 template <
typename TargetType,
8149 std::enable_if_t<
sizeof(
typename Generator::result_type) >=
sizeof(TargetType),
8150 TargetType> fillBitsFrom(Generator& gen) {
8151 using gresult_type =
typename Generator::result_type;
8152 static_assert( std::is_unsigned<TargetType>::value,
"Only unsigned integers are supported" );
8153 static_assert( Generator::min() == 0 &&
8154 Generator::max() ==
static_cast<gresult_type
>( -1 ),
8155 "Generator must be able to output all numbers in its result type (effectively it must be a random bit generator)" );
8159 constexpr auto generated_bits =
sizeof( gresult_type ) * CHAR_BIT;
8160 constexpr auto return_bits =
sizeof( TargetType ) * CHAR_BIT;
8162 return static_cast<TargetType
>( gen() >>
8163 ( generated_bits - return_bits) );
8166 template <
typename TargetType,
8168 std::enable_if_t<
sizeof(
typename Generator::result_type) <
sizeof(TargetType),
8169 TargetType> fillBitsFrom(Generator& gen) {
8170 using gresult_type =
typename Generator::result_type;
8171 static_assert( std::is_unsigned<TargetType>::value,
8172 "Only unsigned integers are supported" );
8173 static_assert( Generator::min() == 0 &&
8174 Generator::max() ==
static_cast<gresult_type
>( -1 ),
8175 "Generator must be able to output all numbers in its result type (effectively it must be a random bit generator)" );
8177 constexpr auto generated_bits =
sizeof( gresult_type ) * CHAR_BIT;
8178 constexpr auto return_bits =
sizeof( TargetType ) * CHAR_BIT;
8179 std::size_t filled_bits = 0;
8182 ret <<= generated_bits;
8184 filled_bits += generated_bits;
8185 }
while ( filled_bits < return_bits );
8197 template <
typename OriginalType,
typename Un
signedType>
8199 std::enable_if_t<std::is_signed<OriginalType>::value, UnsignedType>
8200 transposeToNaturalOrder( UnsignedType in ) {
8202 sizeof( OriginalType ) ==
sizeof( UnsignedType ),
8203 "reordering requires the same sized types on both sides" );
8204 static_assert( std::is_unsigned<UnsignedType>::value,
8205 "Input type must be unsigned" );
8210 constexpr auto highest_bit =
8211 UnsignedType( 1 ) << (
sizeof( UnsignedType ) * CHAR_BIT - 1 );
8212 return static_cast<UnsignedType
>( in ^ highest_bit );
8217 template <
typename OriginalType,
8218 typename UnsignedType>
8220 std::enable_if_t<std::is_unsigned<OriginalType>::value, UnsignedType>
8221 transposeToNaturalOrder(UnsignedType in) {
8223 sizeof( OriginalType ) ==
sizeof( UnsignedType ),
8224 "reordering requires the same sized types on both sides" );
8225 static_assert( std::is_unsigned<UnsignedType>::value,
"Input type must be unsigned" );
8247template <
typename IntegerType>
8248class uniform_integer_distribution {
8249 static_assert(std::is_integral<IntegerType>::value,
"...");
8251 using UnsignedIntegerType = Detail::SizedUnsignedType_t<
sizeof(IntegerType)>;
8258 UnsignedIntegerType m_a;
8261 UnsignedIntegerType m_ab_distance;
8269 UnsignedIntegerType m_rejection_threshold = 0;
8271 static constexpr UnsignedIntegerType computeDistance(IntegerType a, IntegerType b) {
8274 return transposeTo(b) - transposeTo(a) + 1;
8277 static constexpr UnsignedIntegerType computeRejectionThreshold(UnsignedIntegerType ab_distance) {
8280 if ( ab_distance == 0 ) {
return 0; }
8281 return ( ~ab_distance + 1 ) % ab_distance;
8284 static constexpr UnsignedIntegerType transposeTo(IntegerType in) {
8285 return Detail::transposeToNaturalOrder<IntegerType>(
8286 static_cast<UnsignedIntegerType
>( in ) );
8288 static constexpr IntegerType transposeBack(UnsignedIntegerType in) {
8289 return static_cast<IntegerType
>(
8290 Detail::transposeToNaturalOrder<IntegerType>(in) );
8294 using result_type = IntegerType;
8296 constexpr uniform_integer_distribution( IntegerType a, IntegerType b ):
8297 m_a( transposeTo(a) ),
8298 m_ab_distance( computeDistance(a, b) ),
8299 m_rejection_threshold( computeRejectionThreshold(m_ab_distance) ) {
8303 template <
typename Generator>
8304 constexpr result_type operator()( Generator& g ) {
8306 if ( m_ab_distance == 0 ) {
8307 return transposeBack( Detail::fillBitsFrom<UnsignedIntegerType>( g ) );
8310 auto random_number = Detail::fillBitsFrom<UnsignedIntegerType>( g );
8311 auto emul = Detail::extendedMult( random_number, m_ab_distance );
8314 while (emul.lower < m_rejection_threshold) {
8315 random_number = Detail::fillBitsFrom<UnsignedIntegerType>( g );
8316 emul = Detail::extendedMult( random_number, m_ab_distance );
8319 return transposeBack(m_a + emul.upper);
8322 constexpr result_type a()
const {
return transposeBack(m_a); }
8323 constexpr result_type b()
const {
return transposeBack(m_ab_distance + m_a - 1); }
8332#ifndef CATCH_UNIFORM_FLOATING_POINT_DISTRIBUTION_HPP_INCLUDED
8333#define CATCH_UNIFORM_FLOATING_POINT_DISTRIBUTION_HPP_INCLUDED
8338#ifndef CATCH_RANDOM_FLOATING_POINT_HELPERS_HPP_INCLUDED
8339#define CATCH_RANDOM_FLOATING_POINT_HELPERS_HPP_INCLUDED
8343#ifndef CATCH_POLYFILLS_HPP_INCLUDED
8344#define CATCH_POLYFILLS_HPP_INCLUDED
8348 bool isnan(
float f);
8349 bool isnan(
double d);
8362#include <type_traits>
8372 template <
typename FloatType>
8373 FloatType gamma(FloatType a, FloatType b) {
8374 static_assert( std::is_floating_point<FloatType>::value,
8375 "gamma returns the largest ULP magnitude within "
8376 "floating point range [a, b]. This only makes sense "
8377 "for floating point types" );
8380 const auto gamma_up =
Catch::nextafter( a, std::numeric_limits<FloatType>::infinity() ) - a;
8381 const auto gamma_down = b -
Catch::nextafter( b, -std::numeric_limits<FloatType>::infinity() );
8383 return gamma_up < gamma_down ? gamma_down : gamma_up;
8386 template <
typename FloatingPo
int>
8387 struct DistanceTypePicker;
8389 struct DistanceTypePicker<float> {
8390 using type = std::uint32_t;
8393 struct DistanceTypePicker<double> {
8394 using type = std::uint64_t;
8397 template <
typename T>
8398 using DistanceType =
typename DistanceTypePicker<T>::type;
8400#if defined( __GNUC__ ) || defined( __clang__ )
8401# pragma GCC diagnostic push
8402# pragma GCC diagnostic ignored "-Wfloat-equal"
8413 template <
typename FloatType>
8414 DistanceType<FloatType>
8415 count_equidistant_floats( FloatType a, FloatType b, FloatType distance ) {
8419 const auto ag = a / distance;
8420 const auto bg = b / distance;
8422 const auto s = bg - ag;
8423 const auto err = ( std::fabs( a ) <= std::fabs( b ) )
8426 const auto ceil_s =
static_cast<DistanceType<FloatType>
>( std::ceil( s ) );
8428 return ( ceil_s != s ) ? ceil_s : ceil_s + ( err > 0 );
8430#if defined( __GNUC__ ) || defined( __clang__ )
8431# pragma GCC diagnostic pop
8441#include <type_traits>
8446#if defined( __GNUC__ ) || defined( __clang__ )
8447# pragma GCC diagnostic push
8448# pragma GCC diagnostic ignored "-Wfloat-equal"
8454 constexpr std::uint64_t calculate_max_steps_in_one_go(
double gamma) {
8455 if ( gamma == 1.99584030953472e+292 ) {
return 9007199254740991; }
8456 return static_cast<std::uint64_t
>( -1 );
8458 constexpr std::uint32_t calculate_max_steps_in_one_go(
float gamma) {
8459 if ( gamma == 2.028241e+31f ) {
return 16777215; }
8460 return static_cast<std::uint32_t
>( -1 );
8462#if defined( __GNUC__ ) || defined( __clang__ )
8463# pragma GCC diagnostic pop
8493template <
typename FloatType>
8494class uniform_floating_point_distribution {
8495 static_assert(std::is_floating_point<FloatType>::value,
"...");
8496 static_assert(!std::is_same<FloatType, long double>::value,
8497 "We do not support long double due to inconsistent behaviour between platforms");
8499 using WidthType = Detail::DistanceType<FloatType>;
8502 FloatType m_ulp_magnitude;
8503 WidthType m_floats_in_range;
8504 uniform_integer_distribution<WidthType> m_int_dist;
8509 WidthType m_max_steps_in_one_go;
8511 bool m_a_has_leq_magnitude;
8514 using result_type = FloatType;
8516 uniform_floating_point_distribution( FloatType a, FloatType b ):
8519 m_ulp_magnitude( Detail::gamma( m_a, m_b ) ),
8520 m_floats_in_range( Detail::count_equidistant_floats( m_a, m_b, m_ulp_magnitude ) ),
8521 m_int_dist(0, m_floats_in_range),
8522 m_max_steps_in_one_go( Detail::calculate_max_steps_in_one_go(m_ulp_magnitude)),
8523 m_a_has_leq_magnitude(std::fabs(m_a) <= std::fabs(m_b))
8528 template <
typename Generator>
8529 result_type operator()( Generator& g ) {
8530 WidthType steps = m_int_dist( g );
8531 if ( m_a_has_leq_magnitude ) {
8532 if ( steps == m_floats_in_range ) {
return m_a; }
8534 while (steps > m_max_steps_in_one_go) {
8535 b -= m_max_steps_in_one_go * m_ulp_magnitude;
8536 steps -= m_max_steps_in_one_go;
8538 return b - steps * m_ulp_magnitude;
8540 if ( steps == m_floats_in_range ) {
return m_b; }
8542 while (steps > m_max_steps_in_one_go) {
8543 a += m_max_steps_in_one_go * m_ulp_magnitude;
8544 steps -= m_max_steps_in_one_go;
8546 return a + steps * m_ulp_magnitude;
8550 result_type a()
const {
return m_a; }
8551 result_type b()
const {
return m_b; }
8559namespace Generators {
8567template <
typename Float>
8568class RandomFloatingGenerator final :
public IGenerator<Float> {
8569 Catch::SimplePcg32 m_rng;
8570 Catch::uniform_floating_point_distribution<Float> m_dist;
8571 Float m_current_number;
8573 RandomFloatingGenerator( Float a, Float b, std::uint32_t seed ):
8576 static_cast<void>(next());
8579 Float const& get()
const override {
8580 return m_current_number;
8582 bool next()
override {
8583 m_current_number = m_dist(m_rng);
8589class RandomFloatingGenerator<long double> final :
public IGenerator<long double> {
8593 Catch::Detail::unique_ptr<PImpl> m_pimpl;
8594 long double m_current_number;
8597 RandomFloatingGenerator(
long double a,
long double b, std::uint32_t seed );
8599 long double const& get()
const override {
return m_current_number; }
8600 bool next()
override;
8602 ~RandomFloatingGenerator()
override;
8605template <
typename Integer>
8606class RandomIntegerGenerator final :
public IGenerator<Integer> {
8607 Catch::SimplePcg32 m_rng;
8608 Catch::uniform_integer_distribution<Integer> m_dist;
8609 Integer m_current_number;
8611 RandomIntegerGenerator( Integer a, Integer b, std::uint32_t seed ):
8614 static_cast<void>(next());
8617 Integer
const& get()
const override {
8618 return m_current_number;
8620 bool next()
override {
8621 m_current_number = m_dist(m_rng);
8626template <
typename T>
8627std::enable_if_t<std::is_integral<T>::value, GeneratorWrapper<T>>
8629 return GeneratorWrapper<T>(
8634template <
typename T>
8635std::enable_if_t<std::is_floating_point<T>::value,
8638 return GeneratorWrapper<T>(
8651#ifndef CATCH_GENERATORS_RANGE_HPP_INCLUDED
8652#define CATCH_GENERATORS_RANGE_HPP_INCLUDED
8656#include <type_traits>
8659namespace Generators {
8662template <
typename T>
8663class RangeGenerator final :
public IGenerator<T> {
8670 RangeGenerator(T
const& start, T
const& end, T
const& step):
8674 m_positive(m_step > T(0))
8676 assert(m_current != m_end &&
"Range start and end cannot be equal");
8677 assert(m_step != T(0) &&
"Step size cannot be zero");
8678 assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) &&
"Step moves away from end");
8681 RangeGenerator(T
const& start, T
const& end):
8682 RangeGenerator(start, end, (start < end) ? T(1) : T(-1))
8685 T
const& get()
const override {
8689 bool next()
override {
8690 m_current += m_step;
8691 return (m_positive) ? (m_current < m_end) : (m_current > m_end);
8695template <
typename T>
8696GeneratorWrapper<T> range(T
const& start, T
const& end, T
const& step) {
8697 static_assert(std::is_arithmetic<T>::value && !std::is_same<T, bool>::value,
"Type must be numeric");
8701template <
typename T>
8702GeneratorWrapper<T> range(T
const& start, T
const& end) {
8703 static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value,
"Type must be an integer");
8708template <
typename T>
8709class IteratorGenerator final :
public IGenerator<T> {
8710 static_assert(!std::is_same<T, bool>::value,
8711 "IteratorGenerator currently does not support bools"
8712 "because of std::vector<bool> specialization");
8714 std::vector<T> m_elems;
8715 size_t m_current = 0;
8717 template <
typename InputIterator,
typename InputSentinel>
8718 IteratorGenerator(InputIterator first, InputSentinel last):m_elems(first, last) {
8719 if (m_elems.empty()) {
8720 Detail::throw_generator_exception(
"IteratorGenerator received no valid values");
8724 T
const& get()
const override {
8725 return m_elems[m_current];
8728 bool next()
override {
8730 return m_current != m_elems.size();
8734template <
typename InputIterator,
8735 typename InputSentinel,
8736 typename ResultType = std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type>>
8737GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) {
8741template <
typename Container>
8742auto from_range(Container
const& cnt) {
8745 return from_range( begin( cnt ), end( cnt ) );
8772#ifndef CATCH_INTERFACES_ALL_HPP_INCLUDED
8773#define CATCH_INTERFACES_ALL_HPP_INCLUDED
8777#ifndef CATCH_INTERFACES_REPORTER_HPP_INCLUDED
8778#define CATCH_INTERFACES_REPORTER_HPP_INCLUDED
8782#ifndef CATCH_TEST_RUN_INFO_HPP_INCLUDED
8783#define CATCH_TEST_RUN_INFO_HPP_INCLUDED
8788 struct TestRunInfo {
8789 constexpr TestRunInfo(StringRef _name) : name(_name) {}
8804 struct ReporterDescription;
8805 struct ListenerDescription;
8807 struct TestCaseInfo;
8808 class TestCaseHandle;
8813 struct ReporterConfig {
8814 ReporterConfig( IConfig
const* _fullConfig,
8815 Detail::unique_ptr<IStream> _stream,
8816 ColourMode colourMode,
8817 std::map<std::string, std::string> customOptions );
8819 ReporterConfig( ReporterConfig&& ) =
default;
8820 ReporterConfig& operator=( ReporterConfig&& ) =
default;
8823 Detail::unique_ptr<IStream> takeStream() &&;
8824 IConfig
const* fullConfig()
const;
8826 std::map<std::string, std::string>
const& customOptions()
const;
8829 Detail::unique_ptr<IStream> m_stream;
8830 IConfig
const* m_fullConfig;
8832 std::map<std::string, std::string> m_customOptions;
8835 struct AssertionStats {
8836 AssertionStats( AssertionResult
const& _assertionResult,
8837 std::vector<MessageInfo>
const& _infoMessages,
8838 Totals
const& _totals );
8840 AssertionStats( AssertionStats
const& ) =
default;
8841 AssertionStats( AssertionStats && ) =
default;
8842 AssertionStats& operator = ( AssertionStats
const& ) =
delete;
8843 AssertionStats& operator = ( AssertionStats && ) =
delete;
8845 AssertionResult assertionResult;
8846 std::vector<MessageInfo> infoMessages;
8850 struct SectionStats {
8851 SectionStats( SectionInfo&& _sectionInfo,
8852 Counts
const& _assertions,
8853 double _durationInSeconds,
8854 bool _missingAssertions );
8856 SectionInfo sectionInfo;
8858 double durationInSeconds;
8859 bool missingAssertions;
8862 struct TestCaseStats {
8863 TestCaseStats( TestCaseInfo
const& _testInfo,
8864 Totals
const& _totals,
8865 std::string&& _stdOut,
8866 std::string&& _stdErr,
8869 TestCaseInfo
const * testInfo;
8876 struct TestRunStats {
8877 TestRunStats( TestRunInfo
const& _runInfo,
8878 Totals
const& _totals,
8881 TestRunInfo runInfo;
8889 struct ReporterPreferences {
8892 bool shouldRedirectStdOut =
false;
8895 bool shouldReportAllAssertions =
false;
8910 class IEventListener {
8913 ReporterPreferences m_preferences;
8915 IConfig
const* m_config;
8918 IEventListener( IConfig
const* config ): m_config( config ) {}
8920 virtual ~IEventListener();
8925 ReporterPreferences
const& getPreferences()
const {
8926 return m_preferences;
8930 virtual void noMatchingTestCases( StringRef unmatchedSpec ) = 0;
8932 virtual void reportInvalidTestSpec( StringRef invalidArgument ) = 0;
8939 virtual void testRunStarting( TestRunInfo
const& testRunInfo ) = 0;
8942 virtual void testCaseStarting( TestCaseInfo
const& testInfo ) = 0;
8944 virtual void testCasePartialStarting( TestCaseInfo
const& testInfo, uint64_t partNumber ) = 0;
8946 virtual void sectionStarting( SectionInfo
const& sectionInfo ) = 0;
8949 virtual void benchmarkPreparing( StringRef benchmarkName ) = 0;
8951 virtual void benchmarkStarting( BenchmarkInfo
const& benchmarkInfo ) = 0;
8953 virtual void benchmarkEnded( BenchmarkStats<>
const& benchmarkStats ) = 0;
8955 virtual void benchmarkFailed( StringRef benchmarkName ) = 0;
8958 virtual void assertionStarting( AssertionInfo
const& assertionInfo ) = 0;
8961 virtual void assertionEnded( AssertionStats
const& assertionStats ) = 0;
8964 virtual void sectionEnded( SectionStats
const& sectionStats ) = 0;
8966 virtual void testCasePartialEnded(TestCaseStats
const& testCaseStats, uint64_t partNumber ) = 0;
8968 virtual void testCaseEnded( TestCaseStats
const& testCaseStats ) = 0;
8974 virtual void testRunEnded( TestRunStats
const& testRunStats ) = 0;
8982 virtual void skipTest( TestCaseInfo
const& testInfo ) = 0;
8985 virtual void fatalErrorEncountered( StringRef error ) = 0;
8988 virtual void listReporters(std::vector<ReporterDescription>
const& descriptions) = 0;
8990 virtual void listListeners(std::vector<ListenerDescription>
const& descriptions) = 0;
8992 virtual void listTests(std::vector<TestCaseHandle>
const& tests) = 0;
8994 virtual void listTags(std::vector<TagInfo>
const& tags) = 0;
8996 using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
9003#ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED
9004#define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED
9011 struct ReporterConfig;
9013 class IEventListener;
9014 using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
9017 class IReporterFactory {
9019 virtual ~IReporterFactory();
9021 virtual IEventListenerPtr
9022 create( ReporterConfig&& config )
const = 0;
9023 virtual std::string getDescription()
const = 0;
9027 class EventListenerFactory {
9029 virtual ~EventListenerFactory();
9030 virtual IEventListenerPtr create( IConfig
const* config )
const = 0;
9032 virtual StringRef getName()
const = 0;
9034 virtual std::string getDescription()
const = 0;
9041#ifndef CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED
9042#define CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED
9050 class ITagAliasRegistry {
9052 virtual ~ITagAliasRegistry();
9054 virtual TagAlias
const* find( std::string
const& alias )
const = 0;
9055 virtual std::string expandAliases( std::string
const& unexpandedTestSpec )
const = 0;
9057 static ITagAliasRegistry
const& get();
9065#ifndef CATCH_INTERFACES_TESTCASE_HPP_INCLUDED
9066#define CATCH_INTERFACES_TESTCASE_HPP_INCLUDED
9072 struct TestCaseInfo;
9073 class TestCaseHandle;
9076 class ITestCaseRegistry {
9078 virtual ~ITestCaseRegistry();
9080 virtual std::vector<TestCaseInfo* >
const& getAllInfos()
const = 0;
9081 virtual std::vector<TestCaseHandle>
const& getAllTests()
const = 0;
9082 virtual std::vector<TestCaseHandle>
const& getAllTestsSorted( IConfig
const& config )
const = 0;
9092#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
9093#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
9099 struct CaseInsensitiveLess {
9100 bool operator()( StringRef lhs,
9101 StringRef rhs )
const;
9105 struct CaseInsensitiveEqualTo {
9106 bool operator()( StringRef lhs,
9107 StringRef rhs )
const;
9125#ifndef CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED
9126#define CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED
9129#if defined(__ANDROID__)
9130# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE
9134#if defined( CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE ) && \
9135 !defined( CATCH_CONFIG_NO_ANDROID_LOGWRITE ) && \
9136 !defined( CATCH_CONFIG_ANDROID_LOGWRITE )
9137# define CATCH_CONFIG_ANDROID_LOGWRITE
9152#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
9153#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
9156#if defined(_MSC_VER)
9157# if _MSC_VER >= 1900
9158# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
9165#if defined(__cpp_lib_uncaught_exceptions) \
9166 && !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
9168# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
9172#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \
9173 && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \
9174 && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
9176# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
9183#ifndef CATCH_CONSOLE_COLOUR_HPP_INCLUDED
9184#define CATCH_CONSOLE_COLOUR_HPP_INCLUDED
9209 BrightRed = Bright | Red,
9210 BrightGreen = Bright | Green,
9211 LightGrey = Bright | Grey,
9212 BrightWhite = Bright | White,
9213 BrightYellow = Bright | Yellow,
9216 FileName = LightGrey,
9217 Warning = BrightYellow,
9218 ResultError = BrightRed,
9219 ResultSuccess = BrightGreen,
9220 ResultExpectedFailure = Warning,
9226 OriginalExpression = Cyan,
9227 ReconstructedExpression = BrightYellow,
9229 SecondaryText = LightGrey,
9239 ColourImpl( IStream* stream ): m_stream( stream ) {}
9244 ColourImpl
const* m_colourImpl;
9245 Colour::Code m_code;
9246 bool m_engaged =
false;
9250 ColourGuard( Colour::Code code,
9251 ColourImpl
const* colour );
9253 ColourGuard( ColourGuard
const& rhs ) =
delete;
9254 ColourGuard& operator=( ColourGuard
const& rhs ) =
delete;
9256 ColourGuard( ColourGuard&& rhs )
noexcept;
9257 ColourGuard& operator=( ColourGuard&& rhs )
noexcept;
9267 ColourGuard& engage( std::ostream& stream ) &;
9273 ColourGuard&& engage( std::ostream& stream ) &&;
9277 friend std::ostream&
operator<<( std::ostream& lhs,
9278 ColourGuard& guard ) {
9279 guard.engageImpl( lhs );
9283 friend std::ostream&
operator<<( std::ostream& lhs,
9284 ColourGuard&& guard) {
9285 guard.engageImpl( lhs );
9289 void engageImpl( std::ostream& stream );
9293 virtual ~ColourImpl();
9300 ColourGuard guardColour( Colour::Code colourCode );
9303 virtual void use( Colour::Code colourCode )
const = 0;
9307 Detail::unique_ptr<ColourImpl>
makeColourImpl( ColourMode colourSelection,
9318#ifndef CATCH_CONSOLE_WIDTH_HPP_INCLUDED
9319#define CATCH_CONSOLE_WIDTH_HPP_INCLUDED
9324#ifndef CATCH_CONFIG_CONSOLE_WIDTH
9325#define CATCH_CONFIG_CONSOLE_WIDTH 80
9331#ifndef CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED
9332#define CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED
9336#include <initializer_list>
9342#if defined(CATCH_CPP17_OR_GREATER) || defined(_MSC_VER)
9349# if !defined(__cpp_lib_nonmember_container_access)
9350# define CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
9354#define CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
9362#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
9363 template <
typename Container>
9364 constexpr auto empty(Container
const& cont) ->
decltype(cont.empty()) {
9365 return cont.empty();
9367 template <
typename T, std::
size_t N>
9368 constexpr bool empty(
const T (&)[N])
noexcept {
9374 template <
typename T>
9375 constexpr bool empty(std::initializer_list<T> list)
noexcept {
9376 return list.size() > 0;
9380 template <
typename Container>
9381 constexpr auto size(Container
const& cont) ->
decltype(cont.size()) {
9384 template <
typename T, std::
size_t N>
9385 constexpr std::size_t size(
const T(&)[N])
noexcept {
9398#ifndef CATCH_DEBUG_CONSOLE_HPP_INCLUDED
9399#define CATCH_DEBUG_CONSOLE_HPP_INCLUDED
9410#ifndef CATCH_DEBUGGER_HPP_INCLUDED
9411#define CATCH_DEBUGGER_HPP_INCLUDED
9418#ifdef CATCH_PLATFORM_MAC
9420 #if defined(__i386__) || defined(__x86_64__)
9421 #define CATCH_TRAP() __asm__("int $3\n" : : )
9422 #elif defined(__aarch64__)
9423 #define CATCH_TRAP() __asm__(".inst 0xd43e0000")
9424 #elif defined(__POWERPC__)
9425 #define CATCH_TRAP() __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
9426 : : : "memory","r0","r3","r4" )
9429#elif defined(CATCH_PLATFORM_IPHONE)
9432 #if defined(__i386__) || defined(__x86_64__)
9433 #define CATCH_TRAP() __asm__("int $3")
9434 #elif defined(__aarch64__)
9435 #define CATCH_TRAP() __asm__(".inst 0xd4200000")
9436 #elif defined(__arm__) && !defined(__thumb__)
9437 #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
9438 #elif defined(__arm__) && defined(__thumb__)
9439 #define CATCH_TRAP() __asm__(".inst 0xde01")
9442#elif defined(CATCH_PLATFORM_LINUX)
9446 #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64))
9447 #define CATCH_TRAP() asm volatile ("int $3")
9451 #define CATCH_TRAP() raise(SIGTRAP)
9453#elif defined(_MSC_VER)
9454 #define CATCH_TRAP() __debugbreak()
9455#elif defined(__MINGW32__)
9456 extern "C" __declspec(dllimport)
void __stdcall DebugBreak();
9457 #define CATCH_TRAP() DebugBreak()
9460#ifndef CATCH_BREAK_INTO_DEBUGGER
9462 #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
9464 #define CATCH_BREAK_INTO_DEBUGGER() []{}()
9471#ifndef CATCH_ENFORCE_HPP_INCLUDED
9472#define CATCH_ENFORCE_HPP_INCLUDED
9478#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
9479 template <
typename Ex>
9498#define CATCH_MAKE_MSG(...) \
9499 (Catch::ReusableStringStream() << __VA_ARGS__).str()
9501#define CATCH_INTERNAL_ERROR(...) \
9502 Catch::throw_logic_error(CATCH_MAKE_MSG( CATCH_INTERNAL_LINEINFO << ": Internal Catch2 error: " << __VA_ARGS__))
9504#define CATCH_ERROR(...) \
9505 Catch::throw_domain_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
9507#define CATCH_RUNTIME_ERROR(...) \
9508 Catch::throw_runtime_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
9510#define CATCH_ENFORCE( condition, ... ) \
9511 do{ if( !(condition) ) CATCH_ERROR( __VA_ARGS__ ); } while(false)
9517#ifndef CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
9518#define CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
9527 Catch::Detail::unique_ptr<EnumInfo>
makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int>
const& values );
9529 class EnumValuesRegistry :
public IMutableEnumValuesRegistry {
9531 std::vector<Catch::Detail::unique_ptr<EnumInfo>> m_enumInfos;
9533 EnumInfo
const& registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int>
const& values)
override;
9536 std::vector<StringRef>
parseEnums( StringRef enums );
9545#ifndef CATCH_ERRNO_GUARD_HPP_INCLUDED
9546#define CATCH_ERRNO_GUARD_HPP_INCLUDED
9567#ifndef CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
9568#define CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
9576 class ExceptionTranslatorRegistry :
public IExceptionTranslatorRegistry {
9578 ~ExceptionTranslatorRegistry()
override;
9579 void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator );
9590#ifndef CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED
9591#define CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED
9607 class FatalConditionHandler {
9608 bool m_started =
false;
9613 void engage_platform();
9614 void disengage_platform() noexcept;
9617 FatalConditionHandler();
9618 ~FatalConditionHandler();
9621 assert(!m_started &&
"Handler cannot be installed twice.");
9626 void disengage() noexcept {
9627 assert(m_started &&
"Handler cannot be uninstalled without being installed first");
9629 disengage_platform();
9634 class FatalConditionHandlerGuard {
9635 FatalConditionHandler* m_handler;
9637 FatalConditionHandlerGuard(FatalConditionHandler* handler):
9638 m_handler(handler) {
9639 m_handler->engage();
9641 ~FatalConditionHandlerGuard() {
9642 m_handler->disengage();
9651#ifndef CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED
9652#define CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED
9676#if defined( __GNUC__ ) || defined( __clang__ )
9677# pragma GCC diagnostic push
9681# pragma GCC diagnostic ignored "-Wfloat-equal"
9701 template <
typename FP>
9702 uint64_t ulpDistance( FP lhs, FP rhs ) {
9703 assert( std::numeric_limits<FP>::is_iec559 &&
9704 "ulpDistance assumes IEEE-754 format for floating point types" );
9706 "Distance between NaN and number is not meaningful" );
9708 "Distance between NaN and number is not meaningful" );
9712 if ( lhs == rhs ) {
return 0; }
9715 static constexpr FP positive_zero{};
9718 if ( lhs == positive_zero ) { lhs = positive_zero; }
9719 if ( rhs == positive_zero ) { rhs = positive_zero; }
9723 if ( std::signbit( lhs ) != std::signbit( rhs ) ) {
9724 return ulpDistance( std::abs( lhs ), positive_zero ) +
9725 ulpDistance( std::abs( rhs ), positive_zero );
9731 uint64_t lc = Detail::convertToBits( lhs );
9732 uint64_t rc = Detail::convertToBits( rhs );
9737 std::swap( lc, rc );
9743#if defined( __GNUC__ ) || defined( __clang__ )
9744# pragma GCC diagnostic pop
9753#ifndef CATCH_GETENV_HPP_INCLUDED
9754#define CATCH_GETENV_HPP_INCLUDED
9760 char const*
getEnv(
char const* varName);
9768#ifndef CATCH_IS_PERMUTATION_HPP_INCLUDED
9769#define CATCH_IS_PERMUTATION_HPP_INCLUDED
9777 template <
typename ForwardIter,
9780 typename Comparator>
9782 ForwardIter find_sentinel( ForwardIter start,
9786 while ( start != sentinel ) {
9787 if ( cmp( *start, value ) ) {
break; }
9793 template <
typename ForwardIter,
9796 typename Comparator>
9798 std::ptrdiff_t count_sentinel( ForwardIter start,
9802 std::ptrdiff_t count = 0;
9803 while ( start != sentinel ) {
9804 if ( cmp( *start, value ) ) { ++count; }
9810 template <
typename ForwardIter,
typename Sentinel>
9812 std::enable_if_t<!std::is_same<ForwardIter, Sentinel>::value,
9814 sentinel_distance( ForwardIter iter,
const Sentinel sentinel ) {
9815 std::ptrdiff_t dist = 0;
9816 while ( iter != sentinel ) {
9823 template <
typename ForwardIter>
9824 constexpr std::ptrdiff_t sentinel_distance( ForwardIter first,
9825 ForwardIter last ) {
9826 return std::distance( first, last );
9829 template <
typename ForwardIter1,
9831 typename ForwardIter2,
9833 typename Comparator>
9834 constexpr bool check_element_counts( ForwardIter1 first_1,
9835 const Sentinel1 end_1,
9836 ForwardIter2 first_2,
9837 const Sentinel2 end_2,
9839 auto cursor = first_1;
9840 while ( cursor != end_1 ) {
9841 if ( find_sentinel( first_1, cursor, *cursor, cmp ) ==
9844 const auto count_in_range_2 =
9845 count_sentinel( first_2, end_2, *cursor, cmp );
9848 if ( count_in_range_2 == 0 ) {
return false; }
9850 const auto count_in_range_1 =
9851 count_sentinel( cursor, end_1, *cursor, cmp );
9852 if ( count_in_range_1 != count_in_range_2 ) {
9863 template <
typename ForwardIter1,
9865 typename ForwardIter2,
9867 typename Comparator>
9868 constexpr bool is_permutation( ForwardIter1 first_1,
9869 const Sentinel1 end_1,
9870 ForwardIter2 first_2,
9871 const Sentinel2 end_2,
9876 while (first_1 != end_1 && first_2 != end_2 && cmp(*first_1, *first_2)) {
9882 if (first_1 == end_1 || first_2 == end_2) {
9883 return first_1 == end_1 && first_2 == end_2;
9887 auto dist_1 = sentinel_distance( first_1, end_1 );
9888 auto dist_2 = sentinel_distance( first_2, end_2 );
9890 if (dist_1 != dist_2) {
return false; }
9895 return check_element_counts( first_1, end_1, first_2, end_2, cmp );
9904#ifndef CATCH_ISTREAM_HPP_INCLUDED
9905#define CATCH_ISTREAM_HPP_INCLUDED
9918 virtual std::ostream& stream() = 0;
9930 virtual bool isConsole()
const {
return false; }
9944 auto makeStream( std::string
const& filename ) -> Detail::unique_ptr<IStream>;
9951#ifndef CATCH_JSONWRITER_HPP_INCLUDED
9952#define CATCH_JSONWRITER_HPP_INCLUDED
9959 class JsonObjectWriter;
9960 class JsonArrayWriter;
9963 static void indent( std::ostream& os, std::uint64_t level );
9964 static void appendCommaNewline( std::ostream& os,
9966 std::uint64_t level );
9969 class JsonValueWriter {
9971 JsonValueWriter( std::ostream& os );
9972 JsonValueWriter( std::ostream& os, std::uint64_t indent_level );
9974 JsonObjectWriter writeObject() &&;
9975 JsonArrayWriter writeArray() &&;
9977 template <
typename T>
9978 void write( T
const& value ) && {
9979 writeImpl( value, !std::is_arithmetic<T>::value );
9981 void write( StringRef value ) &&;
9982 void write(
bool value ) &&;
9985 void writeImpl( StringRef value,
bool quote );
9991 template <
typename T,
9992 typename =
typename std::enable_if_t<
9993 !std::is_convertible<T, StringRef>::value>>
9994 void writeImpl( T
const& value,
bool quote_value ) {
9996 writeImpl( m_sstream.str(), quote_value );
10000 std::stringstream m_sstream;
10001 std::uint64_t m_indent_level;
10004 class JsonObjectWriter {
10006 JsonObjectWriter( std::ostream& os );
10007 JsonObjectWriter( std::ostream& os, std::uint64_t indent_level );
10009 JsonObjectWriter( JsonObjectWriter&& source )
noexcept;
10010 JsonObjectWriter& operator=( JsonObjectWriter&& source ) =
delete;
10012 ~JsonObjectWriter();
10014 JsonValueWriter write( StringRef key );
10017 std::ostream& m_os;
10018 std::uint64_t m_indent_level;
10019 bool m_should_comma =
false;
10020 bool m_active =
true;
10023 class JsonArrayWriter {
10025 JsonArrayWriter( std::ostream& os );
10026 JsonArrayWriter( std::ostream& os, std::uint64_t indent_level );
10028 JsonArrayWriter( JsonArrayWriter&& source )
noexcept;
10029 JsonArrayWriter& operator=( JsonArrayWriter&& source ) =
delete;
10031 ~JsonArrayWriter();
10033 JsonObjectWriter writeObject();
10034 JsonArrayWriter writeArray();
10036 template <
typename T>
10037 JsonArrayWriter& write( T
const& value ) {
10038 return writeImpl( value );
10041 JsonArrayWriter& write(
bool value );
10044 template <
typename T>
10045 JsonArrayWriter& writeImpl( T
const& value ) {
10046 JsonUtils::appendCommaNewline(
10047 m_os, m_should_comma, m_indent_level + 1 );
10048 JsonValueWriter{ m_os }.write( value );
10053 std::ostream& m_os;
10054 std::uint64_t m_indent_level;
10055 bool m_should_comma =
false;
10056 bool m_active =
true;
10064#ifndef CATCH_LEAK_DETECTOR_HPP_INCLUDED
10065#define CATCH_LEAK_DETECTOR_HPP_INCLUDED
10069 struct LeakDetector {
10078#ifndef CATCH_LIST_HPP_INCLUDED
10079#define CATCH_LIST_HPP_INCLUDED
10088 class IEventListener;
10092 struct ReporterDescription {
10093 std::string name, description;
10095 struct ListenerDescription {
10097 std::string description;
10101 void add(StringRef spelling);
10102 std::string all()
const;
10104 std::set<StringRef> spellings;
10105 std::size_t count = 0;
10108 bool list( IEventListener& reporter, Config
const& config );
10115#ifndef CATCH_OUTPUT_REDIRECT_HPP_INCLUDED
10116#define CATCH_OUTPUT_REDIRECT_HPP_INCLUDED
10124 class OutputRedirect {
10125 bool m_redirectActive =
false;
10126 virtual void activateImpl() = 0;
10127 virtual void deactivateImpl() = 0;
10138 virtual ~OutputRedirect();
10141 virtual std::string getStdout() = 0;
10142 virtual std::string getStderr() = 0;
10143 virtual void clearBuffers() = 0;
10144 bool isActive()
const {
return m_redirectActive; }
10146 assert( !m_redirectActive &&
"redirect is already active" );
10148 m_redirectActive =
true;
10150 void deactivate() {
10151 assert( m_redirectActive &&
"redirect is not active" );
10153 m_redirectActive =
false;
10160 class RedirectGuard {
10161 OutputRedirect* m_redirect;
10163 bool m_previouslyActive;
10164 bool m_moved =
false;
10167 RedirectGuard(
bool activate, OutputRedirect& redirectImpl );
10168 ~RedirectGuard() noexcept( false );
10170 RedirectGuard( RedirectGuard const& ) = delete;
10171 RedirectGuard& operator=( RedirectGuard const& ) = delete;
10174 RedirectGuard( RedirectGuard&& rhs ) noexcept;
10175 RedirectGuard& operator=( RedirectGuard&& rhs ) noexcept;
10178 RedirectGuard scopedActivate( OutputRedirect& redirectImpl );
10179 RedirectGuard scopedDeactivate( OutputRedirect& redirectImpl );
10186#ifndef CATCH_PARSE_NUMBERS_HPP_INCLUDED
10187#define CATCH_PARSE_NUMBERS_HPP_INCLUDED
10200 Optional<unsigned int>
parseUInt(std::string
const& input,
int base = 10);
10206#ifndef CATCH_REPORTER_REGISTRY_HPP_INCLUDED
10207#define CATCH_REPORTER_REGISTRY_HPP_INCLUDED
10216 class IEventListener;
10217 using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
10218 class IReporterFactory;
10220 struct ReporterConfig;
10221 class EventListenerFactory;
10223 class ReporterRegistry {
10224 struct ReporterRegistryImpl;
10225 Detail::unique_ptr<ReporterRegistryImpl> m_impl;
10228 ReporterRegistry();
10229 ~ReporterRegistry();
10231 IEventListenerPtr create( std::string
const& name,
10232 ReporterConfig&& config )
const;
10234 void registerReporter( std::string
const& name,
10235 IReporterFactoryPtr factory );
10238 registerListener( Detail::unique_ptr<EventListenerFactory> factory );
10240 std::map<std::string,
10242 Detail::CaseInsensitiveLess>
const&
10243 getFactories()
const;
10245 std::vector<Detail::unique_ptr<EventListenerFactory>>
const&
10246 getListeners()
const;
10254#ifndef CATCH_RUN_CONTEXT_HPP_INCLUDED
10255#define CATCH_RUN_CONTEXT_HPP_INCLUDED
10259#ifndef CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
10260#define CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
10267namespace TestCaseTracking {
10269 struct NameAndLocation {
10271 SourceLineInfo location;
10273 NameAndLocation( std::string&& _name, SourceLineInfo
const& _location );
10274 friend bool operator==(NameAndLocation
const& lhs, NameAndLocation
const& rhs) {
10279 if ( lhs.location.line != rhs.location.line ) {
return false; }
10280 return lhs.name == rhs.name && lhs.location == rhs.location;
10282 friend bool operator!=(NameAndLocation
const& lhs,
10283 NameAndLocation
const& rhs) {
10284 return !( lhs == rhs );
10295 struct NameAndLocationRef {
10297 SourceLineInfo location;
10299 constexpr NameAndLocationRef( StringRef name_,
10300 SourceLineInfo location_ ):
10301 name( name_ ), location( location_ ) {}
10303 friend bool operator==( NameAndLocation
const& lhs,
10304 NameAndLocationRef
const& rhs ) {
10309 if ( lhs.location.line != rhs.location.line ) {
return false; }
10310 return StringRef( lhs.name ) == rhs.name &&
10311 lhs.location == rhs.location;
10313 friend bool operator==( NameAndLocationRef
const& lhs,
10314 NameAndLocation
const& rhs ) {
10321 using ITrackerPtr = Catch::Detail::unique_ptr<ITracker>;
10324 NameAndLocation m_nameAndLocation;
10326 using Children = std::vector<ITrackerPtr>;
10334 CompletedSuccessfully,
10338 ITracker* m_parent =
nullptr;
10339 Children m_children;
10340 CycleState m_runState = NotStarted;
10343 ITracker( NameAndLocation&& nameAndLoc, ITracker* parent ):
10344 m_nameAndLocation(
CATCH_MOVE(nameAndLoc) ),
10350 NameAndLocation
const& nameAndLocation()
const {
10351 return m_nameAndLocation;
10353 ITracker* parent()
const {
10357 virtual ~ITracker();
10363 virtual bool isComplete()
const = 0;
10365 bool isSuccessfullyCompleted()
const {
10366 return m_runState == CompletedSuccessfully;
10369 bool isOpen()
const;
10371 bool hasStarted()
const;
10374 virtual void close() = 0;
10375 virtual void fail() = 0;
10376 void markAsNeedingAnotherRun();
10379 void addChild( ITrackerPtr&& child );
10385 ITracker* findChild( NameAndLocationRef
const& nameAndLocation );
10387 bool hasChildren()
const {
10388 return !m_children.empty();
10401 virtual bool isSectionTracker()
const;
10408 virtual bool isGeneratorTracker()
const;
10411 class TrackerContext {
10419 ITrackerPtr m_rootTracker;
10420 ITracker* m_currentTracker =
nullptr;
10421 RunState m_runState = NotStarted;
10425 ITracker& startRun();
10427 void startCycle() {
10428 m_currentTracker = m_rootTracker.get();
10429 m_runState = Executing;
10431 void completeCycle();
10433 bool completedCycle()
const;
10434 ITracker& currentTracker() {
return *m_currentTracker; }
10435 void setCurrentTracker( ITracker* tracker );
10438 class TrackerBase :
public ITracker {
10441 TrackerContext& m_ctx;
10444 TrackerBase( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent );
10446 bool isComplete()
const override;
10450 void close()
override;
10451 void fail()
override;
10454 void moveToParent();
10458 class SectionTracker :
public TrackerBase {
10459 std::vector<StringRef> m_filters;
10464 StringRef m_trimmed_name;
10466 SectionTracker( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent );
10468 bool isSectionTracker()
const override;
10470 bool isComplete()
const override;
10472 static SectionTracker& acquire( TrackerContext& ctx, NameAndLocationRef
const& nameAndLocation );
10476 void addInitialFilters( std::vector<std::string>
const& filters );
10477 void addNextFilters( std::vector<StringRef>
const& filters );
10479 std::vector<StringRef>
const& getFilters()
const {
return m_filters; }
10481 StringRef trimmedName()
const;
10486using TestCaseTracking::ITracker;
10487using TestCaseTracking::TrackerContext;
10488using TestCaseTracking::SectionTracker;
10498 class IGeneratorTracker;
10500 class IEventListener;
10501 using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
10502 class OutputRedirect;
10506 class RunContext final :
public IResultCapture {
10509 RunContext( RunContext
const& ) =
delete;
10510 RunContext& operator =( RunContext
const& ) =
delete;
10512 explicit RunContext( IConfig
const* _config, IEventListenerPtr&& reporter );
10514 ~RunContext()
override;
10516 Totals runTest(TestCaseHandle
const& testCase);
10522 ( AssertionInfo
const& info,
10523 ITransientExpression
const& expr,
10524 AssertionReaction& reaction )
override;
10526 ( AssertionInfo
const& info,
10527 ResultWas::OfType resultType,
10528 std::string&& message,
10529 AssertionReaction& reaction )
override;
10530 void handleUnexpectedExceptionNotThrown
10531 ( AssertionInfo
const& info,
10532 AssertionReaction& reaction )
override;
10533 void handleUnexpectedInflightException
10534 ( AssertionInfo
const& info,
10535 std::string&& message,
10536 AssertionReaction& reaction )
override;
10537 void handleIncomplete
10538 ( AssertionInfo
const& info )
override;
10540 ( AssertionInfo
const &info,
10541 ResultWas::OfType resultType,
10542 AssertionReaction &reaction )
override;
10544 void notifyAssertionStarted( AssertionInfo
const& info )
override;
10545 bool sectionStarted( StringRef sectionName,
10546 SourceLineInfo
const& sectionLineInfo,
10547 Counts& assertions )
override;
10549 void sectionEnded( SectionEndInfo&& endInfo )
override;
10550 void sectionEndedEarly( SectionEndInfo&& endInfo )
override;
10554 SourceLineInfo
const& lineInfo )
override;
10556 StringRef generatorName,
10557 SourceLineInfo lineInfo,
10558 Generators::GeneratorBasePtr&& generator )
override;
10561 void benchmarkPreparing( StringRef name )
override;
10562 void benchmarkStarting( BenchmarkInfo
const& info )
override;
10563 void benchmarkEnded( BenchmarkStats<>
const& stats )
override;
10564 void benchmarkFailed( StringRef error )
override;
10566 void pushScopedMessage( MessageInfo
const& message )
override;
10567 void popScopedMessage( MessageInfo
const& message )
override;
10569 void emplaceUnscopedMessage( MessageBuilder&& builder )
override;
10571 std::string getCurrentTestName()
const override;
10573 const AssertionResult* getLastResult()
const override;
10575 void exceptionEarlyReported()
override;
10577 void handleFatalErrorCondition( StringRef message )
override;
10579 bool lastAssertionPassed()
override;
10581 void assertionPassed()
override;
10585 bool aborting()
const;
10589 void runCurrentTest();
10590 void invokeActiveTestCase();
10592 void resetAssertionInfo();
10593 bool testForMissingAssertions( Counts& assertions );
10595 void assertionEnded( AssertionResult&& result );
10597 ( AssertionInfo
const &info,
10598 ResultWas::OfType resultType,
10599 ITransientExpression
const *expr,
10602 void populateReaction( AssertionReaction& reaction );
10606 void handleUnfinishedSections();
10608 TestRunInfo m_runInfo;
10609 TestCaseHandle
const* m_activeTestCase =
nullptr;
10610 ITracker* m_testCaseTracker =
nullptr;
10611 Optional<AssertionResult> m_lastResult;
10613 IConfig
const* m_config;
10615 IEventListenerPtr m_reporter;
10616 std::vector<MessageInfo> m_messages;
10617 std::vector<ScopedMessage> m_messageScopes;
10618 AssertionInfo m_lastAssertionInfo;
10619 std::vector<SectionEndInfo> m_unfinishedSections;
10620 std::vector<ITracker*> m_activeSections;
10621 TrackerContext m_trackerContext;
10622 Detail::unique_ptr<OutputRedirect> m_outputRedirect;
10623 FatalConditionHandler m_fatalConditionhandler;
10624 bool m_lastAssertionPassed =
false;
10625 bool m_shouldReportUnexpected =
true;
10626 bool m_includeSuccessfulResults;
10629 void seedRng(IConfig
const& config);
10636#ifndef CATCH_SHARDING_HPP_INCLUDED
10637#define CATCH_SHARDING_HPP_INCLUDED
10641#include <algorithm>
10645 template<
typename Container>
10646 Container createShard(Container
const& container, std::size_t
const shardCount, std::size_t
const shardIndex) {
10647 assert(shardCount > shardIndex);
10649 if (shardCount == 1) {
10653 const std::size_t totalTestCount = container.size();
10655 const std::size_t shardSize = totalTestCount / shardCount;
10656 const std::size_t leftoverTests = totalTestCount % shardCount;
10658 const std::size_t startIndex = shardIndex * shardSize + (std::min)(shardIndex, leftoverTests);
10659 const std::size_t endIndex = (shardIndex + 1) * shardSize + (std::min)(shardIndex + 1, leftoverTests);
10661 auto startIterator = std::next(container.begin(),
static_cast<std::ptrdiff_t
>(startIndex));
10662 auto endIterator = std::next(container.begin(),
static_cast<std::ptrdiff_t
>(endIndex));
10664 return Container(startIterator, endIterator);
10672#ifndef CATCH_SINGLETONS_HPP_INCLUDED
10673#define CATCH_SINGLETONS_HPP_INCLUDED
10677 struct ISingleton {
10678 virtual ~ISingleton();
10686 template<
typename SingletonImplT,
typename InterfaceT = SingletonImplT,
typename MutableInterfaceT = InterfaceT>
10687 class Singleton : SingletonImplT,
public ISingleton {
10689 static auto getInternal() -> Singleton* {
10690 static Singleton* s_instance =
nullptr;
10691 if( !s_instance ) {
10692 s_instance =
new Singleton;
10699 static auto get() -> InterfaceT
const& {
10700 return *getInternal();
10702 static auto getMutable() -> MutableInterfaceT& {
10703 return *getInternal();
10712#ifndef CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED
10713#define CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED
10717#include <exception>
10721 class StartupExceptionRegistry {
10722#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
10724 void add(std::exception_ptr
const& exception)
noexcept;
10725 std::vector<std::exception_ptr>
const& getExceptions() const noexcept;
10727 std::vector<std::exception_ptr> m_exceptions;
10737#ifndef CATCH_STDSTREAMS_HPP_INCLUDED
10738#define CATCH_STDSTREAMS_HPP_INCLUDED
10744 std::ostream&
cout();
10745 std::ostream&
cerr();
10746 std::ostream&
clog();
10753#ifndef CATCH_STRING_MANIP_HPP_INCLUDED
10754#define CATCH_STRING_MANIP_HPP_INCLUDED
10764 bool startsWith( std::string
const& s, std::string
const& prefix );
10765 bool startsWith( StringRef s,
char prefix );
10766 bool endsWith( std::string
const& s, std::string
const& suffix );
10767 bool endsWith( std::string
const& s,
char suffix );
10768 bool contains( std::string
const& s, std::string
const& infix );
10770 std::string
toLower( std::string
const& s );
10773 std::string
trim( std::string
const& str );
10775 StringRef
trim(StringRef ref);
10778 std::vector<StringRef>
splitStringRef( StringRef str,
char delimiter );
10779 bool replaceInPlace( std::string& str, std::string
const& replaceThis, std::string
const& withThis );
10792 std::uint64_t m_count;
10796 constexpr pluralise(std::uint64_t count, StringRef label):
10801 friend std::ostream&
operator << ( std::ostream& os, pluralise
const& pluraliser );
10808#ifndef CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED
10809#define CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED
10816 struct SourceLineInfo;
10818 class TagAliasRegistry :
public ITagAliasRegistry {
10820 ~TagAliasRegistry()
override;
10821 TagAlias
const* find( std::string
const& alias )
const override;
10822 std::string expandAliases( std::string
const& unexpandedTestSpec )
const override;
10823 void add( std::string
const& alias, std::string
const& tag, SourceLineInfo
const& lineInfo );
10826 std::map<std::string, TagAlias> m_registry;
10834#ifndef CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED
10835#define CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED
10841 struct TestCaseInfo;
10843 class TestCaseInfoHasher {
10845 using hash_t = std::uint64_t;
10846 TestCaseInfoHasher( hash_t seed );
10847 uint32_t operator()( TestCaseInfo
const& t )
const;
10858#ifndef CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
10859#define CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
10867 class ITestInvoker;
10868 class TestCaseHandle;
10871 std::vector<TestCaseHandle>
sortTests( IConfig
const& config, std::vector<TestCaseHandle>
const& unsortedTestCases );
10873 bool isThrowSafe( TestCaseHandle
const& testCase, IConfig
const& config );
10875 std::vector<TestCaseHandle>
filterTests( std::vector<TestCaseHandle>
const& testCases, TestSpec
const& testSpec, IConfig
const& config );
10878 class TestRegistry :
public ITestCaseRegistry {
10880 void registerTest( Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker );
10882 std::vector<TestCaseInfo*>
const& getAllInfos()
const override;
10883 std::vector<TestCaseHandle>
const& getAllTests()
const override;
10884 std::vector<TestCaseHandle>
const& getAllTestsSorted( IConfig
const& config )
const override;
10886 ~TestRegistry()
override;
10889 std::vector<Detail::unique_ptr<TestCaseInfo>> m_owned_test_infos;
10892 std::vector<TestCaseInfo*> m_viewed_test_infos;
10894 std::vector<Detail::unique_ptr<ITestInvoker>> m_invokers;
10895 std::vector<TestCaseHandle> m_handles;
10896 mutable TestRunOrder m_currentSortOrder = TestRunOrder::Declared;
10897 mutable std::vector<TestCaseHandle> m_sortedFunctions;
10909#ifndef CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
10910#define CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
10913#pragma clang diagnostic push
10914#pragma clang diagnostic ignored "-Wpadded"
10923 class ITagAliasRegistry;
10925 class TestSpecParser {
10926 enum Mode{
None, Name, QuotedName, Tag, EscapedName };
10927 Mode m_mode =
None;
10928 Mode lastMode =
None;
10929 bool m_exclusion =
false;
10930 std::size_t m_pos = 0;
10931 std::size_t m_realPatternPos = 0;
10933 std::string m_substring;
10934 std::string m_patternName;
10935 std::vector<std::size_t> m_escapeChars;
10936 TestSpec::Filter m_currentFilter;
10937 TestSpec m_testSpec;
10938 ITagAliasRegistry
const* m_tagAliases =
nullptr;
10941 TestSpecParser( ITagAliasRegistry
const& tagAliases );
10943 TestSpecParser& parse( std::string
const& arg );
10944 TestSpec testSpec();
10947 bool visitChar(
char c );
10948 void startNewMode( Mode mode );
10949 bool processNoneChar(
char c );
10950 void processNameChar(
char c );
10951 bool processOtherChar(
char c );
10954 bool isControlChar(
char c )
const;
10955 void saveLastMode();
10956 void revertBackToLastMode();
10961 std::string preprocessPattern();
10963 void addNamePattern();
10965 void addTagPattern();
10967 inline void addCharToPattern(
char c) {
10969 m_patternName += c;
10970 m_realPatternPos++;
10978#pragma clang diagnostic pop
10984#ifndef CATCH_TEXTFLOW_HPP_INCLUDED
10985#define CATCH_TEXTFLOW_HPP_INCLUDED
10993 namespace TextFlow {
11009 class AnsiSkippingString {
11010 std::string m_string;
11011 std::size_t m_size = 0;
11014 void preprocessString();
11017 class const_iterator;
11018 using iterator = const_iterator;
11021 static constexpr char sentinel =
static_cast<char>( 0xffu );
11023 explicit AnsiSkippingString( std::string
const& text );
11024 explicit AnsiSkippingString( std::string&& text );
11026 const_iterator begin()
const;
11027 const_iterator end()
const;
11029 size_t size()
const {
return m_size; }
11031 std::string substring( const_iterator begin,
11032 const_iterator end )
const;
11035 class AnsiSkippingString::const_iterator {
11036 friend AnsiSkippingString;
11039 const std::string* m_string;
11040 std::string::const_iterator m_it;
11042 explicit const_iterator(
const std::string&
string, EndTag ):
11043 m_string( &string ), m_it( string.end() ) {}
11045 void tryParseAnsiEscapes();
11050 using difference_type = std::ptrdiff_t;
11051 using value_type = char;
11052 using pointer = value_type*;
11053 using reference = value_type&;
11054 using iterator_category = std::bidirectional_iterator_tag;
11056 explicit const_iterator(
const std::string&
string ):
11057 m_string( &string ), m_it( string.begin() ) {
11058 tryParseAnsiEscapes();
11061 char operator*()
const {
return *m_it; }
11063 const_iterator& operator++() {
11067 const_iterator operator++(
int ) {
11068 iterator prev( *
this );
11072 const_iterator& operator--() {
11076 const_iterator operator--(
int ) {
11077 iterator prev( *
this );
11082 bool operator==( const_iterator
const& other )
const {
11083 return m_it == other.m_it;
11085 bool operator!=( const_iterator
const& other )
const {
11088 bool operator<=( const_iterator
const& other )
const {
11089 return m_it <= other.m_it;
11092 const_iterator oneBefore()
const {
11107 AnsiSkippingString m_string;
11109 size_t m_width = CATCH_CONFIG_CONSOLE_WIDTH - 1;
11112 size_t m_indent = 0;
11114 size_t m_initialIndent = std::string::npos;
11120 class const_iterator {
11124 Column
const& m_column;
11126 AnsiSkippingString::const_iterator m_lineStart;
11128 AnsiSkippingString::const_iterator m_lineEnd;
11130 AnsiSkippingString::const_iterator m_parsedTo;
11132 bool m_addHyphen =
false;
11134 const_iterator( Column
const& column, EndTag ):
11135 m_column( column ),
11136 m_lineStart( m_column.m_string.end() ),
11137 m_lineEnd( column.m_string.end() ),
11138 m_parsedTo( column.m_string.end() ) {}
11144 size_t indentSize()
const;
11148 std::string addIndentAndSuffix(
11149 AnsiSkippingString::const_iterator start,
11150 AnsiSkippingString::const_iterator end )
const;
11153 using difference_type = std::ptrdiff_t;
11154 using value_type = std::string;
11155 using pointer = value_type*;
11156 using reference = value_type&;
11157 using iterator_category = std::forward_iterator_tag;
11159 explicit const_iterator( Column
const& column );
11161 std::string operator*()
const;
11163 const_iterator& operator++();
11164 const_iterator operator++(
int );
11166 bool operator==( const_iterator
const& other )
const {
11167 return m_lineStart == other.m_lineStart &&
11168 &m_column == &other.m_column;
11170 bool operator!=( const_iterator
const& other )
const {
11174 using iterator = const_iterator;
11176 explicit Column( std::string
const& text ): m_string(
text ) {}
11177 explicit Column( std::string&& text ):
11180 Column& width(
size_t newWidth ) & {
11181 assert( newWidth > 0 );
11182 m_width = newWidth;
11185 Column&& width(
size_t newWidth ) && {
11186 assert( newWidth > 0 );
11187 m_width = newWidth;
11190 Column& indent(
size_t newIndent ) & {
11191 m_indent = newIndent;
11194 Column&& indent(
size_t newIndent ) && {
11195 m_indent = newIndent;
11198 Column& initialIndent(
size_t newIndent ) & {
11199 m_initialIndent = newIndent;
11202 Column&& initialIndent(
size_t newIndent ) && {
11203 m_initialIndent = newIndent;
11207 size_t width()
const {
return m_width; }
11208 const_iterator begin()
const {
return const_iterator( *
this ); }
11209 const_iterator end()
const {
11210 return { *
this, const_iterator::EndTag{} };
11213 friend std::ostream&
operator<<( std::ostream& os,
11214 Column
const& col );
11216 friend Columns
operator+( Column
const& lhs, Column
const& rhs );
11217 friend Columns
operator+( Column&& lhs, Column&& rhs );
11221 Column
Spacer(
size_t spaceWidth );
11224 std::vector<Column> m_columns;
11231 std::vector<Column>
const& m_columns;
11232 std::vector<Column::const_iterator> m_iterators;
11233 size_t m_activeIterators;
11235 iterator( Columns
const& columns, EndTag );
11238 using difference_type = std::ptrdiff_t;
11239 using value_type = std::string;
11240 using pointer = value_type*;
11241 using reference = value_type&;
11242 using iterator_category = std::forward_iterator_tag;
11244 explicit iterator( Columns
const& columns );
11246 auto operator==( iterator
const& other )
const ->
bool {
11247 return m_iterators == other.m_iterators;
11249 auto operator!=( iterator
const& other )
const ->
bool {
11250 return m_iterators != other.m_iterators;
11252 std::string operator*()
const;
11253 iterator& operator++();
11254 iterator operator++(
int );
11256 using const_iterator = iterator;
11258 iterator begin()
const {
return iterator( *
this ); }
11259 iterator end()
const {
return { *
this, iterator::EndTag() }; }
11261 friend Columns&
operator+=( Columns& lhs, Column
const& rhs );
11262 friend Columns&
operator+=( Columns& lhs, Column&& rhs );
11263 friend Columns
operator+( Columns
const& lhs, Column
const& rhs );
11264 friend Columns
operator+( Columns&& lhs, Column&& rhs );
11266 friend std::ostream&
operator<<( std::ostream& os,
11267 Columns
const& cols );
11275#ifndef CATCH_TO_STRING_HPP_INCLUDED
11276#define CATCH_TO_STRING_HPP_INCLUDED
11282 template <
typename T>
11283 std::string to_string(T
const& t) {
11284#if defined(CATCH_CONFIG_CPP11_TO_STRING)
11285 return std::to_string(t);
11287 ReusableStringStream rss;
11297#ifndef CATCH_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
11298#define CATCH_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
11307#ifndef CATCH_XMLWRITER_HPP_INCLUDED
11308#define CATCH_XMLWRITER_HPP_INCLUDED
11316 enum class XmlFormatting : std::uint8_t {
11322 constexpr XmlFormatting
operator|( XmlFormatting lhs, XmlFormatting rhs ) {
11323 return static_cast<XmlFormatting
>(
static_cast<std::uint8_t
>( lhs ) |
11324 static_cast<std::uint8_t
>( rhs ) );
11327 constexpr XmlFormatting operator&( XmlFormatting lhs, XmlFormatting rhs ) {
11328 return static_cast<XmlFormatting
>(
static_cast<std::uint8_t
>( lhs ) &
11329 static_cast<std::uint8_t
>( rhs ) );
11341 enum ForWhat { ForTextNodes, ForAttributes };
11343 constexpr XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ):
11344 m_str( str ), m_forWhat( forWhat ) {}
11347 void encodeTo( std::ostream& os )
const;
11349 friend std::ostream&
operator << ( std::ostream& os, XmlEncode
const& xmlEncode );
11359 class ScopedElement {
11361 ScopedElement( XmlWriter* writer, XmlFormatting fmt );
11363 ScopedElement( ScopedElement&& other )
noexcept;
11364 ScopedElement& operator=( ScopedElement&& other )
noexcept;
11369 writeText( StringRef text,
11370 XmlFormatting fmt = XmlFormatting::Newline |
11371 XmlFormatting::Indent );
11373 ScopedElement& writeAttribute( StringRef name,
11374 StringRef attribute );
11375 template <
typename T,
11380 typename =
typename std::enable_if_t<
11381 !std::is_convertible<T, StringRef>::value>>
11382 ScopedElement& writeAttribute( StringRef name,
11383 T
const& attribute ) {
11384 m_writer->writeAttribute( name, attribute );
11389 XmlWriter* m_writer =
nullptr;
11390 XmlFormatting m_fmt;
11393 XmlWriter( std::ostream& os );
11396 XmlWriter( XmlWriter
const& ) =
delete;
11397 XmlWriter& operator=( XmlWriter
const& ) =
delete;
11399 XmlWriter& startElement( std::string
const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
11401 ScopedElement scopedElement( std::string
const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
11403 XmlWriter& endElement(XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
11406 XmlWriter& writeAttribute( StringRef name, StringRef attribute );
11409 XmlWriter& writeAttribute( StringRef name,
bool attribute );
11412 XmlWriter& writeAttribute( StringRef name,
char const* attribute );
11416 template <
typename T,
11421 typename =
typename std::enable_if_t<
11422 !std::is_convertible<T, StringRef>::value>>
11423 XmlWriter& writeAttribute( StringRef name, T
const& attribute ) {
11424 ReusableStringStream rss;
11426 return writeAttribute( name, rss.str() );
11430 XmlWriter& writeText( StringRef text,
11431 XmlFormatting fmt = XmlFormatting::Newline |
11432 XmlFormatting::Indent );
11435 XmlWriter& writeComment( StringRef text,
11436 XmlFormatting fmt = XmlFormatting::Newline |
11437 XmlFormatting::Indent );
11439 void writeStylesheetRef( StringRef url );
11441 void ensureTagClosed();
11445 void applyFormatting(XmlFormatting fmt);
11447 void writeDeclaration();
11449 void newlineIfNecessary();
11451 bool m_tagIsOpen =
false;
11452 bool m_needsNewline =
false;
11453 std::vector<std::string> m_tags;
11454 std::string m_indent;
11455 std::ostream& m_os;
11475#ifndef CATCH_MATCHERS_ALL_HPP_INCLUDED
11476#define CATCH_MATCHERS_ALL_HPP_INCLUDED
11480#ifndef CATCH_MATCHERS_HPP_INCLUDED
11481#define CATCH_MATCHERS_HPP_INCLUDED
11485#ifndef CATCH_MATCHERS_IMPL_HPP_INCLUDED
11486#define CATCH_MATCHERS_IMPL_HPP_INCLUDED
11494# pragma clang diagnostic push
11495# pragma clang diagnostic ignored "-Wsign-compare"
11496# pragma clang diagnostic ignored "-Wnon-virtual-dtor"
11497#elif defined __GNUC__
11498# pragma GCC diagnostic push
11499# pragma GCC diagnostic ignored "-Wsign-compare"
11500# pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
11503 template<
typename ArgT,
typename MatcherT>
11504 class MatchExpr :
public ITransientExpression {
11506 MatcherT
const& m_matcher;
11508 constexpr MatchExpr( ArgT && arg, MatcherT
const& matcher )
11509 : ITransientExpression{ true, matcher.match( arg ) },
11511 m_matcher( matcher )
11514 void streamReconstructedExpression( std::ostream& os )
const override {
11517 << m_matcher.toString();
11522# pragma clang diagnostic pop
11523#elif defined __GNUC__
11524# pragma GCC diagnostic pop
11528 namespace Matchers {
11529 template <
typename ArgT>
11533 using StringMatcher = Matchers::MatcherBase<std::string>;
11537 template<
typename ArgT,
typename MatcherT>
11538 constexpr MatchExpr<ArgT, MatcherT>
11539 makeMatchExpr( ArgT&& arg, MatcherT
const& matcher ) {
11540 return MatchExpr<ArgT, MatcherT>(
CATCH_FORWARD(arg), matcher );
11547#define INTERNAL_CHECK_THAT( macroName, matcher, resultDisposition, arg ) \
11549 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
11550 INTERNAL_CATCH_TRY { \
11551 catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher ) ); \
11552 } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
11553 catchAssertionHandler.complete(); \
11558#define INTERNAL_CATCH_THROWS_MATCHES( macroName, exceptionType, resultDisposition, matcher, ... ) \
11560 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
11561 if( catchAssertionHandler.allowThrows() ) \
11563 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
11564 CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
11565 static_cast<void>(__VA_ARGS__ ); \
11566 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
11567 catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
11569 catch( exceptionType const& ex ) { \
11570 catchAssertionHandler.handleExpr( Catch::makeMatchExpr( ex, matcher ) ); \
11573 catchAssertionHandler.handleUnexpectedInflightException(); \
11576 catchAssertionHandler.handleThrowingCallSkipped(); \
11577 catchAssertionHandler.complete(); \
11587namespace Matchers {
11589 class MatcherUntypedBase {
11591 MatcherUntypedBase() =
default;
11593 MatcherUntypedBase(MatcherUntypedBase
const&) =
default;
11594 MatcherUntypedBase(MatcherUntypedBase&&) =
default;
11596 MatcherUntypedBase& operator = (MatcherUntypedBase
const&) =
delete;
11597 MatcherUntypedBase& operator = (MatcherUntypedBase&&) =
delete;
11599 std::string toString()
const;
11602 virtual ~MatcherUntypedBase();
11603 virtual std::string describe()
const = 0;
11604 mutable std::string m_cachedToString;
11608 template<
typename T>
11609 class MatcherBase :
public MatcherUntypedBase {
11611 virtual bool match( T
const& arg )
const = 0;
11616 template<
typename ArgT>
11617 class MatchAllOf final :
public MatcherBase<ArgT> {
11618 std::vector<MatcherBase<ArgT>
const*> m_matchers;
11621 MatchAllOf() =
default;
11622 MatchAllOf(MatchAllOf
const&) =
delete;
11623 MatchAllOf& operator=(MatchAllOf
const&) =
delete;
11624 MatchAllOf(MatchAllOf&&) =
default;
11625 MatchAllOf& operator=(MatchAllOf&&) =
default;
11628 bool match( ArgT
const& arg )
const override {
11629 for(
auto matcher : m_matchers ) {
11630 if (!matcher->match(arg))
11635 std::string describe()
const override {
11636 std::string description;
11637 description.reserve( 4 + m_matchers.size()*32 );
11638 description +=
"( ";
11640 for(
auto matcher : m_matchers ) {
11644 description +=
" and ";
11645 description += matcher->toString();
11647 description +=
" )";
11648 return description;
11651 friend MatchAllOf operator&& (MatchAllOf&& lhs, MatcherBase<ArgT>
const& rhs) {
11652 lhs.m_matchers.push_back(&rhs);
11655 friend MatchAllOf operator&& (MatcherBase<ArgT>
const& lhs, MatchAllOf&& rhs) {
11656 rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs);
11663 template<
typename ArgT>
11664 MatchAllOf<ArgT> operator&& (MatchAllOf<ArgT>
const& lhs, MatcherBase<ArgT>
const& rhs) =
delete;
11667 template<
typename ArgT>
11668 MatchAllOf<ArgT> operator&& (MatcherBase<ArgT>
const& lhs, MatchAllOf<ArgT>
const& rhs) =
delete;
11670 template<
typename ArgT>
11671 class MatchAnyOf final :
public MatcherBase<ArgT> {
11672 std::vector<MatcherBase<ArgT>
const*> m_matchers;
11674 MatchAnyOf() =
default;
11675 MatchAnyOf(MatchAnyOf
const&) =
delete;
11676 MatchAnyOf& operator=(MatchAnyOf
const&) =
delete;
11677 MatchAnyOf(MatchAnyOf&&) =
default;
11678 MatchAnyOf& operator=(MatchAnyOf&&) =
default;
11680 bool match( ArgT
const& arg )
const override {
11681 for(
auto matcher : m_matchers ) {
11682 if (matcher->match(arg))
11687 std::string describe()
const override {
11688 std::string description;
11689 description.reserve( 4 + m_matchers.size()*32 );
11690 description +=
"( ";
11692 for(
auto matcher : m_matchers ) {
11696 description +=
" or ";
11697 description += matcher->toString();
11699 description +=
" )";
11700 return description;
11703 friend MatchAnyOf operator|| (MatchAnyOf&& lhs, MatcherBase<ArgT>
const& rhs) {
11704 lhs.m_matchers.push_back(&rhs);
11707 friend MatchAnyOf operator|| (MatcherBase<ArgT>
const& lhs, MatchAnyOf&& rhs) {
11708 rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs);
11715 template<
typename ArgT>
11716 MatchAnyOf<ArgT> operator|| (MatchAnyOf<ArgT>
const& lhs, MatcherBase<ArgT>
const& rhs) =
delete;
11719 template<
typename ArgT>
11720 MatchAnyOf<ArgT> operator|| (MatcherBase<ArgT>
const& lhs, MatchAnyOf<ArgT>
const& rhs) =
delete;
11722 template<
typename ArgT>
11723 class MatchNotOf final :
public MatcherBase<ArgT> {
11724 MatcherBase<ArgT>
const& m_underlyingMatcher;
11727 explicit MatchNotOf( MatcherBase<ArgT>
const& underlyingMatcher ):
11728 m_underlyingMatcher( underlyingMatcher )
11731 bool match( ArgT
const& arg )
const override {
11732 return !m_underlyingMatcher.match( arg );
11735 std::string describe()
const override {
11736 return "not " + m_underlyingMatcher.toString();
11742 template <
typename T>
11743 Detail::MatchAllOf<T> operator&& (MatcherBase<T>
const& lhs, MatcherBase<T>
const& rhs) {
11744 return Detail::MatchAllOf<T>{} && lhs && rhs;
11746 template <
typename T>
11747 Detail::MatchAnyOf<T> operator|| (MatcherBase<T>
const& lhs, MatcherBase<T>
const& rhs) {
11748 return Detail::MatchAnyOf<T>{} || lhs || rhs;
11751 template <
typename T>
11752 Detail::MatchNotOf<T> operator! (MatcherBase<T>
const& matcher) {
11753 return Detail::MatchNotOf<T>{ matcher };
11761#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
11762 #define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
11763 #define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
11765 #define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
11766 #define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
11768 #define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
11769 #define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
11771#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
11773 #define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
11774 #define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
11776 #define CATCH_CHECK_THROWS_WITH( expr, matcher ) (void)(0)
11777 #define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
11779 #define CATCH_CHECK_THAT( arg, matcher ) (void)(0)
11780 #define CATCH_REQUIRE_THAT( arg, matcher ) (void)(0)
11782#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
11784 #define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
11785 #define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
11787 #define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
11788 #define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
11790 #define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
11791 #define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
11793#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
11795 #define REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
11796 #define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
11798 #define CHECK_THROWS_WITH( expr, matcher ) (void)(0)
11799 #define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
11801 #define CHECK_THAT( arg, matcher ) (void)(0)
11802 #define REQUIRE_THAT( arg, matcher ) (void)(0)
11809#ifndef CATCH_MATCHERS_CONTAINER_PROPERTIES_HPP_INCLUDED
11810#define CATCH_MATCHERS_CONTAINER_PROPERTIES_HPP_INCLUDED
11814#ifndef CATCH_MATCHERS_TEMPLATED_HPP_INCLUDED
11815#define CATCH_MATCHERS_TEMPLATED_HPP_INCLUDED
11819#include <algorithm>
11821#include <type_traits>
11824namespace Matchers {
11825 class MatcherGenericBase :
public MatcherUntypedBase {
11827 MatcherGenericBase() =
default;
11828 ~MatcherGenericBase()
override;
11830 MatcherGenericBase(MatcherGenericBase
const&) =
default;
11831 MatcherGenericBase(MatcherGenericBase&&) =
default;
11833 MatcherGenericBase& operator=(MatcherGenericBase
const&) =
delete;
11834 MatcherGenericBase& operator=(MatcherGenericBase&&) =
delete;
11839 template<std::
size_t N, std::
size_t M>
11840 std::array<void const*, N + M> array_cat(std::array<void const*, N> && lhs, std::array<void const*, M> && rhs) {
11841 std::array<void const*, N + M> arr{};
11842 std::copy_n(lhs.begin(), N, arr.begin());
11843 std::copy_n(rhs.begin(), M, arr.begin() + N);
11847 template<std::
size_t N>
11848 std::array<void const*, N+1> array_cat(std::array<void const*, N> && lhs,
void const* rhs) {
11849 std::array<void const*, N+1> arr{};
11850 std::copy_n(lhs.begin(), N, arr.begin());
11855 template<std::
size_t N>
11856 std::array<void const*, N+1> array_cat(
void const* lhs, std::array<void const*, N> && rhs) {
11857 std::array<void const*, N + 1> arr{ {lhs} };
11858 std::copy_n(rhs.begin(), N, arr.begin() + 1);
11862 template<
typename T>
11863 using is_generic_matcher = std::is_base_of<
11864 Catch::Matchers::MatcherGenericBase,
11865 std::remove_cv_t<std::remove_reference_t<T>>
11868 template<
typename... Ts>
11869 using are_generic_matchers = Catch::Detail::conjunction<is_generic_matcher<Ts>...>;
11871 template<
typename T>
11872 using is_matcher = std::is_base_of<
11873 Catch::Matchers::MatcherUntypedBase,
11874 std::remove_cv_t<std::remove_reference_t<T>>
11878 template<std::
size_t N,
typename Arg>
11879 bool match_all_of(Arg&&, std::array<void const*, N>
const&, std::index_sequence<>) {
11883 template<
typename T,
typename... MatcherTs, std::size_t N,
typename Arg, std::size_t Idx, std::size_t... Indices>
11884 bool match_all_of(Arg&& arg, std::array<void const*, N>
const& matchers, std::index_sequence<Idx, Indices...>) {
11885 return static_cast<T const*
>(matchers[Idx])->match(arg) && match_all_of<MatcherTs...>(arg, matchers, std::index_sequence<Indices...>{});
11889 template<std::
size_t N,
typename Arg>
11890 bool match_any_of(Arg&&, std::array<void const*, N>
const&, std::index_sequence<>) {
11894 template<
typename T,
typename... MatcherTs, std::size_t N,
typename Arg, std::size_t Idx, std::size_t... Indices>
11895 bool match_any_of(Arg&& arg, std::array<void const*, N>
const& matchers, std::index_sequence<Idx, Indices...>) {
11896 return static_cast<T const*
>(matchers[Idx])->match(arg) || match_any_of<MatcherTs...>(arg, matchers, std::index_sequence<Indices...>{});
11899 std::string
describe_multi_matcher(StringRef combine, std::string
const* descriptions_begin, std::string
const* descriptions_end);
11901 template<
typename... MatcherTs, std::size_t... Idx>
11902 std::string
describe_multi_matcher(StringRef combine, std::array<
void const*,
sizeof...(MatcherTs)>
const& matchers, std::index_sequence<Idx...>) {
11903 std::array<std::string,
sizeof...(MatcherTs)> descriptions {{
11904 static_cast<MatcherTs const*
>(matchers[Idx])->toString()...
11911 template<
typename... MatcherTs>
11912 class MatchAllOfGeneric final :
public MatcherGenericBase {
11914 MatchAllOfGeneric(MatchAllOfGeneric
const&) =
delete;
11915 MatchAllOfGeneric& operator=(MatchAllOfGeneric
const&) =
delete;
11916 MatchAllOfGeneric(MatchAllOfGeneric&&) =
default;
11917 MatchAllOfGeneric& operator=(MatchAllOfGeneric&&) =
default;
11919 MatchAllOfGeneric(MatcherTs
const&... matchers) : m_matchers{ {std::addressof(matchers)...} } {}
11920 explicit MatchAllOfGeneric(std::array<
void const*,
sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
11922 template<
typename Arg>
11923 bool match(Arg&& arg)
const {
11924 return match_all_of<MatcherTs...>(arg, m_matchers, std::index_sequence_for<MatcherTs...>{});
11927 std::string describe()
const override {
11928 return describe_multi_matcher<MatcherTs...>(
" and "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{});
11934 std::array<
void const*,
sizeof...( MatcherTs )> m_matchers;
11938 template<
typename... MatchersRHS>
11940 MatchAllOfGeneric<MatcherTs..., MatchersRHS...> operator && (
11941 MatchAllOfGeneric<MatcherTs...>&& lhs,
11942 MatchAllOfGeneric<MatchersRHS...>&& rhs) {
11943 return MatchAllOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(
CATCH_MOVE(lhs.m_matchers),
CATCH_MOVE(rhs.m_matchers))};
11947 template<
typename MatcherRHS>
11948 friend std::enable_if_t<is_matcher<MatcherRHS>::value,
11949 MatchAllOfGeneric<MatcherTs..., MatcherRHS>> operator && (
11950 MatchAllOfGeneric<MatcherTs...>&& lhs,
11951 MatcherRHS
const& rhs) {
11952 return MatchAllOfGeneric<MatcherTs..., MatcherRHS>{array_cat(
CATCH_MOVE(lhs.m_matchers),
static_cast<void const*
>(&rhs))};
11956 template<
typename MatcherLHS>
11957 friend std::enable_if_t<is_matcher<MatcherLHS>::value,
11958 MatchAllOfGeneric<MatcherLHS, MatcherTs...>> operator && (
11959 MatcherLHS
const& lhs,
11960 MatchAllOfGeneric<MatcherTs...>&& rhs) {
11961 return MatchAllOfGeneric<MatcherLHS, MatcherTs...>{array_cat(
static_cast<void const*
>(std::addressof(lhs)),
CATCH_MOVE(rhs.m_matchers))};
11966 template<
typename... MatcherTs>
11967 class MatchAnyOfGeneric final :
public MatcherGenericBase {
11969 MatchAnyOfGeneric(MatchAnyOfGeneric
const&) =
delete;
11970 MatchAnyOfGeneric& operator=(MatchAnyOfGeneric
const&) =
delete;
11971 MatchAnyOfGeneric(MatchAnyOfGeneric&&) =
default;
11972 MatchAnyOfGeneric& operator=(MatchAnyOfGeneric&&) =
default;
11974 MatchAnyOfGeneric(MatcherTs
const&... matchers) : m_matchers{ {std::addressof(matchers)...} } {}
11975 explicit MatchAnyOfGeneric(std::array<
void const*,
sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
11977 template<
typename Arg>
11978 bool match(Arg&& arg)
const {
11979 return match_any_of<MatcherTs...>(arg, m_matchers, std::index_sequence_for<MatcherTs...>{});
11982 std::string describe()
const override {
11983 return describe_multi_matcher<MatcherTs...>(
" or "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{});
11990 std::array<
void const*,
sizeof...( MatcherTs )> m_matchers;
11993 template<
typename... MatchersRHS>
11994 friend MatchAnyOfGeneric<MatcherTs..., MatchersRHS...> operator || (
11995 MatchAnyOfGeneric<MatcherTs...>&& lhs,
11996 MatchAnyOfGeneric<MatchersRHS...>&& rhs) {
11997 return MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(
CATCH_MOVE(lhs.m_matchers),
CATCH_MOVE(rhs.m_matchers))};
12001 template<
typename MatcherRHS>
12002 friend std::enable_if_t<is_matcher<MatcherRHS>::value,
12003 MatchAnyOfGeneric<MatcherTs..., MatcherRHS>> operator || (
12004 MatchAnyOfGeneric<MatcherTs...>&& lhs,
12005 MatcherRHS
const& rhs) {
12006 return MatchAnyOfGeneric<MatcherTs..., MatcherRHS>{array_cat(
CATCH_MOVE(lhs.m_matchers),
static_cast<void const*
>(std::addressof(rhs)))};
12010 template<
typename MatcherLHS>
12011 friend std::enable_if_t<is_matcher<MatcherLHS>::value,
12012 MatchAnyOfGeneric<MatcherLHS, MatcherTs...>> operator || (
12013 MatcherLHS
const& lhs,
12014 MatchAnyOfGeneric<MatcherTs...>&& rhs) {
12015 return MatchAnyOfGeneric<MatcherLHS, MatcherTs...>{array_cat(
static_cast<void const*
>(std::addressof(lhs)),
CATCH_MOVE(rhs.m_matchers))};
12020 template<
typename MatcherT>
12021 class MatchNotOfGeneric final :
public MatcherGenericBase {
12022 MatcherT
const& m_matcher;
12025 MatchNotOfGeneric(MatchNotOfGeneric
const&) =
delete;
12026 MatchNotOfGeneric& operator=(MatchNotOfGeneric
const&) =
delete;
12027 MatchNotOfGeneric(MatchNotOfGeneric&&) =
default;
12028 MatchNotOfGeneric& operator=(MatchNotOfGeneric&&) =
default;
12030 explicit MatchNotOfGeneric(MatcherT
const& matcher) : m_matcher{matcher} {}
12032 template<
typename Arg>
12033 bool match(Arg&& arg)
const {
12034 return !m_matcher.match(arg);
12037 std::string describe()
const override {
12038 return "not " + m_matcher.toString();
12042 friend MatcherT
const& operator ! (MatchNotOfGeneric<MatcherT>
const& matcher) {
12043 return matcher.m_matcher;
12050 template<
typename MatcherLHS,
typename MatcherRHS>
12051 std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherRHS>>
12052 operator && (MatcherLHS
const& lhs, MatcherRHS
const& rhs) {
12053 return { lhs, rhs };
12056 template<
typename MatcherLHS,
typename MatcherRHS>
12057 std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherRHS>>
12058 operator || (MatcherLHS
const& lhs, MatcherRHS
const& rhs) {
12059 return { lhs, rhs };
12063 template<
typename MatcherT>
12064 std::enable_if_t<Detail::is_generic_matcher<MatcherT>::value, Detail::MatchNotOfGeneric<MatcherT>>
12065 operator ! (MatcherT
const& matcher) {
12066 return Detail::MatchNotOfGeneric<MatcherT>{matcher};
12071 template<
typename MatcherLHS,
typename ArgRHS>
12072 std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
12073 operator && (MatcherLHS
const& lhs, MatcherBase<ArgRHS>
const& rhs) {
12074 return { lhs, rhs };
12077 template<
typename ArgLHS,
typename MatcherRHS>
12078 std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
12079 operator && (MatcherBase<ArgLHS>
const& lhs, MatcherRHS
const& rhs) {
12080 return { lhs, rhs };
12083 template<
typename MatcherLHS,
typename ArgRHS>
12084 std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
12085 operator || (MatcherLHS
const& lhs, MatcherBase<ArgRHS>
const& rhs) {
12086 return { lhs, rhs };
12089 template<
typename ArgLHS,
typename MatcherRHS>
12090 std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
12091 operator || (MatcherBase<ArgLHS>
const& lhs, MatcherRHS
const& rhs) {
12092 return { lhs, rhs };
12101 namespace Matchers {
12103 class IsEmptyMatcher final :
public MatcherGenericBase {
12105 template <
typename RangeLike>
12106 bool match(RangeLike&& rng)
const {
12107#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
12108 using Catch::Detail::empty;
12115 std::string describe()
const override;
12118 class HasSizeMatcher final :
public MatcherGenericBase {
12119 std::size_t m_target_size;
12121 explicit HasSizeMatcher(std::size_t target_size):
12122 m_target_size(target_size)
12125 template <
typename RangeLike>
12126 bool match(RangeLike&& rng)
const {
12127#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
12128 using Catch::Detail::size;
12132 return size(rng) == m_target_size;
12135 std::string describe()
const override;
12138 template <
typename Matcher>
12139 class SizeMatchesMatcher final :
public MatcherGenericBase {
12142 explicit SizeMatchesMatcher(Matcher m):
12146 template <
typename RangeLike>
12147 bool match(RangeLike&& rng)
const {
12148#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
12149 using Catch::Detail::size;
12153 return m_matcher.match(size(rng));
12156 std::string describe()
const override {
12157 return "size matches " + m_matcher.describe();
12165 HasSizeMatcher
SizeIs(std::size_t sz);
12166 template <
typename Matcher>
12167 std::enable_if_t<Detail::is_matcher<Matcher>::value,
12168 SizeMatchesMatcher<Matcher>>
SizeIs(Matcher&& m) {
12178#ifndef CATCH_MATCHERS_CONTAINS_HPP_INCLUDED
12179#define CATCH_MATCHERS_CONTAINS_HPP_INCLUDED
12182#include <algorithm>
12183#include <functional>
12186 namespace Matchers {
12188 template <
typename T,
typename Equality>
12189 class ContainsElementMatcher final :
public MatcherGenericBase {
12193 template <
typename T2,
typename Equality2>
12194 ContainsElementMatcher(T2&& target, Equality2&& predicate):
12199 std::string describe()
const override {
12203 template <
typename RangeLike>
12204 bool match( RangeLike&& rng )
const {
12205 for (
auto&& elem : rng ) {
12206 if ( m_eq( elem, m_desired ) ) {
return true; }
12213 template <
typename Matcher>
12214 class ContainsMatcherMatcher final :
public MatcherGenericBase {
12220 ContainsMatcherMatcher(Matcher matcher):
12224 template <
typename RangeLike>
12225 bool match(RangeLike&& rng)
const {
12226 for (
auto&& elem : rng) {
12227 if (m_matcher.match(elem)) {
12234 std::string describe()
const override {
12235 return "contains element matching " + m_matcher.describe();
12244 template <
typename T>
12245 std::enable_if_t<!Detail::is_matcher<T>::value,
12246 ContainsElementMatcher<T, std::equal_to<>>> Contains(T&& elem) {
12251 template <
typename Matcher>
12252 std::enable_if_t<Detail::is_matcher<Matcher>::value,
12253 ContainsMatcherMatcher<Matcher>> Contains(Matcher&& matcher) {
12262 template <
typename T,
typename Equality>
12263 ContainsElementMatcher<T, Equality> Contains(T&& elem, Equality&& eq) {
12273#ifndef CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
12274#define CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
12278namespace Matchers {
12280class ExceptionMessageMatcher final :
public MatcherBase<std::exception> {
12281 std::string m_message;
12284 ExceptionMessageMatcher(std::string
const& message):
12288 bool match(std::exception
const& ex)
const override;
12290 std::string describe()
const override;
12294ExceptionMessageMatcher
Message(std::string
const& message);
12296template <
typename StringMatcherType>
12297class ExceptionMessageMatchesMatcher final
12298 :
public MatcherBase<std::exception> {
12299 StringMatcherType m_matcher;
12302 ExceptionMessageMatchesMatcher( StringMatcherType matcher ):
12305 bool match( std::exception
const& ex )
const override {
12306 return m_matcher.match( ex.what() );
12309 std::string describe()
const override {
12310 return " matches \"" + m_matcher.describe() +
'"';
12316template <
typename StringMatcherType>
12317ExceptionMessageMatchesMatcher<StringMatcherType>
12318MessageMatches( StringMatcherType&& matcher ) {
12328#ifndef CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED
12329#define CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED
12333namespace Matchers {
12339 class WithinAbsMatcher final :
public MatcherBase<double> {
12341 WithinAbsMatcher(
double target,
double margin);
12342 bool match(
double const& matchee)
const override;
12343 std::string describe()
const override;
12350 WithinAbsMatcher
WithinAbs(
double target,
double margin );
12354 class WithinUlpsMatcher final :
public MatcherBase<double> {
12356 WithinUlpsMatcher(
double target,
12358 Detail::FloatingPointKind baseType );
12359 bool match(
double const& matchee)
const override;
12360 std::string describe()
const override;
12364 Detail::FloatingPointKind m_type;
12368 WithinUlpsMatcher
WithinULP(
double target, uint64_t maxUlpDiff);
12370 WithinUlpsMatcher
WithinULP(
float target, uint64_t maxUlpDiff);
12380 class WithinRelMatcher final :
public MatcherBase<double> {
12382 WithinRelMatcher(
double target,
double epsilon );
12383 bool match(
double const& matchee)
const override;
12384 std::string describe()
const override;
12391 WithinRelMatcher
WithinRel(
double target,
double eps);
12393 WithinRelMatcher
WithinRel(
double target);
12395 WithinRelMatcher
WithinRel(
float target,
float eps);
12397 WithinRelMatcher
WithinRel(
float target);
12401 class IsNaNMatcher final :
public MatcherBase<double> {
12403 IsNaNMatcher() =
default;
12404 bool match(
double const& matchee )
const override;
12405 std::string describe()
const override;
12408 IsNaNMatcher
IsNaN();
12416#ifndef CATCH_MATCHERS_PREDICATE_HPP_INCLUDED
12417#define CATCH_MATCHERS_PREDICATE_HPP_INCLUDED
12423namespace Matchers {
12426 std::string finalizeDescription(
const std::string& desc);
12429template <
typename T,
typename Predicate>
12430class PredicateMatcher final :
public MatcherBase<T> {
12431 Predicate m_predicate;
12432 std::string m_description;
12435 PredicateMatcher(Predicate&& elem, std::string
const& descr)
12437 m_description(Detail::finalizeDescription(descr))
12440 bool match( T
const& item )
const override {
12441 return m_predicate(item);
12444 std::string describe()
const override {
12445 return m_description;
12454 template<
typename T,
typename Pred>
12455 PredicateMatcher<T, Pred> Predicate(Pred&& predicate, std::string
const& description =
"") {
12456 static_assert(is_callable<Pred(T)>::value,
"Predicate not callable with argument T");
12457 static_assert(std::is_same<bool, FunctionReturnType<Pred, T>>::value,
"Predicate does not return bool");
12458 return PredicateMatcher<T, Pred>(
CATCH_FORWARD(predicate), description);
12467#ifndef CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED
12468#define CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED
12472 namespace Matchers {
12474 template <
typename Matcher>
12475 class AllMatchMatcher final :
public MatcherGenericBase {
12478 AllMatchMatcher(Matcher matcher):
12482 std::string describe()
const override {
12483 return "all match " + m_matcher.describe();
12486 template <
typename RangeLike>
12487 bool match(RangeLike&& rng)
const {
12488 for (
auto&& elem : rng) {
12489 if (!m_matcher.match(elem)) {
12498 template <
typename Matcher>
12499 class NoneMatchMatcher final :
public MatcherGenericBase {
12502 NoneMatchMatcher(Matcher matcher):
12506 std::string describe()
const override {
12507 return "none match " + m_matcher.describe();
12510 template <
typename RangeLike>
12511 bool match(RangeLike&& rng)
const {
12512 for (
auto&& elem : rng) {
12513 if (m_matcher.match(elem)) {
12522 template <
typename Matcher>
12523 class AnyMatchMatcher final :
public MatcherGenericBase {
12526 AnyMatchMatcher(Matcher matcher):
12530 std::string describe()
const override {
12531 return "any match " + m_matcher.describe();
12534 template <
typename RangeLike>
12535 bool match(RangeLike&& rng)
const {
12536 for (
auto&& elem : rng) {
12537 if (m_matcher.match(elem)) {
12546 class AllTrueMatcher final :
public MatcherGenericBase {
12548 std::string describe()
const override;
12550 template <
typename RangeLike>
12551 bool match(RangeLike&& rng)
const {
12552 for (
auto&& elem : rng) {
12562 class NoneTrueMatcher final :
public MatcherGenericBase {
12564 std::string describe()
const override;
12566 template <
typename RangeLike>
12567 bool match(RangeLike&& rng)
const {
12568 for (
auto&& elem : rng) {
12578 class AnyTrueMatcher final :
public MatcherGenericBase {
12580 std::string describe()
const override;
12582 template <
typename RangeLike>
12583 bool match(RangeLike&& rng)
const {
12584 for (
auto&& elem : rng) {
12594 template <
typename Matcher>
12595 AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) {
12600 template <
typename Matcher>
12601 NoneMatchMatcher<Matcher> NoneMatch(Matcher&& matcher) {
12606 template <
typename Matcher>
12607 AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) {
12625#ifndef CATCH_MATCHERS_RANGE_EQUALS_HPP_INCLUDED
12626#define CATCH_MATCHERS_RANGE_EQUALS_HPP_INCLUDED
12629#include <algorithm>
12633 namespace Matchers {
12639 template <
typename TargetRangeLike,
typename Equality>
12640 class RangeEqualsMatcher final :
public MatcherGenericBase {
12641 TargetRangeLike m_desired;
12642 Equality m_predicate;
12645 template <
typename TargetRangeLike2,
typename Equality2>
12647 RangeEqualsMatcher( TargetRangeLike2&& range,
12648 Equality2&& predicate ):
12652 template <
typename RangeLike>
12654 bool match( RangeLike&& rng )
const {
12655 auto rng_start = begin( rng );
12656 const auto rng_end = end( rng );
12657 auto target_start = begin( m_desired );
12658 const auto target_end = end( m_desired );
12660 while (rng_start != rng_end && target_start != target_end) {
12661 if (!m_predicate(*rng_start, *target_start)) {
12667 return rng_start == rng_end && target_start == target_end;
12670 std::string describe()
const override {
12679 template <
typename TargetRangeLike,
typename Equality>
12680 class UnorderedRangeEqualsMatcher final :
public MatcherGenericBase {
12681 TargetRangeLike m_desired;
12682 Equality m_predicate;
12685 template <
typename TargetRangeLike2,
typename Equality2>
12687 UnorderedRangeEqualsMatcher( TargetRangeLike2&& range,
12688 Equality2&& predicate ):
12692 template <
typename RangeLike>
12694 bool match( RangeLike&& rng )
const {
12697 return Catch::Detail::is_permutation( begin( m_desired ),
12704 std::string describe()
const override {
12705 return "unordered elements are " +
12717 template <
typename RangeLike,
12718 typename Equality =
decltype( std::equal_to<>{} )>
12720 RangeEqualsMatcher<RangeLike, Equality>
12721 RangeEquals( RangeLike&& range,
12722 Equality&& predicate = std::equal_to<>{} ) {
12733 template <
typename T,
12734 typename Equality =
decltype( std::equal_to<>{} )>
12736 RangeEqualsMatcher<std::initializer_list<T>, Equality>
12737 RangeEquals( std::initializer_list<T> range,
12738 Equality&& predicate = std::equal_to<>{} ) {
12749 template <
typename RangeLike,
12750 typename Equality =
decltype( std::equal_to<>{} )>
12752 UnorderedRangeEqualsMatcher<RangeLike, Equality>
12753 UnorderedRangeEquals( RangeLike&& range,
12754 Equality&& predicate = std::equal_to<>{} ) {
12765 template <
typename T,
12766 typename Equality =
decltype( std::equal_to<>{} )>
12768 UnorderedRangeEqualsMatcher<std::initializer_list<T>, Equality>
12769 UnorderedRangeEquals( std::initializer_list<T> range,
12770 Equality&& predicate = std::equal_to<>{} ) {
12779#ifndef CATCH_MATCHERS_STRING_HPP_INCLUDED
12780#define CATCH_MATCHERS_STRING_HPP_INCLUDED
12786namespace Matchers {
12788 struct CasedString {
12789 CasedString( std::string
const& str, CaseSensitive caseSensitivity );
12790 std::string adjustString( std::string
const& str )
const;
12791 StringRef caseSensitivitySuffix()
const;
12797 class StringMatcherBase :
public MatcherBase<std::string> {
12799 CasedString m_comparator;
12800 StringRef m_operation;
12803 StringMatcherBase( StringRef operation,
12804 CasedString
const& comparator );
12805 std::string describe()
const override;
12808 class StringEqualsMatcher final :
public StringMatcherBase {
12810 StringEqualsMatcher( CasedString
const& comparator );
12811 bool match( std::string
const& source )
const override;
12813 class StringContainsMatcher final :
public StringMatcherBase {
12815 StringContainsMatcher( CasedString
const& comparator );
12816 bool match( std::string
const& source )
const override;
12818 class StartsWithMatcher final :
public StringMatcherBase {
12820 StartsWithMatcher( CasedString
const& comparator );
12821 bool match( std::string
const& source )
const override;
12823 class EndsWithMatcher final :
public StringMatcherBase {
12825 EndsWithMatcher( CasedString
const& comparator );
12826 bool match( std::string
const& source )
const override;
12829 class RegexMatcher final :
public MatcherBase<std::string> {
12830 std::string m_regex;
12834 RegexMatcher( std::string regex, CaseSensitive caseSensitivity );
12835 bool match( std::string
const& matchee )
const override;
12836 std::string describe()
const override;
12840 StringEqualsMatcher
Equals( std::string
const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
12842 StringContainsMatcher
ContainsSubstring( std::string
const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
12844 EndsWithMatcher
EndsWith( std::string
const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
12846 StartsWithMatcher
StartsWith( std::string
const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
12848 RegexMatcher
Matches( std::string
const& regex, CaseSensitive caseSensitivity = CaseSensitive::Yes );
12856#ifndef CATCH_MATCHERS_VECTOR_HPP_INCLUDED
12857#define CATCH_MATCHERS_VECTOR_HPP_INCLUDED
12860#include <algorithm>
12863namespace Matchers {
12865 template<
typename T,
typename Alloc>
12866 class VectorContainsElementMatcher final :
public MatcherBase<std::vector<T, Alloc>> {
12867 T
const& m_comparator;
12870 VectorContainsElementMatcher(T
const& comparator):
12871 m_comparator(comparator)
12874 bool match(std::vector<T, Alloc>
const& v)
const override {
12875 for (
auto const& el : v) {
12876 if (el == m_comparator) {
12883 std::string describe()
const override {
12888 template<
typename T,
typename AllocComp,
typename AllocMatch>
12889 class ContainsMatcher final :
public MatcherBase<std::vector<T, AllocMatch>> {
12890 std::vector<T, AllocComp>
const& m_comparator;
12893 ContainsMatcher(std::vector<T, AllocComp>
const& comparator):
12894 m_comparator( comparator )
12897 bool match(std::vector<T, AllocMatch>
const& v)
const override {
12899 if (m_comparator.size() > v.size())
12901 for (
auto const& comparator : m_comparator) {
12902 auto present =
false;
12903 for (
const auto& el : v) {
12904 if (el == comparator) {
12915 std::string describe()
const override {
12920 template<
typename T,
typename AllocComp,
typename AllocMatch>
12921 class EqualsMatcher final :
public MatcherBase<std::vector<T, AllocMatch>> {
12922 std::vector<T, AllocComp>
const& m_comparator;
12925 EqualsMatcher(std::vector<T, AllocComp>
const& comparator):
12926 m_comparator( comparator )
12929 bool match(std::vector<T, AllocMatch>
const& v)
const override {
12934 if ( m_comparator.size() != v.size() ) {
return false; }
12935 for ( std::size_t i = 0; i < v.size(); ++i ) {
12936 if ( !( m_comparator[i] == v[i] ) ) {
return false; }
12940 std::string describe()
const override {
12945 template<
typename T,
typename AllocComp,
typename AllocMatch>
12946 class ApproxMatcher final :
public MatcherBase<std::vector<T, AllocMatch>> {
12947 std::vector<T, AllocComp>
const& m_comparator;
12951 ApproxMatcher(std::vector<T, AllocComp>
const& comparator):
12952 m_comparator( comparator )
12955 bool match(std::vector<T, AllocMatch>
const& v)
const override {
12956 if (m_comparator.size() != v.size())
12958 for (std::size_t i = 0; i < v.size(); ++i)
12959 if (m_comparator[i] != approx(v[i]))
12963 std::string describe()
const override {
12966 template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
12967 ApproxMatcher& epsilon( T
const& newEpsilon ) {
12968 approx.
epsilon(
static_cast<double>(newEpsilon));
12971 template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
12972 ApproxMatcher& margin( T
const& newMargin ) {
12973 approx.
margin(
static_cast<double>(newMargin));
12976 template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
12977 ApproxMatcher& scale( T
const& newScale ) {
12978 approx.
scale(
static_cast<double>(newScale));
12983 template<
typename T,
typename AllocComp,
typename AllocMatch>
12984 class UnorderedEqualsMatcher final :
public MatcherBase<std::vector<T, AllocMatch>> {
12985 std::vector<T, AllocComp>
const& m_target;
12988 UnorderedEqualsMatcher(std::vector<T, AllocComp>
const& target):
12991 bool match(std::vector<T, AllocMatch>
const& vec)
const override {
12992 if (m_target.size() != vec.size()) {
12995 return std::is_permutation(m_target.begin(), m_target.end(), vec.begin());
12998 std::string describe()
const override {
13008 template<
typename T,
typename AllocComp = std::allocator<T>,
typename AllocMatch = AllocComp>
13009 ContainsMatcher<T, AllocComp, AllocMatch> Contains( std::vector<T, AllocComp>
const& comparator ) {
13010 return ContainsMatcher<T, AllocComp, AllocMatch>(comparator);
13014 template<
typename T,
typename Alloc = std::allocator<T>>
13015 VectorContainsElementMatcher<T, Alloc> VectorContains( T
const& comparator ) {
13016 return VectorContainsElementMatcher<T, Alloc>(comparator);
13020 template<
typename T,
typename AllocComp = std::allocator<T>,
typename AllocMatch = AllocComp>
13021 EqualsMatcher<T, AllocComp, AllocMatch>
Equals( std::vector<T, AllocComp>
const& comparator ) {
13022 return EqualsMatcher<T, AllocComp, AllocMatch>(comparator);
13026 template<
typename T,
typename AllocComp = std::allocator<T>,
typename AllocMatch = AllocComp>
13027 ApproxMatcher<T, AllocComp, AllocMatch> Approx( std::vector<T, AllocComp>
const& comparator ) {
13028 return ApproxMatcher<T, AllocComp, AllocMatch>(comparator);
13032 template<
typename T,
typename AllocComp = std::allocator<T>,
typename AllocMatch = AllocComp>
13033 UnorderedEqualsMatcher<T, AllocComp, AllocMatch> UnorderedEquals(std::vector<T, AllocComp>
const& target) {
13034 return UnorderedEqualsMatcher<T, AllocComp, AllocMatch>(target);
13058#ifndef CATCH_REPORTERS_ALL_HPP_INCLUDED
13059#define CATCH_REPORTERS_ALL_HPP_INCLUDED
13063#ifndef CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
13064#define CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
13068#ifndef CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
13069#define CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
13073#ifndef CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED
13074#define CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED
13093 class ReporterBase :
public IEventListener {
13096 Detail::unique_ptr<IStream> m_wrapped_stream;
13099 std::ostream& m_stream;
13101 Detail::unique_ptr<ColourImpl> m_colour;
13103 std::map<std::string, std::string> m_customOptions;
13106 ReporterBase( ReporterConfig&& config );
13107 ~ReporterBase()
override;
13115 void listReporters(
13116 std::vector<ReporterDescription>
const& descriptions )
override;
13123 void listListeners(
13124 std::vector<ListenerDescription>
const& descriptions )
override;
13132 void listTests( std::vector<TestCaseHandle>
const& tests )
override;
13139 void listTags( std::vector<TagInfo>
const& tags )
override;
13149 class StreamingReporterBase :
public ReporterBase {
13153 StreamingReporterBase(ReporterConfig&& _config):
13156 ~StreamingReporterBase()
override;
13158 void benchmarkPreparing( StringRef )
override {}
13159 void benchmarkStarting( BenchmarkInfo
const& )
override {}
13160 void benchmarkEnded( BenchmarkStats<>
const& )
override {}
13161 void benchmarkFailed( StringRef )
override {}
13163 void fatalErrorEncountered( StringRef )
override {}
13164 void noMatchingTestCases( StringRef )
override {}
13165 void reportInvalidTestSpec( StringRef )
override {}
13167 void testRunStarting( TestRunInfo
const& _testRunInfo )
override;
13169 void testCaseStarting(TestCaseInfo
const& _testInfo)
override {
13170 currentTestCaseInfo = &_testInfo;
13172 void testCasePartialStarting( TestCaseInfo
const&, uint64_t )
override {}
13173 void sectionStarting(SectionInfo
const& _sectionInfo)
override {
13174 m_sectionStack.push_back(_sectionInfo);
13177 void assertionStarting( AssertionInfo
const& )
override {}
13178 void assertionEnded( AssertionStats
const& )
override {}
13180 void sectionEnded(SectionStats
const& )
override {
13181 m_sectionStack.pop_back();
13183 void testCasePartialEnded( TestCaseStats
const&, uint64_t )
override {}
13184 void testCaseEnded(TestCaseStats
const& )
override {
13185 currentTestCaseInfo =
nullptr;
13187 void testRunEnded( TestRunStats
const& )
override;
13189 void skipTest(TestCaseInfo
const&)
override {
13195 TestRunInfo currentTestRunInfo{
"test run has not started yet"_sr };
13196 TestCaseInfo
const* currentTestCaseInfo =
nullptr;
13199 std::vector<SectionInfo> m_sectionStack;
13210 class AutomakeReporter final :
public StreamingReporterBase {
13214 AutomakeReporter(ReporterConfig&& _config):
13217 ~AutomakeReporter()
override;
13219 static std::string getDescription() {
13220 using namespace std::string_literals;
13221 return "Reports test results in the format of Automake .trs files"s;
13224 void testCaseEnded(TestCaseStats
const& _testCaseStats)
override;
13225 void skipTest(TestCaseInfo
const& testInfo)
override;
13233#ifndef CATCH_REPORTER_COMPACT_HPP_INCLUDED
13234#define CATCH_REPORTER_COMPACT_HPP_INCLUDED
13241 class CompactReporter final :
public StreamingReporterBase {
13243 using StreamingReporterBase::StreamingReporterBase;
13245 ~CompactReporter()
override;
13247 static std::string getDescription();
13249 void noMatchingTestCases( StringRef unmatchedSpec )
override;
13251 void testRunStarting( TestRunInfo
const& _testInfo )
override;
13253 void assertionEnded(AssertionStats
const& _assertionStats)
override;
13255 void sectionEnded(SectionStats
const& _sectionStats)
override;
13257 void testRunEnded(TestRunStats
const& _testRunStats)
override;
13266#ifndef CATCH_REPORTER_CONSOLE_HPP_INCLUDED
13267#define CATCH_REPORTER_CONSOLE_HPP_INCLUDED
13272 class TablePrinter;
13274 class ConsoleReporter final :
public StreamingReporterBase {
13275 Detail::unique_ptr<TablePrinter> m_tablePrinter;
13278 ConsoleReporter(ReporterConfig&& config);
13279 ~ConsoleReporter()
override;
13280 static std::string getDescription();
13282 void noMatchingTestCases( StringRef unmatchedSpec )
override;
13283 void reportInvalidTestSpec( StringRef arg )
override;
13285 void assertionStarting(AssertionInfo
const&)
override;
13287 void assertionEnded(AssertionStats
const& _assertionStats)
override;
13289 void sectionStarting(SectionInfo
const& _sectionInfo)
override;
13290 void sectionEnded(SectionStats
const& _sectionStats)
override;
13292 void benchmarkPreparing( StringRef name )
override;
13293 void benchmarkStarting(BenchmarkInfo
const& info)
override;
13294 void benchmarkEnded(BenchmarkStats<>
const& stats)
override;
13295 void benchmarkFailed( StringRef error )
override;
13297 void testCaseEnded(TestCaseStats
const& _testCaseStats)
override;
13298 void testRunEnded(TestRunStats
const& _testRunStats)
override;
13299 void testRunStarting(TestRunInfo
const& _testRunInfo)
override;
13304 void lazyPrintWithoutClosingBenchmarkTable();
13305 void lazyPrintRunInfo();
13306 void printTestCaseAndSectionHeader();
13308 void printClosedHeader(std::string
const& _name);
13309 void printOpenHeader(std::string
const& _name);
13313 void printHeaderString(std::string
const& _string, std::size_t indent = 0);
13315 void printTotalsDivider(Totals
const& totals);
13317 bool m_headerPrinted =
false;
13318 bool m_testRunInfoPrinted =
false;
13326#ifndef CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
13327#define CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
13338 class AssertionOrBenchmarkResult {
13342 Optional<AssertionStats> m_assertion;
13343 Optional<BenchmarkStats<>> m_benchmark;
13345 AssertionOrBenchmarkResult(AssertionStats
const& assertion);
13346 AssertionOrBenchmarkResult(BenchmarkStats<>
const& benchmark);
13348 bool isAssertion()
const;
13349 bool isBenchmark()
const;
13351 AssertionStats
const& asAssertion()
const;
13352 BenchmarkStats<>
const& asBenchmark()
const;
13376 class CumulativeReporterBase :
public ReporterBase {
13378 template<
typename T,
typename ChildNodeT>
13380 explicit Node( T
const& _value ) :
value( _value ) {}
13382 using ChildNodes = std::vector<Detail::unique_ptr<ChildNodeT>>;
13384 ChildNodes children;
13386 struct SectionNode {
13387 explicit SectionNode(SectionStats
const& _stats) : stats(_stats) {}
13389 bool operator == (SectionNode
const& other)
const {
13390 return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
13393 bool hasAnyAssertions()
const;
13395 SectionStats stats;
13396 std::vector<Detail::unique_ptr<SectionNode>> childSections;
13397 std::vector<Detail::AssertionOrBenchmarkResult> assertionsAndBenchmarks;
13398 std::string stdOut;
13399 std::string stdErr;
13403 using TestCaseNode = Node<TestCaseStats, SectionNode>;
13404 using TestRunNode = Node<TestRunStats, TestCaseNode>;
13408 CumulativeReporterBase(ReporterConfig&& _config):
13411 ~CumulativeReporterBase()
override;
13413 void benchmarkPreparing( StringRef )
override {}
13414 void benchmarkStarting( BenchmarkInfo
const& )
override {}
13415 void benchmarkEnded( BenchmarkStats<>
const& benchmarkStats )
override;
13416 void benchmarkFailed( StringRef )
override {}
13418 void noMatchingTestCases( StringRef )
override {}
13419 void reportInvalidTestSpec( StringRef )
override {}
13420 void fatalErrorEncountered( StringRef )
override {}
13422 void testRunStarting( TestRunInfo
const& )
override {}
13424 void testCaseStarting( TestCaseInfo
const& )
override {}
13425 void testCasePartialStarting( TestCaseInfo
const&, uint64_t )
override {}
13426 void sectionStarting( SectionInfo
const& sectionInfo )
override;
13428 void assertionStarting( AssertionInfo
const& )
override {}
13430 void assertionEnded( AssertionStats
const& assertionStats )
override;
13431 void sectionEnded( SectionStats
const& sectionStats )
override;
13432 void testCasePartialEnded( TestCaseStats
const&, uint64_t )
override {}
13433 void testCaseEnded( TestCaseStats
const& testCaseStats )
override;
13434 void testRunEnded( TestRunStats
const& testRunStats )
override;
13436 virtual void testRunEndedCumulative() = 0;
13438 void skipTest(TestCaseInfo
const&)
override {}
13442 bool m_shouldStoreSuccesfulAssertions =
true;
13444 bool m_shouldStoreFailedAssertions =
true;
13449 Detail::unique_ptr<TestRunNode> m_testRun;
13454 std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases;
13456 Detail::unique_ptr<SectionNode> m_rootSection;
13458 SectionNode* m_deepestSection =
nullptr;
13460 std::vector<SectionNode*> m_sectionStack;
13468#ifndef CATCH_REPORTER_EVENT_LISTENER_HPP_INCLUDED
13469#define CATCH_REPORTER_EVENT_LISTENER_HPP_INCLUDED
13481 class EventListenerBase :
public IEventListener {
13483 using IEventListener::IEventListener;
13485 void reportInvalidTestSpec( StringRef unmatchedSpec )
override;
13486 void fatalErrorEncountered( StringRef error )
override;
13488 void benchmarkPreparing( StringRef name )
override;
13489 void benchmarkStarting( BenchmarkInfo
const& benchmarkInfo )
override;
13490 void benchmarkEnded( BenchmarkStats<>
const& benchmarkStats )
override;
13491 void benchmarkFailed( StringRef error )
override;
13493 void assertionStarting( AssertionInfo
const& assertionInfo )
override;
13494 void assertionEnded( AssertionStats
const& assertionStats )
override;
13496 void listReporters(
13497 std::vector<ReporterDescription>
const& descriptions )
override;
13498 void listListeners(
13499 std::vector<ListenerDescription>
const& descriptions )
override;
13500 void listTests( std::vector<TestCaseHandle>
const& tests )
override;
13501 void listTags( std::vector<TagInfo>
const& tagInfos )
override;
13503 void noMatchingTestCases( StringRef unmatchedSpec )
override;
13504 void testRunStarting( TestRunInfo
const& testRunInfo )
override;
13505 void testCaseStarting( TestCaseInfo
const& testInfo )
override;
13506 void testCasePartialStarting( TestCaseInfo
const& testInfo,
13507 uint64_t partNumber )
override;
13508 void sectionStarting( SectionInfo
const& sectionInfo )
override;
13509 void sectionEnded( SectionStats
const& sectionStats )
override;
13510 void testCasePartialEnded( TestCaseStats
const& testCaseStats,
13511 uint64_t partNumber )
override;
13512 void testCaseEnded( TestCaseStats
const& testCaseStats )
override;
13513 void testRunEnded( TestRunStats
const& testRunStats )
override;
13514 void skipTest( TestCaseInfo
const& testInfo )
override;
13522#ifndef CATCH_REPORTER_HELPERS_HPP_INCLUDED
13523#define CATCH_REPORTER_HELPERS_HPP_INCLUDED
13533 class TestCaseHandle;
13544 struct lineOfChars {
13546 constexpr lineOfChars(
char c_ ): c( c_ ) {}
13548 friend std::ostream&
operator<<( std::ostream& out, lineOfChars value );
13561 std::vector<ReporterDescription>
const& descriptions,
13562 Verbosity verbosity );
13569 std::vector<ListenerDescription>
const& descriptions );
13578 void defaultListTags( std::ostream& out, std::vector<TagInfo>
const& tags,
bool isFiltered );
13590 ColourImpl* streamColour,
13591 std::vector<TestCaseHandle>
const& tests,
13593 Verbosity verbosity );
13601 ColourImpl& streamColour,
13602 Totals
const& totals );
13610#ifndef CATCH_REPORTER_JSON_HPP_INCLUDED
13611#define CATCH_REPORTER_JSON_HPP_INCLUDED
13617 class JsonReporter :
public StreamingReporterBase {
13619 JsonReporter( ReporterConfig&& config );
13621 ~JsonReporter()
override;
13623 static std::string getDescription();
13626 void testRunStarting( TestRunInfo
const& runInfo )
override;
13627 void testRunEnded( TestRunStats
const& runStats )
override;
13629 void testCaseStarting( TestCaseInfo
const& tcInfo )
override;
13630 void testCaseEnded( TestCaseStats
const& tcStats )
override;
13632 void testCasePartialStarting( TestCaseInfo
const& tcInfo,
13633 uint64_t index )
override;
13634 void testCasePartialEnded( TestCaseStats
const& tcStats,
13635 uint64_t index )
override;
13637 void sectionStarting( SectionInfo
const& sectionInfo )
override;
13638 void sectionEnded( SectionStats
const& sectionStats )
override;
13640 void assertionStarting( AssertionInfo
const& assertionInfo )
override;
13641 void assertionEnded( AssertionStats
const& assertionStats )
override;
13645 void benchmarkPreparing( StringRef name )
override;
13646 void benchmarkStarting( BenchmarkInfo
const& )
override;
13647 void benchmarkEnded( BenchmarkStats<>
const& )
override;
13648 void benchmarkFailed( StringRef error )
override;
13650 void listReporters(
13651 std::vector<ReporterDescription>
const& descriptions )
override;
13652 void listListeners(
13653 std::vector<ListenerDescription>
const& descriptions )
override;
13654 void listTests( std::vector<TestCaseHandle>
const& tests )
override;
13655 void listTags( std::vector<TagInfo>
const& tags )
override;
13658 Timer m_testCaseTimer;
13659 enum class Writer {
13664 JsonArrayWriter& startArray();
13665 JsonArrayWriter& startArray( StringRef key );
13667 JsonObjectWriter& startObject();
13668 JsonObjectWriter& startObject( StringRef key );
13673 bool isInside( Writer writer );
13675 void startListing();
13682 std::stack<JsonObjectWriter> m_objectWriters{};
13683 std::stack<JsonArrayWriter> m_arrayWriters{};
13684 std::stack<Writer> m_writers{};
13686 bool m_startedListing =
false;
13696#ifndef CATCH_REPORTER_JUNIT_HPP_INCLUDED
13697#define CATCH_REPORTER_JUNIT_HPP_INCLUDED
13703 class JunitReporter final :
public CumulativeReporterBase {
13705 JunitReporter(ReporterConfig&& _config);
13707 static std::string getDescription();
13709 void testRunStarting(TestRunInfo
const& runInfo)
override;
13711 void testCaseStarting(TestCaseInfo
const& testCaseInfo)
override;
13712 void assertionEnded(AssertionStats
const& assertionStats)
override;
13714 void testCaseEnded(TestCaseStats
const& testCaseStats)
override;
13716 void testRunEndedCumulative()
override;
13719 void writeRun(TestRunNode
const& testRunNode,
double suiteTime);
13721 void writeTestCase(TestCaseNode
const& testCaseNode);
13723 void writeSection( std::string
const& className,
13724 std::string
const& rootName,
13725 SectionNode
const& sectionNode,
13726 bool testOkToFail );
13728 void writeAssertions(SectionNode
const& sectionNode);
13729 void writeAssertion(AssertionStats
const& stats);
13733 std::string stdOutForSuite;
13734 std::string stdErrForSuite;
13735 unsigned int unexpectedExceptions = 0;
13736 bool m_okToFail =
false;
13744#ifndef CATCH_REPORTER_MULTI_HPP_INCLUDED
13745#define CATCH_REPORTER_MULTI_HPP_INCLUDED
13750 class MultiReporter final :
public IEventListener {
13757 std::vector<IEventListenerPtr> m_reporterLikes;
13758 bool m_haveNoncapturingReporters =
false;
13762 size_t m_insertedListeners = 0;
13764 void updatePreferences(IEventListener
const& reporterish);
13767 using IEventListener::IEventListener;
13769 void addListener( IEventListenerPtr&& listener );
13770 void addReporter( IEventListenerPtr&& reporter );
13774 void noMatchingTestCases( StringRef unmatchedSpec )
override;
13775 void fatalErrorEncountered( StringRef error )
override;
13776 void reportInvalidTestSpec( StringRef arg )
override;
13778 void benchmarkPreparing( StringRef name )
override;
13779 void benchmarkStarting( BenchmarkInfo
const& benchmarkInfo )
override;
13780 void benchmarkEnded( BenchmarkStats<>
const& benchmarkStats )
override;
13781 void benchmarkFailed( StringRef error )
override;
13783 void testRunStarting( TestRunInfo
const& testRunInfo )
override;
13784 void testCaseStarting( TestCaseInfo
const& testInfo )
override;
13785 void testCasePartialStarting(TestCaseInfo
const& testInfo, uint64_t partNumber)
override;
13786 void sectionStarting( SectionInfo
const& sectionInfo )
override;
13787 void assertionStarting( AssertionInfo
const& assertionInfo )
override;
13789 void assertionEnded( AssertionStats
const& assertionStats )
override;
13790 void sectionEnded( SectionStats
const& sectionStats )
override;
13791 void testCasePartialEnded(TestCaseStats
const& testStats, uint64_t partNumber)
override;
13792 void testCaseEnded( TestCaseStats
const& testCaseStats )
override;
13793 void testRunEnded( TestRunStats
const& testRunStats )
override;
13795 void skipTest( TestCaseInfo
const& testInfo )
override;
13797 void listReporters(std::vector<ReporterDescription>
const& descriptions)
override;
13798 void listListeners(std::vector<ListenerDescription>
const& descriptions)
override;
13799 void listTests(std::vector<TestCaseHandle>
const& tests)
override;
13800 void listTags(std::vector<TagInfo>
const& tags)
override;
13810#ifndef CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
13811#define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
13814#include <type_traits>
13820 template <
typename T,
typename =
void>
13821 struct has_description : std::false_type {};
13823 template <
typename T>
13824 struct has_description<
13826 void_t<decltype( T::getDescription() )>>
13827 : std::true_type {};
13832 IReporterFactoryPtr reporterPtr );
13837 class IEventListener;
13838 using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
13840 template <
typename T>
13841 class ReporterFactory :
public IReporterFactory {
13843 IEventListenerPtr create( ReporterConfig&& config )
const override {
13844 return Detail::make_unique<T>(
CATCH_MOVE(config) );
13847 std::string getDescription()
const override {
13848 return T::getDescription();
13853 template<
typename T>
13854 class ReporterRegistrar {
13856 explicit ReporterRegistrar( std::string
const& name ) {
13858 Detail::make_unique<ReporterFactory<T>>() );
13862 template<
typename T>
13863 class ListenerRegistrar {
13865 class TypedListenerFactory :
public EventListenerFactory {
13866 StringRef m_listenerName;
13868 std::string getDescriptionImpl( std::true_type )
const {
13869 return T::getDescription();
13872 std::string getDescriptionImpl( std::false_type )
const {
13873 return "(No description provided)";
13877 TypedListenerFactory( StringRef listenerName ):
13878 m_listenerName( listenerName ) {}
13880 IEventListenerPtr create( IConfig
const* config )
const override {
13881 return Detail::make_unique<T>( config );
13884 StringRef getName()
const override {
13885 return m_listenerName;
13888 std::string getDescription()
const override {
13889 return getDescriptionImpl( Detail::has_description<T>{} );
13894 ListenerRegistrar(StringRef listenerName) {
13900#if !defined(CATCH_CONFIG_DISABLE)
13902# define CATCH_REGISTER_REPORTER( name, reporterType ) \
13903 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
13904 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
13906 Catch::ReporterRegistrar<reporterType> INTERNAL_CATCH_UNIQUE_NAME( \
13907 catch_internal_RegistrarFor )( name ); \
13909 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
13911# define CATCH_REGISTER_LISTENER( listenerType ) \
13912 CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
13913 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
13915 Catch::ListenerRegistrar<listenerType> INTERNAL_CATCH_UNIQUE_NAME( \
13916 catch_internal_RegistrarFor )( #listenerType##_catch_sr ); \
13918 CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
13922#define CATCH_REGISTER_REPORTER(name, reporterType)
13923#define CATCH_REGISTER_LISTENER(listenerType)
13930#ifndef CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
13931#define CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
13937 class SonarQubeReporter final :
public CumulativeReporterBase {
13939 SonarQubeReporter(ReporterConfig&& config)
13940 : CumulativeReporterBase(
CATCH_MOVE(config))
13942 m_preferences.shouldRedirectStdOut =
true;
13943 m_preferences.shouldReportAllAssertions =
false;
13944 m_shouldStoreSuccesfulAssertions =
false;
13947 static std::string getDescription() {
13948 using namespace std::string_literals;
13949 return "Reports test results in the Generic Test Data SonarQube XML format"s;
13952 void testRunStarting( TestRunInfo
const& testRunInfo )
override;
13954 void testRunEndedCumulative()
override {
13955 writeRun( *m_testRun );
13959 void writeRun( TestRunNode
const& runNode );
13961 void writeTestFile(StringRef filename, std::vector<TestCaseNode const*>
const& testCaseNodes);
13963 void writeTestCase(TestCaseNode
const& testCaseNode);
13965 void writeSection(std::string
const& rootName, SectionNode
const& sectionNode,
bool okToFail);
13967 void writeAssertions(SectionNode
const& sectionNode,
bool okToFail);
13969 void writeAssertion(AssertionStats
const& stats,
bool okToFail);
13981#ifndef CATCH_REPORTER_TAP_HPP_INCLUDED
13982#define CATCH_REPORTER_TAP_HPP_INCLUDED
13987 class TAPReporter final :
public StreamingReporterBase {
13989 TAPReporter( ReporterConfig&& config ):
13990 StreamingReporterBase(
CATCH_MOVE(config) ) {
13991 m_preferences.shouldReportAllAssertions =
true;
13994 static std::string getDescription() {
13995 using namespace std::string_literals;
13996 return "Reports test results in TAP format, suitable for test harnesses"s;
13999 void testRunStarting( TestRunInfo
const& testInfo )
override;
14001 void noMatchingTestCases( StringRef unmatchedSpec )
override;
14003 void assertionEnded(AssertionStats
const& _assertionStats)
override;
14005 void testRunEnded(TestRunStats
const& _testRunStats)
override;
14008 std::size_t counter = 0;
14016#ifndef CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
14017#define CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
14023# pragma clang diagnostic push
14024# pragma clang diagnostic ignored "-Wpadded"
14029 class TeamCityReporter final :
public StreamingReporterBase {
14031 TeamCityReporter( ReporterConfig&& _config )
14032 : StreamingReporterBase(
CATCH_MOVE(_config) )
14034 m_preferences.shouldRedirectStdOut =
true;
14037 ~TeamCityReporter()
override;
14039 static std::string getDescription() {
14040 using namespace std::string_literals;
14041 return "Reports test results as TeamCity service messages"s;
14044 void testRunStarting( TestRunInfo
const& runInfo )
override;
14045 void testRunEnded( TestRunStats
const& runStats )
override;
14048 void assertionEnded(AssertionStats
const& assertionStats)
override;
14050 void sectionStarting(SectionInfo
const& sectionInfo)
override {
14051 m_headerPrintedForThisSection =
false;
14052 StreamingReporterBase::sectionStarting( sectionInfo );
14055 void testCaseStarting(TestCaseInfo
const& testInfo)
override;
14057 void testCaseEnded(TestCaseStats
const& testCaseStats)
override;
14060 void printSectionHeader(std::ostream& os);
14062 bool m_headerPrintedForThisSection =
false;
14069# pragma clang diagnostic pop
14075#ifndef CATCH_REPORTER_XML_HPP_INCLUDED
14076#define CATCH_REPORTER_XML_HPP_INCLUDED
14082 class XmlReporter :
public StreamingReporterBase {
14084 XmlReporter(ReporterConfig&& _config);
14086 ~XmlReporter()
override;
14088 static std::string getDescription();
14090 virtual std::string getStylesheetRef()
const;
14092 void writeSourceInfo(SourceLineInfo
const& sourceInfo);
14096 void testRunStarting(TestRunInfo
const& testInfo)
override;
14098 void testCaseStarting(TestCaseInfo
const& testInfo)
override;
14100 void sectionStarting(SectionInfo
const& sectionInfo)
override;
14102 void assertionStarting(AssertionInfo
const&)
override;
14104 void assertionEnded(AssertionStats
const& assertionStats)
override;
14106 void sectionEnded(SectionStats
const& sectionStats)
override;
14108 void testCaseEnded(TestCaseStats
const& testCaseStats)
override;
14110 void testRunEnded(TestRunStats
const& testRunStats)
override;
14112 void benchmarkPreparing( StringRef name )
override;
14113 void benchmarkStarting(BenchmarkInfo
const&)
override;
14114 void benchmarkEnded(BenchmarkStats<>
const&)
override;
14115 void benchmarkFailed( StringRef error )
override;
14117 void listReporters(std::vector<ReporterDescription>
const& descriptions)
override;
14118 void listListeners(std::vector<ListenerDescription>
const& descriptions)
override;
14119 void listTests(std::vector<TestCaseHandle>
const& tests)
override;
14120 void listTags(std::vector<TagInfo>
const& tags)
override;
14123 Timer m_testCaseTimer;
14125 int m_sectionDepth = 0;
#define CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR(id, op)
Definition catch_amalgamated.hpp:5485
#define CATCH_DEFINE_COMPARABLE_TRAIT(id, op)
Definition catch_amalgamated.hpp:5088
#define CATCH_CATCH_ANON(type)
Definition catch_amalgamated.hpp:522
#define CATCH_MOVE(...)
Replacement for std::move with better compile time performance.
Definition catch_amalgamated.hpp:610
#define CATCH_EXPORT
Definition catch_amalgamated.hpp:548
#define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(op)
Definition catch_amalgamated.hpp:5537
std::ostream & operator<<(std::ostream &, Catch_global_namespace_dummy)
#define SizedUnsignedTypeHelper(TYPE)
#define CATCH_TRY
Definition catch_amalgamated.hpp:520
#define CATCH_FORWARD(...)
Replacement for std::forward with better compile time performance.
Definition catch_amalgamated.hpp:613
#define CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR(id, op)
Definition catch_amalgamated.hpp:5431
#define CATCH_CATCH_ALL
Definition catch_amalgamated.hpp:521
Approx(double value)
Definition catch_amalgamated.cpp:566
void setMargin(double margin)
Definition catch_amalgamated.cpp:597
Approx operator-() const
Definition catch_amalgamated.cpp:577
bool equalityComparisonImpl(double other) const
Definition catch_amalgamated.cpp:590
void setEpsilon(double epsilon)
Definition catch_amalgamated.cpp:604
static Approx custom()
Definition catch_amalgamated.cpp:573
Approx & epsilon(T const &newEpsilon)
Definition catch_amalgamated.hpp:3186
Approx & margin(T const &newMargin)
Definition catch_amalgamated.hpp:3193
Definition catch_amalgamated.hpp:3115
Approx(double value)
Definition catch_amalgamated.cpp:566
Approx(T const &value)
Definition catch_amalgamated.hpp:3140
double m_value
Definition catch_amalgamated.hpp:3211
void setMargin(double margin)
Definition catch_amalgamated.cpp:597
Approx operator()(T const &value) const
Definition catch_amalgamated.hpp:3131
bool equalityComparisonImpl(double other) const
Definition catch_amalgamated.cpp:590
double m_epsilon
Definition catch_amalgamated.hpp:3208
Approx & scale(T const &newScale)
Definition catch_amalgamated.hpp:3200
void setEpsilon(double epsilon)
Definition catch_amalgamated.cpp:604
double m_scale
Definition catch_amalgamated.hpp:3210
static Approx custom()
Definition catch_amalgamated.cpp:573
friend bool operator==(const T &lhs, Approx const &rhs)
Definition catch_amalgamated.hpp:3145
Approx & epsilon(T const &newEpsilon)
Definition catch_amalgamated.hpp:3186
double m_margin
Definition catch_amalgamated.hpp:3209
Approx & margin(T const &newMargin)
Definition catch_amalgamated.hpp:3193
Definition catch_amalgamated.hpp:5617
~AssertionHandler()
Definition catch_amalgamated.hpp:5629
bool m_completed
Definition catch_amalgamated.hpp:5620
AssertionHandler(StringRef macroName, SourceLineInfo const &lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition)
Definition catch_amalgamated.cpp:2529
AssertionReaction m_reaction
Definition catch_amalgamated.hpp:5619
constexpr void handleExpr(ExprLhs< T > const &expr)
Definition catch_amalgamated.hpp:5637
AssertionInfo m_assertionInfo
Definition catch_amalgamated.hpp:5618
IResultCapture & m_resultCapture
Definition catch_amalgamated.hpp:5621
Definition catch_amalgamated.hpp:3338
StringRef getMessage() const
Definition catch_amalgamated.cpp:710
StringRef getTestMacroName() const
Definition catch_amalgamated.cpp:717
std::string getExpression() const
Definition catch_amalgamated.cpp:673
AssertionInfo m_info
Definition catch_amalgamated.hpp:3357
bool hasExpandedExpression() const
Definition catch_amalgamated.cpp:699
SourceLineInfo getSourceInfo() const
Definition catch_amalgamated.cpp:713
std::string getExpandedExpression() const
Definition catch_amalgamated.cpp:703
std::string getExpressionInMacro() const
Definition catch_amalgamated.cpp:686
bool hasMessage() const
Definition catch_amalgamated.cpp:669
bool hasExpression() const
Definition catch_amalgamated.cpp:665
bool succeeded() const
Definition catch_amalgamated.cpp:652
ResultWas::OfType getResultType() const
Definition catch_amalgamated.cpp:661
AssertionResultData m_resultData
Definition catch_amalgamated.hpp:3358
bool isOk() const
Definition catch_amalgamated.cpp:657
Definition catch_amalgamated.hpp:5334
LhsT m_lhs
Definition catch_amalgamated.hpp:5335
RhsT m_rhs
Definition catch_amalgamated.hpp:5337
StringRef m_op
Definition catch_amalgamated.hpp:5336
constexpr BinaryExpr(bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs)
Definition catch_amalgamated.hpp:5345
void streamReconstructedExpression(std::ostream &os) const override
This function has to be overriden by the derived class.
Definition catch_amalgamated.hpp:5339
void captureValue(size_t index, std::string const &value)
Definition catch_amalgamated.cpp:1066
size_t m_captured
Definition catch_amalgamated.hpp:4018
IResultCapture & m_resultCapture
Definition catch_amalgamated.hpp:4017
void captureValues(size_t index, T const &value)
Definition catch_amalgamated.hpp:4030
Capturer & operator=(Capturer const &)=delete
void captureValues(size_t index, T const &value, Ts const &... values)
Definition catch_amalgamated.hpp:4035
Capturer(StringRef macroName, SourceLineInfo const &lineInfo, ResultWas::OfType resultType, StringRef names)
Definition catch_amalgamated.cpp:995
Capturer(Capturer const &)=delete
std::vector< MessageInfo > m_messages
Definition catch_amalgamated.hpp:4016
Definition catch_amalgamated.hpp:4730
Detail::InternalParseResult parse(std::string const &, Detail::TokenStream tokens) const override
Definition catch_amalgamated.cpp:2776
Definition catch_amalgamated.hpp:4879
StringRef m_exeName
Definition catch_amalgamated.hpp:4881
std::vector< StringRef > m_args
Definition catch_amalgamated.hpp:4882
StringRef exeName() const
Definition catch_amalgamated.hpp:4889
Args(int argc, char const *const *argv)
Definition catch_amalgamated.cpp:3055
Definition catch_amalgamated.hpp:4406
static auto ok(U &&value) -> BasicResult
Definition catch_amalgamated.hpp:4416
static auto ok() -> BasicResult
Definition catch_amalgamated.hpp:4419
BasicResult(BasicResult< U > const &other)
Definition catch_amalgamated.hpp:4409
auto errorMessage() const -> std::string const &
Definition catch_amalgamated.hpp:4433
std::string m_errorMessage
Definition catch_amalgamated.hpp:4449
void enforceOk() const override
Definition catch_amalgamated.hpp:4438
BasicResult(ResultType type, std::string &&message)
Definition catch_amalgamated.hpp:4451
static auto runtimeError(std::string &&message) -> BasicResult
Definition catch_amalgamated.hpp:4424
auto type() const -> ResultType
Definition catch_amalgamated.hpp:4432
static auto logicError(std::string &&message) -> BasicResult
Definition catch_amalgamated.hpp:4420
Definition catch_amalgamated.hpp:4653
auto operator|(T const &other) const -> Parser
ParseState(ParseResultType type, TokenStream remainingTokens)
Definition catch_amalgamated.cpp:2757
TokenStream && remainingTokens() &&
Definition catch_amalgamated.hpp:4470
ParseResultType type() const
Definition catch_amalgamated.hpp:4466
TokenStream const & remainingTokens() const &
Definition catch_amalgamated.hpp:4467
TokenStream m_remainingTokens
Definition catch_amalgamated.hpp:4476
ParseResultType m_type
Definition catch_amalgamated.hpp:4475
Definition catch_amalgamated.hpp:4640
virtual ~ParserBase()=default
virtual auto parse(std::string const &exeName, TokenStream tokens) const -> InternalParseResult=0
virtual auto validate() const -> Result
Definition catch_amalgamated.hpp:4643
virtual size_t cardinality() const
Definition catch_amalgamated.cpp:2751
Definition catch_amalgamated.hpp:4661
ParserRefImpl(std::shared_ptr< BoundRef > const &ref)
Definition catch_amalgamated.hpp:4668
DerivedT && operator()(StringRef description) &&
Definition catch_amalgamated.hpp:4697
ParserRefImpl(T &ref, StringRef hint)
Definition catch_amalgamated.hpp:4682
ParserRefImpl(LambdaT const &ref, StringRef hint)
Definition catch_amalgamated.hpp:4689
StringRef m_description
Definition catch_amalgamated.hpp:4666
DerivedT & operator()(StringRef description) &
Definition catch_amalgamated.hpp:4693
Optionality m_optionality
Definition catch_amalgamated.hpp:4663
auto isOptional() const -> bool
Definition catch_amalgamated.hpp:4712
auto optional() -> DerivedT &
Definition catch_amalgamated.hpp:4702
ParserRefImpl(accept_many_t, LambdaT const &ref, StringRef hint)
Definition catch_amalgamated.hpp:4673
StringRef m_hint
Definition catch_amalgamated.hpp:4665
auto cardinality() const -> size_t override
Definition catch_amalgamated.hpp:4716
StringRef hint() const
Definition catch_amalgamated.hpp:4723
auto required() -> DerivedT &
Definition catch_amalgamated.hpp:4707
std::shared_ptr< BoundRef > m_ref
Definition catch_amalgamated.hpp:4664
ResultBase(ResultType type)
Definition catch_amalgamated.hpp:4323
ResultBase(ResultBase const &)=default
ResultBase & operator=(ResultBase const &)=default
ResultBase & operator=(ResultBase &&)=default
ResultBase(ResultBase &&)=default
virtual void enforceOk() const =0
ResultType m_type
Definition catch_amalgamated.hpp:4334
ResultBase(ResultType type)
Definition catch_amalgamated.hpp:4323
Definition catch_amalgamated.hpp:4338
ResultValueBase(ResultType, T const &value)
Definition catch_amalgamated.hpp:4364
ResultValueBase & operator=(ResultValueBase const &other)
Definition catch_amalgamated.hpp:4373
ResultValueBase & operator=(ResultValueBase &&other)
Definition catch_amalgamated.hpp:4381
ResultValueBase(ResultType, T &&value)
Definition catch_amalgamated.hpp:4368
T m_value
Definition catch_amalgamated.hpp:4396
ResultValueBase(ResultValueBase const &other)
Definition catch_amalgamated.hpp:4352
T const & value() const &
Definition catch_amalgamated.hpp:4340
ResultValueBase(ResultType type)
Definition catch_amalgamated.hpp:4350
ResultValueBase(ResultValueBase &&other)
Definition catch_amalgamated.hpp:4357
~ResultValueBase() override
Definition catch_amalgamated.hpp:4390
T && value() &&
Definition catch_amalgamated.hpp:4344
Definition catch_amalgamated.hpp:4281
Token const * operator->() const
Definition catch_amalgamated.hpp:4305
std::vector< StringRef >::const_iterator Iterator
Definition catch_amalgamated.hpp:4282
size_t count() const
Definition catch_amalgamated.hpp:4296
void loadBuffer()
Definition catch_amalgamated.cpp:2669
Iterator it
Definition catch_amalgamated.hpp:4283
Token operator*() const
Definition catch_amalgamated.hpp:4300
TokenStream(Args const &args)
Definition catch_amalgamated.cpp:2708
Iterator itEnd
Definition catch_amalgamated.hpp:4284
std::vector< Token > m_tokenBuffer
Definition catch_amalgamated.hpp:4285
Definition catch_amalgamated.hpp:4792
ExeName()
Definition catch_amalgamated.cpp:2898
std::string const & name() const
Definition catch_amalgamated.hpp:4811
ExeName(LambdaT const &lambda)
Definition catch_amalgamated.hpp:4801
std::shared_ptr< std::string > m_name
Definition catch_amalgamated.hpp:4793
std::shared_ptr< Detail::BoundValueRefBase > m_ref
Definition catch_amalgamated.hpp:4794
Definition catch_amalgamated.hpp:4741
Opt & operator[](StringRef optName) &
Definition catch_amalgamated.hpp:4769
Opt(LambdaT const &ref, StringRef hint)
Definition catch_amalgamated.hpp:4756
std::vector< StringRef > m_optNames
Definition catch_amalgamated.hpp:4743
Opt(LambdaT const &ref)
Definition catch_amalgamated.hpp:4747
Opt && operator[](StringRef optName) &&
Definition catch_amalgamated.hpp:4773
Opt(T &ref, StringRef hint)
Definition catch_amalgamated.hpp:4766
Opt(accept_many_t, LambdaT const &ref, StringRef hint)
Definition catch_amalgamated.hpp:4760
Definition catch_amalgamated.hpp:4817
friend Parser & operator|=(Parser &p, Opt const &opt)
Definition catch_amalgamated.hpp:4834
ExeName m_exeName
Definition catch_amalgamated.hpp:4818
auto operator|=(Arg const &arg) -> Parser &
Definition catch_amalgamated.hpp:4829
friend auto operator<<(std::ostream &os, Parser const &parser) -> std::ostream &
Definition catch_amalgamated.hpp:4862
std::vector< Arg > m_args
Definition catch_amalgamated.hpp:4820
friend Parser operator|(Parser &&p, T &&rhs)
Definition catch_amalgamated.hpp:4853
friend Parser operator|(Parser const &p, T &&rhs)
Definition catch_amalgamated.hpp:4846
auto operator|=(ExeName const &exeName) -> Parser &
Definition catch_amalgamated.hpp:4824
friend Parser & operator|=(Parser &p, Opt &&opt)
Definition catch_amalgamated.hpp:4838
std::vector< Opt > m_options
Definition catch_amalgamated.hpp:4819
Definition catch_amalgamated.hpp:3809
unsigned int shardCount() const override
Definition catch_amalgamated.cpp:907
std::vector< std::string > const & getTestsOrTags() const override
Definition catch_amalgamated.cpp:875
double benchmarkConfidenceInterval() const override
Definition catch_amalgamated.cpp:918
bool hasTestFilters() const override
Definition catch_amalgamated.cpp:888
ColourMode defaultColourMode() const override
Definition catch_amalgamated.cpp:909
unsigned int benchmarkSamples() const override
Definition catch_amalgamated.cpp:917
TestSpec m_testSpec
Definition catch_amalgamated.hpp:3864
std::vector< std::string > const & getSectionsToRun() const override
Definition catch_amalgamated.cpp:876
std::vector< ProcessedReporterSpec > m_processedReporterSpecs
Definition catch_amalgamated.hpp:3863
bool listTests() const
Definition catch_amalgamated.cpp:870
bool listReporters() const
Definition catch_amalgamated.cpp:872
bool warnAboutMissingAssertions() const override
Definition catch_amalgamated.cpp:896
unsigned int benchmarkResamples() const override
Definition catch_amalgamated.cpp:919
std::vector< ProcessedReporterSpec > const & getProcessedReporterSpecs() const
Definition catch_amalgamated.cpp:883
bool showInvisibles() const override
Definition catch_amalgamated.cpp:912
bool m_hasTestFilters
Definition catch_amalgamated.hpp:3865
bool includeSuccessfulResults() const override
Definition catch_amalgamated.cpp:895
bool listTags() const
Definition catch_amalgamated.cpp:871
std::chrono::milliseconds benchmarkWarmupTime() const override
Definition catch_amalgamated.cpp:920
std::vector< ReporterSpec > const & getReporterSpecs() const
Definition catch_amalgamated.cpp:878
TestSpec const & testSpec() const override
Definition catch_amalgamated.cpp:887
bool benchmarkNoAnalysis() const override
Definition catch_amalgamated.cpp:916
ShowDurations showDurations() const override
Definition catch_amalgamated.cpp:903
Verbosity verbosity() const override
Definition catch_amalgamated.cpp:913
double minDuration() const override
Definition catch_amalgamated.cpp:904
bool listListeners() const
Definition catch_amalgamated.cpp:873
StringRef name() const override
Definition catch_amalgamated.cpp:894
void readBazelEnvVars()
Definition catch_amalgamated.cpp:922
bool warnAboutUnmatchedTestSpecs() const override
Definition catch_amalgamated.cpp:899
bool skipBenchmarks() const override
Definition catch_amalgamated.cpp:915
bool zeroTestsCountAsSuccess() const override
Definition catch_amalgamated.cpp:902
TestRunOrder runOrder() const override
Definition catch_amalgamated.cpp:905
int abortAfter() const override
Definition catch_amalgamated.cpp:911
ConfigData m_data
Definition catch_amalgamated.hpp:3862
unsigned int shardIndex() const override
Definition catch_amalgamated.cpp:908
bool allowThrows() const override
Definition catch_amalgamated.cpp:893
bool shouldDebugBreak() const override
Definition catch_amalgamated.cpp:910
uint32_t rngSeed() const override
Definition catch_amalgamated.cpp:906
bool showHelp() const
Definition catch_amalgamated.cpp:890
Definition catch_amalgamated.hpp:563
IConfig const * m_config
Definition catch_amalgamated.hpp:564
IResultCapture * m_resultCapture
Definition catch_amalgamated.hpp:565
constexpr void setResultCapture(IResultCapture *resultCapture)
Definition catch_amalgamated.hpp:578
static void createContext()
Definition catch_amalgamated.cpp:3652
constexpr IConfig const * getConfig() const
Definition catch_amalgamated.hpp:577
constexpr void setConfig(IConfig const *config)
Definition catch_amalgamated.hpp:581
friend Context & getCurrentMutableContext()
Definition catch_amalgamated.cpp:3656
friend void cleanUpContext()
Definition catch_amalgamated.cpp:3648
static CATCH_EXPORT Context * currentContext
Definition catch_amalgamated.hpp:567
friend Context const & getCurrentContext()
Definition catch_amalgamated.hpp:587
constexpr IResultCapture * getResultCapture() const
Definition catch_amalgamated.hpp:574
Definition catch_amalgamated.hpp:2500
static auto test(int) -> decltype(std::declval< Stream & >()<< std::declval< U >(), std::true_type())
static const bool value
Definition catch_amalgamated.hpp:2509
static auto test(...) -> std::false_type
Deriving classes become noncopyable and nonmovable.
Definition catch_amalgamated.hpp:1131
NonCopyable & operator=(NonCopyable &&)=delete
NonCopyable & operator=(NonCopyable const &)=delete
NonCopyable(NonCopyable &&)=delete
NonCopyable(NonCopyable const &)=delete
NonCopyable() noexcept=default
Definition catch_amalgamated.hpp:890
T & operator*()
Definition catch_amalgamated.hpp:929
unique_ptr(unique_ptr &&rhs) noexcept
Definition catch_amalgamated.hpp:915
unique_ptr & operator=(unique_ptr &&rhs) noexcept
Definition catch_amalgamated.hpp:919
friend void swap(unique_ptr &lhs, unique_ptr &rhs)
Definition catch_amalgamated.hpp:964
constexpr unique_ptr(std::nullptr_t=nullptr)
Definition catch_amalgamated.hpp:893
T * operator->() noexcept
Definition catch_amalgamated.hpp:937
GeneratorUntypedBase * m_ptr
Definition catch_amalgamated.hpp:891
T * get()
Definition catch_amalgamated.hpp:946
GeneratorUntypedBase * release()
Definition catch_amalgamated.hpp:954
~unique_ptr()
Definition catch_amalgamated.hpp:925
unique_ptr & operator=(unique_ptr const &)=delete
unique_ptr(unique_ptr const &)=delete
void reset(T *ptr=nullptr)
Definition catch_amalgamated.hpp:949
T const * operator->() const noexcept
Definition catch_amalgamated.hpp:941
unique_ptr & operator=(unique_ptr< U > &&from)
Definition catch_amalgamated.hpp:906
T const & operator*() const
Definition catch_amalgamated.hpp:933
constexpr unique_ptr(T *ptr)
Definition catch_amalgamated.hpp:896
T const * get() const
Definition catch_amalgamated.hpp:947
unique_ptr(unique_ptr< U > &&from)
Definition catch_amalgamated.hpp:901
Definition catch_amalgamated.hpp:7248
std::string translate(ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd) const override
Definition catch_amalgamated.hpp:7255
constexpr ExceptionTranslator(std::string(*translateFunction)(T const &))
Definition catch_amalgamated.hpp:7251
std::string(* m_translateFunction)(T const &)
Definition catch_amalgamated.hpp:7272
ExceptionTranslatorRegistrar(std::string(*translateFunction)(T const &))
Definition catch_amalgamated.hpp:7277
Definition catch_amalgamated.hpp:5426
constexpr auto makeUnaryExpr() const -> UnaryExpr< LhsT >
Definition catch_amalgamated.hpp:5574
constexpr ExprLhs(LhsT lhs)
Definition catch_amalgamated.hpp:5429
LhsT m_lhs
Definition catch_amalgamated.hpp:5427
GeneratorException(const char *msg)
Definition catch_amalgamated.hpp:7390
const char *const m_msg
Definition catch_amalgamated.hpp:7387
size_t m_chunk_size
Definition catch_amalgamated.hpp:7904
bool m_used_up
Definition catch_amalgamated.hpp:7906
ChunkGenerator(size_t size, GeneratorWrapper< T > generator)
Definition catch_amalgamated.hpp:7908
bool next() override
Definition catch_amalgamated.hpp:7925
GeneratorWrapper< T > m_generator
Definition catch_amalgamated.hpp:7905
std::vector< T > m_chunk
Definition catch_amalgamated.hpp:7903
std::vector< T > const & get() const override
Definition catch_amalgamated.hpp:7922
Definition catch_amalgamated.hpp:7765
bool next() override
Definition catch_amalgamated.hpp:7788
Predicate m_predicate
Definition catch_amalgamated.hpp:7767
GeneratorWrapper< T > m_generator
Definition catch_amalgamated.hpp:7766
T const & get() const override
Definition catch_amalgamated.hpp:7784
FilterGenerator(P &&pred, GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7770
Definition catch_amalgamated.hpp:7561
size_t m_idx
Definition catch_amalgamated.hpp:7566
std::vector< T > m_values
Definition catch_amalgamated.hpp:7565
bool next() override
Definition catch_amalgamated.hpp:7573
FixedValuesGenerator(std::initializer_list< T > values)
Definition catch_amalgamated.hpp:7568
T const & get() const override
Definition catch_amalgamated.hpp:7570
Definition catch_amalgamated.hpp:7416
GeneratorUntypedBase()=default
bool countedNext()
Definition catch_amalgamated.cpp:2399
virtual ~GeneratorUntypedBase()
std::string m_stringReprCache
Definition catch_amalgamated.hpp:7419
GeneratorUntypedBase & operator=(GeneratorUntypedBase const &)=default
GeneratorUntypedBase(GeneratorUntypedBase const &)=default
virtual std::string stringifyImpl() const =0
Customization point for currentElementAsString
std::size_t m_currentElementIndex
Definition catch_amalgamated.hpp:7422
std::size_t currentElementIndex() const
Definition catch_amalgamated.hpp:7456
Definition catch_amalgamated.hpp:7523
T const & get() const
Definition catch_amalgamated.hpp:7532
GeneratorWrapper(GeneratorPtr< T > generator)
Definition catch_amalgamated.hpp:7529
GeneratorWrapper(IGenerator< T > *generator)
Takes ownership of the passed pointer.
Definition catch_amalgamated.hpp:7527
bool next()
Definition catch_amalgamated.hpp:7535
GeneratorPtr< T > m_generator
Definition catch_amalgamated.hpp:7524
Definition catch_amalgamated.hpp:7591
Generators(Gs &&... moreGenerators)
Definition catch_amalgamated.hpp:7622
std::vector< GeneratorWrapper< T > > m_generators
Definition catch_amalgamated.hpp:7592
void add_generator(GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7595
size_t m_current
Definition catch_amalgamated.hpp:7593
void add_generators(U &&valueOrGenerator)
Definition catch_amalgamated.hpp:7610
void add_generator(T const &val)
Definition catch_amalgamated.hpp:7598
bool next() override
Definition catch_amalgamated.hpp:7631
T const & get() const override
Definition catch_amalgamated.hpp:7627
std::enable_if_t<!std::is_same< std::decay_t< U >, T >::value > add_generator(U &&val)
Definition catch_amalgamated.hpp:7606
void add_generator(T &&val)
Definition catch_amalgamated.hpp:7601
void add_generators(U &&valueOrGenerator, Gs &&... moreGenerators)
Definition catch_amalgamated.hpp:7615
Definition catch_amalgamated.hpp:7505
virtual T const & get() const =0
T type
Definition catch_amalgamated.hpp:7516
std::string stringifyImpl() const override
Customization point for currentElementAsString
Definition catch_amalgamated.hpp:7506
Definition catch_amalgamated.hpp:7861
MapGenerator(F2 &&function, GeneratorWrapper< U > &&generator)
Definition catch_amalgamated.hpp:7869
GeneratorWrapper< U > m_generator
Definition catch_amalgamated.hpp:7863
T m_cache
Definition catch_amalgamated.hpp:7866
bool next() override
Definition catch_amalgamated.hpp:7878
T const & get() const override
Definition catch_amalgamated.hpp:7875
Func m_function
Definition catch_amalgamated.hpp:7864
Definition catch_amalgamated.hpp:7805
T const & get() const override
Definition catch_amalgamated.hpp:7822
bool next() override
Definition catch_amalgamated.hpp:7830
RepeatGenerator(size_t repeats, GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7815
size_t m_repeat_index
Definition catch_amalgamated.hpp:7813
size_t m_current_repeat
Definition catch_amalgamated.hpp:7812
GeneratorWrapper< T > m_generator
Definition catch_amalgamated.hpp:7809
std::vector< T > m_returned
Definition catch_amalgamated.hpp:7810
size_t m_target_repeats
Definition catch_amalgamated.hpp:7811
Definition catch_amalgamated.hpp:7542
bool next() override
Definition catch_amalgamated.hpp:7555
SingleValueGenerator(T const &value)
Definition catch_amalgamated.hpp:7545
SingleValueGenerator(T &&value)
Definition catch_amalgamated.hpp:7548
T m_value
Definition catch_amalgamated.hpp:7543
T const & get() const override
Definition catch_amalgamated.hpp:7552
Definition catch_amalgamated.hpp:7728
size_t m_returned
Definition catch_amalgamated.hpp:7730
GeneratorWrapper< T > m_generator
Definition catch_amalgamated.hpp:7729
T const & get() const override
Definition catch_amalgamated.hpp:7739
size_t m_target
Definition catch_amalgamated.hpp:7731
TakeGenerator(size_t target, GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7733
bool next() override
Definition catch_amalgamated.hpp:7742
Definition catch_amalgamated.hpp:1197
virtual double minDuration() const =0
virtual unsigned int benchmarkSamples() const =0
virtual ColourMode defaultColourMode() const =0
virtual bool includeSuccessfulResults() const =0
virtual int abortAfter() const =0
virtual unsigned int benchmarkResamples() const =0
virtual std::vector< std::string > const & getTestsOrTags() const =0
virtual bool hasTestFilters() const =0
virtual std::chrono::milliseconds benchmarkWarmupTime() const =0
virtual Verbosity verbosity() const =0
virtual ShowDurations showDurations() const =0
virtual bool shouldDebugBreak() const =0
virtual bool warnAboutUnmatchedTestSpecs() const =0
virtual TestSpec const & testSpec() const =0
virtual bool zeroTestsCountAsSuccess() const =0
virtual uint32_t rngSeed() const =0
virtual bool warnAboutMissingAssertions() const =0
virtual unsigned int shardIndex() const =0
virtual bool showInvisibles() const =0
virtual bool benchmarkNoAnalysis() const =0
virtual bool allowThrows() const =0
virtual bool skipBenchmarks() const =0
virtual unsigned int shardCount() const =0
virtual StringRef name() const =0
virtual double benchmarkConfidenceInterval() const =0
virtual std::vector< std::string > const & getSectionsToRun() const =0
virtual TestRunOrder runOrder() const =0
Definition catch_amalgamated.hpp:7228
virtual ~IExceptionTranslatorRegistry()
virtual std::string translateActiveException() const =0
Definition catch_amalgamated.hpp:7222
virtual std::string translate(ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd) const =0
virtual ~IExceptionTranslator()
Definition catch_amalgamated.hpp:7477
virtual auto getGenerator() const -> Generators::GeneratorBasePtr const &=0
virtual void setGenerator(Generators::GeneratorBasePtr &&generator)=0
virtual ~IGeneratorTracker()
virtual auto hasGenerator() const -> bool=0
Definition catch_amalgamated.hpp:2434
virtual ~IMutableEnumValuesRegistry()
virtual Detail::EnumInfo const & registerEnum(StringRef enumName, StringRef allEnums, std::vector< int > const &values)=0
Detail::EnumInfo const & registerEnum(StringRef enumName, StringRef allEnums, std::initializer_list< E > values)
Definition catch_amalgamated.hpp:2441
Definition catch_amalgamated.hpp:1273
virtual void registerTest(Detail::unique_ptr< TestCaseInfo > &&testInfo, Detail::unique_ptr< ITestInvoker > &&invoker)=0
virtual void registerStartupException() noexcept=0
virtual void registerListener(Detail::unique_ptr< EventListenerFactory > factory)=0
virtual ~IMutableRegistryHub()
virtual void registerReporter(std::string const &name, IReporterFactoryPtr factory)=0
virtual IMutableEnumValuesRegistry & getMutableEnumValuesRegistry()=0
virtual void registerTagAlias(std::string const &alias, std::string const &tag, SourceLineInfo const &lineInfo)=0
virtual void registerTranslator(Detail::unique_ptr< IExceptionTranslator > &&translator)=0
Definition catch_amalgamated.hpp:1260
virtual ITestCaseRegistry const & getTestCaseRegistry() const =0
virtual ITagAliasRegistry const & getTagAliasRegistry() const =0
virtual StartupExceptionRegistry const & getStartupExceptionRegistry() const =0
virtual IExceptionTranslatorRegistry const & getExceptionTranslatorRegistry() const =0
virtual ReporterRegistry const & getReporterRegistry() const =0
Definition catch_amalgamated.hpp:1048
virtual void emplaceUnscopedMessage(MessageBuilder &&builder)=0
virtual void benchmarkStarting(BenchmarkInfo const &info)=0
virtual void benchmarkEnded(BenchmarkStats<> const &stats)=0
virtual const AssertionResult * getLastResult() const =0
virtual IGeneratorTracker * createGeneratorTracker(StringRef generatorName, SourceLineInfo lineInfo, Generators::GeneratorBasePtr &&generator)=0
virtual void popScopedMessage(MessageInfo const &message)=0
virtual void handleFatalErrorCondition(StringRef message)=0
virtual void handleUnexpectedInflightException(AssertionInfo const &info, std::string &&message, AssertionReaction &reaction)=0
virtual void handleExpr(AssertionInfo const &info, ITransientExpression const &expr, AssertionReaction &reaction)=0
virtual void notifyAssertionStarted(AssertionInfo const &info)=0
virtual void handleMessage(AssertionInfo const &info, ResultWas::OfType resultType, std::string &&message, AssertionReaction &reaction)=0
virtual void handleUnexpectedExceptionNotThrown(AssertionInfo const &info, AssertionReaction &reaction)=0
virtual void benchmarkFailed(StringRef error)=0
virtual ~IResultCapture()
virtual void handleIncomplete(AssertionInfo const &info)=0
virtual void sectionEnded(SectionEndInfo &&endInfo)=0
virtual void pushScopedMessage(MessageInfo const &message)=0
virtual bool lastAssertionPassed()=0
virtual void assertionPassed()=0
virtual IGeneratorTracker * acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const &lineInfo)=0
virtual bool sectionStarted(StringRef sectionName, SourceLineInfo const §ionLineInfo, Counts &assertions)=0
virtual void handleNonExpr(AssertionInfo const &info, ResultWas::OfType resultType, AssertionReaction &reaction)=0
virtual void sectionEndedEarly(SectionEndInfo &&endInfo)=0
virtual void exceptionEarlyReported()=0
virtual std::string getCurrentTestName() const =0
virtual void benchmarkPreparing(StringRef name)=0
Definition catch_amalgamated.hpp:5967
virtual void prepareTestCase()
Definition catch_amalgamated.cpp:7095
virtual void invoke() const =0
virtual void tearDownTestCase()
Definition catch_amalgamated.cpp:7096
Definition catch_amalgamated.hpp:5304
bool m_result
Definition catch_amalgamated.hpp:5306
friend std::ostream & operator<<(std::ostream &out, ITransientExpression const &expr)
Definition catch_amalgamated.hpp:5325
constexpr auto getResult() const -> bool
Definition catch_amalgamated.hpp:5313
constexpr ITransientExpression(bool isBinaryExpression, bool result)
Definition catch_amalgamated.hpp:5317
bool m_isBinaryExpression
Definition catch_amalgamated.hpp:5305
constexpr auto isBinaryExpression() const -> bool
Definition catch_amalgamated.hpp:5312
virtual void streamReconstructedExpression(std::ostream &os) const
This function has to be overriden by the derived class.
Definition catch_amalgamated.cpp:3819
~ITransientExpression()=default
constexpr ITransientExpression(ITransientExpression const &)=default
constexpr ITransientExpression & operator=(ITransientExpression const &)=default
Definition catch_amalgamated.hpp:3295
friend class AssertionHandler
Definition catch_amalgamated.hpp:3296
ITransientExpression const * m_transientExpression
Definition catch_amalgamated.hpp:3300
friend struct AssertionStats
Definition catch_amalgamated.hpp:3297
bool m_isNegated
Definition catch_amalgamated.hpp:3301
constexpr LazyExpression(bool isNegated)
Definition catch_amalgamated.hpp:3303
constexpr LazyExpression(LazyExpression const &other)=default
friend class RunContext
Definition catch_amalgamated.hpp:3298
Definition catch_amalgamated.hpp:3537
friend bool operator!=(Optional const &a, Optional const &b)
Definition catch_amalgamated.hpp:3624
char storage[sizeof(T)]
Definition catch_amalgamated.hpp:3630
Optional(T const &_value)
Definition catch_amalgamated.hpp:3542
T const & operator*() const
Definition catch_amalgamated.hpp:3590
bool some() const
Definition catch_amalgamated.hpp:3607
T * operator->()
Definition catch_amalgamated.hpp:3594
T & operator*()
Definition catch_amalgamated.hpp:3586
Optional & operator=(T const &_value)
Definition catch_amalgamated.hpp:3547
bool none() const
Definition catch_amalgamated.hpp:3608
~Optional()
Definition catch_amalgamated.hpp:3540
void reset()
Definition catch_amalgamated.hpp:3581
Optional & operator=(T &&_value)
Definition catch_amalgamated.hpp:3552
Optional & operator=(Optional const &_other)
Definition catch_amalgamated.hpp:3564
T * nullableValue
Definition catch_amalgamated.hpp:3629
friend bool operator==(Optional const &a, Optional const &b)
Definition catch_amalgamated.hpp:3615
Optional(T &&_value)
Definition catch_amalgamated.hpp:3544
T valueOr(T const &defaultValue) const
Definition catch_amalgamated.hpp:3603
Optional(Optional &&_other)
Definition catch_amalgamated.hpp:3560
Optional()
Definition catch_amalgamated.hpp:3539
const T * operator->() const
Definition catch_amalgamated.hpp:3598
Optional & operator=(Optional &&_other)
Definition catch_amalgamated.hpp:3571
Optional(Optional const &_other)
Definition catch_amalgamated.hpp:3558
Definition catch_amalgamated.hpp:3686
Optional< ColourMode > const & colourMode() const
Definition catch_amalgamated.hpp:3712
Optional< ColourMode > m_colourMode
Definition catch_amalgamated.hpp:3689
std::map< std::string, std::string > m_customOptions
Definition catch_amalgamated.hpp:3690
friend bool operator==(ReporterSpec const &lhs, ReporterSpec const &rhs)
Definition catch_amalgamated.cpp:5469
std::map< std::string, std::string > const & customOptions() const
Definition catch_amalgamated.hpp:3714
friend bool operator!=(ReporterSpec const &lhs, ReporterSpec const &rhs)
Definition catch_amalgamated.hpp:3694
Optional< std::string > const & outputFile() const
Definition catch_amalgamated.hpp:3708
std::string const & name() const
Definition catch_amalgamated.hpp:3706
ReporterSpec(std::string name, Optional< std::string > outputFileName, Optional< ColourMode > colourMode, std::map< std::string, std::string > customOptions)
Definition catch_amalgamated.cpp:5533
std::string m_name
Definition catch_amalgamated.hpp:3687
Optional< std::string > m_outputFileName
Definition catch_amalgamated.hpp:3688
Definition catch_amalgamated.hpp:2355
std::string str() const
Returns the serialized state.
Definition catch_amalgamated.cpp:5588
auto get() -> std::ostream &
Definition catch_amalgamated.hpp:2388
std::size_t m_index
Definition catch_amalgamated.hpp:2356
ReusableStringStream()
Definition catch_amalgamated.cpp:5577
std::ostream * m_oss
Definition catch_amalgamated.hpp:2357
bool m_moved
Definition catch_amalgamated.hpp:4012
ScopedMessage(ScopedMessage &duplicate)=delete
ScopedMessage(MessageBuilder &&builder)
Definition catch_amalgamated.cpp:977
MessageInfo m_info
Definition catch_amalgamated.hpp:4011
bool m_sectionIncluded
Definition catch_amalgamated.hpp:5886
Timer m_timer
Definition catch_amalgamated.hpp:5887
SectionInfo m_info
Definition catch_amalgamated.hpp:5883
Section(SectionInfo &&info)
Definition catch_amalgamated.cpp:6310
Counts m_assertions
Definition catch_amalgamated.hpp:5885
void useConfigData(ConfigData const &configData)
Definition catch_amalgamated.cpp:1395
void showHelp() const
Definition catch_amalgamated.cpp:1328
Session()
Definition catch_amalgamated.cpp:1290
bool m_startupExceptions
Definition catch_amalgamated.hpp:4973
ConfigData m_configData
Definition catch_amalgamated.hpp:4971
Detail::unique_ptr< Config > m_config
Definition catch_amalgamated.hpp:4972
int run(int argc, CharT const *const argv[])
Definition catch_amalgamated.hpp:4952
ConfigData & configData()
Definition catch_amalgamated.cpp:1419
Clara::Parser m_cli
Definition catch_amalgamated.hpp:4970
void libIdentify()
Definition catch_amalgamated.cpp:1334
int applyCommandLine(int argc, char const *const *argv)
Definition catch_amalgamated.cpp:1342
Definition catch_amalgamated.hpp:7968
SimplePcg32()
Definition catch_amalgamated.hpp:7980
std::uint32_t result_type
Definition catch_amalgamated.hpp:7971
static const std::uint64_t s_inc
Definition catch_amalgamated.hpp:8002
static constexpr result_type min()
Definition catch_amalgamated.hpp:7972
static constexpr result_type max()
Definition catch_amalgamated.hpp:7975
std::uint64_t m_state
Definition catch_amalgamated.hpp:7997
std::uint64_t state_type
Definition catch_amalgamated.hpp:7969
Definition catch_amalgamated.hpp:711
char const * m_start
Definition catch_amalgamated.hpp:721
std::size_t size_type
Definition catch_amalgamated.hpp:713
constexpr auto empty() const noexcept -> bool
Definition catch_amalgamated.hpp:760
friend std::string operator+(StringRef lhs, StringRef rhs)
Definition catch_amalgamated.cpp:6605
auto operator!=(StringRef other) const noexcept -> bool
Definition catch_amalgamated.hpp:748
constexpr auto operator[](size_type index) const noexcept -> char
Definition catch_amalgamated.hpp:752
static constexpr char const *const s_empty
Definition catch_amalgamated.hpp:719
constexpr const_iterator end() const
Definition catch_amalgamated.hpp:785
friend std::ostream & operator<<(std::ostream &os, StringRef str)
Definition catch_amalgamated.cpp:6601
int compare(StringRef rhs) const
Definition catch_amalgamated.cpp:6580
static constexpr size_type npos
Definition catch_amalgamated.hpp:716
bool operator<(StringRef rhs) const noexcept
Definition catch_amalgamated.cpp:6573
constexpr StringRef() noexcept=default
auto operator==(StringRef other) const noexcept -> bool
Definition catch_amalgamated.hpp:744
constexpr char const * data() const noexcept
Definition catch_amalgamated.hpp:780
StringRef(std::string const &stdString) noexcept
Definition catch_amalgamated.hpp:734
size_type m_size
Definition catch_amalgamated.hpp:722
constexpr StringRef substr(size_type start, size_type length) const noexcept
Definition catch_amalgamated.hpp:770
constexpr const_iterator begin() const
Definition catch_amalgamated.hpp:784
const char * const_iterator
Definition catch_amalgamated.hpp:714
constexpr auto size() const noexcept -> size_type
Definition catch_amalgamated.hpp:763
friend std::string & operator+=(std::string &lhs, StringRef rhs)
Definition catch_amalgamated.cpp:6613
TestCaseInfo * m_info
Definition catch_amalgamated.hpp:7168
void invoke() const
Definition catch_amalgamated.hpp:7182
void prepareTestCase() const
Definition catch_amalgamated.hpp:7174
constexpr TestCaseInfo const & getTestCaseInfo() const
Definition catch_amalgamated.hpp:7186
ITestInvoker * m_invoker
Definition catch_amalgamated.hpp:7169
void tearDownTestCase() const
Definition catch_amalgamated.hpp:7178
constexpr TestCaseHandle(TestCaseInfo *info, ITestInvoker *invoker)
Definition catch_amalgamated.hpp:7171
void(C::* m_testAsMethod)()
Definition catch_amalgamated.hpp:6006
void invoke() const override
Definition catch_amalgamated.hpp:6011
constexpr TestInvokerAsMethod(void(C::*testAsMethod)()) noexcept
Definition catch_amalgamated.hpp:6008
void invoke() const override
Definition catch_amalgamated.hpp:6041
constexpr TestInvokerFixture(void(C::*testAsMethod)() const) noexcept
Definition catch_amalgamated.hpp:6030
Detail::unique_ptr< C > m_fixture
Definition catch_amalgamated.hpp:6027
void tearDownTestCase() override
Definition catch_amalgamated.hpp:6037
void(C::* m_testAsMethod)() const
Definition catch_amalgamated.hpp:6026
void prepareTestCase() override
Definition catch_amalgamated.hpp:6033
NamePattern(std::string const &name, std::string const &filterString)
Definition catch_amalgamated.cpp:1794
WildcardPattern m_wildcardPattern
Definition catch_amalgamated.hpp:3461
bool matches(TestCaseInfo const &testCase) const override
Definition catch_amalgamated.cpp:1799
void serializeTo(std::ostream &out) const override
Definition catch_amalgamated.cpp:1803
friend std::ostream & operator<<(std::ostream &out, Pattern const &pattern)
Definition catch_amalgamated.hpp:3445
Pattern(std::string const &name)
Definition catch_amalgamated.cpp:1783
virtual bool matches(TestCaseInfo const &testCase) const =0
std::string const & name() const
Definition catch_amalgamated.cpp:1789
virtual void serializeTo(std::ostream &out) const =0
std::string const m_name
Definition catch_amalgamated.hpp:3451
std::string m_tag
Definition catch_amalgamated.hpp:3471
bool matches(TestCaseInfo const &testCase) const override
Definition catch_amalgamated.cpp:1813
void serializeTo(std::ostream &out) const override
Definition catch_amalgamated.cpp:1819
TagPattern(std::string const &tag, std::string const &filterString)
Definition catch_amalgamated.cpp:1808
Definition catch_amalgamated.hpp:3434
std::vector< FilterMatch > Matches
Definition catch_amalgamated.hpp:3496
bool matches(TestCaseInfo const &testCase) const
Definition catch_amalgamated.cpp:1868
friend std::ostream & operator<<(std::ostream &out, TestSpec const &spec)
Definition catch_amalgamated.hpp:3512
friend class TestSpecParser
Definition catch_amalgamated.hpp:3508
std::vector< std::string > vectorStrings
Definition catch_amalgamated.hpp:3497
std::vector< std::string > m_invalidSpecs
Definition catch_amalgamated.hpp:3506
bool hasFilters() const
Definition catch_amalgamated.cpp:1864
Matches matchesByFilter(std::vector< TestCaseHandle > const &testCases, IConfig const &config) const
Definition catch_amalgamated.cpp:1872
const vectorStrings & getInvalidSpecs() const
Definition catch_amalgamated.cpp:1887
void serializeTo(std::ostream &out) const
Serializes this test spec into a string that would be parsed into equivalent test spec.
Definition catch_amalgamated.cpp:1891
std::vector< Filter > m_filters
Definition catch_amalgamated.hpp:3505
Definition catch_amalgamated.hpp:5855
auto getElapsedSeconds() const -> double
Definition catch_amalgamated.cpp:1928
void start()
Definition catch_amalgamated.cpp:1916
auto getElapsedMilliseconds() const -> unsigned int
Definition catch_amalgamated.cpp:1925
auto getElapsedMicroseconds() const -> uint64_t
Definition catch_amalgamated.cpp:1922
auto getElapsedNanoseconds() const -> uint64_t
Definition catch_amalgamated.cpp:1919
uint64_t m_nanoseconds
Definition catch_amalgamated.hpp:5856
Definition catch_amalgamated.hpp:5410
LhsT m_lhs
Definition catch_amalgamated.hpp:5411
constexpr UnaryExpr(LhsT lhs)
Definition catch_amalgamated.hpp:5418
void streamReconstructedExpression(std::ostream &os) const override
This function has to be overriden by the derived class.
Definition catch_amalgamated.hpp:5413
Definition catch_amalgamated.hpp:3401
std::string m_pattern
Definition catch_amalgamated.hpp:3418
WildcardPattern(std::string const &pattern, CaseSensitive caseSensitivity)
Definition catch_amalgamated.cpp:7786
CaseSensitive m_caseSensitivity
Definition catch_amalgamated.hpp:3416
WildcardPosition m_wildcard
Definition catch_amalgamated.hpp:3417
WildcardPosition
Definition catch_amalgamated.hpp:3402
@ WildcardAtEnd
Definition catch_amalgamated.hpp:3405
@ WildcardAtBothEnds
Definition catch_amalgamated.hpp:3406
@ NoWildcard
Definition catch_amalgamated.hpp:3403
@ WildcardAtStart
Definition catch_amalgamated.hpp:3404
constexpr auto warmup_iterations
Definition catch_amalgamated.hpp:1977
Estimate< double > bootstrap(double confidence_level, double *first, double *last, sample const &resample, double(*estimator)(double const *, double const *))
Definition catch_amalgamated.cpp:447
constexpr auto warmup_seed
Definition catch_amalgamated.hpp:1980
bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, double *first, double *last)
Definition catch_amalgamated.cpp:504
constexpr auto clock_cost_estimation_tick_limit
Definition catch_amalgamated.hpp:1983
TimingOf< Fun, Args... > measure(Fun &&fun, Args &&... args)
Definition catch_amalgamated.hpp:1791
constexpr auto clock_cost_estimation_time_limit
Definition catch_amalgamated.hpp:1982
SampleAnalysis analyse(const IConfig &cfg, FDuration *first, FDuration *last)
Definition catch_amalgamated.cpp:60
TimingOf< Fun, run_for_at_least_argument_t< Clock, Fun > > run_for_at_least(IDuration how_long, const int initial_iterations, Fun &&fun)
Definition catch_amalgamated.hpp:1830
OutlierClassification classify_outliers(double const *first, double const *last)
Definition catch_amalgamated.cpp:384
double weighted_average_quantile(int k, int q, double *first, double *last)
Definition catch_amalgamated.cpp:365
EnvironmentEstimate estimate_clock_resolution(int iterations)
Definition catch_amalgamated.hpp:1993
double erfc_inv(double x)
Definition catch_amalgamated.cpp:426
TimingOf< Fun, int > measure_one(Fun &&fun, int iters, std::false_type)
Definition catch_amalgamated.hpp:1810
int warmup()
Definition catch_amalgamated.hpp:1988
constexpr auto clock_resolution_estimation_time
Definition catch_amalgamated.hpp:1981
constexpr auto clock_cost_estimation_iterations
Definition catch_amalgamated.hpp:1985
constexpr auto clock_cost_estimation_time
Definition catch_amalgamated.hpp:1984
repeater< std::decay_t< Fun > > repeat(Fun &&fun)
Definition catch_amalgamated.hpp:1689
double normal_cdf(double x)
Definition catch_amalgamated.cpp:422
CompleteType_t< FunctionReturnType< Fun, Args... > > complete_invoke(Fun &&fun, Args &&... args)
Definition catch_amalgamated.hpp:1748
typename CompleteType< T >::type CompleteType_t
Definition catch_amalgamated.hpp:1728
EnvironmentEstimate estimate_clock_cost(FDuration resolution)
Definition catch_amalgamated.hpp:2002
double mean(double const *first, double const *last)
Definition catch_amalgamated.cpp:412
void throw_optimized_away_error()
Definition catch_amalgamated.cpp:158
constexpr auto warmup_time
Definition catch_amalgamated.hpp:1978
std::vector< double > sample
Definition catch_amalgamated.hpp:1909
Environment measure_environment()
Definition catch_amalgamated.hpp:2032
std::conditional_t< is_callable< Fun(Chronometer)>::value, Chronometer, int > run_for_at_least_argument_t
Definition catch_amalgamated.hpp:1822
constexpr auto minimum_ticks
Definition catch_amalgamated.hpp:1979
double normal_quantile(double p)
Definition catch_amalgamated.cpp:430
std::vector< double > resolution(int k)
Definition catch_amalgamated.hpp:1958
Definition catch_amalgamated.cpp:44
std::chrono::nanoseconds IDuration
Definition catch_amalgamated.hpp:1001
Detail::ObjectStorage< T, false > destructable_object
Definition catch_amalgamated.hpp:2290
std::chrono::duration< double, std::nano > FDuration
Definition catch_amalgamated.hpp:1002
std::chrono::steady_clock default_clock
Definition catch_amalgamated.hpp:1007
Detail::ObjectStorage< T, true > storage_for
Definition catch_amalgamated.hpp:2287
typename Clock::time_point TimePoint
Definition catch_amalgamated.hpp:1005
auto invoke_deoptimized(Fn &&fn, Args &&... args) -> std::enable_if_t<!std::is_same< void, decltype(fn(args...))>::value >
Definition catch_amalgamated.hpp:1480
Detail::CompleteType_t< FunctionReturnType< Fun > > user_code(Fun &&fun)
Definition catch_amalgamated.hpp:1755
void deoptimize_value(T &&x)
Definition catch_amalgamated.hpp:1475
Timing< Detail::CompleteType_t< FunctionReturnType< Func, Args... > > > TimingOf
Definition catch_amalgamated.hpp:1781
Definition catch_amalgamated.cpp:2667
ResultType
Denotes type of a parsing result.
Definition catch_amalgamated.hpp:4314
@ RuntimeError
Error in parsing inputs.
Definition catch_amalgamated.hpp:4318
@ LogicError
Error in user-specified arguments for construction.
Definition catch_amalgamated.hpp:4316
@ Ok
No errors.
Definition catch_amalgamated.hpp:4315
BasicResult< ParseResultType > ParserResult
Definition catch_amalgamated.hpp:4480
TokenType
Definition catch_amalgamated.hpp:4273
@ Option
Definition catch_amalgamated.hpp:4273
@ Argument
Definition catch_amalgamated.hpp:4273
BasicResult< ParseState > InternalParseResult
Definition catch_amalgamated.hpp:4481
auto invokeLambda(L const &lambda, std::string const &arg) -> ParserResult
Definition catch_amalgamated.hpp:4589
Optionality
Definition catch_amalgamated.hpp:4638
@ Required
Definition catch_amalgamated.hpp:4638
@ Optional
Definition catch_amalgamated.hpp:4638
ParserResult convertInto(std::string const &source, std::string &target)
Definition catch_amalgamated.cpp:2727
BasicResult< void > Result
Definition catch_amalgamated.hpp:4479
ParseResultType
Definition catch_amalgamated.hpp:4223
@ ShortCircuitSame
Definition catch_amalgamated.hpp:4227
@ ShortCircuitAll
Definition catch_amalgamated.hpp:4226
@ Matched
Definition catch_amalgamated.hpp:4224
@ NoMatch
Definition catch_amalgamated.hpp:4225
constexpr accept_many_t accept_many
Definition catch_amalgamated.hpp:4231
Definition catch_amalgamated.cpp:1943
typename make_void< Ts... >::type void_t
Definition catch_amalgamated.hpp:2406
bool directCompare(float lhs, float rhs)
Definition catch_amalgamated.cpp:4281
std::string convertIntoString(StringRef string, bool escapeInvisibles)
Encases `string in quotes, and optionally escapes invisibles.
Definition catch_amalgamated.cpp:1984
std::string convertUnknownEnumToString(E e)
Definition catch_amalgamated.hpp:2586
unique_ptr< T > make_unique(Args &&... args)
Definition catch_amalgamated.hpp:976
std::enable_if_t< !std::is_enum< T >::value &&!std::is_base_of< std::exception, T >::value, std::string > convertUnstreamable(T const &)
Definition catch_amalgamated.hpp:2518
std::vector< StringRef > parseEnums(StringRef enums)
Definition catch_amalgamated.cpp:3893
Catch::Detail::unique_ptr< EnumInfo > makeEnumInfo(StringRef enumName, StringRef allValueNames, std::vector< int > const &values)
Definition catch_amalgamated.cpp:3913
void registerTranslatorImpl(Detail::unique_ptr< IExceptionTranslator > &&translator)
Definition catch_amalgamated.cpp:2247
char const * getEnv(char const *varName)
Definition catch_amalgamated.cpp:4305
constexpr StringRef unprintableString
Definition catch_amalgamated.hpp:2483
std::remove_cv_t< std::remove_reference_t< T > > RemoveCVRef_t
Definition catch_amalgamated.hpp:5281
void registerListenerImpl(Detail::unique_ptr< EventListenerFactory > listenerFactory)
Definition catch_amalgamated.cpp:10943
std::string rawMemoryToString(const void *object, std::size_t size)
Definition catch_amalgamated.cpp:2026
std::string rangeToString(InputIterator first, Sentinel last)
Definition catch_amalgamated.hpp:2775
uint32_t convertToBits(float f)
Definition catch_amalgamated.cpp:4263
std::size_t catch_strnlen(const char *str, std::size_t n)
Definition catch_amalgamated.hpp:2475
std::string stringify(const T &e)
Definition catch_amalgamated.hpp:2581
void registerReporterImpl(std::string const &name, IReporterFactoryPtr reporterPtr)
Definition catch_amalgamated.cpp:10930
void throw_generator_exception(char const *msg)
Throws GeneratorException with the provided message.
Definition catch_amalgamated.cpp:2315
Definition catch_amalgamated.cpp:2310
GeneratorWrapper< DecayedT > value(T &&value)
Definition catch_amalgamated.hpp:7580
auto generate(StringRef generatorName, SourceLineInfo const &lineInfo, L const &generatorExpression) -> typename decltype(generatorExpression())::type
Definition catch_amalgamated.hpp:7678
IGeneratorTracker * createGeneratorTracker(StringRef generatorName, SourceLineInfo lineInfo, GeneratorBasePtr &&generator)
Definition catch_amalgamated.cpp:2326
GeneratorWrapper< std::tuple< std::decay_t< Ts >... > > table(std::initializer_list< std::tuple< std::decay_t< Ts >... > > tuples)
Definition catch_amalgamated.hpp:7646
GeneratorWrapper< T > filter(Predicate &&pred, GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7800
GeneratorWrapper< T > repeat(size_t repeats, GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7856
auto makeGenerators(GeneratorWrapper< T > &&generator, Gs &&... moreGenerators) -> Generators< T >
Definition catch_amalgamated.hpp:7655
Catch::Detail::unique_ptr< GeneratorUntypedBase > GeneratorBasePtr
Definition catch_amalgamated.hpp:1044
IGeneratorTracker * acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const &lineInfo)
Definition catch_amalgamated.cpp:2322
Catch::Detail::unique_ptr< IGenerator< T > > GeneratorPtr
Definition catch_amalgamated.hpp:7520
GeneratorWrapper< std::vector< T > > chunk(size_t size, GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7938
GeneratorWrapper< T > take(size_t target, GeneratorWrapper< T > &&generator)
Definition catch_amalgamated.hpp:7759
GeneratorWrapper< T > map(Func &&function, GeneratorWrapper< U > &&generator)
Definition catch_amalgamated.hpp:7888
GeneratorWrapper< T > values(std::initializer_list< T > values)
Definition catch_amalgamated.hpp:7586
std::string describe_multi_matcher(StringRef combine, std::string const *descriptions_begin, std::string const *descriptions_end)
Definition catch_amalgamated.cpp:8565
FloatingPointKind
Definition catch_amalgamated.cpp:8263
@ Float
Definition catch_amalgamated.cpp:8264
NoneTrueMatcher NoneTrue()
Definition catch_amalgamated.cpp:8444
IsNaNMatcher IsNaN()
Definition catch_amalgamated.cpp:8418
EndsWithMatcher EndsWith(std::string const &str, CaseSensitive caseSensitivity)
Definition catch_amalgamated.cpp:8543
WithinAbsMatcher WithinAbs(double target, double margin)
Definition catch_amalgamated.cpp:8387
StringContainsMatcher ContainsSubstring(std::string const &str, CaseSensitive caseSensitivity)
Definition catch_amalgamated.cpp:8540
ExceptionMessageMatcher Message(std::string const &message)
Definition catch_amalgamated.cpp:8201
AllTrueMatcher AllTrue()
Definition catch_amalgamated.cpp:8440
HasSizeMatcher SizeIs(std::size_t sz)
Definition catch_amalgamated.cpp:8181
WithinRelMatcher WithinRel(double target, double eps)
Definition catch_amalgamated.cpp:8391
WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff)
Definition catch_amalgamated.cpp:8379
AnyTrueMatcher AnyTrue()
Definition catch_amalgamated.cpp:8448
IsEmptyMatcher IsEmpty()
Definition catch_amalgamated.cpp:8177
StringEqualsMatcher Equals(std::string const &str, CaseSensitive caseSensitivity)
Definition catch_amalgamated.cpp:8537
StartsWithMatcher StartsWith(std::string const &str, CaseSensitive caseSensitivity)
Definition catch_amalgamated.cpp:8546
RegexMatcher Matches(std::string const ®ex, CaseSensitive caseSensitivity)
Definition catch_amalgamated.cpp:8550
Column Spacer(size_t spaceWidth)
Definition catch_amalgamated.cpp:7657
Definition catch_amalgamated.cpp:611
Definition catch_amalgamated.cpp:43
std::ostream & cout()
Definition catch_amalgamated.cpp:6445
void toLowerInPlace(std::string &s)
Definition catch_amalgamated.cpp:6476
std::string trim(std::string const &str)
Definition catch_amalgamated.cpp:6490
GenerateFrom
Definition catch_amalgamated.hpp:3645
@ Default
Currently equivalent to RandomDevice, but can change at any point.
Definition catch_amalgamated.hpp:3649
@ RandomDevice
Definition catch_amalgamated.hpp:3647
@ Time
Definition catch_amalgamated.hpp:3646
void cleanUp()
Definition catch_amalgamated.cpp:1151
bool list(IEventListener &reporter, Config const &config)
Definition catch_amalgamated.cpp:4740
bool isThrowSafe(TestCaseHandle const &testCase, IConfig const &config)
Definition catch_amalgamated.cpp:6788
void seedRng(IConfig const &config)
Definition catch_amalgamated.cpp:6296
std::uint32_t generateRandomSeed(GenerateFrom from)
Definition catch_amalgamated.cpp:5290
std::ostream & clog()
Definition catch_amalgamated.cpp:6447
auto operator+=(std::string &lhs, StringRef rhs) -> std::string &
Definition catch_amalgamated.cpp:6613
void throw_test_failure_exception()
Definition catch_amalgamated.cpp:7071
void handleExceptionMatchExpr(AssertionHandler &handler, std::string const &str)
Definition catch_amalgamated.cpp:2589
Detail::unique_ptr< ITestInvoker > makeTestInvokerFixture(void(C::*testAsMethod)() const)
Definition catch_amalgamated.hpp:6048
bool operator==(ProcessedReporterSpec const &lhs, ProcessedReporterSpec const &rhs)
Definition catch_amalgamated.cpp:793
void defaultListTags(std::ostream &out, std::vector< TagInfo > const &tags, bool isFiltered)
Definition catch_amalgamated.cpp:9911
Version const & libraryVersion()
Definition catch_amalgamated.cpp:2285
Optional< unsigned int > parseUInt(std::string const &input, int base)
Definition catch_amalgamated.cpp:5147
auto makeStream(std::string const &filename) -> Detail::unique_ptr< IStream >
Definition catch_amalgamated.cpp:4445
std::remove_reference_t< std::remove_cv_t< std::result_of_t< Func(U...)> > > FunctionReturnType
Definition catch_amalgamated.hpp:1524
void throw_exception(std::exception const &e)
Definition catch_amalgamated.cpp:3844
Detail::unique_ptr< ITestInvoker > makeTestInvoker(void(*testAsFunction)())
Definition catch_amalgamated.cpp:7141
void throw_runtime_error(std::string const &msg)
Definition catch_amalgamated.cpp:3862
bool uncaught_exceptions()
Definition catch_amalgamated.cpp:7771
constexpr bool isOk(ResultWas::OfType resultType)
Definition catch_amalgamated.hpp:842
void formatReconstructedExpression(std::ostream &os, std::string const &lhs, StringRef op, std::string const &rhs)
Definition catch_amalgamated.cpp:3826
std::ostream & cerr()
Definition catch_amalgamated.cpp:6446
IMutableRegistryHub & getMutableRegistryHub()
Definition catch_amalgamated.cpp:1148
IRegistryHub const & getRegistryHub()
Definition catch_amalgamated.cpp:1145
constexpr bool shouldSuppressFailure(int flags)
Definition catch_amalgamated.hpp:866
constexpr ResultDisposition::Flags operator|(ResultDisposition::Flags lhs, ResultDisposition::Flags rhs)
Definition catch_amalgamated.hpp:857
Detail::unique_ptr< ColourImpl > makeColourImpl(ColourMode colourSelection, IStream *stream)
Definition catch_amalgamated.cpp:3591
std::vector< StringRef > splitStringRef(StringRef str, char delimiter)
Definition catch_amalgamated.cpp:6536
bool startsWith(std::string const &s, std::string const &prefix)
Definition catch_amalgamated.cpp:6461
constexpr bool isFalseTest(int flags)
Definition catch_amalgamated.hpp:863
void defaultListTests(std::ostream &out, ColourImpl *streamColour, std::vector< TestCaseHandle > const &tests, bool isFiltered, Verbosity verbosity)
Definition catch_amalgamated.cpp:9933
void throw_logic_error(std::string const &msg)
Definition catch_amalgamated.cpp:3852
bool isRedirectAvailable(OutputRedirect::Kind kind)
Definition catch_amalgamated.cpp:5047
bool isColourImplAvailable(ColourMode colourSelection)
Definition catch_amalgamated.cpp:3620
void addSingleton(ISingleton *singleton)
Definition catch_amalgamated.cpp:6374
Detail::unique_ptr< IReporterFactory > IReporterFactoryPtr
Definition catch_amalgamated.hpp:1258
void throw_test_skip_exception()
Definition catch_amalgamated.cpp:7079
std::string(*)() exceptionTranslateFunction
Definition catch_amalgamated.hpp:7217
void defaultListReporters(std::ostream &out, std::vector< ReporterDescription > const &descriptions, Verbosity verbosity)
Definition catch_amalgamated.cpp:9846
Context const & getCurrentContext()
Definition catch_amalgamated.hpp:587
void cleanupSingletons()
Definition catch_amalgamated.cpp:6377
void defaultListListeners(std::ostream &out, std::vector< ListenerDescription > const &descriptions)
Definition catch_amalgamated.cpp:9879
ColourMode
Definition catch_amalgamated.hpp:1177
@ None
Don't use any colour.
Definition catch_amalgamated.hpp:1185
@ PlatformDefault
Let Catch2 pick implementation based on platform detection.
Definition catch_amalgamated.hpp:1179
@ Win32
Use Win32 console colour API.
Definition catch_amalgamated.hpp:1183
@ ANSI
Use ANSI colour code escapes.
Definition catch_amalgamated.hpp:1181
SimplePcg32 & sharedRng()
Definition catch_amalgamated.cpp:3662
bool contains(std::string const &s, std::string const &infix)
Definition catch_amalgamated.cpp:6473
void writeToDebugConsole(std::string const &text)
Definition catch_amalgamated.cpp:3695
TestCaseProperties
Definition catch_amalgamated.hpp:7108
@ None
Definition catch_amalgamated.hpp:7109
@ IsHidden
Definition catch_amalgamated.hpp:7110
@ Benchmark
Definition catch_amalgamated.hpp:7115
@ Throws
Definition catch_amalgamated.hpp:7113
@ ShouldFail
Definition catch_amalgamated.hpp:7111
@ NonPortable
Definition catch_amalgamated.hpp:7114
@ MayFail
Definition catch_amalgamated.hpp:7112
TestRunOrder
Definition catch_amalgamated.hpp:1172
@ Declared
Definition catch_amalgamated.hpp:1173
@ LexicographicallySorted
Definition catch_amalgamated.hpp:1174
@ Randomized
Definition catch_amalgamated.hpp:1175
std::vector< TestCaseHandle > const & getAllTestCasesSorted(IConfig const &config)
Definition catch_amalgamated.cpp:6803
bool isDebuggerActive()
Definition catch_amalgamated.cpp:3810
bool operator!=(SimplePcg32 const &lhs, SimplePcg32 const &rhs)
Definition catch_amalgamated.cpp:5276
std::uint32_t getSeed()
Returns Catch2's current RNG seed.
Definition catch_amalgamated.cpp:962
std::string toLower(std::string const &s)
Definition catch_amalgamated.cpp:6481
CaseSensitive
Definition catch_amalgamated.hpp:3371
@ Yes
Definition catch_amalgamated.hpp:3371
@ No
Definition catch_amalgamated.hpp:3371
std::vector< Detail::unique_ptr< IExceptionTranslator const > > ExceptionTranslators
Definition catch_amalgamated.hpp:7220
unsigned int rngSeed()
Definition catch_amalgamated.cpp:6300
constexpr bool isJustInfo(int flags)
Definition catch_amalgamated.hpp:845
std::vector< TestCaseHandle > sortTests(IConfig const &config, std::vector< TestCaseHandle > const &unsortedTestCases)
Definition catch_amalgamated.cpp:6737
bool endsWith(std::string const &s, std::string const &suffix)
Definition catch_amalgamated.cpp:6467
std::string translateActiveException()
Definition catch_amalgamated.cpp:1155
std::string operator+(StringRef lhs, StringRef rhs)
Definition catch_amalgamated.cpp:6605
void cleanUpContext()
Definition catch_amalgamated.cpp:3648
std::string serializeFilters(std::vector< std::string > const &filters)
Definition catch_amalgamated.cpp:9816
float nextafter(float x, float y)
Definition catch_amalgamated.cpp:5211
void throw_domain_error(std::string const &msg)
Definition catch_amalgamated.cpp:3857
Detail::unique_ptr< OutputRedirect > makeOutputRedirect(bool actual)
Definition catch_amalgamated.cpp:5062
Context & getCurrentMutableContext()
Definition catch_amalgamated.cpp:3656
void printTestRunTotals(std::ostream &stream, ColourImpl &streamColour, Totals const &totals)
Definition catch_amalgamated.cpp:10033
bool shouldShowDuration(IConfig const &config, double duration)
Definition catch_amalgamated.cpp:9805
std::string rangeToString(Range const &range)
Definition catch_amalgamated.hpp:2936
std::vector< TestCaseHandle > filterTests(std::vector< TestCaseHandle > const &testCases, TestSpec const &testSpec, IConfig const &config)
Definition catch_amalgamated.cpp:6792
std::string getFormattedDuration(double duration)
Definition catch_amalgamated.cpp:9785
IResultCapture & getResultCapture()
Definition catch_amalgamated.cpp:6289
Verbosity
Definition catch_amalgamated.hpp:1153
@ Quiet
Definition catch_amalgamated.hpp:1154
@ High
Definition catch_amalgamated.hpp:1156
@ Normal
Definition catch_amalgamated.hpp:1155
ShowDurations
Definition catch_amalgamated.hpp:1167
@ DefaultForReporter
Definition catch_amalgamated.hpp:1168
@ Always
Definition catch_amalgamated.hpp:1169
@ Never
Definition catch_amalgamated.hpp:1170
bool replaceInPlace(std::string &str, std::string const &replaceThis, std::string const &withThis)
Definition catch_amalgamated.cpp:6510
bool isnan(float f)
Definition catch_amalgamated.cpp:5191
void close()
Definition matplotlibcpp.h:2567
void text(Numeric x, Numeric y, const std::string &s="")
Definition matplotlibcpp.h:1834
Definition catch_amalgamated.hpp:1529
Definition catch_amalgamated.hpp:3267
SourceLineInfo lineInfo
Definition catch_amalgamated.hpp:3271
ResultDisposition::Flags resultDisposition
Definition catch_amalgamated.hpp:3273
StringRef macroName
Definition catch_amalgamated.hpp:3270
StringRef capturedExpression
Definition catch_amalgamated.hpp:3272
Definition catch_amalgamated.hpp:5611
bool shouldThrow
Definition catch_amalgamated.hpp:5613
bool shouldSkip
Definition catch_amalgamated.hpp:5614
bool shouldDebugBreak
Definition catch_amalgamated.hpp:5612
Definition catch_amalgamated.hpp:3325
std::string reconstructExpression() const
Definition catch_amalgamated.cpp:634
ResultWas::OfType resultType
Definition catch_amalgamated.hpp:3333
AssertionResultData()=delete
std::string reconstructedExpression
Definition catch_amalgamated.hpp:3331
std::string message
Definition catch_amalgamated.hpp:3330
LazyExpression lazyExpression
Definition catch_amalgamated.hpp:3332
AutoReg(Detail::unique_ptr< ITestInvoker > invoker, SourceLineInfo const &lineInfo, StringRef classOrMethod, NameAndTags const &nameAndTags) noexcept
Definition catch_amalgamated.cpp:7145
Definition catch_amalgamated.hpp:1350
double clockCost
Definition catch_amalgamated.hpp:1357
unsigned int samples
Definition catch_amalgamated.hpp:1354
unsigned int resamples
Definition catch_amalgamated.hpp:1355
int iterations
Definition catch_amalgamated.hpp:1353
double estimatedDuration
Definition catch_amalgamated.hpp:1352
std::string name
Definition catch_amalgamated.hpp:1351
double clockResolution
Definition catch_amalgamated.hpp:1356
Definition catch_amalgamated.hpp:1363
Benchmark::OutlierClassification outliers
Definition catch_amalgamated.hpp:1369
Benchmark::Estimate< Benchmark::FDuration > standardDeviation
Definition catch_amalgamated.hpp:1368
double outlierVariance
Definition catch_amalgamated.hpp:1370
std::vector< Benchmark::FDuration > samples
Definition catch_amalgamated.hpp:1366
BenchmarkInfo info
Definition catch_amalgamated.hpp:1364
Benchmark::Estimate< Benchmark::FDuration > mean
Definition catch_amalgamated.hpp:1367
Detail::BenchmarkFunction fun
Definition catch_amalgamated.hpp:2185
Benchmark & operator=(Fun func)
Definition catch_amalgamated.hpp:2171
Benchmark(std::string &&benchmarkName, FUN &&func)
Definition catch_amalgamated.hpp:2114
std::string name
Definition catch_amalgamated.hpp:2186
Benchmark(std::string &&benchmarkName)
Definition catch_amalgamated.hpp:2110
void run()
Definition catch_amalgamated.hpp:2127
ExecutionPlan prepare(const IConfig &cfg, Environment env)
Definition catch_amalgamated.hpp:2118
Definition catch_amalgamated.hpp:1562
int runs() const
Definition catch_amalgamated.hpp:1567
void measure(Fun &&fun)
Definition catch_amalgamated.hpp:1565
Chronometer(Detail::ChronometerConcept &meter, int repeats_)
Definition catch_amalgamated.hpp:1569
void measure(Fun &&fun, std::true_type)
Definition catch_amalgamated.hpp:1580
Detail::ChronometerConcept * impl
Definition catch_amalgamated.hpp:1588
int repeats
Definition catch_amalgamated.hpp:1589
void measure(Fun &&fun, std::false_type)
Definition catch_amalgamated.hpp:1575
callable & operator=(callable &&)=default
virtual void call(Chronometer meter) const =0
callable(callable &&)=default
Definition catch_amalgamated.hpp:1623
void call(Chronometer meter, std::true_type) const
Definition catch_amalgamated.hpp:1630
void call(Chronometer meter) const override
Definition catch_amalgamated.hpp:1627
model(Fun &&fun_)
Definition catch_amalgamated.hpp:1624
void call(Chronometer meter, std::false_type) const
Definition catch_amalgamated.hpp:1633
model(Fun const &fun_)
Definition catch_amalgamated.hpp:1625
Fun fun
Definition catch_amalgamated.hpp:1637
Definition catch_amalgamated.hpp:1612
BenchmarkFunction & operator=(BenchmarkFunction &&that) noexcept
Definition catch_amalgamated.hpp:1652
BenchmarkFunction()
Definition catch_amalgamated.cpp:136
BenchmarkFunction(BenchmarkFunction &&that) noexcept
Definition catch_amalgamated.hpp:1648
BenchmarkFunction(Fun &&fun)
Definition catch_amalgamated.hpp:1645
Catch::Detail::unique_ptr< callable > f
Definition catch_amalgamated.hpp:1660
void operator()(Chronometer meter) const
Definition catch_amalgamated.hpp:1657
Definition catch_amalgamated.hpp:1538
virtual ~ChronometerConcept()
ChronometerConcept & operator=(ChronometerConcept const &)=default
ChronometerConcept(ChronometerConcept const &)=default
ChronometerConcept()=default
Definition catch_amalgamated.hpp:1548
void finish() override
Definition catch_amalgamated.hpp:1550
TimePoint< Clock > started
Definition catch_amalgamated.hpp:1557
void start() override
Definition catch_amalgamated.hpp:1549
IDuration elapsed() const
Definition catch_amalgamated.hpp:1552
TimePoint< Clock > finished
Definition catch_amalgamated.hpp:1558
static CompleteType_t< void > invoke(Fun &&fun, Args &&... args)
Definition catch_amalgamated.hpp:1740
Definition catch_amalgamated.hpp:1731
static Result invoke(Fun &&fun, Args &&... args)
Definition catch_amalgamated.hpp:1733
Definition catch_amalgamated.hpp:1725
Definition catch_amalgamated.hpp:1723
T type
Definition catch_amalgamated.hpp:1723
Definition catch_amalgamated.hpp:2234
ObjectStorage(const ObjectStorage &other)
Definition catch_amalgamated.hpp:2237
ObjectStorage(ObjectStorage &&other)
Definition catch_amalgamated.hpp:2242
~ObjectStorage()
Definition catch_amalgamated.hpp:2247
T const & stored_object() const
Definition catch_amalgamated.hpp:2275
void destruct_on_exit(std::enable_if_t< Destruct, U > *=nullptr)
Definition catch_amalgamated.hpp:2264
unsigned char data[sizeof(T)]
Definition catch_amalgamated.hpp:2282
std::enable_if_t< AllowManualDestruction > destruct()
Definition catch_amalgamated.hpp:2256
T & stored_object()
Definition catch_amalgamated.hpp:2273
void destruct_on_exit(std::enable_if_t<!Destruct, U > *=nullptr)
Definition catch_amalgamated.hpp:2267
void construct(Args &&... args)
Definition catch_amalgamated.hpp:2250
Definition catch_amalgamated.hpp:1934
Estimate< double > standard_deviation
Definition catch_amalgamated.hpp:1936
double outlier_variance
Definition catch_amalgamated.hpp:1937
Estimate< double > mean
Definition catch_amalgamated.hpp:1935
Definition catch_amalgamated.hpp:1680
void operator()(int k) const
Definition catch_amalgamated.hpp:1681
Fun fun
Definition catch_amalgamated.hpp:1686
Definition catch_amalgamated.hpp:1387
OutlierClassification outliers
Definition catch_amalgamated.hpp:1389
FDuration mean
Definition catch_amalgamated.hpp:1388
Definition catch_amalgamated.hpp:1391
EnvironmentEstimate clock_cost
Definition catch_amalgamated.hpp:1393
EnvironmentEstimate clock_resolution
Definition catch_amalgamated.hpp:1392
Definition catch_amalgamated.hpp:1308
Type lower_bound
Definition catch_amalgamated.hpp:1310
Type point
Definition catch_amalgamated.hpp:1309
double confidence_interval
Definition catch_amalgamated.hpp:1312
Type upper_bound
Definition catch_amalgamated.hpp:1311
Definition catch_amalgamated.hpp:1854
Detail::BenchmarkFunction benchmark
Definition catch_amalgamated.hpp:1857
FDuration warmup_time
Definition catch_amalgamated.hpp:1858
int iterations_per_sample
Definition catch_amalgamated.hpp:1855
std::vector< FDuration > run(const IConfig &cfg, Environment env) const
Definition catch_amalgamated.hpp:1862
int warmup_iterations
Definition catch_amalgamated.hpp:1859
FDuration estimated_duration
Definition catch_amalgamated.hpp:1856
Definition catch_amalgamated.hpp:1327
int high_severe
Definition catch_amalgamated.hpp:1332
int high_mild
Definition catch_amalgamated.hpp:1331
constexpr int total() const
Definition catch_amalgamated.hpp:1334
int low_severe
Definition catch_amalgamated.hpp:1329
int low_mild
Definition catch_amalgamated.hpp:1330
int samples_seen
Definition catch_amalgamated.hpp:1328
Definition catch_amalgamated.hpp:2076
double outlier_variance
Definition catch_amalgamated.hpp:2081
OutlierClassification outliers
Definition catch_amalgamated.hpp:2080
Estimate< FDuration > standard_deviation
Definition catch_amalgamated.hpp:2079
Estimate< FDuration > mean
Definition catch_amalgamated.hpp:2078
std::vector< FDuration > samples
Definition catch_amalgamated.hpp:2077
Definition catch_amalgamated.hpp:1775
int iterations
Definition catch_amalgamated.hpp:1778
IDuration elapsed
Definition catch_amalgamated.hpp:1776
Detail::CompleteType_t< FunctionReturnType< Func, Args... > > result
Definition catch_amalgamated.hpp:1777
BoundFlagLambda(L const &lambda)
Definition catch_amalgamated.hpp:4629
L m_lambda
Definition catch_amalgamated.hpp:4619
auto setFlag(bool flag) -> ParserResult override
Definition catch_amalgamated.hpp:4632
Definition catch_amalgamated.hpp:4526
bool isFlag() const override
Definition catch_amalgamated.cpp:2772
virtual auto setFlag(bool flag) -> ParserResult=0
bool & m_ref
Definition catch_amalgamated.hpp:4560
BoundFlagRef(bool &ref)
Definition catch_amalgamated.hpp:4562
Definition catch_amalgamated.hpp:4598
BoundLambda(L const &lambda)
Definition catch_amalgamated.hpp:4604
auto setValue(std::string const &arg) -> ParserResult override
Definition catch_amalgamated.hpp:4606
L m_lambda
Definition catch_amalgamated.hpp:4599
Definition catch_amalgamated.hpp:4613
BoundManyLambda(L const &lambda)
Definition catch_amalgamated.hpp:4614
bool isContainer() const override
Definition catch_amalgamated.hpp:4615
Definition catch_amalgamated.hpp:4517
virtual bool isContainer() const
Definition catch_amalgamated.cpp:2768
virtual ~BoundRef()=default
virtual bool isFlag() const
Definition catch_amalgamated.cpp:2770
Definition catch_amalgamated.hpp:4522
virtual auto setValue(std::string const &arg) -> ParserResult=0
BoundValueRef(std::vector< T > &ref)
Definition catch_amalgamated.hpp:4545
auto isContainer() const -> bool override
Definition catch_amalgamated.hpp:4547
std::vector< T > & m_ref
Definition catch_amalgamated.hpp:4543
auto setValue(std::string const &arg) -> ParserResult override
Definition catch_amalgamated.hpp:4549
Definition catch_amalgamated.hpp:4531
ParserResult setValue(std::string const &arg) override
Definition catch_amalgamated.hpp:4536
T & m_ref
Definition catch_amalgamated.hpp:4532
BoundValueRef(T &ref)
Definition catch_amalgamated.hpp:4534
Definition catch_amalgamated.hpp:4483
StringRef descriptions
Definition catch_amalgamated.hpp:4485
std::string left
Definition catch_amalgamated.hpp:4484
static auto invoke(L const &lambda, ArgType const &arg) -> ParserResult
Definition catch_amalgamated.hpp:4581
Definition catch_amalgamated.hpp:4567
static auto invoke(L const &lambda, ArgType const &arg) -> ParserResult
Definition catch_amalgamated.hpp:4573
Definition catch_amalgamated.hpp:4274
TokenType type
Definition catch_amalgamated.hpp:4275
StringRef token
Definition catch_amalgamated.hpp:4276
static const bool isValid
Definition catch_amalgamated.hpp:4263
ReturnT ReturnType
Definition catch_amalgamated.hpp:4265
std::remove_const_t< std::remove_reference_t< ArgT > > ArgType
Definition catch_amalgamated.hpp:4264
static const bool isValid
Definition catch_amalgamated.hpp:4258
Definition catch_amalgamated.hpp:4254
Definition catch_amalgamated.hpp:4234
Definition catch_amalgamated.hpp:4240
Help(bool &showHelpFlag)
Definition catch_amalgamated.cpp:3063
Definition catch_amalgamated.hpp:4230
Definition catch_amalgamated.hpp:3762
bool listTests
Definition catch_amalgamated.hpp:3764
bool benchmarkNoAnalysis
Definition catch_amalgamated.hpp:3785
bool showHelp
Definition catch_amalgamated.hpp:3772
std::chrono::milliseconds::rep benchmarkWarmupTime
Definition catch_amalgamated.hpp:3789
bool allowZeroTests
Definition catch_amalgamated.hpp:3776
std::vector< ReporterSpec > reporterSpecifications
Definition catch_amalgamated.hpp:3802
bool libIdentify
Definition catch_amalgamated.hpp:3775
int abortAfter
Definition catch_amalgamated.hpp:3778
bool showInvisibles
Definition catch_amalgamated.hpp:3773
unsigned int benchmarkResamples
Definition catch_amalgamated.hpp:3788
bool listReporters
Definition catch_amalgamated.hpp:3766
bool listListeners
Definition catch_amalgamated.hpp:3767
bool filenamesAsTags
Definition catch_amalgamated.hpp:3774
TestRunOrder runOrder
Definition catch_amalgamated.hpp:3795
bool skipBenchmarks
Definition catch_amalgamated.hpp:3784
std::string name
Definition catch_amalgamated.hpp:3800
bool noThrow
Definition catch_amalgamated.hpp:3771
std::vector< std::string > sectionsToRun
Definition catch_amalgamated.hpp:3805
ShowDurations showDurations
Definition catch_amalgamated.hpp:3793
unsigned int shardCount
Definition catch_amalgamated.hpp:3781
ColourMode defaultColourMode
Definition catch_amalgamated.hpp:3796
WaitForKeypress::When waitForKeypress
Definition catch_amalgamated.hpp:3797
std::vector< std::string > testsOrTags
Definition catch_amalgamated.hpp:3804
Verbosity verbosity
Definition catch_amalgamated.hpp:3791
uint32_t rngSeed
Definition catch_amalgamated.hpp:3779
double benchmarkConfidenceInterval
Definition catch_amalgamated.hpp:3787
std::string processName
Definition catch_amalgamated.hpp:3801
std::string defaultOutputFilename
Definition catch_amalgamated.hpp:3799
double minDuration
Definition catch_amalgamated.hpp:3794
unsigned int benchmarkSamples
Definition catch_amalgamated.hpp:3786
bool showSuccessfulTests
Definition catch_amalgamated.hpp:3769
WarnAbout::What warnings
Definition catch_amalgamated.hpp:3792
unsigned int shardIndex
Definition catch_amalgamated.hpp:3782
bool listTags
Definition catch_amalgamated.hpp:3765
bool shouldDebugBreak
Definition catch_amalgamated.hpp:3770
Definition catch_amalgamated.hpp:4116
bool allOk() const
Definition catch_amalgamated.cpp:2210
std::uint64_t skipped
Definition catch_amalgamated.hpp:4127
std::uint64_t total() const
Definition catch_amalgamated.cpp:2204
bool allPassed() const
Definition catch_amalgamated.cpp:2207
std::uint64_t failed
Definition catch_amalgamated.hpp:4125
std::uint64_t passed
Definition catch_amalgamated.hpp:4124
std::uint64_t failedButOk
Definition catch_amalgamated.hpp:4126
Definition catch_amalgamated.hpp:5579
Definition catch_amalgamated.hpp:2424
StringRef m_name
Definition catch_amalgamated.hpp:2425
StringRef lookup(int value) const
Definition catch_amalgamated.cpp:3905
std::vector< std::pair< int, StringRef > > m_values
Definition catch_amalgamated.hpp:2426
Definition catch_amalgamated.hpp:5144
Definition catch_amalgamated.hpp:5150
Definition catch_amalgamated.hpp:2919
Definition catch_amalgamated.hpp:2403
void type
Definition catch_amalgamated.hpp:2403
Definition catch_amalgamated.hpp:5157
Definition catch_amalgamated.hpp:7652
Definition catch_amalgamated.hpp:3989
MessageBuilder(StringRef macroName, SourceLineInfo const &lineInfo, ResultWas::OfType type)
Definition catch_amalgamated.hpp:3990
MessageInfo m_info
Definition catch_amalgamated.hpp:4001
Definition catch_amalgamated.hpp:3945
static unsigned int globalCount
Definition catch_amalgamated.hpp:3963
StringRef macroName
Definition catch_amalgamated.hpp:3950
unsigned int sequence
Definition catch_amalgamated.hpp:3954
SourceLineInfo lineInfo
Definition catch_amalgamated.hpp:3952
std::string message
Definition catch_amalgamated.hpp:3951
ResultWas::OfType type
Definition catch_amalgamated.hpp:3953
MessageInfo(StringRef _macroName, SourceLineInfo const &_lineInfo, ResultWas::OfType _type)
Definition catch_amalgamated.cpp:4797
Definition catch_amalgamated.hpp:3978
ReusableStringStream m_stream
Definition catch_amalgamated.hpp:3986
Definition catch_amalgamated.hpp:3749
std::string outputFilename
Definition catch_amalgamated.hpp:3751
friend bool operator!=(ProcessedReporterSpec const &lhs, ProcessedReporterSpec const &rhs)
Definition catch_amalgamated.hpp:3756
std::string name
Definition catch_amalgamated.hpp:3750
std::map< std::string, std::string > customOptions
Definition catch_amalgamated.hpp:3753
ColourMode colourMode
Definition catch_amalgamated.hpp:3752
friend bool operator==(ProcessedReporterSpec const &lhs, ProcessedReporterSpec const &rhs)
Definition catch_amalgamated.cpp:793
RegistrarForTagAliases(char const *alias, char const *tag, SourceLineInfo const &lineInfo)
Definition catch_amalgamated.cpp:1511
Definition catch_amalgamated.hpp:849
Flags
Definition catch_amalgamated.hpp:849
@ SuppressFail
Definition catch_amalgamated.hpp:854
@ FalseTest
Definition catch_amalgamated.hpp:853
@ ContinueOnFailure
Definition catch_amalgamated.hpp:852
@ Normal
Definition catch_amalgamated.hpp:850
Definition catch_amalgamated.hpp:820
OfType
Definition catch_amalgamated.hpp:820
@ FailureBit
Definition catch_amalgamated.hpp:828
@ Info
Definition catch_amalgamated.hpp:823
@ ThrewException
Definition catch_amalgamated.hpp:835
@ ExpressionFailed
Definition catch_amalgamated.hpp:830
@ Unknown
Definition catch_amalgamated.hpp:821
@ Warning
Definition catch_amalgamated.hpp:824
@ FatalErrorCondition
Definition catch_amalgamated.hpp:838
@ DidntThrowException
Definition catch_amalgamated.hpp:836
@ ExplicitSkip
Definition catch_amalgamated.hpp:826
@ Exception
Definition catch_amalgamated.hpp:833
@ ExplicitFailure
Definition catch_amalgamated.hpp:831
@ Ok
Definition catch_amalgamated.hpp:822
Definition catch_amalgamated.hpp:4162
SectionInfo sectionInfo
Definition catch_amalgamated.hpp:4163
double durationInSeconds
Definition catch_amalgamated.hpp:4165
Counts prevAssertions
Definition catch_amalgamated.hpp:4164
Definition catch_amalgamated.hpp:4148
SectionInfo(SourceLineInfo const &_lineInfo, std::string _name, const char *const =nullptr)
Definition catch_amalgamated.hpp:4152
std::string name
Definition catch_amalgamated.hpp:4158
SourceLineInfo lineInfo
Definition catch_amalgamated.hpp:4159
Definition catch_amalgamated.hpp:3242
constexpr SourceLineInfo(char const *_file, std::size_t _line) noexcept
Definition catch_amalgamated.hpp:3245
std::size_t line
Definition catch_amalgamated.hpp:3254
char const * file
Definition catch_amalgamated.hpp:3253
Definition catch_amalgamated.hpp:3923
constexpr friend T const & operator+(T const &value, StreamEndStop)
Definition catch_amalgamated.hpp:3927
constexpr StringRef operator+() const
Definition catch_amalgamated.hpp:3924
static std::string convert(Catch::Approx const &value)
Definition catch_amalgamated.cpp:620
static std::string convert(R const &range)
Definition catch_amalgamated.hpp:2959
static std::string convert(R C::*p)
Definition catch_amalgamated.hpp:2755
static std::string convert(U *p)
Definition catch_amalgamated.hpp:2744
static std::string convert(T const(&arr)[SZ])
Definition catch_amalgamated.hpp:2966
static std::string convert(bool b)
Definition catch_amalgamated.hpp:2702
static std::string convert(char c)
Definition catch_amalgamated.cpp:2162
static std::string convert(char *str)
Definition catch_amalgamated.cpp:2068
static std::string convert(char const *str)
static std::string convert(char const *str)
Definition catch_amalgamated.hpp:2647
static std::string convert(double value)
Definition catch_amalgamated.cpp:2177
static CATCH_EXPORT int precision
Definition catch_amalgamated.hpp:2738
static std::string convert(float value)
Definition catch_amalgamated.cpp:2171
static CATCH_EXPORT int precision
Definition catch_amalgamated.hpp:2732
static std::string convert(int value)
Definition catch_amalgamated.cpp:2115
static std::string convert(long value)
Definition catch_amalgamated.cpp:2118
static std::string convert(long long value)
static std::string convert(signed char value)
static std::string convert(signed char const *str)
Definition catch_amalgamated.hpp:2654
static std::string convert(std::chrono::duration< Value, Ratio > const &duration)
Definition catch_amalgamated.hpp:3021
static std::string convert(std::chrono::duration< Value, std::ratio< 1 > > const &duration)
Definition catch_amalgamated.hpp:3029
static std::string convert(std::chrono::duration< Value, std::ratio< 3600 > > const &duration)
Definition catch_amalgamated.hpp:3045
static std::string convert(std::chrono::duration< Value, std::ratio< 60 > > const &duration)
Definition catch_amalgamated.hpp:3037
static std::string convert(std::chrono::time_point< Clock, Duration > const &time_point)
Definition catch_amalgamated.hpp:3057
static std::string convert(std::chrono::time_point< std::chrono::system_clock, Duration > const &time_point)
Definition catch_amalgamated.hpp:3064
static std::string convert(std::nullptr_t)
Definition catch_amalgamated.hpp:2723
static std::string convert(const std::string &str)
Definition catch_amalgamated.cpp:2051
static std::string convert(const std::wstring &wstr)
Definition catch_amalgamated.cpp:2077
static std::string convert(unsigned char value)
static std::string convert(unsigned char const *str)
Definition catch_amalgamated.hpp:2662
static std::string convert(unsigned int value)
static std::string convert(unsigned long value)
static std::string convert(unsigned long long value)
static std::string convert(wchar_t *str)
Definition catch_amalgamated.cpp:2099
static std::string convert(wchar_t const *str)
Definition catch_amalgamated.hpp:2552
static std::enable_if_t<!::Catch::Detail::IsStreamInsertable< Fake >::value, std::string > convert(const Fake &value)
Definition catch_amalgamated.hpp:2567
static std::enable_if_t<::Catch::Detail::IsStreamInsertable< Fake >::value, std::string > convert(const Fake &value)
Definition catch_amalgamated.hpp:2556
SourceLineInfo lineInfo
Definition catch_amalgamated.hpp:4996
std::string tag
Definition catch_amalgamated.hpp:4995
TagAlias(std::string const &_tag, SourceLineInfo _lineInfo)
Definition catch_amalgamated.hpp:4990
constexpr Tag(StringRef original_)
Definition catch_amalgamated.hpp:7096
friend bool operator==(Tag const &lhs, Tag const &rhs)
Definition catch_amalgamated.cpp:1622
StringRef original
Definition catch_amalgamated.hpp:7099
Definition catch_amalgamated.hpp:7127
TestCaseInfo(StringRef _className, NameAndTags const &_nameAndTags, SourceLineInfo const &_lineInfo)
Definition catch_amalgamated.cpp:1634
std::string tagsAsString() const
Definition catch_amalgamated.cpp:1731
std::vector< Tag > tags
Definition catch_amalgamated.hpp:7156
StringRef className
Definition catch_amalgamated.hpp:7149
std::string name
Definition catch_amalgamated.hpp:7148
bool okToFail() const
Definition catch_amalgamated.cpp:1718
TestCaseProperties properties
Definition catch_amalgamated.hpp:7158
bool isHidden() const
Definition catch_amalgamated.cpp:1712
friend bool operator<(TestCaseInfo const &lhs, TestCaseInfo const &rhs)
Orders by name, classname and tags.
Definition catch_amalgamated.cpp:1757
std::string backingTags
Definition catch_amalgamated.hpp:7151
SourceLineInfo lineInfo
Definition catch_amalgamated.hpp:7157
bool expectedToFail() const
Definition catch_amalgamated.cpp:1721
void addFilenameTag()
Definition catch_amalgamated.cpp:1725
void internalAppendTag(StringRef tagString)
Definition catch_amalgamated.cpp:1748
Used to signal that an assertion macro failed.
Definition catch_amalgamated.hpp:624
Used to signal that the remainder of a test should be skipped.
Definition catch_amalgamated.hpp:626
Definition catch_amalgamated.hpp:3492
std::string name
Definition catch_amalgamated.hpp:3493
std::vector< TestCaseHandle const * > tests
Definition catch_amalgamated.hpp:3494
Definition catch_amalgamated.hpp:3474
std::vector< Detail::unique_ptr< Pattern > > m_required
Definition catch_amalgamated.hpp:3475
std::vector< Detail::unique_ptr< Pattern > > m_forbidden
Definition catch_amalgamated.hpp:3476
friend std::ostream & operator<<(std::ostream &out, Filter const &f)
Definition catch_amalgamated.hpp:3481
void serializeTo(std::ostream &out) const
Serializes this filter into a string that would be parsed into an equivalent filter.
Definition catch_amalgamated.cpp:1839
Definition catch_amalgamated.hpp:4130
Totals delta(Totals const &prevTotals) const
Definition catch_amalgamated.cpp:2227
Counts assertions
Definition catch_amalgamated.hpp:4137
Counts testCases
Definition catch_amalgamated.hpp:4138
Definition catch_amalgamated.hpp:7322
unsigned int const buildNumber
Definition catch_amalgamated.hpp:7337
char const *const branchName
Definition catch_amalgamated.hpp:7336
Version & operator=(Version const &)=delete
unsigned int const minorVersion
Definition catch_amalgamated.hpp:7332
unsigned int const majorVersion
Definition catch_amalgamated.hpp:7331
unsigned int const patchNumber
Definition catch_amalgamated.hpp:7333
Version(Version const &)=delete
Definition catch_amalgamated.hpp:1187
When
Definition catch_amalgamated.hpp:1187
@ Never
Definition catch_amalgamated.hpp:1188
@ BeforeStart
Definition catch_amalgamated.hpp:1189
@ BeforeExit
Definition catch_amalgamated.hpp:1190
@ BeforeStartAndExit
Definition catch_amalgamated.hpp:1191
Definition catch_amalgamated.hpp:1159
What
Definition catch_amalgamated.hpp:1159
@ UnmatchedTestSpec
A command line test spec matched no test cases.
Definition catch_amalgamated.hpp:1164
@ NoAssertions
A test case or leaf section did not run any assertions.
Definition catch_amalgamated.hpp:1162
@ Nothing
Definition catch_amalgamated.hpp:1160
Definition catch_amalgamated.hpp:5302
Definition catch_amalgamated.hpp:5290
Definition catch_amalgamated.hpp:1503
static true_given< decltype(std::declval< Fun >()(std::declval< Args >()...))> test(int)
static std::false_type test(...)
Definition catch_amalgamated.hpp:1511
Definition catch_amalgamated.hpp:2926
static char symbol()
Definition catch_amalgamated.hpp:2994
static char symbol()
Definition catch_amalgamated.hpp:2998
static char symbol()
Definition catch_amalgamated.hpp:3010
static char symbol()
Definition catch_amalgamated.hpp:3014
static char symbol()
Definition catch_amalgamated.hpp:3006
static char symbol()
Definition catch_amalgamated.hpp:3002
Definition catch_amalgamated.hpp:2983
static std::string symbol()
Definition catch_amalgamated.hpp:2984
Definition catch_amalgamated.hpp:1501
Definition catch_amalgamated.hpp:2465