summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadaf Ebrahimi <sadafebrahimi@google.com>2024-02-27 22:07:33 +0000
committerSadaf Ebrahimi <sadafebrahimi@google.com>2024-02-27 22:10:18 +0000
commit2fb0c25c31f9e9272a55ca31e3558484a4bc6208 (patch)
tree864c52fff91ada9d6a095df9ed49786356575bf6
parent2816b606749b3f0ba23fbff76e0252ef7caf826a (diff)
downloadcatch2-main.tar.gz
Remove catch2HEADmastermain
Please go through go/android-3p process if you need this project in the future. Test: TreeHugger Change-Id: Ie672213bf9c40027691fe0bad180a64f1bfc7bbb
-rw-r--r--.conan/build.py94
-rw-r--r--.conan/test_package/CMakeLists.txt11
-rw-r--r--.conan/test_package/conanfile.py19
-rw-r--r--.conan/test_package/test_package.cpp15
-rw-r--r--.gitattributes22
-rw-r--r--.github/FUNDING.yml1
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md29
-rw-r--r--.github/ISSUE_TEMPLATE/feature_request.md14
-rw-r--r--.github/pull_request_template.md28
-rw-r--r--.gitignore30
-rw-r--r--.travis.yml339
-rw-r--r--Android.bp140
-rw-r--r--CMake/Catch2Config.cmake.in10
-rw-r--r--CMake/FindGcov.cmake157
-rw-r--r--CMake/FindLcov.cmake354
-rw-r--r--CMake/Findcodecov.cmake258
-rw-r--r--CMake/MiscFunctions.cmake26
-rw-r--r--CMake/catch2.pc.in7
-rwxr-xr-xCMake/llvm-cov-wrapper56
-rw-r--r--CMakeLists.txt233
-rw-r--r--CODE_OF_CONDUCT.md46
l---------LICENSE1
-rw-r--r--LICENSE.txt23
-rw-r--r--METADATA20
-rw-r--r--MODULE_LICENSE_BOOST0
l---------NOTICE1
-rw-r--r--OWNERS4
-rw-r--r--README.md37
-rw-r--r--appveyor.yml101
-rw-r--r--artwork/catch2-c-logo.pngbin10636 -> 0 bytes
-rw-r--r--artwork/catch2-hand-logo.pngbin33761 -> 0 bytes
-rw-r--r--artwork/catch2-logo-small.pngbin20939 -> 0 bytes
-rw-r--r--codecov.yml25
-rw-r--r--conanfile.py27
-rw-r--r--contrib/Catch.cmake175
-rw-r--r--contrib/CatchAddTests.cmake81
-rw-r--r--contrib/ParseAndAddCatchTests.cmake225
-rw-r--r--contrib/gdbinit16
-rw-r--r--contrib/lldbinit16
-rw-r--r--docs/Readme.md41
-rw-r--r--docs/assertions.md201
-rw-r--r--docs/benchmarks.md254
-rw-r--r--docs/ci-and-misc.md112
-rw-r--r--docs/cmake-integration.md226
-rw-r--r--docs/command-line.md401
-rw-r--r--docs/commercial-users.md22
-rw-r--r--docs/configuration.md275
-rw-r--r--docs/contributing.md173
-rw-r--r--docs/deprecations.md137
-rw-r--r--docs/event-listeners.md75
-rw-r--r--docs/generators.md154
-rw-r--r--docs/limitations.md187
-rw-r--r--docs/list-of-examples.md48
-rw-r--r--docs/logging.md159
-rw-r--r--docs/matchers.md207
-rw-r--r--docs/opensource-users.md120
-rw-r--r--docs/other-macros.md154
-rw-r--r--docs/own-main.md131
-rw-r--r--docs/release-notes.md1094
-rw-r--r--docs/release-process.md73
-rw-r--r--docs/reporters.md47
-rw-r--r--docs/slow-compiles.md72
-rw-r--r--docs/test-cases-and-sections.md275
-rw-r--r--docs/test-fixtures.md143
-rw-r--r--docs/tostring.md132
-rw-r--r--docs/tutorial.md279
-rw-r--r--docs/why-catch.md46
-rw-r--r--examples/000-CatchMain.cpp15
-rw-r--r--examples/010-TestCase.cpp36
-rw-r--r--examples/020-TestCase-1.cpp35
-rw-r--r--examples/020-TestCase-2.cpp33
-rw-r--r--examples/030-Asn-Require-Check.cpp74
-rw-r--r--examples/100-Fix-Section.cpp69
-rw-r--r--examples/110-Fix-ClassFixture.cpp63
-rw-r--r--examples/120-Bdd-ScenarioGivenWhenThen.cpp73
-rw-r--r--examples/200-Rpt-CatchMain.cpp27
-rw-r--r--examples/207-Rpt-TeamCityReporter.cpp171
-rw-r--r--examples/210-Evt-EventListeners.cpp422
-rw-r--r--examples/231-Cfg-OutputStreams.cpp56
-rw-r--r--examples/300-Gen-OwnGenerator.cpp59
-rw-r--r--examples/301-Gen-MapTypeConversion.cpp56
-rw-r--r--examples/310-Gen-VariablesInGenerators.cpp33
-rw-r--r--examples/311-Gen-CustomCapture.cpp41
-rw-r--r--examples/CMakeLists.txt157
-rw-r--r--include/catch.hpp496
l---------include/catch_with_main.cpp1
-rw-r--r--include/catch_with_main.hpp14
-rw-r--r--include/external/clara.hpp1268
-rw-r--r--include/internal/benchmark/catch_benchmark.hpp122
-rw-r--r--include/internal/benchmark/catch_benchmarking_all.hpp29
-rw-r--r--include/internal/benchmark/catch_chronometer.hpp71
-rw-r--r--include/internal/benchmark/catch_clock.hpp40
-rw-r--r--include/internal/benchmark/catch_constructor.hpp79
-rw-r--r--include/internal/benchmark/catch_environment.hpp38
-rw-r--r--include/internal/benchmark/catch_estimate.hpp31
-rw-r--r--include/internal/benchmark/catch_execution_plan.hpp58
-rw-r--r--include/internal/benchmark/catch_optimizer.hpp68
-rw-r--r--include/internal/benchmark/catch_outlier_classification.hpp29
-rw-r--r--include/internal/benchmark/catch_sample_analysis.hpp50
-rw-r--r--include/internal/benchmark/detail/catch_analyse.hpp78
-rw-r--r--include/internal/benchmark/detail/catch_benchmark_function.hpp105
-rw-r--r--include/internal/benchmark/detail/catch_complete_invoke.hpp69
-rw-r--r--include/internal/benchmark/detail/catch_estimate_clock.hpp113
-rw-r--r--include/internal/benchmark/detail/catch_measure.hpp35
-rw-r--r--include/internal/benchmark/detail/catch_repeat.hpp37
-rw-r--r--include/internal/benchmark/detail/catch_run_for_at_least.hpp65
-rw-r--r--include/internal/benchmark/detail/catch_stats.cpp224
-rw-r--r--include/internal/benchmark/detail/catch_stats.hpp160
-rw-r--r--include/internal/benchmark/detail/catch_timing.hpp33
-rw-r--r--include/internal/catch_approx.cpp88
-rw-r--r--include/internal/catch_approx.h132
-rw-r--r--include/internal/catch_assertionhandler.cpp122
-rw-r--r--include/internal/catch_assertionhandler.h88
-rw-r--r--include/internal/catch_assertioninfo.h31
-rw-r--r--include/internal/catch_assertionresult.cpp104
-rw-r--r--include/internal/catch_assertionresult.h59
-rw-r--r--include/internal/catch_capture.hpp168
-rw-r--r--include/internal/catch_capture_matchers.cpp24
-rw-r--r--include/internal/catch_capture_matchers.h88
-rw-r--r--include/internal/catch_clara.h38
-rw-r--r--include/internal/catch_commandline.cpp227
-rw-r--r--include/internal/catch_commandline.h20
-rw-r--r--include/internal/catch_common.cpp43
-rw-r--r--include/internal/catch_common.h92
-rw-r--r--include/internal/catch_compiler_capabilities.h374
-rw-r--r--include/internal/catch_config.cpp85
-rw-r--r--include/internal/catch_config.hpp131
-rw-r--r--include/internal/catch_console_colour.cpp243
-rw-r--r--include/internal/catch_console_colour.h69
-rw-r--r--include/internal/catch_context.cpp70
-rw-r--r--include/internal/catch_context.h64
-rw-r--r--include/internal/catch_debug_console.cpp41
-rw-r--r--include/internal/catch_debug_console.h17
-rw-r--r--include/internal/catch_debugger.cpp123
-rw-r--r--include/internal/catch_debugger.h61
-rw-r--r--include/internal/catch_decomposer.cpp24
-rw-r--r--include/internal/catch_decomposer.h247
-rw-r--r--include/internal/catch_default_main.hpp47
-rw-r--r--include/internal/catch_enforce.cpp40
-rw-r--r--include/internal/catch_enforce.h53
-rw-r--r--include/internal/catch_enum_values_registry.cpp75
-rw-r--r--include/internal/catch_enum_values_registry.h35
-rw-r--r--include/internal/catch_errno_guard.cpp15
-rw-r--r--include/internal/catch_errno_guard.h22
-rw-r--r--include/internal/catch_exception_translator_registry.cpp89
-rw-r--r--include/internal/catch_exception_translator_registry.h30
-rw-r--r--include/internal/catch_external_interfaces.h20
-rw-r--r--include/internal/catch_fatal_condition.cpp176
-rw-r--r--include/internal/catch_fatal_condition.h69
-rw-r--r--include/internal/catch_generators.cpp32
-rw-r--r--include/internal/catch_generators.hpp212
-rw-r--r--include/internal/catch_generators_generic.hpp237
-rw-r--r--include/internal/catch_generators_specific.hpp175
-rw-r--r--include/internal/catch_impl.hpp33
-rw-r--r--include/internal/catch_interfaces_capture.cpp5
-rw-r--r--include/internal/catch_interfaces_capture.h100
-rw-r--r--include/internal/catch_interfaces_config.cpp5
-rw-r--r--include/internal/catch_interfaces_config.h91
-rw-r--r--include/internal/catch_interfaces_enum_values_registry.h46
-rw-r--r--include/internal/catch_interfaces_exception.cpp6
-rw-r--r--include/internal/catch_interfaces_exception.h86
-rw-r--r--include/internal/catch_interfaces_generatortracker.h39
-rw-r--r--include/internal/catch_interfaces_registry_hub.cpp6
-rw-r--r--include/internal/catch_interfaces_registry_hub.h61
-rw-r--r--include/internal/catch_interfaces_reporter.cpp114
-rw-r--r--include/internal/catch_interfaces_reporter.h270
-rw-r--r--include/internal/catch_interfaces_runner.cpp5
-rw-r--r--include/internal/catch_interfaces_runner.h19
-rw-r--r--include/internal/catch_interfaces_tag_alias_registry.h28
-rw-r--r--include/internal/catch_interfaces_testcase.cpp6
-rw-r--r--include/internal/catch_interfaces_testcase.h38
-rw-r--r--include/internal/catch_leak_detector.cpp37
-rw-r--r--include/internal/catch_leak_detector.h18
-rw-r--r--include/internal/catch_list.cpp173
-rw-r--r--include/internal/catch_list.h38
-rw-r--r--include/internal/catch_matchers.cpp28
-rw-r--r--include/internal/catch_matchers.h174
-rw-r--r--include/internal/catch_matchers_exception.cpp30
-rw-r--r--include/internal/catch_matchers_exception.hpp36
-rw-r--r--include/internal/catch_matchers_floating.cpp237
-rw-r--r--include/internal/catch_matchers_floating.h70
-rw-r--r--include/internal/catch_matchers_generic.cpp9
-rw-r--r--include/internal/catch_matchers_generic.hpp58
-rw-r--r--include/internal/catch_matchers_string.cpp118
-rw-r--r--include/internal/catch_matchers_string.h80
-rw-r--r--include/internal/catch_matchers_vector.h182
-rw-r--r--include/internal/catch_message.cpp142
-rw-r--r--include/internal/catch_message.h99
-rw-r--r--include/internal/catch_meta.hpp50
-rw-r--r--include/internal/catch_objc.hpp215
-rw-r--r--include/internal/catch_objc_arc.hpp51
-rw-r--r--include/internal/catch_option.hpp73
-rw-r--r--include/internal/catch_output_redirect.cpp147
-rw-r--r--include/internal/catch_output_redirect.h116
-rw-r--r--include/internal/catch_platform.h27
-rw-r--r--include/internal/catch_polyfills.cpp31
-rw-r--r--include/internal/catch_polyfills.hpp15
-rw-r--r--include/internal/catch_preprocessor.hpp236
-rw-r--r--include/internal/catch_random_number_generator.cpp73
-rw-r--r--include/internal/catch_random_number_generator.h58
-rw-r--r--include/internal/catch_reenable_warnings.h21
-rw-r--r--include/internal/catch_registry_hub.cpp95
-rw-r--r--include/internal/catch_reporter_registrars.hpp78
-rw-r--r--include/internal/catch_reporter_registry.cpp34
-rw-r--r--include/internal/catch_reporter_registry.h37
-rw-r--r--include/internal/catch_result_type.cpp27
-rw-r--r--include/internal/catch_result_type.h55
-rw-r--r--include/internal/catch_run_context.cpp521
-rw-r--r--include/internal/catch_run_context.h158
-rw-r--r--include/internal/catch_section.cpp38
-rw-r--r--include/internal/catch_section.h51
-rw-r--r--include/internal/catch_section_info.cpp19
-rw-r--r--include/internal/catch_section_info.h42
-rw-r--r--include/internal/catch_session.cpp313
-rw-r--r--include/internal/catch_session.h62
-rw-r--r--include/internal/catch_singletons.cpp36
-rw-r--r--include/internal/catch_singletons.hpp44
-rw-r--r--include/internal/catch_startup_exception_registry.cpp26
-rw-r--r--include/internal/catch_startup_exception_registry.h27
-rw-r--r--include/internal/catch_stream.cpp187
-rw-r--r--include/internal/catch_stream.h51
-rw-r--r--include/internal/catch_string_manip.cpp109
-rw-r--r--include/internal/catch_string_manip.h45
-rw-r--r--include/internal/catch_stringref.cpp50
-rw-r--r--include/internal/catch_stringref.h104
-rw-r--r--include/internal/catch_suppress_warnings.h27
-rw-r--r--include/internal/catch_tag_alias.cpp5
-rw-r--r--include/internal/catch_tag_alias.h26
-rw-r--r--include/internal/catch_tag_alias_autoregistrar.cpp16
-rw-r--r--include/internal/catch_tag_alias_autoregistrar.h26
-rw-r--r--include/internal/catch_tag_alias_registry.cpp58
-rw-r--r--include/internal/catch_tag_alias_registry.h31
-rw-r--r--include/internal/catch_test_case_info.cpp186
-rw-r--r--include/internal/catch_test_case_info.h90
-rw-r--r--include/internal/catch_test_case_registry_impl.cpp121
-rw-r--r--include/internal/catch_test_case_registry_impl.h71
-rw-r--r--include/internal/catch_test_case_tracker.cpp248
-rw-r--r--include/internal/catch_test_case_tracker.h160
-rw-r--r--include/internal/catch_test_registry.cpp37
-rw-r--r--include/internal/catch_test_registry.h402
-rw-r--r--include/internal/catch_test_spec.cpp99
-rw-r--r--include/internal/catch_test_spec.h94
-rw-r--r--include/internal/catch_test_spec_parser.cpp238
-rw-r--r--include/internal/catch_test_spec_parser.h79
-rw-r--r--include/internal/catch_text.h17
-rw-r--r--include/internal/catch_timer.cpp74
-rw-r--r--include/internal/catch_timer.h30
-rw-r--r--include/internal/catch_to_string.hpp28
-rw-r--r--include/internal/catch_tostring.cpp265
-rw-r--r--include/internal/catch_tostring.h668
-rw-r--r--include/internal/catch_totals.cpp61
-rw-r--r--include/internal/catch_totals.h41
-rw-r--r--include/internal/catch_uncaught_exceptions.cpp21
-rw-r--r--include/internal/catch_uncaught_exceptions.h15
-rw-r--r--include/internal/catch_user_interfaces.h18
-rw-r--r--include/internal/catch_version.cpp44
-rw-r--r--include/internal/catch_version.h39
-rw-r--r--include/internal/catch_wildcard_pattern.cpp47
-rw-r--r--include/internal/catch_wildcard_pattern.h38
-rw-r--r--include/internal/catch_windows_h_proxy.h39
-rw-r--r--include/internal/catch_xmlwriter.cpp334
-rw-r--r--include/internal/catch_xmlwriter.h116
-rw-r--r--include/reporters/catch_reporter_automake.hpp62
-rw-r--r--include/reporters/catch_reporter_bases.cpp73
-rw-r--r--include/reporters/catch_reporter_bases.hpp282
-rw-r--r--include/reporters/catch_reporter_compact.cpp293
-rw-r--r--include/reporters/catch_reporter_compact.h41
-rw-r--r--include/reporters/catch_reporter_console.cpp699
-rw-r--r--include/reporters/catch_reporter_console.h89
-rw-r--r--include/reporters/catch_reporter_junit.cpp276
-rw-r--r--include/reporters/catch_reporter_junit.h61
-rw-r--r--include/reporters/catch_reporter_listening.cpp164
-rw-r--r--include/reporters/catch_reporter_listening.h63
-rw-r--r--include/reporters/catch_reporter_sonarqube.hpp181
-rw-r--r--include/reporters/catch_reporter_tap.hpp253
-rw-r--r--include/reporters/catch_reporter_teamcity.hpp219
-rw-r--r--include/reporters/catch_reporter_xml.cpp273
-rw-r--r--include/reporters/catch_reporter_xml.h68
-rw-r--r--misc/CMakeLists.txt11
-rw-r--r--misc/SelfTest.vcxproj.user23
-rw-r--r--misc/appveyorBuildConfigurationScript.bat22
-rw-r--r--misc/appveyorMergeCoverageScript.py9
-rw-r--r--misc/appveyorTestRunScript.bat15
-rw-r--r--misc/coverage-helper.cpp142
-rw-r--r--misc/installOpenCppCoverage.ps119
-rw-r--r--projects/CMakeLists.txt461
-rw-r--r--projects/ExtraTests/CMakeLists.txt167
-rw-r--r--projects/ExtraTests/ToDo.txt11
-rw-r--r--projects/ExtraTests/X01-PrefixedMacros.cpp84
-rw-r--r--projects/ExtraTests/X02-DisabledMacros.cpp31
-rw-r--r--projects/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp23
-rw-r--r--projects/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp33
-rw-r--r--projects/ExtraTests/X10-FallbackStringifier.cpp23
-rw-r--r--projects/ExtraTests/X11-DisableStringification.cpp16
-rw-r--r--projects/ExtraTests/X12-CustomDebugBreakMacro.cpp17
-rw-r--r--projects/ExtraTests/X20-BenchmarkingMacros.cpp125
-rw-r--r--projects/ExtraTests/X90-WindowsHeaderInclusion.cpp12
-rw-r--r--projects/SelfTest/Baselines/automake.std.approved.txt168
-rw-r--r--projects/SelfTest/Baselines/compact.sw.approved.txt1816
-rw-r--r--projects/SelfTest/Baselines/console.std.approved.txt1385
-rw-r--r--projects/SelfTest/Baselines/console.sw.approved.txt13421
-rw-r--r--projects/SelfTest/Baselines/console.swa4.approved.txt373
-rw-r--r--projects/SelfTest/Baselines/junit.sw.approved.txt1718
-rw-r--r--projects/SelfTest/Baselines/sonarqube.sw.approved.txt1731
-rw-r--r--projects/SelfTest/Baselines/xml.sw.approved.txt16043
-rw-r--r--projects/SelfTest/CompileTimePerfTests/10.tests.cpp13
-rw-r--r--projects/SelfTest/CompileTimePerfTests/100.tests.cpp13
-rw-r--r--projects/SelfTest/CompileTimePerfTests/All.tests.cpp15
-rw-r--r--projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp553
-rw-r--r--projects/SelfTest/IntrospectiveTests/Details.tests.cpp23
-rw-r--r--projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp352
-rw-r--r--projects/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp405
-rw-r--r--projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp206
-rw-r--r--projects/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp45
-rw-r--r--projects/SelfTest/IntrospectiveTests/String.tests.cpp150
-rw-r--r--projects/SelfTest/IntrospectiveTests/StringManip.tests.cpp67
-rw-r--r--projects/SelfTest/IntrospectiveTests/Tag.tests.cpp57
-rw-r--r--projects/SelfTest/IntrospectiveTests/ToString.tests.cpp42
-rw-r--r--projects/SelfTest/IntrospectiveTests/Xml.tests.cpp114
-rw-r--r--projects/SelfTest/Misc/invalid-test-names.input1
-rw-r--r--projects/SelfTest/Misc/plain-old-tests.input2
-rw-r--r--projects/SelfTest/Misc/special-characters-in-file.input1
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_console_colour.cpp3
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_debugger.cpp2
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp2
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_option.cpp3
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_stream.cpp3
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_test_case_tracker.cpp2
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_test_spec.cpp3
-rw-r--r--projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp4
-rw-r--r--projects/SelfTest/TestMain.cpp34
-rw-r--r--projects/SelfTest/UsageTests/Approx.tests.cpp215
-rw-r--r--projects/SelfTest/UsageTests/BDD.tests.cpp110
-rw-r--r--projects/SelfTest/UsageTests/Benchmark.tests.cpp144
-rw-r--r--projects/SelfTest/UsageTests/Class.tests.cpp137
-rw-r--r--projects/SelfTest/UsageTests/Compilation.tests.cpp237
-rw-r--r--projects/SelfTest/UsageTests/Condition.tests.cpp334
-rw-r--r--projects/SelfTest/UsageTests/Decomposition.tests.cpp39
-rw-r--r--projects/SelfTest/UsageTests/EnumToString.tests.cpp99
-rw-r--r--projects/SelfTest/UsageTests/Exception.tests.cpp216
-rw-r--r--projects/SelfTest/UsageTests/Generators.tests.cpp256
-rw-r--r--projects/SelfTest/UsageTests/Matchers.tests.cpp578
-rw-r--r--projects/SelfTest/UsageTests/Message.tests.cpp269
-rw-r--r--projects/SelfTest/UsageTests/Misc.tests.cpp487
-rw-r--r--projects/SelfTest/UsageTests/ToStringByte.tests.cpp15
-rw-r--r--projects/SelfTest/UsageTests/ToStringChrono.tests.cpp44
-rw-r--r--projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp210
-rw-r--r--projects/SelfTest/UsageTests/ToStringOptional.tests.cpp23
-rw-r--r--projects/SelfTest/UsageTests/ToStringPair.tests.cpp30
-rw-r--r--projects/SelfTest/UsageTests/ToStringTuple.tests.cpp47
-rw-r--r--projects/SelfTest/UsageTests/ToStringVariant.tests.cpp91
-rw-r--r--projects/SelfTest/UsageTests/ToStringVector.tests.cpp86
-rw-r--r--projects/SelfTest/UsageTests/ToStringWhich.tests.cpp193
-rw-r--r--projects/SelfTest/UsageTests/Tricky.tests.cpp410
-rw-r--r--projects/SelfTest/UsageTests/VariadicMacros.tests.cpp29
-rw-r--r--projects/SelfTest/WarnAboutNoTests.cmake19
-rw-r--r--projects/XCode/OCTest/OCTest.xcodeproj/project.pbxproj294
-rw-r--r--projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist8
-rw-r--r--projects/XCode/OCTest/OCTest/CatchOCTestCase.h25
-rw-r--r--projects/XCode/OCTest/OCTest/CatchOCTestCase.mm87
-rw-r--r--projects/XCode/OCTest/OCTest/Main.mm2
-rw-r--r--projects/XCode/OCTest/OCTest/OCTest.179
-rw-r--r--projects/XCode/OCTest/OCTest/OCTest.mm28
-rw-r--r--projects/XCode/OCTest/OCTest/TestObj.h28
-rw-r--r--projects/XCode/OCTest/OCTest/TestObj.m25
-rw-r--r--projects/XCode/OCTest/catch_objc_impl.mm69
-rwxr-xr-xscripts/approvalTests.py214
-rwxr-xr-xscripts/approve.py33
-rwxr-xr-xscripts/benchmarkCompile.py148
-rwxr-xr-xscripts/benchmarkRunner.py56
-rwxr-xr-xscripts/developBuild.py10
-rw-r--r--scripts/embed.py63
-rwxr-xr-xscripts/embedClara.py27
-rw-r--r--scripts/extractFeaturesFromReleaseNotes.py94
-rwxr-xr-xscripts/fixWhitespace.py52
-rwxr-xr-xscripts/generateSingleHeader.py151
-rwxr-xr-xscripts/majorRelease.py10
-rwxr-xr-xscripts/minorRelease.py10
-rwxr-xr-xscripts/patchRelease.py10
-rw-r--r--scripts/releaseCommon.py166
-rwxr-xr-xscripts/releaseNotes.py65
-rw-r--r--scripts/scriptCommon.py31
-rw-r--r--scripts/updateDocumentToC.py449
-rw-r--r--scripts/updateWandbox.py53
-rw-r--r--single_include/catch2/catch.hpp17620
-rw-r--r--single_include/catch2/catch_reporter_automake.hpp62
-rw-r--r--single_include/catch2/catch_reporter_sonarqube.hpp181
-rw-r--r--single_include/catch2/catch_reporter_tap.hpp253
-rw-r--r--single_include/catch2/catch_reporter_teamcity.hpp219
-rw-r--r--third_party/clara.hpp1267
391 files changed, 1 insertions, 95854 deletions
diff --git a/.conan/build.py b/.conan/build.py
deleted file mode 100644
index 27298651..00000000
--- a/.conan/build.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import os
-import re
-from cpt.packager import ConanMultiPackager
-from cpt.ci_manager import CIManager
-from cpt.printer import Printer
-
-
-class BuilderSettings(object):
- @property
- def username(self):
- """ Set catchorg as package's owner
- """
- return os.getenv("CONAN_USERNAME", "catchorg")
-
- @property
- def login_username(self):
- """ Set Bintray login username
- """
- return os.getenv("CONAN_LOGIN_USERNAME", "horenmar")
-
- @property
- def upload(self):
- """ Set Catch2 repository to be used on upload.
- The upload server address could be customized by env var
- CONAN_UPLOAD. If not defined, the method will check the branch name.
- Only master or CONAN_STABLE_BRANCH_PATTERN will be accepted.
- The master branch will be pushed to testing channel, because it does
- not match the stable pattern. Otherwise it will upload to stable
- channel.
- """
- return os.getenv("CONAN_UPLOAD", "https://api.bintray.com/conan/catchorg/Catch2")
-
- @property
- def upload_only_when_stable(self):
- """ Force to upload when running over tag branch
- """
- return os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", "True").lower() in ["true", "1", "yes"]
-
- @property
- def stable_branch_pattern(self):
- """ Only upload the package the branch name is like a tag
- """
- return os.getenv("CONAN_STABLE_BRANCH_PATTERN", r"v\d+\.\d+\.\d+")
-
- @property
- def reference(self):
- """ Read project version from branch create Conan reference
- """
- return os.getenv("CONAN_REFERENCE", "Catch2/{}".format(self._version))
-
- @property
- def channel(self):
- """ Default Conan package channel when not stable
- """
- return os.getenv("CONAN_CHANNEL", "testing")
-
- @property
- def _version(self):
- """ Get version name from cmake file
- """
- pattern = re.compile(r"project\(Catch2 LANGUAGES CXX VERSION (\d+\.\d+\.\d+)\)")
- version = "latest"
- with open("CMakeLists.txt") as file:
- for line in file:
- result = pattern.search(line)
- if result:
- version = result.group(1)
- return version
-
- @property
- def _branch(self):
- """ Get branch name from CI manager
- """
- printer = Printer(None)
- ci_manager = CIManager(printer)
- return ci_manager.get_branch()
-
-
-if __name__ == "__main__":
- settings = BuilderSettings()
- builder = ConanMultiPackager(
- reference=settings.reference,
- channel=settings.channel,
- upload=settings.upload,
- upload_only_when_stable=settings.upload_only_when_stable,
- stable_branch_pattern=settings.stable_branch_pattern,
- login_username=settings.login_username,
- username=settings.username,
- test_folder=os.path.join(".conan", "test_package"))
- builder.add()
- builder.run()
diff --git a/.conan/test_package/CMakeLists.txt b/.conan/test_package/CMakeLists.txt
deleted file mode 100644
index db056599..00000000
--- a/.conan/test_package/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-cmake_minimum_required(VERSION 3.2.0)
-project(test_package CXX)
-
-include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
-conan_basic_setup(TARGETS)
-
-find_package(Catch2 REQUIRED CONFIG)
-
-add_executable(${PROJECT_NAME} test_package.cpp)
-target_link_libraries(${PROJECT_NAME} CONAN_PKG::Catch2)
-set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11)
diff --git a/.conan/test_package/conanfile.py b/.conan/test_package/conanfile.py
deleted file mode 100644
index 0a0da54a..00000000
--- a/.conan/test_package/conanfile.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-from conans import ConanFile, CMake
-import os
-
-
-class TestPackageConan(ConanFile):
- settings = "os", "compiler", "build_type", "arch"
- generators = "cmake"
-
- def build(self):
- cmake = CMake(self)
- cmake.configure()
- cmake.build()
-
- def test(self):
- assert os.path.isfile(os.path.join(self.deps_cpp_info["Catch2"].rootpath, "licenses", "LICENSE.txt"))
- bin_path = os.path.join("bin", "test_package")
- self.run("%s -s" % bin_path, run_environment=True)
diff --git a/.conan/test_package/test_package.cpp b/.conan/test_package/test_package.cpp
deleted file mode 100644
index cff50de5..00000000
--- a/.conan/test_package/test_package.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#define CATCH_CONFIG_MAIN
-
-#include <catch2/catch.hpp>
-
-int Factorial( int number ) {
- return number <= 1 ? 1 : Factorial( number - 1 ) * number;
-}
-
-TEST_CASE( "Factorial Tests", "[single-file]" ) {
- REQUIRE( Factorial(0) == 1 );
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-} \ No newline at end of file
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 23f98fff..00000000
--- a/.gitattributes
+++ /dev/null
@@ -1,22 +0,0 @@
-# This sets the default behaviour, overriding core.autocrlf
-* text=auto
-
-# All source files should have unix line-endings in the repository,
-# but convert to native line-endings on checkout
-*.cpp text
-*.h text
-*.hpp text
-
-# Windows specific files should retain windows line-endings
-*.sln text eol=crlf
-
-# Keep executable scripts with LFs so they can be run after being
-# checked out on Windows
-*.py text eol=lf
-
-
-# Keep the single include header with LFs to make sure it is uploaded,
-# hashed etc with LF
-single_include/**/*.hpp eol=lf
-# Also keep the LICENCE file with LFs for the same reason
-LICENCE.txt eol=lf
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index 01d384e8..00000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1 +0,0 @@
-patreon: horenmar
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index dbeff115..00000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,29 +0,0 @@
----
-name: Bug report
-about: Create an issue that documents a bug
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Describe the bug**
-A clear and concise description of what the bug is.
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Reproduction steps**
-Steps to reproduce the bug.
-<!-- Usually this means a small and self-contained piece of code that uses Catch and specifying compiler flags if relevant. -->
-
-
-**Platform information:**
-<!-- Fill in any extra information that might be important for your issue. -->
- - OS: **Windows NT**
- - Compiler+version: **GCC v2.9.5**
- - Catch version: **v1.2.3**
-
-
-**Additional context**
-Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index be9b9eea..00000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-name: Feature request
-about: Create an issue that requests a feature or other improvement
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Description**
-Describe the feature/change you request and why do you want it.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
deleted file mode 100644
index ea2b7bb5..00000000
--- a/.github/pull_request_template.md
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
-Please do not submit pull requests changing the `version.hpp`
-or the single-include `catch.hpp` file, these are changed
-only when a new release is made.
-
-Before submitting a PR you should probably read the contributor documentation
-at docs/contributing.md. It will tell you how to properly test your changes.
--->
-
-
-## Description
-<!--
-Describe the what and the why of your pull request. Remember that these two
-are usually a bit different. As an example, if you have made various changes
-to decrease the number of new strings allocated, that's what. The why probably
-was that you have a large set of tests and found that this speeds them up.
--->
-
-## GitHub Issues
-<!--
-If this PR was motivated by some existing issues, reference them here.
-
-If it is a simple bug-fix, please also add a line like 'Closes #123'
-to your commit message, so that it is automatically closed.
-If it is not, don't, as it might take several iterations for a feature
-to be done properly. If in doubt, leave it open and reference it in the
-PR itself, so that maintainers can decide.
--->
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index f017e9e0..00000000
--- a/.gitignore
+++ /dev/null
@@ -1,30 +0,0 @@
-*.build
-*.pbxuser
-*.mode1v3
-*.ncb
-*.suo
-Debug
-Release
-*.user
-*.xcuserstate
-.DS_Store
-xcuserdata
-CatchSelfTest.xcscheme
-Breakpoints.xcbkptlist
-projects/VS2010/TestCatch/_UpgradeReport_Files/
-projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj.filters
-projects/VisualStudio/TestCatch/UpgradeLog.XML
-projects/CMake/.idea
-projects/CMake/cmake-build-debug
-UpgradeLog.XML
-Resources/DWARF
-projects/Generated
-*.pyc
-DerivedData
-*.xccheckout
-Build
-.idea
-.vs
-cmake-build-*
-benchmark-dir
-.conan/test_package/build
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 0fe2abb1..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,339 +0,0 @@
-language: cpp
-
-branches:
- except:
- - /dev-appveyor.*/
-
-common_sources: &all_sources
- - ubuntu-toolchain-r-test
- - llvm-toolchain-trusty
- - llvm-toolchain-trusty-3.9
- - llvm-toolchain-trusty-4.0
- - llvm-toolchain-xenial-5.0
- - llvm-toolchain-xenial-6.0
-
-matrix:
- include:
-
- # 1/ Linux Clang Builds
- - os: linux
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-3.5']
- env: COMPILER='clang++-3.5'
-
- - os: linux
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-3.6']
- env: COMPILER='clang++-3.6'
-
- # Clang 3.7 is intentionally skipped as we cannot get it easily on
- # TravisCI container
-
- - os: linux
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['lcov', 'clang-3.8']
- env: COMPILER='clang++-3.8'
-
- - os: linux
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-3.9']
- env: COMPILER='clang++-3.9'
-
- - os: linux
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-4.0']
- env: COMPILER='clang++-4.0'
-
- - os: linux
- dist: xenial
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-5.0']
- env: COMPILER='clang++-5.0'
-
- - os: linux
- dist: xenial
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-6.0']
- env: COMPILER='clang++-6.0'
-
- # 2/ Linux GCC Builds
- - os: linux
- compiler: gcc
- addons:
- apt:
- sources: *all_sources
- packages: ['g++-4.8']
- env: COMPILER='g++-4.8'
-
- - os: linux
- compiler: gcc
- addons:
- apt:
- sources: *all_sources
- packages: ['g++-4.9']
- env: COMPILER='g++-4.9'
-
- - os: linux
- compiler: gcc
- addons:
- apt:
- sources: *all_sources
- packages: ['g++-5']
- env: COMPILER='g++-5'
-
- - os: linux
- compiler: gcc
- addons: &gcc6
- apt:
- sources: *all_sources
- packages: ['g++-6']
- env: COMPILER='g++-6'
-
- - os: linux
- compiler: gcc
- addons: &gcc7
- apt:
- sources: *all_sources
- packages: ['g++-7']
- env: COMPILER='g++-7'
-
- - os: linux
- compiler: gcc
- addons: &gcc8
- apt:
- sources: *all_sources
- packages: ['g++-8']
- env: COMPILER='g++-8'
-
- # 3b/ Linux C++14 Clang builds
- # Note that we need newer libstdc++ for C++14 support
- - os: linux
- compiler: clang
- addons:
- apt:
- packages: ['clang-3.8', 'libstdc++-6-dev']
- sources:
- - ubuntu-toolchain-r-test
- - llvm-toolchain-trusty
- env: COMPILER='clang++-3.8' CPP14=1
-
- - os: linux
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-3.9', 'libstdc++-6-dev']
- env: COMPILER='clang++-3.9' CPP14=1
-
- - os: linux
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-4.0', 'libstdc++-6-dev']
- env: COMPILER='clang++-4.0' CPP14=1
-
- - os: linux
- dist: xenial
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-5.0', 'libstdc++-6-dev']
- env: COMPILER='clang++-5.0' CPP14=1
-
- - os: linux
- dist: xenial
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-6.0', 'libstdc++-6-dev']
- env: COMPILER='clang++-6.0' CPP14=1
-
-
- # 4a/ Linux C++14 GCC builds
- - os: linux
- compiler: gcc
- addons: *gcc6
- env: COMPILER='g++-6' CPP14=1
-
- - os: linux
- compiler: gcc
- addons: *gcc7
- env: COMPILER='g++-7' CPP14=1
-
- - os: linux
- compiler: gcc
- addons: *gcc8
- env: COMPILER='g++-8' CPP14=1
-
- # 5/ OSX Clang Builds
- - os: osx
- osx_image: xcode7.3
- compiler: clang
- env: COMPILER='clang++'
-
- - os: osx
- osx_image: xcode8
- compiler: clang
- env: COMPILER='clang++'
-
- - os: osx
- osx_image: xcode9
- compiler: clang
- env: COMPILER='clang++'
-
- - os: osx
- osx_image: xcode9.1
- compiler: clang
- env: COMPILER='clang++'
-
- - os: osx
- osx_image: xcode9.1
- compiler: clang
- env: COMPILER='clang++' CPP14=1
-
- # 6/ Special builds -- examples, coverage, valgrind, etc.
- - os: linux
- compiler: gcc
- addons:
- apt:
- sources: *all_sources
- packages: ['lcov', 'g++-7']
- env: COMPILER='g++-7' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
-
- - os: linux
- compiler: clang
- addons:
- apt:
- packages: ['clang-3.8', 'lcov']
- sources:
- - ubuntu-toolchain-r-test
- - llvm-toolchain-trusty
- env: COMPILER='clang++-3.8' EXAMPLES=1 COVERAGE=1 EXTRAS=1
-
- - os: linux
- compiler: gcc
- addons:
- apt:
- sources: *all_sources
- packages: ['valgrind', 'lcov', 'g++-7']
- env: COMPILER='g++-7' CPP14=1 VALGRIND=1
-
- - os: osx
- osx_image: xcode9.1
- compiler: clang
- env: COMPILER='clang++' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
-
- # 7/ C++17 builds
- - os: linux
- compiler: gcc
- addons: *gcc7
- env: COMPILER='g++-7' CPP17=1
-
- - os: linux
- compiler: gcc
- addons: *gcc7
- env: COMPILER='g++-7' EXAMPLES=1 COVERAGE=1 EXTRAS=1 CPP17=1
-
- - os: linux
- dist: xenial
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-6.0', 'libstdc++-8-dev']
- env: COMPILER='clang++-6.0' CPP17=1
-
- - os: linux
- dist: xenial
- compiler: clang
- addons:
- apt:
- sources: *all_sources
- packages: ['clang-6.0', 'libstdc++-8-dev']
- env: COMPILER='clang++-6.0' CPP17=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
-
- # 8/ Conan
- - language: python
- python:
- - "3.7"
- dist: xenial
- install:
- - pip install conan-package-tools
- env:
- - CONAN_GCC_VERSIONS=8
- - CONAN_DOCKER_IMAGE=conanio/gcc8
- script:
- - python .conan/build.py
-
-install:
- - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- - |
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
- CMAKE_URL="http://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz"
- mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
- export PATH=${DEPS_DIR}/cmake/bin:${PATH}
- elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
- which cmake || brew install cmake;
- fi
-
-before_script:
- - export CXX=${COMPILER}
- - cd ${TRAVIS_BUILD_DIR}
- # Regenerate single header file, so it is tested in the examples...
- - python scripts/generateSingleHeader.py
-
- - |
- if [[ ${CPP17} -eq 1 ]]; then
- export CPP_STANDARD=17
- elif [[ ${CPP14} -eq 1 ]]; then
- export CPP_STANDARD=14
- else
- export CPP_STANDARD=11
- fi
-
- # Use Debug builds for running Valgrind and building examples
- - cmake -H. -BBuild-Debug -DCMAKE_BUILD_TYPE=Debug -Wdev -DCATCH_USE_VALGRIND=${VALGRIND} -DCATCH_BUILD_EXAMPLES=${EXAMPLES} -DCATCH_ENABLE_COVERAGE=${COVERAGE} -DCATCH_BUILD_EXTRA_TESTS=${EXTRAS} -DCMAKE_CXX_STANDARD=${CPP_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=On -DCMAKE_CXX_EXTENSIONS=OFF
- # Don't bother with release build for coverage build
- - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -Wdev -DCMAKE_CXX_STANDARD=${CPP_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=On -DCMAKE_CXX_EXTENSIONS=OFF
-
-
-script:
- - cd Build-Debug
- - make -j 2
- - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
- # Coverage collection does not work for OS X atm
- - |
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ "${COVERAGE}" == "1" ]]; then
- make gcov
- make lcov
- bash <(curl -s https://codecov.io/bash) -X gcov || echo "Codecov did not collect coverage reports"
- fi
- - # Go to release build
- - cd ../Build-Release
- - make -j 2
- - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
diff --git a/Android.bp b/Android.bp
deleted file mode 100644
index 99a231e5..00000000
--- a/Android.bp
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright (C) 2018 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
- default_applicable_licenses: ["external_catch2_license"],
-}
-
-// Added automatically by a large-scale-change that took the approach of
-// 'apply every license found to every target'. While this makes sure we respect
-// every license restriction, it may not be entirely correct.
-//
-// e.g. GPL in an MIT project might only apply to the contrib/ directory.
-//
-// Please consider splitting the single license below into multiple licenses,
-// taking care not to lose any license_kind information, and overriding the
-// default license using the 'licenses: [...]' property on targets as needed.
-//
-// For unused files, consider creating a 'fileGroup' with "//visibility:private"
-// to attach the license to, and including a comment whether the files may be
-// used in the current project.
-// See: http://go/android-license-faq
-license {
- name: "external_catch2_license",
- visibility: [":__subpackages__"],
- license_kinds: [
- "SPDX-license-identifier-BSD",
- "SPDX-license-identifier-BSL-1.0",
- "SPDX-license-identifier-GPL",
- "SPDX-license-identifier-MIT",
- ],
- license_text: [
- "LICENSE.txt",
- ],
-}
-
-cc_defaults {
- name: "libcatch2-defaults",
- host_supported: true,
- local_include_dirs: ["include"], // cc_test ignores export_include_dirs
- export_include_dirs: ["include"],
- srcs: ["include/**/*.cpp"],
- exclude_srcs: ["include/catch_with_main.cpp"],
-}
-
-// !!! IMPORTANT: Use 'whole_static_libs' or the linker will dead-code-eliminate
-// parts of the important code (the console and junit reporters).
-
-// Android users: libcatch2-main is what you want 99% of the time.
-// Using the pre-defined main speeds up compilation significantly.
-// If for some reason you want to provide your own `main`, use "libcatch2"
-// See also docs/configuration.md
-cc_library_static {
- name: "libcatch2-main",
- defaults: [
- "libcatch2-defaults",
- ],
- srcs: [
- "include/catch_with_main.cpp",
- ],
-}
-
-// libcatch2 without the pre-defined main.
-// This is only useful if your program will define its own main.
-cc_library_static {
- name: "libcatch2",
- defaults: [
- "libcatch2-defaults",
- ],
- cflags: ["-DCATCH_CONFIG_DISABLE_EXCEPTIONS"],
-}
-
-// This rule can be used by other external/ projects that depend on catch2
-// without turning off exceptions.
-cc_library_static {
- name: "libcatch2-upstream",
- defaults: [
- "libcatch2-defaults",
- ],
- cflags: ["-fexceptions"],
-}
-
-// Configurations meant for validating upstream. Not intended to be used by anything else.
-
-cc_defaults {
- name: "libcatch2-defaults-tests",
- host_supported: true,
- srcs: [
- "projects/SelfTest/**/*.cpp",
- ],
- // This directory just re-includes existing tests 100x over.
- // This is extremely slow to build, we don't lose coverage by excluding it.
- exclude_srcs: [
- "projects/SelfTest/CompileTimePerfTests/**/*.cpp",
- ],
- shared_libs: ["liblog"],
-}
-
-// Upstream config: Exceptions are enabled.
-// This should be validated first after an upstream merge.
-cc_test {
- name: "libcatch2-tests-upstream",
- defaults: [
- "libcatch2-defaults-tests",
- ],
-
- gtest: false,
- cflags: ["-fexceptions"],
-
- whole_static_libs: [
- "libcatch2-upstream",
- ],
-}
-
-// Android config: Exceptions are disabled.
-// This should be validated second after an upstream merge.
-cc_test {
- name: "libcatch2-tests",
- defaults: [
- "libcatch2-defaults-tests",
- ],
- cflags: [
- "-DCATCH_CONFIG_DISABLE_EXCEPTIONS",
- "-Wno-unused-function",
- ],
- gtest: false,
- whole_static_libs: [
- "libcatch2",
- ],
-}
diff --git a/CMake/Catch2Config.cmake.in b/CMake/Catch2Config.cmake.in
deleted file mode 100644
index c485219c..00000000
--- a/CMake/Catch2Config.cmake.in
+++ /dev/null
@@ -1,10 +0,0 @@
-@PACKAGE_INIT@
-
-
-# Avoid repeatedly including the targets
-if(NOT TARGET Catch2::Catch2)
- # Provide path for scripts
- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
-
- include(${CMAKE_CURRENT_LIST_DIR}/Catch2Targets.cmake)
-endif()
diff --git a/CMake/FindGcov.cmake b/CMake/FindGcov.cmake
deleted file mode 100644
index 41417113..00000000
--- a/CMake/FindGcov.cmake
+++ /dev/null
@@ -1,157 +0,0 @@
-# This file is part of CMake-codecov.
-#
-# Copyright (c)
-# 2015-2017 RWTH Aachen University, Federal Republic of Germany
-#
-# See the LICENSE file in the package base directory for details
-#
-# Written by Alexander Haase, alexander.haase@rwth-aachen.de
-#
-
-
-# include required Modules
-include(FindPackageHandleStandardArgs)
-
-
-# Search for gcov binary.
-set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
-set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY})
-
-get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
-foreach (LANG ${ENABLED_LANGUAGES})
- # Gcov evaluation is dependent on the used compiler. Check gcov support for
- # each compiler that is used. If gcov binary was already found for this
- # compiler, do not try to find it again.
- if (NOT GCOV_${CMAKE_${LANG}_COMPILER_ID}_BIN)
- get_filename_component(COMPILER_PATH "${CMAKE_${LANG}_COMPILER}" PATH)
-
- if ("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "GNU")
- # Some distributions like OSX (homebrew) ship gcov with the compiler
- # version appended as gcov-x. To find this binary we'll build the
- # suggested binary name with the compiler version.
- string(REGEX MATCH "^[0-9]+" GCC_VERSION
- "${CMAKE_${LANG}_COMPILER_VERSION}")
-
- find_program(GCOV_BIN NAMES gcov-${GCC_VERSION} gcov
- HINTS ${COMPILER_PATH})
-
- elseif ("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Clang")
- # Some distributions like Debian ship llvm-cov with the compiler
- # version appended as llvm-cov-x.y. To find this binary we'll build
- # the suggested binary name with the compiler version.
- string(REGEX MATCH "^[0-9]+.[0-9]+" LLVM_VERSION
- "${CMAKE_${LANG}_COMPILER_VERSION}")
-
- # llvm-cov prior version 3.5 seems to be not working with coverage
- # evaluation tools, but these versions are compatible with the gcc
- # gcov tool.
- if(LLVM_VERSION VERSION_GREATER 3.4)
- find_program(LLVM_COV_BIN NAMES "llvm-cov-${LLVM_VERSION}"
- "llvm-cov" HINTS ${COMPILER_PATH})
- mark_as_advanced(LLVM_COV_BIN)
-
- if (LLVM_COV_BIN)
- find_program(LLVM_COV_WRAPPER "llvm-cov-wrapper" PATHS
- ${CMAKE_MODULE_PATH})
- if (LLVM_COV_WRAPPER)
- set(GCOV_BIN "${LLVM_COV_WRAPPER}" CACHE FILEPATH "")
-
- # set additional parameters
- set(GCOV_${CMAKE_${LANG}_COMPILER_ID}_ENV
- "LLVM_COV_BIN=${LLVM_COV_BIN}" CACHE STRING
- "Environment variables for llvm-cov-wrapper.")
- mark_as_advanced(GCOV_${CMAKE_${LANG}_COMPILER_ID}_ENV)
- endif ()
- endif ()
- endif ()
-
- if (NOT GCOV_BIN)
- # Fall back to gcov binary if llvm-cov was not found or is
- # incompatible. This is the default on OSX, but may crash on
- # recent Linux versions.
- find_program(GCOV_BIN gcov HINTS ${COMPILER_PATH})
- endif ()
- endif ()
-
-
- if (GCOV_BIN)
- set(GCOV_${CMAKE_${LANG}_COMPILER_ID}_BIN "${GCOV_BIN}" CACHE STRING
- "${LANG} gcov binary.")
-
- if (NOT CMAKE_REQUIRED_QUIET)
- message("-- Found gcov evaluation for "
- "${CMAKE_${LANG}_COMPILER_ID}: ${GCOV_BIN}")
- endif()
-
- unset(GCOV_BIN CACHE)
- endif ()
- endif ()
-endforeach ()
-
-
-
-
-# Add a new global target for all gcov targets. This target could be used to
-# generate the gcov files for the whole project instead of calling <TARGET>-gcov
-# for each target.
-if (NOT TARGET gcov)
- add_custom_target(gcov)
-endif (NOT TARGET gcov)
-
-
-
-# This function will add gcov evaluation for target <TNAME>. Only sources of
-# this target will be evaluated and no dependencies will be added. It will call
-# Gcov on any source file of <TNAME> once and store the gcov file in the same
-# directory.
-function (add_gcov_target TNAME)
- set(TDIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TNAME}.dir)
-
- # We don't have to check, if the target has support for coverage, thus this
- # will be checked by add_coverage_target in Findcoverage.cmake. Instead we
- # have to determine which gcov binary to use.
- get_target_property(TSOURCES ${TNAME} SOURCES)
- set(SOURCES "")
- set(TCOMPILER "")
- foreach (FILE ${TSOURCES})
- codecov_path_of_source(${FILE} FILE)
- if (NOT "${FILE}" STREQUAL "")
- codecov_lang_of_source(${FILE} LANG)
- if (NOT "${LANG}" STREQUAL "")
- list(APPEND SOURCES "${FILE}")
- set(TCOMPILER ${CMAKE_${LANG}_COMPILER_ID})
- endif ()
- endif ()
- endforeach ()
-
- # If no gcov binary was found, coverage data can't be evaluated.
- if (NOT GCOV_${TCOMPILER}_BIN)
- message(WARNING "No coverage evaluation binary found for ${TCOMPILER}.")
- return()
- endif ()
-
- set(GCOV_BIN "${GCOV_${TCOMPILER}_BIN}")
- set(GCOV_ENV "${GCOV_${TCOMPILER}_ENV}")
-
-
- set(BUFFER "")
- foreach(FILE ${SOURCES})
- get_filename_component(FILE_PATH "${TDIR}/${FILE}" PATH)
-
- # call gcov
- add_custom_command(OUTPUT ${TDIR}/${FILE}.gcov
- COMMAND ${GCOV_ENV} ${GCOV_BIN} ${TDIR}/${FILE}.gcno > /dev/null
- DEPENDS ${TNAME} ${TDIR}/${FILE}.gcno
- WORKING_DIRECTORY ${FILE_PATH}
- )
-
- list(APPEND BUFFER ${TDIR}/${FILE}.gcov)
- endforeach()
-
-
- # add target for gcov evaluation of <TNAME>
- add_custom_target(${TNAME}-gcov DEPENDS ${BUFFER})
-
- # add evaluation target to the global gcov target.
- add_dependencies(gcov ${TNAME}-gcov)
-endfunction (add_gcov_target)
diff --git a/CMake/FindLcov.cmake b/CMake/FindLcov.cmake
deleted file mode 100644
index beb925ae..00000000
--- a/CMake/FindLcov.cmake
+++ /dev/null
@@ -1,354 +0,0 @@
-# This file is part of CMake-codecov.
-#
-# Copyright (c)
-# 2015-2017 RWTH Aachen University, Federal Republic of Germany
-#
-# See the LICENSE file in the package base directory for details
-#
-# Written by Alexander Haase, alexander.haase@rwth-aachen.de
-#
-
-
-# configuration
-set(LCOV_DATA_PATH "${CMAKE_BINARY_DIR}/lcov/data")
-set(LCOV_DATA_PATH_INIT "${LCOV_DATA_PATH}/init")
-set(LCOV_DATA_PATH_CAPTURE "${LCOV_DATA_PATH}/capture")
-set(LCOV_HTML_PATH "${CMAKE_BINARY_DIR}/lcov/html")
-
-
-
-
-# Search for Gcov which is used by Lcov.
-find_package(Gcov)
-
-
-
-
-# This function will add lcov evaluation for target <TNAME>. Only sources of
-# this target will be evaluated and no dependencies will be added. It will call
-# geninfo on any source file of <TNAME> once and store the info file in the same
-# directory.
-#
-# Note: This function is only a wrapper to define this function always, even if
-# coverage is not supported by the compiler or disabled. This function must
-# be defined here, because the module will be exited, if there is no coverage
-# support by the compiler or it is disabled by the user.
-function (add_lcov_target TNAME)
- if (LCOV_FOUND)
- # capture initial coverage data
- lcov_capture_initial_tgt(${TNAME})
-
- # capture coverage data after execution
- lcov_capture_tgt(${TNAME})
- endif ()
-endfunction (add_lcov_target)
-
-
-
-
-# include required Modules
-include(FindPackageHandleStandardArgs)
-
-# Search for required lcov binaries.
-find_program(LCOV_BIN lcov)
-find_program(GENINFO_BIN geninfo)
-find_program(GENHTML_BIN genhtml)
-find_package_handle_standard_args(lcov
- REQUIRED_VARS LCOV_BIN GENINFO_BIN GENHTML_BIN
-)
-
-# enable genhtml C++ demangeling, if c++filt is found.
-set(GENHTML_CPPFILT_FLAG "")
-find_program(CPPFILT_BIN c++filt)
-if (NOT CPPFILT_BIN STREQUAL "")
- set(GENHTML_CPPFILT_FLAG "--demangle-cpp")
-endif (NOT CPPFILT_BIN STREQUAL "")
-
-# enable no-external flag for lcov, if available.
-if (GENINFO_BIN AND NOT DEFINED GENINFO_EXTERN_FLAG)
- set(FLAG "")
- execute_process(COMMAND ${GENINFO_BIN} --help OUTPUT_VARIABLE GENINFO_HELP)
- string(REGEX MATCH "external" GENINFO_RES "${GENINFO_HELP}")
- if (GENINFO_RES)
- set(FLAG "--no-external")
- endif ()
-
- set(GENINFO_EXTERN_FLAG "${FLAG}"
- CACHE STRING "Geninfo flag to exclude system sources.")
-endif ()
-
-# If Lcov was not found, exit module now.
-if (NOT LCOV_FOUND)
- return()
-endif (NOT LCOV_FOUND)
-
-
-
-
-# Create directories to be used.
-file(MAKE_DIRECTORY ${LCOV_DATA_PATH_INIT})
-file(MAKE_DIRECTORY ${LCOV_DATA_PATH_CAPTURE})
-
-set(LCOV_REMOVE_PATTERNS "")
-
-# This function will merge lcov files to a single target file. Additional lcov
-# flags may be set with setting LCOV_EXTRA_FLAGS before calling this function.
-function (lcov_merge_files OUTFILE ...)
- # Remove ${OUTFILE} from ${ARGV} and generate lcov parameters with files.
- list(REMOVE_AT ARGV 0)
-
- # Generate merged file.
- string(REPLACE "${CMAKE_BINARY_DIR}/" "" FILE_REL "${OUTFILE}")
- add_custom_command(OUTPUT "${OUTFILE}.raw"
- COMMAND cat ${ARGV} > ${OUTFILE}.raw
- DEPENDS ${ARGV}
- COMMENT "Generating ${FILE_REL}"
- )
-
- add_custom_command(OUTPUT "${OUTFILE}"
- COMMAND ${LCOV_BIN} --quiet -a ${OUTFILE}.raw --output-file ${OUTFILE}
- --base-directory ${PROJECT_SOURCE_DIR} ${LCOV_EXTRA_FLAGS}
- COMMAND ${LCOV_BIN} --quiet -r ${OUTFILE} ${LCOV_REMOVE_PATTERNS}
- --output-file ${OUTFILE} ${LCOV_EXTRA_FLAGS}
- DEPENDS ${OUTFILE}.raw
- COMMENT "Post-processing ${FILE_REL}"
- )
-endfunction ()
-
-
-
-
-# Add a new global target to generate initial coverage reports for all targets.
-# This target will be used to generate the global initial info file, which is
-# used to gather even empty report data.
-if (NOT TARGET lcov-capture-init)
- add_custom_target(lcov-capture-init)
- set(LCOV_CAPTURE_INIT_FILES "" CACHE INTERNAL "")
-endif (NOT TARGET lcov-capture-init)
-
-
-# This function will add initial capture of coverage data for target <TNAME>,
-# which is needed to get also data for objects, which were not loaded at
-# execution time. It will call geninfo for every source file of <TNAME> once and
-# store the info file in the same directory.
-function (lcov_capture_initial_tgt TNAME)
- # We don't have to check, if the target has support for coverage, thus this
- # will be checked by add_coverage_target in Findcoverage.cmake. Instead we
- # have to determine which gcov binary to use.
- get_target_property(TSOURCES ${TNAME} SOURCES)
- set(SOURCES "")
- set(TCOMPILER "")
- foreach (FILE ${TSOURCES})
- codecov_path_of_source(${FILE} FILE)
- if (NOT "${FILE}" STREQUAL "")
- codecov_lang_of_source(${FILE} LANG)
- if (NOT "${LANG}" STREQUAL "")
- list(APPEND SOURCES "${FILE}")
- set(TCOMPILER ${CMAKE_${LANG}_COMPILER_ID})
- endif ()
- endif ()
- endforeach ()
-
- # If no gcov binary was found, coverage data can't be evaluated.
- if (NOT GCOV_${TCOMPILER}_BIN)
- message(WARNING "No coverage evaluation binary found for ${TCOMPILER}.")
- return()
- endif ()
-
- set(GCOV_BIN "${GCOV_${TCOMPILER}_BIN}")
- set(GCOV_ENV "${GCOV_${TCOMPILER}_ENV}")
-
-
- set(TDIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TNAME}.dir)
- set(GENINFO_FILES "")
- foreach(FILE ${SOURCES})
- # generate empty coverage files
- set(OUTFILE "${TDIR}/${FILE}.info.init")
- list(APPEND GENINFO_FILES ${OUTFILE})
-
- add_custom_command(OUTPUT ${OUTFILE} COMMAND ${GCOV_ENV} ${GENINFO_BIN}
- --quiet --base-directory ${PROJECT_SOURCE_DIR} --initial
- --gcov-tool ${GCOV_BIN} --output-filename ${OUTFILE}
- ${GENINFO_EXTERN_FLAG} ${TDIR}/${FILE}.gcno
- DEPENDS ${TNAME}
- COMMENT "Capturing initial coverage data for ${FILE}"
- )
- endforeach()
-
- # Concatenate all files generated by geninfo to a single file per target.
- set(OUTFILE "${LCOV_DATA_PATH_INIT}/${TNAME}.info")
- set(LCOV_EXTRA_FLAGS "--initial")
- lcov_merge_files("${OUTFILE}" ${GENINFO_FILES})
- add_custom_target(${TNAME}-capture-init ALL DEPENDS ${OUTFILE})
-
- # add geninfo file generation to global lcov-geninfo target
- add_dependencies(lcov-capture-init ${TNAME}-capture-init)
- set(LCOV_CAPTURE_INIT_FILES "${LCOV_CAPTURE_INIT_FILES}"
- "${OUTFILE}" CACHE INTERNAL ""
- )
-endfunction (lcov_capture_initial_tgt)
-
-
-# This function will generate the global info file for all targets. It has to be
-# called after all other CMake functions in the root CMakeLists.txt file, to get
-# a full list of all targets that generate coverage data.
-function (lcov_capture_initial)
- # Skip this function (and do not create the following targets), if there are
- # no input files.
- if ("${LCOV_CAPTURE_INIT_FILES}" STREQUAL "")
- return()
- endif ()
-
- # Add a new target to merge the files of all targets.
- set(OUTFILE "${LCOV_DATA_PATH_INIT}/all_targets.info")
- lcov_merge_files("${OUTFILE}" ${LCOV_CAPTURE_INIT_FILES})
- add_custom_target(lcov-geninfo-init ALL DEPENDS ${OUTFILE}
- lcov-capture-init
- )
-endfunction (lcov_capture_initial)
-
-
-
-
-# Add a new global target to generate coverage reports for all targets. This
-# target will be used to generate the global info file.
-if (NOT TARGET lcov-capture)
- add_custom_target(lcov-capture)
- set(LCOV_CAPTURE_FILES "" CACHE INTERNAL "")
-endif (NOT TARGET lcov-capture)
-
-
-# This function will add capture of coverage data for target <TNAME>, which is
-# needed to get also data for objects, which were not loaded at execution time.
-# It will call geninfo for every source file of <TNAME> once and store the info
-# file in the same directory.
-function (lcov_capture_tgt TNAME)
- # We don't have to check, if the target has support for coverage, thus this
- # will be checked by add_coverage_target in Findcoverage.cmake. Instead we
- # have to determine which gcov binary to use.
- get_target_property(TSOURCES ${TNAME} SOURCES)
- set(SOURCES "")
- set(TCOMPILER "")
- foreach (FILE ${TSOURCES})
- codecov_path_of_source(${FILE} FILE)
- if (NOT "${FILE}" STREQUAL "")
- codecov_lang_of_source(${FILE} LANG)
- if (NOT "${LANG}" STREQUAL "")
- list(APPEND SOURCES "${FILE}")
- set(TCOMPILER ${CMAKE_${LANG}_COMPILER_ID})
- endif ()
- endif ()
- endforeach ()
-
- # If no gcov binary was found, coverage data can't be evaluated.
- if (NOT GCOV_${TCOMPILER}_BIN)
- message(WARNING "No coverage evaluation binary found for ${TCOMPILER}.")
- return()
- endif ()
-
- set(GCOV_BIN "${GCOV_${TCOMPILER}_BIN}")
- set(GCOV_ENV "${GCOV_${TCOMPILER}_ENV}")
-
-
- set(TDIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TNAME}.dir)
- set(GENINFO_FILES "")
- foreach(FILE ${SOURCES})
- # Generate coverage files. If no .gcda file was generated during
- # execution, the empty coverage file will be used instead.
- set(OUTFILE "${TDIR}/${FILE}.info")
- list(APPEND GENINFO_FILES ${OUTFILE})
-
- add_custom_command(OUTPUT ${OUTFILE}
- COMMAND test -f "${TDIR}/${FILE}.gcda"
- && ${GCOV_ENV} ${GENINFO_BIN} --quiet --base-directory
- ${PROJECT_SOURCE_DIR} --gcov-tool ${GCOV_BIN}
- --output-filename ${OUTFILE} ${GENINFO_EXTERN_FLAG}
- ${TDIR}/${FILE}.gcda
- || cp ${OUTFILE}.init ${OUTFILE}
- DEPENDS ${TNAME} ${TNAME}-capture-init
- COMMENT "Capturing coverage data for ${FILE}"
- )
- endforeach()
-
- # Concatenate all files generated by geninfo to a single file per target.
- set(OUTFILE "${LCOV_DATA_PATH_CAPTURE}/${TNAME}.info")
- lcov_merge_files("${OUTFILE}" ${GENINFO_FILES})
- add_custom_target(${TNAME}-geninfo DEPENDS ${OUTFILE})
-
- # add geninfo file generation to global lcov-capture target
- add_dependencies(lcov-capture ${TNAME}-geninfo)
- set(LCOV_CAPTURE_FILES "${LCOV_CAPTURE_FILES}" "${OUTFILE}" CACHE INTERNAL
- ""
- )
-
- # Add target for generating html output for this target only.
- file(MAKE_DIRECTORY ${LCOV_HTML_PATH}/${TNAME})
- add_custom_target(${TNAME}-genhtml
- COMMAND ${GENHTML_BIN} --quiet --sort --prefix ${PROJECT_SOURCE_DIR}
- --baseline-file ${LCOV_DATA_PATH_INIT}/${TNAME}.info
- --output-directory ${LCOV_HTML_PATH}/${TNAME}
- --title "${CMAKE_PROJECT_NAME} - target ${TNAME}"
- ${GENHTML_CPPFILT_FLAG} ${OUTFILE}
- DEPENDS ${TNAME}-geninfo ${TNAME}-capture-init
- )
-endfunction (lcov_capture_tgt)
-
-
-# This function will generate the global info file for all targets. It has to be
-# called after all other CMake functions in the root CMakeLists.txt file, to get
-# a full list of all targets that generate coverage data.
-function (lcov_capture)
- # Skip this function (and do not create the following targets), if there are
- # no input files.
- if ("${LCOV_CAPTURE_FILES}" STREQUAL "")
- return()
- endif ()
-
- # Add a new target to merge the files of all targets.
- set(OUTFILE "${LCOV_DATA_PATH_CAPTURE}/all_targets.info")
- lcov_merge_files("${OUTFILE}" ${LCOV_CAPTURE_FILES})
- add_custom_target(lcov-geninfo DEPENDS ${OUTFILE} lcov-capture)
-
- # Add a new global target for all lcov targets. This target could be used to
- # generate the lcov html output for the whole project instead of calling
- # <TARGET>-geninfo and <TARGET>-genhtml for each target. It will also be
- # used to generate a html site for all project data together instead of one
- # for each target.
- if (NOT TARGET lcov)
- file(MAKE_DIRECTORY ${LCOV_HTML_PATH}/all_targets)
- add_custom_target(lcov
- COMMAND ${GENHTML_BIN} --quiet --sort
- --baseline-file ${LCOV_DATA_PATH_INIT}/all_targets.info
- --output-directory ${LCOV_HTML_PATH}/all_targets
- --title "${CMAKE_PROJECT_NAME}" --prefix "${PROJECT_SOURCE_DIR}"
- ${GENHTML_CPPFILT_FLAG} ${OUTFILE}
- DEPENDS lcov-geninfo-init lcov-geninfo
- )
- endif ()
-endfunction (lcov_capture)
-
-
-
-
-# Add a new global target to generate the lcov html report for the whole project
-# instead of calling <TARGET>-genhtml for each target (to create an own report
-# for each target). Instead of the lcov target it does not require geninfo for
-# all targets, so you have to call <TARGET>-geninfo to generate the info files
-# the targets you'd like to have in your report or lcov-geninfo for generating
-# info files for all targets before calling lcov-genhtml.
-file(MAKE_DIRECTORY ${LCOV_HTML_PATH}/selected_targets)
-if (NOT TARGET lcov-genhtml)
- add_custom_target(lcov-genhtml
- COMMAND ${GENHTML_BIN}
- --quiet
- --output-directory ${LCOV_HTML_PATH}/selected_targets
- --title \"${CMAKE_PROJECT_NAME} - targets `find
- ${LCOV_DATA_PATH_CAPTURE} -name \"*.info\" ! -name
- \"all_targets.info\" -exec basename {} .info \\\;`\"
- --prefix ${PROJECT_SOURCE_DIR}
- --sort
- ${GENHTML_CPPFILT_FLAG}
- `find ${LCOV_DATA_PATH_CAPTURE} -name \"*.info\" ! -name
- \"all_targets.info\"`
- )
-endif (NOT TARGET lcov-genhtml)
diff --git a/CMake/Findcodecov.cmake b/CMake/Findcodecov.cmake
deleted file mode 100644
index 2c0f2fee..00000000
--- a/CMake/Findcodecov.cmake
+++ /dev/null
@@ -1,258 +0,0 @@
-# This file is part of CMake-codecov.
-#
-# Copyright (c)
-# 2015-2017 RWTH Aachen University, Federal Republic of Germany
-#
-# See the LICENSE file in the package base directory for details
-#
-# Written by Alexander Haase, alexander.haase@rwth-aachen.de
-#
-
-
-# Add an option to choose, if coverage should be enabled or not. If enabled
-# marked targets will be build with coverage support and appropriate targets
-# will be added. If disabled coverage will be ignored for *ALL* targets.
-option(ENABLE_COVERAGE "Enable coverage build." OFF)
-
-set(COVERAGE_FLAG_CANDIDATES
- # gcc and clang
- "-O0 -g -fprofile-arcs -ftest-coverage"
-
- # gcc and clang fallback
- "-O0 -g --coverage"
-)
-
-
-# Add coverage support for target ${TNAME} and register target for coverage
-# evaluation. If coverage is disabled or not supported, this function will
-# simply do nothing.
-#
-# Note: This function is only a wrapper to define this function always, even if
-# coverage is not supported by the compiler or disabled. This function must
-# be defined here, because the module will be exited, if there is no coverage
-# support by the compiler or it is disabled by the user.
-function (add_coverage TNAME)
- # only add coverage for target, if coverage is support and enabled.
- if (ENABLE_COVERAGE)
- foreach (TNAME ${ARGV})
- add_coverage_target(${TNAME})
- endforeach ()
- endif ()
-endfunction (add_coverage)
-
-
-# Add global target to gather coverage information after all targets have been
-# added. Other evaluation functions could be added here, after checks for the
-# specific module have been passed.
-#
-# Note: This function is only a wrapper to define this function always, even if
-# coverage is not supported by the compiler or disabled. This function must
-# be defined here, because the module will be exited, if there is no coverage
-# support by the compiler or it is disabled by the user.
-function (coverage_evaluate)
- # add lcov evaluation
- if (LCOV_FOUND)
- lcov_capture_initial()
- lcov_capture()
- endif (LCOV_FOUND)
-endfunction ()
-
-
-# Exit this module, if coverage is disabled. add_coverage is defined before this
-# return, so this module can be exited now safely without breaking any build-
-# scripts.
-if (NOT ENABLE_COVERAGE)
- return()
-endif ()
-
-
-
-
-# Find the reuired flags foreach language.
-set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
-set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY})
-
-get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
-foreach (LANG ${ENABLED_LANGUAGES})
- # Coverage flags are not dependent on language, but the used compiler. So
- # instead of searching flags foreach language, search flags foreach compiler
- # used.
- set(COMPILER ${CMAKE_${LANG}_COMPILER_ID})
- if (NOT COVERAGE_${COMPILER}_FLAGS)
- foreach (FLAG ${COVERAGE_FLAG_CANDIDATES})
- if(NOT CMAKE_REQUIRED_QUIET)
- message(STATUS "Try ${COMPILER} code coverage flag = [${FLAG}]")
- endif()
-
- set(CMAKE_REQUIRED_FLAGS "${FLAG}")
- unset(COVERAGE_FLAG_DETECTED CACHE)
-
- if (${LANG} STREQUAL "C")
- include(CheckCCompilerFlag)
- check_c_compiler_flag("${FLAG}" COVERAGE_FLAG_DETECTED)
-
- elseif (${LANG} STREQUAL "CXX")
- include(CheckCXXCompilerFlag)
- check_cxx_compiler_flag("${FLAG}" COVERAGE_FLAG_DETECTED)
-
- elseif (${LANG} STREQUAL "Fortran")
- # CheckFortranCompilerFlag was introduced in CMake 3.x. To be
- # compatible with older Cmake versions, we will check if this
- # module is present before we use it. Otherwise we will define
- # Fortran coverage support as not available.
- include(CheckFortranCompilerFlag OPTIONAL
- RESULT_VARIABLE INCLUDED)
- if (INCLUDED)
- check_fortran_compiler_flag("${FLAG}"
- COVERAGE_FLAG_DETECTED)
- elseif (NOT CMAKE_REQUIRED_QUIET)
- message("-- Performing Test COVERAGE_FLAG_DETECTED")
- message("-- Performing Test COVERAGE_FLAG_DETECTED - Failed"
- " (Check not supported)")
- endif ()
- endif()
-
- if (COVERAGE_FLAG_DETECTED)
- set(COVERAGE_${COMPILER}_FLAGS "${FLAG}"
- CACHE STRING "${COMPILER} flags for code coverage.")
- mark_as_advanced(COVERAGE_${COMPILER}_FLAGS)
- break()
- else ()
- message(WARNING "Code coverage is not available for ${COMPILER}"
- " compiler. Targets using this compiler will be "
- "compiled without it.")
- endif ()
- endforeach ()
- endif ()
-endforeach ()
-
-set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
-
-
-
-
-# Helper function to get the language of a source file.
-function (codecov_lang_of_source FILE RETURN_VAR)
- get_filename_component(FILE_EXT "${FILE}" EXT)
- string(TOLOWER "${FILE_EXT}" FILE_EXT)
- string(SUBSTRING "${FILE_EXT}" 1 -1 FILE_EXT)
-
- get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
- foreach (LANG ${ENABLED_LANGUAGES})
- list(FIND CMAKE_${LANG}_SOURCE_FILE_EXTENSIONS "${FILE_EXT}" TEMP)
- if (NOT ${TEMP} EQUAL -1)
- set(${RETURN_VAR} "${LANG}" PARENT_SCOPE)
- return()
- endif ()
- endforeach()
-
- set(${RETURN_VAR} "" PARENT_SCOPE)
-endfunction ()
-
-
-# Helper function to get the relative path of the source file destination path.
-# This path is needed by FindGcov and FindLcov cmake files to locate the
-# captured data.
-function (codecov_path_of_source FILE RETURN_VAR)
- string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _source ${FILE})
-
- # If expression was found, SOURCEFILE is a generator-expression for an
- # object library. Currently we found no way to call this function automatic
- # for the referenced target, so it must be called in the directoryso of the
- # object library definition.
- if (NOT "${_source}" STREQUAL "")
- set(${RETURN_VAR} "" PARENT_SCOPE)
- return()
- endif ()
-
-
- string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" FILE "${FILE}")
- if(IS_ABSOLUTE ${FILE})
- file(RELATIVE_PATH FILE ${CMAKE_CURRENT_SOURCE_DIR} ${FILE})
- endif()
-
- # get the right path for file
- string(REPLACE ".." "__" PATH "${FILE}")
-
- set(${RETURN_VAR} "${PATH}" PARENT_SCOPE)
-endfunction()
-
-
-
-
-# Add coverage support for target ${TNAME} and register target for coverage
-# evaluation.
-function(add_coverage_target TNAME)
- # Check if all sources for target use the same compiler. If a target uses
- # e.g. C and Fortran mixed and uses different compilers (e.g. clang and
- # gfortran) this can trigger huge problems, because different compilers may
- # use different implementations for code coverage.
- get_target_property(TSOURCES ${TNAME} SOURCES)
- set(TARGET_COMPILER "")
- set(ADDITIONAL_FILES "")
- foreach (FILE ${TSOURCES})
- # If expression was found, FILE is a generator-expression for an object
- # library. Object libraries will be ignored.
- string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _file ${FILE})
- if ("${_file}" STREQUAL "")
- codecov_lang_of_source(${FILE} LANG)
- if (LANG)
- list(APPEND TARGET_COMPILER ${CMAKE_${LANG}_COMPILER_ID})
-
- list(APPEND ADDITIONAL_FILES "${FILE}.gcno")
- list(APPEND ADDITIONAL_FILES "${FILE}.gcda")
- endif ()
- endif ()
- endforeach ()
-
- list(REMOVE_DUPLICATES TARGET_COMPILER)
- list(LENGTH TARGET_COMPILER NUM_COMPILERS)
-
- if (NUM_COMPILERS GREATER 1)
- message(WARNING "Can't use code coverage for target ${TNAME}, because "
- "it will be compiled by incompatible compilers. Target will be "
- "compiled without code coverage.")
- return()
-
- elseif (NUM_COMPILERS EQUAL 0)
- message(WARNING "Can't use code coverage for target ${TNAME}, because "
- "it uses an unknown compiler. Target will be compiled without "
- "code coverage.")
- return()
-
- elseif (NOT DEFINED "COVERAGE_${TARGET_COMPILER}_FLAGS")
- # A warning has been printed before, so just return if flags for this
- # compiler aren't available.
- return()
- endif()
-
-
- # enable coverage for target
- set_property(TARGET ${TNAME} APPEND_STRING
- PROPERTY COMPILE_FLAGS " ${COVERAGE_${TARGET_COMPILER}_FLAGS}")
- set_property(TARGET ${TNAME} APPEND_STRING
- PROPERTY LINK_FLAGS " ${COVERAGE_${TARGET_COMPILER}_FLAGS}")
-
-
- # Add gcov files generated by compiler to clean target.
- set(CLEAN_FILES "")
- foreach (FILE ${ADDITIONAL_FILES})
- codecov_path_of_source(${FILE} FILE)
- list(APPEND CLEAN_FILES "CMakeFiles/${TNAME}.dir/${FILE}")
- endforeach()
-
- set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
- "${CLEAN_FILES}")
-
-
- add_gcov_target(${TNAME})
- add_lcov_target(${TNAME})
-endfunction(add_coverage_target)
-
-
-
-
-# Include modules for parsing the collected data and output it in a readable
-# format (like gcov and lcov).
-find_package(Gcov)
-find_package(Lcov)
diff --git a/CMake/MiscFunctions.cmake b/CMake/MiscFunctions.cmake
deleted file mode 100644
index 262f7cd8..00000000
--- a/CMake/MiscFunctions.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-#checks that the given hard-coded list contains all headers + sources in the given folder
-function(CheckFileList LIST_VAR FOLDER)
- set(MESSAGE " should be added to the variable ${LIST_VAR}")
- set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
- file(GLOB GLOBBED_LIST "${FOLDER}/*.cpp"
- "${FOLDER}/*.hpp"
- "${FOLDER}/*.h")
- list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
- foreach(EXTRA_ITEM ${GLOBBED_LIST})
- string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
- message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
- endforeach()
-endfunction()
-
-function(CheckFileListRec LIST_VAR FOLDER)
- set(MESSAGE " should be added to the variable ${LIST_VAR}")
- set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
- file(GLOB_RECURSE GLOBBED_LIST "${FOLDER}/*.cpp"
- "${FOLDER}/*.hpp"
- "${FOLDER}/*.h")
- list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
- foreach(EXTRA_ITEM ${GLOBBED_LIST})
- string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
- message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
- endforeach()
-endfunction()
diff --git a/CMake/catch2.pc.in b/CMake/catch2.pc.in
deleted file mode 100644
index 3ac9fbd1..00000000
--- a/CMake/catch2.pc.in
+++ /dev/null
@@ -1,7 +0,0 @@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: Catch2
-Description: A modern, C++-native, header-only, test framework for C++11
-URL: https://github.com/catchorg/Catch2
-Version: @Catch2_VERSION@
-Cflags: -I${includedir}
diff --git a/CMake/llvm-cov-wrapper b/CMake/llvm-cov-wrapper
deleted file mode 100755
index 2ac33102..00000000
--- a/CMake/llvm-cov-wrapper
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-# This file is part of CMake-codecov.
-#
-# Copyright (c)
-# 2015-2017 RWTH Aachen University, Federal Republic of Germany
-#
-# See the LICENSE file in the package base directory for details
-#
-# Written by Alexander Haase, alexander.haase@rwth-aachen.de
-#
-
-if [ -z "$LLVM_COV_BIN" ]
-then
- echo "LLVM_COV_BIN not set!" >& 2
- exit 1
-fi
-
-
-# Get LLVM version to find out.
-LLVM_VERSION=$($LLVM_COV_BIN -version | grep -i "LLVM version" \
- | sed "s/^\([A-Za-z ]*\)\([0-9]\).\([0-9]\).*$/\2.\3/g")
-
-if [ "$1" = "-v" ]
-then
- echo "llvm-cov-wrapper $LLVM_VERSION"
- exit 0
-fi
-
-
-if [ -n "$LLVM_VERSION" ]
-then
- MAJOR=$(echo $LLVM_VERSION | cut -d'.' -f1)
- MINOR=$(echo $LLVM_VERSION | cut -d'.' -f2)
-
- if [ $MAJOR -eq 3 ] && [ $MINOR -le 4 ]
- then
- if [ -f "$1" ]
- then
- filename=$(basename "$1")
- extension="${filename##*.}"
-
- case "$extension" in
- "gcno") exec $LLVM_COV_BIN --gcno="$1" ;;
- "gcda") exec $LLVM_COV_BIN --gcda="$1" ;;
- esac
- fi
- fi
-
- if [ $MAJOR -eq 3 ] && [ $MINOR -le 5 ]
- then
- exec $LLVM_COV_BIN $@
- fi
-fi
-
-exec $LLVM_COV_BIN gcov $@
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index ad04dec1..00000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,233 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# detect if Catch is being bundled,
-# disable testsuite in that case
-if(NOT DEFINED PROJECT_NAME)
- set(NOT_SUBPROJECT ON)
-endif()
-
-# Catch2's build breaks if done in-tree. You probably should not build
-# things in tree anyway, but we can allow projects that include Catch2
-# as a subproject to build in-tree as long as it is not in our tree.
-if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
-endif()
-
-
-project(Catch2 LANGUAGES CXX VERSION 2.11.2)
-
-# Provide path for scripts
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
-
-include(GNUInstallDirs)
-include(CMakePackageConfigHelpers)
-include(CTest)
-
-option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF)
-option(CATCH_BUILD_TESTING "Build SelfTest project" ON)
-option(CATCH_BUILD_EXAMPLES "Build documentation examples" OFF)
-option(CATCH_BUILD_EXTRA_TESTS "Build extra tests" OFF)
-option(CATCH_ENABLE_COVERAGE "Generate coverage for codecov.io" OFF)
-option(CATCH_ENABLE_WERROR "Enable all warnings as errors" ON)
-option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
-option(CATCH_INSTALL_HELPERS "Install contrib alongside library" ON)
-
-
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
-# define some folders
-set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
-set(BENCHMARK_DIR ${CATCH_DIR}/projects/Benchmark)
-set(HEADER_DIR ${CATCH_DIR}/include)
-
-if(USE_WMAIN)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
-endif()
-
-if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT)
- find_package(PythonInterp)
- if (NOT PYTHONINTERP_FOUND)
- message(FATAL_ERROR "Python not found, but required for tests")
- endif()
- add_subdirectory(projects)
-endif()
-
-if(CATCH_BUILD_EXAMPLES)
- add_subdirectory(examples)
-endif()
-
-if(CATCH_BUILD_EXTRA_TESTS)
- add_subdirectory(projects/ExtraTests)
-endif()
-
-# add catch as a 'linkable' target
-add_library(Catch2 INTERFACE)
-
-
-
-# depend on some obvious c++11 features so the dependency is transitively added dependents
-target_compile_features(Catch2
- INTERFACE
- cxx_alignas
- cxx_alignof
- cxx_attributes
- cxx_auto_type
- cxx_constexpr
- cxx_defaulted_functions
- cxx_deleted_functions
- cxx_final
- cxx_lambdas
- cxx_noexcept
- cxx_override
- cxx_range_for
- cxx_rvalue_references
- cxx_static_assert
- cxx_strong_enums
- cxx_trailing_return_types
- cxx_unicode_literals
- cxx_user_literals
- cxx_variadic_macros
-)
-
-target_include_directories(Catch2
- INTERFACE
- $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/single_include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
-)
-
-if (ANDROID)
- target_link_libraries(Catch2 INTERFACE log)
-endif()
-
-# provide a namespaced alias for clients to 'link' against if catch is included as a sub-project
-add_library(Catch2::Catch2 ALIAS Catch2)
-
-# Only perform the installation steps when Catch is not being used as
-# a subproject via `add_subdirectory`, or the destinations will break,
-# see https://github.com/catchorg/Catch2/issues/1373
-if (NOT_SUBPROJECT)
- set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
-
- configure_package_config_file(
- ${CMAKE_CURRENT_LIST_DIR}/CMake/Catch2Config.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/Catch2Config.cmake
- INSTALL_DESTINATION
- ${CATCH_CMAKE_CONFIG_DESTINATION}
- )
-
-
- # create and install an export set for catch target as Catch2::Catch
- install(
- TARGETS
- Catch2
- EXPORT
- Catch2Targets
- DESTINATION
- ${CMAKE_INSTALL_LIBDIR}
- )
-
-
- install(
- EXPORT
- Catch2Targets
- NAMESPACE
- Catch2::
- DESTINATION
- ${CATCH_CMAKE_CONFIG_DESTINATION}
- )
-
- # By default, FooConfigVersion is tied to architecture that it was
- # generated on. Because Catch2 is header-only, it is arch-independent
- # and thus Catch2ConfigVersion should not be tied to the architecture
- # it was generated on.
- #
- # CMake does not provide a direct customization point for this in
- # `write_basic_package_version_file`, but it can be accomplished
- # indirectly by temporarily redefining `CMAKE_SIZEOF_VOID_P` to an
- # empty string. Note that just undefining the variable could be
- # insufficient in cases where the variable was already in CMake cache
- set(CATCH2_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
- set(CMAKE_SIZEOF_VOID_P "")
- write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
- COMPATIBILITY
- SameMajorVersion
- )
- set(CMAKE_SIZEOF_VOID_P ${CATCH2_CMAKE_SIZEOF_VOID_P})
-
- install(
- DIRECTORY
- "single_include/"
- DESTINATION
- "${CMAKE_INSTALL_INCLUDEDIR}"
- )
-
- install(
- FILES
- "${CMAKE_CURRENT_BINARY_DIR}/Catch2Config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
- DESTINATION
- ${CATCH_CMAKE_CONFIG_DESTINATION}
- )
-
- # Install documentation
- if(CATCH_INSTALL_DOCS)
- install(
- DIRECTORY
- docs/
- DESTINATION
- "${CMAKE_INSTALL_DOCDIR}"
- )
- endif()
-
- if(CATCH_INSTALL_HELPERS)
- # Install CMake scripts
- install(
- FILES
- "contrib/ParseAndAddCatchTests.cmake"
- "contrib/Catch.cmake"
- "contrib/CatchAddTests.cmake"
- DESTINATION
- ${CATCH_CMAKE_CONFIG_DESTINATION}
- )
-
- # Install debugger helpers
- install(
- FILES
- "contrib/gdbinit"
- "contrib/lldbinit"
- DESTINATION
- ${CMAKE_INSTALL_DATAROOTDIR}/Catch2
- )
- endif()
-
- ## Provide some pkg-config integration
- set(PKGCONFIG_INSTALL_DIR
- "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
- CACHE PATH "Path where catch2.pc is installed"
- )
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/catch2.pc
- @ONLY
- )
- install(
- FILES
- "${CMAKE_CURRENT_BINARY_DIR}/catch2.pc"
- DESTINATION
- ${PKGCONFIG_INSTALL_DIR}
- )
-
- # CPack/CMake started taking the package version from project version 3.12
- # So we need to set the version manually for older CMake versions
- if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
- set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
- endif()
-
- set(CPACK_PACKAGE_CONTACT "https://github.com/catchorg/Catch2/")
-
-
- include( CPack )
-
-endif(NOT_SUBPROJECT)
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index be1a688e..00000000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at github@philnash.me. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/LICENSE b/LICENSE
deleted file mode 120000
index 85de3d45..00000000
--- a/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-LICENSE.txt \ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 36b7cd93..00000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/METADATA b/METADATA
deleted file mode 100644
index 55f54b41..00000000
--- a/METADATA
+++ /dev/null
@@ -1,20 +0,0 @@
-name: "catch"
-description: "A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)"
-third_party {
- url {
- type: HOMEPAGE
- value: "http://catch-lib.net"
- }
- url {
- type: GIT
- value: "https://github.com/catchorg/Catch2.git"
- }
- version: "v2.11.2"
- license_note: "would be NOTICE save for scripts/updateDocumentToC.py"
- license_type: RESTRICTED
- last_upgrade_date {
- year: 2020
- month: 3
- day: 19
- }
-}
diff --git a/MODULE_LICENSE_BOOST b/MODULE_LICENSE_BOOST
deleted file mode 100644
index e69de29b..00000000
--- a/MODULE_LICENSE_BOOST
+++ /dev/null
diff --git a/NOTICE b/NOTICE
deleted file mode 120000
index 85de3d45..00000000
--- a/NOTICE
+++ /dev/null
@@ -1 +0,0 @@
-LICENSE.txt \ No newline at end of file
diff --git a/OWNERS b/OWNERS
index 5778e281..7529cb92 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,3 +1 @@
-# Default code reviewers picked from top 3 or more developers.
-# Please update this list if you find better candidates.
-iam@google.com
+include platform/system/core:/janitors/OWNERS
diff --git a/README.md b/README.md
deleted file mode 100644
index 3167d24d..00000000
--- a/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-<a id="top"></a>
-![catch logo](artwork/catch2-logo-small.png)
-
-[![Github Releases](https://img.shields.io/github/release/catchorg/catch2.svg)](https://github.com/catchorg/catch2/releases)
-[![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](https://travis-ci.org/catchorg/Catch2)
-[![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true)](https://ci.appveyor.com/project/catchorg/catch2)
-[![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2)
-[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/ZI5SYb7JE1UJhAKP)
-[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
-
-
-<a href="https://github.com/catchorg/Catch2/releases/download/v2.11.2/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
-
-## Catch2 is released!
-
-If you've been using an earlier version of Catch, please see the
-Breaking Changes section of [the release notes](https://github.com/catchorg/Catch2/releases/tag/v2.0.1)
-before moving to Catch2. You might also like to read [this blog post](https://levelofindirection.com/blog/catch2-released.html) for more details.
-
-## What's the Catch?
-
-Catch2 is a multi-paradigm test framework for C++. which also supports
-Objective-C (and maybe C).
-It is primarily distributed as a single header file, although certain
-extensions may require additional headers.
-
-## How to use it
-This documentation comprises these three parts:
-
-* [Why do we need yet another C++ Test Framework?](docs/why-catch.md#top)
-* [Tutorial](docs/tutorial.md#top) - getting started
-* [Reference section](docs/Readme.md#top) - all the details
-
-## More
-* Issues and bugs can be raised on the [Issue tracker on GitHub](https://github.com/catchorg/Catch2/issues)
-* For discussion or questions please use [the dedicated Google Groups forum](https://groups.google.com/forum/?fromgroups#!forum/catch-forum) or our [Discord](https://discord.gg/4CWS9zD)
-* See [who else is using Catch2](docs/opensource-users.md#top)
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index dfd44316..00000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,101 +0,0 @@
-# version string format -- This will be overwritten later anyway
-version: "{build}"
-
-# We need a more up to date pip because Python 2.7 is EOL soon
-init:
- - set PATH=C:\Python35\Scripts;%PATH%
-
-
-branches:
- except:
- - /dev-travis.+/
-
-os:
- - Visual Studio 2017
- - Visual Studio 2015
-
-environment:
- matrix:
- - additional_flags: "/permissive- /std:c++latest"
- wmain: 0
-
- - additional_flags: ""
- wmain: 0
-
- - additional_flags: "/D_UNICODE /DUNICODE"
- wmain: 1
- coverage: 0
-
- # Have a coverage dimension
- - additional_flags: ""
- wmain: 0
- coverage: 1
-
- # Have an examples dimension
- - additional_flags: ""
- wmain: 0
- examples: 1
-
-
-matrix:
- exclude:
- - os: Visual Studio 2015
- additional_flags: "/permissive- /std:c++latest"
-
- - os: Visual Studio 2015
- additional_flags: "/D_UNICODE /DUNICODE"
-
- # Exclude unwanted coverage configurations
- - coverage: 1
- platform: Win32
-
- - coverage: 1
- os: Visual Studio 2015
-
- - coverage: 1
- configuration: Release
-
- # Exclude unwanted examples configurations
- - examples: 1
- platform: Win32
-
- - examples: 1
- os: Visual Studio 2015
-
- - examples: 1
- configuration: Release
-
-
-install:
- - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { pip --disable-pip-version-check install codecov }
- - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { .\misc\installOpenCppCoverage.ps1 }
-
-# Win32 and x64 are CMake-compatible solution platform names.
-# This allows us to pass %PLATFORM% to CMake -A.
-platform:
- - Win32
- - x64
-
-# build Configurations, i.e. Debug, Release, etc.
-configuration:
- - Debug
- - Release
-
-#Cmake will autodetect the compiler, but we set the arch
-before_build:
- - set CXXFLAGS=%additional_flags%
- # Indirection because appveyor doesn't handle multiline batch scripts properly
- # https://stackoverflow.com/questions/37627248/how-to-split-a-command-over-multiple-lines-in-appveyor-yml/37647169#37647169
- # https://help.appveyor.com/discussions/questions/3888-multi-line-cmd-or-powershell-warning-ignore
- - cmd: .\misc\appveyorBuildConfigurationScript.bat
-
-
-# build with MSBuild
-build:
- project: Build\Catch2.sln # path to Visual Studio solution or project
- parallel: true # enable MSBuild parallel builds
- verbosity: normal # MSBuild verbosity level {quiet|minimal|normal|detailed}
-
-test_script:
- - set CTEST_OUTPUT_ON_FAILURE=1
- - cmd: .\misc\appveyorTestRunScript.bat
diff --git a/artwork/catch2-c-logo.png b/artwork/catch2-c-logo.png
deleted file mode 100644
index b1066b8e..00000000
--- a/artwork/catch2-c-logo.png
+++ /dev/null
Binary files differ
diff --git a/artwork/catch2-hand-logo.png b/artwork/catch2-hand-logo.png
deleted file mode 100644
index ab857eaa..00000000
--- a/artwork/catch2-hand-logo.png
+++ /dev/null
Binary files differ
diff --git a/artwork/catch2-logo-small.png b/artwork/catch2-logo-small.png
deleted file mode 100644
index 742e81e1..00000000
--- a/artwork/catch2-logo-small.png
+++ /dev/null
Binary files differ
diff --git a/codecov.yml b/codecov.yml
deleted file mode 100644
index 75809ee2..00000000
--- a/codecov.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-coverage:
- precision: 2
- round: nearest
- range: "60...90"
- status:
- project:
- default:
- threshold: 2%
- patch:
- default:
- target: 80%
- ignore:
- - "projects/SelfTest"
- - "**/catch_reporter_tap.hpp"
- - "**/catch_reporter_automake.hpp"
- - "**/catch_reporter_teamcity.hpp"
- - "**/catch_reporter_sonarqube.hpp"
- - "**/external/clara.hpp"
-
-
-codecov:
- branch: master
-
-comment:
- layout: "diff"
diff --git a/conanfile.py b/conanfile.py
deleted file mode 100644
index 8d407baf..00000000
--- a/conanfile.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-from conans import ConanFile, CMake
-
-
-class CatchConan(ConanFile):
- name = "Catch2"
- description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD"
- topics = ("conan", "catch2", "header-only", "unit-test", "tdd", "bdd")
- url = "https://github.com/catchorg/Catch2"
- homepage = url
- license = "BSL-1.0"
- exports = "LICENSE.txt"
- exports_sources = ("single_include/*", "CMakeLists.txt", "CMake/*", "contrib/*")
- generators = "cmake"
-
- def package(self):
- cmake = CMake(self)
- cmake.definitions["BUILD_TESTING"] = "OFF"
- cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF"
- cmake.definitions["CATCH_INSTALL_HELPERS"] = "ON"
- cmake.configure(build_folder='build')
- cmake.install()
-
- self.copy(pattern="LICENSE.txt", dst="licenses")
-
- def package_id(self):
- self.info.header_only()
diff --git a/contrib/Catch.cmake b/contrib/Catch.cmake
deleted file mode 100644
index 486e3233..00000000
--- a/contrib/Catch.cmake
+++ /dev/null
@@ -1,175 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-#[=======================================================================[.rst:
-Catch
------
-
-This module defines a function to help use the Catch test framework.
-
-The :command:`catch_discover_tests` discovers tests by asking the compiled test
-executable to enumerate its tests. This does not require CMake to be re-run
-when tests change. However, it may not work in a cross-compiling environment,
-and setting test properties is less convenient.
-
-This command is intended to replace use of :command:`add_test` to register
-tests, and will create a separate CTest test for each Catch test case. Note
-that this is in some cases less efficient, as common set-up and tear-down logic
-cannot be shared by multiple test cases executing in the same instance.
-However, it provides more fine-grained pass/fail information to CTest, which is
-usually considered as more beneficial. By default, the CTest test name is the
-same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
-
-.. command:: catch_discover_tests
-
- Automatically add tests with CTest by querying the compiled test executable
- for available tests::
-
- catch_discover_tests(target
- [TEST_SPEC arg1...]
- [EXTRA_ARGS arg1...]
- [WORKING_DIRECTORY dir]
- [TEST_PREFIX prefix]
- [TEST_SUFFIX suffix]
- [PROPERTIES name1 value1...]
- [TEST_LIST var]
- )
-
- ``catch_discover_tests`` sets up a post-build command on the test executable
- that generates the list of tests by parsing the output from running the test
- with the ``--list-test-names-only`` argument. This ensures that the full
- list of tests is obtained. Since test discovery occurs at build time, it is
- not necessary to re-run CMake when the list of tests changes.
- However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
- in order to function in a cross-compiling environment.
-
- Additionally, setting properties on tests is somewhat less convenient, since
- the tests are not available at CMake time. Additional test properties may be
- assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
- more fine-grained test control is needed, custom content may be provided
- through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
- directory property. The set of discovered tests is made accessible to such a
- script via the ``<target>_TESTS`` variable.
-
- The options are:
-
- ``target``
- Specifies the Catch executable, which must be a known CMake executable
- target. CMake will substitute the location of the built executable when
- running the test.
-
- ``TEST_SPEC arg1...``
- Specifies test cases, wildcarded test cases, tags and tag expressions to
- pass to the Catch executable with the ``--list-test-names-only`` argument.
-
- ``EXTRA_ARGS arg1...``
- Any extra arguments to pass on the command line to each test case.
-
- ``WORKING_DIRECTORY dir``
- Specifies the directory in which to run the discovered test cases. If this
- option is not provided, the current binary directory is used.
-
- ``TEST_PREFIX prefix``
- Specifies a ``prefix`` to be prepended to the name of each discovered test
- case. This can be useful when the same test executable is being used in
- multiple calls to ``catch_discover_tests()`` but with different
- ``TEST_SPEC`` or ``EXTRA_ARGS``.
-
- ``TEST_SUFFIX suffix``
- Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
- every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
- be specified.
-
- ``PROPERTIES name1 value1...``
- Specifies additional properties to be set on all tests discovered by this
- invocation of ``catch_discover_tests``.
-
- ``TEST_LIST var``
- Make the list of tests available in the variable ``var``, rather than the
- default ``<target>_TESTS``. This can be useful when the same test
- executable is being used in multiple calls to ``catch_discover_tests()``.
- Note that this variable is only available in CTest.
-
-#]=======================================================================]
-
-#------------------------------------------------------------------------------
-function(catch_discover_tests TARGET)
- cmake_parse_arguments(
- ""
- ""
- "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST"
- "TEST_SPEC;EXTRA_ARGS;PROPERTIES"
- ${ARGN}
- )
-
- if(NOT _WORKING_DIRECTORY)
- set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
- endif()
- if(NOT _TEST_LIST)
- set(_TEST_LIST ${TARGET}_TESTS)
- endif()
-
- ## Generate a unique name based on the extra arguments
- string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}")
- string(SUBSTRING ${args_hash} 0 7 args_hash)
-
- # Define rule to generate test list for aforementioned test executable
- set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
- set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
- get_property(crosscompiling_emulator
- TARGET ${TARGET}
- PROPERTY CROSSCOMPILING_EMULATOR
- )
- add_custom_command(
- TARGET ${TARGET} POST_BUILD
- BYPRODUCTS "${ctest_tests_file}"
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TARGET=${TARGET}"
- -D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
- -D "TEST_EXECUTOR=${crosscompiling_emulator}"
- -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
- -D "TEST_SPEC=${_TEST_SPEC}"
- -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
- -D "TEST_PROPERTIES=${_PROPERTIES}"
- -D "TEST_PREFIX=${_TEST_PREFIX}"
- -D "TEST_SUFFIX=${_TEST_SUFFIX}"
- -D "TEST_LIST=${_TEST_LIST}"
- -D "CTEST_FILE=${ctest_tests_file}"
- -P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
- VERBATIM
- )
-
- file(WRITE "${ctest_include_file}"
- "if(EXISTS \"${ctest_tests_file}\")\n"
- " include(\"${ctest_tests_file}\")\n"
- "else()\n"
- " add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
- "endif()\n"
- )
-
- if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
- # Add discovered tests to directory TEST_INCLUDE_FILES
- set_property(DIRECTORY
- APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
- )
- else()
- # Add discovered tests as directory TEST_INCLUDE_FILE if possible
- get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
- if (NOT ${test_include_file_set})
- set_property(DIRECTORY
- PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
- )
- else()
- message(FATAL_ERROR
- "Cannot set more than one TEST_INCLUDE_FILE"
- )
- endif()
- endif()
-
-endfunction()
-
-###############################################################################
-
-set(_CATCH_DISCOVER_TESTS_SCRIPT
- ${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake
-)
diff --git a/contrib/CatchAddTests.cmake b/contrib/CatchAddTests.cmake
deleted file mode 100644
index 156d55ff..00000000
--- a/contrib/CatchAddTests.cmake
+++ /dev/null
@@ -1,81 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-set(prefix "${TEST_PREFIX}")
-set(suffix "${TEST_SUFFIX}")
-set(spec ${TEST_SPEC})
-set(extra_args ${TEST_EXTRA_ARGS})
-set(properties ${TEST_PROPERTIES})
-set(script)
-set(suite)
-set(tests)
-
-function(add_command NAME)
- set(_args "")
- foreach(_arg ${ARGN})
- if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
- set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
- else()
- set(_args "${_args} ${_arg}")
- endif()
- endforeach()
- set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
-endfunction()
-
-# Run test executable to get list of available tests
-if(NOT EXISTS "${TEST_EXECUTABLE}")
- message(FATAL_ERROR
- "Specified test executable '${TEST_EXECUTABLE}' does not exist"
- )
-endif()
-execute_process(
- COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
- OUTPUT_VARIABLE output
- RESULT_VARIABLE result
-)
-# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
-if(${result} EQUAL 0)
- message(WARNING
- "Test executable '${TEST_EXECUTABLE}' contains no tests!\n"
- )
-elseif(${result} LESS 0)
- message(FATAL_ERROR
- "Error running test executable '${TEST_EXECUTABLE}':\n"
- " Result: ${result}\n"
- " Output: ${output}\n"
- )
-endif()
-
-string(REPLACE "\n" ";" output "${output}")
-
-# Parse output
-foreach(line ${output})
- set(test ${line})
- # Escape characters in test case names that would be parsed by Catch2
- set(test_name ${test})
- foreach(char , [ ])
- string(REPLACE ${char} "\\${char}" test_name ${test_name})
- endforeach(char)
- # ...and add to script
- add_command(add_test
- "${prefix}${test}${suffix}"
- ${TEST_EXECUTOR}
- "${TEST_EXECUTABLE}"
- "${test_name}"
- ${extra_args}
- )
- add_command(set_tests_properties
- "${prefix}${test}${suffix}"
- PROPERTIES
- WORKING_DIRECTORY "${TEST_WORKING_DIR}"
- ${properties}
- )
- list(APPEND tests "${prefix}${test}${suffix}")
-endforeach()
-
-# Create a list of all discovered tests, which users may use to e.g. set
-# properties on the tests
-add_command(set ${TEST_LIST} ${tests})
-
-# Write CTest script
-file(WRITE "${CTEST_FILE}" "${script}")
diff --git a/contrib/ParseAndAddCatchTests.cmake b/contrib/ParseAndAddCatchTests.cmake
deleted file mode 100644
index 925d9328..00000000
--- a/contrib/ParseAndAddCatchTests.cmake
+++ /dev/null
@@ -1,225 +0,0 @@
-#==================================================================================================#
-# supported macros #
-# - TEST_CASE, #
-# - SCENARIO, #
-# - TEST_CASE_METHOD, #
-# - CATCH_TEST_CASE, #
-# - CATCH_SCENARIO, #
-# - CATCH_TEST_CASE_METHOD. #
-# #
-# Usage #
-# 1. make sure this module is in the path or add this otherwise: #
-# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
-# 2. make sure that you've enabled testing option for the project by the call: #
-# enable_testing() #
-# 3. add the lines to the script for testing target (sample CMakeLists.txt): #
-# project(testing_target) #
-# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
-# enable_testing() #
-# #
-# find_path(CATCH_INCLUDE_DIR "catch.hpp") #
-# include_directories(${INCLUDE_DIRECTORIES} ${CATCH_INCLUDE_DIR}) #
-# #
-# file(GLOB SOURCE_FILES "*.cpp") #
-# add_executable(${PROJECT_NAME} ${SOURCE_FILES}) #
-# #
-# include(ParseAndAddCatchTests) #
-# ParseAndAddCatchTests(${PROJECT_NAME}) #
-# #
-# The following variables affect the behavior of the script: #
-# #
-# PARSE_CATCH_TESTS_VERBOSE (Default OFF) #
-# -- enables debug messages #
-# PARSE_CATCH_TESTS_NO_HIDDEN_TESTS (Default OFF) #
-# -- excludes tests marked with [!hide], [.] or [.foo] tags #
-# PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME (Default ON) #
-# -- adds fixture class name to the test name #
-# PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME (Default ON) #
-# -- adds cmake target name to the test name #
-# PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS (Default OFF) #
-# -- causes CMake to rerun when file with tests changes so that new tests will be discovered #
-# #
-# One can also set (locally) the optional variable OptionalCatchTestLauncher to precise the way #
-# a test should be run. For instance to use test MPI, one can write #
-# set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) #
-# just before calling this ParseAndAddCatchTests function #
-# #
-# The AdditionalCatchParameters optional variable can be used to pass extra argument to the test #
-# command. For example, to include successful tests in the output, one can write #
-# set(AdditionalCatchParameters --success) #
-# #
-# After the script, the ParseAndAddCatchTests_TESTS property for the target, and for each source #
-# file in the target is set, and contains the list of the tests extracted from that target, or #
-# from that file. This is useful, for example to add further labels or properties to the tests. #
-# #
-#==================================================================================================#
-
-if (CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
- message(FATAL_ERROR "ParseAndAddCatchTests requires CMake 2.8.8 or newer")
-endif()
-
-option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF)
-option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF)
-option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the test name" ON)
-option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON)
-option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF)
-
-function(ParseAndAddCatchTests_PrintDebugMessage)
- if(PARSE_CATCH_TESTS_VERBOSE)
- message(STATUS "ParseAndAddCatchTests: ${ARGV}")
- endif()
-endfunction()
-
-# This removes the contents between
-# - block comments (i.e. /* ... */)
-# - full line comments (i.e. // ... )
-# contents have been read into '${CppCode}'.
-# !keep partial line comments
-function(ParseAndAddCatchTests_RemoveComments CppCode)
- string(ASCII 2 CMakeBeginBlockComment)
- string(ASCII 3 CMakeEndBlockComment)
- string(REGEX REPLACE "/\\*" "${CMakeBeginBlockComment}" ${CppCode} "${${CppCode}}")
- string(REGEX REPLACE "\\*/" "${CMakeEndBlockComment}" ${CppCode} "${${CppCode}}")
- string(REGEX REPLACE "${CMakeBeginBlockComment}[^${CMakeEndBlockComment}]*${CMakeEndBlockComment}" "" ${CppCode} "${${CppCode}}")
- string(REGEX REPLACE "\n[ \t]*//+[^\n]+" "\n" ${CppCode} "${${CppCode}}")
-
- set(${CppCode} "${${CppCode}}" PARENT_SCOPE)
-endfunction()
-
-# Worker function
-function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
- # If SourceFile is an object library, do not scan it (as it is not a file). Exit without giving a warning about a missing file.
- if(SourceFile MATCHES "\\\$<TARGET_OBJECTS:.+>")
- ParseAndAddCatchTests_PrintDebugMessage("Detected OBJECT library: ${SourceFile} this will not be scanned for tests.")
- return()
- endif()
- # According to CMake docs EXISTS behavior is well-defined only for full paths.
- get_filename_component(SourceFile ${SourceFile} ABSOLUTE)
- if(NOT EXISTS ${SourceFile})
- message(WARNING "Cannot find source file: ${SourceFile}")
- return()
- endif()
- ParseAndAddCatchTests_PrintDebugMessage("parsing ${SourceFile}")
- file(STRINGS ${SourceFile} Contents NEWLINE_CONSUME)
-
- # Remove block and fullline comments
- ParseAndAddCatchTests_RemoveComments(Contents)
-
- # Find definition of test names
- string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^\)]+\\)+[ \t\n]*{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}")
-
- if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests)
- ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
- set_property(
- DIRECTORY
- APPEND
- PROPERTY CMAKE_CONFIGURE_DEPENDS ${SourceFile}
- )
- endif()
-
- foreach(TestName ${Tests})
- # Strip newlines
- string(REGEX REPLACE "\\\\\n|\n" "" TestName "${TestName}")
-
- # Get test type and fixture if applicable
- string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
- string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
- string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
-
- # Get string parts of test definition
- string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")
-
- # Strip wrapping quotation marks
- string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
- string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")
-
- # Validate that a test name and tags have been provided
- list(LENGTH TestStrings TestStringsLength)
- if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
- message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
- endif()
-
- # Assign name and tags
- list(GET TestStrings 0 Name)
- if("${TestType}" STREQUAL "SCENARIO")
- set(Name "Scenario: ${Name}")
- endif()
- if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND TestFixture)
- set(CTestName "${TestFixture}:${Name}")
- else()
- set(CTestName "${Name}")
- endif()
- if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
- set(CTestName "${TestTarget}:${CTestName}")
- endif()
- # add target to labels to enable running all tests added from this target
- set(Labels ${TestTarget})
- if(TestStringsLength EQUAL 2)
- list(GET TestStrings 1 Tags)
- string(TOLOWER "${Tags}" Tags)
- # remove target from labels if the test is hidden
- if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
- list(REMOVE_ITEM Labels ${TestTarget})
- endif()
- string(REPLACE "]" ";" Tags "${Tags}")
- string(REPLACE "[" "" Tags "${Tags}")
- else()
- # unset tags variable from previous loop
- unset(Tags)
- endif()
-
- list(APPEND Labels ${Tags})
-
- set(HiddenTagFound OFF)
- foreach(label ${Labels})
- string(REGEX MATCH "^!hide|^\\." result ${label})
- if(result)
- set(HiddenTagFound ON)
- break()
- endif(result)
- endforeach(label)
- if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
- ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
- else()
- ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
- if(Labels)
- ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
- endif()
-
- # Escape commas in the test spec
- string(REPLACE "," "\\," Name ${Name})
-
- # Add the test and set its properties
- add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
- # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
- if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
- ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
- set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
- else()
- set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
- LABELS "${Labels}")
- endif()
- set_property(
- TARGET ${TestTarget}
- APPEND
- PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
- set_property(
- SOURCE ${SourceFile}
- APPEND
- PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
- endif()
-
-
- endforeach()
-endfunction()
-
-# entry point
-function(ParseAndAddCatchTests TestTarget)
- ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
- get_target_property(SourceFiles ${TestTarget} SOURCES)
- ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
- foreach(SourceFile ${SourceFiles})
- ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
- endforeach()
- ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
-endfunction()
diff --git a/contrib/gdbinit b/contrib/gdbinit
deleted file mode 100644
index fb3608ae..00000000
--- a/contrib/gdbinit
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This file provides a way to skip stepping into Catch code when debugging with gdb.
-#
-# With the gdb "skip" command you can tell gdb to skip files or functions during debugging.
-# see https://xaizek.github.io/2016-05-26/skipping-standard-library-in-gdb/ for an example
-#
-# Basically the following line tells gdb to skip all functions containing the
-# regexp "Catch", which matches the complete Catch namespace.
-# If you want to skip just some parts of the Catch code you can modify the
-# regexp accordingly.
-#
-# If you want to permanently skip stepping into Catch code copy the following
-# line into your ~/.gdbinit file
-#
-
-skip -rfu Catch
diff --git a/contrib/lldbinit b/contrib/lldbinit
deleted file mode 100644
index 4f13634d..00000000
--- a/contrib/lldbinit
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This file provides a way to skip stepping into Catch code when debugging with lldb.
-#
-# With the setting "target.process.thread.step-avoid-regexp" you can tell lldb
-# to skip functions matching the regexp
-#
-# Basically the following line tells lldb to skip all functions containing the
-# regexp "Catch", which matches the complete Catch namespace.
-# If you want to skip just some parts of the Catch code you can modify the
-# regexp accordingly.
-#
-# If you want to permanently skip stepping into Catch code copy the following
-# line into your ~/.lldbinit file
-#
-
-settings set target.process.thread.step-avoid-regexp Catch \ No newline at end of file
diff --git a/docs/Readme.md b/docs/Readme.md
deleted file mode 100644
index 0bbb104e..00000000
--- a/docs/Readme.md
+++ /dev/null
@@ -1,41 +0,0 @@
-<a id="top"></a>
-# Reference
-
-To get the most out of Catch2, start with the [tutorial](tutorial.md#top).
-Once you're up and running consider the following reference material.
-
-Writing tests:
-* [Assertion macros](assertions.md#top)
-* [Matchers](matchers.md#top)
-* [Logging macros](logging.md#top)
-* [Test cases and sections](test-cases-and-sections.md#top)
-* [Test fixtures](test-fixtures.md#top)
-* [Reporters](reporters.md#top)
-* [Event Listeners](event-listeners.md#top)
-* [Data Generators](generators.md#top)
-* [Other macros](other-macros.md#top)
-* [Micro benchmarking](benchmarks.md#top)
-
-Fine tuning:
-* [Supplying your own main()](own-main.md#top)
-* [Compile-time configuration](configuration.md#top)
-* [String Conversions](tostring.md#top)
-
-Running:
-* [Command line](command-line.md#top)
-
-Odds and ends:
-* [CMake integration](cmake-integration.md#top)
-* [CI and other miscellaneous pieces](ci-and-misc.md#top)
-
-FAQ:
-* [Why are my tests slow to compile?](slow-compiles.md#top)
-* [Known limitations](limitations.md#top)
-
-Other:
-* [Why Catch?](why-catch.md#top)
-* [Open Source Projects using Catch](opensource-users.md#top)
-* [Commercial Projects using Catch](commercial-users.md#top)
-* [Contributing](contributing.md#top)
-* [Release Notes](release-notes.md#top)
-* [Deprecations and incoming changes](deprecations.md#top)
diff --git a/docs/assertions.md b/docs/assertions.md
deleted file mode 100644
index 682eb6e7..00000000
--- a/docs/assertions.md
+++ /dev/null
@@ -1,201 +0,0 @@
-<a id="top"></a>
-# Assertion Macros
-
-**Contents**<br>
-[Natural Expressions](#natural-expressions)<br>
-[Exceptions](#exceptions)<br>
-[Matcher expressions](#matcher-expressions)<br>
-[Thread Safety](#thread-safety)<br>
-[Expressions with commas](#expressions-with-commas)<br>
-
-Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).
-
-Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there is a rich set of auxiliary macros as well. We'll describe all of these here.
-
-Most of these macros come in two forms:
-
-## Natural Expressions
-
-The ```REQUIRE``` family of macros tests an expression and aborts the test case if it fails.
-The ```CHECK``` family are equivalent but execution continues in the same test case even if the assertion fails. This is useful if you have a series of essentially orthogonal assertions and it is useful to see all the results rather than stopping at the first failure.
-
-* **REQUIRE(** _expression_ **)** and
-* **CHECK(** _expression_ **)**
-
-Evaluates the expression and records the result. If an exception is thrown, it is caught, reported, and counted as a failure. These are the macros you will use most of the time.
-
-Examples:
-```
-CHECK( str == "string value" );
-CHECK( thisReturnsTrue() );
-REQUIRE( i == 42 );
-```
-
-* **REQUIRE_FALSE(** _expression_ **)** and
-* **CHECK_FALSE(** _expression_ **)**
-
-Evaluates the expression and records the _logical NOT_ of the result. If an exception is thrown it is caught, reported, and counted as a failure.
-(these forms exist as a workaround for the fact that ! prefixed expressions cannot be decomposed).
-
-Example:
-```
-REQUIRE_FALSE( thisReturnsFalse() );
-```
-
-Do note that "overly complex" expressions cannot be decomposed and thus will not compile. This is done partly for practical reasons (to keep the underlying expression template machinery to minimum) and partly for philosophical reasons (assertions should be simple and deterministic).
-
-Examples:
-* `CHECK(a == 1 && b == 2);`
-This expression is too complex because of the `&&` operator. If you want to check that 2 or more properties hold, you can either put the expression into parenthesis, which stops decomposition from working, or you need to decompose the expression into two assertions: `CHECK( a == 1 ); CHECK( b == 2);`
-* `CHECK( a == 2 || b == 1 );`
-This expression is too complex because of the `||` operator. If you want to check that one of several properties hold, you can put the expression into parenthesis (unlike with `&&`, expression decomposition into several `CHECK`s is not possible).
-
-
-### Floating point comparisons
-
-When comparing floating point numbers - especially if at least one of them has been computed - great care must be taken to allow for rounding errors and inexact representations.
-
-Catch provides a way to perform tolerant comparisons of floating point values through use of a wrapper class called `Approx`. `Approx` can be used on either side of a comparison expression. It overloads the comparisons operators to take a tolerance into account. Here's a simple example:
-
-```cpp
-REQUIRE( performComputation() == Approx( 2.1 ) );
-```
-
-Catch also provides a user-defined literal for `Approx`; `_a`. It resides in
-the `Catch::literals` namespace and can be used like so:
-```cpp
-using namespace Catch::literals;
-REQUIRE( performComputation() == 2.1_a );
-```
-
-`Approx` is constructed with defaults that should cover most simple cases.
-For the more complex cases, `Approx` provides 3 customization points:
-
-* __epsilon__ - epsilon serves to set the coefficient by which a result
-can differ from `Approx`'s value before it is rejected.
-_By default set to `std::numeric_limits<float>::epsilon()*100`._
-* __margin__ - margin serves to set the the absolute value by which
-a result can differ from `Approx`'s value before it is rejected.
-_By default set to `0.0`._
-* __scale__ - scale is used to change the magnitude of `Approx` for relative check.
-_By default set to `0.0`._
-
-#### epsilon example
-```cpp
-Approx target = Approx(100).epsilon(0.01);
-100.0 == target; // Obviously true
-200.0 == target; // Obviously still false
-100.5 == target; // True, because we set target to allow up to 1% difference
-```
-
-#### margin example
-```cpp
-Approx target = Approx(100).margin(5);
-100.0 == target; // Obviously true
-200.0 == target; // Obviously still false
-104.0 == target; // True, because we set target to allow absolute difference of at most 5
-```
-
-#### scale
-Scale can be useful if the computation leading to the result worked
-on different scale than is used by the results. Since allowed difference
-between Approx's value and compared value is based primarily on Approx's value
-(the allowed difference is computed as
-`(Approx::scale + Approx::value) * epsilon`), the resulting comparison could
-need rescaling to be correct.
-
-
-## Exceptions
-
-* **REQUIRE_NOTHROW(** _expression_ **)** and
-* **CHECK_NOTHROW(** _expression_ **)**
-
-Expects that no exception is thrown during evaluation of the expression.
-
-* **REQUIRE_THROWS(** _expression_ **)** and
-* **CHECK_THROWS(** _expression_ **)**
-
-Expects that an exception (of any type) is be thrown during evaluation of the expression.
-
-* **REQUIRE_THROWS_AS(** _expression_, _exception type_ **)** and
-* **CHECK_THROWS_AS(** _expression_, _exception type_ **)**
-
-Expects that an exception of the _specified type_ is thrown during evaluation of the expression. Note that the _exception type_ is extended with `const&` and you should not include it yourself.
-
-* **REQUIRE_THROWS_WITH(** _expression_, _string or string matcher_ **)** and
-* **CHECK_THROWS_WITH(** _expression_, _string or string matcher_ **)**
-
-Expects that an exception is thrown that, when converted to a string, matches the _string_ or _string matcher_ provided (see next section for Matchers).
-
-e.g.
-```cpp
-REQUIRE_THROWS_WITH( openThePodBayDoors(), Contains( "afraid" ) && Contains( "can't do that" ) );
-REQUIRE_THROWS_WITH( dismantleHal(), "My mind is going" );
-```
-
-* **REQUIRE_THROWS_MATCHES(** _expression_, _exception type_, _matcher for given exception type_ **)** and
-* **CHECK_THROWS_MATCHES(** _expression_, _exception type_, _matcher for given exception type_ **)**
-
-Expects that exception of _exception type_ is thrown and it matches provided matcher (see the [documentation for Matchers](matchers.md#top)).
-
-
-_Please note that the `THROW` family of assertions expects to be passed a single expression, not a statement or series of statements. If you want to check a more complicated sequence of operations, you can use a C++11 lambda function._
-
-```cpp
-REQUIRE_NOTHROW([&](){
- int i = 1;
- int j = 2;
- auto k = i + j;
- if (k == 3) {
- throw 1;
- }
-}());
-```
-
-
-
-## Matcher expressions
-
-To support Matchers a slightly different form is used. Matchers have [their own documentation](matchers.md#top).
-
-* **REQUIRE_THAT(** _lhs_, _matcher expression_ **)** and
-* **CHECK_THAT(** _lhs_, _matcher expression_ **)**
-
-Matchers can be composed using `&&`, `||` and `!` operators.
-
-## Thread Safety
-
-Currently assertions in Catch are not thread safe.
-For more details, along with workarounds, see the section on [the limitations page](limitations.md#thread-safe-assertions).
-
-## Expressions with commas
-
-Because the preprocessor parses code using different rules than the
-compiler, multiple-argument assertions (e.g. `REQUIRE_THROWS_AS`) have
-problems with commas inside the provided expressions. As an example
-`REQUIRE_THROWS_AS(std::pair<int, int>(1, 2), std::invalid_argument);`
-will fail to compile, because the preprocessor sees 3 arguments provided,
-but the macro accepts only 2. There are two possible workarounds.
-
-1) Use typedef:
-```cpp
-using int_pair = std::pair<int, int>;
-REQUIRE_THROWS_AS(int_pair(1, 2), std::invalid_argument);
-```
-
-This solution is always applicable, but makes the meaning of the code
-less clear.
-
-2) Parenthesize the expression:
-```cpp
-TEST_CASE_METHOD((Fixture<int, int>), "foo", "[bar]") {
- SUCCEED();
-}
-```
-
-This solution is not always applicable, because it might require extra
-changes on the Catch's side to work.
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/benchmarks.md b/docs/benchmarks.md
deleted file mode 100644
index a41839fd..00000000
--- a/docs/benchmarks.md
+++ /dev/null
@@ -1,254 +0,0 @@
-<a id="top"></a>
-# Authoring benchmarks
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
-
-_Note that benchmarking support is disabled by default and to enable it,
-you need to define `CATCH_CONFIG_ENABLE_BENCHMARKING`. For more details,
-see the [compile-time configuration documentation](configuration.md#top)._
-
-Writing benchmarks is not easy. Catch simplifies certain aspects but you'll
-always need to take care about various aspects. Understanding a few things about
-the way Catch runs your code will be very helpful when writing your benchmarks.
-
-First off, let's go over some terminology that will be used throughout this
-guide.
-
-- *User code*: user code is the code that the user provides to be measured.
-- *Run*: one run is one execution of the user code.
-- *Sample*: one sample is one data point obtained by measuring the time it takes
- to perform a certain number of runs. One sample can consist of more than one
- run if the clock available does not have enough resolution to accurately
- measure a single run. All samples for a given benchmark execution are obtained
- with the same number of runs.
-
-## Execution procedure
-
-Now I can explain how a benchmark is executed in Catch. There are three main
-steps, though the first does not need to be repeated for every benchmark.
-
-1. *Environmental probe*: before any benchmarks can be executed, the clock's
-resolution is estimated. A few other environmental artifacts are also estimated
-at this point, like the cost of calling the clock function, but they almost
-never have any impact in the results.
-
-2. *Estimation*: the user code is executed a few times to obtain an estimate of
-the amount of runs that should be in each sample. This also has the potential
-effect of bringing relevant code and data into the caches before the actual
-measurement starts.
-
-3. *Measurement*: all the samples are collected sequentially by performing the
-number of runs estimated in the previous step for each sample.
-
-This already gives us one important rule for writing benchmarks for Catch: the
-benchmarks must be repeatable. The user code will be executed several times, and
-the number of times it will be executed during the estimation step cannot be
-known beforehand since it depends on the time it takes to execute the code.
-User code that cannot be executed repeatedly will lead to bogus results or
-crashes.
-
-## Benchmark specification
-
-Benchmarks can be specified anywhere inside a Catch test case.
-There is a simple and a slightly more advanced version of the `BENCHMARK` macro.
-
-Let's have a look how a naive Fibonacci implementation could be benchmarked:
-```c++
-std::uint64_t Fibonacci(std::uint64_t number) {
- return number < 2 ? 1 : Fibonacci(number - 1) + Fibonacci(number - 2);
-}
-```
-Now the most straight forward way to benchmark this function, is just adding a `BENCHMARK` macro to our test case:
-```c++
-TEST_CASE("Fibonacci") {
- CHECK(Fibonacci(0) == 1);
- // some more asserts..
- CHECK(Fibonacci(5) == 8);
- // some more asserts..
-
- // now let's benchmark:
- BENCHMARK("Fibonacci 20") {
- return Fibonacci(20);
- };
-
- BENCHMARK("Fibonacci 25") {
- return Fibonacci(25);
- };
-
- BENCHMARK("Fibonacci 30") {
- return Fibonacci(30);
- };
-
- BENCHMARK("Fibonacci 35") {
- return Fibonacci(35);
- };
-}
-```
-There's a few things to note:
-- As `BENCHMARK` expands to a lambda expression it is necessary to add a semicolon after
- the closing brace (as opposed to the first experimental version).
-- The `return` is a handy way to avoid the compiler optimizing away the benchmark code.
-
-Running this already runs the benchmarks and outputs something similar to:
-```
--------------------------------------------------------------------------------
-Fibonacci
--------------------------------------------------------------------------------
-C:\path\to\Catch2\Benchmark.tests.cpp(10)
-...............................................................................
-benchmark name samples iterations estimated
- mean low mean high mean
- std dev low std dev high std dev
--------------------------------------------------------------------------------
-Fibonacci 20 100 416439 83.2878 ms
- 2 ns 2 ns 2 ns
- 0 ns 0 ns 0 ns
-
-Fibonacci 25 100 400776 80.1552 ms
- 3 ns 3 ns 3 ns
- 0 ns 0 ns 0 ns
-
-Fibonacci 30 100 396873 79.3746 ms
- 17 ns 17 ns 17 ns
- 0 ns 0 ns 0 ns
-
-Fibonacci 35 100 145169 87.1014 ms
- 468 ns 464 ns 473 ns
- 21 ns 15 ns 34 ns
-```
-
-### Advanced benchmarking
-The simplest use case shown above, takes no arguments and just runs the user code that needs to be measured.
-However, if using the `BENCHMARK_ADVANCED` macro and adding a `Catch::Benchmark::Chronometer` argument after
-the macro, some advanced features are available. The contents of the simple benchmarks are invoked once per run,
-while the blocks of the advanced benchmarks are invoked exactly twice:
-once during the estimation phase, and another time during the execution phase.
-
-```c++
-BENCHMARK("simple"){ return long_computation(); };
-
-BENCHMARK_ADVANCED("advanced")(Catch::Benchmark::Chronometer meter) {
- set_up();
- meter.measure([] { return long_computation(); });
-};
-```
-
-These advanced benchmarks no longer consist entirely of user code to be measured.
-In these cases, the code to be measured is provided via the
-`Catch::Benchmark::Chronometer::measure` member function. This allows you to set up any
-kind of state that might be required for the benchmark but is not to be included
-in the measurements, like making a vector of random integers to feed to a
-sorting algorithm.
-
-A single call to `Catch::Benchmark::Chronometer::measure` performs the actual measurements
-by invoking the callable object passed in as many times as necessary. Anything
-that needs to be done outside the measurement can be done outside the call to
-`measure`.
-
-The callable object passed in to `measure` can optionally accept an `int`
-parameter.
-
-```c++
-meter.measure([](int i) { return long_computation(i); });
-```
-
-If it accepts an `int` parameter, the sequence number of each run will be passed
-in, starting with 0. This is useful if you want to measure some mutating code,
-for example. The number of runs can be known beforehand by calling
-`Catch::Benchmark::Chronometer::runs`; with this one can set up a different instance to be
-mutated by each run.
-
-```c++
-std::vector<std::string> v(meter.runs());
-std::fill(v.begin(), v.end(), test_string());
-meter.measure([&v](int i) { in_place_escape(v[i]); });
-```
-
-Note that it is not possible to simply use the same instance for different runs
-and resetting it between each run since that would pollute the measurements with
-the resetting code.
-
-It is also possible to just provide an argument name to the simple `BENCHMARK` macro to get
-the same semantics as providing a callable to `meter.measure` with `int` argument:
-
-```c++
-BENCHMARK("indexed", i){ return long_computation(i); };
-```
-
-### Constructors and destructors
-
-All of these tools give you a lot mileage, but there are two things that still
-need special handling: constructors and destructors. The problem is that if you
-use automatic objects they get destroyed by the end of the scope, so you end up
-measuring the time for construction and destruction together. And if you use
-dynamic allocation instead, you end up including the time to allocate memory in
-the measurements.
-
-To solve this conundrum, Catch provides class templates that let you manually
-construct and destroy objects without dynamic allocation and in a way that lets
-you measure construction and destruction separately.
-
-```c++
-BENCHMARK_ADVANCED("construct")(Catch::Benchmark::Chronometer meter) {
- std::vector<Catch::Benchmark::storage_for<std::string>> storage(meter.runs());
- meter.measure([&](int i) { storage[i].construct("thing"); });
-};
-
-BENCHMARK_ADVANCED("destroy")(Catch::Benchmark::Chronometer meter) {
- std::vector<Catch::Benchmark::destructable_object<std::string>> storage(meter.runs());
- for(auto&& o : storage)
- o.construct("thing");
- meter.measure([&](int i) { storage[i].destruct(); });
-};
-```
-
-`Catch::Benchmark::storage_for<T>` objects are just pieces of raw storage suitable for `T`
-objects. You can use the `Catch::Benchmark::storage_for::construct` member function to call a constructor and
-create an object in that storage. So if you want to measure the time it takes
-for a certain constructor to run, you can just measure the time it takes to run
-this function.
-
-When the lifetime of a `Catch::Benchmark::storage_for<T>` object ends, if an actual object was
-constructed there it will be automatically destroyed, so nothing leaks.
-
-If you want to measure a destructor, though, we need to use
-`Catch::Benchmark::destructable_object<T>`. These objects are similar to
-`Catch::Benchmark::storage_for<T>` in that construction of the `T` object is manual, but
-it does not destroy anything automatically. Instead, you are required to call
-the `Catch::Benchmark::destructable_object::destruct` member function, which is what you
-can use to measure the destruction time.
-
-### The optimizer
-
-Sometimes the optimizer will optimize away the very code that you want to
-measure. There are several ways to use results that will prevent the optimiser
-from removing them. You can use the `volatile` keyword, or you can output the
-value to standard output or to a file, both of which force the program to
-actually generate the value somehow.
-
-Catch adds a third option. The values returned by any function provided as user
-code are guaranteed to be evaluated and not optimised out. This means that if
-your user code consists of computing a certain value, you don't need to bother
-with using `volatile` or forcing output. Just `return` it from the function.
-That helps with keeping the code in a natural fashion.
-
-Here's an example:
-
-```c++
-// may measure nothing at all by skipping the long calculation since its
-// result is not used
-BENCHMARK("no return"){ long_calculation(); };
-
-// the result of long_calculation() is guaranteed to be computed somehow
-BENCHMARK("with return"){ return long_calculation(); };
-```
-
-However, there's no other form of control over the optimizer whatsoever. It is
-up to you to write a benchmark that actually measures what you want and doesn't
-just measure the time to do a whole bunch of nothing.
-
-To sum up, there are two simple rules: whatever you would do in handwritten code
-to control optimization still works in Catch; and Catch makes return values
-from user code into observable effects that can't be optimized away.
-
-<i>Adapted from nonius' documentation.</i>
diff --git a/docs/ci-and-misc.md b/docs/ci-and-misc.md
deleted file mode 100644
index 40b7cec9..00000000
--- a/docs/ci-and-misc.md
+++ /dev/null
@@ -1,112 +0,0 @@
-<a id="top"></a>
-# CI and other odd pieces
-
-**Contents**<br>
-[Continuous Integration systems](#continuous-integration-systems)<br>
-[Other reporters](#other-reporters)<br>
-[Low-level tools](#low-level-tools)<br>
-[CMake](#cmake)<br>
-
-This page talks about how Catch integrates with Continuous Integration
-Build Systems may refer to low-level tools, like CMake, or larger systems that run on servers, like Jenkins or TeamCity. This page will talk about both.
-
-## Continuous Integration systems
-
-Probably the most important aspect to using Catch with a build server is the use of different reporters. Catch comes bundled with three reporters that should cover the majority of build servers out there - although adding more for better integration with some is always a possibility (currently we also offer TeamCity, TAP, Automake and SonarQube reporters).
-
-Two of these reporters are built in (XML and JUnit) and the third (TeamCity) is included as a separate header. It's possible that the other two may be split out in the future too - as that would make the core of Catch smaller for those that don't need them.
-
-### XML Reporter
-```-r xml```
-
-The XML Reporter writes in an XML format that is specific to Catch.
-
-The advantage of this format is that it corresponds well to the way Catch works (especially the more unusual features, such as nested sections) and is a fully streaming format - that is it writes output as it goes, without having to store up all its results before it can start writing.
-
-The disadvantage is that, being specific to Catch, no existing build servers understand the format natively. It can be used as input to an XSLT transformation that could convert it to, say, HTML - although this loses the streaming advantage, of course.
-
-### JUnit Reporter
-```-r junit```
-
-The JUnit Reporter writes in an XML format that mimics the JUnit ANT schema.
-
-The advantage of this format is that the JUnit Ant schema is widely understood by most build servers and so can usually be consumed with no additional work.
-
-The disadvantage is that this schema was designed to correspond to how JUnit works - and there is a significant mismatch with how Catch works. Additionally the format is not streamable (because opening elements hold counts of failed and passing tests as attributes) - so the whole test run must complete before it can be written.
-
-## Other reporters
-Other reporters are not part of the single-header distribution and need
-to be downloaded and included separately. All reporters are stored in
-`single_include` directory in the git repository, and are named
-`catch_reporter_*.hpp`. For example, to use the TeamCity reporter you
-need to download `single_include/catch_reporter_teamcity.hpp` and include
-it after Catch itself.
-
-```cpp
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-#include "catch_reporter_teamcity.hpp"
-```
-
-### TeamCity Reporter
-```-r teamcity```
-
-The TeamCity Reporter writes TeamCity service messages to stdout. In order to be able to use this reporter an additional header must also be included.
-
-Being specific to TeamCity this is the best reporter to use with it - but it is completely unsuitable for any other purpose. It is a streaming format (it writes as it goes) - although test results don't appear in the TeamCity interface until the completion of a suite (usually the whole test run).
-
-### Automake Reporter
-```-r automake```
-
-The Automake Reporter writes out the [meta tags](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html#Log-files-generation-and-test-results-recording) expected by automake via `make check`.
-
-### TAP (Test Anything Protocol) Reporter
-```-r tap```
-
-Because of the incremental nature of Catch's test suites and ability to run specific tests, our implementation of TAP reporter writes out the number of tests in a suite last.
-
-### SonarQube Reporter
-```-r sonarqube```
-[SonarQube Generic Test Data](https://docs.sonarqube.org/latest/analysis/generic-test/) XML format for tests metrics.
-
-## Low-level tools
-
-### Precompiled headers (PCHs)
-
-Catch offers prototypal support for being included in precompiled headers, but because of its single-header nature it does need some actions by the user:
-* The precompiled header needs to define `CATCH_CONFIG_ALL_PARTS`
-* The implementation file needs to
- * undefine `TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED`
- * define `CATCH_CONFIG_IMPL_ONLY`
- * define `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`
- * include "catch.hpp" again
-
-
-### CodeCoverage module (GCOV, LCOV...)
-
-If you are using GCOV tool to get testing coverage of your code, and are not sure how to integrate it with CMake and Catch, there should be an external example over at https://github.com/fkromer/catch_cmake_coverage
-
-
-### pkg-config
-
-Catch2 provides a rudimentary pkg-config integration, by registering itself
-under the name `catch2`. This means that after Catch2 is installed, you
-can use `pkg-config` to get its include path: `pkg-config --cflags catch2`.
-
-### gdb and lldb scripts
-
-Catch2's `contrib` folder also contains two simple debugger scripts,
-`gdbinit` for `gdb` and `lldbinit` for `lldb`. If loaded into their
-respective debugger, these will tell it to step over Catch2's internals
-when stepping through code.
-
-
-## CMake
-
-[As it has been getting kinda long, the documentation of Catch2's
-integration with CMake has been moved to its own page.](cmake-integration.md#top)
-
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/cmake-integration.md b/docs/cmake-integration.md
deleted file mode 100644
index 57073c40..00000000
--- a/docs/cmake-integration.md
+++ /dev/null
@@ -1,226 +0,0 @@
-<a id="top"></a>
-# CMake integration
-
-**Contents**<br>
-[CMake target](#cmake-target)<br>
-[Automatic test registration](#automatic-test-registration)<br>
-[CMake project options](#cmake-project-options)<br>
-[Installing Catch2 from git repository](#installing-catch2-from-git-repository)<br>
-
-Because we use CMake to build Catch2, we also provide a couple of
-integration points for our users.
-
-1) Catch2 exports a (namespaced) CMake target
-2) Catch2's repository contains CMake scripts for automatic registration
-of `TEST_CASE`s in CTest
-
-## CMake target
-
-Catch2's CMake build exports an interface target `Catch2::Catch2`. Linking
-against it will add the proper include path and all necessary capabilities
-to the resulting binary.
-
-This means that if Catch2 has been installed on the system, it should be
-enough to do:
-```cmake
-find_package(Catch2 REQUIRED)
-target_link_libraries(tests Catch2::Catch2)
-```
-
-
-This target is also provided when Catch2 is used as a subdirectory.
-Assuming that Catch2 has been cloned to `lib/Catch2`:
-```cmake
-add_subdirectory(lib/Catch2)
-target_link_libraries(tests Catch2::Catch2)
-```
-
-## Automatic test registration
-
-Catch2's repository also contains two CMake scripts that help users
-with automatically registering their `TEST_CASE`s with CTest. They
-can be found in the `contrib` folder, and are
-
-1) `Catch.cmake` (and its dependency `CatchAddTests.cmake`)
-2) `ParseAndAddCatchTests.cmake`
-
-If Catch2 has been installed in system, both of these can be used after
-doing `find_package(Catch2 REQUIRED)`. Otherwise you need to add them
-to your CMake module path.
-
-### `Catch.cmake` and `CatchAddTests.cmake`
-
-`Catch.cmake` provides function `catch_discover_tests` to get tests from
-a target. This function works by running the resulting executable with
-`--list-test-names-only` flag, and then parsing the output to find all
-existing tests.
-
-#### Usage
-```cmake
-cmake_minimum_required(VERSION 3.5)
-
-project(baz LANGUAGES CXX VERSION 0.0.1)
-
-find_package(Catch2 REQUIRED)
-add_executable(foo test.cpp)
-target_link_libraries(foo Catch2::Catch2)
-
-include(CTest)
-include(Catch)
-catch_discover_tests(foo)
-```
-
-
-#### Customization
-`catch_discover_tests` can be given several extra argumets:
-```cmake
-catch_discover_tests(target
- [TEST_SPEC arg1...]
- [EXTRA_ARGS arg1...]
- [WORKING_DIRECTORY dir]
- [TEST_PREFIX prefix]
- [TEST_SUFFIX suffix]
- [PROPERTIES name1 value1...]
- [TEST_LIST var]
-)
-```
-
-* `TEST_SPEC arg1...`
-
-Specifies test cases, wildcarded test cases, tags and tag expressions to
-pass to the Catch executable alongside the `--list-test-names-only` flag.
-
-
-* `EXTRA_ARGS arg1...`
-
-Any extra arguments to pass on the command line to each test case.
-
-
-* `WORKING_DIRECTORY dir`
-
-Specifies the directory in which to run the discovered test cases. If this
-option is not provided, the current binary directory is used.
-
-
-* `TEST_PREFIX prefix`
-
-Specifies a _prefix_ to be added to the name of each discovered test case.
-This can be useful when the same test executable is being used in multiple
-calls to `catch_discover_tests()`, with different `TEST_SPEC` or `EXTRA_ARGS`.
-
-
-* `TEST_SUFFIX suffix`
-
-Same as `TEST_PREFIX`, except it specific the _suffix_ for the test names.
-Both `TEST_PREFIX` and `TEST_SUFFIX` can be specified at the same time.
-
-
-* `PROPERTIES name1 value1...`
-
-Specifies additional properties to be set on all tests discovered by this
-invocation of `catch_discover_tests`.
-
-
-* `TEST_LIST var`
-
-Make the list of tests available in the variable `var`, rather than the
-default `<target>_TESTS`. This can be useful when the same test
-executable is being used in multiple calls to `catch_discover_tests()`.
-Note that this variable is only available in CTest.
-
-
-### `ParseAndAddCatchTests.cmake`
-
-`ParseAndAddCatchTests` works by parsing all implementation files
-associated with the provided target, and registering them via CTest's
-`add_test`. This approach has some limitations, such as the fact that
-commented-out tests will be registered anyway.
-
-
-#### Usage
-
-```cmake
-cmake_minimum_required(VERSION 3.5)
-
-project(baz LANGUAGES CXX VERSION 0.0.1)
-
-find_package(Catch2 REQUIRED)
-add_executable(foo test.cpp)
-target_link_libraries(foo Catch2::Catch2)
-
-include(CTest)
-include(ParseAndAddCatchTests)
-ParseAndAddCatchTests(foo)
-```
-
-
-#### Customization
-
-`ParseAndAddCatchTests` provides some customization points:
-* `PARSE_CATCH_TESTS_VERBOSE` -- When `ON`, the script prints debug
-messages. Defaults to `OFF`.
-* `PARSE_CATCH_TESTS_NO_HIDDEN_TESTS` -- When `ON`, hidden tests (tests
-tagged with any of `[!hide]`, `[.]` or `[.foo]`) will not be registered.
-Defaults to `OFF`.
-* `PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME` -- When `ON`, adds fixture
-class name to the test name in CTest. Defaults to `ON`.
-* `PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME` -- When `ON`, adds target
-name to the test name in CTest. Defaults to `ON`.
-* `PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS` -- When `ON`, adds test
-file to `CMAKE_CONFIGURE_DEPENDS`. This means that the CMake configuration
-step will be re-ran when the test files change, letting new tests be
-automatically discovered. Defaults to `OFF`.
-
-
-Optionally, one can specify a launching command to run tests by setting the
-variable `OptionalCatchTestLauncher` before calling `ParseAndAddCatchTests`. For
-instance to run some tests using `MPI` and other sequentially, one can write
-```cmake
-set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC})
-ParseAndAddCatchTests(mpi_foo)
-unset(OptionalCatchTestLauncher)
-ParseAndAddCatchTests(bar)
-```
-
-## CMake project options
-
-Catch2's CMake project also provides some options for other projects
-that consume it. These are
-
-* `CATCH_BUILD_TESTING` -- When `ON`, Catch2's SelfTest project will be
-built. Defaults to `ON`. Note that Catch2 also obeys `BUILD_TESTING` CMake
-variable, so _both_ of them need to be `ON` for the SelfTest to be built,
-and either of them can be set to `OFF` to disable building SelfTest.
-* `CATCH_BUILD_EXAMPLES` -- When `ON`, Catch2's usage examples will be
-built. Defaults to `OFF`.
-* `CATCH_INSTALL_DOCS` -- When `ON`, Catch2's documentation will be
-included in the installation. Defaults to `ON`.
-* `CATCH_INSTALL_HELPERS` -- When `ON`, Catch2's contrib folder will be
-included in the installation. Defaults to `ON`.
-* `BUILD_TESTING` -- When `ON` and the project is not used as a subproject,
-Catch2's test binary will be built. Defaults to `ON`.
-
-
-## Installing Catch2 from git repository
-
-If you cannot install Catch2 from a package manager (e.g. Ubuntu 16.04
-provides catch only in version 1.2.0) you might want to install it from
-the repository instead. Assuming you have enough rights, you can just
-install it to the default location, like so:
-```
-$ git clone https://github.com/catchorg/Catch2.git
-$ cd Catch2
-$ cmake -Bbuild -H. -DBUILD_TESTING=OFF
-$ sudo cmake --build build/ --target install
-```
-
-If you do not have superuser rights, you will also need to specify
-[CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
-when configuring the build, and then modify your calls to
-[find_package](https://cmake.org/cmake/help/latest/command/find_package.html)
-accordingly.
-
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/command-line.md b/docs/command-line.md
deleted file mode 100644
index 51eeb2f6..00000000
--- a/docs/command-line.md
+++ /dev/null
@@ -1,401 +0,0 @@
-<a id="top"></a>
-# Command line
-
-**Contents**<br>
-[Specifying which tests to run](#specifying-which-tests-to-run)<br>
-[Choosing a reporter to use](#choosing-a-reporter-to-use)<br>
-[Breaking into the debugger](#breaking-into-the-debugger)<br>
-[Showing results for successful tests](#showing-results-for-successful-tests)<br>
-[Aborting after a certain number of failures](#aborting-after-a-certain-number-of-failures)<br>
-[Listing available tests, tags or reporters](#listing-available-tests-tags-or-reporters)<br>
-[Sending output to a file](#sending-output-to-a-file)<br>
-[Naming a test run](#naming-a-test-run)<br>
-[Eliding assertions expected to throw](#eliding-assertions-expected-to-throw)<br>
-[Make whitespace visible](#make-whitespace-visible)<br>
-[Warnings](#warnings)<br>
-[Reporting timings](#reporting-timings)<br>
-[Load test names to run from a file](#load-test-names-to-run-from-a-file)<br>
-[Just test names](#just-test-names)<br>
-[Specify the order test cases are run](#specify-the-order-test-cases-are-run)<br>
-[Specify a seed for the Random Number Generator](#specify-a-seed-for-the-random-number-generator)<br>
-[Identify framework and version according to the libIdentify standard](#identify-framework-and-version-according-to-the-libidentify-standard)<br>
-[Wait for key before continuing](#wait-for-key-before-continuing)<br>
-[Specify the number of benchmark samples to collect](#specify-the-number-of-benchmark-samples-to-collect)<br>
-[Specify the number of resamples for bootstrapping](#specify-the-number-of-resamples-for-bootstrapping)<br>
-[Specify the confidence-interval for bootstrapping](#specify-the-confidence-interval-for-bootstrapping)<br>
-[Disable statistical analysis of collected benchmark samples](#disable-statistical-analysis-of-collected-benchmark-samples)<br>
-[Specify the amount of time in milliseconds spent on warming up each test](#specify-the-amount-of-time-in-milliseconds-spent-on-warming-up-each-test)<br>
-[Usage](#usage)<br>
-[Specify the section to run](#specify-the-section-to-run)<br>
-[Filenames as tags](#filenames-as-tags)<br>
-[Override output colouring](#override-output-colouring)<br>
-
-Catch works quite nicely without any command line options at all - but for those times when you want greater control the following options are available.
-Click one of the following links to take you straight to that option - or scroll on to browse the available options.
-
-<a href="#specifying-which-tests-to-run"> ` <test-spec> ...`</a><br />
-<a href="#usage"> ` -h, -?, --help`</a><br />
-<a href="#listing-available-tests-tags-or-reporters"> ` -l, --list-tests`</a><br />
-<a href="#listing-available-tests-tags-or-reporters"> ` -t, --list-tags`</a><br />
-<a href="#showing-results-for-successful-tests"> ` -s, --success`</a><br />
-<a href="#breaking-into-the-debugger"> ` -b, --break`</a><br />
-<a href="#eliding-assertions-expected-to-throw"> ` -e, --nothrow`</a><br />
-<a href="#invisibles"> ` -i, --invisibles`</a><br />
-<a href="#sending-output-to-a-file"> ` -o, --out`</a><br />
-<a href="#choosing-a-reporter-to-use"> ` -r, --reporter`</a><br />
-<a href="#naming-a-test-run"> ` -n, --name`</a><br />
-<a href="#aborting-after-a-certain-number-of-failures"> ` -a, --abort`</a><br />
-<a href="#aborting-after-a-certain-number-of-failures"> ` -x, --abortx`</a><br />
-<a href="#warnings"> ` -w, --warn`</a><br />
-<a href="#reporting-timings"> ` -d, --durations`</a><br />
-<a href="#input-file"> ` -f, --input-file`</a><br />
-<a href="#run-section"> ` -c, --section`</a><br />
-<a href="#filenames-as-tags"> ` -#, --filenames-as-tags`</a><br />
-
-
-</br>
-
-<a href="#list-test-names-only"> ` --list-test-names-only`</a><br />
-<a href="#listing-available-tests-tags-or-reporters"> ` --list-reporters`</a><br />
-<a href="#order"> ` --order`</a><br />
-<a href="#rng-seed"> ` --rng-seed`</a><br />
-<a href="#libidentify"> ` --libidentify`</a><br />
-<a href="#wait-for-keypress"> ` --wait-for-keypress`</a><br />
-<a href="#benchmark-samples"> ` --benchmark-samples`</a><br />
-<a href="#benchmark-resamples"> ` --benchmark-resamples`</a><br />
-<a href="#benchmark-confidence-interval"> ` --benchmark-confidence-interval`</a><br />
-<a href="#benchmark-no-analysis"> ` --benchmark-no-analysis`</a><br />
-<a href="#benchmark-warmup-time"> ` --benchmark-warmup-time`</a><br />
-<a href="#use-colour"> ` --use-colour`</a><br />
-
-</br>
-
-
-
-<a id="specifying-which-tests-to-run"></a>
-## Specifying which tests to run
-
-<pre>&lt;test-spec> ...</pre>
-
-Test cases, wildcarded test cases, tags and tag expressions are all passed directly as arguments. Tags are distinguished by being enclosed in square brackets.
-
-If no test specs are supplied then all test cases, except "hidden" tests, are run.
-A test is hidden by giving it any tag starting with (or just) a period (```.```) - or, in the deprecated case, tagged ```[hide]``` or given name starting with `'./'`. To specify hidden tests from the command line ```[.]``` or ```[hide]``` can be used *regardless of how they were declared*.
-
-Specs must be enclosed in quotes if they contain spaces. If they do not contain spaces the quotes are optional.
-
-Wildcards consist of the `*` character at the beginning and/or end of test case names and can substitute for any number of any characters (including none).
-
-Test specs are case insensitive.
-
-If a spec is prefixed with `exclude:` or the `~` character then the pattern matches an exclusion. This means that tests matching the pattern are excluded from the set - even if a prior inclusion spec included them. Subsequent inclusion specs will take precedence, however.
-Inclusions and exclusions are evaluated in left-to-right order.
-
-Test case examples:
-
-<pre>thisTestOnly Matches the test case called, 'thisTestOnly'
-"this test only" Matches the test case called, 'this test only'
-these* Matches all cases starting with 'these'
-exclude:notThis Matches all tests except, 'notThis'
-~notThis Matches all tests except, 'notThis'
-~*private* Matches all tests except those that contain 'private'
-a* ~ab* abc Matches all tests that start with 'a', except those that
- start with 'ab', except 'abc', which is included
--# [#somefile] Matches all tests from the file 'somefile.cpp'
-</pre>
-
-Names within square brackets are interpreted as tags.
-A series of tags form an AND expression whereas a comma-separated sequence forms an OR expression. e.g.:
-
-<pre>[one][two],[three]</pre>
-This matches all tests tagged `[one]` and `[two]`, as well as all tests tagged `[three]`
-
-Test names containing special characters, such as `,` or `[` can specify them on the command line using `\`.
-`\` also escapes itself.
-
-<a id="choosing-a-reporter-to-use"></a>
-## Choosing a reporter to use
-
-<pre>-r, --reporter &lt;reporter></pre>
-
-A reporter is an object that formats and structures the output of running tests, and potentially summarises the results. By default a console reporter is used that writes, IDE friendly, textual output. Catch comes bundled with some alternative reporters, but more can be added in client code.<br />
-The bundled reporters are:
-
-<pre>-r console
--r compact
--r xml
--r junit
-</pre>
-
-The JUnit reporter is an xml format that follows the structure of the JUnit XML Report ANT task, as consumed by a number of third-party tools, including Continuous Integration servers such as Hudson. If not otherwise needed, the standard XML reporter is preferred as this is a streaming reporter, whereas the Junit reporter needs to hold all its results until the end so it can write the overall results into attributes of the root node.
-
-<a id="breaking-into-the-debugger"></a>
-## Breaking into the debugger
-<pre>-b, --break</pre>
-
-Under most debuggers Catch2 is capable of automatically breaking on a test
-failure. This allows the user to see the current state of the test during
-failure.
-
-<a id="showing-results-for-successful-tests"></a>
-## Showing results for successful tests
-<pre>-s, --success</pre>
-
-Usually you only want to see reporting for failed tests. Sometimes it's useful to see *all* the output (especially when you don't trust that that test you just added worked first time!).
-To see successful, as well as failing, test results just pass this option. Note that each reporter may treat this option differently. The Junit reporter, for example, logs all results regardless.
-
-<a id="aborting-after-a-certain-number-of-failures"></a>
-## Aborting after a certain number of failures
-<pre>-a, --abort
--x, --abortx [&lt;failure threshold>]
-</pre>
-
-If a ```REQUIRE``` assertion fails the test case aborts, but subsequent test cases are still run.
-If a ```CHECK``` assertion fails even the current test case is not aborted.
-
-Sometimes this results in a flood of failure messages and you'd rather just see the first few. Specifying ```-a``` or ```--abort``` on its own will abort the whole test run on the first failed assertion of any kind. Use ```-x``` or ```--abortx``` followed by a number to abort after that number of assertion failures.
-
-<a id="listing-available-tests-tags-or-reporters"></a>
-## Listing available tests, tags or reporters
-<pre>-l, --list-tests
--t, --list-tags
---list-reporters
-</pre>
-
-```-l``` or ```--list-tests``` will list all registered tests, along with any tags.
-If one or more test-specs have been supplied too then only the matching tests will be listed.
-
-```-t``` or ```--list-tags``` lists all available tags, along with the number of test cases they match. Again, supplying test specs limits the tags that match.
-
-```--list-reporters``` lists the available reporters.
-
-<a id="sending-output-to-a-file"></a>
-## Sending output to a file
-<pre>-o, --out &lt;filename>
-</pre>
-
-Use this option to send all output to a file. By default output is sent to stdout (note that uses of stdout and stderr *from within test cases* are redirected and included in the report - so even stderr will effectively end up on stdout).
-
-<a id="naming-a-test-run"></a>
-## Naming a test run
-<pre>-n, --name &lt;name for test run></pre>
-
-If a name is supplied it will be used by the reporter to provide an overall name for the test run. This can be useful if you are sending to a file, for example, and need to distinguish different test runs - either from different Catch executables or runs of the same executable with different options. If not supplied the name is defaulted to the name of the executable.
-
-<a id="eliding-assertions-expected-to-throw"></a>
-## Eliding assertions expected to throw
-<pre>-e, --nothrow</pre>
-
-Skips all assertions that test that an exception is thrown, e.g. ```REQUIRE_THROWS```.
-
-These can be a nuisance in certain debugging environments that may break when exceptions are thrown (while this is usually optional for handled exceptions, it can be useful to have enabled if you are trying to track down something unexpected).
-
-Sometimes exceptions are expected outside of one of the assertions that tests for them (perhaps thrown and caught within the code-under-test). The whole test case can be skipped when using ```-e``` by marking it with the ```[!throws]``` tag.
-
-When running with this option any throw checking assertions are skipped so as not to contribute additional noise. Be careful if this affects the behaviour of subsequent tests.
-
-<a id="invisibles"></a>
-## Make whitespace visible
-<pre>-i, --invisibles</pre>
-
-If a string comparison fails due to differences in whitespace - especially leading or trailing whitespace - it can be hard to see what's going on.
-This option transforms tabs and newline characters into ```\t``` and ```\n``` respectively when printing.
-
-<a id="warnings"></a>
-## Warnings
-<pre>-w, --warn &lt;warning name></pre>
-
-Enables reporting of suspicious test states. There are currently two
-available warnings
-
-```
- NoAssertions // Fail test case / leaf section if no assertions
- // (e.g. `REQUIRE`) is encountered.
- NoTests // Return non-zero exit code when no test cases were run
- // Also calls reporter's noMatchingTestCases method
-```
-
-
-<a id="reporting-timings"></a>
-## Reporting timings
-<pre>-d, --durations &lt;yes/no></pre>
-
-When set to ```yes``` Catch will report the duration of each test case, in milliseconds. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not.
-
-<a id="input-file"></a>
-## Load test names to run from a file
-<pre>-f, --input-file &lt;filename></pre>
-
-Provide the name of a file that contains a list of test case names - one per line. Blank lines are skipped and anything after the comment character, ```#```, is ignored.
-
-A useful way to generate an initial instance of this file is to use the <a href="#list-test-names-only">list-test-names-only</a> option. This can then be manually curated to specify a specific subset of tests - or in a specific order.
-
-<a id="list-test-names-only"></a>
-## Just test names
-<pre>--list-test-names-only</pre>
-
-This option lists all available tests in a non-indented form, one on each line. This makes it ideal for saving to a file and feeding back into the <a href="#input-file">```-f``` or ```--input-file```</a> option.
-
-
-<a id="order"></a>
-## Specify the order test cases are run
-<pre>--order &lt;decl|lex|rand&gt;</pre>
-
-Test cases are ordered one of three ways:
-
-
-### decl
-Declaration order (this is the default order if no --order argument is provided). The order the tests were originally declared in. Note that ordering between files is not guaranteed and is implementation dependent.
-
-### lex
-Lexicographically sorted. Tests are sorted, alpha-numerically, by name.
-
-### rand
-Randomly sorted. Test names are sorted using ```std::random_shuffle()```. By default the random number generator is seeded with 0 - and so the order is repeatable. To control the random seed see <a href="#rng-seed">rng-seed</a>.
-
-<a id="rng-seed"></a>
-## Specify a seed for the Random Number Generator
-<pre>--rng-seed &lt;'time'|number&gt;</pre>
-
-Sets a seed for the random number generator using ```std::srand()```.
-If a number is provided this is used directly as the seed so the random pattern is repeatable.
-Alternatively if the keyword ```time``` is provided then the result of calling ```std::time(0)``` is used and so the pattern becomes unpredictable. In some cases, you might need to pass the keyword ```time``` in double quotes instead of single quotes.
-
-In either case the actual value for the seed is printed as part of Catch's output so if an issue is discovered that is sensitive to test ordering the ordering can be reproduced - even if it was originally seeded from ```std::time(0)```.
-
-<a id="libidentify"></a>
-## Identify framework and version according to the libIdentify standard
-<pre>--libidentify</pre>
-
-See [The LibIdentify repo for more information and examples](https://github.com/janwilmans/LibIdentify).
-
-<a id="wait-for-keypress"></a>
-## Wait for key before continuing
-<pre>--wait-for-keypress &lt;never|start|exit|both&gt;</pre>
-
-Will cause the executable to print a message and wait until the return/ enter key is pressed before continuing -
-either before running any tests, after running all tests - or both, depending on the argument.
-
-<a id="benchmark-samples"></a>
-## Specify the number of benchmark samples to collect
-<pre>--benchmark-samples &lt;# of samples&gt;</pre>
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
-
-When running benchmarks a number of "samples" is collected. This is the base data for later statistical analysis.
-Per sample a clock resolution dependent number of iterations of the user code is run, which is independent of the number of samples. Defaults to 100.
-
-<a id="benchmark-resamples"></a>
-## Specify the number of resamples for bootstrapping
-<pre>--benchmark-resamples &lt;# of resamples&gt;</pre>
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
-
-After the measurements are performed, statistical [bootstrapping] is performed
-on the samples. The number of resamples for that bootstrapping is configurable
-but defaults to 100000. Due to the bootstrapping it is possible to give
-estimates for the mean and standard deviation. The estimates come with a lower
-bound and an upper bound, and the confidence interval (which is configurable but
-defaults to 95%).
-
- [bootstrapping]: http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29
-
-<a id="benchmark-confidence-interval"></a>
-## Specify the confidence-interval for bootstrapping
-<pre>--benchmark-confidence-interval &lt;confidence-interval&gt;</pre>
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
-
-The confidence-interval is used for statistical bootstrapping on the samples to
-calculate the upper and lower bounds of mean and standard deviation.
-Must be between 0 and 1 and defaults to 0.95.
-
-<a id="benchmark-no-analysis"></a>
-## Disable statistical analysis of collected benchmark samples
-<pre>--benchmark-no-analysis</pre>
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
-
-When this flag is specified no bootstrapping or any other statistical analysis is performed.
-Instead the user code is only measured and the plain mean from the samples is reported.
-
-<a id="benchmark-warmup-time"></a>
-## Specify the amount of time in milliseconds spent on warming up each test
-<pre>--benchmark-warmup-time</pre>
-
-> [Introduced](https://github.com/catchorg/Catch2/pull/1844) in Catch 2.11.2.
-
-Configure the amount of time spent warming up each test.
-
-<a id="usage"></a>
-## Usage
-<pre>-h, -?, --help</pre>
-
-Prints the command line arguments to stdout
-
-
-<a id="run-section"></a>
-## Specify the section to run
-<pre>-c, --section &lt;section name&gt;</pre>
-
-To limit execution to a specific section within a test case, use this option one or more times.
-To narrow to sub-sections use multiple instances, where each subsequent instance specifies a deeper nesting level.
-
-E.g. if you have:
-
-<pre>
-TEST_CASE( "Test" ) {
- SECTION( "sa" ) {
- SECTION( "sb" ) {
- /*...*/
- }
- SECTION( "sc" ) {
- /*...*/
- }
- }
- SECTION( "sd" ) {
- /*...*/
- }
-}
-</pre>
-
-Then you can run `sb` with:
-<pre>./MyExe Test -c sa -c sb</pre>
-
-Or run just `sd` with:
-<pre>./MyExe Test -c sd</pre>
-
-To run all of `sa`, including `sb` and `sc` use:
-<pre>./MyExe Test -c sa</pre>
-
-There are some limitations of this feature to be aware of:
-- Code outside of sections being skipped will still be executed - e.g. any set-up code in the TEST_CASE before the
-start of the first section.</br>
-- At time of writing, wildcards are not supported in section names.
-- If you specify a section without narrowing to a test case first then all test cases will be executed
-(but only matching sections within them).
-
-
-<a id="filenames-as-tags"></a>
-## Filenames as tags
-<pre>-#, --filenames-as-tags</pre>
-
-When this option is used then every test is given an additional tag which is formed of the unqualified
-filename it is found in, with any extension stripped, prefixed with the `#` character.
-
-So, for example, tests within the file `~\Dev\MyProject\Ferrets.cpp` would be tagged `[#Ferrets]`.
-
-<a id="use-colour"></a>
-## Override output colouring
-<pre>--use-colour &lt;yes|no|auto&gt;</pre>
-
-Catch colours output for terminals, but omits colouring when it detects that
-output is being sent to a pipe. This is done to avoid interfering with automated
-processing of output.
-
-`--use-colour yes` forces coloured output, `--use-colour no` disables coloured
-output. The default behaviour is `--use-colour auto`.
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/commercial-users.md b/docs/commercial-users.md
deleted file mode 100644
index 7d2e87d3..00000000
--- a/docs/commercial-users.md
+++ /dev/null
@@ -1,22 +0,0 @@
-<a id="top"></a>
-# Commercial users of Catch
-
-As well as [Open Source](opensource-users.md#top) users Catch is widely used within proprietary code bases too.
-Many organisations like to keep this information internal, and that's fine,
-but if you're more open it would be great if we could list the names of as
-many organisations as possible that use Catch somewhere in their codebase.
-Enterprise environments often tend to be far more conservative in their tool adoption -
-and being aware that other companies are using Catch can ease the path in.
-
-So if you are aware of Catch usage in your organisation, and are fairly confident there is no issue with sharing this
-fact then please let us know - either directly, via a PR or
-[issue](https://github.com/philsquared/Catch/issues), or on the [forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum).
-
- - Bloomberg
- - [Bloomlife](https://bloomlife.com)
- - NASA
- - [Inscopix Inc.](https://www.inscopix.com/)
- - [Makimo](https://makimo.pl/)
- - [UX3D](https://ux3d.io)
- - [King](https://king.com)
-
diff --git a/docs/configuration.md b/docs/configuration.md
deleted file mode 100644
index 940356ad..00000000
--- a/docs/configuration.md
+++ /dev/null
@@ -1,275 +0,0 @@
-<a id="top"></a>
-# Compile-time configuration
-
-**Contents**<br>
-[main()/ implementation](#main-implementation)<br>
-[Reporter / Listener interfaces](#reporter--listener-interfaces)<br>
-[Prefixing Catch macros](#prefixing-catch-macros)<br>
-[Terminal colour](#terminal-colour)<br>
-[Console width](#console-width)<br>
-[stdout](#stdout)<br>
-[Fallback stringifier](#fallback-stringifier)<br>
-[Default reporter](#default-reporter)<br>
-[C++11 toggles](#c11-toggles)<br>
-[C++17 toggles](#c17-toggles)<br>
-[Other toggles](#other-toggles)<br>
-[Windows header clutter](#windows-header-clutter)<br>
-[Enabling stringification](#enabling-stringification)<br>
-[Disabling exceptions](#disabling-exceptions)<br>
-[Overriding Catch's debug break (`-b`)](#overriding-catchs-debug-break--b)<br>
-
-Catch is designed to "just work" as much as possible. For most people the only configuration needed is telling Catch which source file should host all the implementation code (```CATCH_CONFIG_MAIN```).
-
-Nonetheless there are still some occasions where finer control is needed. For these occasions Catch exposes a set of macros for configuring how it is built.
-
-## main()/ implementation
-
- CATCH_CONFIG_MAIN // Designates this as implementation file and defines main()
- CATCH_CONFIG_RUNNER // Designates this as implementation file
-
-Although Catch is header only it still, internally, maintains a distinction between interface headers and headers that contain implementation. Only one source file in your test project should compile the implementation headers and this is controlled through the use of one of these macros - one of these identifiers should be defined before including Catch in *exactly one implementation file in your project*.
-
-## Reporter / Listener interfaces
-
- CATCH_CONFIG_EXTERNAL_INTERFACES // Brings in necessary headers for Reporter/Listener implementation
-
-Brings in various parts of Catch that are required for user defined Reporters and Listeners. This means that new Reporters and Listeners can be defined in this file as well as in the main file.
-
-Implied by both `CATCH_CONFIG_MAIN` and `CATCH_CONFIG_RUNNER`.
-
-## Prefixing Catch macros
-
- CATCH_CONFIG_PREFIX_ALL
-
-To keep test code clean and uncluttered Catch uses short macro names (e.g. ```TEST_CASE``` and ```REQUIRE```). Occasionally these may conflict with identifiers from platform headers or the system under test. In this case the above identifier can be defined. This will cause all the Catch user macros to be prefixed with ```CATCH_``` (e.g. ```CATCH_TEST_CASE``` and ```CATCH_REQUIRE```).
-
-
-## Terminal colour
-
- CATCH_CONFIG_COLOUR_NONE // completely disables all text colouring
- CATCH_CONFIG_COLOUR_WINDOWS // forces the Win32 console API to be used
- CATCH_CONFIG_COLOUR_ANSI // forces ANSI colour codes to be used
-
-Yes, I am English, so I will continue to spell "colour" with a 'u'.
-
-When sending output to the terminal, if it detects that it can, Catch will use colourised text. On Windows the Win32 API, ```SetConsoleTextAttribute```, is used. On POSIX systems ANSI colour escape codes are inserted into the stream.
-
-For finer control you can define one of the above identifiers (these are mutually exclusive - but that is not checked so may behave unexpectedly if you mix them):
-
-Note that when ANSI colour codes are used "unistd.h" must be includable - along with a definition of ```isatty()```
-
-Typically you should place the ```#define``` before #including "catch.hpp" in your main source file - but if you prefer you can define it for your whole project by whatever your IDE or build system provides for you to do so.
-
-## Console width
-
- CATCH_CONFIG_CONSOLE_WIDTH = x // where x is a number
-
-Catch formats output intended for the console to fit within a fixed number of characters. This is especially important as indentation is used extensively and uncontrolled line wraps break this.
-By default a console width of 80 is assumed but this can be controlled by defining the above identifier to be a different value.
-
-## stdout
-
- CATCH_CONFIG_NOSTDOUT
-
-To support platforms that do not provide `std::cout`, `std::cerr` and
-`std::clog`, Catch does not usem the directly, but rather calls
-`Catch::cout`, `Catch::cerr` and `Catch::clog`. You can replace their
-implementation by defining `CATCH_CONFIG_NOSTDOUT` and implementing
-them yourself, their signatures are:
-
- std::ostream& cout();
- std::ostream& cerr();
- std::ostream& clog();
-
-[You can see an example of replacing these functions here.](
-../examples/231-Cfg-OutputStreams.cpp)
-
-
-## Fallback stringifier
-
-By default, when Catch's stringification machinery has to stringify
-a type that does not specialize `StringMaker`, does not overload `operator<<`,
-is not an enumeration and is not a range, it uses `"{?}"`. This can be
-overridden by defining `CATCH_CONFIG_FALLBACK_STRINGIFIER` to name of a
-function that should perform the stringification instead.
-
-All types that do not provide `StringMaker` specialization or `operator<<`
-overload will be sent to this function (this includes enums and ranges).
-The provided function must return `std::string` and must accept any type,
-e.g. via overloading.
-
-_Note that if the provided function does not handle a type and this type
-requires to be stringified, the compilation will fail._
-
-
-## Default reporter
-
-Catch's default reporter can be changed by defining macro
-`CATCH_CONFIG_DEFAULT_REPORTER` to string literal naming the desired
-default reporter.
-
-This means that defining `CATCH_CONFIG_DEFAULT_REPORTER` to `"console"`
-is equivalent with the out-of-the-box experience.
-
-
-## C++11 toggles
-
- CATCH_CONFIG_CPP11_TO_STRING // Use `std::to_string`
-
-Because we support platforms whose standard library does not contain
-`std::to_string`, it is possible to force Catch to use a workaround
-based on `std::stringstream`. On platforms other than Android,
-the default is to use `std::to_string`. On Android, the default is to
-use the `stringstream` workaround. As always, it is possible to override
-Catch's selection, by defining either `CATCH_CONFIG_CPP11_TO_STRING` or
-`CATCH_CONFIG_NO_CPP11_TO_STRING`.
-
-
-## C++17 toggles
-
- CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS // Use std::uncaught_exceptions instead of std::uncaught_exception
- CATCH_CONFIG_CPP17_STRING_VIEW // Override std::string_view support detection(Catch provides a StringMaker specialization by default)
- CATCH_CONFIG_CPP17_VARIANT // Override std::variant support detection (checked by CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER)
- CATCH_CONFIG_CPP17_OPTIONAL // Override std::optional support detection (checked by CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER)
- CATCH_CONFIG_CPP17_BYTE // Override std::byte support detection (Catch provides a StringMaker specialization by default)
-
-> `CATCH_CONFIG_CPP17_STRING_VIEW` was [introduced](https://github.com/catchorg/Catch2/issues/1376) in Catch 2.4.1.
-
-Catch contains basic compiler/standard detection and attempts to use
-some C++17 features whenever appropriate. This automatic detection
-can be manually overridden in both directions, that is, a feature
-can be enabled by defining the macro in the table above, and disabled
-by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`.
-
-
-## Other toggles
-
- CATCH_CONFIG_COUNTER // Use __COUNTER__ to generate unique names for test cases
- CATCH_CONFIG_WINDOWS_SEH // Enable SEH handling on Windows
- CATCH_CONFIG_FAST_COMPILE // Sacrifices some (rather minor) features for compilation speed
- CATCH_CONFIG_DISABLE_MATCHERS // Do not compile Matchers in this compilation unit
- CATCH_CONFIG_POSIX_SIGNALS // Enable handling POSIX signals
- CATCH_CONFIG_WINDOWS_CRTDBG // Enable leak checking using Windows's CRT Debug Heap
- CATCH_CONFIG_DISABLE_STRINGIFICATION // Disable stringifying the original expression
- CATCH_CONFIG_DISABLE // Disables assertions and test case registration
- CATCH_CONFIG_WCHAR // Enables use of wchart_t
- CATCH_CONFIG_EXPERIMENTAL_REDIRECT // Enables the new (experimental) way of capturing stdout/stderr
- CATCH_CONFIG_ENABLE_BENCHMARKING // Enables the integrated benchmarking features (has a significant effect on compilation speed)
- CATCH_CONFIG_USE_ASYNC // Force parallel statistical processing of samples during benchmarking
- CATCH_CONFIG_ANDROID_LOGWRITE // Use android's logging system for debug output
- CATCH_CONFIG_GLOBAL_NEXTAFTER // Use nextafter{,f,l} instead of std::nextafter
-
-> [`CATCH_CONFIG_ANDROID_LOGWRITE`](https://github.com/catchorg/Catch2/issues/1743) and [`CATCH_CONFIG_GLOBAL_NEXTAFTER`](https://github.com/catchorg/Catch2/pull/1739) were introduced in Catch 2.10.0
-
-Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support.
-
-`CATCH_CONFIG_POSIX_SIGNALS` is on by default, except when Catch is compiled under `Cygwin`, where it is disabled by default (but can be force-enabled by defining `CATCH_CONFIG_POSIX_SIGNALS`).
-
-`CATCH_CONFIG_WINDOWS_CRTDBG` is off by default. If enabled, Windows's CRT is used to check for memory leaks, and displays them after the tests finish running.
-
-`CATCH_CONFIG_WCHAR` is on by default, but can be disabled. Currently
-it is only used in support for DJGPP cross-compiler.
-
-With the exception of `CATCH_CONFIG_EXPERIMENTAL_REDIRECT`,
-these toggles can be disabled by using `_NO_` form of the toggle,
-e.g. `CATCH_CONFIG_NO_WINDOWS_SEH`.
-
-### `CATCH_CONFIG_FAST_COMPILE`
-This compile-time flag speeds up compilation of assertion macros by ~20%,
-by disabling the generation of assertion-local try-catch blocks for
-non-exception family of assertion macros ({`REQUIRE`,`CHECK`}{``,`_FALSE`, `_THAT`}).
-This disables translation of exceptions thrown under these assertions, but
-should not lead to false negatives.
-
-`CATCH_CONFIG_FAST_COMPILE` has to be either defined, or not defined,
-in all translation units that are linked into single test binary.
-
-### `CATCH_CONFIG_DISABLE_MATCHERS`
-When `CATCH_CONFIG_DISABLE_MATCHERS` is defined, all mentions of Catch's Matchers are ifdef-ed away from the translation unit. Doing so will speed up compilation of that TU.
-
-_Note: If you define `CATCH_CONFIG_DISABLE_MATCHERS` in the same file as Catch's main is implemented, your test executable will fail to link if you use Matchers anywhere._
-
-### `CATCH_CONFIG_DISABLE_STRINGIFICATION`
-This toggle enables a workaround for VS 2017 bug. For details see [known limitations](limitations.md#visual-studio-2017----raw-string-literal-in-assert-fails-to-compile).
-
-### `CATCH_CONFIG_DISABLE`
-This toggle removes most of Catch from given file. This means that `TEST_CASE`s are not registered and assertions are turned into no-ops. Useful for keeping tests within implementation files (ie for functions with internal linkage), instead of in external files.
-
-This feature is considered experimental and might change at any point.
-
-_Inspired by Doctest's `DOCTEST_CONFIG_DISABLE`_
-
-## Windows header clutter
-
-On Windows Catch includes `windows.h`. To minimize global namespace clutter in the implementation file, it defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` before including it. You can control this behaviour via two macros:
-
- CATCH_CONFIG_NO_NOMINMAX // Stops Catch from using NOMINMAX macro
- CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN // Stops Catch from using WIN32_LEAN_AND_MEAN macro
-
-
-## Enabling stringification
-
-By default, Catch does not stringify some types from the standard library. This is done to avoid dragging in various standard library headers by default. However, Catch does contain these and can be configured to provide them, using these macros:
-
- CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER // Provide StringMaker specialization for std::pair
- CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER // Provide StringMaker specialization for std::tuple
- CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER // Provide StringMaker specialization for std::chrono::duration, std::chrono::timepoint
- CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER // Provide StringMaker specialization for std::variant, std::monostate (on C++17)
- CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER // Provide StringMaker specialization for std::optional (on C++17)
- CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS // Defines all of the above
-
-> `CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1380) in Catch 2.4.1.
-
-> `CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1510) in Catch 2.6.0.
-
-## Disabling exceptions
-
-> Introduced in Catch 2.4.0.
-
-By default, Catch2 uses exceptions to signal errors and to abort tests
-when an assertion from the `REQUIRE` family of assertions fails. We also
-provide an experimental support for disabling exceptions. Catch2 should
-automatically detect when it is compiled with exceptions disabled, but
-it can be forced to compile without exceptions by defining
-
- CATCH_CONFIG_DISABLE_EXCEPTIONS
-
-Note that when using Catch2 without exceptions, there are 2 major
-limitations:
-
-1) If there is an error that would normally be signalled by an exception,
-the exception's message will instead be written to `Catch::cerr` and
-`std::terminate` will be called.
-2) If an assertion from the `REQUIRE` family of macros fails,
-`std::terminate` will be called after the active reporter returns.
-
-
-There is also a customization point for the exact behaviour of what
-happens instead of exception being thrown. To use it, define
-
- CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER
-
-and provide a definition for this function:
-
-```cpp
-namespace Catch {
- [[noreturn]]
- void throw_exception(std::exception const&);
-}
-```
-
-## Overriding Catch's debug break (`-b`)
-
-> [Introduced](https://github.com/catchorg/Catch2/pull/1846) in Catch 2.11.2.
-
-You can override Catch2's break-into-debugger code by defining the
-`CATCH_BREAK_INTO_DEBUGGER()` macro. This can be used if e.g. Catch2 does
-not know your platform, or your platform is misdetected.
-
-The macro will be used as is, that is, `CATCH_BREAK_INTO_DEBUGGER();`
-must compile and must break into debugger.
-
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/contributing.md b/docs/contributing.md
deleted file mode 100644
index 5429bf9d..00000000
--- a/docs/contributing.md
+++ /dev/null
@@ -1,173 +0,0 @@
-<a id="top"></a>
-# Contributing to Catch
-
-**Contents**<br>
-[Branches](#branches)<br>
-[Directory structure](#directory-structure)<br>
-[Testing your changes](#testing-your-changes)<br>
-[Documenting your code](#documenting-your-code)<br>
-[Code constructs to watch out for](#code-constructs-to-watch-out-for)<br>
-
-So you want to contribute something to Catch? That's great! Whether it's a bug fix, a new feature, support for
-additional compilers - or just a fix to the documentation - all contributions are very welcome and very much appreciated.
-Of course so are bug reports and other comments and questions.
-
-If you are contributing to the code base there are a few simple guidelines to keep in mind. This also includes notes to
-help you find your way around. As this is liable to drift out of date please raise an issue or, better still, a pull
-request for this file, if you notice that.
-
-## Branches
-
-Ongoing development is currently on _master_. At some point an integration branch will be set-up and PRs should target
- that - but for now it's all against master. You may see feature branches come and go from time to time, too.
-
-## Directory structure
-
-_Users_ of Catch primarily use the single header version. _Maintainers_ should work with the full source (which is still,
-primarily, in headers). This can be found in the `include` folder. There are a set of test files, currently under
-`projects/SelfTest`. The test app can be built via CMake from the `CMakeLists.txt` file in the root, or you can generate
-project files for Visual Studio, XCode, and others (instructions in the `projects` folder). If you have access to CLion,
-it can work with the CMake file directly.
-
-As well as the runtime test files you'll also see a `SurrogateCpps` directory under `projects/SelfTest`.
-This contains a set of .cpp files that each `#include` a single header.
-While these files are not essential to compilation they help to keep the implementation headers self-contained.
-At time of writing this set is not complete but has reasonable coverage.
-If you add additional headers please try to remember to add a surrogate cpp for it.
-
-The other directories are `scripts` which contains a set of python scripts to help in testing Catch as well as
-generating the single include, and `docs`, which contains the documentation as a set of markdown files.
-
-__When submitting a pull request please do not include changes to the single include, or to the version number file
-as these are managed by the scripts!__
-
-
-## Testing your changes
-
-Obviously all changes to Catch's code should be tested. If you added new
-functionality, you should add tests covering and showcasing it. Even if you have
-only made changes to Catch internals (i.e. you implemented some performance
-improvements), you should still test your changes.
-
-This means 2 things
-
-* Compiling Catch's SelfTest project:
-```
-$ cd Catch2
-$ cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug
-$ cmake --build debug-build
-```
-because code that does not compile is evidently incorrect. Obviously,
-you are not expected to have access to all the compilers and platforms
-supported by Catch2, but you should at least smoke test your changes
-on your platform. Our CI pipeline will check your PR against most of
-the supported platforms, but it takes an hour to finish -- compiling
-locally takes just a few minutes.
-
-
-* Running the tests via CTest:
-```
-$ cd debug-build
-$ ctest -j 2 --output-on-failure
-```
-__Note:__ When running your tests with multi-configuration generators like
-Visual Studio, you might get errors "Test not available without configuration."
-You then have to pick one configuration (e.g. ` -C Debug`) in the `ctest` call.
-
-If you added new tests, approval tests are very likely to fail. If they
-do not, it means that your changes weren't run as part of them. This
-_might_ be intentional, but usually is not.
-
-The approval tests compare current output of the SelfTest binary in various
-configurations against known good outputs. The reason it fails is,
-_usually_, that you've added new tests but have not yet approved the changes
-they introduce. This is done with the `scripts/approve.py` script, but
-before you do so, you need to check that the introduced changes are indeed
-intentional.
-
-
-## Documenting your code
-
-If you have added new feature to Catch2, it needs documentation, so that
-other people can use it as well. This section collects some technical
-information that you will need for updating Catch2's documentation, and
-possibly some generic advise as well.
-
-First, the technicalities:
-
-* We introduced version tags to the documentation, which show users in
-which version a specific feature was introduced. This means that newly
-written documentation should be tagged with a placeholder, that will
-be replaced with the actual version upon release. There are 2 styles
-of placeholders used through the documentation, you should pick one that
-fits your text better (if in doubt, take a look at the existing version
-tags for other features).
- * `> [Introduced](link-to-issue-or-PR) in Catch X.Y.Z` - this
- placeholder is usually used after a section heading
- * `> X (Y and Z) was [introduced](link-to-issue-or-PR) in Catch X.Y.Z`
- - this placeholder is used when you need to tag a subpart of something,
- e.g. list
-* Crosslinks to different pages should target the `top` anchor, like this
-`[link to contributing](contributing.md#top)`.
-* If you have introduced a new document, there is a simple template you
-should use. It provides you with the top anchor mentioned above, and also
-with a backlink to the top of the documentation:
-```markdown
-<a id="top"></a>
-# Cool feature
-
-Text that explains how to use the cool feature.
-
-
----
-
-[Home](Readme.md#top)
-```
-* For pages with more than 4 subheadings, we provide a table of contents
-(ToC) at the top of the page. Because GitHub markdown does not support
-automatic generation of ToC, it has to be handled semi-manually. Thus,
-if you've added a new subheading to some page, you should add it to the
-ToC. This can be done either manually, or by running the
-`updateDocumentToC.py` script in the `scripts/` folder.
-
-
-Now, for the generic tips:
- * Usage examples are good
- * Don't be afraid to introduce new pages
- * Try to be reasonably consistent with the surrounding documentation
-
-
-
-
-## Code constructs to watch out for
-
-This section is a (sadly incomplete) listing of various constructs that
-are problematic and are not always caught by our CI infrastructure.
-
-### Naked exceptions and exceptions-related function
-
-If you are throwing an exception, it should be done via `CATCH_ERROR`
-or `CATCH_RUNTIME_ERROR` in `catch_enforce.h`. These macros will handle
-the differences between compilation with or without exceptions for you.
-However, some platforms (IAR) also have problems with exceptions-related
-functions, such as `std::current_exceptions`. We do not have IAR in our
-CI, but luckily there should not be too many reasons to use these.
-However, if you do, they should be kept behind a
-`CATCH_CONFIG_DISABLE_EXCEPTIONS` macro.
-
-### Unqualified usage of functions from C's stdlib
-
-If you are using a function from C's stdlib, please include the header
-as `<cfoo>` and call the function qualified. The common knowledge that
-there is no difference is wrong, QNX and VxWorks won't compile if you
-include the header as `<cfoo>` and call the function unqualified.
-
-
-----
-
-_This documentation will always be in-progress as new information comes
-up, but we are trying to keep it as up to date as possible._
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/deprecations.md b/docs/deprecations.md
deleted file mode 100644
index 39194ed7..00000000
--- a/docs/deprecations.md
+++ /dev/null
@@ -1,137 +0,0 @@
-<a id="top"></a>
-# Deprecations and incoming changes
-
-This page documents current deprecations and upcoming planned changes
-inside Catch2. The difference between these is that a deprecated feature
-will be removed, while a planned change to a feature means that the
-feature will behave differently, but will still be present. Obviously,
-either of these is a breaking change, and thus will not happen until
-at least the next major release.
-
-
-## Deprecations
-
-### `--list-*` return values
-
-The return codes of the `--list-*` family of command line arguments
-will no longer be equal to the number of tests/tags/etc found, instead
-it will be 0 for success and non-zero for failure.
-
-
-### `--list-test-names-only`
-
-`--list-test-names-only` command line argument will be removed.
-
-
-### `ANON_TEST_CASE`
-
-`ANON_TEST_CASE` is scheduled for removal, as it can be fully replaced
-by a `TEST_CASE` with no arguments.
-
-
-### Secondary description amongst tags
-
-Currently, the tags part of `TEST_CASE` (and others) macro can also
-contain text that is not part of tags. This text is then separated into
-a "description" of the test case, but the description is then never used
-apart from writing it out for `--list-tests -v high`.
-
-Because it isn't actually used nor documented, and brings complications
-to Catch2's internals, description support will be removed.
-
-### SourceLineInfo::empty()
-
-There should be no reason to ever have an empty `SourceLineInfo`, so the
-method will be removed.
-
-
-### Composing lvalues of already composed matchers
-
-Because a significant bug in this use case has persisted for 2+ years
-without a bug report, and to simplify the implementation, code that
-composes lvalues of composed matchers will not compile. That is,
-this code will no longer work:
-
-```cpp
- auto m1 = Contains("string");
- auto m2 = Contains("random");
- auto composed1 = m1 || m2;
- auto m3 = Contains("different");
- auto composed2 = composed1 || m3;
- REQUIRE_THAT(foo(), !composed1);
- REQUIRE_THAT(foo(), composed2);
-```
-
-Instead you will have to write this:
-
-```cpp
- auto m1 = Contains("string");
- auto m2 = Contains("random");
- auto m3 = Contains("different");
- REQUIRE_THAT(foo(), !(m1 || m2));
- REQUIRE_THAT(foo(), m1 || m2 || m3);
-```
-
-
-## Planned changes
-
-
-### Reporter verbosities
-
-The current implementation of verbosities, where the reporter is checked
-up-front whether it supports the requested verbosity, is fundamentally
-misguided and will be changed. The new implementation will no longer check
-whether the specified reporter supports the requested verbosity, instead
-it will be up to the reporters to deal with verbosities as they see fit
-(with an expectation that unsupported verbosities will be, at most,
-warnings, but not errors).
-
-
-### Output format of `--list-*` command line parameters
-
-The various list operations will be piped through reporters. This means
-that e.g. XML reporter will write the output as machine-parseable XML,
-while the Console reporter will keep the current, human-oriented output.
-
-
-### `CHECKED_IF` and `CHECKED_ELSE`
-
-To make the `CHECKED_IF` and `CHECKED_ELSE` macros more useful, they will
-be marked as "OK to fail" (`Catch::ResultDisposition::SuppressFail` flag
-will be added), which means that their failure will not fail the test,
-making the `else` actually useful.
-
-
-### Change semantics of `[.]` and tag exclusion
-
-Currently, given these 2 tests
-```cpp
-TEST_CASE("A", "[.][foo]") {}
-TEST_CASE("B", "[.][bar]") {}
-```
-specifying `[foo]` as the testspec will run test "A" and specifying
-`~[foo]` will run test "B", even though it is hidden. Also, specifying
-`~[baz]` will run both tests. This behaviour is often surprising and will
-be changed so that hidden tests are included in a run only if they
-positively match a testspec.
-
-
-### Console Colour API
-
-The API for Catch2's console colour will be changed to take an extra
-argument, the stream to which the colour code should be applied.
-
-
-### Type erasure in the `PredicateMatcher`
-
-Currently, the `PredicateMatcher` uses `std::function` for type erasure,
-so that type of the matcher is always `PredicateMatcher<T>`, regardless
-of the type of the predicate. Because of the high compilation overhead
-of `std::function`, and the fact that the type erasure is used only rarely,
-`PredicateMatcher` will no longer be type erased in the future. Instead,
-the predicate type will be made part of the PredicateMatcher's type.
-
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/event-listeners.md b/docs/event-listeners.md
deleted file mode 100644
index 62311006..00000000
--- a/docs/event-listeners.md
+++ /dev/null
@@ -1,75 +0,0 @@
-<a id="top"></a>
-# Event Listeners
-
-A `Listener` is a class you can register with Catch that will then be passed events,
-such as a test case starting or ending, as they happen during a test run.
-`Listeners` are actually types of `Reporters`, with a few small differences:
-
-1. Once registered in code they are automatically used - you don't need to specify them on the command line
-2. They are called in addition to (just before) any reporters, and you can register multiple listeners.
-3. They derive from `Catch::TestEventListenerBase`, which has default stubs for all the events,
-so you are not forced to implement events you're not interested in.
-4. You register a listener with `CATCH_REGISTER_LISTENER`
-
-
-## Implementing a Listener
-Simply derive a class from `Catch::TestEventListenerBase` and implement the methods you are interested in, either in
-the main source file (i.e. the one that defines `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`), or in a
-file that defines `CATCH_CONFIG_EXTERNAL_INTERFACES`.
-
-Then register it using `CATCH_REGISTER_LISTENER`.
-
-For example ([complete source code](../examples/210-Evt-EventListeners.cpp)):
-
-```c++
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-
-struct MyListener : Catch::TestEventListenerBase {
-
- using TestEventListenerBase::TestEventListenerBase; // inherit constructor
-
- void testCaseStarting( Catch::TestCaseInfo const& testInfo ) override {
- // Perform some setup before a test case is run
- }
-
- void testCaseEnded( Catch::TestCaseStats const& testCaseStats ) override {
- // Tear-down after a test case is run
- }
-};
-CATCH_REGISTER_LISTENER( MyListener )
-```
-
-_Note that you should not use any assertion macros within a Listener!_
-
-## Events that can be hooked
-
-The following are the methods that can be overridden in the Listener:
-
-```c++
-// The whole test run, starting and ending
-virtual void testRunStarting( TestRunInfo const& testRunInfo );
-virtual void testRunEnded( TestRunStats const& testRunStats );
-
-// Test cases starting and ending
-virtual void testCaseStarting( TestCaseInfo const& testInfo );
-virtual void testCaseEnded( TestCaseStats const& testCaseStats );
-
-// Sections starting and ending
-virtual void sectionStarting( SectionInfo const& sectionInfo );
-virtual void sectionEnded( SectionStats const& sectionStats );
-
-// Assertions before/ after
-virtual void assertionStarting( AssertionInfo const& assertionInfo );
-virtual bool assertionEnded( AssertionStats const& assertionStats );
-
-// A test is being skipped (because it is "hidden")
-virtual void skipTest( TestCaseInfo const& testInfo );
-```
-
-More information about the events (e.g. name of the test case) is contained in the structs passed as arguments -
-just look in the source code to see what fields are available.
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/generators.md b/docs/generators.md
deleted file mode 100644
index 55ff0ba5..00000000
--- a/docs/generators.md
+++ /dev/null
@@ -1,154 +0,0 @@
-<a id="top"></a>
-# Data Generators
-
-> Introduced in Catch 2.6.0.
-
-Data generators (also known as _data driven/parametrized test cases_)
-let you reuse the same set of assertions across different input values.
-In Catch2, this means that they respect the ordering and nesting
-of the `TEST_CASE` and `SECTION` macros, and their nested sections
-are run once per each value in a generator.
-
-This is best explained with an example:
-```cpp
-TEST_CASE("Generators") {
- auto i = GENERATE(1, 2, 3);
- SECTION("one") {
- auto j = GENERATE( -3, -2, -1 );
- REQUIRE(j < i);
- }
-}
-```
-
-The assertion in this test case will be run 9 times, because there
-are 3 possible values for `i` (1, 2, and 3) and there are 3 possible
-values for `j` (-3, -2, and -1).
-
-
-There are 2 parts to generators in Catch2, the `GENERATE` macro together
-with the already provided generators, and the `IGenerator<T>` interface
-that allows users to implement their own generators.
-
-## Provided generators
-
-Catch2's provided generator functionality consists of three parts,
-
-* `GENERATE` macro, that serves to integrate generator expression with
-a test case,
-* 2 fundamental generators
- * `SingleValueGenerator<T>` -- contains only single element
- * `FixedValuesGenerator<T>` -- contains multiple elements
-* 5 generic generators that modify other generators
- * `FilterGenerator<T, Predicate>` -- filters out elements from a generator
- for which the predicate returns "false"
- * `TakeGenerator<T>` -- takes first `n` elements from a generator
- * `RepeatGenerator<T>` -- repeats output from a generator `n` times
- * `MapGenerator<T, U, Func>` -- returns the result of applying `Func`
- on elements from a different generator
- * `ChunkGenerator<T>` -- returns chunks (inside `std::vector`) of n elements from a generator
-* 4 specific purpose generators
- * `RandomIntegerGenerator<Integral>` -- generates random Integrals from range
- * `RandomFloatGenerator<Float>` -- generates random Floats from range
- * `RangeGenerator<T>` -- generates all values inside an arithmetic range
- * `IteratorGenerator<T>` -- copies and returns values from an iterator range
-
-> `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch 2.7.0.
-
-> `IteratorGenerator<T>` was introduced in Catch 2.10.0.
-
-The generators also have associated helper functions that infer their
-type, making their usage much nicer. These are
-
-* `value(T&&)` for `SingleValueGenerator<T>`
-* `values(std::initializer_list<T>)` for `FixedValuesGenerator<T>`
-* `table<Ts...>(std::initializer_list<std::tuple<Ts...>>)` for `FixedValuesGenerator<std::tuple<Ts...>>`
-* `filter(predicate, GeneratorWrapper<T>&&)` for `FilterGenerator<T, Predicate>`
-* `take(count, GeneratorWrapper<T>&&)` for `TakeGenerator<T>`
-* `repeat(repeats, GeneratorWrapper<T>&&)` for `RepeatGenerator<T>`
-* `map(func, GeneratorWrapper<T>&&)` for `MapGenerator<T, U, Func>` (map `U` to `T`, deduced from `Func`)
-* `map<T>(func, GeneratorWrapper<U>&&)` for `MapGenerator<T, U, Func>` (map `U` to `T`)
-* `chunk(chunk-size, GeneratorWrapper<T>&&)` for `ChunkGenerator<T>`
-* `random(IntegerOrFloat a, IntegerOrFloat b)` for `RandomIntegerGenerator` or `RandomFloatGenerator`
-* `range(Arithemtic start, Arithmetic end)` for `RangeGenerator<Arithmetic>` with a step size of `1`
-* `range(Arithmetic start, Arithmetic end, Arithmetic step)` for `RangeGenerator<Arithmetic>` with a custom step size
-* `from_range(InputIterator from, InputIterator to)` for `IteratorGenerator<T>`
-* `from_range(Container const&)` for `IteratorGenerator<T>`
-
-> `chunk()`, `random()` and both `range()` functions were introduced in Catch 2.7.0.
-
-> `from_range` has been introduced in Catch 2.10.0
-
-> `range()` for floating point numbers has been introduced in Catch 2.11.0
-
-And can be used as shown in the example below to create a generator
-that returns 100 odd random number:
-
-```cpp
-TEST_CASE("Generating random ints", "[example][generator]") {
- SECTION("Deducing functions") {
- auto i = GENERATE(take(100, filter([](int i) { return i % 2 == 1; }, random(-100, 100))));
- REQUIRE(i > -100);
- REQUIRE(i < 100);
- REQUIRE(i % 2 == 1);
- }
-}
-```
-
-
-Apart from registering generators with Catch2, the `GENERATE` macro has
-one more purpose, and that is to provide simple way of generating trivial
-generators, as seen in the first example on this page, where we used it
-as `auto i = GENERATE(1, 2, 3);`. This usage converted each of the three
-literals into a single `SingleValueGenerator<int>` and then placed them all in
-a special generator that concatenates other generators. It can also be
-used with other generators as arguments, such as `auto i = GENERATE(0, 2,
-take(100, random(300, 3000)));`. This is useful e.g. if you know that
-specific inputs are problematic and want to test them separately/first.
-
-**For safety reasons, you cannot use variables inside the `GENERATE` macro.
-This is done because the generator expression _will_ outlive the outside
-scope and thus capturing references is dangerous. If you need to use
-variables inside the generator expression, make sure you thought through
-the lifetime implications and use `GENERATE_COPY` or `GENERATE_REF`.**
-
-> `GENERATE_COPY` and `GENERATE_REF` were introduced in Catch 2.7.1.
-
-You can also override the inferred type by using `as<type>` as the first
-argument to the macro. This can be useful when dealing with string literals,
-if you want them to come out as `std::string`:
-
-```cpp
-TEST_CASE("type conversion", "[generators]") {
- auto str = GENERATE(as<std::string>{}, "a", "bb", "ccc");
- REQUIRE(str.size() > 0);
-}
-```
-
-## Generator interface
-
-You can also implement your own generators, by deriving from the
-`IGenerator<T>` interface:
-
-```cpp
-template<typename T>
-struct IGenerator : GeneratorUntypedBase {
- // via GeneratorUntypedBase:
- // Attempts to move the generator to the next element.
- // Returns true if successful (and thus has another element that can be read)
- virtual bool next() = 0;
-
- // Precondition:
- // The generator is either freshly constructed or the last call to next() returned true
- virtual T const& get() const = 0;
-};
-```
-
-However, to be able to use your custom generator inside `GENERATE`, it
-will need to be wrapped inside a `GeneratorWrapper<T>`.
-`GeneratorWrapper<T>` is a value wrapper around a
-`std::unique_ptr<IGenerator<T>>`.
-
-For full example of implementing your own generator, look into Catch2's
-examples, specifically
-[Generators: Create your own generator](../examples/300-Gen-OwnGenerator.cpp).
-
diff --git a/docs/limitations.md b/docs/limitations.md
deleted file mode 100644
index 65483b87..00000000
--- a/docs/limitations.md
+++ /dev/null
@@ -1,187 +0,0 @@
-<a id="top"></a>
-# Known limitations
-
-Over time, some limitations of Catch2 emerged. Some of these are due
-to implementation details that cannot be easily changed, some of these
-are due to lack of development resources on our part, and some of these
-are due to plain old 3rd party bugs.
-
-
-## Implementation limits
-### Sections nested in loops
-
-If you are using `SECTION`s inside loops, you have to create them with
-different name per loop's iteration. The recommended way to do so is to
-incorporate the loop's counter into section's name, like so:
-
-```cpp
-TEST_CASE( "Looped section" ) {
- for (char i = '0'; i < '5'; ++i) {
- SECTION(std::string("Looped section ") + i) {
- SUCCEED( "Everything is OK" );
- }
- }
-}
-```
-
-or with a `DYNAMIC_SECTION` macro (that was made for exactly this purpose):
-
-```cpp
-TEST_CASE( "Looped section" ) {
- for (char i = '0'; i < '5'; ++i) {
- DYNAMIC_SECTION( "Looped section " << i) {
- SUCCEED( "Everything is OK" );
- }
- }
-}
-```
-
-### Tests might be run again if last section fails
-
-If the last section in a test fails, it might be run again. This is because
-Catch2 discovers `SECTION`s dynamically, as they are about to run, and
-if the last section in test case is aborted during execution (e.g. via
-the `REQUIRE` family of macros), Catch2 does not know that there are no
-more sections in that test case and must run the test case again.
-
-
-### MinGW/CygWin compilation (linking) is extremely slow
-
-Compiling Catch2 with MinGW can be exceedingly slow, especially during
-the linking step. As far as we can tell, this is caused by deficiencies
-in its default linker. If you can tell MinGW to instead use lld, via
-`-fuse-ld=lld`, the link time should drop down to reasonable length
-again.
-
-
-## Features
-This section outlines some missing features, what is their status and their possible workarounds.
-
-### Thread safe assertions
-Catch2's assertion macros are not thread safe. This does not mean that
-you cannot use threads inside Catch's test, but that only single thread
-can interact with Catch's assertions and other macros.
-
-This means that this is ok
-```cpp
- std::vector<std::thread> threads;
- std::atomic<int> cnt{ 0 };
- for (int i = 0; i < 4; ++i) {
- threads.emplace_back([&]() {
- ++cnt; ++cnt; ++cnt; ++cnt;
- });
- }
- for (auto& t : threads) { t.join(); }
- REQUIRE(cnt == 16);
-```
-because only one thread passes the `REQUIRE` macro and this is not
-```cpp
- std::vector<std::thread> threads;
- std::atomic<int> cnt{ 0 };
- for (int i = 0; i < 4; ++i) {
- threads.emplace_back([&]() {
- ++cnt; ++cnt; ++cnt; ++cnt;
- CHECK(cnt == 16);
- });
- }
- for (auto& t : threads) { t.join(); }
- REQUIRE(cnt == 16);
-```
-
-Because C++11 provides the necessary tools to do this, we are planning
-to remove this limitation in the future.
-
-### Process isolation in a test
-Catch does not support running tests in isolated (forked) processes. While this might in the future, the fact that Windows does not support forking and only allows full-on process creation and the desire to keep code as similar as possible across platforms, mean that this is likely to take significant development time, that is not currently available.
-
-### Running multiple tests in parallel
-Catch's test execution is strictly serial. If you find yourself with a test suite that takes too long to run and you want to make it parallel, there are 2 feasible solutions
- * You can split your tests into multiple binaries and then run these binaries in parallel.
- * You can have Catch list contained test cases and then run the same test binary multiple times in parallel, passing each instance list of test cases it should run.
-
-Both of these solutions have their problems, but should let you wring parallelism out of your test suite.
-
-## 3rd party bugs
-This section outlines known bugs in 3rd party components (this means compilers, standard libraries, standard runtimes).
-
-### Visual Studio 2017 -- raw string literal in assert fails to compile
-There is a known bug in Visual Studio 2017 (VC 15), that causes compilation error when preprocessor attempts to stringize a raw string literal (`#` preprocessor is applied to it). This snippet is sufficient to trigger the compilation error:
-```cpp
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-
-TEST_CASE("test") {
- CHECK(std::string(R"("\)") == "\"\\");
-}
-```
-
-Catch provides a workaround, it is possible to disable stringification of original expressions by defining `CATCH_CONFIG_DISABLE_STRINGIFICATION`:
-```cpp
-#define CATCH_CONFIG_FAST_COMPILE
-#define CATCH_CONFIG_DISABLE_STRINGIFICATION
-#include "catch.hpp"
-
-TEST_CASE("test") {
- CHECK(std::string(R"("\)") == "\"\\");
-}
-```
-
-_Do note that this changes the output somewhat_
-```
-catchwork\test1.cpp(6):
-PASSED:
- CHECK( Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION )
-with expansion:
- ""\" == ""\"
-```
-
-### Visual Studio 2015 -- Alignment compilation error (C2718)
-
-VS 2015 has a known bug, where `declval<T>` can cause compilation error
-if `T` has alignment requirements that it cannot meet.
-
-
-A workaround is to explicitly specialize `Catch::is_range` for given
-type (this avoids code path that uses `declval<T>` in a SFINAE context).
-
-
-### Visual Studio 2015 -- Wrong line number reported in debug mode
-VS 2015 has a known bug where `__LINE__` macro can be improperly expanded under certain circumstances, while compiling multi-file project in Debug mode.
-
-A workaround is to compile the binary in Release mode.
-
-### Clang/G++ -- skipping leaf sections after an exception
-Some versions of `libc++` and `libstdc++` (or their runtimes) have a bug with `std::uncaught_exception()` getting stuck returning `true` after rethrow, even if there are no active exceptions. One such case is this snippet, which skipped the sections "a" and "b", when compiled against `libcxxrt` from master
-```cpp
-#define CATCH_CONFIG_MAIN
-#include <catch.hpp>
-
-TEST_CASE("a") {
- CHECK_THROWS(throw 3);
-}
-
-TEST_CASE("b") {
- int i = 0;
- SECTION("a") { i = 1; }
- SECTION("b") { i = 2; }
- CHECK(i > 0);
-}
-```
-
-If you are seeing a problem like this, i.e. a weird test paths that trigger only under Clang with `libc++`, or only under very specific version of `libstdc++`, it is very likely you are seeing this. The only known workaround is to use a fixed version of your standard library.
-
-### Clang/G++ -- `Matches` string matcher always returns false
-This is a bug in `libstdc++-4.8`, where all matching methods from `<regex>` return false. Since `Matches` uses `<regex>` internally, if the underlying implementation does not work, it doesn't work either.
-
-Workaround: Use newer version of `libstdc++`.
-
-
-### libstdc++, `_GLIBCXX_DEBUG` macro and random ordering of tests
-
-Running a Catch2 binary compiled against libstdc++ with `_GLIBCXX_DEBUG`
-macro defined with `--order rand` will cause a debug check to trigger and
-abort the run due to self-assignment.
-[This is a known bug inside libstdc++](https://stackoverflow.com/questions/22915325/avoiding-self-assignment-in-stdshuffle/23691322)
-
-Workaround: Don't use `--order rand` when compiling against debug-enabled
-libstdc++.
diff --git a/docs/list-of-examples.md b/docs/list-of-examples.md
deleted file mode 100644
index 95e7bda0..00000000
--- a/docs/list-of-examples.md
+++ /dev/null
@@ -1,48 +0,0 @@
-<a id="top"></a>
-# List of examples
-
-## Already available
-
-- Catch main: [Catch-provided main](../examples/000-CatchMain.cpp)
-- Test Case: [Single-file](../examples/010-TestCase.cpp)
-- Test Case: [Multiple-file 1](../examples/020-TestCase-1.cpp), [2](../examples/020-TestCase-2.cpp)
-- Assertion: [REQUIRE, CHECK](../examples/030-Asn-Require-Check.cpp)
-- Fixture: [Sections](../examples/100-Fix-Section.cpp)
-- Fixture: [Class-based fixtures](../examples/110-Fix-ClassFixture.cpp)
-- BDD: [SCENARIO, GIVEN, WHEN, THEN](../examples/120-Bdd-ScenarioGivenWhenThen.cpp)
-- Report: [Catch-provided main](../examples/200-Rpt-CatchMain.cpp)
-- Report: [TeamCity reporter](../examples/207-Rpt-TeamCityReporter.cpp)
-- Listener: [Listeners](../examples/210-Evt-EventListeners.cpp)
-- Configuration: [Provide your own output streams](../examples/231-Cfg-OutputStreams.cpp)
-- Generators: [Create your own generator](../examples/300-Gen-OwnGenerator.cpp)
-- Generators: [Use map to convert types in GENERATE expression](../examples/301-Gen-MapTypeConversion.cpp)
-- Generators: [Use variables in generator expressions](../examples/310-Gen-VariablesInGenerators.cpp)
-- Generators: [Use custom variable capture in generator expressions](../examples/311-Gen-CustomCapture.cpp)
-
-
-## Planned
-
-- Assertion: [REQUIRE_THAT and Matchers](../examples/040-Asn-RequireThat.cpp)
-- Assertion: [REQUIRE_NO_THROW](../examples/050-Asn-RequireNoThrow.cpp)
-- Assertion: [REQUIRE_THROWS](../examples/050-Asn-RequireThrows.cpp)
-- Assertion: [REQUIRE_THROWS_AS](../examples/070-Asn-RequireThrowsAs.cpp)
-- Assertion: [REQUIRE_THROWS_WITH](../examples/080-Asn-RequireThrowsWith.cpp)
-- Assertion: [REQUIRE_THROWS_MATCHES](../examples/090-Asn-RequireThrowsMatches.cpp)
-- Floating point: [Approx - Comparisons](../examples/130-Fpt-Approx.cpp)
-- Logging: [CAPTURE - Capture expression](../examples/140-Log-Capture.cpp)
-- Logging: [INFO - Provide information with failure](../examples/150-Log-Info.cpp)
-- Logging: [WARN - Issue warning](../examples/160-Log-Warn.cpp)
-- Logging: [FAIL, FAIL_CHECK - Issue message and force failure/continue](../examples/170-Log-Fail.cpp)
-- Logging: [SUCCEED - Issue message and continue](../examples/180-Log-Succeed.cpp)
-- Report: [User-defined type](../examples/190-Rpt-ReportUserDefinedType.cpp)
-- Report: [User-defined reporter](../examples/202-Rpt-UserDefinedReporter.cpp)
-- Report: [Automake reporter](../examples/205-Rpt-AutomakeReporter.cpp)
-- Report: [TAP reporter](../examples/206-Rpt-TapReporter.cpp)
-- Report: [Multiple reporter](../examples/208-Rpt-MultipleReporters.cpp)
-- Configuration: [Provide your own main()](../examples/220-Cfg-OwnMain.cpp)
-- Configuration: [Compile-time configuration](../examples/230-Cfg-CompileTimeConfiguration.cpp)
-- Configuration: [Run-time configuration](../examples/240-Cfg-RunTimeConfiguration.cpp)
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/logging.md b/docs/logging.md
deleted file mode 100644
index 476b1e08..00000000
--- a/docs/logging.md
+++ /dev/null
@@ -1,159 +0,0 @@
-<a id="top"></a>
-# Logging macros
-
-Additional messages can be logged during a test case. Note that the messages logged with `INFO` are scoped and thus will not be reported if failure occurs in scope preceding the message declaration. An example:
-
-```cpp
-TEST_CASE("Foo") {
- INFO("Test case start");
- for (int i = 0; i < 2; ++i) {
- INFO("The number is " << i);
- CHECK(i == 0);
- }
-}
-
-TEST_CASE("Bar") {
- INFO("Test case start");
- for (int i = 0; i < 2; ++i) {
- INFO("The number is " << i);
- CHECK(i == i);
- }
- CHECK(false);
-}
-```
-When the `CHECK` fails in the "Foo" test case, then two messages will be printed.
-```
-Test case start
-The number is 1
-```
-When the last `CHECK` fails in the "Bar" test case, then only one message will be printed: `Test case start`.
-
-## Logging without local scope
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch 2.7.0.
-
-`UNSCOPED_INFO` is similar to `INFO` with two key differences:
-
-- Lifetime of an unscoped message is not tied to its own scope.
-- An unscoped message can be reported by the first following assertion only, regardless of the result of that assertion.
-
-In other words, lifetime of `UNSCOPED_INFO` is limited by the following assertion (or by the end of test case/section, whichever comes first) whereas lifetime of `INFO` is limited by its own scope.
-
-These differences make this macro useful for reporting information from helper functions or inner scopes. An example:
-
-```cpp
-void print_some_info() {
- UNSCOPED_INFO("Info from helper");
-}
-
-TEST_CASE("Baz") {
- print_some_info();
- for (int i = 0; i < 2; ++i) {
- UNSCOPED_INFO("The number is " << i);
- }
- CHECK(false);
-}
-
-TEST_CASE("Qux") {
- INFO("First info");
- UNSCOPED_INFO("First unscoped info");
- CHECK(false);
-
- INFO("Second info");
- UNSCOPED_INFO("Second unscoped info");
- CHECK(false);
-}
-```
-
-"Baz" test case prints:
-```
-Info from helper
-The number is 0
-The number is 1
-```
-
-With "Qux" test case, two messages will be printed when the first `CHECK` fails:
-```
-First info
-First unscoped info
-```
-
-"First unscoped info" message will be cleared after the first `CHECK`, while "First info" message will persist until the end of the test case. Therefore, when the second `CHECK` fails, three messages will be printed:
-```
-First info
-Second info
-Second unscoped info
-```
-
-## Streaming macros
-
-All these macros allow heterogeneous sequences of values to be streaming using the insertion operator (```<<```) in the same way that std::ostream, std::cout, etc support it.
-
-E.g.:
-```c++
-INFO( "The number is " << i );
-```
-
-(Note that there is no initial ```<<``` - instead the insertion sequence is placed in parentheses.)
-These macros come in three forms:
-
-**INFO(** _message expression_ **)**
-
-The message is logged to a buffer, but only reported with next assertions that are logged. This allows you to log contextual information in case of failures which is not shown during a successful test run (for the console reporter, without -s). Messages are removed from the buffer at the end of their scope, so may be used, for example, in loops.
-
-_Note that in Catch2 2.x.x `INFO` can be used without a trailing semicolon as there is a trailing semicolon inside macro.
-This semicolon will be removed with next major version. It is highly advised to use a trailing semicolon after `INFO` macro._
-
-**UNSCOPED_INFO(** _message expression_ **)**
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch 2.7.0.
-
-Similar to `INFO`, but messages are not limited to their own scope: They are removed from the buffer after each assertion, section or test case, whichever comes first.
-
-**WARN(** _message expression_ **)**
-
-The message is always reported but does not fail the test.
-
-**FAIL(** _message expression_ **)**
-
-The message is reported and the test case fails.
-
-**FAIL_CHECK(** _message expression_ **)**
-
-AS `FAIL`, but does not abort the test
-
-## Quickly capture value of variables or expressions
-
-**CAPTURE(** _expression1_, _expression2_, ... **)**
-
-Sometimes you just want to log a value of variable, or expression. For
-convenience, we provide the `CAPTURE` macro, that can take a variable,
-or an expression, and prints out that variable/expression and its value
-at the time of capture.
-
-e.g. `CAPTURE( theAnswer );` will log message "theAnswer := 42", while
-```cpp
-int a = 1, b = 2, c = 3;
-CAPTURE( a, b, c, a + b, c > b, a == 1);
-```
-will log a total of 6 messages:
-```
-a := 1
-b := 2
-c := 3
-a + b := 3
-c > b := true
-a == 1 := true
-```
-
-You can also capture expressions that use commas inside parentheses
-(e.g. function calls), brackets, or braces (e.g. initializers). To
-properly capture expression that contains template parameters list
-(in other words, it contains commas between angle brackets), you need
-to enclose the expression inside parentheses:
-`CAPTURE( (std::pair<int, int>{1, 2}) );`
-
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/matchers.md b/docs/matchers.md
deleted file mode 100644
index bdb7dac4..00000000
--- a/docs/matchers.md
+++ /dev/null
@@ -1,207 +0,0 @@
-<a id="top"></a>
-# Matchers
-
-Matchers are an alternative way to do assertions which are easily extensible and composable.
-This makes them well suited to use with more complex types (such as collections) or your own custom types.
-Matchers were first popularised by the [Hamcrest](https://en.wikipedia.org/wiki/Hamcrest) family of frameworks.
-
-## In use
-
-Matchers are introduced with the `REQUIRE_THAT` or `CHECK_THAT` macros, which take two arguments.
-The first argument is the thing (object or value) under test. The second part is a match _expression_,
-which consists of either a single matcher or one or more matchers combined using `&&`, `||` or `!` operators.
-
-For example, to assert that a string ends with a certain substring:
-
- ```c++
-using Catch::Matchers::EndsWith; // or Catch::EndsWith
-std::string str = getStringFromSomewhere();
-REQUIRE_THAT( str, EndsWith( "as a service" ) );
-```
-
-The matcher objects can take multiple arguments, allowing more fine tuning.
-The built-in string matchers, for example, take a second argument specifying whether the comparison is
-case sensitive or not:
-
-```c++
-REQUIRE_THAT( str, EndsWith( "as a service", Catch::CaseSensitive::No ) );
- ```
-
-And matchers can be combined:
-
-```c++
-REQUIRE_THAT( str,
- EndsWith( "as a service" ) ||
- (StartsWith( "Big data" ) && !Contains( "web scale" ) ) );
-```
-
-_The combining operators do not take ownership of the matcher objects.
-This means that if you store the combined object, you have to ensure that
-the matcher objects outlive its last use. What this means is that code
-like this leads to a use-after-free and (hopefully) a crash:_
-
-```cpp
-TEST_CASE("Bugs, bugs, bugs", "[Bug]"){
- std::string str = "Bugs as a service";
-
- auto match_expression = Catch::EndsWith( "as a service" ) ||
- (Catch::StartsWith( "Big data" ) && !Catch::Contains( "web scale" ) );
- REQUIRE_THAT(str, match_expression);
-}
-```
-
-
-## Built in matchers
-Catch2 provides some matchers by default. They can be found in the
-`Catch::Matchers::foo` namespace and are imported into the `Catch`
-namespace as well.
-
-There are two parts to each of the built-in matchers, the matcher
-type itself and a helper function that provides template argument
-deduction when creating templated matchers. As an example, the matcher
-for checking that two instances of `std::vector` are identical is
-`EqualsMatcher<T>`, but the user is expected to use the `Equals`
-helper function instead.
-
-
-### String matchers
-The string matchers are `StartsWith`, `EndsWith`, `Contains`, `Equals` and `Matches`. The first four match a literal (sub)string against a result, while `Matches` takes and matches an ECMAScript regex. Do note that `Matches` matches the string as a whole, meaning that "abc" will not match against "abcd", but "abc.*" will.
-
-Each of the provided `std::string` matchers also takes an optional second argument, that decides case sensitivity (by-default, they are case sensitive).
-
-
-### Vector matchers
-Catch2 currently provides 5 built-in matchers that work on `std::vector`.
-These are
-
- * `Contains` which checks whether a specified vector is present in the result
- * `VectorContains` which checks whether a specified element is present in the result
- * `Equals` which checks whether the result is exactly equal (order matters) to a specific vector
- * `UnorderedEquals` which checks whether the result is equal to a specific vector under a permutation
- * `Approx` which checks whether the result is "approx-equal" (order matters, but comparison is done via `Approx`) to a specific vector
-> Approx matcher was [introduced](https://github.com/catchorg/Catch2/issues/1499) in Catch 2.7.2.
-
-
-### Floating point matchers
-Catch2 provides 3 matchers for working with floating point numbers. These
-are `WithinAbsMatcher`, `WithinUlpsMatcher` and `WithinRelMatcher`.
-
-The `WithinAbsMatcher` matcher accepts floating point numbers that are
-within a certain distance of target. It should be constructed with the
-`WithinAbs(double target, double margin)` helper.
-
-The `WithinUlpsMatcher` matcher accepts floating point numbers that are
-within a certain number of [ULPs](https://en.wikipedia.org/wiki/Unit_in_the_last_place)
-of the target. Because ULP comparisons need to be done differently for
-`float`s and for `double`s, there are two overloads of the helpers for
-this matcher, `WithinULP(float target, int64_t ULPs)`, and
-`WithinULP(double target, int64_t ULPs)`.
-
-The `WithinRelMatcher` matcher accepts floating point numbers that are
-_approximately equal_ with the target number with some specific tolerance.
-In other words, it checks that `|lhs - rhs| <= epsilon * max(|lhs|, |rhs|)`,
-with special casing for `INFINITY` and `NaN`. There are _4_ overloads of
-the helpers for this matcher, `WithinRel(double target, double margin)`,
-`WithinRel(float target, float margin)`, `WithinRel(double target)`, and
-`WithinRel(float target)`. The latter two provide a default epsilon of
-machine epsilon * 100.
-
-> `WithinRel` matcher was introduced in Catch 2.10.0
-
-### Generic matchers
-Catch also aims to provide a set of generic matchers. Currently this set
-contains only a matcher that takes arbitrary callable predicate and applies
-it onto the provided object.
-
-Because of type inference limitations, the argument type of the predicate
-has to be provided explicitly. Example:
-```cpp
-REQUIRE_THAT("Hello olleH",
- Predicate<std::string>(
- [] (std::string const& str) -> bool { return str.front() == str.back(); },
- "First and last character should be equal")
-);
-```
-
-The second argument is an optional description of the predicate, and is
-used only during reporting of the result.
-
-
-### Exception matchers
-Catch2 also provides an exception matcher that can be used to verify
-that an exception's message exactly matches desired string. The matcher
-is `ExceptionMessageMatcher`, and we also provide a helper function
-`Message`.
-
-The matched exception must publicly derive from `std::exception` and
-the message matching is done _exactly_, including case.
-
-> `ExceptionMessageMatcher` was introduced in Catch 2.10.0
-
-Example use:
-```cpp
-REQUIRE_THROWS_MATCHES(throwsDerivedException(), DerivedException, Message("DerivedException::what"));
-```
-
-## Custom matchers
-It's easy to provide your own matchers to extend Catch or just to work with your own types.
-
-You need to provide two things:
-1. A matcher class, derived from `Catch::MatcherBase<T>` - where `T` is the type being tested.
-The constructor takes and stores any arguments needed (e.g. something to compare against) and you must
-override two methods: `match()` and `describe()`.
-2. A simple builder function. This is what is actually called from the test code and allows overloading.
-
-Here's an example for asserting that an integer falls within a given range
-(note that it is all inline for the sake of keeping the example short):
-
-```c++
-// The matcher class
-class IntRange : public Catch::MatcherBase<int> {
- int m_begin, m_end;
-public:
- IntRange( int begin, int end ) : m_begin( begin ), m_end( end ) {}
-
- // Performs the test for this matcher
- bool match( int const& i ) const override {
- return i >= m_begin && i <= m_end;
- }
-
- // Produces a string describing what this matcher does. It should
- // include any provided data (the begin/ end in this case) and
- // be written as if it were stating a fact (in the output it will be
- // preceded by the value under test).
- virtual std::string describe() const override {
- std::ostringstream ss;
- ss << "is between " << m_begin << " and " << m_end;
- return ss.str();
- }
-};
-
-// The builder function
-inline IntRange IsBetween( int begin, int end ) {
- return IntRange( begin, end );
-}
-
-// ...
-
-// Usage
-TEST_CASE("Integers are within a range")
-{
- CHECK_THAT( 3, IsBetween( 1, 10 ) );
- CHECK_THAT( 100, IsBetween( 1, 10 ) );
-}
-```
-
-Running this test gives the following in the console:
-
-```
-/**/TestFile.cpp:123: FAILED:
- CHECK_THAT( 100, IsBetween( 1, 10 ) )
-with expansion:
- 100 is between 1 and 10
-```
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/opensource-users.md b/docs/opensource-users.md
deleted file mode 100644
index 36c0db64..00000000
--- a/docs/opensource-users.md
+++ /dev/null
@@ -1,120 +0,0 @@
-<a id="top"></a>
-# Open Source projects using Catch
-
-Catch is great for open source. With its [liberal license](../LICENSE.txt) and single-header, dependency-free, distribution
-it's easy to just drop the header into your project and start writing tests - what's not to like?
-
-As a result Catch is now being used in many Open Source projects, including some quite well known ones.
-This page is an attempt to track those projects. Obviously it can never be complete.
-This effort largely relies on the maintainers of the projects themselves updating this page and submitting a PR
-(or, if you prefer contact one of the maintainers of Catch directly, use the
-[forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum)), or raise an [issue](https://github.com/philsquared/Catch/issues) to let us know).
-Of course users of those projects might want to update this page too. That's fine - as long you're confident the project maintainers won't mind.
-If you're an Open Source project maintainer and see your project listed here but would rather it wasn't -
-just let us know via any of the previously mentioned means - although I'm sure there won't be many who feel that way.
-
-Listing a project here does not imply endorsement and the plan is to keep these ordered alphabetically to avoid an implication of relative importance.
-
-## Libraries & Frameworks
-
-### [ApprovalTests.cpp](https://github.com/approvals/ApprovalTests.cpp)
-C++11 implementation of Approval Tests, for quick, convenient testing of legacy code.
-
-### [Azmq](https://github.com/zeromq/azmq)
-Boost Asio style bindings for ZeroMQ.
-
-### [Cataclysm: Dark Days Ahead](https://github.com/CleverRaven/Cataclysm-DDA)
-Post-apocalyptic survival RPG.
-
-### [ChakraCore](https://github.com/Microsoft/ChakraCore)
-The core part of the Chakra JavaScript engine that powers Microsoft Edge.
-
-### [ChaiScript](https://github.com/ChaiScript/ChaiScript)
-A, header-only, embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques.
-
-### [Clara](https://github.com/philsquared/Clara)
-A, single-header-only, type-safe, command line parser - which also prints formatted usage strings.
-
-### [Couchbase-lite-core](https://github.com/couchbase/couchbase-lite-core)
-The next-generation core storage and query engine for Couchbase Lite.
-
-### [cppcodec](https://github.com/tplgy/cppcodec)
-Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32.
-
-### [DtCraft](https://github.com/twhuang-uiuc/DtCraft)
-A High-performance Cluster Computing Engine.
-
-### [forest](https://github.com/xorz57/forest)
-Template Library of Tree Data Structures.
-
-### [Fuxedo](https://github.com/fuxedo/fuxedo)
-Open source Oracle Tuxedo-like XATMI middleware for C and C++.
-
-### [Inja](https://github.com/pantor/inja)
-A header-only template engine for modern C++.
-
-### [libcluon](https://github.com/chrberger/libcluon)
-A single-header-only library written in C++14 to glue distributed software components (UDP, TCP, shared memory) supporting natively Protobuf, LCM/ZCM, MsgPack, and JSON for dynamic message transformations in-between.
-
-### [MNMLSTC Core](https://github.com/mnmlstc/core)
-A small and easy to use C++11 library that adds a functionality set that will be available in C++14 and later, as well as some useful additions.
-
-### [nanodbc](https://github.com/lexicalunit/nanodbc/)
-A small C++ library wrapper for the native C ODBC API.
-
-### [Nonius](https://github.com/libnonius/nonius)
-A header-only framework for benchmarking small snippets of C++ code.
-
-### [SOCI](https://github.com/SOCI/soci)
-The C++ Database Access Library.
-
-### [polymorphic_value](https://github.com/jbcoe/polymorphic_value)
-A polymorphic value-type for C++.
-
-### [Ppconsul](https://github.com/oliora/ppconsul)
-A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure.
-
-### [Reactive-Extensions/ RxCpp](https://github.com/Reactive-Extensions/RxCpp)
-A library of algorithms for values-distributed-in-time.
-
-### [thor](https://github.com/xorz57/thor)
-Wrapper Library for CUDA.
-
-### [TextFlowCpp](https://github.com/philsquared/textflowcpp)
-A small, single-header-only, library for wrapping and composing columns of text.
-
-### [Trompeloeil](https://github.com/rollbear/trompeloeil)
-A thread-safe header-only mocking framework for C++14.
-
-### [args](https://github.com/Taywee/args)
-A simple header-only C++ argument parser library.
-
-## Applications & Tools
-
-### [ArangoDB](https://github.com/arangodb/arangodb)
-ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values.
-
-### [Giada - Your Hardcore Loop Machine](https://github.com/monocasual/giada)
-Minimal, open-source and cross-platform audio tool for live music production.
-
-### [MAME](https://github.com/mamedev/mame)
-MAME originally stood for Multiple Arcade Machine Emulator.
-
-### [Newsbeuter](https://github.com/akrennmair/newsbeuter)
-Newsbeuter is an open-source RSS/Atom feed reader for text terminals.
-
-### [raspigcd](https://github.com/pantadeusz/raspigcd)
-Low level CLI app and library for execution of GCODE on Raspberry Pi without any additional microcontrolers (just RPi + Stepsticks).
-
-### [SpECTRE](https://github.com/sxs-collaboration/spectre)
-SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.
-
-### [Standardese](https://github.com/foonathan/standardese)
-Standardese aims to be a nextgen Doxygen.
-
-### [PopHead](https://github.com/SPC-Some-Polish-Coders/PopHead)
-A 2D, Zombie, RPG game which is being made on our own engine.
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/other-macros.md b/docs/other-macros.md
deleted file mode 100644
index 994115f1..00000000
--- a/docs/other-macros.md
+++ /dev/null
@@ -1,154 +0,0 @@
-<a id="top"></a>
-# Other macros
-
-This page serves as a reference for macros that are not documented
-elsewhere. For now, these macros are separated into 2 rough categories,
-"assertion related macros" and "test case related macros".
-
-## Assertion related macros
-
-* `CHECKED_IF` and `CHECKED_ELSE`
-
-`CHECKED_IF( expr )` is an `if` replacement, that also applies Catch2's
-stringification machinery to the _expr_ and records the result. As with
-`if`, the block after a `CHECKED_IF` is entered only if the expression
-evaluates to `true`. `CHECKED_ELSE( expr )` work similarly, but the block
-is entered only if the _expr_ evaluated to `false`.
-
-Example:
-```cpp
-int a = ...;
-int b = ...;
-CHECKED_IF( a == b ) {
- // This block is entered when a == b
-} CHECKED_ELSE ( a == b ) {
- // This block is entered when a != b
-}
-```
-
-* `CHECK_NOFAIL`
-
-`CHECK_NOFAIL( expr )` is a variant of `CHECK` that does not fail the test
-case if _expr_ evaluates to `false`. This can be useful for checking some
-assumption, that might be violated without the test necessarily failing.
-
-Example output:
-```
-main.cpp:6:
-FAILED - but was ok:
- CHECK_NOFAIL( 1 == 2 )
-
-main.cpp:7:
-PASSED:
- CHECK( 2 == 2 )
-```
-
-* `SUCCEED`
-
-`SUCCEED( msg )` is mostly equivalent with `INFO( msg ); REQUIRE( true );`.
-In other words, `SUCCEED` is for cases where just reaching a certain line
-means that the test has been a success.
-
-Example usage:
-```cpp
-TEST_CASE( "SUCCEED showcase" ) {
- int I = 1;
- SUCCEED( "I is " << I );
-}
-```
-
-* `STATIC_REQUIRE`
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1362) in Catch 2.4.2.
-
-`STATIC_REQUIRE( expr )` is a macro that can be used the same way as a
-`static_assert`, but also registers the success with Catch2, so it is
-reported as a success at runtime. The whole check can also be deferred
-to the runtime, by defining `CATCH_CONFIG_RUNTIME_STATIC_REQUIRE` before
-including the Catch2 header.
-
-Example:
-```cpp
-TEST_CASE("STATIC_REQUIRE showcase", "[traits]") {
- STATIC_REQUIRE( std::is_void<void>::value );
- STATIC_REQUIRE_FALSE( std::is_void<int>::value );
-}
-```
-
-## Test case related macros
-
-* `METHOD_AS_TEST_CASE`
-
-`METHOD_AS_TEST_CASE( member-function-pointer, description )` lets you
-register a member function of a class as a Catch2 test case. The class
-will be separately instantiated for each method registered in this way.
-
-```cpp
-class TestClass {
- std::string s;
-
-public:
- TestClass()
- :s( "hello" )
- {}
-
- void testCase() {
- REQUIRE( s == "hello" );
- }
-};
-
-
-METHOD_AS_TEST_CASE( TestClass::testCase, "Use class's method as a test case", "[class]" )
-```
-
-* `REGISTER_TEST_CASE`
-
-`REGISTER_TEST_CASE( function, description )` let's you register
-a `function` as a test case. The function has to have `void()` signature,
-the description can contain both name and tags.
-
-Example:
-```cpp
-REGISTER_TEST_CASE( someFunction, "ManuallyRegistered", "[tags]" );
-```
-
-_Note that the registration still has to happen before Catch2's session
-is initiated. This means that it either needs to be done in a global
-constructor, or before Catch2's session is created in user's own main._
-
-
-* `ANON_TEST_CASE`
-
-`ANON_TEST_CASE` is a `TEST_CASE` replacement that will autogenerate
-unique name. The advantage of this is that you do not have to think
-of a name for the test case,`the disadvantage is that the name doesn't
-necessarily remain stable across different links, and thus it might be
-hard to run directly.
-
-Example:
-```cpp
-ANON_TEST_CASE() {
- SUCCEED("Hello from anonymous test case");
-}
-```
-
-* `DYNAMIC_SECTION`
-
-> Introduced in Catch 2.3.0.
-
-`DYNAMIC_SECTION` is a `SECTION` where the user can use `operator<<` to
-create the final name for that section. This can be useful with e.g.
-generators, or when creating a `SECTION` dynamically, within a loop.
-
-Example:
-```cpp
-TEST_CASE( "looped SECTION tests" ) {
- int a = 1;
-
- for( int b = 0; b < 10; ++b ) {
- DYNAMIC_SECTION( "b is currently: " << b ) {
- CHECK( b > a );
- }
- }
-}
-```
diff --git a/docs/own-main.md b/docs/own-main.md
deleted file mode 100644
index 6a9b1aad..00000000
--- a/docs/own-main.md
+++ /dev/null
@@ -1,131 +0,0 @@
-<a id="top"></a>
-# Supplying main() yourself
-
-**Contents**<br>
-[Let Catch take full control of args and config](#let-catch-take-full-control-of-args-and-config)<br>
-[Amending the config](#amending-the-config)<br>
-[Adding your own command line options](#adding-your-own-command-line-options)<br>
-[Version detection](#version-detection)<br>
-
-The easiest way to use Catch is to let it supply ```main()``` for you and handle configuring itself from the command line.
-
-This is achieved by writing ```#define CATCH_CONFIG_MAIN``` before the ```#include "catch.hpp"``` in *exactly one* source file.
-
-Sometimes, though, you need to write your own version of main(). You can do this by writing ```#define CATCH_CONFIG_RUNNER``` instead. Now you are free to write ```main()``` as normal and call into Catch yourself manually.
-
-You now have a lot of flexibility - but here are three recipes to get your started:
-
-## Let Catch take full control of args and config
-
-If you just need to have code that executes before and/ or after Catch this is the simplest option.
-
-```c++
-#define CATCH_CONFIG_RUNNER
-#include "catch.hpp"
-
-int main( int argc, char* argv[] ) {
- // global setup...
-
- int result = Catch::Session().run( argc, argv );
-
- // global clean-up...
-
- return result;
-}
-```
-
-## Amending the config
-
-If you still want Catch to process the command line, but you want to programmatically tweak the config, you can do so in one of two ways:
-
-```c++
-#define CATCH_CONFIG_RUNNER
-#include "catch.hpp"
-
-int main( int argc, char* argv[] )
-{
- Catch::Session session; // There must be exactly one instance
-
- // writing to session.configData() here sets defaults
- // this is the preferred way to set them
-
- int returnCode = session.applyCommandLine( argc, argv );
- if( returnCode != 0 ) // Indicates a command line error
- return returnCode;
-
- // writing to session.configData() or session.Config() here
- // overrides command line args
- // only do this if you know you need to
-
- int numFailed = session.run();
-
- // numFailed is clamped to 255 as some unices only use the lower 8 bits.
- // This clamping has already been applied, so just return it here
- // You can also do any post run clean-up here
- return numFailed;
-}
-```
-
-Take a look at the definitions of Config and ConfigData to see what you can do with them.
-
-To take full control of the config simply omit the call to ```applyCommandLine()```.
-
-## Adding your own command line options
-
-Catch embeds a powerful command line parser called [Clara](https://github.com/philsquared/Clara).
-As of Catch2 (and Clara 1.0) Clara allows you to write _composable_ option and argument parsers,
-so extending Catch's own command line options is now easy.
-
-```c++
-#define CATCH_CONFIG_RUNNER
-#include "catch.hpp"
-
-int main( int argc, char* argv[] )
-{
- Catch::Session session; // There must be exactly one instance
-
- int height = 0; // Some user variable you want to be able to set
-
- // Build a new parser on top of Catch's
- using namespace Catch::clara;
- auto cli
- = session.cli() // Get Catch's composite command line parser
- | Opt( height, "height" ) // bind variable to a new option, with a hint string
- ["-g"]["--height"] // the option names it will respond to
- ("how high?"); // description string for the help output
-
- // Now pass the new composite back to Catch so it uses that
- session.cli( cli );
-
- // Let Catch (using Clara) parse the command line
- int returnCode = session.applyCommandLine( argc, argv );
- if( returnCode != 0 ) // Indicates a command line error
- return returnCode;
-
- // if set on the command line then 'height' is now set at this point
- if( height > 0 )
- std::cout << "height: " << height << std::endl;
-
- return session.run();
-}
-```
-
-See the [Clara documentation](https://github.com/philsquared/Clara/blob/master/README.md) for more details.
-
-
-## Version detection
-
-Catch provides a triplet of macros providing the header's version,
-
-* `CATCH_VERSION_MAJOR`
-* `CATCH_VERSION_MINOR`
-* `CATCH_VERSION_PATCH`
-
-these macros expand into a single number, that corresponds to the appropriate
-part of the version. As an example, given single header version v2.3.4,
-the macros would expand into `2`, `3`, and `4` respectively.
-
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/release-notes.md b/docs/release-notes.md
deleted file mode 100644
index 0c023085..00000000
--- a/docs/release-notes.md
+++ /dev/null
@@ -1,1094 +0,0 @@
-<a id="top"></a>
-
-# Release notes
-**Contents**<br>
-[2.11.2](#2112)<br>
-[2.11.1](#2111)<br>
-[2.11.0](#2110)<br>
-[2.10.2](#2102)<br>
-[2.10.1](#2101)<br>
-[2.10.0](#2100)<br>
-[2.9.2](#292)<br>
-[2.9.1](#291)<br>
-[2.9.0](#290)<br>
-[2.8.0](#280)<br>
-[2.7.2](#272)<br>
-[2.7.1](#271)<br>
-[2.7.0](#270)<br>
-[2.6.1](#261)<br>
-[2.6.0](#260)<br>
-[2.5.0](#250)<br>
-[2.4.2](#242)<br>
-[2.4.1](#241)<br>
-[2.4.0](#240)<br>
-[2.3.0](#230)<br>
-[2.2.3](#223)<br>
-[2.2.2](#222)<br>
-[2.2.1](#221)<br>
-[2.2.0](#220)<br>
-[2.1.2](#212)<br>
-[2.1.1](#211)<br>
-[2.1.0](#210)<br>
-[2.0.1](#201)<br>
-[Older versions](#older-versions)<br>
-[Even Older versions](#even-older-versions)<br>
-
-
-## 2.11.2
-
-### Improvements
-* GCC and Clang now issue warnings for suspicious code in assertions (#1880)
- * E.g. `REQUIRE( int != unsigned int )` will now issue mixed signedness comparison warning
- * This has always worked on MSVC, but it now also works for GCC and current Clang versions
-* Colorization of "Test filters" output should be more robust now
-* `--wait-for-keypress` now also accepts `never` as an option (#1866)
-* Reporters no longer round-off nanoseconds when reporting benchmarking results (#1876)
-* Catch2's debug break now supports iOS while using Thumb instruction set (#1862)
-* It is now possible to customize benchmark's warm-up time when running the test binary (#1844)
- * `--benchmark-warmup-time {ms}`
-* User can now specify how Catch2 should break into debugger (#1846)
-
-### Fixes
-* Fixes missing `<random>` include in benchmarking (#1831)
-* Fixed missing `<iterator>` include in benchmarking (#1874)
-* Hidden test cases are now also tagged with `[!hide]` as per documentation (#1847)
-* Detection of whether libc provides `std::nextafter` has been improved (#1854)
-* Detection of `wmain` no longer incorrectly looks for `WIN32` macro (#1849)
- * Now it just detects Windows platform
-* Composing already-composed matchers no longer modifies the partially-composed matcher expression
- * This bug has been present for the last ~2 years and nobody reported it
-
-
-## 2.11.1
-
-### Improvements
-* Breaking into debugger is supported on iOS (#1817)
-* `google-build-using-namespace` clang-tidy warning is suppressed (#1799)
-
-### Fixes
-* Clang on Windows is no longer assumed to implement MSVC's traditional preprocessor (#1806)
-* `ObjectStorage` now behaves properly in `const` contexts (#1820)
-* `GENERATE_COPY(a, b)` now compiles properly (#1809, #1815)
-* Some more cleanups in the benchmarking support
-
-
-## 2.11.0
-
-### Improvements
-* JUnit reporter output now contains more details in case of failure (#1347, #1719)
-* Added SonarQube Test Data reporter (#1738)
- * It is in a separate header, just like the TAP, Automake, and TeamCity reporters
-* `range` generator now allows floating point numbers (#1776)
-* Reworked part of internals to increase throughput
-
-
-### Fixes
-* The single header version should contain full benchmarking support (#1800)
-* `[.foo]` is now properly parsed as `[.][foo]` when used on the command line (#1798)
-* Fixed compilation of benchmarking on platforms where `steady_clock::period` is not `std::nano` (#1794)
-
-
-
-## 2.10.2
-
-### Improvements
-* Catch2 will now compile on platform where `INFINITY` is double (#1782)
-
-
-### Fixes
-* Warning suppressed during listener registration will no longer leak
-
-
-
-## 2.10.1
-
-### Improvements
-* Catch2 now guards itself against `min` and `max` macros from `windows.h` (#1772)
-* Templated tests will now compile with ICC (#1748)
-* `WithinULP` matcher now uses scientific notation for stringification (#1760)
-
-
-### Fixes
-* Templated tests no longer trigger `-Wunused-templates` (#1762)
-* Suppressed clang-analyzer false positive in context getter (#1230, #1735)
-
-
-### Miscellaneous
-* CMake no longer prohibits in-tree build when Catch2 is used as a subproject (#1773, #1774)
-
-
-
-## 2.10.0
-
-### Fixes
-* `TEMPLATE_LIST_TEST_CASE` now properly handles non-copyable and non-movable types (#1729)
-* Fixed compilation error on Solaris caused by a system header defining macro `TT` (#1722, #1723)
-* `REGISTER_ENUM` will now fail at compilation time if the registered enum is too large
-* Removed use of `std::is_same_v` in C++17 mode (#1757)
-* Fixed parsing of escaped special characters when reading test specs from a file (#1767, #1769)
-
-
-### Improvements
-* Trailing and leading whitespace in test/section specs are now ignored.
-* Writing to Android debug log now uses `__android_log_write` instead of `__android_log_print`
-* Android logging support can now be turned on/off at compile time (#1743)
- * The toggle is `CATCH_CONFIG_ANDROID_LOGWRITE`
-* Added a generator that returns elements of a range
- * Use via `from_range(from, to)` or `from_range(container)`
-* Added support for CRTs that do not provide `std::nextafter` (#1739)
- * They must still provide global `nextafter{f,l,}`
- * Enabled via `CATCH_CONFIG_GLOBAL_NEXTAFTER`
-* Special cased `Approx(inf)` not to match non-infinite values
- * Very strictly speaking this might be a breaking change, but it should match user expectations better
-* The output of benchmarking through the Console reporter when `--benchmark-no-analysis` is set is now much simpler (#1768)
-* Added a matcher that can be used for checking an exceptions message (#1649, #1728)
- * The matcher helper function is called `Message`
- * The exception must publicly derive from `std::exception`
- * The matching is done exactly, including case and whitespace
-* Added a matcher that can be used for checking relative equality of floating point numbers (#1746)
- * Unlike `Approx`, it considers both sides when determining the allowed margin
- * Special cases `NaN` and `INFINITY` to match user expectations
- * The matcher helper function is called `WithinRel`
-* The ULP matcher now allows for any possible distance between the two numbers
-* The random number generators now use Catch-global instance of RNG (#1734, #1736)
- * This means that nested random number generators actually generate different numbers
-
-
-### Miscellaneous
-* In-repo PNGs have been optimized to lower overhead of using Catch2 via git clone
-* Catch2 now uses its own implementation of the URBG concept
- * In the future we also plan to use our own implementation of the distributions from `<random>` to provide cross-platform repeatability of random results
-
-
-
-## 2.9.2
-
-### Fixes
-* `ChunkGenerator` can now be used with chunks of size 0 (#1671)
-* Nested subsections are now run properly when specific section is run via the `-c` argument (#1670, #1673)
-* Catch2 now consistently uses `_WIN32` to detect Windows platform (#1676)
-* `TEMPLATE_LIST_TEST_CASE` now support non-default constructible type lists (#1697)
-* Fixed a crash in the XMLReporter when a benchmark throws exception during warmup (#1706)
-* Fixed a possible infinite loop in CompactReporter (#1715)
-* Fixed `-w NoTests` returning 0 even when no tests were matched (#1449, #1683, #1684)
-* Fixed matcher compilation under Obj-C++ (#1661)
-
-### Improvements
-* `RepeatGenerator` and `FixedValuesGenerator` now fail to compile when used with `bool` (#1692)
- * Previously they would fail at runtime.
-* Catch2 now supports Android's debug logging for its debug output (#1710)
-* Catch2 now detects and configures itself for the RTX platform (#1693)
- * You still need to pass `--benchmark-no-analysis` if you are using benchmarking under RTX
-* Removed a "storage class is not first" warning when compiling Catch2 with PGI compiler (#1717)
-
-### Miscellaneous
-* Documentation now contains indication when a specific feature was introduced (#1695)
- * These start with Catch2 v2.3.0, (a bit over a year ago).
- * `docs/contributing.md` has been updated to provide contributors guidance on how to add these to newly written documentation
-* Various other documentation improvements
- * ToC fixes
- * Documented `--order` and `--rng-seed` command line options
- * Benchmarking documentation now clearly states that it requires opt-in
- * Documented `CATCH_CONFIG_CPP17_OPTIONAL` and `CATCH_CONFIG_CPP17_BYTE` macros
- * Properly documented built-in vector matchers
- * Improved `*_THROWS_MATCHES` documentation a bit
-* CMake config file is now arch-independent even if `CMAKE_SIZEOF_VOID_P` is in CMake cache (#1660)
-* `CatchAddTests` now properly escapes `[` and `]` in test names (#1634, #1698)
-* Reverted `CatchAddTests` adding tags as CTest labels (#1658)
- * The script broke when test names were too long
- * Overwriting `LABELS` caused trouble for users who set them manually
- * CMake does not let users append to `LABELS` if the test name has spaces
-
-
-## 2.9.1
-
-### Fixes
-* Fix benchmarking compilation failure in files without `CATCH_CONFIG_EXTERNAL_INTERFACES` (or implementation)
-
-## 2.9.0
-
-### Improvements
-* The experimental benchmarking support has been replaced by integrating Nonius code (#1616)
- * This provides a much more featurefull micro-benchmarking support.
- * Due to the compilation cost, it is disabled by default. See the documentation for details.
- * As far as backwards compatibility is concerned, this feature is still considered experimental in that we might change the interface based on user feedback.
-* `WithinULP` matcher now shows the acceptable range (#1581)
-* Template test cases now support type lists (#1627)
-
-
-## 2.8.0
-
-### Improvements
-* Templated test cases no longer check whether the provided types are unique (#1628)
- * This allows you to e.g. test over `uint32_t`, `uint64_t`, and `size_t` without compilation failing
-* The precision of floating point stringification can be modified by user (#1612, #1614)
-* We now provide `REGISTER_ENUM` convenience macro for generating `StringMaker` specializations for enums
- * See the "String conversion" documentation for details
-* Added new set of macros for template test cases that enables the use of NTTPs (#1531, #1609)
- * See "Test cases and sections" documentation for details
-
-### Fixes
-* `UNSCOPED_INFO` macro now has a prefixed/disabled/prefixed+disabled versions (#1611)
-* Reporting errors at startup should no longer cause a segfault under certain circumstances (#1626)
-
-
-### Miscellaneous
-* CMake will now prevent you from attempting in-tree build (#1636, #1638)
- * Previously it would break with an obscure error message during the build step
-
-
-## 2.7.2
-
-### Improvements
-* Added an approximate vector matcher (#1499)
-
-### Fixes
-* Filters will no longer be shown if there were none
-* Fixed compilation error when using Homebrew GCC on OS X (#1588, #1589)
-* Fixed the console reporter not showing messages that start with a newline (#1455, #1470)
-* Modified JUnit reporter's output so that rng seed and filters are reported according to the JUnit schema (#1598)
-* Fixed some obscure warnings and static analysis passes
-
-### Miscellaneous
-* Various improvements to `ParseAndAddCatchTests` (#1559, #1601)
- * When a target is parsed, it receives `ParseAndAddCatchTests_TESTS` property which summarizes found tests
- * Fixed problem with tests not being found if the `OptionalCatchTestLauncher` variables is used
- * Including the script will no longer forcefully modify `CMAKE_MINIMUM_REQUIRED_VERSION`
- * CMake object libraries are ignored when parsing to avoid needless warnings
-* `CatchAddTests` now adds test's tags to their CTest labels (#1600)
-* Added basic CPack support to our build
-
-## 2.7.1
-
-### Improvements
-* Reporters now print out the filters applied to test cases (#1550, #1585)
-* Added `GENERATE_COPY` and `GENERATE_REF` macros that can use variables inside the generator expression
- * Because of the significant danger of lifetime issues, the default `GENERATE` macro still does not allow variables
-* The `map` generator helper now deduces the mapped return type (#1576)
-
-### Fixes
-* Fixed ObjC++ compilation (#1571)
-* Fixed test tag parsing so that `[.foo]` is now parsed as `[.][foo]`.
-* Suppressed warning caused by the Windows headers defining SE codes in different manners (#1575)
-
-## 2.7.0
-
-### Improvements
-* `TEMPLATE_PRODUCT_TEST_CASE` now uses the resulting type in the name, instead of the serial number (#1544)
-* Catch2's single header is now strictly ASCII (#1542)
-* Added generator for random integral/floating point types
- * The types are inferred within the `random` helper
-* Added back RangeGenerator (#1526)
- * RangeGenerator returns elements within a certain range
-* Added ChunkGenerator generic transform (#1538)
- * A ChunkGenerator returns the elements from different generator in chunks of n elements
-* Added `UNSCOPED_INFO` (#415, #983, #1522)
- * This is a variant of `INFO` that lives until next assertion/end of the test case.
-
-
-### Fixes
-* All calls to C stdlib functions are now `std::` qualified (#1541)
- * Code brought in from Clara was also updated.
-* Running tests will no longer open the specified output file twice (#1545)
- * This would cause trouble when the file was not a file, but rather a named pipe
- * Fixes the CLion/Resharper integration with Catch
-* Fixed `-Wunreachable-code` occurring with (old) ccache+cmake+clang combination (#1540)
-* Fixed `-Wdefaulted-function-deleted` warning with Clang 8 (#1537)
-* Catch2's type traits and helpers are now properly namespaced inside `Catch::` (#1548)
-* Fixed std{out,err} redirection for failing test (#1514, #1525)
- * Somehow, this bug has been present for well over a year before it was reported
-
-
-### Contrib
-* `ParseAndAddCatchTests` now properly escapes commas in the test name
-
-
-
-## 2.6.1
-
-### Improvements
-* The JUnit reporter now also reports random seed (#1520, #1521)
-
-### Fixes
-* The TAP reporter now formats comments with test name properly (#1529)
-* `CATCH_REQUIRE_THROWS`'s internals were unified with `REQUIRE_THROWS` (#1536)
- * This fixes a potential `-Wunused-value` warning when used
-* Fixed a potential segfault when using any of the `--list-*` options (#1533, #1534)
-
-
-## 2.6.0
-
-**With this release the data generator feature is now fully supported.**
-
-
-### Improvements
-* Added `TEMPLATE_PRODUCT_TEST_CASE` (#1454, #1468)
- * This allows you to easily test various type combinations, see documentation for details
-* The error message for `&&` and `||` inside assertions has been improved (#1273, #1480)
-* The error message for chained comparisons inside assertions has been improved (#1481)
-* Added `StringMaker` specialization for `std::optional` (#1510)
-* The generator interface has been redone once again (#1516)
- * It is no longer considered experimental and is fully supported
- * The new interface supports "Input" generators
- * The generator documentation has been fully updated
- * We also added 2 generator examples
-
-
-### Fixes
-* Fixed `-Wredundant-move` on newer Clang (#1474)
-* Removed unreachable mentions `std::current_exception`, `std::rethrow_exception` in no-exceptions mode (#1462)
- * This should fix compilation with IAR
-* Fixed missing `<type_traits>` include (#1494)
-* Fixed various static analysis warnings
- * Unrestored stream state in `XmlWriter` (#1489)
- * Potential division by zero in `estimateClockResolution` (#1490)
- * Uninitialized member in `RunContext` (#1491)
- * `SourceLineInfo` move ops are now marked `noexcept`
- * `CATCH_BREAK_INTO_DEBUGGER` is now always a function
-* Fix double run of a test case if user asks for a specific section (#1394, #1492)
-* ANSI colour code output now respects `-o` flag and writes to the file as well (#1502)
-* Fixed detection of `std::variant` support for compilers other than Clang (#1511)
-
-
-### Contrib
-* `ParseAndAddCatchTests` has learned how to use `DISABLED` CTest property (#1452)
-* `ParseAndAddCatchTests` now works when there is a whitspace before the test name (#1493)
-
-
-### Miscellaneous
-* We added new issue templates for reporting issues on GitHub
-* `contributing.md` has been updated to reflect the current test status (#1484)
-
-
-
-## 2.5.0
-
-### Improvements
-* Added support for templated tests via `TEMPLATE_TEST_CASE` (#1437)
-
-
-### Fixes
-* Fixed compilation of `PredicateMatcher<const char*>` by removing partial specialization of `MatcherMethod<T*>`
-* Listeners now implicitly support any verbosity (#1426)
-* Fixed compilation with Embarcadero builder by introducing `Catch::isnan` polyfill (#1438)
-* Fixed `CAPTURE` asserting for non-trivial captures (#1436, #1448)
-
-
-### Miscellaneous
-* We should now be providing first party Conan support via https://bintray.com/catchorg/Catch2 (#1443)
-* Added new section "deprecations and planned changes" to the documentation
- * It contains summary of what is deprecated and might change with next major version
-* From this release forward, the released headers should be pgp signed (#430)
- * KeyID `E29C 46F3 B8A7 5028 6079 3B7D ECC9 C20E 314B 2360`
- * or https://codingnest.com/files/horenmar-publickey.asc
-
-
-## 2.4.2
-
-### Improvements
-* XmlReporter now also outputs the RNG seed that was used in a run (#1404)
-* `Catch::Session::applyCommandLine` now also accepts `wchar_t` arguments.
- * However, Catch2 still does not support unicode.
-* Added `STATIC_REQUIRE` macro (#1356, #1362)
-* Catch2's singleton's are now cleaned up even if tests are run (#1411)
- * This is mostly useful as a FP prevention for users who define their own main.
-* Specifying an invalid reporter via `-r` is now reported sooner (#1351, #1422)
-
-
-### Fixes
-* Stringification no longer assumes that `char` is signed (#1399, #1407)
- * This caused a `Wtautological-compare` warning.
-* SFINAE for `operator<<` no longer sees different overload set than the actual insertion (#1403)
-
-
-### Contrib
-* `catch_discover_tests` correctly adds tests with comma in name (#1327, #1409)
-* Added a new customization point in how the tests are launched to `catch_discover_tests`
-
-
-## 2.4.1
-
-### Improvements
-* Added a StringMaker for `std::(w)string_view` (#1375, #1376)
-* Added a StringMaker for `std::variant` (#1380)
- * This one is disabled by default to avoid increased compile-time drag
-* Added detection for cygwin environment without `std::to_string` (#1396, #1397)
-
-### Fixes
-* `UnorderedEqualsMatcher` will no longer accept erroneously accept
-vectors that share suffix, but are not permutation of the desired vector
-* Abort after (`-x N`) can no longer be overshot by nested `REQUIRES` and
-subsequently ignored (#1391, #1392)
-
-
-## 2.4.0
-
-**This release brings two new experimental features, generator support
-and a `-fno-exceptions` support. Being experimental means that they
-will not be subject to the usual stability guarantees provided by semver.**
-
-### Improvements
-* Various small runtime performance improvements
-* `CAPTURE` macro is now variadic
-* Added `AND_GIVEN` macro (#1360)
-* Added experimental support for data generators
- * See [their documentation](generators.md) for details
-* Added support for compiling and running Catch without exceptions
- * Doing so limits the functionality somewhat
- * Look [into the documentation](configuration.md#disablingexceptions) for details
-
-### Fixes
-* Suppressed `-Wnon-virtual-dtor` warnings in Matchers (#1357)
-* Suppressed `-Wunreachable-code` warnings in floating point matchers (#1350)
-
-### CMake
-* It is now possible to override which Python is used to run Catch's tests (#1365)
-* Catch now provides infrastructure for adding tests that check compile-time configuration
-* Catch no longer tries to install itself when used as a subproject (#1373)
-* Catch2ConfigVersion.cmake is now generated as arch-independent (#1368)
- * This means that installing Catch from 32-bit machine and copying it to 64-bit one works
- * This fixes conan installation of Catch
-
-
-## 2.3.0
-
-**This release changes the include paths provided by our CMake and
-pkg-config integration. The proper include path for the single-header
-when using one of the above is now `<catch2/catch.hpp>`. This change
-also necessitated changes to paths inside the repository, so that the
-single-header version is now at `single_include/catch2/catch.hpp`, rather
-than `single_include/catch.hpp`.**
-
-
-
-### Fixes
-* Fixed Objective-C++ build
-* `-Wunused-variable` suppression no longer leaks from Catch's header under Clang
-* Implementation of the experimental new output capture can now be disabled (#1335)
- * This allows building Catch2 on platforms that do not provide things like `dup` or `tmpfile`.
-* The JUnit and XML reporters will no longer skip over successful tests when running without `-s` (#1264, #1267, #1310)
- * See improvements for more details
-
-### Improvements
-* pkg-config and CMake integration has been rewritten
- * If you use them, the new include path is `#include <catch2/catch.hpp>`
- * CMake installation now also installs scripts from `contrib/`
- * For details see the [new documentation](cmake-integration.md#top)
-* Reporters now have a new customization point, `ReporterPreferences::shouldReportAllAssertions`
- * When this is set to `false` and the tests are run without `-s`, passing assertions are not sent to the reporter.
- * Defaults to `false`.
-* Added `DYNAMIC_SECTION`, a section variant that constructs its name using stream
- * This means that you can do `DYNAMIC_SECTION("For X := " << x)`.
-
-
-## 2.2.3
-
-**To fix some of the bugs, some behavior had to change in potentially breaking manner.**
-**This means that even though this is a patch release, it might not be a drop-in replacement.**
-
-### Fixes
-* Listeners are now called before reporter
- * This was always documented to be the case, now it actually works that way
-* Catch's commandline will no longer accept multiple reporters
- * This was done because multiple reporters never worked properly and broke things in non-obvious ways
- * **This has potential to be a breaking change**
-* MinGW is now detected as Windows platform w/o SEH support (#1257)
- * This means that Catch2 no longer tries to use POSIX signal handling when compiled with MinGW
-* Fixed potential UB in parsing tags using non-ASCII characters (#1266)
- * Note that Catch2 still supports only ASCII test names/tags/etc
-* `TEST_CASE_METHOD` can now be used on classnames containing commas (#1245)
- * You have to enclose the classname in extra set of parentheses
-* Fixed insufficient alt stack size for POSIX signal handling (#1225)
-* Fixed compilation error on Android due to missing `std::to_string` in C++11 mode (#1280)
-* Fixed the order of user-provided `FALLBACK_STRINGIFIER` in stringification machinery (#1024)
- * It was intended to be replacement for built-in fallbacks, but it was used _after_ them.
- * **This has potential to be a breaking change**
-* Fixed compilation error when a type has an `operator<<` with templated lhs (#1285, #1306)
-
-### Improvements
-* Added a new, experimental, output capture (#1243)
- * This capture can also redirect output written via C apis, e.g. `printf`
- * To opt-in, define `CATCH_CONFIG_EXPERIMENTAL_REDIRECT` in the implementation file
-* Added a new fallback stringifier for classes derived from `std::exception`
- * Both `StringMaker` specialization and `operator<<` overload are given priority
-
-### Miscellaneous
-* `contrib/` now contains dbg scripts that skip over Catch's internals (#904, #1283)
- * `gdbinit` for gdb `lldbinit` for lldb
-* `CatchAddTests.cmake` no longer strips whitespace from tests (#1265, #1281)
-* Online documentation now describes `--use-colour` option (#1263)
-
-
-## 2.2.2
-
-### Fixes
-* Fixed bug in `WithinAbs::match()` failing spuriously (#1228)
-* Fixed clang-tidy diagnostic about virtual call in destructor (#1226)
-* Reduced the number of GCC warnings suppression leaking out of the header (#1090, #1091)
- * Only `-Wparentheses` should be leaking now
-* Added upper bound on the time benchmark timer calibration is allowed to take (#1237)
- * On platforms where `std::chrono::high_resolution_clock`'s resolution is low, the calibration would appear stuck
-* Fixed compilation error when stringifying static arrays of `unsigned char`s (#1238)
-
-### Improvements
-* XML encoder now hex-encodes invalid UTF-8 sequences (#1207)
- * This affects xml and junit reporters
- * Some invalid UTF-8 parts are left as is, e.g. surrogate pairs. This is because certain extensions of UTF-8 allow them, such as WTF-8.
-* CLR objects (`T^`) can now be stringified (#1216)
- * This affects code compiled as C++/CLI
-* Added `PredicateMatcher`, a matcher that takes an arbitrary predicate function (#1236)
- * See [documentation for details](https://github.com/catchorg/Catch2/blob/master/docs/matchers.md)
-
-### Others
-* Modified CMake-installed pkg-config to allow `#include <catch.hpp>`(#1239)
- * The plans to standardize on `#include <catch2/catch.hpp>` are still in effect
-
-
-## 2.2.1
-
-### Fixes
-* Fixed compilation error when compiling Catch2 with `std=c++17` against libc++ (#1214)
- * Clara (Catch2's CLI parsing library) used `std::optional` without including it explicitly
-* Fixed Catch2 return code always being 0 (#1215)
- * In the words of STL, "We feel superbad about letting this in"
-
-
-## 2.2.0
-
-### Fixes
-* Hidden tests are not listed by default when listing tests (#1175)
- * This makes `catch_discover_tests` CMake script work better
-* Fixed regression that meant `<windows.h>` could potentially not be included properly (#1197)
-* Fixed installing `Catch2ConfigVersion.cmake` when Catch2 is a subproject.
-
-### Improvements
-* Added an option to warn (+ exit with error) when no tests were ran (#1158)
- * Use as `-w NoTests`
-* Added provisional support for Emscripten (#1114)
-* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/master/docs/configuration.md#fallback-stringifier) (#1024)
- * This allows project's own stringification machinery to be easily reused for Catch
-* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178)
- * The embedded version of Clara was bumped to v1.1.3
-* Various minor performance improvements
-* Added support for DJGPP DOS crosscompiler (#1206)
-
-
-## 2.1.2
-
-### Fixes
-* Fixed compilation error with `-fno-rtti` (#1165)
-* Fixed NoAssertion warnings
-* `operator<<` is used before range-based stringification (#1172)
-* Fixed `-Wpedantic` warnings (extra semicolons and binary literals) (#1173)
-
-
-### Improvements
-* Added `CATCH_VERSION_{MAJOR,MINOR,PATCH}` macros (#1131)
-* Added `BrightYellow` colour for use in reporters (#979)
- * It is also used by ConsoleReporter for reconstructed expressions
-
-### Other changes
-* Catch is now exported as a CMake package and linkable target (#1170)
-
-## 2.1.1
-
-### Improvements
-* Static arrays are now properly stringified like ranges across MSVC/GCC/Clang
-* Embedded newer version of Clara -- v1.1.1
- * This should fix some warnings dragged in from Clara
-* MSVC's CLR exceptions are supported
-
-
-### Fixes
-* Fixed compilation when comparison operators do not return bool (#1147)
-* Fixed CLR exceptions blowing up the executable during translation (#1138)
-
-
-### Other changes
-* Many CMake changes
- * `NO_SELFTEST` option is deprecated, use `BUILD_TESTING` instead.
- * Catch specific CMake options were prefixed with `CATCH_` for namespacing purposes
- * Other changes to simplify Catch2's packaging
-
-
-
-## 2.1.0
-
-### Improvements
-* Various performance improvements
- * On top of the performance regression fixes
-* Experimental support for PCH was added (#1061)
-* `CATCH_CONFIG_EXTERNAL_INTERFACES` now brings in declarations of Console, Compact, XML and JUnit reporters
-* `MatcherBase` no longer has a pointless second template argument
-* Reduced the number of warning suppressions that leak into user's code
- * Bugs in g++ 4.x and 5.x mean that some of them have to be left in
-
-
-### Fixes
-* Fixed performance regression from Catch classic
- * One of the performance improvement patches for Catch classic was not applied to Catch2
-* Fixed platform detection for iOS (#1084)
-* Fixed compilation when `g++` is used together with `libc++` (#1110)
-* Fixed TeamCity reporter compilation with the single header version
- * To fix the underlying issue we will be versioning reporters in single_include folder per release
-* The XML reporter will now report `WARN` messages even when not used with `-s`
-* Fixed compilation when `VectorContains` matcher was combined using `&&` (#1092)
-* Fixed test duration overflowing after 10 seconds (#1125, #1129)
-* Fixed `std::uncaught_exception` deprecation warning (#1124)
-
-
-### New features
-* New Matchers
- * Regex matcher for strings, `Matches`.
- * Set-equal matcher for vectors, `UnorderedEquals`
- * Floating point matchers, `WithinAbs` and `WithinULP`.
-* Stringification now attempts to decompose all containers (#606)
- * Containers are objects that respond to ADL `begin(T)` and `end(T)`.
-
-
-### Other changes
-* Reporters will now be versioned in the `single_include` folder to ensure their compatibility with the last released version
-
-
-
-
-## 2.0.1
-
-### Breaking changes
-* Removed C++98 support
-* Removed legacy reporter support
-* Removed legacy generator support
- * Generator support will come back later, reworked
-* Removed `Catch::toString` support
- * The new stringification machinery uses `Catch::StringMaker` specializations first and `operator<<` overloads second.
-* Removed legacy `SCOPED_MSG` and `SCOPED_INFO` macros
-* Removed `INTERNAL_CATCH_REGISTER_REPORTER`
- * `CATCH_REGISTER_REPORTER` should be used to register reporters
-* Removed legacy `[hide]` tag
- * `[.]`, `[.foo]` and `[!hide]` are still supported
-* Output into debugger is now colourized
-* `*_THROWS_AS(expr, exception_type)` now unconditionally appends `const&` to the exception type.
-* `CATCH_CONFIG_FAST_COMPILE` now affects the `CHECK_` family of assertions as well as `REQUIRE_` family of assertions
- * This is most noticeable in `CHECK(throws())`, which would previously report failure, properly stringify the exception and continue. Now it will report failure and stop executing current section.
-* Removed deprecated matcher utility functions `Not`, `AllOf` and `AnyOf`.
- * They are superseded by operators `!`, `&&` and `||`, which are natural and do not have limited arity
-* Removed support for non-const comparison operators
- * Non-const comparison operators are an abomination that should not exist
- * They were breaking support for comparing function to function pointer
-* `std::pair` and `std::tuple` are no longer stringified by default
- * This is done to avoid dragging in `<tuple>` and `<utility>` headers in common path
- * Their stringification can be enabled per-file via new configuration macros
-* `Approx` is subtly different and hopefully behaves more as users would expect
- * `Approx::scale` defaults to `0.0`
- * `Approx::epsilon` no longer applies to the larger of the two compared values, but only to the `Approx`'s value
- * `INFINITY == Approx(INFINITY)` returns true
-
-
-### Improvements
-* Reporters and Listeners can be defined in files different from the main file
- * The file has to define `CATCH_CONFIG_EXTERNAL_INTERFACES` before including catch.hpp.
-* Errors that happen during set up before main are now caught and properly reported once main is entered
- * If you are providing your own main, you can access and use these as well.
-* New assertion macros, *_THROWS_MATCHES(expr, exception_type, matcher) are provided
- * As the arguments suggest, these allow you to assert that an expression throws desired type of exception and pass the exception to a matcher.
-* JUnit reporter no longer has significantly different output for test cases with and without sections
-* Most assertions now support expressions containing commas (ie `REQUIRE(foo() == std::vector<int>{1, 2, 3});`)
-* Catch now contains experimental micro benchmarking support
- * See `projects/SelfTest/Benchmark.tests.cpp` for examples
- * The support being experiment means that it can be changed without prior notice
-* Catch uses new CLI parsing library (Clara)
- * Users can now easily add new command line options to the final executable
- * This also leads to some changes in `Catch::Session` interface
-* All parts of matchers can be removed from a TU by defining `CATCH_CONFIG_DISABLE_MATCHERS`
- * This can be used to somewhat speed up compilation times
-* An experimental implementation of `CATCH_CONFIG_DISABLE` has been added
- * Inspired by Doctest's `DOCTEST_CONFIG_DISABLE`
- * Useful for implementing tests in source files
- * ie for functions in anonymous namespaces
- * Removes all assertions
- * Prevents `TEST_CASE` registrations
- * Exception translators are not registered
- * Reporters are not registered
- * Listeners are not registered
-* Reporters/Listeners are now notified of fatal errors
- * This means specific signals or structured exceptions
- * The Reporter/Listener interface provides default, empty, implementation to preserve backward compatibility
-* Stringification of `std::chrono::duration` and `std::chrono::time_point` is now supported
- * Needs to be enabled by a per-file compile time configuration option
-* Add `pkg-config` support to CMake install command
-
-
-### Fixes
-* Don't use console colour if running in XCode
-* Explicit constructor in reporter base class
-* Swept out `-Wweak-vtables`, `-Wexit-time-destructors`, `-Wglobal-constructors` warnings
-* Compilation for Universal Windows Platform (UWP) is supported
- * SEH handling and colorized output are disabled when compiling for UWP
-* Implemented a workaround for `std::uncaught_exception` issues in libcxxrt
- * These issues caused incorrect section traversals
- * The workaround is only partial, user's test can still trigger the issue by using `throw;` to rethrow an exception
-* Suppressed C4061 warning under MSVC
-
-
-### Internal changes
-* The development version now uses .cpp files instead of header files containing implementation.
- * This makes partial rebuilds much faster during development
-* The expression decomposition layer has been rewritten
-* The evaluation layer has been rewritten
-* New library (TextFlow) is used for formatting text to output
-
-
-## Older versions
-
-### 1.12.x
-
-#### 1.12.2
-##### Fixes
-* Fixed missing <cassert> include
-
-#### 1.12.1
-
-##### Fixes
-* Fixed deprecation warning in `ScopedMessage::~ScopedMessage`
-* All uses of `min` or `max` identifiers are now wrapped in parentheses
- * This avoids problems when Windows headers define `min` and `max` macros
-
-#### 1.12.0
-
-##### Fixes
-* Fixed compilation for strict C++98 mode (ie not gnu++98) and older compilers (#1103)
-* `INFO` messages are included in the `xml` reporter output even without `-s` specified.
-
-
-### 1.11.x
-
-#### 1.11.0
-
-##### Fixes
-* The original expression in `REQUIRE_FALSE( expr )` is now reporter properly as `!( expr )` (#1051)
- * Previously the parentheses were missing and `x != y` would be expanded as `!x != x`
-* `Approx::Margin` is now inclusive (#952)
- * Previously it was meant and documented as inclusive, but the check itself wasn't
- * This means that `REQUIRE( 0.25f == Approx( 0.0f ).margin( 0.25f ) )` passes, instead of fails
-* `RandomNumberGenerator::result_type` is now unsigned (#1050)
-
-##### Improvements
-* `__JETBRAINS_IDE__` macro handling is now CLion version specific (#1017)
- * When CLion 2017.3 or newer is detected, `__COUNTER__` is used instead of
-* TeamCity reporter now explicitly flushes output stream after each report (#1057)
- * On some platforms, output from redirected streams would show up only after the tests finished running
-* `ParseAndAddCatchTests` now can add test files as dependency to CMake configuration
- * This means you do not have to manually rerun CMake configuration step to detect new tests
-
-### 1.10.x
-
-#### 1.10.0
-
-##### Fixes
-* Evaluation layer has been rewritten (backported from Catch 2)
- * The new layer is much simpler and fixes some issues (#981)
-* Implemented workaround for VS 2017 raw string literal stringification bug (#995)
-* Fixed interaction between `[!shouldfail]` and `[!mayfail]` tags and sections
- * Previously sections with failing assertions would be marked as failed, not failed-but-ok
-
-##### Improvements
-* Added [libidentify](https://github.com/janwilmans/LibIdentify) support
-* Added "wait-for-keypress" option
-
-### 1.9.x
-
-#### 1.9.6
-
-##### Improvements
-* Catch's runtime overhead has been significantly decreased (#937, #939)
-* Added `--list-extra-info` cli option (#934).
- * It lists all tests together with extra information, ie filename, line number and description.
-
-
-
-#### 1.9.5
-
-##### Fixes
-* Truthy expressions are now reconstructed properly, not as booleans (#914)
-* Various warnings are no longer erroneously suppressed in test files (files that include `catch.hpp`, but do not define `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`) (#871)
-* Catch no longer fails to link when main is compiled as C++, but linked against Objective-C (#855)
-* Fixed incorrect gcc version detection when deciding to use `__COUNTER__` (#928)
- * Previously any GCC with minor version less than 3 would be incorrectly classified as not supporting `__COUNTER__`.
-* Suppressed C4996 warning caused by upcoming updated to MSVC 2017, marking `std::uncaught_exception` as deprecated. (#927)
-
-##### Improvements
-* CMake integration script now incorporates debug messages and registers tests in an improved way (#911)
-* Various documentation improvements
-
-
-
-#### 1.9.4
-
-##### Fixes
-* `CATCH_FAIL` macro no longer causes compilation error without variadic macro support
-* `INFO` messages are no longer cleared after being reported once
-
-##### Improvements and minor changes
-* Catch now uses `wmain` when compiled under Windows and `UNICODE` is defined.
- * Note that Catch still officially supports only ASCII
-
-#### 1.9.3
-
-##### Fixes
-* Completed the fix for (lack of) uint64_t in earlier Visual Studios
-
-#### 1.9.2
-
-##### Improvements and minor changes
-* All of `Approx`'s member functions now accept strong typedefs in C++11 mode (#888)
- * Previously `Approx::scale`, `Approx::epsilon`, `Approx::margin` and `Approx::operator()` didn't.
-
-
-##### Fixes
-* POSIX signals are now disabled by default under QNX (#889)
- * QNX does not support current enough (2001) POSIX specification
-* JUnit no longer counts exceptions as failures if given test case is marked as ok to fail.
-* `Catch::Option` should now have its storage properly aligned.
-* Catch no longer attempts to define `uint64_t` on windows (#862)
- * This was causing trouble when compiled under Cygwin
-
-##### Other
-* Catch is now compiled under MSVC 2017 using `std:c++latest` (C++17 mode) in CI
-* We now provide cmake script that autoregisters Catch tests into ctest.
- * See `contrib` folder.
-
-
-#### 1.9.1
-
-##### Fixes
-* Unexpected exceptions are no longer ignored by default (#885, #887)
-
-
-#### 1.9.0
-
-
-##### Improvements and minor changes
-* Catch no longer attempts to ensure the exception type passed by user in `REQUIRE_THROWS_AS` is a constant reference.
- * It was causing trouble when `REQUIRE_THROWS_AS` was used inside templated functions
- * This actually reverts changes made in v1.7.2
-* Catch's `Version` struct should no longer be double freed when multiple instances of Catch tests are loaded into single program (#858)
- * It is now a static variable in an inline function instead of being an `extern`ed struct.
-* Attempt to register invalid tag or tag alias now throws instead of calling `exit()`.
- * Because this happen before entering main, it still aborts execution
- * Further improvements to this are coming
-* `CATCH_CONFIG_FAST_COMPILE` now speeds-up compilation of `REQUIRE*` assertions by further ~15%.
- * The trade-off is disabling translation of unexpected exceptions into text.
-* When Catch is compiled using C++11, `Approx` is now constructible with anything that can be explicitly converted to `double`.
-* Captured messages are now printed on unexpected exceptions
-
-##### Fixes:
-* Clang's `-Wexit-time-destructors` should be suppressed for Catch's internals
-* GCC's `-Wparentheses` is now suppressed for all TU's that include `catch.hpp`.
- * This is functionally a revert of changes made in 1.8.0, where we tried using `_Pragma` based suppression. This should have kept the suppression local to Catch's assertions, but bugs in GCC's handling of `_Pragma`s in C++ mode meant that it did not always work.
-* You can now tell Catch to use C++11-based check when checking whether a type can be streamed to output.
- * This fixes cases when an unstreamable type has streamable private base (#877)
- * [Details can be found in documentation](configuration.md#catch_config_cpp11_stream_insertable_check)
-
-
-##### Other notes:
-* We have added VS 2017 to our CI
-* Work on Catch 2 should start soon
-
-
-
-### 1.8.x
-
-#### 1.8.2
-
-
-##### Improvements and minor changes
-* TAP reporter now behaves as if `-s` was always set
- * This should be more consistent with the protocol desired behaviour.
-* Compact reporter now obeys `-d yes` argument (#780)
- * The format is "XXX.123 s: <section-name>" (3 decimal places are always present).
- * Before it did not report the durations at all.
-* XML reporter now behaves the same way as Console reporter in regards to `INFO`
- * This means it reports `INFO` messages on success, if output on success (`-s`) is enabled.
- * Previously it only reported `INFO` messages on failure.
-* `CAPTURE(expr)` now stringifies `expr` in the same way assertion macros do (#639)
-* Listeners are now finally [documented](event-listeners.md#top).
- * Listeners provide a way to hook into events generated by running your tests, including start and end of run, every test case, every section and every assertion.
-
-
-##### Fixes:
-* Catch no longer attempts to reconstruct expression that led to a fatal error (#810)
- * This fixes possible signal/SEH loop when processing expressions, where the signal was triggered by expression decomposition.
-* Fixed (C4265) missing virtual destructor warning in Matchers (#844)
-* `std::string`s are now taken by `const&` everywhere (#842).
- * Previously some places were taking them by-value.
-* Catch should no longer change errno (#835).
- * This was caused by libstdc++ bug that we now work around.
-* Catch now provides `FAIL_CHECK( ... )` macro (#765).
- * Same as `FAIL( ... )`, but does not abort the test.
-* Functions like `fabs`, `tolower`, `memset`, `isalnum` are now used with `std::` qualification (#543).
-* Clara no longer assumes first argument (binary name) is always present (#729)
- * If it is missing, empty string is used as default.
-* Clara no longer reads 1 character past argument string (#830)
-* Regression in Objective-C bindings (Matchers) fixed (#854)
-
-
-##### Other notes:
-* We have added VS 2013 and 2015 to our CI
-* Catch Classic (1.x.x) now contains its own, forked, version of Clara (the argument parser).
-
-
-
-#### 1.8.1
-
-##### Fixes
-
-Cygwin issue with `gettimeofday` - `#define` was not early enough
-
-#### 1.8.0
-
-##### New features/ minor changes
-
-* Matchers have new, simpler (and documented) interface.
- * Catch provides string and vector matchers.
- * For details see [Matchers documentation](matchers.md#top).
-* Changed console reporter test duration reporting format (#322)
- * Old format: `Some simple comparisons between doubles completed in 0.000123s`
- * New format: `xxx.123s: Some simple comparisons between doubles` _(There will always be exactly 3 decimal places)_
-* Added opt-in leak detection under MSVC + Windows (#439)
- * Enable it by compiling Catch's main with `CATCH_CONFIG_WINDOWS_CRTDBG`
-* Introduced new compile-time flag, `CATCH_CONFIG_FAST_COMPILE`, trading features for compilation speed.
- * Moves debug breaks out of tests and into implementation, speeding up test compilation time (~10% on linux).
- * _More changes are coming_
-* Added [TAP (Test Anything Protocol)](https://testanything.org/) and [Automake](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html#Log-files-generation-and-test-results-recording) reporters.
- * These are not present in the default single-include header and need to be downloaded from GitHub separately.
- * For details see [documentation about integrating with build systems](build-systems.md#top).
-* XML reporter now reports filename as part of the `Section` and `TestCase` tags.
-* `Approx` now supports an optional margin of absolute error
- * It has also received [new documentation](assertions.md#top).
-
-##### Fixes
-* Silenced C4312 ("conversion from int to 'ClassName *") warnings in the evaluate layer.
-* Fixed C4512 ("assignment operator could not be generated") warnings under VS2013.
-* Cygwin compatibility fixes
- * Signal handling is no longer compiled by default.
- * Usage of `gettimeofday` inside Catch should no longer cause compilation errors.
-* Improved `-Wparentheses` suppression for gcc (#674)
- * When compiled with gcc 4.8 or newer, the suppression is localized to assertions only
- * Otherwise it is suppressed for the whole TU
-* Fixed test spec parser issue (with escapes in multiple names)
-
-##### Other
-* Various documentation fixes and improvements
-
-
-### 1.7.x
-
-#### 1.7.2
-
-##### Fixes and minor improvements
-Xml:
-
-(technically the first two are breaking changes but are also fixes and arguably break few if any people)
-* C-escape control characters instead of XML encoding them (which requires XML 1.1)
-* Revert XML output to XML 1.0
-* Can provide stylesheet references by extending the XML reporter
-* Added description and tags attributes to XML Reporter
-* Tags are closed and the stream flushed more eagerly to avoid stdout interpolation
-
-
-Other:
-* `REQUIRE_THROWS_AS` now catches exception by `const&` and reports expected type
-* In `SECTION`s the file/ line is now of the `SECTION`. not the `TEST_CASE`
-* Added std:: qualification to some functions from C stdlib
-* Removed use of RTTI (`dynamic_cast`) that had crept back in
-* Silenced a few more warnings in different circumstances
-* Travis improvements
-
-#### 1.7.1
-
-##### Fixes:
-* Fixed inconsistency in defining `NOMINMAX` and `WIN32_LEAN_AND_MEAN` inside `catch.hpp`.
-* Fixed SEH-related compilation error under older MinGW compilers, by making Windows SEH handling opt-in for compilers other than MSVC.
- * For specifics, look into the [documentation](configuration.md#top).
-* Fixed compilation error under MinGW caused by improper compiler detection.
-* Fixed XML reporter sometimes leaving an empty output file when a test ends with signal/structured exception.
-* Fixed XML reporter not reporting captured stdout/stderr.
-* Fixed possible infinite recursion in Windows SEH.
-* Fixed possible compilation error caused by Catch's operator overloads being ambiguous in regards to user-defined templated operators.
-
-#### 1.7.0
-
-##### Features/ Changes:
-* Catch now runs significantly faster for passing tests
- * Microbenchmark focused on Catch's overhead went from ~3.4s to ~0.7s.
- * Real world test using [JSON for Modern C++](https://github.com/nlohmann/json)'s test suite went from ~6m 25s to ~4m 14s.
-* Catch can now run specific sections within test cases.
- * For now the support is only basic (no wildcards or tags), for details see the [documentation](command-line.md#top).
-* Catch now supports SEH on Windows as well as signals on Linux.
- * After receiving a signal, Catch reports failing assertion and then passes the signal onto the previous handler.
-* Approx can be used to compare values against strong typedefs (available in C++11 mode only).
- * Strong typedefs mean types that are explicitly convertible to double.
-* CHECK macro no longer stops executing section if an exception happens.
-* Certain characters (space, tab, etc) are now pretty printed.
- * This means that a `char c = ' '; REQUIRE(c == '\t');` would be printed as `' ' == '\t'`, instead of ` == 9`.
-
-##### Fixes:
-* Text formatting no longer attempts to access out-of-bounds characters under certain conditions.
-* THROW family of assertions no longer trigger `-Wunused-value` on expressions containing explicit cast.
-* Breaking into debugger under OS X works again and no longer required `DEBUG` to be defined.
-* Compilation no longer breaks under certain compiler if a lambda is used inside assertion macro.
-
-##### Other:
-* Catch's CMakeLists now defines install command.
-* Catch's CMakeLists now generates projects with warnings enabled.
-
-
-### 1.6.x
-
-#### 1.6.1
-
-##### Features/ Changes:
-* Catch now supports breaking into debugger on Linux
-
-##### Fixes:
-* Generators no longer leak memory (generators are still unsupported in general)
-* JUnit reporter now reports UTC timestamps, instead of "tbd"
-* `CHECK_THAT` macro is now properly defined as `CATCH_CHECK_THAT` when using `CATCH_` prefixed macros
-
-##### Other:
-* Types with overloaded `&&` operator are no longer evaluated twice when used in an assertion macro.
-* The use of `__COUNTER__` is suppressed when Catch is parsed by CLion
- * This change is not active when compiling a binary
-* Approval tests can now be run on Windows
-* CMake will now warn if a file is present in the `include` folder but not is not enumerated as part of the project
-* Catch now defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` before including `windows.h`
- * This can be disabled if needed, see [documentation](configuration.md#top) for details.
-
-
-#### 1.6.0
-
-##### Cmake/ projects:
-* Moved CMakeLists.txt to root, made it friendlier for CLion and generating XCode and VS projects, and removed the manually maintained XCode and VS projects.
-
-##### Features/ Changes:
-* Approx now supports `>=` and `<=`
-* Can now use `\` to escape chars in test names on command line
-* Standardize C++11 feature toggles
-
-##### Fixes:
-* Blue shell colour
-* Missing argument to `CATCH_CHECK_THROWS`
-* Don't encode extended ASCII in XML
-* use `std::shuffle` on more compilers (fixes deprecation warning/error)
-* Use `__COUNTER__` more consistently (where available)
-
-##### Other:
-* Tweaks and changes to scripts - particularly for Approval test - to make them more portable
-
-
-## Even Older versions
-Release notes were not maintained prior to v1.6.0, but you should be able to work them out from the Git history
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/release-process.md b/docs/release-process.md
deleted file mode 100644
index 130a8922..00000000
--- a/docs/release-process.md
+++ /dev/null
@@ -1,73 +0,0 @@
-<a id="top"></a>
-# How to release
-
-When enough changes have accumulated, it is time to release new version of Catch. This document describes the process in doing so, that no steps are forgotten. Note that all referenced scripts can be found in the `scripts/` directory.
-
-## Necessary steps
-
-These steps are necessary and have to be performed before each new release. They serve to make sure that the new release is correct and linked-to from the standard places.
-
-
-### Testing
-
-All of the tests are currently run in our CI setup based on TravisCI and
-AppVeyor. As long as the last commit tested green, the release can
-proceed.
-
-
-### Incrementing version number
-
-Catch uses a variant of [semantic versioning](http://semver.org/), with breaking API changes (and thus major version increments) being very rare. Thus, the release will usually increment the patch version, when it only contains couple of bugfixes, or minor version, when it contains new functionality, or larger changes in implementation of current functionality.
-
-After deciding which part of version number should be incremented, you can use one of the `*Release.py` scripts to perform the required changes to Catch.
-
-This will take care of generating the single include header, updating
-version numbers everywhere and pushing the new version to Wandbox.
-
-
-### Release notes
-
-Once a release is ready, release notes need to be written. They should summarize changes done since last release. For rough idea of expected notes see previous releases. Once written, release notes should be added to `docs/release-notes.md`.
-
-
-### Commit and push update to GitHub
-
-After version number is incremented, single-include header is regenerated and release notes are updated, changes should be committed and pushed to GitHub.
-
-
-### Release on GitHub
-
-After pushing changes to GitHub, GitHub release *needs* to be created.
-Tag version and release title should be same as the new version,
-description should contain the release notes for the current release.
-Single header version of `catch.hpp` *needs* to be attached as a binary,
-as that is where the official download link links to. Preferably
-it should use linux line endings. All non-bundled reporters (Automake, TAP,
-TeamCity, SonarQube) should also be attached as binaries, as they might be
-dependent on a specific version of the single-include header.
-
-Since 2.5.0, the release tag and the "binaries" (headers) should be PGP
-signed.
-
-#### Signing a tag
-
-To create a signed tag, use `git tag -s <VERSION>`, where `<VERSION>`
-is the version being released, e.g. `git tag -s v2.6.0`.
-
-Use the version name as the short message and the release notes as
-the body (long) message.
-
-#### Signing the headers
-
-This will create ASCII-armored signatures for the headers that are
-uploaded to the GitHub release:
-
-```
-$ gpg2 --armor --output catch.hpp.asc --detach-sig catch.hpp
-$ gpg2 --armor --output catch_reporter_automake.hpp.asc --detach-sig catch_reporter_automake.hpp
-$ gpg2 --armor --output catch_reporter_teamcity.hpp.asc --detach-sig catch_reporter_teamcity.hpp
-$ gpg2 --armor --output catch_reporter_tap.hpp.asc --detach-sig catch_reporter_tap.hpp
-$ gpg2 --armor --output catch_reporter_sonarqube.hpp.asc --detach-sig catch_reporter_sonarqube.hpp
-```
-
-_GPG does not support signing multiple files in single invocation._
diff --git a/docs/reporters.md b/docs/reporters.md
deleted file mode 100644
index a33e55bf..00000000
--- a/docs/reporters.md
+++ /dev/null
@@ -1,47 +0,0 @@
-<a id="top"></a>
-# Reporters
-
-Catch has a modular reporting system and comes bundled with a handful of useful reporters built in.
-You can also write your own reporters.
-
-## Using different reporters
-
-The reporter to use can easily be controlled from the command line.
-To specify a reporter use [`-r` or `--reporter`](command-line.md#choosing-a-reporter-to-use), followed by the name of the reporter, e.g.:
-
-```
--r xml
-```
-
-If you don't specify a reporter then the console reporter is used by default.
-There are four reporters built in to the single include:
-
-* `console` writes as lines of text, formatted to a typical terminal width, with colours if a capable terminal is detected.
-* `compact` similar to `console` but optimised for minimal output - each entry on one line
-* `junit` writes xml that corresponds to Ant's [junitreport](http://help.catchsoftware.com/display/ET/JUnit+Format) target. Useful for build systems that understand Junit.
-Because of the way the junit format is structured the run must complete before anything is written.
-* `xml` writes an xml format tailored to Catch. Unlike `junit` this is a streaming format so results are delivered progressively.
-
-There are a few additional reporters, for specific build systems, in the Catch repository (in `include\reporters`) which you can `#include` in your project if you would like to make use of them.
-Do this in one source file - the same one you have `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`.
-
-* `teamcity` writes the native, streaming, format that [TeamCity](https://www.jetbrains.com/teamcity/) understands.
-Use this when building as part of a TeamCity build to see results as they happen ([code example](../examples/207-Rpt-TeamCityReporter.cpp)).
-* `tap` writes in the TAP ([Test Anything Protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol)) format.
-* `automake` writes in a format that correspond to [automake .trs](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html) files
-* `sonarqube` writes the [SonarQube Generic Test Data](https://docs.sonarqube.org/latest/analysis/generic-test/) XML format.
-
-You see what reporters are available from the command line by running with `--list-reporters`.
-
-By default all these reports are written to stdout, but can be redirected to a file with [`-o` or `--out`](command-line.md#sending-output-to-a-file)
-
-## Writing your own reporter
-
-You can write your own custom reporter and register it with Catch.
-At time of writing the interface is subject to some changes so is not, yet, documented here.
-If you are determined you shouldn't have too much trouble working it out from the existing implementations -
-but do keep in mind upcoming changes (these will be minor, simplifying, changes such as not needing to forward calls to the base class).
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/slow-compiles.md b/docs/slow-compiles.md
deleted file mode 100644
index 230f5330..00000000
--- a/docs/slow-compiles.md
+++ /dev/null
@@ -1,72 +0,0 @@
-<a id="top"></a>
-# Why do my tests take so long to compile?
-
-**Contents**<br>
-[Short answer](#short-answer)<br>
-[Long answer](#long-answer)<br>
-[Practical example](#practical-example)<br>
-[Other possible solutions](#other-possible-solutions)<br>
-
-Several people have reported that test code written with Catch takes much longer to compile than they would expect. Why is that?
-
-Catch is implemented entirely in headers. There is a little overhead due to this - but not as much as you might think - and you can minimise it simply by organising your test code as follows:
-
-## Short answer
-Exactly one source file must ```#define``` either ```CATCH_CONFIG_MAIN``` or ```CATCH_CONFIG_RUNNER``` before ```#include```-ing Catch. In this file *do not write any test cases*! In most cases that means this file will just contain two lines (the ```#define``` and the ```#include```).
-
-## Long answer
-
-Usually C++ code is split between a header file, containing declarations and prototypes, and an implementation file (.cpp) containing the definition, or implementation, code. Each implementation file, along with all the headers that it includes (and which those headers include, etc), is expanded into a single entity called a translation unit - which is then passed to the compiler and compiled down to an object file.
-
-But functions and methods can also be written inline in header files. The downside to this is that these definitions will then be compiled in *every* translation unit that includes the header.
-
-Because Catch is implemented *entirely* in headers you might think that the whole of Catch must be compiled into every translation unit that uses it! Actually it's not quite as bad as that. Catch mitigates this situation by effectively maintaining the traditional separation between the implementation code and declarations. Internally the implementation code is protected by ```#ifdef```s and is conditionally compiled into only one translation unit. This translation unit is that one that ```#define```s ```CATCH_CONFIG_MAIN``` or ```CATCH_CONFIG_RUNNER```. Let's call this the main source file.
-
-As a result the main source file *does* compile the whole of Catch every time! So it makes sense to dedicate this file to *only* ```#define```-ing the identifier and ```#include```-ing Catch (and implementing the runner code, if you're doing that). Keep all your test cases in other files. This way you won't pay the recompilation cost for the whole of Catch.
-
-## Practical example
-Assume you have the `Factorial` function from the [tutorial](tutorial.md#top) in `factorial.cpp` (with forward declaration in `factorial.h`) and want to test it and keep the compile times down when adding new tests. Then you should have 2 files, `tests-main.cpp` and `tests-factorial.cpp`:
-
-```cpp
-// tests-main.cpp
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-```
-
-```cpp
-// tests-factorial.cpp
-#include "catch.hpp"
-
-#include "factorial.h"
-
-TEST_CASE( "Factorials are computed", "[factorial]" ) {
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-}
-```
-
-After compiling `tests-main.cpp` once, it is enough to link it with separately compiled `tests-factorial.cpp`. This means that adding more tests to `tests-factorial.cpp`, will not result in recompiling Catch's main and the resulting compilation times will decrease substantially.
-
-```
-$ g++ tests-main.cpp -c
-$ g++ factorial.cpp -c
-$ g++ tests-main.o factorial.o tests-factorial.cpp -o tests && ./tests -r compact
-Passed 1 test case with 4 assertions.
-```
-
-Now, the next time we change the file `tests-factorial.cpp` (say we add `REQUIRE( Factorial(0) == 1)`), it is enough to recompile the tests instead of recompiling main as well:
-
-```
-$ g++ tests-main.o factorial.o tests-factorial.cpp -o tests && ./tests -r compact
-tests-factorial.cpp:11: failed: Factorial(0) == 1 for: 0 == 1
-Failed 1 test case, failed 1 assertion.
-```
-
-## Other possible solutions
-You can also opt to sacrifice some features in order to speed-up Catch's compilation times. For details see the [documentation on Catch's compile-time configuration](configuration.md#other-toggles).
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/test-cases-and-sections.md b/docs/test-cases-and-sections.md
deleted file mode 100644
index 53f9e150..00000000
--- a/docs/test-cases-and-sections.md
+++ /dev/null
@@ -1,275 +0,0 @@
-<a id="top"></a>
-# Test cases and sections
-
-**Contents**<br>
-[Tags](#tags)<br>
-[Tag aliases](#tag-aliases)<br>
-[BDD-style test cases](#bdd-style-test-cases)<br>
-[Type parametrised test cases](#type-parametrised-test-cases)<br>
-[Signature based parametrised test cases](#signature-based-parametrised-test-cases)<br>
-
-While Catch fully supports the traditional, xUnit, style of class-based fixtures containing test case methods this is not the preferred style.
-
-Instead Catch provides a powerful mechanism for nesting test case sections within a test case. For a more detailed discussion see the [tutorial](tutorial.md#test-cases-and-sections).
-
-Test cases and sections are very easy to use in practice:
-
-* **TEST_CASE(** _test name_ \[, _tags_ \] **)**
-* **SECTION(** _section name_ **)**
-
-_test name_ and _section name_ are free form, quoted, strings. The optional _tags_ argument is a quoted string containing one or more tags enclosed in square brackets. Tags are discussed below. Test names must be unique within the Catch executable.
-
-For examples see the [Tutorial](tutorial.md#top)
-
-## Tags
-
-Tags allow an arbitrary number of additional strings to be associated with a test case. Test cases can be selected (for running, or just for listing) by tag - or even by an expression that combines several tags. At their most basic level they provide a simple way to group several related tests together.
-
-As an example - given the following test cases:
-
- TEST_CASE( "A", "[widget]" ) { /* ... */ }
- TEST_CASE( "B", "[widget]" ) { /* ... */ }
- TEST_CASE( "C", "[gadget]" ) { /* ... */ }
- TEST_CASE( "D", "[widget][gadget]" ) { /* ... */ }
-
-The tag expression, ```"[widget]"``` selects A, B & D. ```"[gadget]"``` selects C & D. ```"[widget][gadget]"``` selects just D and ```"[widget],[gadget]"``` selects all four test cases.
-
-For more detail on command line selection see [the command line docs](command-line.md#specifying-which-tests-to-run)
-
-Tag names are not case sensitive and can contain any ASCII characters. This means that tags `[tag with spaces]` and `[I said "good day"]` are both allowed tags and can be filtered on. Escapes are not supported however and `[\]]` is not a valid tag.
-
-### Special Tags
-
-All tag names beginning with non-alphanumeric characters are reserved by Catch. Catch defines a number of "special" tags, which have meaning to the test runner itself. These special tags all begin with a symbol character. Following is a list of currently defined special tags and their meanings.
-
-* `[!hide]` or `[.]` - causes test cases to be skipped from the default list (i.e. when no test cases have been explicitly selected through tag expressions or name wildcards). The hide tag is often combined with another, user, tag (for example `[.][integration]` - so all integration tests are excluded from the default run but can be run by passing `[integration]` on the command line). As a short-cut you can combine these by simply prefixing your user tag with a `.` - e.g. `[.integration]`. Because the hide tag has evolved to have several forms, all forms are added as tags if you use one of them.
-
-* `[!throws]` - lets Catch know that this test is likely to throw an exception even if successful. This causes the test to be excluded when running with `-e` or `--nothrow`.
-
-* `[!mayfail]` - doesn't fail the test if any given assertion fails (but still reports it). This can be useful to flag a work-in-progress, or a known issue that you don't want to immediately fix but still want to track in your tests.
-
-* `[!shouldfail]` - like `[!mayfail]` but *fails* the test if it *passes*. This can be useful if you want to be notified of accidental, or third-party, fixes.
-
-* `[!nonportable]` - Indicates that behaviour may vary between platforms or compilers.
-
-* `[#<filename>]` - running with `-#` or `--filenames-as-tags` causes Catch to add the filename, prefixed with `#` (and with any extension stripped), as a tag to all contained tests, e.g. tests in testfile.cpp would all be tagged `[#testfile]`.
-
-* `[@<alias>]` - tag aliases all begin with `@` (see below).
-
-* `[!benchmark]` - this test case is actually a benchmark. This is an experimental feature, and currently has no documentation. If you want to try it out, look at `projects/SelfTest/Benchmark.tests.cpp` for details.
-
-## Tag aliases
-
-Between tag expressions and wildcarded test names (as well as combinations of the two) quite complex patterns can be constructed to direct which test cases are run. If a complex pattern is used often it is convenient to be able to create an alias for the expression. This can be done, in code, using the following form:
-
- CATCH_REGISTER_TAG_ALIAS( <alias string>, <tag expression> )
-
-Aliases must begin with the `@` character. An example of a tag alias is:
-
- CATCH_REGISTER_TAG_ALIAS( "[@nhf]", "[failing]~[.]" )
-
-Now when `[@nhf]` is used on the command line this matches all tests that are tagged `[failing]`, but which are not also hidden.
-
-## BDD-style test cases
-
-In addition to Catch's take on the classic style of test cases, Catch supports an alternative syntax that allow tests to be written as "executable specifications" (one of the early goals of [Behaviour Driven Development](http://dannorth.net/introducing-bdd/)). This set of macros map on to ```TEST_CASE```s and ```SECTION```s, with a little internal support to make them smoother to work with.
-
-* **SCENARIO(** _scenario name_ \[, _tags_ \] **)**
-
-This macro maps onto ```TEST_CASE``` and works in the same way, except that the test case name will be prefixed by "Scenario: "
-
-* **GIVEN(** _something_ **)**
-* **WHEN(** _something_ **)**
-* **THEN(** _something_ **)**
-
-These macros map onto ```SECTION```s except that the section names are the _something_s prefixed by "given: ", "when: " or "then: " respectively.
-
-* **AND_GIVEN(** _something_ **)**
-* **AND_WHEN(** _something_ **)**
-* **AND_THEN(** _something_ **)**
-
-Similar to ```GIVEN```, ```WHEN``` and ```THEN``` except that the prefixes start with "and ". These are used to chain ```GIVEN```s, ```WHEN```s and ```THEN```s together.
-
-> `AND_GIVEN` was [introduced](https://github.com/catchorg/Catch2/issues/1360) in Catch 2.4.0.
-
-When any of these macros are used the console reporter recognises them and formats the test case header such that the Givens, Whens and Thens are aligned to aid readability.
-
-Other than the additional prefixes and the formatting in the console reporter these macros behave exactly as ```TEST_CASE```s and ```SECTION```s. As such there is nothing enforcing the correct sequencing of these macros - that's up to the programmer!
-
-## Type parametrised test cases
-
-In addition to `TEST_CASE`s, Catch2 also supports test cases parametrised
-by types, in the form of `TEMPLATE_TEST_CASE`,
-`TEMPLATE_PRODUCT_TEST_CASE` and `TEMPLATE_LIST_TEST_CASE`.
-
-* **TEMPLATE_TEST_CASE(** _test name_ , _tags_, _type1_, _type2_, ..., _typen_ **)**
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1437) in Catch 2.5.0.
-
-_test name_ and _tag_ are exactly the same as they are in `TEST_CASE`,
-with the difference that the tag string must be provided (however, it
-can be empty). _type1_ through _typen_ is the list of types for which
-this test case should run, and, inside the test code, the current type
-is available as the `TestType` type.
-
-Because of limitations of the C++ preprocessor, if you want to specify
-a type with multiple template parameters, you need to enclose it in
-parentheses, e.g. `std::map<int, std::string>` needs to be passed as
-`(std::map<int, std::string>)`.
-
-Example:
-```cpp
-TEMPLATE_TEST_CASE( "vectors can be sized and resized", "[vector][template]", int, std::string, (std::tuple<int,float>) ) {
-
- std::vector<TestType> v( 5 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "resizing bigger changes size and capacity" ) {
- v.resize( 10 );
-
- REQUIRE( v.size() == 10 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "resizing smaller changes size but not capacity" ) {
- v.resize( 0 );
-
- REQUIRE( v.size() == 0 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "We can use the 'swap trick' to reset the capacity" ) {
- std::vector<TestType> empty;
- empty.swap( v );
-
- REQUIRE( v.capacity() == 0 );
- }
- }
- SECTION( "reserving smaller does not change size or capacity" ) {
- v.reserve( 0 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
- }
-}
-```
-
-* **TEMPLATE_PRODUCT_TEST_CASE(** _test name_ , _tags_, (_template-type1_, _template-type2_, ..., _template-typen_), (_template-arg1_, _template-arg2_, ..., _template-argm_) **)**
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1468) in Catch 2.6.0.
-
-_template-type1_ through _template-typen_ is list of template template
-types which should be combined with each of _template-arg1_ through
- _template-argm_, resulting in _n * m_ test cases. Inside the test case,
-the resulting type is available under the name of `TestType`.
-
-To specify more than 1 type as a single _template-type_ or _template-arg_,
-you must enclose the types in an additional set of parentheses, e.g.
-`((int, float), (char, double))` specifies 2 template-args, each
-consisting of 2 concrete types (`int`, `float` and `char`, `double`
-respectively). You can also omit the outer set of parentheses if you
-specify only one type as the full set of either the _template-types_,
-or the _template-args_.
-
-
-Example:
-```cpp
-template< typename T>
-struct Foo {
- size_t size() {
- return 0;
- }
-};
-
-TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]", (std::vector, Foo), (int, float)) {
- TestType x;
- REQUIRE(x.size() == 0);
-}
-```
-
-You can also have different arities in the _template-arg_ packs:
-```cpp
-TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
- TestType x;
- REQUIRE(std::tuple_size<TestType>::value >= 1);
-}
-```
-
-_While there is an upper limit on the number of types you can specify
-in single `TEMPLATE_TEST_CASE` or `TEMPLATE_PRODUCT_TEST_CASE`, the limit
-is very high and should not be encountered in practice._
-
-* **TEMPLATE_LIST_TEST_CASE(** _test name_, _tags_, _type list_ **)**
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1627) in Catch 2.9.0.
-
-_type list_ is a generic list of types on which test case should be instantiated.
-List can be `std::tuple`, `boost::mpl::list`, `boost::mp11::mp_list` or anything with
-`template <typename...>` signature.
-
-This allows you to reuse the _type list_ in multiple test cases.
-
-Example:
-```cpp
-using MyTypes = std::tuple<int, char, float>;
-TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes)
-{
- REQUIRE(sizeof(TestType) > 0);
-}
-```
-
-
-## Signature based parametrised test cases
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch 2.8.0.
-
-In addition to [type parametrised test cases](#type-parametrised-test-cases) Catch2 also supports
-signature base parametrised test cases, in form of `TEMPLATE_TEST_CASE_SIG` and `TEMPLATE_PRODUCT_TEST_CASE_SIG`.
-These test cases have similar syntax like [type parametrised test cases](#type-parametrised-test-cases), with one
-additional positional argument which specifies the signature.
-
-### Signature
-Signature has some strict rules for these tests cases to work properly:
-* signature with multiple template parameters e.g. `typename T, size_t S` must have this format in test case declaration
- `((typename T, size_t S), T, S)`
-* signature with variadic template arguments e.g. `typename T, size_t S, typename...Ts` must have this format in test case declaration
- `((typename T, size_t S, typename...Ts), T, S, Ts...)`
-* signature with single non type template parameter e.g. `int V` must have this format in test case declaration `((int V), V)`
-* signature with single type template parameter e.g. `typename T` should not be used as it is in fact `TEMPLATE_TEST_CASE`
-
-Currently Catch2 support up to 11 template parameters in signature
-
-### Examples
-
-* **TEMPLATE_TEST_CASE_SIG(** _test name_ , _tags_, _signature_, _type1_, _type2_, ..., _typen_ **)**
-
-Inside `TEMPLATE_TEST_CASE_SIG` test case you can use the names of template parameters as defined in _signature_.
-
-```cpp
-TEMPLATE_TEST_CASE_SIG("TemplateTestSig: arrays can be created from NTTP arguments", "[vector][template][nttp]",
- ((typename T, int V), T, V), (int,5), (float,4), (std::string,15), ((std::tuple<int, float>), 6)) {
-
- std::array<T, V> v;
- REQUIRE(v.size() > 1);
-}
-```
-
-* **TEMPLATE_PRODUCT_TEST_CASE_SIG(** _test name_ , _tags_, _signature_, (_template-type1_, _template-type2_, ..., _template-typen_), (_template-arg1_, _template-arg2_, ..., _template-argm_) **)**
-
-```cpp
-
-template<typename T, size_t S>
-struct Bar {
- size_t size() { return S; }
-};
-
-TEMPLATE_PRODUCT_TEST_CASE_SIG("A Template product test case with array signature", "[template][product][nttp]", ((typename T, size_t S), T, S), (std::array, Bar), ((int, 9), (float, 42))) {
- TestType x;
- REQUIRE(x.size() > 0);
-}
-```
-
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/test-fixtures.md b/docs/test-fixtures.md
deleted file mode 100644
index 832bba12..00000000
--- a/docs/test-fixtures.md
+++ /dev/null
@@ -1,143 +0,0 @@
-<a id="top"></a>
-# Test fixtures
-
-## Defining test fixtures
-
-Although Catch allows you to group tests together as sections within a test case, it can still be convenient, sometimes, to group them using a more traditional test fixture. Catch fully supports this too. You define the test fixture as a simple structure:
-
-```c++
-class UniqueTestsFixture {
- private:
- static int uniqueID;
- protected:
- DBConnection conn;
- public:
- UniqueTestsFixture() : conn(DBConnection::createConnection("myDB")) {
- }
- protected:
- int getID() {
- return ++uniqueID;
- }
- };
-
- int UniqueTestsFixture::uniqueID = 0;
-
- TEST_CASE_METHOD(UniqueTestsFixture, "Create Employee/No Name", "[create]") {
- REQUIRE_THROWS(conn.executeSQL("INSERT INTO employee (id, name) VALUES (?, ?)", getID(), ""));
- }
- TEST_CASE_METHOD(UniqueTestsFixture, "Create Employee/Normal", "[create]") {
- REQUIRE(conn.executeSQL("INSERT INTO employee (id, name) VALUES (?, ?)", getID(), "Joe Bloggs"));
- }
-```
-
-The two test cases here will create uniquely-named derived classes of UniqueTestsFixture and thus can access the `getID()` protected method and `conn` member variables. This ensures that both the test cases are able to create a DBConnection using the same method (DRY principle) and that any ID's created are unique such that the order that tests are executed does not matter.
-
-
-Catch2 also provides `TEMPLATE_TEST_CASE_METHOD` and
-`TEMPLATE_PRODUCT_TEST_CASE_METHOD` that can be used together
-with templated fixtures and templated template fixtures to perform
-tests for multiple different types. Unlike `TEST_CASE_METHOD`,
-`TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD` do
-require the tag specification to be non-empty, as it is followed by
-further macro arguments.
-
-Also note that, because of limitations of the C++ preprocessor, if you
-want to specify a type with multiple template parameters, you need to
-enclose it in parentheses, e.g. `std::map<int, std::string>` needs to be
-passed as `(std::map<int, std::string>)`.
-In the case of `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, if a member of the
-type list should consist of more than single type, it needs to be enclosed
-in another pair of parentheses, e.g. `(std::map, std::pair)` and
-`((int, float), (char, double))`.
-
-Example:
-```cpp
-template< typename T >
-struct Template_Fixture {
- Template_Fixture(): m_a(1) {}
-
- T m_a;
-};
-
-TEMPLATE_TEST_CASE_METHOD(Template_Fixture,"A TEMPLATE_TEST_CASE_METHOD based test run that succeeds", "[class][template]", int, float, double) {
- REQUIRE( Template_Fixture<TestType>::m_a == 1 );
-}
-
-template<typename T>
-struct Template_Template_Fixture {
- Template_Template_Fixture() {}
-
- T m_a;
-};
-
-template<typename T>
-struct Foo_class {
- size_t size() {
- return 0;
- }
-};
-
-TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Template_Fixture, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test succeeds", "[class][template]", (Foo_class, std::vector), int) {
- REQUIRE( Template_Template_Fixture<TestType>::m_a.size() == 0 );
-}
-```
-
-_While there is an upper limit on the number of types you can specify
-in single `TEMPLATE_TEST_CASE_METHOD` or `TEMPLATE_PRODUCT_TEST_CASE_METHOD`,
-the limit is very high and should not be encountered in practice._
-
-## Signature-based parametrised test fixtures
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch 2.8.0.
-
-Catch2 also provides `TEMPLATE_TEST_CASE_METHOD_SIG` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG` to support
-fixtures using non-type template parameters. These test cases work similar to `TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD`,
-with additional positional argument for [signature](test-cases-and-sections.md#signature-based-parametrised-test-cases).
-
-Example:
-```cpp
-template <int V>
-struct Nttp_Fixture{
- int value = V;
-};
-
-TEMPLATE_TEST_CASE_METHOD_SIG(Nttp_Fixture, "A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds", "[class][template][nttp]",((int V), V), 1, 3, 6) {
- REQUIRE(Nttp_Fixture<V>::value > 0);
-}
-
-template<typename T>
-struct Template_Fixture_2 {
- Template_Fixture_2() {}
-
- T m_a;
-};
-
-template< typename T, size_t V>
-struct Template_Foo_2 {
- size_t size() { return V; }
-};
-
-TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds", "[class][template][product][nttp]", ((typename T, size_t S), T, S),(std::array, Template_Foo_2), ((int,2), (float,6)))
-{
- REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() >= 2);
-}
-```
-
-## Template fixtures with types specified in template type lists
-
-Catch2 also provides `TEMPLATE_LIST_TEST_CASE_METHOD` to support template fixtures with types specified in
-template type lists like `std::tuple`, `boost::mpl::list` or `boost::mp11::mp_list`. This test case works the same as `TEMPLATE_TEST_CASE_METHOD`,
-only difference is the source of types. This allows you to reuse the template type list in multiple test cases.
-
-Example:
-```cpp
-using MyTypes = std::tuple<int, char, double>;
-TEMPLATE_LIST_TEST_CASE_METHOD(Template_Fixture, "Template test case method with test types specified inside std::tuple", "[class][template][list]", MyTypes)
-{
- REQUIRE( Template_Fixture<TestType>::m_a == 1 );
-}
-```
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/tostring.md b/docs/tostring.md
deleted file mode 100644
index 156c895a..00000000
--- a/docs/tostring.md
+++ /dev/null
@@ -1,132 +0,0 @@
-<a id="top"></a>
-# String conversions
-
-**Contents**<br>
-[operator << overload for std::ostream](#operator--overload-for-stdostream)<br>
-[Catch::StringMaker specialisation](#catchstringmaker-specialisation)<br>
-[Catch::is_range specialisation](#catchis_range-specialisation)<br>
-[Exceptions](#exceptions)<br>
-[Enums](#enums)<br>
-[Floating point precision](#floating-point-precision)<br>
-
-
-Catch needs to be able to convert types you use in assertions and logging expressions into strings (for logging and reporting purposes).
-Most built-in or std types are supported out of the box but there are two ways that you can tell Catch how to convert your own types (or other, third-party types) into strings.
-
-## operator << overload for std::ostream
-
-This is the standard way of providing string conversions in C++ - and the chances are you may already provide this for your own purposes. If you're not familiar with this idiom it involves writing a free function of the form:
-
-```cpp
-std::ostream& operator << ( std::ostream& os, T const& value ) {
- os << convertMyTypeToString( value );
- return os;
-}
-```
-
-(where ```T``` is your type and ```convertMyTypeToString``` is where you'll write whatever code is necessary to make your type printable - it doesn't have to be in another function).
-
-You should put this function in the same namespace as your type, or the global namespace, and have it declared before including Catch's header.
-
-## Catch::StringMaker specialisation
-If you don't want to provide an ```operator <<``` overload, or you want to convert your type differently for testing purposes, you can provide a specialization for `Catch::StringMaker<T>`:
-
-```cpp
-namespace Catch {
- template<>
- struct StringMaker<T> {
- static std::string convert( T const& value ) {
- return convertMyTypeToString( value );
- }
- };
-}
-```
-
-## Catch::is_range specialisation
-As a fallback, Catch attempts to detect if the type can be iterated
-(`begin(T)` and `end(T)` are valid) and if it can be, it is stringified
-as a range. For certain types this can lead to infinite recursion, so
-it can be disabled by specializing `Catch::is_range` like so:
-
-```cpp
-namespace Catch {
- template<>
- struct is_range<T> {
- static const bool value = false;
- };
-}
-
-```
-
-
-## Exceptions
-
-By default all exceptions deriving from `std::exception` will be translated to strings by calling the `what()` method. For exception types that do not derive from `std::exception` - or if `what()` does not return a suitable string - use `CATCH_TRANSLATE_EXCEPTION`. This defines a function that takes your exception type, by reference, and returns a string. It can appear anywhere in the code - it doesn't have to be in the same translation unit. For example:
-
-```cpp
-CATCH_TRANSLATE_EXCEPTION( MyType& ex ) {
- return ex.message();
-}
-```
-
-## Enums
-
-> Introduced in Catch 2.8.0.
-
-Enums that already have a `<<` overload for `std::ostream` will convert to strings as expected.
-If you only need to convert enums to strings for test reporting purposes you can provide a `StringMaker` specialisations as any other type.
-However, as a convenience, Catch provides the `REGISTER_ENUM` helper macro that will generate the `StringMaker` specialiation for you with minimal code.
-Simply provide it the (qualified) enum name, followed by all the enum values, and you're done!
-
-E.g.
-
-```cpp
-enum class Fruits { Banana, Apple, Mango };
-
-CATCH_REGISTER_ENUM( Fruits, Fruits::Banana, Fruits::Apple, Fruits::Mango )
-
-TEST_CASE() {
- REQUIRE( Fruits::Mango == Fruits::Apple );
-}
-```
-
-... or if the enum is in a namespace:
-```cpp
-namespace Bikeshed {
- enum class Colours { Red, Green, Blue };
-}
-
-// Important!: This macro must appear at top level scope - not inside a namespace
-// You can fully qualify the names, or use a using if you prefer
-CATCH_REGISTER_ENUM( Bikeshed::Colours,
- Bikeshed::Colours::Red,
- Bikeshed::Colours::Green,
- Bikeshed::Colours::Blue )
-
-TEST_CASE() {
- REQUIRE( Bikeshed::Colours::Red == Bikeshed::Colours::Blue );
-}
-```
-
-## Floating point precision
-
-> [Introduced](https://github.com/catchorg/Catch2/issues/1614) in Catch 2.8.0.
-
-Catch provides a built-in `StringMaker` specialization for both `float`
-and `double`. By default, it uses what we think is a reasonable precision,
-but you can customize it by modifying the `precision` static variable
-inside the `StringMaker` specialization, like so:
-
-```cpp
- Catch::StringMaker<float>::precision = 15;
- const float testFloat1 = 1.12345678901234567899f;
- const float testFloat2 = 1.12345678991234567899f;
- REQUIRE(testFloat1 == testFloat2);
-```
-
-This assertion will fail and print out the `testFloat1` and `testFloat2`
-to 15 decimal places.
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/tutorial.md b/docs/tutorial.md
deleted file mode 100644
index 1f0b8ff2..00000000
--- a/docs/tutorial.md
+++ /dev/null
@@ -1,279 +0,0 @@
-<a id="top"></a>
-# Tutorial
-
-**Contents**<br>
-[Getting Catch2](#getting-catch2)<br>
-[Where to put it?](#where-to-put-it)<br>
-[Writing tests](#writing-tests)<br>
-[Test cases and sections](#test-cases-and-sections)<br>
-[BDD-Style](#bdd-style)<br>
-[Scaling up](#scaling-up)<br>
-[Type parametrised test cases](#type-parametrised-test-cases)<br>
-[Next steps](#next-steps)<br>
-
-## Getting Catch2
-
-The simplest way to get Catch2 is to download the latest [single header version](https://raw.githubusercontent.com/catchorg/Catch2/master/single_include/catch2/catch.hpp). The single header is generated by merging a set of individual headers but it is still just normal source code in a header file.
-
-Alternative ways of getting Catch2 include using your system package
-manager, or installing it using [its CMake package](cmake-integration.md#installing-catch2-from-git-repository).
-
-The full source for Catch2, including test projects, documentation, and other things, is hosted on GitHub. [http://catch-lib.net](http://catch-lib.net) will redirect you there.
-
-
-## Where to put it?
-
-Catch2 is header only. All you need to do is drop the file somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](https://levelofindirection.com/blog/unit-testing-in-cpp-and-objective-c-just-got-ridiculously-easier-still.html).
-
-The rest of this tutorial will assume that the Catch2 single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary.
-
-_If you have installed Catch2 from system package manager, or CMake
-package, you need to include the header as `#include <catch2/catch.hpp>`_
-
-## Writing tests
-
-Let's start with a really simple example ([code](../examples/010-TestCase.cpp)). Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now).
-
-```c++
-unsigned int Factorial( unsigned int number ) {
- return number <= 1 ? number : Factorial(number-1)*number;
-}
-```
-
-To keep things simple we'll put everything in a single file (<a href="#scaling-up">see later for more on how to structure your test files</a>).
-
-```c++
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
-#include "catch.hpp"
-
-unsigned int Factorial( unsigned int number ) {
- return number <= 1 ? number : Factorial(number-1)*number;
-}
-
-TEST_CASE( "Factorials are computed", "[factorial]" ) {
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-}
-```
-
-This will compile to a complete executable which responds to [command line arguments](command-line.md#top). If you just run it with no arguments it will execute all test cases (in this case there is just one), report any failures, report a summary of how many tests passed and failed and return the number of failed tests (useful for if you just want a yes/ no answer to: "did it work").
-
-If you run this as written it will pass. Everything is good. Right?
-Well, there is still a bug here. In fact the first version of this tutorial I posted here genuinely had the bug in! So it's not completely contrived (thanks to Daryle Walker (```@CTMacUser```) for pointing this out).
-
-What is the bug? Well what is the factorial of zero?
-[The factorial of zero is one](http://mathforum.org/library/drmath/view/57128.html) - which is just one of those things you have to know (and remember!).
-
-Let's add that to the test case:
-
-```c++
-TEST_CASE( "Factorials are computed", "[factorial]" ) {
- REQUIRE( Factorial(0) == 1 );
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-}
-```
-
-Now we get a failure - something like:
-
-```
-Example.cpp:9: FAILED:
- REQUIRE( Factorial(0) == 1 )
-with expansion:
- 0 == 1
-```
-
-Note that we get the actual return value of Factorial(0) printed for us (0) - even though we used a natural expression with the == operator. That lets us immediately see what the problem is.
-
-Let's change the factorial function to:
-
-```c++
-unsigned int Factorial( unsigned int number ) {
- return number > 1 ? Factorial(number-1)*number : 1;
-}
-```
-
-Now all the tests pass.
-
-Of course there are still more issues to deal with. For example we'll hit problems when the return value starts to exceed the range of an unsigned int. With factorials that can happen quite quickly. You might want to add tests for such cases and decide how to handle them. We'll stop short of doing that here.
-
-### What did we do here?
-
-Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take a moment to consider those before we move on.
-
-1. All we did was ```#define``` one identifier and ```#include``` one header and we got everything - even an implementation of ```main()``` that will [respond to command line arguments](command-line.md#top). You can only use that ```#define``` in one implementation file, for (hopefully) obvious reasons. Once you have more than one file with unit tests in you'll just ```#include "catch.hpp"``` and go. Usually it's a good idea to have a dedicated implementation file that just has ```#define CATCH_CONFIG_MAIN``` and ```#include "catch.hpp"```. You can also provide your own implementation of main and drive Catch yourself (see [Supplying-your-own-main()](own-main.md#top)).
-2. We introduce test cases with the ```TEST_CASE``` macro. This macro takes one or two arguments - a free form test name and, optionally, one or more tags (for more see <a href="#test-cases-and-sections">Test cases and Sections</a>). The test name must be unique. You can run sets of tests by specifying a wildcarded test name or a tag expression. See the [command line docs](command-line.md#top) for more information on running tests.
-3. The name and tags arguments are just strings. We haven't had to declare a function or method - or explicitly register the test case anywhere. Behind the scenes a function with a generated name is defined for you, and automatically registered using static registry classes. By abstracting the function name away we can name our tests without the constraints of identifier names.
-4. We write our individual test assertions using the ```REQUIRE``` macro. Rather than a separate macro for each type of condition we express the condition naturally using C/C++ syntax. Behind the scenes a simple set of expression templates captures the left-hand-side and right-hand-side of the expression so we can display the values in our test report. As we'll see later there _are_ other assertion macros - but because of this technique the number of them is drastically reduced.
-
-<a id="test-cases-and-sections"></a>
-## Test cases and sections
-
-Most test frameworks have a class-based fixture mechanism. That is, test cases map to methods on a class and common setup and teardown can be performed in ```setup()``` and ```teardown()``` methods (or constructor/ destructor in languages, like C++, that support deterministic destruction).
-
-While Catch fully supports this way of working there are a few problems with the approach. In particular the way your code must be split up, and the blunt granularity of it, may cause problems. You can only have one setup/ teardown pair across a set of methods, but sometimes you want slightly different setup in each method, or you may even want several levels of setup (a concept which we will clarify later on in this tutorial). It was <a href="http://jamesnewkirk.typepad.com/posts/2007/09/why-you-should-.html">problems like these</a> that led James Newkirk, who led the team that built NUnit, to start again from scratch and <a href="http://jamesnewkirk.typepad.com/posts/2007/09/announcing-xuni.html">build xUnit</a>).
-
-Catch takes a different approach (to both NUnit and xUnit) that is a more natural fit for C++ and the C family of languages. This is best explained through an example ([code](../examples/100-Fix-Section.cpp)):
-
-```c++
-TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
-
- std::vector<int> v( 5 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "resizing bigger changes size and capacity" ) {
- v.resize( 10 );
-
- REQUIRE( v.size() == 10 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "resizing smaller changes size but not capacity" ) {
- v.resize( 0 );
-
- REQUIRE( v.size() == 0 );
- REQUIRE( v.capacity() >= 5 );
- }
- SECTION( "reserving bigger changes capacity but not size" ) {
- v.reserve( 10 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "reserving smaller does not change size or capacity" ) {
- v.reserve( 0 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
- }
-}
-```
-
-For each ```SECTION``` the ```TEST_CASE``` is executed from the start - so as we enter each section we know that size is 5 and capacity is at least 5. We enforced those requirements with the ```REQUIRE```s at the top level so we can be confident in them.
-This works because the ```SECTION``` macro contains an if statement that calls back into Catch to see if the section should be executed. One leaf section is executed on each run through a ```TEST_CASE```. The other sections are skipped. Next time through the next section is executed, and so on until no new sections are encountered.
-
-So far so good - this is already an improvement on the setup/teardown approach because now we see our setup code inline and use the stack.
-
-The power of sections really shows, however, when we need to execute a sequence of checked operations. Continuing the vector example, we might want to verify that attempting to reserve a capacity smaller than the current capacity of the vector changes nothing. We can do that, naturally, like so:
-
-```c++
- SECTION( "reserving bigger changes capacity but not size" ) {
- v.reserve( 10 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 10 );
-
- SECTION( "reserving smaller again does not change capacity" ) {
- v.reserve( 7 );
-
- REQUIRE( v.capacity() >= 10 );
- }
- }
-```
-
-Sections can be nested to an arbitrary depth (limited only by your stack size). Each leaf section (i.e. a section that contains no nested sections) will be executed exactly once, on a separate path of execution from any other leaf section (so no leaf section can interfere with another). A failure in a parent section will prevent nested sections from running - but then that's the idea.
-
-## BDD-Style
-
-If you name your test cases and sections appropriately you can achieve a BDD-style specification structure. This became such a useful way of working that first class support has been added to Catch. Scenarios can be specified using ```SCENARIO```, ```GIVEN```, ```WHEN``` and ```THEN``` macros, which map on to ```TEST_CASE```s and ```SECTION```s, respectively. For more details see [Test cases and sections](test-cases-and-sections.md#top).
-
-The vector example can be adjusted to use these macros like so ([example code](../examples/120-Bdd-ScenarioGivenWhenThen.cpp)):
-
-```c++
-SCENARIO( "vectors can be sized and resized", "[vector]" ) {
-
- GIVEN( "A vector with some items" ) {
- std::vector<int> v( 5 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
-
- WHEN( "the size is increased" ) {
- v.resize( 10 );
-
- THEN( "the size and capacity change" ) {
- REQUIRE( v.size() == 10 );
- REQUIRE( v.capacity() >= 10 );
- }
- }
- WHEN( "the size is reduced" ) {
- v.resize( 0 );
-
- THEN( "the size changes but not capacity" ) {
- REQUIRE( v.size() == 0 );
- REQUIRE( v.capacity() >= 5 );
- }
- }
- WHEN( "more capacity is reserved" ) {
- v.reserve( 10 );
-
- THEN( "the capacity changes but not the size" ) {
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 10 );
- }
- }
- WHEN( "less capacity is reserved" ) {
- v.reserve( 0 );
-
- THEN( "neither size nor capacity are changed" ) {
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
- }
- }
- }
-}
-```
-
-Conveniently, these tests will be reported as follows when run:
-
-```
-Scenario: vectors can be sized and resized
- Given: A vector with some items
- When: more capacity is reserved
- Then: the capacity changes but not the size
-```
-
-<a id="scaling-up"></a>
-## Scaling up
-
-To keep the tutorial simple we put all our code in a single file. This is fine to get started - and makes jumping into Catch even quicker and easier. As you write more real-world tests, though, this is not really the best approach.
-
-The requirement is that the following block of code ([or equivalent](own-main.md#top)):
-
-```c++
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-```
-
-appears in _exactly one_ source file. Use as many additional cpp files (or whatever you call your implementation files) as you need for your tests, partitioned however makes most sense for your way of working. Each additional file need only ```#include "catch.hpp"``` - do not repeat the ```#define```!
-
-In fact it is usually a good idea to put the block with the ```#define``` [in its own source file](slow-compiles.md#top) (code example [main](../examples/020-TestCase-1.cpp), [tests](../examples/020-TestCase-2.cpp)).
-
-Do not write your tests in header files!
-
-
-## Type parametrised test cases
-
-Test cases in Catch2 can be also parametrised by type, via the
-`TEMPLATE_TEST_CASE` and `TEMPLATE_PRODUCT_TEST_CASE` macros,
-which behave in the same way the `TEST_CASE` macro, but are run for
-every type or type combination.
-
-For more details, see our documentation on [test cases and
-sections](test-cases-and-sections.md#type-parametrised-test-cases).
-
-
-## Next steps
-
-This has been a brief introduction to get you up and running with Catch, and to point out some of the key differences between Catch and other frameworks you may already be familiar with. This will get you going quite far already and you are now in a position to dive in and write some tests.
-
-Of course there is more to learn - most of which you should be able to page-fault in as you go. Please see the ever-growing [Reference section](Readme.md#top) for what's available.
-
----
-
-[Home](Readme.md#top)
diff --git a/docs/why-catch.md b/docs/why-catch.md
deleted file mode 100644
index 86cc55bc..00000000
--- a/docs/why-catch.md
+++ /dev/null
@@ -1,46 +0,0 @@
-<a id="top"></a>
-# Why do we need yet another C++ test framework?
-
-Good question. For C++ there are quite a number of established frameworks,
-including (but not limited to),
-[Google Test](http://code.google.com/p/googletest/),
-[Boost.Test](http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/index.html),
-[CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page),
-[Cute](http://www.cute-test.com),
-[many, many more](http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B).
-
-So what does Catch bring to the party that differentiates it from these? Apart from a Catchy name, of course.
-
-## Key Features
-
-* Quick and Really easy to get started. Just download catch.hpp, `#include` it and you're away.
-* No external dependencies. As long as you can compile C++11 and have a C++ standard library available.
-* Write test cases as, self-registering, functions (or methods, if you prefer).
-* Divide test cases into sections, each of which is run in isolation (eliminates the need for fixtures).
-* Use BDD-style Given-When-Then sections as well as traditional unit test cases.
-* Only one core assertion macro for comparisons. Standard C/C++ operators are used for the comparison - yet the full expression is decomposed and lhs and rhs values are logged.
-* Tests are named using free-form strings - no more couching names in legal identifiers.
-
-## Other core features
-
-* Tests can be tagged for easily running ad-hoc groups of tests.
-* Failures can (optionally) break into the debugger on Windows and Mac.
-* Output is through modular reporter objects. Basic textual and XML reporters are included. Custom reporters can easily be added.
-* JUnit xml output is supported for integration with third-party tools, such as CI servers.
-* A default main() function is provided, but you can supply your own for complete control (e.g. integration into your own test runner GUI).
-* A command line parser is provided and can still be used if you choose to provided your own main() function.
-* Catch can test itself.
-* Alternative assertion macro(s) report failures but don't abort the test case
-* Floating point tolerance comparisons are built in using an expressive Approx() syntax.
-* Internal and friendly macros are isolated so name clashes can be managed
-* Matchers
-
-## Who else is using Catch?
-
-See the list of [open source projects using Catch](opensource-users.md#top).
-
-See the [tutorial](tutorial.md#top) to get more of a taste of using Catch in practice
-
----
-
-[Home](Readme.md#top)
diff --git a/examples/000-CatchMain.cpp b/examples/000-CatchMain.cpp
deleted file mode 100644
index 2894d425..00000000
--- a/examples/000-CatchMain.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// 000-CatchMain.cpp
-
-// In a Catch project with multiple files, dedicate one file to compile the
-// source code of Catch itself and reuse the resulting object file for linking.
-
-// Let Catch provide main():
-#define CATCH_CONFIG_MAIN
-
-#include <catch2/catch.hpp>
-
-// That's it
-
-// Compile implementation of Catch for use with files that do contain tests:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 000-CatchMain.cpp
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -c 000-CatchMain.cpp
diff --git a/examples/010-TestCase.cpp b/examples/010-TestCase.cpp
deleted file mode 100644
index c00b8a8f..00000000
--- a/examples/010-TestCase.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-// 010-TestCase.cpp
-
-// Let Catch provide main():
-#define CATCH_CONFIG_MAIN
-
-#include <catch2/catch.hpp>
-
-int Factorial( int number ) {
- return number <= 1 ? number : Factorial( number - 1 ) * number; // fail
-// return number <= 1 ? 1 : Factorial( number - 1 ) * number; // pass
-}
-
-TEST_CASE( "Factorial of 0 is 1 (fail)", "[single-file]" ) {
- REQUIRE( Factorial(0) == 1 );
-}
-
-TEST_CASE( "Factorials of 1 and higher are computed (pass)", "[single-file]" ) {
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-}
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 010-TestCase 010-TestCase.cpp && 010-TestCase --success
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 010-TestCase.cpp && 010-TestCase --success
-
-// Expected compact output (all assertions):
-//
-// prompt> 010-TestCase --reporter compact --success
-// 010-TestCase.cpp:14: failed: Factorial(0) == 1 for: 0 == 1
-// 010-TestCase.cpp:18: passed: Factorial(1) == 1 for: 1 == 1
-// 010-TestCase.cpp:19: passed: Factorial(2) == 2 for: 2 == 2
-// 010-TestCase.cpp:20: passed: Factorial(3) == 6 for: 6 == 6
-// 010-TestCase.cpp:21: passed: Factorial(10) == 3628800 for: 3628800 (0x375f00) == 3628800 (0x375f00)
-// Failed 1 test case, failed 1 assertion.
diff --git a/examples/020-TestCase-1.cpp b/examples/020-TestCase-1.cpp
deleted file mode 100644
index ab0249e4..00000000
--- a/examples/020-TestCase-1.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// 020-TestCase-1.cpp
-
-// In a Catch project with multiple files, dedicate one file to compile the
-// source code of Catch itself and reuse the resulting object file for linking.
-
-// Let Catch provide main():
-#define CATCH_CONFIG_MAIN
-
-#include <catch2/catch.hpp>
-
-TEST_CASE( "1: All test cases reside in other .cpp files (empty)", "[multi-file:1]" ) {
-}
-
-// ^^^
-// Normally no TEST_CASEs in this file.
-// Here just to show there are two source files via option --list-tests.
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 020-TestCase-1.cpp
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 020-TestCase TestCase-1.o 020-TestCase-2.cpp && 020-TestCase --success
-//
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -c 020-TestCase-1.cpp
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -Fe020-TestCase.exe 020-TestCase-1.obj 020-TestCase-2.cpp && 020-TestCase --success
-
-// Expected test case listing:
-//
-// prompt> 020-TestCase --list-tests *
-// Matching test cases:
-// 1: All test cases reside in other .cpp files (empty)
-// [multi-file:1]
-// 2: Factorial of 0 is computed (fail)
-// [multi-file:2]
-// 2: Factorials of 1 and higher are computed (pass)
-// [multi-file:2]
-// 3 matching test cases
diff --git a/examples/020-TestCase-2.cpp b/examples/020-TestCase-2.cpp
deleted file mode 100644
index 08b313e0..00000000
--- a/examples/020-TestCase-2.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// 020-TestCase-2.cpp
-
-// main() provided by Catch in file 020-TestCase-1.cpp.
-
-#include <catch2/catch.hpp>
-
-int Factorial( int number ) {
- return number <= 1 ? number : Factorial( number - 1 ) * number; // fail
-// return number <= 1 ? 1 : Factorial( number - 1 ) * number; // pass
-}
-
-TEST_CASE( "2: Factorial of 0 is 1 (fail)", "[multi-file:2]" ) {
- REQUIRE( Factorial(0) == 1 );
-}
-
-TEST_CASE( "2: Factorials of 1 and higher are computed (pass)", "[multi-file:2]" ) {
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-}
-
-// Compile: see 020-TestCase-1.cpp
-
-// Expected compact output (all assertions):
-//
-// prompt> 020-TestCase --reporter compact --success
-// 020-TestCase-2.cpp:13: failed: Factorial(0) == 1 for: 0 == 1
-// 020-TestCase-2.cpp:17: passed: Factorial(1) == 1 for: 1 == 1
-// 020-TestCase-2.cpp:18: passed: Factorial(2) == 2 for: 2 == 2
-// 020-TestCase-2.cpp:19: passed: Factorial(3) == 6 for: 6 == 6
-// 020-TestCase-2.cpp:20: passed: Factorial(10) == 3628800 for: 3628800 (0x375f00) == 3628800 (0x375f00)
-// Failed 1 test case, failed 1 assertion.
diff --git a/examples/030-Asn-Require-Check.cpp b/examples/030-Asn-Require-Check.cpp
deleted file mode 100644
index f814a1b3..00000000
--- a/examples/030-Asn-Require-Check.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// 030-Asn-Require-Check.cpp
-
-// Catch has two natural expression assertion macro's:
-// - REQUIRE() stops at first failure.
-// - CHECK() continues after failure.
-
-// There are two variants to support decomposing negated expressions:
-// - REQUIRE_FALSE() stops at first failure.
-// - CHECK_FALSE() continues after failure.
-
-// main() provided in 000-CatchMain.cpp
-
-#include <catch2/catch.hpp>
-
-std::string one() {
- return "1";
-}
-
-TEST_CASE( "Assert that something is true (pass)", "[require]" ) {
- REQUIRE( one() == "1" );
-}
-
-TEST_CASE( "Assert that something is true (fail)", "[require]" ) {
- REQUIRE( one() == "x" );
-}
-
-TEST_CASE( "Assert that something is true (stop at first failure)", "[require]" ) {
- WARN( "REQUIRE stops at first failure:" );
-
- REQUIRE( one() == "x" );
- REQUIRE( one() == "1" );
-}
-
-TEST_CASE( "Assert that something is true (continue after failure)", "[check]" ) {
- WARN( "CHECK continues after failure:" );
-
- CHECK( one() == "x" );
- REQUIRE( one() == "1" );
-}
-
-TEST_CASE( "Assert that something is false (stops at first failure)", "[require-false]" ) {
- WARN( "REQUIRE_FALSE stops at first failure:" );
-
- REQUIRE_FALSE( one() == "1" );
- REQUIRE_FALSE( one() != "1" );
-}
-
-TEST_CASE( "Assert that something is false (continue after failure)", "[check-false]" ) {
- WARN( "CHECK_FALSE continues after failure:" );
-
- CHECK_FALSE( one() == "1" );
- REQUIRE_FALSE( one() != "1" );
-}
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 030-Asn-Require-Check 030-Asn-Require-Check.cpp 000-CatchMain.o && 030-Asn-Require-Check --success
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 030-Asn-Require-Check.cpp 000-CatchMain.obj && 030-Asn-Require-Check --success
-
-// Expected compact output (all assertions):
-//
-// prompt> 030-Asn-Require-Check.exe --reporter compact --success
-// 030-Asn-Require-Check.cpp:20: passed: one() == "1" for: "1" == "1"
-// 030-Asn-Require-Check.cpp:24: failed: one() == "x" for: "1" == "x"
-// 030-Asn-Require-Check.cpp:28: warning: 'REQUIRE stops at first failure:'
-// 030-Asn-Require-Check.cpp:30: failed: one() == "x" for: "1" == "x"
-// 030-Asn-Require-Check.cpp:35: warning: 'CHECK continues after failure:'
-// 030-Asn-Require-Check.cpp:37: failed: one() == "x" for: "1" == "x"
-// 030-Asn-Require-Check.cpp:38: passed: one() == "1" for: "1" == "1"
-// 030-Asn-Require-Check.cpp:42: warning: 'REQUIRE_FALSE stops at first failure:'
-// 030-Asn-Require-Check.cpp:44: failed: !(one() == "1") for: !("1" == "1")
-// 030-Asn-Require-Check.cpp:49: warning: 'CHECK_FALSE continues after failure:'
-// 030-Asn-Require-Check.cpp:51: failed: !(one() == "1") for: !("1" == "1")
-// 030-Asn-Require-Check.cpp:52: passed: !(one() != "1") for: !("1" != "1")
-// Failed 5 test cases, failed 5 assertions.
diff --git a/examples/100-Fix-Section.cpp b/examples/100-Fix-Section.cpp
deleted file mode 100644
index d0b9f2da..00000000
--- a/examples/100-Fix-Section.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// 100-Fix-Section.cpp
-
-// Catch has two ways to express fixtures:
-// - Sections (this file)
-// - Traditional class-based fixtures
-
-// main() provided in 000-CatchMain.cpp
-
-#include <catch2/catch.hpp>
-
-TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
-
- // For each section, vector v is anew:
-
- std::vector<int> v( 5 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "resizing bigger changes size and capacity" ) {
- v.resize( 10 );
-
- REQUIRE( v.size() == 10 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "resizing smaller changes size but not capacity" ) {
- v.resize( 0 );
-
- REQUIRE( v.size() == 0 );
- REQUIRE( v.capacity() >= 5 );
- }
- SECTION( "reserving bigger changes capacity but not size" ) {
- v.reserve( 10 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "reserving smaller does not change size or capacity" ) {
- v.reserve( 0 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
- }
-}
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 100-Fix-Section 100-Fix-Section.cpp 000-CatchMain.o && 100-Fix-Section --success
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 100-Fix-Section.cpp 000-CatchMain.obj && 100-Fix-Section --success
-
-// Expected compact output (all assertions):
-//
-// prompt> 100-Fix-Section.exe --reporter compact --success
-// 100-Fix-Section.cpp:17: passed: v.size() == 5 for: 5 == 5
-// 100-Fix-Section.cpp:18: passed: v.capacity() >= 5 for: 5 >= 5
-// 100-Fix-Section.cpp:23: passed: v.size() == 10 for: 10 == 10
-// 100-Fix-Section.cpp:24: passed: v.capacity() >= 10 for: 10 >= 10
-// 100-Fix-Section.cpp:17: passed: v.size() == 5 for: 5 == 5
-// 100-Fix-Section.cpp:18: passed: v.capacity() >= 5 for: 5 >= 5
-// 100-Fix-Section.cpp:29: passed: v.size() == 0 for: 0 == 0
-// 100-Fix-Section.cpp:30: passed: v.capacity() >= 5 for: 5 >= 5
-// 100-Fix-Section.cpp:17: passed: v.size() == 5 for: 5 == 5
-// 100-Fix-Section.cpp:18: passed: v.capacity() >= 5 for: 5 >= 5
-// 100-Fix-Section.cpp:35: passed: v.size() == 5 for: 5 == 5
-// 100-Fix-Section.cpp:36: passed: v.capacity() >= 10 for: 10 >= 10
-// 100-Fix-Section.cpp:17: passed: v.size() == 5 for: 5 == 5
-// 100-Fix-Section.cpp:18: passed: v.capacity() >= 5 for: 5 >= 5
-// 100-Fix-Section.cpp:41: passed: v.size() == 5 for: 5 == 5
-// 100-Fix-Section.cpp:42: passed: v.capacity() >= 5 for: 5 >= 5
-// Passed 1 test case with 16 assertions.
diff --git a/examples/110-Fix-ClassFixture.cpp b/examples/110-Fix-ClassFixture.cpp
deleted file mode 100644
index e42fd175..00000000
--- a/examples/110-Fix-ClassFixture.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// 110-Fix-ClassFixture.cpp
-
-// Catch has two ways to express fixtures:
-// - Sections
-// - Traditional class-based fixtures (this file)
-
-// main() provided in 000-CatchMain.cpp
-
-#include <catch2/catch.hpp>
-
-class DBConnection
-{
-public:
- static DBConnection createConnection( std::string const & /*dbName*/ ) {
- return DBConnection();
- }
-
- bool executeSQL( std::string const & /*query*/, int const /*id*/, std::string const & arg ) {
- if ( arg.length() == 0 ) {
- throw std::logic_error("empty SQL query argument");
- }
- return true; // ok
- }
-};
-
-class UniqueTestsFixture
-{
-protected:
- UniqueTestsFixture()
- : conn( DBConnection::createConnection( "myDB" ) )
- {}
-
- int getID() {
- return ++uniqueID;
- }
-
-protected:
- DBConnection conn;
-
-private:
- static int uniqueID;
-};
-
-int UniqueTestsFixture::uniqueID = 0;
-
-TEST_CASE_METHOD( UniqueTestsFixture, "Create Employee/No Name", "[create]" ) {
- REQUIRE_THROWS( conn.executeSQL( "INSERT INTO employee (id, name) VALUES (?, ?)", getID(), "") );
-}
-
-TEST_CASE_METHOD( UniqueTestsFixture, "Create Employee/Normal", "[create]" ) {
- REQUIRE( conn.executeSQL( "INSERT INTO employee (id, name) VALUES (?, ?)", getID(), "Joe Bloggs" ) );
-}
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 110-Fix-ClassFixture 110-Fix-ClassFixture.cpp 000-CatchMain.o && 110-Fix-ClassFixture --success
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 110-Fix-ClassFixture.cpp 000-CatchMain.obj && 110-Fix-ClassFixture --success
-
-// Expected compact output (all assertions):
-//
-// prompt> 110-Fix-ClassFixture.exe --reporter compact --success
-// 110-Fix-ClassFixture.cpp:47: passed: conn.executeSQL( "INSERT INTO employee (id, name) VALUES (?, ?)", getID(), "")
-// 110-Fix-ClassFixture.cpp:51: passed: conn.executeSQL( "INSERT INTO employee (id, name) VALUES (?, ?)", getID(), "Joe Bloggs" ) for: true
-// Passed both 2 test cases with 2 assertions.
diff --git a/examples/120-Bdd-ScenarioGivenWhenThen.cpp b/examples/120-Bdd-ScenarioGivenWhenThen.cpp
deleted file mode 100644
index d1b9ce55..00000000
--- a/examples/120-Bdd-ScenarioGivenWhenThen.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// 120-Bdd-ScenarioGivenWhenThen.cpp
-
-// main() provided in 000-CatchMain.cpp
-
-#include <catch2/catch.hpp>
-
-SCENARIO( "vectors can be sized and resized", "[vector]" ) {
-
- GIVEN( "A vector with some items" ) {
- std::vector<int> v( 5 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
-
- WHEN( "the size is increased" ) {
- v.resize( 10 );
-
- THEN( "the size and capacity change" ) {
- REQUIRE( v.size() == 10 );
- REQUIRE( v.capacity() >= 10 );
- }
- }
- WHEN( "the size is reduced" ) {
- v.resize( 0 );
-
- THEN( "the size changes but not capacity" ) {
- REQUIRE( v.size() == 0 );
- REQUIRE( v.capacity() >= 5 );
- }
- }
- WHEN( "more capacity is reserved" ) {
- v.reserve( 10 );
-
- THEN( "the capacity changes but not the size" ) {
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 10 );
- }
- }
- WHEN( "less capacity is reserved" ) {
- v.reserve( 0 );
-
- THEN( "neither size nor capacity are changed" ) {
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
- }
- }
- }
-}
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 120-Bdd-ScenarioGivenWhenThen 120-Bdd-ScenarioGivenWhenThen.cpp 000-CatchMain.o && 120-Bdd-ScenarioGivenWhenThen --success
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 120-Bdd-ScenarioGivenWhenThen.cpp 000-CatchMain.obj && 120-Bdd-ScenarioGivenWhenThen --success
-
-// Expected compact output (all assertions):
-//
-// prompt> 120-Bdd-ScenarioGivenWhenThen.exe --reporter compact --success
-// 120-Bdd-ScenarioGivenWhenThen.cpp:12: passed: v.size() == 5 for: 5 == 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:13: passed: v.capacity() >= 5 for: 5 >= 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:19: passed: v.size() == 10 for: 10 == 10
-// 120-Bdd-ScenarioGivenWhenThen.cpp:20: passed: v.capacity() >= 10 for: 10 >= 10
-// 120-Bdd-ScenarioGivenWhenThen.cpp:12: passed: v.size() == 5 for: 5 == 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:13: passed: v.capacity() >= 5 for: 5 >= 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:27: passed: v.size() == 0 for: 0 == 0
-// 120-Bdd-ScenarioGivenWhenThen.cpp:28: passed: v.capacity() >= 5 for: 5 >= 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:12: passed: v.size() == 5 for: 5 == 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:13: passed: v.capacity() >= 5 for: 5 >= 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:35: passed: v.size() == 5 for: 5 == 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:36: passed: v.capacity() >= 10 for: 10 >= 10
-// 120-Bdd-ScenarioGivenWhenThen.cpp:12: passed: v.size() == 5 for: 5 == 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:13: passed: v.capacity() >= 5 for: 5 >= 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:43: passed: v.size() == 5 for: 5 == 5
-// 120-Bdd-ScenarioGivenWhenThen.cpp:44: passed: v.capacity() >= 5 for: 5 >= 5
-// Passed 1 test case with 16 assertions.
diff --git a/examples/200-Rpt-CatchMain.cpp b/examples/200-Rpt-CatchMain.cpp
deleted file mode 100644
index b84c804d..00000000
--- a/examples/200-Rpt-CatchMain.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// 200-Rpt-CatchMain.cpp
-
-// In a Catch project with multiple files, dedicate one file to compile the
-// source code of Catch itself and reuse the resulting object file for linking.
-
-// Let Catch provide main():
-#define CATCH_CONFIG_MAIN
-
-#include <catch2/catch.hpp>
-
-#ifdef CATCH_EXAMPLE_RPT_1
-#include CATCH_EXAMPLE_RPT_1
-#endif
-
-#ifdef CATCH_EXAMPLE_RPT_2
-#include CATCH_EXAMPLE_RPT_2
-#endif
-
-#ifdef CATCH_EXAMPLE_RPT_3
-#include CATCH_EXAMPLE_RPT_3
-#endif
-
-// That's it
-
-// Compile implementation of Catch for use with files that do contain tests:
-// - g++ -std=c++11 -Wall -I$(CATCH_ROOT) -DCATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_teamcity.hpp\" -o 200-Rpt-CatchMainTeamCity.o -c 200-Rpt-CatchMain.cpp
-// cl -EHsc -I%CATCH_ROOT% -DCATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_teamcity.hpp\" -Fo200-Rpt-CatchMainTeamCity.obj -c 200-Rpt-CatchMain.cpp
diff --git a/examples/207-Rpt-TeamCityReporter.cpp b/examples/207-Rpt-TeamCityReporter.cpp
deleted file mode 100644
index d28460f4..00000000
--- a/examples/207-Rpt-TeamCityReporter.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-// 207-Rpt-TeamCityReporter.cpp
-
-// Catch has built-in and external reporters:
-// Built-in:
-// - compact
-// - console
-// - junit
-// - xml
-// External:
-// - automake
-// - tap
-// - teamcity (this example)
-
-// main() and reporter code provided in 200-Rpt-CatchMain.cpp
-
-#include <catch2/catch.hpp>
-
-#ifdef _MSC_VER
-# pragma warning (disable : 4702) // Disable warning: unreachable code
-#endif
-
-TEST_CASE( "TeamCity passes unconditionally succeeding assertion", "[teamcity]" ) {
-
- SUCCEED();
-}
-
-TEST_CASE( "TeamCity reports unconditionally failing assertion", "[teamcity]" ) {
-
- FAIL();
-}
-
-TEST_CASE( "TeamCity reports failing check", "[teamcity]" ) {
-
- REQUIRE( 3 == 7 );
-}
-
-TEST_CASE( "TeamCity reports failing check-false", "[teamcity]" ) {
-
- REQUIRE_FALSE( 3 == 3 );
-}
-
-TEST_CASE( "TeamCity reports failing check-that", "[teamcity]" ) {
-
- using namespace Catch;
-
- REQUIRE_THAT( "hello", Contains( "world" ) );
-}
-
-TEST_CASE( "TeamCity reports unexpected exception", "[teamcity]" ) {
-
- REQUIRE( (throw std::runtime_error("surprise!"), true) );
-}
-
-TEST_CASE( "TeamCity reports undesired exception", "[teamcity]" ) {
-
- REQUIRE_NOTHROW( (throw std::runtime_error("surprise!"), true) );
-}
-
-TEST_CASE( "TeamCity reports missing expected exception", "[teamcity]" ) {
-
- REQUIRE_THROWS( true );
-}
-
-TEST_CASE( "TeamCity reports missing specific expected exception", "[teamcity]" ) {
-
- REQUIRE_THROWS_AS( throw std::bad_alloc(), std::runtime_error );
-}
-
-TEST_CASE( "TeamCity reports unexpected message in expected exception", "[teamcity]" ) {
-
- using namespace Catch;
-
- CHECK_THROWS_WITH( throw std::runtime_error("hello"), "world" );
- CHECK_THROWS_WITH( throw std::runtime_error("hello"), Contains("world") );
-}
-
-struct MyException: public std::runtime_error
-{
- MyException( char const * text )
- : std::runtime_error( text ) {}
-
- ~MyException() override;
-};
-
-// prevent -Wweak-vtables:
-MyException::~MyException() = default;
-
-struct MyExceptionMatcher : Catch::MatcherBase< std::runtime_error >
-{
- std::string m_text;
-
- MyExceptionMatcher( char const * text )
- : m_text( text )
- {}
-
- ~MyExceptionMatcher() override;
-
- bool match( std::runtime_error const & arg ) const override
- {
- return m_text == arg.what() ;
- }
-
- std::string describe() const override
- {
- return "it's me";
- }
-};
-
-// prevent -Wweak-vtables:
-MyExceptionMatcher::~MyExceptionMatcher() = default;
-
-TEST_CASE( "TeamCity failing check-throws-matches", "[teamcity]" ) {
-
- CHECK_THROWS_MATCHES( throw MyException("hello"), MyException, MyExceptionMatcher("world") );
-}
-
-// [!throws] - lets Catch know that this test is likely to throw an exception even if successful.
-// This causes the test to be excluded when running with -e or --nothrow.
-
-// No special effects for the reporter.
-
-TEST_CASE( "TeamCity throwing exception with tag [!throws]", "[teamcity][!throws]" ) {
-
- REQUIRE_THROWS( throw std::runtime_error("unsurprisingly") );
-}
-
-// [!mayfail] - doesn't fail the test if any given assertion fails (but still reports it). This can be useful to flag a work-in-progress, or a known issue that you don't want to immediately fix but still want to track in your tests.
-
-TEST_CASE( "TeamCity failing assertion with tag [!mayfail]", "[teamcity][!mayfail] " ) {
-
- REQUIRE( 3 == 7 ); // doesn't fail test case this time, reports: testIgnored
- REQUIRE( 3 == 3 );
-}
-
-// [!shouldfail] - like [!mayfail] but fails the test if it passes.
-// This can be useful if you want to be notified of accidental, or third-party, fixes.
-
-TEST_CASE( "TeamCity succeeding assertion with tag [!shouldfail]", "[teamcity][!shouldfail]" ) {
-
- SUCCEED( "Marked [!shouldfail]" );
-}
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_ROOT) -DCATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_teamcity.hpp\" -o 200-Rpt-CatchMainTeamCity.o -c 200-Rpt-CatchMain.cpp
-// - g++ -std=c++11 -Wall -I$(CATCH_ROOT) -o 207-Rpt-TeamCityReporter 207-Rpt-TeamCityReporter.cpp 200-Rpt-CatchMainTeamCity.o && 207-Rpt-TeamCityReporter --list-reporters
-//
-// - cl -EHsc -I%CATCH_ROOT% -DCATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_teamcity.hpp\" -Fo200-Rpt-CatchMainTeamCity.obj -c 200-Rpt-CatchMain.cpp
-// - cl -EHsc -I%CATCH_ROOT% 207-Rpt-TeamCityReporter.cpp 200-Rpt-CatchMainTeamCity.o && 207-Rpt-TeamCityReporter --list-reporters
-
-// Compilation output (--list-reporters):
-// Available reporters:
-// compact: Reports test results on a single line, suitable for IDEs
-// console: Reports test results as plain lines of text
-// junit: Reports test results in an XML format that looks like Ant's
-// junitreport target
-// teamcity: Reports test results as TeamCity service messages
-// xml: Reports test results as an XML document
-
-// Expected output (abbreviated and broken into shorter lines):
-//
-// prompt> 207-Rpt-TeamCityReporter.exe --reporter teamcity
-// ##teamcity[testSuiteStarted name='207-Rpt-TeamCityReporter.exe']
-// ##teamcity[testStarted name='TeamCity passes unconditionally succeeding assertion']
-// ##teamcity[testFinished name='TeamCity passes unconditionally succeeding assertion' duration='1']
-// ##teamcity[testStarted name='TeamCity reports unconditionally failing assertion']
-// ##teamcity[testFailed name='TeamCity reports unconditionally failing assertion' /
-// message='.../examples/207-Rpt-TeamCityReporter.cpp:23|n/
-// ...............................................................................|n|n/
-// .../examples/207-Rpt-TeamCityReporter.cpp:25|nexplicit failure']
-// ##teamcity[testFinished name='TeamCity reports unconditionally failing assertion' duration='3']
-// ...
diff --git a/examples/210-Evt-EventListeners.cpp b/examples/210-Evt-EventListeners.cpp
deleted file mode 100644
index 044a29e3..00000000
--- a/examples/210-Evt-EventListeners.cpp
+++ /dev/null
@@ -1,422 +0,0 @@
-// 210-Evt-EventListeners.cpp
-
-// Contents:
-// 1. Printing of listener data
-// 2. My listener and registration
-// 3. Test cases
-
-// main() provided in 000-CatchMain.cpp
-
-// Let Catch provide the required interfaces:
-#define CATCH_CONFIG_EXTERNAL_INTERFACES
-
-#include <catch2/catch.hpp>
-#include <iostream>
-
-// -----------------------------------------------------------------------
-// 1. Printing of listener data:
-//
-
-std::string ws(int const level) {
- return std::string( 2 * level, ' ' );
-}
-
-template< typename T >
-std::ostream& operator<<( std::ostream& os, std::vector<T> const& v ) {
- os << "{ ";
- for ( const auto& x : v )
- os << x << ", ";
- return os << "}";
-}
-
-// struct SourceLineInfo {
-// char const* file;
-// std::size_t line;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::SourceLineInfo const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- file: " << info.file << "\n"
- << ws(level+1) << "- line: " << info.line << "\n";
-}
-
-//struct MessageInfo {
-// std::string macroName;
-// std::string message;
-// SourceLineInfo lineInfo;
-// ResultWas::OfType type;
-// unsigned int sequence;
-//};
-
-void print( std::ostream& os, int const level, Catch::MessageInfo const& info ) {
- os << ws(level+1) << "- macroName: '" << info.macroName << "'\n"
- << ws(level+1) << "- message '" << info.message << "'\n";
- print( os,level+1 , "- lineInfo", info.lineInfo );
- os << ws(level+1) << "- sequence " << info.sequence << "\n";
-}
-
-void print( std::ostream& os, int const level, std::string const& title, std::vector<Catch::MessageInfo> const& v ) {
- os << ws(level ) << title << ":\n";
- for ( const auto& x : v )
- {
- os << ws(level+1) << "{\n";
- print( os, level+2, x );
- os << ws(level+1) << "}\n";
- }
-// os << ws(level+1) << "\n";
-}
-
-// struct TestRunInfo {
-// std::string name;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::TestRunInfo const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- name: " << info.name << "\n";
-}
-
-// struct Counts {
-// std::size_t total() const;
-// bool allPassed() const;
-// bool allOk() const;
-//
-// std::size_t passed = 0;
-// std::size_t failed = 0;
-// std::size_t failedButOk = 0;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::Counts const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- total(): " << info.total() << "\n"
- << ws(level+1) << "- allPassed(): " << info.allPassed() << "\n"
- << ws(level+1) << "- allOk(): " << info.allOk() << "\n"
- << ws(level+1) << "- passed: " << info.passed << "\n"
- << ws(level+1) << "- failed: " << info.failed << "\n"
- << ws(level+1) << "- failedButOk: " << info.failedButOk << "\n";
-}
-
-// struct Totals {
-// Counts assertions;
-// Counts testCases;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::Totals const& info ) {
- os << ws(level) << title << ":\n";
- print( os, level+1, "- assertions", info.assertions );
- print( os, level+1, "- testCases" , info.testCases );
-}
-
-// struct TestRunStats {
-// TestRunInfo runInfo;
-// Totals totals;
-// bool aborting;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::TestRunStats const& info ) {
- os << ws(level) << title << ":\n";
- print( os, level+1 , "- runInfo", info.runInfo );
- print( os, level+1 , "- totals" , info.totals );
- os << ws(level+1) << "- aborting: " << info.aborting << "\n";
-}
-
-// struct TestCaseInfo {
-// enum SpecialProperties{
-// None = 0,
-// IsHidden = 1 << 1,
-// ShouldFail = 1 << 2,
-// MayFail = 1 << 3,
-// Throws = 1 << 4,
-// NonPortable = 1 << 5,
-// Benchmark = 1 << 6
-// };
-//
-// bool isHidden() const;
-// bool throws() const;
-// bool okToFail() const;
-// bool expectedToFail() const;
-//
-// std::string tagsAsString() const;
-//
-// std::string name;
-// std::string className;
-// std::string description;
-// std::vector<std::string> tags;
-// std::vector<std::string> lcaseTags;
-// SourceLineInfo lineInfo;
-// SpecialProperties properties;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::TestCaseInfo const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- isHidden(): " << info.isHidden() << "\n"
- << ws(level+1) << "- throws(): " << info.throws() << "\n"
- << ws(level+1) << "- okToFail(): " << info.okToFail() << "\n"
- << ws(level+1) << "- expectedToFail(): " << info.expectedToFail() << "\n"
- << ws(level+1) << "- tagsAsString(): '" << info.tagsAsString() << "'\n"
- << ws(level+1) << "- name: '" << info.name << "'\n"
- << ws(level+1) << "- className: '" << info.className << "'\n"
- << ws(level+1) << "- description: '" << info.description << "'\n"
- << ws(level+1) << "- tags: " << info.tags << "\n"
- << ws(level+1) << "- lcaseTags: " << info.lcaseTags << "\n";
- print( os, level+1 , "- lineInfo", info.lineInfo );
- os << ws(level+1) << "- properties (flags): 0x" << std::hex << info.properties << std::dec << "\n";
-}
-
-// struct TestCaseStats {
-// TestCaseInfo testInfo;
-// Totals totals;
-// std::string stdOut;
-// std::string stdErr;
-// bool aborting;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::TestCaseStats const& info ) {
- os << ws(level ) << title << ":\n";
- print( os, level+1 , "- testInfo", info.testInfo );
- print( os, level+1 , "- totals" , info.totals );
- os << ws(level+1) << "- stdOut: " << info.stdOut << "\n"
- << ws(level+1) << "- stdErr: " << info.stdErr << "\n"
- << ws(level+1) << "- aborting: " << info.aborting << "\n";
-}
-
-// struct SectionInfo {
-// std::string name;
-// std::string description;
-// SourceLineInfo lineInfo;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::SectionInfo const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- name: " << info.name << "\n";
- print( os, level+1 , "- lineInfo", info.lineInfo );
-}
-
-// struct SectionStats {
-// SectionInfo sectionInfo;
-// Counts assertions;
-// double durationInSeconds;
-// bool missingAssertions;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::SectionStats const& info ) {
- os << ws(level ) << title << ":\n";
- print( os, level+1 , "- sectionInfo", info.sectionInfo );
- print( os, level+1 , "- assertions" , info.assertions );
- os << ws(level+1) << "- durationInSeconds: " << info.durationInSeconds << "\n"
- << ws(level+1) << "- missingAssertions: " << info.missingAssertions << "\n";
-}
-
-// struct AssertionInfo
-// {
-// StringRef macroName;
-// SourceLineInfo lineInfo;
-// StringRef capturedExpression;
-// ResultDisposition::Flags resultDisposition;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionInfo const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- macroName: '" << info.macroName << "'\n";
- print( os, level+1 , "- lineInfo" , info.lineInfo );
- os << ws(level+1) << "- capturedExpression: '" << info.capturedExpression << "'\n"
- << ws(level+1) << "- resultDisposition (flags): 0x" << std::hex << info.resultDisposition << std::dec << "\n";
-}
-
-//struct AssertionResultData
-//{
-// std::string reconstructExpression() const;
-//
-// std::string message;
-// mutable std::string reconstructedExpression;
-// LazyExpression lazyExpression;
-// ResultWas::OfType resultType;
-//};
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionResultData const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- reconstructExpression(): '" << info.reconstructExpression() << "'\n"
- << ws(level+1) << "- message: '" << info.message << "'\n"
- << ws(level+1) << "- lazyExpression: '" << "(info.lazyExpression)" << "'\n"
- << ws(level+1) << "- resultType: '" << info.resultType << "'\n";
-}
-
-//class AssertionResult {
-// bool isOk() const;
-// bool succeeded() const;
-// ResultWas::OfType getResultType() const;
-// bool hasExpression() const;
-// bool hasMessage() const;
-// std::string getExpression() const;
-// std::string getExpressionInMacro() const;
-// bool hasExpandedExpression() const;
-// std::string getExpandedExpression() const;
-// std::string getMessage() const;
-// SourceLineInfo getSourceInfo() const;
-// std::string getTestMacroName() const;
-//
-// AssertionInfo m_info;
-// AssertionResultData m_resultData;
-//};
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionResult const& info ) {
- os << ws(level ) << title << ":\n"
- << ws(level+1) << "- isOk(): " << info.isOk() << "\n"
- << ws(level+1) << "- succeeded(): " << info.succeeded() << "\n"
- << ws(level+1) << "- getResultType(): " << info.getResultType() << "\n"
- << ws(level+1) << "- hasExpression(): " << info.hasExpression() << "\n"
- << ws(level+1) << "- hasMessage(): " << info.hasMessage() << "\n"
- << ws(level+1) << "- getExpression(): '" << info.getExpression() << "'\n"
- << ws(level+1) << "- getExpressionInMacro(): '" << info.getExpressionInMacro() << "'\n"
- << ws(level+1) << "- hasExpandedExpression(): " << info.hasExpandedExpression() << "\n"
- << ws(level+1) << "- getExpandedExpression(): " << info.getExpandedExpression() << "'\n"
- << ws(level+1) << "- getMessage(): '" << info.getMessage() << "'\n";
- print( os, level+1 , "- getSourceInfo(): ", info.getSourceInfo() );
- os << ws(level+1) << "- getTestMacroName(): '" << info.getTestMacroName() << "'\n";
-
-// print( os, level+1 , "- *** m_info (AssertionInfo)", info.m_info );
-// print( os, level+1 , "- *** m_resultData (AssertionResultData)", info.m_resultData );
-}
-
-// struct AssertionStats {
-// AssertionResult assertionResult;
-// std::vector<MessageInfo> infoMessages;
-// Totals totals;
-// };
-
-void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionStats const& info ) {
- os << ws(level ) << title << ":\n";
- print( os, level+1 , "- assertionResult", info.assertionResult );
- print( os, level+1 , "- infoMessages", info.infoMessages );
- print( os, level+1 , "- totals", info.totals );
-}
-
-// -----------------------------------------------------------------------
-// 2. My listener and registration:
-//
-
-char const * dashed_line =
- "--------------------------------------------------------------------------";
-
-struct MyListener : Catch::TestEventListenerBase {
-
- using TestEventListenerBase::TestEventListenerBase; // inherit constructor
-
- // Get rid of Wweak-tables
- ~MyListener();
-
- // The whole test run starting
- void testRunStarting( Catch::TestRunInfo const& testRunInfo ) override {
- std::cout
- << std::boolalpha
- << "\nEvent: testRunStarting:\n";
- print( std::cout, 1, "- testRunInfo", testRunInfo );
- }
-
- // The whole test run ending
- void testRunEnded( Catch::TestRunStats const& testRunStats ) override {
- std::cout
- << dashed_line
- << "\nEvent: testRunEnded:\n";
- print( std::cout, 1, "- testRunStats", testRunStats );
- }
-
- // A test is being skipped (because it is "hidden")
- void skipTest( Catch::TestCaseInfo const& testInfo ) override {
- std::cout
- << dashed_line
- << "\nEvent: skipTest:\n";
- print( std::cout, 1, "- testInfo", testInfo );
- }
-
- // Test cases starting
- void testCaseStarting( Catch::TestCaseInfo const& testInfo ) override {
- std::cout
- << dashed_line
- << "\nEvent: testCaseStarting:\n";
- print( std::cout, 1, "- testInfo", testInfo );
- }
-
- // Test cases ending
- void testCaseEnded( Catch::TestCaseStats const& testCaseStats ) override {
- std::cout << "\nEvent: testCaseEnded:\n";
- print( std::cout, 1, "testCaseStats", testCaseStats );
- }
-
- // Sections starting
- void sectionStarting( Catch::SectionInfo const& sectionInfo ) override {
- std::cout << "\nEvent: sectionStarting:\n";
- print( std::cout, 1, "- sectionInfo", sectionInfo );
- }
-
- // Sections ending
- void sectionEnded( Catch::SectionStats const& sectionStats ) override {
- std::cout << "\nEvent: sectionEnded:\n";
- print( std::cout, 1, "- sectionStats", sectionStats );
- }
-
- // Assertions before/ after
- void assertionStarting( Catch::AssertionInfo const& assertionInfo ) override {
- std::cout << "\nEvent: assertionStarting:\n";
- print( std::cout, 1, "- assertionInfo", assertionInfo );
- }
-
- bool assertionEnded( Catch::AssertionStats const& assertionStats ) override {
- std::cout << "\nEvent: assertionEnded:\n";
- print( std::cout, 1, "- assertionStats", assertionStats );
- return true;
- }
-};
-
-CATCH_REGISTER_LISTENER( MyListener )
-
-// Get rid of Wweak-tables
-MyListener::~MyListener() {}
-
-
-// -----------------------------------------------------------------------
-// 3. Test cases:
-//
-
-TEST_CASE( "1: Hidden testcase", "[.hidden]" ) {
-}
-
-TEST_CASE( "2: Testcase with sections", "[tag-A][tag-B]" ) {
-
- int i = 42;
-
- REQUIRE( i == 42 );
-
- SECTION("Section 1") {
- INFO("Section 1");
- i = 7;
- SECTION("Section 1.1") {
- INFO("Section 1.1");
- REQUIRE( i == 42 );
- }
- }
-
- SECTION("Section 2") {
- INFO("Section 2");
- REQUIRE( i == 42 );
- }
- WARN("At end of test case");
-}
-
-struct Fixture {
- int fortytwo() const {
- return 42;
- }
-};
-
-TEST_CASE_METHOD( Fixture, "3: Testcase with class-based fixture", "[tag-C][tag-D]" ) {
- REQUIRE( fortytwo() == 42 );
-}
-
-// Compile & run:
-// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 210-Evt-EventListeners 210-Evt-EventListeners.cpp 000-CatchMain.o && 210-Evt-EventListeners --success
-// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 210-Evt-EventListeners.cpp 000-CatchMain.obj && 210-Evt-EventListeners --success
-
-// Expected compact output (all assertions):
-//
-// prompt> 210-Evt-EventListeners --reporter compact --success
-// result omitted for brevity.
diff --git a/examples/231-Cfg-OutputStreams.cpp b/examples/231-Cfg-OutputStreams.cpp
deleted file mode 100644
index 8c65cc44..00000000
--- a/examples/231-Cfg-OutputStreams.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// 231-Cfg-OutputStreams.cpp
-// Show how to replace the streams with a simple custom made streambuf.
-
-// Note that this reimplementation _does not_ follow `std::cerr`
-// semantic, because it buffers the output. For most uses however,
-// there is no important difference between having `std::cerr` buffered
-// or unbuffered.
-
-#define CATCH_CONFIG_NOSTDOUT
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-
-class out_buff : public std::stringbuf {
- std::FILE* m_stream;
-public:
- out_buff(std::FILE* stream):m_stream(stream) {}
- ~out_buff();
- int sync() override {
- int ret = 0;
- for (unsigned char c : str()) {
- if (putc(c, m_stream) == EOF) {
- ret = -1;
- break;
- }
- }
- // Reset the buffer to avoid printing it multiple times
- str("");
- return ret;
- }
-};
-
-out_buff::~out_buff() { pubsync(); }
-
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wexit-time-destructors" // static variables in cout/cerr/clog
-#endif
-
-namespace Catch {
- std::ostream& cout() {
- static std::ostream ret(new out_buff(stdout));
- return ret;
- }
- std::ostream& clog() {
- static std::ostream ret(new out_buff(stderr));
- return ret;
- }
- std::ostream& cerr() {
- return clog();
- }
-}
-
-
-TEST_CASE("This binary uses putc to write out output", "[compilation-only]") {
- SUCCEED("Nothing to test.");
-}
diff --git a/examples/300-Gen-OwnGenerator.cpp b/examples/300-Gen-OwnGenerator.cpp
deleted file mode 100644
index c8b6a65d..00000000
--- a/examples/300-Gen-OwnGenerator.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// 300-Gen-OwnGenerator.cpp
-// Shows how to define a custom generator.
-
-// Specifically we will implement a random number generator for integers
-// It will have infinite capacity and settable lower/upper bound
-
-#include <catch2/catch.hpp>
-
-#include <random>
-
-// This class shows how to implement a simple generator for Catch tests
-class RandomIntGenerator : public Catch::Generators::IGenerator<int> {
- std::minstd_rand m_rand;
- std::uniform_int_distribution<> m_dist;
- int current_number;
-public:
-
- RandomIntGenerator(int low, int high):
- m_rand(std::random_device{}()),
- m_dist(low, high)
- {
- static_cast<void>(next());
- }
-
- int const& get() const override;
- bool next() override {
- current_number = m_dist(m_rand);
- return true;
- }
-};
-
-// Avoids -Wweak-vtables
-int const& RandomIntGenerator::get() const {
- return current_number;
-}
-
-// This helper function provides a nicer UX when instantiating the generator
-// Notice that it returns an instance of GeneratorWrapper<int>, which
-// is a value-wrapper around std::unique_ptr<IGenerator<int>>.
-Catch::Generators::GeneratorWrapper<int> random(int low, int high) {
- return Catch::Generators::GeneratorWrapper<int>(std::unique_ptr<Catch::Generators::IGenerator<int>>(new RandomIntGenerator(low, high)));
-}
-
-// The two sections in this test case are equivalent, but the first one
-// is much more readable/nicer to use
-TEST_CASE("Generating random ints", "[example][generator]") {
- SECTION("Nice UX") {
- auto i = GENERATE(take(100, random(-100, 100)));
- REQUIRE(i >= -100);
- REQUIRE(i <= 100);
- }
- SECTION("Creating the random generator directly") {
- auto i = GENERATE(take(100, GeneratorWrapper<int>(std::unique_ptr<IGenerator<int>>(new RandomIntGenerator(-100, 100)))));
- REQUIRE(i >= -100);
- REQUIRE(i <= 100);
- }
-}
-
-// Compiling and running this file will result in 400 successful assertions
diff --git a/examples/301-Gen-MapTypeConversion.cpp b/examples/301-Gen-MapTypeConversion.cpp
deleted file mode 100644
index 88772971..00000000
--- a/examples/301-Gen-MapTypeConversion.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// 301-Gen-MapTypeConversion.cpp
-// Shows how to use map to modify generator's return type.
-
-// TODO
-
-#include <catch2/catch.hpp>
-
-#include <string>
-#include <sstream>
-
-// Returns a line from a stream. You could have it e.g. read lines from
-// a file, but to avoid problems with paths in examples, we will use
-// a fixed stringstream.
-class LineGenerator : public Catch::Generators::IGenerator<std::string> {
- std::string m_line;
- std::stringstream m_stream;
-public:
- LineGenerator() {
- m_stream.str("1\n2\n3\n4\n");
- if (!next()) {
- throw Catch::GeneratorException("Couldn't read a single line");
- }
- }
-
- std::string const& get() const override;
-
- bool next() override {
- return !!std::getline(m_stream, m_line);
- }
-};
-
-std::string const& LineGenerator::get() const {
- return m_line;
-}
-
-// This helper function provides a nicer UX when instantiating the generator
-// Notice that it returns an instance of GeneratorWrapper<std::string>, which
-// is a value-wrapper around std::unique_ptr<IGenerator<std::string>>.
-Catch::Generators::GeneratorWrapper<std::string> lines(std::string /* ignored for example */) {
- return Catch::Generators::GeneratorWrapper<std::string>(
- std::unique_ptr<Catch::Generators::IGenerator<std::string>>(
- new LineGenerator()
- )
- );
-}
-
-
-
-TEST_CASE("filter can convert types inside the generator expression", "[example][generator]") {
- auto num = GENERATE(map<int>([](std::string const& line) { return std::stoi(line); },
- lines("fake-file")));
-
- REQUIRE(num > 0);
-}
-
-// Compiling and running this file will result in 4 successful assertions
diff --git a/examples/310-Gen-VariablesInGenerators.cpp b/examples/310-Gen-VariablesInGenerators.cpp
deleted file mode 100644
index 422815d2..00000000
--- a/examples/310-Gen-VariablesInGenerators.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// 310-Gen-VariablesInGenerator.cpp
-// Shows how to use variables when creating generators.
-
-// Note that using variables inside generators is dangerous and should
-// be done only if you know what you are doing, because the generators
-// _WILL_ outlive the variables -- thus they should be either captured
-// by value directly, or copied by the generators during construction.
-
-#include <catch2/catch.hpp>
-
-TEST_CASE("Generate random doubles across different ranges",
- "[generator][example][advanced]") {
- // Workaround for old libstdc++
- using record = std::tuple<double, double>;
- // Set up 3 ranges to generate numbers from
- auto r = GENERATE(table<double, double>({
- record{3, 4},
- record{-4, -3},
- record{10, 1000}
- }));
-
- // This will not compile (intentionally), because it accesses a variable
- // auto number = GENERATE(take(50, random(std::get<0>(r), std::get<1>(r))));
-
- // GENERATE_COPY copies all variables mentioned inside the expression
- // thus this will work.
- auto number = GENERATE_COPY(take(50, random(std::get<0>(r), std::get<1>(r))));
-
- REQUIRE(std::abs(number) > 0);
-}
-
-// Compiling and running this file will result in 150 successful assertions
-
diff --git a/examples/311-Gen-CustomCapture.cpp b/examples/311-Gen-CustomCapture.cpp
deleted file mode 100644
index da6d686f..00000000
--- a/examples/311-Gen-CustomCapture.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// 311-Gen-CustomCapture.cpp
-// Shows how to provide custom capture list to the generator expression
-
-// Note that using variables inside generators is dangerous and should
-// be done only if you know what you are doing, because the generators
-// _WILL_ outlive the variables. Also, even if you know what you are
-// doing, you should probably use GENERATE_COPY or GENERATE_REF macros
-// instead. However, if your use case requires having a
-// per-variable custom capture list, this example shows how to achieve
-// that.
-
-#include <catch2/catch.hpp>
-
-TEST_CASE("Generate random doubles across different ranges",
- "[generator][example][advanced]") {
- // Workaround for old libstdc++
- using record = std::tuple<double, double>;
- // Set up 3 ranges to generate numbers from
- auto r1 = GENERATE(table<double, double>({
- record{3, 4},
- record{-4, -3},
- record{10, 1000}
- }));
-
- auto r2(r1);
-
- // This will take r1 by reference and r2 by value.
- // Note that there are no advantages for doing so in this example,
- // it is done only for expository purposes.
- auto number = Catch::Generators::generate( CATCH_INTERNAL_LINEINFO,
- [&r1, r2]{
- using namespace Catch::Generators;
- return makeGenerators(take(50, random(std::get<0>(r1), std::get<1>(r2))));
- }
- );
-
- REQUIRE(std::abs(number) > 0);
-}
-
-// Compiling and running this file will result in 150 successful assertions
-
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
deleted file mode 100644
index 65dc5f54..00000000
--- a/examples/CMakeLists.txt
+++ /dev/null
@@ -1,157 +0,0 @@
-#
-# Build examples.
-#
-# Requires CATCH_BUILD_EXAMPLES to be defined 'true', see ../CMakeLists.txt.
-#
-
-cmake_minimum_required( VERSION 3.0 )
-
-project( CatchExamples CXX )
-
-message( STATUS "Examples included" )
-
-# define folders used:
-
-set( EXAMPLES_DIR ${CATCH_DIR}/examples )
-set( HEADER_DIR ${CATCH_DIR}/single_include )
-set( REPORTER_HEADER_DIR ${CATCH_DIR}/include/reporters )
-
-# single-file sources:
-
-set( SOURCES_SINGLE_FILE
- 010-TestCase.cpp
- 231-Cfg-OutputStreams.cpp
-)
-
-# multiple-file modules:
-
-set( SOURCES_020
- 020-TestCase-1.cpp
- 020-TestCase-2.cpp
-)
-
-# main for idiomatic test sources:
-
-set( SOURCES_IDIOMATIC_MAIN
- 000-CatchMain.cpp
-)
-
-# sources to combine with 000-CatchMain.cpp:
-
-set( SOURCES_IDIOMATIC_TESTS
- 030-Asn-Require-Check.cpp
- 100-Fix-Section.cpp
- 110-Fix-ClassFixture.cpp
- 120-Bdd-ScenarioGivenWhenThen.cpp
- 210-Evt-EventListeners.cpp
- 300-Gen-OwnGenerator.cpp
- 301-Gen-MapTypeConversion.cpp
- 310-Gen-VariablesInGenerators.cpp
- 311-Gen-CustomCapture.cpp
-)
-
-# main-s for reporter-specific test sources:
-
-set( SOURCES_REPORTERS_MAIN
- 200-Rpt-CatchMain.cpp
-)
-
-string( REPLACE ".cpp" "" BASENAMES_REPORTERS_MAIN 200-Rpt-CatchMain.cpp )
-
-set( NAMES_REPORTERS TeamCity )
-
-foreach( reporter ${NAMES_REPORTERS} )
- list( APPEND SOURCES_SPECIFIC_REPORTERS_MAIN ${BASENAMES_REPORTERS_MAIN}${reporter}.cpp )
-endforeach()
-
-# sources to combine with 200-Rpt-CatchMain{Reporter}.cpp:
-
-set( SOURCES_REPORTERS_TESTS
- 207-Rpt-TeamCityReporter.cpp
-)
-
-# check if all sources are listed, warn if not:
-
-set( SOURCES_ALL
- ${SOURCES_020}
- ${SOURCES_SINGLE_FILE}
- ${SOURCES_IDIOMATIC_MAIN}
- ${SOURCES_IDIOMATIC_TESTS}
- ${SOURCES_REPORTERS_MAIN}
- ${SOURCES_REPORTERS_TESTS}
-)
-
-foreach( name ${SOURCES_ALL} )
- list( APPEND SOURCES_ALL_PATH ${EXAMPLES_DIR}/${name} )
-endforeach()
-
-CheckFileList( SOURCES_ALL_PATH ${EXAMPLES_DIR} )
-
-# create target names:
-
-string( REPLACE ".cpp" "" BASENAMES_SINGLE_FILE "${SOURCES_SINGLE_FILE}" )
-string( REPLACE ".cpp" "" BASENAMES_IDIOMATIC_TESTS "${SOURCES_IDIOMATIC_TESTS}" )
-string( REPLACE ".cpp" "" BASENAMES_REPORTERS_TESTS "${SOURCES_REPORTERS_TESTS}" )
-string( REPLACE ".cpp" "" BASENAMES_REPORTERS_MAIN "${SOURCES_REPORTERS_MAIN}" )
-
-set( TARGETS_SINGLE_FILE ${BASENAMES_SINGLE_FILE} )
-set( TARGETS_IDIOMATIC_TESTS ${BASENAMES_IDIOMATIC_TESTS} )
-set( TARGETS_REPORTERS_TESTS ${BASENAMES_REPORTERS_TESTS} )
-set( TARGETS_REPORTERS_MAIN ${BASENAMES_REPORTERS_MAIN} )
-
-set( TARGETS_ALL
- ${TARGETS_SINGLE_FILE}
- 020-TestCase
- ${TARGETS_IDIOMATIC_TESTS} CatchMain
- ${TARGETS_REPORTERS_TESTS} CatchMainTeamCity
-)
-
-# define program targets:
-
-add_library( CatchMain OBJECT ${EXAMPLES_DIR}/${SOURCES_IDIOMATIC_MAIN} ${HEADER_DIR}/catch2/catch.hpp )
-#add_library( CatchMainAutomake OBJECT ${EXAMPLES_DIR}/200-Rpt-CatchMain.cpp ${HEADER_DIR}/catch2/catch.hpp )
-#add_library( CatchMainTap OBJECT ${EXAMPLES_DIR}/200-Rpt-CatchMain.cpp ${HEADER_DIR}/catch2/catch.hpp )
-add_library( CatchMainTeamCity OBJECT ${EXAMPLES_DIR}/200-Rpt-CatchMain.cpp ${HEADER_DIR}/catch2/catch.hpp )
-
-#target_compile_definitions( CatchMainAutomake PRIVATE CATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_automake.hpp\" )
-#target_compile_definitions( CatchMainTap PRIVATE CATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_tap.hpp\" )
-target_compile_definitions( CatchMainTeamCity PRIVATE CATCH_EXAMPLE_RPT_1=\"include/reporters/catch_reporter_teamcity.hpp\" )
-
-foreach( name ${TARGETS_SINGLE_FILE} )
- add_executable( ${name} ${EXAMPLES_DIR}/${name}.cpp ${HEADER_DIR}/catch2/catch.hpp )
-endforeach()
-
-foreach( name ${TARGETS_IDIOMATIC_TESTS} )
- add_executable( ${name} ${EXAMPLES_DIR}/${name}.cpp $<TARGET_OBJECTS:CatchMain> ${HEADER_DIR}/catch2/catch.hpp )
-endforeach()
-
-add_executable( 020-TestCase ${EXAMPLES_DIR}/020-TestCase-1.cpp ${EXAMPLES_DIR}/020-TestCase-2.cpp ${HEADER_DIR}/catch2/catch.hpp )
-
-#add_executable( 207-Rpt-AutomakeReporter ${EXAMPLES_DIR}/207-Rpt-AutomakeReporter.cpp $<TARGET_OBJECTS:CatchMainAutomake> ${HEADER_DIR}/catch2/catch.hpp )
-#add_executable( 207-Rpt-TapReporter ${EXAMPLES_DIR}/207-Rpt-TapReporter.cpp $<TARGET_OBJECTS:CatchMainTap> ${HEADER_DIR}/catch2/catch.hpp )
-add_executable( 207-Rpt-TeamCityReporter ${EXAMPLES_DIR}/207-Rpt-TeamCityReporter.cpp $<TARGET_OBJECTS:CatchMainTeamCity> ${HEADER_DIR}/catch2/catch.hpp )
-
-#foreach( name ${TARGETS_REPORTERS_TESTS} )
-# add_executable( ${name} ${EXAMPLES_DIR}/${name}.cpp $<TARGET_OBJECTS:CatchMain> ${HEADER_DIR}/catch2/catch.hpp )
-#endforeach()
-
-foreach( name ${TARGETS_ALL} )
- target_include_directories( ${name} PRIVATE ${HEADER_DIR} ${CATCH_DIR} )
-
- set_property(TARGET ${name} PROPERTY CXX_STANDARD 11)
- set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF)
-
- # Add desired warnings
- if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
- target_compile_options( ${name} PRIVATE -Wall -Wextra -Wunreachable-code )
- endif()
- # Clang specific warning go here
- if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
- # Actually keep these
- target_compile_options( ${name} PRIVATE -Wweak-vtables -Wexit-time-destructors -Wglobal-constructors -Wmissing-noreturn )
- endif()
- if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
- target_compile_options( ${name} PRIVATE /W4 /w44265 /WX )
- endif()
-endforeach()
-
diff --git a/include/catch.hpp b/include/catch.hpp
deleted file mode 100644
index 633d91aa..00000000
--- a/include/catch.hpp
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * Created by Phil on 22/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef TWOBLUECUBES_CATCH_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_HPP_INCLUDED
-
-#define CATCH_VERSION_MAJOR 2
-#define CATCH_VERSION_MINOR 11
-#define CATCH_VERSION_PATCH 2
-
-#ifdef __clang__
-# pragma clang system_header
-#elif defined __GNUC__
-# pragma GCC system_header
-#endif
-
-#include "internal/catch_suppress_warnings.h"
-
-#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
-# define CATCH_IMPL
-# define CATCH_CONFIG_ALL_PARTS
-#endif
-
-// In the impl file, we want to have access to all parts of the headers
-// Can also be used to sanely support PCHs
-#if defined(CATCH_CONFIG_ALL_PARTS)
-# define CATCH_CONFIG_EXTERNAL_INTERFACES
-# if defined(CATCH_CONFIG_DISABLE_MATCHERS)
-# undef CATCH_CONFIG_DISABLE_MATCHERS
-# endif
-# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-# endif
-#endif
-
-#if !defined(CATCH_CONFIG_IMPL_ONLY)
-#include "internal/catch_platform.h"
-
-#ifdef CATCH_IMPL
-# ifndef CLARA_CONFIG_MAIN
-# define CLARA_CONFIG_MAIN_NOT_DEFINED
-# define CLARA_CONFIG_MAIN
-# endif
-#endif
-
-#include "internal/catch_user_interfaces.h"
-#include "internal/catch_tag_alias_autoregistrar.h"
-#include "internal/catch_test_registry.h"
-#include "internal/catch_capture.hpp"
-#include "internal/catch_section.h"
-#include "internal/catch_interfaces_exception.h"
-#include "internal/catch_approx.h"
-#include "internal/catch_compiler_capabilities.h"
-#include "internal/catch_string_manip.h"
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
-#include "internal/catch_capture_matchers.h"
-#endif
-#include "internal/catch_generators.hpp"
-#include "internal/catch_generators_generic.hpp"
-#include "internal/catch_generators_specific.hpp"
-
-// These files are included here so the single_include script doesn't put them
-// in the conditionally compiled sections
-#include "internal/catch_test_case_info.h"
-#include "internal/catch_interfaces_runner.h"
-
-#ifdef __OBJC__
-#include "internal/catch_objc.hpp"
-#endif
-
-// Benchmarking needs the externally-facing parts of reporters to work
-#if defined(CATCH_CONFIG_EXTERNAL_INTERFACES) || defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#include "internal/catch_external_interfaces.h"
-#endif
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#include "internal/benchmark/catch_benchmarking_all.hpp"
-#endif
-
-#endif // ! CATCH_CONFIG_IMPL_ONLY
-
-#ifdef CATCH_IMPL
-#include "internal/catch_impl.hpp"
-#endif
-
-#ifdef CATCH_CONFIG_MAIN
-#include "internal/catch_default_main.hpp"
-#endif
-
-
-#if !defined(CATCH_CONFIG_IMPL_ONLY)
-
-#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED
-# undef CLARA_CONFIG_MAIN
-#endif
-
-#if !defined(CATCH_CONFIG_DISABLE)
-//////
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-
-#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
-#endif// CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-
-#define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-#define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
-
-#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
-
-#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
-#define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
-#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE",__VA_ARGS__ )
-
-#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
-#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-#define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-#define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
-#define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
-#define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#else
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#endif
-
-
-#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
-#define CATCH_STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ )
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
-#else
-#define CATCH_STATIC_REQUIRE( ... ) CATCH_REQUIRE( __VA_ARGS__ )
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ )
-#endif
-
-
-// "BDD-style" convenience wrappers
-#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-#define CATCH_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
-#define CATCH_AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
-#define CATCH_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
-#define CATCH_AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
-#define CATCH_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
-#define CATCH_AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#define CATCH_BENCHMARK(...) \
- INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
-#define CATCH_BENCHMARK_ADVANCED(name) \
- INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-
-#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-
-#define CHECK( ... ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
-
-#define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
-
-#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
-#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
-#define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE",__VA_ARGS__ )
-
-#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
-#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-#define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-#define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
-#define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
-#define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
-#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#endif
-
-
-#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
-#define STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
-#define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
-#else
-#define STATIC_REQUIRE( ... ) REQUIRE( __VA_ARGS__ )
-#define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ )
-#endif
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
-
-// "BDD-style" convenience wrappers
-#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-
-#define GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
-#define AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
-#define WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
-#define AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
-#define THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
-#define AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#define BENCHMARK(...) \
- INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
-#define BENCHMARK_ADVANCED(name) \
- INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-using Catch::Detail::Approx;
-
-#else // CATCH_CONFIG_DISABLE
-
-//////
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( ... ) (void)(0)
-#define CATCH_REQUIRE_FALSE( ... ) (void)(0)
-
-#define CATCH_REQUIRE_THROWS( ... ) (void)(0)
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif// CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_REQUIRE_NOTHROW( ... ) (void)(0)
-
-#define CATCH_CHECK( ... ) (void)(0)
-#define CATCH_CHECK_FALSE( ... ) (void)(0)
-#define CATCH_CHECKED_IF( ... ) if (__VA_ARGS__)
-#define CATCH_CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
-#define CATCH_CHECK_NOFAIL( ... ) (void)(0)
-
-#define CATCH_CHECK_THROWS( ... ) (void)(0)
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_CHECK_NOTHROW( ... ) (void)(0)
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THAT( arg, matcher ) (void)(0)
-
-#define CATCH_REQUIRE_THAT( arg, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define CATCH_INFO( msg ) (void)(0)
-#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
-#define CATCH_WARN( msg ) (void)(0)
-#define CATCH_CAPTURE( msg ) (void)(0)
-
-#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_METHOD_AS_TEST_CASE( method, ... )
-#define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0)
-#define CATCH_SECTION( ... )
-#define CATCH_DYNAMIC_SECTION( ... )
-#define CATCH_FAIL( ... ) (void)(0)
-#define CATCH_FAIL_CHECK( ... ) (void)(0)
-#define CATCH_SUCCEED( ... ) (void)(0)
-
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#endif
-
-// "BDD-style" convenience wrappers
-#define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
-#define CATCH_GIVEN( desc )
-#define CATCH_AND_GIVEN( desc )
-#define CATCH_WHEN( desc )
-#define CATCH_AND_WHEN( desc )
-#define CATCH_THEN( desc )
-#define CATCH_AND_THEN( desc )
-
-#define CATCH_STATIC_REQUIRE( ... ) (void)(0)
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0)
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( ... ) (void)(0)
-#define REQUIRE_FALSE( ... ) (void)(0)
-
-#define REQUIRE_THROWS( ... ) (void)(0)
-#define REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
-#define REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define REQUIRE_NOTHROW( ... ) (void)(0)
-
-#define CHECK( ... ) (void)(0)
-#define CHECK_FALSE( ... ) (void)(0)
-#define CHECKED_IF( ... ) if (__VA_ARGS__)
-#define CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
-#define CHECK_NOFAIL( ... ) (void)(0)
-
-#define CHECK_THROWS( ... ) (void)(0)
-#define CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CHECK_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CHECK_NOTHROW( ... ) (void)(0)
-
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THAT( arg, matcher ) (void)(0)
-
-#define REQUIRE_THAT( arg, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define INFO( msg ) (void)(0)
-#define UNSCOPED_INFO( msg ) (void)(0)
-#define WARN( msg ) (void)(0)
-#define CAPTURE( msg ) (void)(0)
-
-#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define METHOD_AS_TEST_CASE( method, ... )
-#define REGISTER_TEST_CASE( Function, ... ) (void)(0)
-#define SECTION( ... )
-#define DYNAMIC_SECTION( ... )
-#define FAIL( ... ) (void)(0)
-#define FAIL_CHECK( ... ) (void)(0)
-#define SUCCEED( ... ) (void)(0)
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#endif
-
-#define STATIC_REQUIRE( ... ) (void)(0)
-#define STATIC_REQUIRE_FALSE( ... ) (void)(0)
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
-
-// "BDD-style" convenience wrappers
-#define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) )
-#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
-
-#define GIVEN( desc )
-#define AND_GIVEN( desc )
-#define WHEN( desc )
-#define AND_WHEN( desc )
-#define THEN( desc )
-#define AND_THEN( desc )
-
-using Catch::Detail::Approx;
-
-
-#endif
-
-#endif // ! CATCH_CONFIG_IMPL_ONLY
-
-#include "internal/catch_reenable_warnings.h"
-
-#endif // TWOBLUECUBES_CATCH_HPP_INCLUDED
diff --git a/include/catch_with_main.cpp b/include/catch_with_main.cpp
deleted file mode 120000
index 273da6b6..00000000
--- a/include/catch_with_main.cpp
+++ /dev/null
@@ -1 +0,0 @@
-catch_with_main.hpp \ No newline at end of file
diff --git a/include/catch_with_main.hpp b/include/catch_with_main.hpp
deleted file mode 100644
index 54aa651f..00000000
--- a/include/catch_with_main.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
- /*
- * Created by Phil on 01/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
-
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-
-#endif // TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
diff --git a/include/external/clara.hpp b/include/external/clara.hpp
deleted file mode 100644
index c7348bf9..00000000
--- a/include/external/clara.hpp
+++ /dev/null
@@ -1,1268 +0,0 @@
-// Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See https://github.com/philsquared/Clara for more details
-
-// Clara v1.1.5
-
-#ifndef CATCH_CLARA_HPP_INCLUDED
-#define CATCH_CLARA_HPP_INCLUDED
-
-#ifndef CATCH_CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-#ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-#ifndef CLARA_CONFIG_OPTIONAL_TYPE
-#ifdef __has_include
-#if __has_include(<optional>) && __cplusplus >= 201703L
-#include <optional>
-#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
-#endif
-#endif
-#endif
-
-
-// ----------- #included from clara_textflow.hpp -----------
-
-// TextFlowCpp
-//
-// A single-header library for wrapping and laying out basic text, by Phil Nash
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// This project is hosted at https://github.com/philsquared/textflowcpp
-
-#ifndef CATCH_CLARA_TEXTFLOW_HPP_INCLUDED
-#define CATCH_CLARA_TEXTFLOW_HPP_INCLUDED
-
-#include <cassert>
-#include <ostream>
-#include <sstream>
-#include <vector>
-
-#ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-
-namespace Catch {
-namespace clara {
-namespace TextFlow {
-
-inline auto isWhitespace(char c) -> bool {
- static std::string chars = " \t\n\r";
- return chars.find(c) != std::string::npos;
-}
-inline auto isBreakableBefore(char c) -> bool {
- static std::string chars = "[({<|";
- return chars.find(c) != std::string::npos;
-}
-inline auto isBreakableAfter(char c) -> bool {
- static std::string chars = "])}>.,:;*+-=&/\\";
- return chars.find(c) != std::string::npos;
-}
-
-class Columns;
-
-class Column {
- std::vector<std::string> m_strings;
- size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH;
- size_t m_indent = 0;
- size_t m_initialIndent = std::string::npos;
-
-public:
- class iterator {
- friend Column;
-
- Column const& m_column;
- size_t m_stringIndex = 0;
- size_t m_pos = 0;
-
- size_t m_len = 0;
- size_t m_end = 0;
- bool m_suffix = false;
-
- iterator(Column const& column, size_t stringIndex)
- : m_column(column),
- m_stringIndex(stringIndex) {}
-
- auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; }
-
- auto isBoundary(size_t at) const -> bool {
- assert(at > 0);
- assert(at <= line().size());
-
- return at == line().size() ||
- (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) ||
- isBreakableBefore(line()[at]) ||
- isBreakableAfter(line()[at - 1]);
- }
-
- void calcLength() {
- assert(m_stringIndex < m_column.m_strings.size());
-
- m_suffix = false;
- auto width = m_column.m_width - indent();
- m_end = m_pos;
- if (line()[m_pos] == '\n') {
- ++m_end;
- }
- while (m_end < line().size() && line()[m_end] != '\n')
- ++m_end;
-
- if (m_end < m_pos + width) {
- m_len = m_end - m_pos;
- } else {
- size_t len = width;
- while (len > 0 && !isBoundary(m_pos + len))
- --len;
- while (len > 0 && isWhitespace(line()[m_pos + len - 1]))
- --len;
-
- if (len > 0) {
- m_len = len;
- } else {
- m_suffix = true;
- m_len = width - 1;
- }
- }
- }
-
- auto indent() const -> size_t {
- auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos;
- return initial == std::string::npos ? m_column.m_indent : initial;
- }
-
- auto addIndentAndSuffix(std::string const &plain) const -> std::string {
- return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain);
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type * ;
- using reference = value_type & ;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator(Column const& column) : m_column(column) {
- assert(m_column.m_width > m_column.m_indent);
- assert(m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent);
- calcLength();
- if (m_len == 0)
- m_stringIndex++; // Empty string
- }
-
- auto operator *() const -> std::string {
- assert(m_stringIndex < m_column.m_strings.size());
- assert(m_pos <= m_end);
- return addIndentAndSuffix(line().substr(m_pos, m_len));
- }
-
- auto operator ++() -> iterator& {
- m_pos += m_len;
- if (m_pos < line().size() && line()[m_pos] == '\n')
- m_pos += 1;
- else
- while (m_pos < line().size() && isWhitespace(line()[m_pos]))
- ++m_pos;
-
- if (m_pos == line().size()) {
- m_pos = 0;
- ++m_stringIndex;
- }
- if (m_stringIndex < m_column.m_strings.size())
- calcLength();
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev(*this);
- operator++();
- return prev;
- }
-
- auto operator ==(iterator const& other) const -> bool {
- return
- m_pos == other.m_pos &&
- m_stringIndex == other.m_stringIndex &&
- &m_column == &other.m_column;
- }
- auto operator !=(iterator const& other) const -> bool {
- return !operator==(other);
- }
- };
- using const_iterator = iterator;
-
- explicit Column(std::string const& text) { m_strings.push_back(text); }
-
- auto width(size_t newWidth) -> Column& {
- assert(newWidth > 0);
- m_width = newWidth;
- return *this;
- }
- auto indent(size_t newIndent) -> Column& {
- m_indent = newIndent;
- return *this;
- }
- auto initialIndent(size_t newIndent) -> Column& {
- m_initialIndent = newIndent;
- return *this;
- }
-
- auto width() const -> size_t { return m_width; }
- auto begin() const -> iterator { return iterator(*this); }
- auto end() const -> iterator { return { *this, m_strings.size() }; }
-
- inline friend std::ostream& operator << (std::ostream& os, Column const& col) {
- bool first = true;
- for (auto line : col) {
- if (first)
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto operator + (Column const& other)->Columns;
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-};
-
-class Spacer : public Column {
-
-public:
- explicit Spacer(size_t spaceWidth) : Column("") {
- width(spaceWidth);
- }
-};
-
-class Columns {
- std::vector<Column> m_columns;
-
-public:
-
- class iterator {
- friend Columns;
- struct EndTag {};
-
- std::vector<Column> const& m_columns;
- std::vector<Column::iterator> m_iterators;
- size_t m_activeIterators;
-
- iterator(Columns const& columns, EndTag)
- : m_columns(columns.m_columns),
- m_activeIterators(0) {
- m_iterators.reserve(m_columns.size());
-
- for (auto const& col : m_columns)
- m_iterators.push_back(col.end());
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type * ;
- using reference = value_type & ;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator(Columns const& columns)
- : m_columns(columns.m_columns),
- m_activeIterators(m_columns.size()) {
- m_iterators.reserve(m_columns.size());
-
- for (auto const& col : m_columns)
- m_iterators.push_back(col.begin());
- }
-
- auto operator ==(iterator const& other) const -> bool {
- return m_iterators == other.m_iterators;
- }
- auto operator !=(iterator const& other) const -> bool {
- return m_iterators != other.m_iterators;
- }
- auto operator *() const -> std::string {
- std::string row, padding;
-
- for (size_t i = 0; i < m_columns.size(); ++i) {
- auto width = m_columns[i].width();
- if (m_iterators[i] != m_columns[i].end()) {
- std::string col = *m_iterators[i];
- row += padding + col;
- if (col.size() < width)
- padding = std::string(width - col.size(), ' ');
- else
- padding = "";
- } else {
- padding += std::string(width, ' ');
- }
- }
- return row;
- }
- auto operator ++() -> iterator& {
- for (size_t i = 0; i < m_columns.size(); ++i) {
- if (m_iterators[i] != m_columns[i].end())
- ++m_iterators[i];
- }
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev(*this);
- operator++();
- return prev;
- }
- };
- using const_iterator = iterator;
-
- auto begin() const -> iterator { return iterator(*this); }
- auto end() const -> iterator { return { *this, iterator::EndTag() }; }
-
- auto operator += (Column const& col) -> Columns& {
- m_columns.push_back(col);
- return *this;
- }
- auto operator + (Column const& col) -> Columns {
- Columns combined = *this;
- combined += col;
- return combined;
- }
-
- inline friend std::ostream& operator << (std::ostream& os, Columns const& cols) {
-
- bool first = true;
- for (auto line : cols) {
- if (first)
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-};
-
-inline auto Column::operator + (Column const& other) -> Columns {
- Columns cols;
- cols += *this;
- cols += other;
- return cols;
-}
-}
-
-}
-}
-#endif // CATCH_CLARA_TEXTFLOW_HPP_INCLUDED
-
-// ----------- end of #include from clara_textflow.hpp -----------
-// ........... back in clara.hpp
-
-#include <cctype>
-#include <string>
-#include <memory>
-#include <set>
-#include <algorithm>
-
-#if !defined(CATCH_PLATFORM_WINDOWS) && ( defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) )
-#define CATCH_PLATFORM_WINDOWS
-#endif
-
-namespace Catch { namespace clara {
-namespace detail {
-
- // Traits for extracting arg and return type of lambdas (for single argument lambdas)
- template<typename L>
- struct UnaryLambdaTraits : UnaryLambdaTraits<decltype( &L::operator() )> {};
-
- template<typename ClassT, typename ReturnT, typename... Args>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( Args... ) const> {
- static const bool isValid = false;
- };
-
- template<typename ClassT, typename ReturnT, typename ArgT>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( ArgT ) const> {
- static const bool isValid = true;
- using ArgType = typename std::remove_const<typename std::remove_reference<ArgT>::type>::type;
- using ReturnType = ReturnT;
- };
-
- class TokenStream;
-
- // Transport for raw args (copied from main args, or supplied via init list for testing)
- class Args {
- friend TokenStream;
- std::string m_exeName;
- std::vector<std::string> m_args;
-
- public:
- Args( int argc, char const* const* argv )
- : m_exeName(argv[0]),
- m_args(argv + 1, argv + argc) {}
-
- Args( std::initializer_list<std::string> args )
- : m_exeName( *args.begin() ),
- m_args( args.begin()+1, args.end() )
- {}
-
- auto exeName() const -> std::string {
- return m_exeName;
- }
- };
-
- // Wraps a token coming from a token stream. These may not directly correspond to strings as a single string
- // may encode an option + its argument if the : or = form is used
- enum class TokenType {
- Option, Argument
- };
- struct Token {
- TokenType type;
- std::string token;
- };
-
- inline auto isOptPrefix( char c ) -> bool {
- return c == '-'
-#ifdef CATCH_PLATFORM_WINDOWS
- || c == '/'
-#endif
- ;
- }
-
- // Abstracts iterators into args as a stream of tokens, with option arguments uniformly handled
- class TokenStream {
- using Iterator = std::vector<std::string>::const_iterator;
- Iterator it;
- Iterator itEnd;
- std::vector<Token> m_tokenBuffer;
-
- void loadBuffer() {
- m_tokenBuffer.resize( 0 );
-
- // Skip any empty strings
- while( it != itEnd && it->empty() )
- ++it;
-
- if( it != itEnd ) {
- auto const &next = *it;
- if( isOptPrefix( next[0] ) ) {
- auto delimiterPos = next.find_first_of( " :=" );
- if( delimiterPos != std::string::npos ) {
- m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
- m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
- } else {
- if( next[1] != '-' && next.size() > 2 ) {
- std::string opt = "- ";
- for( size_t i = 1; i < next.size(); ++i ) {
- opt[1] = next[i];
- m_tokenBuffer.push_back( { TokenType::Option, opt } );
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Option, next } );
- }
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Argument, next } );
- }
- }
- }
-
- public:
- explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {}
-
- TokenStream( Iterator it, Iterator itEnd ) : it( it ), itEnd( itEnd ) {
- loadBuffer();
- }
-
- explicit operator bool() const {
- return !m_tokenBuffer.empty() || it != itEnd;
- }
-
- auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); }
-
- auto operator*() const -> Token {
- assert( !m_tokenBuffer.empty() );
- return m_tokenBuffer.front();
- }
-
- auto operator->() const -> Token const * {
- assert( !m_tokenBuffer.empty() );
- return &m_tokenBuffer.front();
- }
-
- auto operator++() -> TokenStream & {
- if( m_tokenBuffer.size() >= 2 ) {
- m_tokenBuffer.erase( m_tokenBuffer.begin() );
- } else {
- if( it != itEnd )
- ++it;
- loadBuffer();
- }
- return *this;
- }
- };
-
-
- class ResultBase {
- public:
- enum Type {
- Ok, LogicError, RuntimeError
- };
-
- protected:
- ResultBase( Type type ) : m_type( type ) {}
- virtual ~ResultBase() = default;
-
- virtual void enforceOk() const = 0;
-
- Type m_type;
- };
-
- template<typename T>
- class ResultValueBase : public ResultBase {
- public:
- auto value() const -> T const & {
- enforceOk();
- return m_value;
- }
-
- protected:
- ResultValueBase( Type type ) : ResultBase( type ) {}
-
- ResultValueBase( ResultValueBase const &other ) : ResultBase( other ) {
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- }
-
- ResultValueBase( Type, T const &value ) : ResultBase( Ok ) {
- new( &m_value ) T( value );
- }
-
- auto operator=( ResultValueBase const &other ) -> ResultValueBase & {
- if( m_type == ResultBase::Ok )
- m_value.~T();
- ResultBase::operator=(other);
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- return *this;
- }
-
- ~ResultValueBase() override {
- if( m_type == Ok )
- m_value.~T();
- }
-
- union {
- T m_value;
- };
- };
-
- template<>
- class ResultValueBase<void> : public ResultBase {
- protected:
- using ResultBase::ResultBase;
- };
-
- template<typename T = void>
- class BasicResult : public ResultValueBase<T> {
- public:
- template<typename U>
- explicit BasicResult( BasicResult<U> const &other )
- : ResultValueBase<T>( other.type() ),
- m_errorMessage( other.errorMessage() )
- {
- assert( type() != ResultBase::Ok );
- }
-
- template<typename U>
- static auto ok( U const &value ) -> BasicResult { return { ResultBase::Ok, value }; }
- static auto ok() -> BasicResult { return { ResultBase::Ok }; }
- static auto logicError( std::string const &message ) -> BasicResult { return { ResultBase::LogicError, message }; }
- static auto runtimeError( std::string const &message ) -> BasicResult { return { ResultBase::RuntimeError, message }; }
-
- explicit operator bool() const { return m_type == ResultBase::Ok; }
- auto type() const -> ResultBase::Type { return m_type; }
- auto errorMessage() const -> std::string { return m_errorMessage; }
-
- protected:
- void enforceOk() const override {
-
- // Errors shouldn't reach this point, but if they do
- // the actual error message will be in m_errorMessage
- assert( m_type != ResultBase::LogicError );
- assert( m_type != ResultBase::RuntimeError );
- if( m_type != ResultBase::Ok )
- std::abort();
- }
-
- std::string m_errorMessage; // Only populated if resultType is an error
-
- BasicResult( ResultBase::Type type, std::string const &message )
- : ResultValueBase<T>(type),
- m_errorMessage(message)
- {
- assert( m_type != ResultBase::Ok );
- }
-
- using ResultValueBase<T>::ResultValueBase;
- using ResultBase::m_type;
- };
-
- enum class ParseResultType {
- Matched, NoMatch, ShortCircuitAll, ShortCircuitSame
- };
-
- class ParseState {
- public:
-
- ParseState( ParseResultType type, TokenStream const &remainingTokens )
- : m_type(type),
- m_remainingTokens( remainingTokens )
- {}
-
- auto type() const -> ParseResultType { return m_type; }
- auto remainingTokens() const -> TokenStream { return m_remainingTokens; }
-
- private:
- ParseResultType m_type;
- TokenStream m_remainingTokens;
- };
-
- using Result = BasicResult<void>;
- using ParserResult = BasicResult<ParseResultType>;
- using InternalParseResult = BasicResult<ParseState>;
-
- struct HelpColumns {
- std::string left;
- std::string right;
- };
-
- template<typename T>
- inline auto convertInto( std::string const &source, T& target ) -> ParserResult {
- std::stringstream ss;
- ss << source;
- ss >> target;
- if( ss.fail() )
- return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult {
- target = source;
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, bool &target ) -> ParserResult {
- std::string srcLC = source;
- std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( std::tolower(c) ); } );
- if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on")
- target = true;
- else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off")
- target = false;
- else
- return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- }
-#ifdef CLARA_CONFIG_OPTIONAL_TYPE
- template<typename T>
- inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> ParserResult {
- T temp;
- auto result = convertInto( source, temp );
- if( result )
- target = std::move(temp);
- return result;
- }
-#endif // CLARA_CONFIG_OPTIONAL_TYPE
-
- struct NonCopyable {
- NonCopyable() = default;
- NonCopyable( NonCopyable const & ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable &operator=( NonCopyable const & ) = delete;
- NonCopyable &operator=( NonCopyable && ) = delete;
- };
-
- struct BoundRef : NonCopyable {
- virtual ~BoundRef() = default;
- virtual auto isContainer() const -> bool { return false; }
- virtual auto isFlag() const -> bool { return false; }
- };
- struct BoundValueRefBase : BoundRef {
- virtual auto setValue( std::string const &arg ) -> ParserResult = 0;
- };
- struct BoundFlagRefBase : BoundRef {
- virtual auto setFlag( bool flag ) -> ParserResult = 0;
- virtual auto isFlag() const -> bool { return true; }
- };
-
- template<typename T>
- struct BoundValueRef : BoundValueRefBase {
- T &m_ref;
-
- explicit BoundValueRef( T &ref ) : m_ref( ref ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return convertInto( arg, m_ref );
- }
- };
-
- template<typename T>
- struct BoundValueRef<std::vector<T>> : BoundValueRefBase {
- std::vector<T> &m_ref;
-
- explicit BoundValueRef( std::vector<T> &ref ) : m_ref( ref ) {}
-
- auto isContainer() const -> bool override { return true; }
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- T temp;
- auto result = convertInto( arg, temp );
- if( result )
- m_ref.push_back( temp );
- return result;
- }
- };
-
- struct BoundFlagRef : BoundFlagRefBase {
- bool &m_ref;
-
- explicit BoundFlagRef( bool &ref ) : m_ref( ref ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- m_ref = flag;
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ReturnType>
- struct LambdaInvoker {
- static_assert( std::is_same<ReturnType, ParserResult>::value, "Lambda must return void or clara::ParserResult" );
-
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- return lambda( arg );
- }
- };
-
- template<>
- struct LambdaInvoker<void> {
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- lambda( arg );
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ArgType, typename L>
- inline auto invokeLambda( L const &lambda, std::string const &arg ) -> ParserResult {
- ArgType temp{};
- auto result = convertInto( arg, temp );
- return !result
- ? result
- : LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( lambda, temp );
- }
-
-
- template<typename L>
- struct BoundLambda : BoundValueRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- explicit BoundLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return invokeLambda<typename UnaryLambdaTraits<L>::ArgType>( m_lambda, arg );
- }
- };
-
- template<typename L>
- struct BoundFlagLambda : BoundFlagRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- static_assert( std::is_same<typename UnaryLambdaTraits<L>::ArgType, bool>::value, "flags must be boolean" );
-
- explicit BoundFlagLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- return LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( m_lambda, flag );
- }
- };
-
- enum class Optionality { Optional, Required };
-
- struct Parser;
-
- class ParserBase {
- public:
- virtual ~ParserBase() = default;
- virtual auto validate() const -> Result { return Result::ok(); }
- virtual auto parse( std::string const& exeName, TokenStream const &tokens) const -> InternalParseResult = 0;
- virtual auto cardinality() const -> size_t { return 1; }
-
- auto parse( Args const &args ) const -> InternalParseResult {
- return parse( args.exeName(), TokenStream( args ) );
- }
- };
-
- template<typename DerivedT>
- class ComposableParserImpl : public ParserBase {
- public:
- template<typename T>
- auto operator|( T const &other ) const -> Parser;
-
- template<typename T>
- auto operator+( T const &other ) const -> Parser;
- };
-
- // Common code and state for Args and Opts
- template<typename DerivedT>
- class ParserRefImpl : public ComposableParserImpl<DerivedT> {
- protected:
- Optionality m_optionality = Optionality::Optional;
- std::shared_ptr<BoundRef> m_ref;
- std::string m_hint;
- std::string m_description;
-
- explicit ParserRefImpl( std::shared_ptr<BoundRef> const &ref ) : m_ref( ref ) {}
-
- public:
- template<typename T>
- ParserRefImpl( T &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundValueRef<T>>( ref ) ),
- m_hint( hint )
- {}
-
- template<typename LambdaT>
- ParserRefImpl( LambdaT const &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ),
- m_hint(hint)
- {}
-
- auto operator()( std::string const &description ) -> DerivedT & {
- m_description = description;
- return static_cast<DerivedT &>( *this );
- }
-
- auto optional() -> DerivedT & {
- m_optionality = Optionality::Optional;
- return static_cast<DerivedT &>( *this );
- };
-
- auto required() -> DerivedT & {
- m_optionality = Optionality::Required;
- return static_cast<DerivedT &>( *this );
- };
-
- auto isOptional() const -> bool {
- return m_optionality == Optionality::Optional;
- }
-
- auto cardinality() const -> size_t override {
- if( m_ref->isContainer() )
- return 0;
- else
- return 1;
- }
-
- auto hint() const -> std::string { return m_hint; }
- };
-
- class ExeName : public ComposableParserImpl<ExeName> {
- std::shared_ptr<std::string> m_name;
- std::shared_ptr<BoundValueRefBase> m_ref;
-
- template<typename LambdaT>
- static auto makeRef(LambdaT const &lambda) -> std::shared_ptr<BoundValueRefBase> {
- return std::make_shared<BoundLambda<LambdaT>>( lambda) ;
- }
-
- public:
- ExeName() : m_name( std::make_shared<std::string>( "<executable>" ) ) {}
-
- explicit ExeName( std::string &ref ) : ExeName() {
- m_ref = std::make_shared<BoundValueRef<std::string>>( ref );
- }
-
- template<typename LambdaT>
- explicit ExeName( LambdaT const& lambda ) : ExeName() {
- m_ref = std::make_shared<BoundLambda<LambdaT>>( lambda );
- }
-
- // The exe name is not parsed out of the normal tokens, but is handled specially
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- }
-
- auto name() const -> std::string { return *m_name; }
- auto set( std::string const& newName ) -> ParserResult {
-
- auto lastSlash = newName.find_last_of( "\\/" );
- auto filename = ( lastSlash == std::string::npos )
- ? newName
- : newName.substr( lastSlash+1 );
-
- *m_name = filename;
- if( m_ref )
- return m_ref->setValue( filename );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- class Arg : public ParserRefImpl<Arg> {
- public:
- using ParserRefImpl::ParserRefImpl;
-
- auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- auto const &token = *remainingTokens;
- if( token.type != TokenType::Argument )
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
-
- assert( !m_ref->isFlag() );
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
-
- auto result = valueRef->setValue( remainingTokens->token );
- if( !result )
- return InternalParseResult( result );
- else
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- };
-
- inline auto normaliseOpt( std::string const &optName ) -> std::string {
-#ifdef CATCH_PLATFORM_WINDOWS
- if( optName[0] == '/' )
- return "-" + optName.substr( 1 );
- else
-#endif
- return optName;
- }
-
- class Opt : public ParserRefImpl<Opt> {
- protected:
- std::vector<std::string> m_optNames;
-
- public:
- template<typename LambdaT>
- explicit Opt( LambdaT const &ref ) : ParserRefImpl( std::make_shared<BoundFlagLambda<LambdaT>>( ref ) ) {}
-
- explicit Opt( bool &ref ) : ParserRefImpl( std::make_shared<BoundFlagRef>( ref ) ) {}
-
- template<typename LambdaT>
- Opt( LambdaT const &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- template<typename T>
- Opt( T &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- auto operator[]( std::string const &optName ) -> Opt & {
- m_optNames.push_back( optName );
- return *this;
- }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::ostringstream oss;
- bool first = true;
- for( auto const &opt : m_optNames ) {
- if (first)
- first = false;
- else
- oss << ", ";
- oss << opt;
- }
- if( !m_hint.empty() )
- oss << " <" << m_hint << ">";
- return { { oss.str(), m_description } };
- }
-
- auto isMatch( std::string const &optToken ) const -> bool {
- auto normalisedToken = normaliseOpt( optToken );
- for( auto const &name : m_optNames ) {
- if( normaliseOpt( name ) == normalisedToken )
- return true;
- }
- return false;
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- if( remainingTokens && remainingTokens->type == TokenType::Option ) {
- auto const &token = *remainingTokens;
- if( isMatch(token.token ) ) {
- if( m_ref->isFlag() ) {
- auto flagRef = static_cast<detail::BoundFlagRefBase*>( m_ref.get() );
- auto result = flagRef->setFlag( true );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- } else {
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
- ++remainingTokens;
- if( !remainingTokens )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto const &argToken = *remainingTokens;
- if( argToken.type != TokenType::Argument )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto result = valueRef->setValue( argToken.token );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- }
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- }
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
- }
-
- auto validate() const -> Result override {
- if( m_optNames.empty() )
- return Result::logicError( "No options supplied to Opt" );
- for( auto const &name : m_optNames ) {
- if( name.empty() )
- return Result::logicError( "Option name cannot be empty" );
-#ifdef CATCH_PLATFORM_WINDOWS
- if( name[0] != '-' && name[0] != '/' )
- return Result::logicError( "Option name must begin with '-' or '/'" );
-#else
- if( name[0] != '-' )
- return Result::logicError( "Option name must begin with '-'" );
-#endif
- }
- return ParserRefImpl::validate();
- }
- };
-
- struct Help : Opt {
- Help( bool &showHelpFlag )
- : Opt([&]( bool flag ) {
- showHelpFlag = flag;
- return ParserResult::ok( ParseResultType::ShortCircuitAll );
- })
- {
- static_cast<Opt &>( *this )
- ("display usage information")
- ["-?"]["-h"]["--help"]
- .optional();
- }
- };
-
-
- struct Parser : ParserBase {
-
- mutable ExeName m_exeName;
- std::vector<Opt> m_options;
- std::vector<Arg> m_args;
-
- auto operator|=( ExeName const &exeName ) -> Parser & {
- m_exeName = exeName;
- return *this;
- }
-
- auto operator|=( Arg const &arg ) -> Parser & {
- m_args.push_back(arg);
- return *this;
- }
-
- auto operator|=( Opt const &opt ) -> Parser & {
- m_options.push_back(opt);
- return *this;
- }
-
- auto operator|=( Parser const &other ) -> Parser & {
- m_options.insert(m_options.end(), other.m_options.begin(), other.m_options.end());
- m_args.insert(m_args.end(), other.m_args.begin(), other.m_args.end());
- return *this;
- }
-
- template<typename T>
- auto operator|( T const &other ) const -> Parser {
- return Parser( *this ) |= other;
- }
-
- // Forward deprecated interface with '+' instead of '|'
- template<typename T>
- auto operator+=( T const &other ) -> Parser & { return operator|=( other ); }
- template<typename T>
- auto operator+( T const &other ) const -> Parser { return operator|( other ); }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::vector<HelpColumns> cols;
- for (auto const &o : m_options) {
- auto childCols = o.getHelpColumns();
- cols.insert( cols.end(), childCols.begin(), childCols.end() );
- }
- return cols;
- }
-
- void writeToStream( std::ostream &os ) const {
- if (!m_exeName.name().empty()) {
- os << "usage:\n" << " " << m_exeName.name() << " ";
- bool required = true, first = true;
- for( auto const &arg : m_args ) {
- if (first)
- first = false;
- else
- os << " ";
- if( arg.isOptional() && required ) {
- os << "[";
- required = false;
- }
- os << "<" << arg.hint() << ">";
- if( arg.cardinality() == 0 )
- os << " ... ";
- }
- if( !required )
- os << "]";
- if( !m_options.empty() )
- os << " options";
- os << "\n\nwhere options are:" << std::endl;
- }
-
- auto rows = getHelpColumns();
- size_t consoleWidth = CATCH_CLARA_CONFIG_CONSOLE_WIDTH;
- size_t optWidth = 0;
- for( auto const &cols : rows )
- optWidth = (std::max)(optWidth, cols.left.size() + 2);
-
- optWidth = (std::min)(optWidth, consoleWidth/2);
-
- for( auto const &cols : rows ) {
- auto row =
- TextFlow::Column( cols.left ).width( optWidth ).indent( 2 ) +
- TextFlow::Spacer(4) +
- TextFlow::Column( cols.right ).width( consoleWidth - 7 - optWidth );
- os << row << std::endl;
- }
- }
-
- friend auto operator<<( std::ostream &os, Parser const &parser ) -> std::ostream& {
- parser.writeToStream( os );
- return os;
- }
-
- auto validate() const -> Result override {
- for( auto const &opt : m_options ) {
- auto result = opt.validate();
- if( !result )
- return result;
- }
- for( auto const &arg : m_args ) {
- auto result = arg.validate();
- if( !result )
- return result;
- }
- return Result::ok();
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const& exeName, TokenStream const &tokens ) const -> InternalParseResult override {
-
- struct ParserInfo {
- ParserBase const* parser = nullptr;
- size_t count = 0;
- };
- const size_t totalParsers = m_options.size() + m_args.size();
- assert( totalParsers < 512 );
- // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
- ParserInfo parseInfos[512];
-
- {
- size_t i = 0;
- for (auto const &opt : m_options) parseInfos[i++].parser = &opt;
- for (auto const &arg : m_args) parseInfos[i++].parser = &arg;
- }
-
- m_exeName.set( exeName );
-
- auto result = InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- while( result.value().remainingTokens() ) {
- bool tokenParsed = false;
-
- for( size_t i = 0; i < totalParsers; ++i ) {
- auto& parseInfo = parseInfos[i];
- if( parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality() ) {
- result = parseInfo.parser->parse(exeName, result.value().remainingTokens());
- if (!result)
- return result;
- if (result.value().type() != ParseResultType::NoMatch) {
- tokenParsed = true;
- ++parseInfo.count;
- break;
- }
- }
- }
-
- if( result.value().type() == ParseResultType::ShortCircuitAll )
- return result;
- if( !tokenParsed )
- return InternalParseResult::runtimeError( "Unrecognised token: " + result.value().remainingTokens()->token );
- }
- // !TBD Check missing required options
- return result;
- }
- };
-
- template<typename DerivedT>
- template<typename T>
- auto ComposableParserImpl<DerivedT>::operator|( T const &other ) const -> Parser {
- return Parser() | static_cast<DerivedT const &>( *this ) | other;
- }
-} // namespace detail
-
-
-// A Combined parser
-using detail::Parser;
-
-// A parser for options
-using detail::Opt;
-
-// A parser for arguments
-using detail::Arg;
-
-// Wrapper for argc, argv from main()
-using detail::Args;
-
-// Specifies the name of the executable
-using detail::ExeName;
-
-// Convenience wrapper for option parser that specifies the help option
-using detail::Help;
-
-// enum of result types from a parse
-using detail::ParseResultType;
-
-// Result type for parser operation
-using detail::ParserResult;
-
-
-}} // namespace Catch::clara
-
-
-#endif // CATCH_CLARA_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_benchmark.hpp b/include/internal/benchmark/catch_benchmark.hpp
deleted file mode 100644
index ec8dde08..00000000
--- a/include/internal/benchmark/catch_benchmark.hpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- // Benchmark
-#ifndef TWOBLUECUBES_CATCH_BENCHMARK_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_BENCHMARK_HPP_INCLUDED
-
-#include "../catch_config.hpp"
-#include "../catch_context.h"
-#include "../catch_interfaces_reporter.h"
-#include "../catch_test_registry.h"
-
-#include "catch_chronometer.hpp"
-#include "catch_clock.hpp"
-#include "catch_environment.hpp"
-#include "catch_execution_plan.hpp"
-#include "detail/catch_estimate_clock.hpp"
-#include "detail/catch_complete_invoke.hpp"
-#include "detail/catch_analyse.hpp"
-#include "detail/catch_benchmark_function.hpp"
-#include "detail/catch_run_for_at_least.hpp"
-
-#include <algorithm>
-#include <functional>
-#include <string>
-#include <vector>
-#include <cmath>
-
-namespace Catch {
- namespace Benchmark {
- struct Benchmark {
- Benchmark(std::string &&name)
- : name(std::move(name)) {}
-
- template <class FUN>
- Benchmark(std::string &&name, FUN &&func)
- : fun(std::move(func)), name(std::move(name)) {}
-
- template <typename Clock>
- ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
- auto min_time = env.clock_resolution.mean * Detail::minimum_ticks;
- auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(cfg.benchmarkWarmupTime()));
- auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(run_time), 1, fun);
- int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed));
- return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FloatDuration<Clock>>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations };
- }
-
- template <typename Clock = default_clock>
- void run() {
- IConfigPtr cfg = getCurrentContext().getConfig();
-
- auto env = Detail::measure_environment<Clock>();
-
- getResultCapture().benchmarkPreparing(name);
- CATCH_TRY{
- auto plan = user_code([&] {
- return prepare<Clock>(*cfg, env);
- });
-
- BenchmarkInfo info {
- name,
- plan.estimated_duration.count(),
- plan.iterations_per_sample,
- cfg->benchmarkSamples(),
- cfg->benchmarkResamples(),
- env.clock_resolution.mean.count(),
- env.clock_cost.mean.count()
- };
-
- getResultCapture().benchmarkStarting(info);
-
- auto samples = user_code([&] {
- return plan.template run<Clock>(*cfg, env);
- });
-
- auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end());
- BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
- getResultCapture().benchmarkEnded(stats);
-
- } CATCH_CATCH_ALL{
- if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow.
- std::rethrow_exception(std::current_exception());
- }
- }
-
- // sets lambda to be used in fun *and* executes benchmark!
- template <typename Fun,
- typename std::enable_if<!Detail::is_related<Fun, Benchmark>::value, int>::type = 0>
- Benchmark & operator=(Fun func) {
- fun = Detail::BenchmarkFunction(func);
- run();
- return *this;
- }
-
- explicit operator bool() {
- return true;
- }
-
- private:
- Detail::BenchmarkFunction fun;
- std::string name;
- };
- }
-} // namespace Catch
-
-#define INTERNAL_CATCH_GET_1_ARG(arg1, arg2, ...) arg1
-#define INTERNAL_CATCH_GET_2_ARG(arg1, arg2, ...) arg2
-
-#define INTERNAL_CATCH_BENCHMARK(BenchmarkName, name, benchmarkIndex)\
- if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
- BenchmarkName = [&](int benchmarkIndex)
-
-#define INTERNAL_CATCH_BENCHMARK_ADVANCED(BenchmarkName, name)\
- if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
- BenchmarkName = [&]
-
-#endif // TWOBLUECUBES_CATCH_BENCHMARK_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_benchmarking_all.hpp b/include/internal/benchmark/catch_benchmarking_all.hpp
deleted file mode 100644
index 7717f899..00000000
--- a/include/internal/benchmark/catch_benchmarking_all.hpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-
-// A proxy header that includes all of the benchmarking headers to allow
-// concise include of the benchmarking features. You should prefer the
-// individual includes in standard use.
-
-#include "catch_benchmark.hpp"
-#include "catch_chronometer.hpp"
-#include "catch_clock.hpp"
-#include "catch_constructor.hpp"
-#include "catch_environment.hpp"
-#include "catch_estimate.hpp"
-#include "catch_execution_plan.hpp"
-#include "catch_optimizer.hpp"
-#include "catch_outlier_classification.hpp"
-#include "catch_sample_analysis.hpp"
-#include "detail/catch_analyse.hpp"
-#include "detail/catch_benchmark_function.hpp"
-#include "detail/catch_complete_invoke.hpp"
-#include "detail/catch_estimate_clock.hpp"
-#include "detail/catch_measure.hpp"
-#include "detail/catch_repeat.hpp"
-#include "detail/catch_run_for_at_least.hpp"
-#include "detail/catch_stats.hpp"
-#include "detail/catch_timing.hpp"
diff --git a/include/internal/benchmark/catch_chronometer.hpp b/include/internal/benchmark/catch_chronometer.hpp
deleted file mode 100644
index 1022017d..00000000
--- a/include/internal/benchmark/catch_chronometer.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// User-facing chronometer
-
-#ifndef TWOBLUECUBES_CATCH_CHRONOMETER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CHRONOMETER_HPP_INCLUDED
-
-#include "catch_clock.hpp"
-#include "catch_optimizer.hpp"
-#include "detail/catch_complete_invoke.hpp"
-#include "../catch_meta.hpp"
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- struct ChronometerConcept {
- virtual void start() = 0;
- virtual void finish() = 0;
- virtual ~ChronometerConcept() = default;
- };
- template <typename Clock>
- struct ChronometerModel final : public ChronometerConcept {
- void start() override { started = Clock::now(); }
- void finish() override { finished = Clock::now(); }
-
- ClockDuration<Clock> elapsed() const { return finished - started; }
-
- TimePoint<Clock> started;
- TimePoint<Clock> finished;
- };
- } // namespace Detail
-
- struct Chronometer {
- public:
- template <typename Fun>
- void measure(Fun&& fun) { measure(std::forward<Fun>(fun), is_callable<Fun(int)>()); }
-
- int runs() const { return k; }
-
- Chronometer(Detail::ChronometerConcept& meter, int k)
- : impl(&meter)
- , k(k) {}
-
- private:
- template <typename Fun>
- void measure(Fun&& fun, std::false_type) {
- measure([&fun](int) { return fun(); }, std::true_type());
- }
-
- template <typename Fun>
- void measure(Fun&& fun, std::true_type) {
- Detail::optimizer_barrier();
- impl->start();
- for (int i = 0; i < k; ++i) invoke_deoptimized(fun, i);
- impl->finish();
- Detail::optimizer_barrier();
- }
-
- Detail::ChronometerConcept* impl;
- int k;
- };
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_CHRONOMETER_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_clock.hpp b/include/internal/benchmark/catch_clock.hpp
deleted file mode 100644
index 32a3e868..00000000
--- a/include/internal/benchmark/catch_clock.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Clocks
-
-#ifndef TWOBLUECUBES_CATCH_CLOCK_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CLOCK_HPP_INCLUDED
-
-#include <chrono>
-#include <ratio>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Clock>
- using ClockDuration = typename Clock::duration;
- template <typename Clock>
- using FloatDuration = std::chrono::duration<double, typename Clock::period>;
-
- template <typename Clock>
- using TimePoint = typename Clock::time_point;
-
- using default_clock = std::chrono::steady_clock;
-
- template <typename Clock>
- struct now {
- TimePoint<Clock> operator()() const {
- return Clock::now();
- }
- };
-
- using fp_seconds = std::chrono::duration<double, std::ratio<1>>;
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_CLOCK_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_constructor.hpp b/include/internal/benchmark/catch_constructor.hpp
deleted file mode 100644
index 4fc04042..00000000
--- a/include/internal/benchmark/catch_constructor.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Constructor and destructor helpers
-
-#ifndef TWOBLUECUBES_CATCH_CONSTRUCTOR_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CONSTRUCTOR_HPP_INCLUDED
-
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T, bool Destruct>
- struct ObjectStorage
- {
- using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type;
-
- ObjectStorage() : data() {}
-
- ObjectStorage(const ObjectStorage& other)
- {
- new(&data) T(other.stored_object());
- }
-
- ObjectStorage(ObjectStorage&& other)
- {
- new(&data) T(std::move(other.stored_object()));
- }
-
- ~ObjectStorage() { destruct_on_exit<T>(); }
-
- template <typename... Args>
- void construct(Args&&... args)
- {
- new (&data) T(std::forward<Args>(args)...);
- }
-
- template <bool AllowManualDestruction = !Destruct>
- typename std::enable_if<AllowManualDestruction>::type destruct()
- {
- stored_object().~T();
- }
-
- private:
- // If this is a constructor benchmark, destruct the underlying object
- template <typename U>
- void destruct_on_exit(typename std::enable_if<Destruct, U>::type* = 0) { destruct<true>(); }
- // Otherwise, don't
- template <typename U>
- void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { }
-
- T& stored_object() {
- return *static_cast<T*>(static_cast<void*>(&data));
- }
-
- T const& stored_object() const {
- return *static_cast<T*>(static_cast<void*>(&data));
- }
-
-
- TStorage data;
- };
- }
-
- template <typename T>
- using storage_for = Detail::ObjectStorage<T, true>;
-
- template <typename T>
- using destructable_object = Detail::ObjectStorage<T, false>;
- }
-}
-
-#endif // TWOBLUECUBES_CATCH_CONSTRUCTOR_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_environment.hpp b/include/internal/benchmark/catch_environment.hpp
deleted file mode 100644
index 55951249..00000000
--- a/include/internal/benchmark/catch_environment.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Environment information
-
-#ifndef TWOBLUECUBES_CATCH_ENVIRONMENT_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_ENVIRONMENT_HPP_INCLUDED
-
-#include "catch_clock.hpp"
-#include "catch_outlier_classification.hpp"
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct EnvironmentEstimate {
- Duration mean;
- OutlierClassification outliers;
-
- template <typename Duration2>
- operator EnvironmentEstimate<Duration2>() const {
- return { mean, outliers };
- }
- };
- template <typename Clock>
- struct Environment {
- using clock_type = Clock;
- EnvironmentEstimate<FloatDuration<Clock>> clock_resolution;
- EnvironmentEstimate<FloatDuration<Clock>> clock_cost;
- };
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_ENVIRONMENT_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_estimate.hpp b/include/internal/benchmark/catch_estimate.hpp
deleted file mode 100644
index a3c913ce..00000000
--- a/include/internal/benchmark/catch_estimate.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- // Statistics estimates
-
-#ifndef TWOBLUECUBES_CATCH_ESTIMATE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_ESTIMATE_HPP_INCLUDED
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct Estimate {
- Duration point;
- Duration lower_bound;
- Duration upper_bound;
- double confidence_interval;
-
- template <typename Duration2>
- operator Estimate<Duration2>() const {
- return { point, lower_bound, upper_bound, confidence_interval };
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_ESTIMATE_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_execution_plan.hpp b/include/internal/benchmark/catch_execution_plan.hpp
deleted file mode 100644
index e56c83aa..00000000
--- a/include/internal/benchmark/catch_execution_plan.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- // Execution plan
-
-#ifndef TWOBLUECUBES_CATCH_EXECUTION_PLAN_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_EXECUTION_PLAN_HPP_INCLUDED
-
-#include "../catch_config.hpp"
-#include "catch_clock.hpp"
-#include "catch_environment.hpp"
-#include "detail/catch_benchmark_function.hpp"
-#include "detail/catch_repeat.hpp"
-#include "detail/catch_run_for_at_least.hpp"
-
-#include <algorithm>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct ExecutionPlan {
- int iterations_per_sample;
- Duration estimated_duration;
- Detail::BenchmarkFunction benchmark;
- Duration warmup_time;
- int warmup_iterations;
-
- template <typename Duration2>
- operator ExecutionPlan<Duration2>() const {
- return { iterations_per_sample, estimated_duration, benchmark, warmup_time, warmup_iterations };
- }
-
- template <typename Clock>
- std::vector<FloatDuration<Clock>> run(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
- // warmup a bit
- Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_iterations, Detail::repeat(now<Clock>{}));
-
- std::vector<FloatDuration<Clock>> times;
- times.reserve(cfg.benchmarkSamples());
- std::generate_n(std::back_inserter(times), cfg.benchmarkSamples(), [this, env] {
- Detail::ChronometerModel<Clock> model;
- this->benchmark(Chronometer(model, iterations_per_sample));
- auto sample_time = model.elapsed() - env.clock_cost.mean;
- if (sample_time < FloatDuration<Clock>::zero()) sample_time = FloatDuration<Clock>::zero();
- return sample_time / iterations_per_sample;
- });
- return times;
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_EXECUTION_PLAN_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_optimizer.hpp b/include/internal/benchmark/catch_optimizer.hpp
deleted file mode 100644
index bda7c6d7..00000000
--- a/include/internal/benchmark/catch_optimizer.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- // Hinting the optimizer
-
-#ifndef TWOBLUECUBES_CATCH_OPTIMIZER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_OPTIMIZER_HPP_INCLUDED
-
-#if defined(_MSC_VER)
-# include <atomic> // atomic_thread_fence
-#endif
-
-namespace Catch {
- namespace Benchmark {
-#if defined(__GNUC__) || defined(__clang__)
- template <typename T>
- inline void keep_memory(T* p) {
- asm volatile("" : : "g"(p) : "memory");
- }
- inline void keep_memory() {
- asm volatile("" : : : "memory");
- }
-
- namespace Detail {
- inline void optimizer_barrier() { keep_memory(); }
- } // namespace Detail
-#elif defined(_MSC_VER)
-
-#pragma optimize("", off)
- template <typename T>
- inline void keep_memory(T* p) {
- // thanks @milleniumbug
- *reinterpret_cast<char volatile*>(p) = *reinterpret_cast<char const volatile*>(p);
- }
- // TODO equivalent keep_memory()
-#pragma optimize("", on)
-
- namespace Detail {
- inline void optimizer_barrier() {
- std::atomic_thread_fence(std::memory_order_seq_cst);
- }
- } // namespace Detail
-
-#endif
-
- template <typename T>
- inline void deoptimize_value(T&& x) {
- keep_memory(&x);
- }
-
- template <typename Fn, typename... Args>
- inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<!std::is_same<void, decltype(fn(args...))>::value>::type {
- deoptimize_value(std::forward<Fn>(fn) (std::forward<Args...>(args...)));
- }
-
- template <typename Fn, typename... Args>
- inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<std::is_same<void, decltype(fn(args...))>::value>::type {
- std::forward<Fn>(fn) (std::forward<Args...>(args...));
- }
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_OPTIMIZER_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_outlier_classification.hpp b/include/internal/benchmark/catch_outlier_classification.hpp
deleted file mode 100644
index 66a0adf5..00000000
--- a/include/internal/benchmark/catch_outlier_classification.hpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Outlier information
-#ifndef TWOBLUECUBES_CATCH_OUTLIERS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_OUTLIERS_HPP_INCLUDED
-
-namespace Catch {
- namespace Benchmark {
- struct OutlierClassification {
- int samples_seen = 0;
- int low_severe = 0; // more than 3 times IQR below Q1
- int low_mild = 0; // 1.5 to 3 times IQR below Q1
- int high_mild = 0; // 1.5 to 3 times IQR above Q3
- int high_severe = 0; // more than 3 times IQR above Q3
-
- int total() const {
- return low_severe + low_mild + high_mild + high_severe;
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_OUTLIERS_HPP_INCLUDED
diff --git a/include/internal/benchmark/catch_sample_analysis.hpp b/include/internal/benchmark/catch_sample_analysis.hpp
deleted file mode 100644
index 4550d0bc..00000000
--- a/include/internal/benchmark/catch_sample_analysis.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Benchmark results
-
-#ifndef TWOBLUECUBES_CATCH_BENCHMARK_RESULTS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_BENCHMARK_RESULTS_HPP_INCLUDED
-
-#include "catch_clock.hpp"
-#include "catch_estimate.hpp"
-#include "catch_outlier_classification.hpp"
-
-#include <algorithm>
-#include <vector>
-#include <string>
-#include <iterator>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct SampleAnalysis {
- std::vector<Duration> samples;
- Estimate<Duration> mean;
- Estimate<Duration> standard_deviation;
- OutlierClassification outliers;
- double outlier_variance;
-
- template <typename Duration2>
- operator SampleAnalysis<Duration2>() const {
- std::vector<Duration2> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
- return {
- std::move(samples2),
- mean,
- standard_deviation,
- outliers,
- outlier_variance,
- };
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_BENCHMARK_RESULTS_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_analyse.hpp b/include/internal/benchmark/detail/catch_analyse.hpp
deleted file mode 100644
index a3becbe4..00000000
--- a/include/internal/benchmark/detail/catch_analyse.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- // Run and analyse one benchmark
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_ANALYSE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_ANALYSE_HPP_INCLUDED
-
-#include "../catch_clock.hpp"
-#include "../catch_sample_analysis.hpp"
-#include "catch_stats.hpp"
-
-#include <algorithm>
-#include <iterator>
-#include <vector>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Duration, typename Iterator>
- SampleAnalysis<Duration> analyse(const IConfig &cfg, Environment<Duration>, Iterator first, Iterator last) {
- if (!cfg.benchmarkNoAnalysis()) {
- std::vector<double> samples;
- samples.reserve(last - first);
- std::transform(first, last, std::back_inserter(samples), [](Duration d) { return d.count(); });
-
- auto analysis = Catch::Benchmark::Detail::analyse_samples(cfg.benchmarkConfidenceInterval(), cfg.benchmarkResamples(), samples.begin(), samples.end());
- auto outliers = Catch::Benchmark::Detail::classify_outliers(samples.begin(), samples.end());
-
- auto wrap_estimate = [](Estimate<double> e) {
- return Estimate<Duration> {
- Duration(e.point),
- Duration(e.lower_bound),
- Duration(e.upper_bound),
- e.confidence_interval,
- };
- };
- std::vector<Duration> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](double d) { return Duration(d); });
- return {
- std::move(samples2),
- wrap_estimate(analysis.mean),
- wrap_estimate(analysis.standard_deviation),
- outliers,
- analysis.outlier_variance,
- };
- } else {
- std::vector<Duration> samples;
- samples.reserve(last - first);
-
- Duration mean = Duration(0);
- int i = 0;
- for (auto it = first; it < last; ++it, ++i) {
- samples.push_back(Duration(*it));
- mean += Duration(*it);
- }
- mean /= i;
-
- return {
- std::move(samples),
- Estimate<Duration>{mean, mean, mean, 0.0},
- Estimate<Duration>{Duration(0), Duration(0), Duration(0), 0.0},
- OutlierClassification{},
- 0.0
- };
- }
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_ANALYSE_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_benchmark_function.hpp b/include/internal/benchmark/detail/catch_benchmark_function.hpp
deleted file mode 100644
index 60c7f1d6..00000000
--- a/include/internal/benchmark/detail/catch_benchmark_function.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
- /*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- // Dumb std::function implementation for consistent call overhead
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_BENCHMARK_FUNCTION_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_BENCHMARK_FUNCTION_HPP_INCLUDED
-
-#include "../catch_chronometer.hpp"
-#include "catch_complete_invoke.hpp"
-#include "../../catch_meta.hpp"
-
-#include <cassert>
-#include <type_traits>
-#include <utility>
-#include <memory>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T>
- using Decay = typename std::decay<T>::type;
- template <typename T, typename U>
- struct is_related
- : std::is_same<Decay<T>, Decay<U>> {};
-
- /// We need to reinvent std::function because every piece of code that might add overhead
- /// in a measurement context needs to have consistent performance characteristics so that we
- /// can account for it in the measurement.
- /// Implementations of std::function with optimizations that aren't always applicable, like
- /// small buffer optimizations, are not uncommon.
- /// This is effectively an implementation of std::function without any such optimizations;
- /// it may be slow, but it is consistently slow.
- struct BenchmarkFunction {
- private:
- struct callable {
- virtual void call(Chronometer meter) const = 0;
- virtual callable* clone() const = 0;
- virtual ~callable() = default;
- };
- template <typename Fun>
- struct model : public callable {
- model(Fun&& fun) : fun(std::move(fun)) {}
- model(Fun const& fun) : fun(fun) {}
-
- model<Fun>* clone() const override { return new model<Fun>(*this); }
-
- void call(Chronometer meter) const override {
- call(meter, is_callable<Fun(Chronometer)>());
- }
- void call(Chronometer meter, std::true_type) const {
- fun(meter);
- }
- void call(Chronometer meter, std::false_type) const {
- meter.measure(fun);
- }
-
- Fun fun;
- };
-
- struct do_nothing { void operator()() const {} };
-
- template <typename T>
- BenchmarkFunction(model<T>* c) : f(c) {}
-
- public:
- BenchmarkFunction()
- : f(new model<do_nothing>{ {} }) {}
-
- template <typename Fun,
- typename std::enable_if<!is_related<Fun, BenchmarkFunction>::value, int>::type = 0>
- BenchmarkFunction(Fun&& fun)
- : f(new model<typename std::decay<Fun>::type>(std::forward<Fun>(fun))) {}
-
- BenchmarkFunction(BenchmarkFunction&& that)
- : f(std::move(that.f)) {}
-
- BenchmarkFunction(BenchmarkFunction const& that)
- : f(that.f->clone()) {}
-
- BenchmarkFunction& operator=(BenchmarkFunction&& that) {
- f = std::move(that.f);
- return *this;
- }
-
- BenchmarkFunction& operator=(BenchmarkFunction const& that) {
- f.reset(that.f->clone());
- return *this;
- }
-
- void operator()(Chronometer meter) const { f->call(meter); }
-
- private:
- std::unique_ptr<callable> f;
- };
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_BENCHMARK_FUNCTION_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_complete_invoke.hpp b/include/internal/benchmark/detail/catch_complete_invoke.hpp
deleted file mode 100644
index abeb2ac7..00000000
--- a/include/internal/benchmark/detail/catch_complete_invoke.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Invoke with a special case for void
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_COMPLETE_INVOKE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_COMPLETE_INVOKE_HPP_INCLUDED
-
-#include "../../catch_enforce.h"
-
-#include <type_traits>
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T>
- struct CompleteType { using type = T; };
- template <>
- struct CompleteType<void> { struct type {}; };
-
- template <typename T>
- using CompleteType_t = typename CompleteType<T>::type;
-
- template <typename Result>
- struct CompleteInvoker {
- template <typename Fun, typename... Args>
- static Result invoke(Fun&& fun, Args&&... args) {
- return std::forward<Fun>(fun)(std::forward<Args>(args)...);
- }
- };
- template <>
- struct CompleteInvoker<void> {
- template <typename Fun, typename... Args>
- static CompleteType_t<void> invoke(Fun&& fun, Args&&... args) {
- std::forward<Fun>(fun)(std::forward<Args>(args)...);
- return {};
- }
- };
- template <typename Sig>
- using ResultOf_t = typename std::result_of<Sig>::type;
-
- // invoke and not return void :(
- template <typename Fun, typename... Args>
- CompleteType_t<ResultOf_t<Fun(Args...)>> complete_invoke(Fun&& fun, Args&&... args) {
- return CompleteInvoker<ResultOf_t<Fun(Args...)>>::invoke(std::forward<Fun>(fun), std::forward<Args>(args)...);
- }
-
- const std::string benchmarkErrorMsg = "a benchmark failed to run successfully";
- } // namespace Detail
-
- template <typename Fun>
- Detail::CompleteType_t<Detail::ResultOf_t<Fun()>> user_code(Fun&& fun) {
- CATCH_TRY{
- return Detail::complete_invoke(std::forward<Fun>(fun));
- } CATCH_CATCH_ALL{
- getResultCapture().benchmarkFailed(translateActiveException());
- CATCH_RUNTIME_ERROR(Detail::benchmarkErrorMsg);
- }
- }
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_COMPLETE_INVOKE_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_estimate_clock.hpp b/include/internal/benchmark/detail/catch_estimate_clock.hpp
deleted file mode 100644
index 055c5825..00000000
--- a/include/internal/benchmark/detail/catch_estimate_clock.hpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- // Environment measurement
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_ESTIMATE_CLOCK_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_ESTIMATE_CLOCK_HPP_INCLUDED
-
-#include "../catch_clock.hpp"
-#include "../catch_environment.hpp"
-#include "catch_stats.hpp"
-#include "catch_measure.hpp"
-#include "catch_run_for_at_least.hpp"
-#include "../catch_clock.hpp"
-
-#include <algorithm>
-#include <iterator>
-#include <tuple>
-#include <vector>
-#include <cmath>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock>
- std::vector<double> resolution(int k) {
- std::vector<TimePoint<Clock>> times;
- times.reserve(k + 1);
- std::generate_n(std::back_inserter(times), k + 1, now<Clock>{});
-
- std::vector<double> deltas;
- deltas.reserve(k);
- std::transform(std::next(times.begin()), times.end(), times.begin(),
- std::back_inserter(deltas),
- [](TimePoint<Clock> a, TimePoint<Clock> b) { return static_cast<double>((a - b).count()); });
-
- return deltas;
- }
-
- const auto warmup_iterations = 10000;
- const auto warmup_time = std::chrono::milliseconds(100);
- const auto minimum_ticks = 1000;
- const auto warmup_seed = 10000;
- const auto clock_resolution_estimation_time = std::chrono::milliseconds(500);
- const auto clock_cost_estimation_time_limit = std::chrono::seconds(1);
- const auto clock_cost_estimation_tick_limit = 100000;
- const auto clock_cost_estimation_time = std::chrono::milliseconds(10);
- const auto clock_cost_estimation_iterations = 10000;
-
- template <typename Clock>
- int warmup() {
- return run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_seed, &resolution<Clock>)
- .iterations;
- }
- template <typename Clock>
- EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_resolution(int iterations) {
- auto r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_resolution_estimation_time), iterations, &resolution<Clock>)
- .result;
- return {
- FloatDuration<Clock>(mean(r.begin(), r.end())),
- classify_outliers(r.begin(), r.end()),
- };
- }
- template <typename Clock>
- EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_cost(FloatDuration<Clock> resolution) {
- auto time_limit = std::min(resolution * clock_cost_estimation_tick_limit, FloatDuration<Clock>(clock_cost_estimation_time_limit));
- auto time_clock = [](int k) {
- return Detail::measure<Clock>([k] {
- for (int i = 0; i < k; ++i) {
- volatile auto ignored = Clock::now();
- (void)ignored;
- }
- }).elapsed;
- };
- time_clock(1);
- int iters = clock_cost_estimation_iterations;
- auto&& r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_cost_estimation_time), iters, time_clock);
- std::vector<double> times;
- int nsamples = static_cast<int>(std::ceil(time_limit / r.elapsed));
- times.reserve(nsamples);
- std::generate_n(std::back_inserter(times), nsamples, [time_clock, &r] {
- return static_cast<double>((time_clock(r.iterations) / r.iterations).count());
- });
- return {
- FloatDuration<Clock>(mean(times.begin(), times.end())),
- classify_outliers(times.begin(), times.end()),
- };
- }
-
- template <typename Clock>
- Environment<FloatDuration<Clock>> measure_environment() {
- static Environment<FloatDuration<Clock>>* env = nullptr;
- if (env) {
- return *env;
- }
-
- auto iters = Detail::warmup<Clock>();
- auto resolution = Detail::estimate_clock_resolution<Clock>(iters);
- auto cost = Detail::estimate_clock_cost<Clock>(resolution.mean);
-
- env = new Environment<FloatDuration<Clock>>{ resolution, cost };
- return *env;
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_ESTIMATE_CLOCK_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_measure.hpp b/include/internal/benchmark/detail/catch_measure.hpp
deleted file mode 100644
index 62ed2809..00000000
--- a/include/internal/benchmark/detail/catch_measure.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Measure
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_MEASURE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_MEASURE_HPP_INCLUDED
-
-#include "../catch_clock.hpp"
-#include "catch_complete_invoke.hpp"
-#include "catch_timing.hpp"
-
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock, typename Fun, typename... Args>
- TimingOf<Clock, Fun(Args...)> measure(Fun&& fun, Args&&... args) {
- auto start = Clock::now();
- auto&& r = Detail::complete_invoke(fun, std::forward<Args>(args)...);
- auto end = Clock::now();
- auto delta = end - start;
- return { delta, std::forward<decltype(r)>(r), 1 };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_MEASURE_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_repeat.hpp b/include/internal/benchmark/detail/catch_repeat.hpp
deleted file mode 100644
index ab240792..00000000
--- a/include/internal/benchmark/detail/catch_repeat.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// repeat algorithm
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_REPEAT_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_REPEAT_HPP_INCLUDED
-
-#include <type_traits>
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Fun>
- struct repeater {
- void operator()(int k) const {
- for (int i = 0; i < k; ++i) {
- fun();
- }
- }
- Fun fun;
- };
- template <typename Fun>
- repeater<typename std::decay<Fun>::type> repeat(Fun&& fun) {
- return { std::forward<Fun>(fun) };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_REPEAT_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_run_for_at_least.hpp b/include/internal/benchmark/detail/catch_run_for_at_least.hpp
deleted file mode 100644
index a41c6b46..00000000
--- a/include/internal/benchmark/detail/catch_run_for_at_least.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Run a function for a minimum amount of time
-
-#ifndef TWOBLUECUBES_CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
-
-#include "../catch_clock.hpp"
-#include "../catch_chronometer.hpp"
-#include "catch_measure.hpp"
-#include "catch_complete_invoke.hpp"
-#include "catch_timing.hpp"
-#include "../../catch_meta.hpp"
-
-#include <utility>
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun(int)> measure_one(Fun&& fun, int iters, std::false_type) {
- return Detail::measure<Clock>(fun, iters);
- }
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun(Chronometer)> measure_one(Fun&& fun, int iters, std::true_type) {
- Detail::ChronometerModel<Clock> meter;
- auto&& result = Detail::complete_invoke(fun, Chronometer(meter, iters));
-
- return { meter.elapsed(), std::move(result), iters };
- }
-
- template <typename Clock, typename Fun>
- using run_for_at_least_argument_t = typename std::conditional<is_callable<Fun(Chronometer)>::value, Chronometer, int>::type;
-
- struct optimized_away_error : std::exception {
- const char* what() const noexcept override {
- return "could not measure benchmark, maybe it was optimized away";
- }
- };
-
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun(run_for_at_least_argument_t<Clock, Fun>)> run_for_at_least(ClockDuration<Clock> how_long, int seed, Fun&& fun) {
- auto iters = seed;
- while (iters < (1 << 30)) {
- auto&& Timing = measure_one<Clock>(fun, iters, is_callable<Fun(Chronometer)>());
-
- if (Timing.elapsed >= how_long) {
- return { Timing.elapsed, std::move(Timing.result), iters };
- }
- iters *= 2;
- }
- throw optimized_away_error{};
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_stats.cpp b/include/internal/benchmark/detail/catch_stats.cpp
deleted file mode 100644
index b85b740e..00000000
--- a/include/internal/benchmark/detail/catch_stats.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Created by Martin on 15/06/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Statistical analysis tools
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-
-#include "catch_stats.hpp"
-
-#include "../../catch_compiler_capabilities.h"
-
-#include <cassert>
-#include <random>
-
-
-#if defined(CATCH_CONFIG_USE_ASYNC)
-#include <future>
-#endif
-
-namespace {
- double erf_inv(double x) {
- // Code accompanying the article "Approximating the erfinv function" in GPU Computing Gems, Volume 2
- double w, p;
-
- w = -log((1.0 - x) * (1.0 + x));
-
- if (w < 6.250000) {
- w = w - 3.125000;
- p = -3.6444120640178196996e-21;
- p = -1.685059138182016589e-19 + p * w;
- p = 1.2858480715256400167e-18 + p * w;
- p = 1.115787767802518096e-17 + p * w;
- p = -1.333171662854620906e-16 + p * w;
- p = 2.0972767875968561637e-17 + p * w;
- p = 6.6376381343583238325e-15 + p * w;
- p = -4.0545662729752068639e-14 + p * w;
- p = -8.1519341976054721522e-14 + p * w;
- p = 2.6335093153082322977e-12 + p * w;
- p = -1.2975133253453532498e-11 + p * w;
- p = -5.4154120542946279317e-11 + p * w;
- p = 1.051212273321532285e-09 + p * w;
- p = -4.1126339803469836976e-09 + p * w;
- p = -2.9070369957882005086e-08 + p * w;
- p = 4.2347877827932403518e-07 + p * w;
- p = -1.3654692000834678645e-06 + p * w;
- p = -1.3882523362786468719e-05 + p * w;
- p = 0.0001867342080340571352 + p * w;
- p = -0.00074070253416626697512 + p * w;
- p = -0.0060336708714301490533 + p * w;
- p = 0.24015818242558961693 + p * w;
- p = 1.6536545626831027356 + p * w;
- } else if (w < 16.000000) {
- w = sqrt(w) - 3.250000;
- p = 2.2137376921775787049e-09;
- p = 9.0756561938885390979e-08 + p * w;
- p = -2.7517406297064545428e-07 + p * w;
- p = 1.8239629214389227755e-08 + p * w;
- p = 1.5027403968909827627e-06 + p * w;
- p = -4.013867526981545969e-06 + p * w;
- p = 2.9234449089955446044e-06 + p * w;
- p = 1.2475304481671778723e-05 + p * w;
- p = -4.7318229009055733981e-05 + p * w;
- p = 6.8284851459573175448e-05 + p * w;
- p = 2.4031110387097893999e-05 + p * w;
- p = -0.0003550375203628474796 + p * w;
- p = 0.00095328937973738049703 + p * w;
- p = -0.0016882755560235047313 + p * w;
- p = 0.0024914420961078508066 + p * w;
- p = -0.0037512085075692412107 + p * w;
- p = 0.005370914553590063617 + p * w;
- p = 1.0052589676941592334 + p * w;
- p = 3.0838856104922207635 + p * w;
- } else {
- w = sqrt(w) - 5.000000;
- p = -2.7109920616438573243e-11;
- p = -2.5556418169965252055e-10 + p * w;
- p = 1.5076572693500548083e-09 + p * w;
- p = -3.7894654401267369937e-09 + p * w;
- p = 7.6157012080783393804e-09 + p * w;
- p = -1.4960026627149240478e-08 + p * w;
- p = 2.9147953450901080826e-08 + p * w;
- p = -6.7711997758452339498e-08 + p * w;
- p = 2.2900482228026654717e-07 + p * w;
- p = -9.9298272942317002539e-07 + p * w;
- p = 4.5260625972231537039e-06 + p * w;
- p = -1.9681778105531670567e-05 + p * w;
- p = 7.5995277030017761139e-05 + p * w;
- p = -0.00021503011930044477347 + p * w;
- p = -0.00013871931833623122026 + p * w;
- p = 1.0103004648645343977 + p * w;
- p = 4.8499064014085844221 + p * w;
- }
- return p * x;
- }
-
- double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
- auto m = Catch::Benchmark::Detail::mean(first, last);
- double variance = std::accumulate(first, last, 0., [m](double a, double b) {
- double diff = b - m;
- return a + diff * diff;
- }) / (last - first);
- return std::sqrt(variance);
- }
-
-}
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
-
- double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last) {
- auto count = last - first;
- double idx = (count - 1) * k / static_cast<double>(q);
- int j = static_cast<int>(idx);
- double g = idx - j;
- std::nth_element(first, first + j, last);
- auto xj = first[j];
- if (g == 0) return xj;
-
- auto xj1 = *std::min_element(first + (j + 1), last);
- return xj + g * (xj1 - xj);
- }
-
-
- double erfc_inv(double x) {
- return erf_inv(1.0 - x);
- }
-
- double normal_quantile(double p) {
- static const double ROOT_TWO = std::sqrt(2.0);
-
- double result = 0.0;
- assert(p >= 0 && p <= 1);
- if (p < 0 || p > 1) {
- return result;
- }
-
- result = -erfc_inv(2.0 * p);
- // result *= normal distribution standard deviation (1.0) * sqrt(2)
- result *= /*sd * */ ROOT_TWO;
- // result += normal disttribution mean (0)
- return result;
- }
-
-
- double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n) {
- double sb = stddev.point;
- double mn = mean.point / n;
- double mg_min = mn / 2.;
- double sg = std::min(mg_min / 4., sb / std::sqrt(n));
- double sg2 = sg * sg;
- double sb2 = sb * sb;
-
- auto c_max = [n, mn, sb2, sg2](double x) -> double {
- double k = mn - x;
- double d = k * k;
- double nd = n * d;
- double k0 = -n * nd;
- double k1 = sb2 - n * sg2 + nd;
- double det = k1 * k1 - 4 * sg2 * k0;
- return (int)(-2. * k0 / (k1 + std::sqrt(det)));
- };
-
- auto var_out = [n, sb2, sg2](double c) {
- double nc = n - c;
- return (nc / n) * (sb2 - nc * sg2);
- };
-
- return std::min(var_out(1), var_out(std::min(c_max(0.), c_max(mg_min)))) / sb2;
- }
-
-
- bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last) {
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
- static std::random_device entropy;
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- auto n = static_cast<int>(last - first); // seriously, one can't use integral types without hell in C++
-
- auto mean = &Detail::mean<std::vector<double>::iterator>;
- auto stddev = &standard_deviation;
-
-#if defined(CATCH_CONFIG_USE_ASYNC)
- auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
- auto seed = entropy();
- return std::async(std::launch::async, [=] {
- std::mt19937 rng(seed);
- auto resampled = resample(rng, n_resamples, first, last, f);
- return bootstrap(confidence_level, first, last, resampled, f);
- });
- };
-
- auto mean_future = Estimate(mean);
- auto stddev_future = Estimate(stddev);
-
- auto mean_estimate = mean_future.get();
- auto stddev_estimate = stddev_future.get();
-#else
- auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
- auto seed = entropy();
- std::mt19937 rng(seed);
- auto resampled = resample(rng, n_resamples, first, last, f);
- return bootstrap(confidence_level, first, last, resampled, f);
- };
-
- auto mean_estimate = Estimate(mean);
- auto stddev_estimate = Estimate(stddev);
-#endif // CATCH_USE_ASYNC
-
- double outlier_variance = Detail::outlier_variance(mean_estimate, stddev_estimate, n);
-
- return { mean_estimate, stddev_estimate, outlier_variance };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
diff --git a/include/internal/benchmark/detail/catch_stats.hpp b/include/internal/benchmark/detail/catch_stats.hpp
deleted file mode 100644
index 71a460d9..00000000
--- a/include/internal/benchmark/detail/catch_stats.hpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Statistical analysis tools
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_ANALYSIS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_ANALYSIS_HPP_INCLUDED
-
-#include "../catch_clock.hpp"
-#include "../catch_estimate.hpp"
-#include "../catch_outlier_classification.hpp"
-
-#include <algorithm>
-#include <functional>
-#include <vector>
-#include <iterator>
-#include <numeric>
-#include <tuple>
-#include <cmath>
-#include <utility>
-#include <cstddef>
-#include <random>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- using sample = std::vector<double>;
-
- double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last);
-
- template <typename Iterator>
- OutlierClassification classify_outliers(Iterator first, Iterator last) {
- std::vector<double> copy(first, last);
-
- auto q1 = weighted_average_quantile(1, 4, copy.begin(), copy.end());
- auto q3 = weighted_average_quantile(3, 4, copy.begin(), copy.end());
- auto iqr = q3 - q1;
- auto los = q1 - (iqr * 3.);
- auto lom = q1 - (iqr * 1.5);
- auto him = q3 + (iqr * 1.5);
- auto his = q3 + (iqr * 3.);
-
- OutlierClassification o;
- for (; first != last; ++first) {
- auto&& t = *first;
- if (t < los) ++o.low_severe;
- else if (t < lom) ++o.low_mild;
- else if (t > his) ++o.high_severe;
- else if (t > him) ++o.high_mild;
- ++o.samples_seen;
- }
- return o;
- }
-
- template <typename Iterator>
- double mean(Iterator first, Iterator last) {
- auto count = last - first;
- double sum = std::accumulate(first, last, 0.);
- return sum / count;
- }
-
- template <typename URng, typename Iterator, typename Estimator>
- sample resample(URng& rng, int resamples, Iterator first, Iterator last, Estimator& estimator) {
- auto n = last - first;
- std::uniform_int_distribution<decltype(n)> dist(0, n - 1);
-
- sample out;
- out.reserve(resamples);
- std::generate_n(std::back_inserter(out), resamples, [n, first, &estimator, &dist, &rng] {
- std::vector<double> resampled;
- resampled.reserve(n);
- std::generate_n(std::back_inserter(resampled), n, [first, &dist, &rng] { return first[dist(rng)]; });
- return estimator(resampled.begin(), resampled.end());
- });
- std::sort(out.begin(), out.end());
- return out;
- }
-
- template <typename Estimator, typename Iterator>
- sample jackknife(Estimator&& estimator, Iterator first, Iterator last) {
- auto n = last - first;
- auto second = std::next(first);
- sample results;
- results.reserve(n);
-
- for (auto it = first; it != last; ++it) {
- std::iter_swap(it, first);
- results.push_back(estimator(second, last));
- }
-
- return results;
- }
-
- inline double normal_cdf(double x) {
- return std::erfc(-x / std::sqrt(2.0)) / 2.0;
- }
-
- double erfc_inv(double x);
-
- double normal_quantile(double p);
-
- template <typename Iterator, typename Estimator>
- Estimate<double> bootstrap(double confidence_level, Iterator first, Iterator last, sample const& resample, Estimator&& estimator) {
- auto n_samples = last - first;
-
- double point = estimator(first, last);
- // Degenerate case with a single sample
- if (n_samples == 1) return { point, point, point, confidence_level };
-
- sample jack = jackknife(estimator, first, last);
- double jack_mean = mean(jack.begin(), jack.end());
- double sum_squares, sum_cubes;
- std::tie(sum_squares, sum_cubes) = std::accumulate(jack.begin(), jack.end(), std::make_pair(0., 0.), [jack_mean](std::pair<double, double> sqcb, double x) -> std::pair<double, double> {
- auto d = jack_mean - x;
- auto d2 = d * d;
- auto d3 = d2 * d;
- return { sqcb.first + d2, sqcb.second + d3 };
- });
-
- double accel = sum_cubes / (6 * std::pow(sum_squares, 1.5));
- int n = static_cast<int>(resample.size());
- double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / (double)n;
- // degenerate case with uniform samples
- if (prob_n == 0) return { point, point, point, confidence_level };
-
- double bias = normal_quantile(prob_n);
- double z1 = normal_quantile((1. - confidence_level) / 2.);
-
- auto cumn = [n](double x) -> int {
- return std::lround(normal_cdf(x) * n); };
- auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
- double b1 = bias + z1;
- double b2 = bias - z1;
- double a1 = a(b1);
- double a2 = a(b2);
- auto lo = std::max(cumn(a1), 0);
- auto hi = std::min(cumn(a2), n - 1);
-
- return { point, resample[lo], resample[hi], confidence_level };
- }
-
- double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n);
-
- struct bootstrap_analysis {
- Estimate<double> mean;
- Estimate<double> standard_deviation;
- double outlier_variance;
- };
-
- bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last);
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_ANALYSIS_HPP_INCLUDED
diff --git a/include/internal/benchmark/detail/catch_timing.hpp b/include/internal/benchmark/detail/catch_timing.hpp
deleted file mode 100644
index 073cb742..00000000
--- a/include/internal/benchmark/detail/catch_timing.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Timing
-
-#ifndef TWOBLUECUBES_CATCH_DETAIL_TIMING_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DETAIL_TIMING_HPP_INCLUDED
-
-#include "../catch_clock.hpp"
-#include "catch_complete_invoke.hpp"
-
-#include <tuple>
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration, typename Result>
- struct Timing {
- Duration elapsed;
- Result result;
- int iterations;
- };
- template <typename Clock, typename Sig>
- using TimingOf = Timing<ClockDuration<Clock>, Detail::CompleteType_t<Detail::ResultOf_t<Sig>>>;
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_DETAIL_TIMING_HPP_INCLUDED
diff --git a/include/internal/catch_approx.cpp b/include/internal/catch_approx.cpp
deleted file mode 100644
index 32b5e043..00000000
--- a/include/internal/catch_approx.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_approx.h"
-#include "catch_enforce.h"
-
-#include <cmath>
-#include <limits>
-
-namespace {
-
-// Performs equivalent check of std::fabs(lhs - rhs) <= margin
-// But without the subtraction to allow for INFINITY in comparison
-bool marginComparison(double lhs, double rhs, double margin) {
- return (lhs + margin >= rhs) && (rhs + margin >= lhs);
-}
-
-}
-
-namespace Catch {
-namespace Detail {
-
- Approx::Approx ( double value )
- : m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
- m_margin( 0.0 ),
- m_scale( 0.0 ),
- m_value( value )
- {}
-
- Approx Approx::custom() {
- return Approx( 0 );
- }
-
- Approx Approx::operator-() const {
- auto temp(*this);
- temp.m_value = -temp.m_value;
- return temp;
- }
-
-
- std::string Approx::toString() const {
- ReusableStringStream rss;
- rss << "Approx( " << ::Catch::Detail::stringify( m_value ) << " )";
- return rss.str();
- }
-
- bool Approx::equalityComparisonImpl(const double other) const {
- // First try with fixed margin, then compute margin based on epsilon, scale and Approx's value
- // Thanks to Richard Harris for his help refining the scaled margin value
- return marginComparison(m_value, other, m_margin)
- || marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(std::isinf(m_value)? 0 : m_value)));
- }
-
- void Approx::setMargin(double newMargin) {
- CATCH_ENFORCE(newMargin >= 0,
- "Invalid Approx::margin: " << newMargin << '.'
- << " Approx::Margin has to be non-negative.");
- m_margin = newMargin;
- }
-
- void Approx::setEpsilon(double newEpsilon) {
- CATCH_ENFORCE(newEpsilon >= 0 && newEpsilon <= 1.0,
- "Invalid Approx::epsilon: " << newEpsilon << '.'
- << " Approx::epsilon has to be in [0, 1]");
- m_epsilon = newEpsilon;
- }
-
-} // end namespace Detail
-
-namespace literals {
- Detail::Approx operator "" _a(long double val) {
- return Detail::Approx(val);
- }
- Detail::Approx operator "" _a(unsigned long long val) {
- return Detail::Approx(val);
- }
-} // end namespace literals
-
-std::string StringMaker<Catch::Detail::Approx>::convert(Catch::Detail::Approx const& value) {
- return value.toString();
-}
-
-} // end namespace Catch
diff --git a/include/internal/catch_approx.h b/include/internal/catch_approx.h
deleted file mode 100644
index 4522e5ad..00000000
--- a/include/internal/catch_approx.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Created by Phil on 28/04/2011.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
-
-#include "catch_tostring.h"
-
-#include <type_traits>
-
-namespace Catch {
-namespace Detail {
-
- class Approx {
- private:
- bool equalityComparisonImpl(double other) const;
- // Validates the new margin (margin >= 0)
- // out-of-line to avoid including stdexcept in the header
- void setMargin(double margin);
- // Validates the new epsilon (0 < epsilon < 1)
- // out-of-line to avoid including stdexcept in the header
- void setEpsilon(double epsilon);
-
- public:
- explicit Approx ( double value );
-
- static Approx custom();
-
- Approx operator-() const;
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx operator()( T const& value ) {
- Approx approx( static_cast<double>(value) );
- approx.m_epsilon = m_epsilon;
- approx.m_margin = m_margin;
- approx.m_scale = m_scale;
- return approx;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- explicit Approx( T const& value ): Approx(static_cast<double>(value))
- {}
-
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator == ( const T& lhs, Approx const& rhs ) {
- auto lhs_v = static_cast<double>(lhs);
- return rhs.equalityComparisonImpl(lhs_v);
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator == ( Approx const& lhs, const T& rhs ) {
- return operator==( rhs, lhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator != ( T const& lhs, Approx const& rhs ) {
- return !operator==( lhs, rhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator != ( Approx const& lhs, T const& rhs ) {
- return !operator==( rhs, lhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator <= ( T const& lhs, Approx const& rhs ) {
- return static_cast<double>(lhs) < rhs.m_value || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator <= ( Approx const& lhs, T const& rhs ) {
- return lhs.m_value < static_cast<double>(rhs) || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator >= ( T const& lhs, Approx const& rhs ) {
- return static_cast<double>(lhs) > rhs.m_value || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator >= ( Approx const& lhs, T const& rhs ) {
- return lhs.m_value > static_cast<double>(rhs) || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& epsilon( T const& newEpsilon ) {
- double epsilonAsDouble = static_cast<double>(newEpsilon);
- setEpsilon(epsilonAsDouble);
- return *this;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& margin( T const& newMargin ) {
- double marginAsDouble = static_cast<double>(newMargin);
- setMargin(marginAsDouble);
- return *this;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& scale( T const& newScale ) {
- m_scale = static_cast<double>(newScale);
- return *this;
- }
-
- std::string toString() const;
-
- private:
- double m_epsilon;
- double m_margin;
- double m_scale;
- double m_value;
- };
-} // end namespace Detail
-
-namespace literals {
- Detail::Approx operator "" _a(long double val);
- Detail::Approx operator "" _a(unsigned long long val);
-} // end namespace literals
-
-template<>
-struct StringMaker<Catch::Detail::Approx> {
- static std::string convert(Catch::Detail::Approx const& value);
-};
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp
deleted file mode 100644
index fd14c85a..00000000
--- a/include/internal/catch_assertionhandler.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Created by Phil on 8/8/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_assertionhandler.h"
-#include "catch_assertionresult.h"
-#include "catch_interfaces_runner.h"
-#include "catch_interfaces_config.h"
-#include "catch_context.h"
-#include "catch_debugger.h"
-#include "catch_interfaces_registry_hub.h"
-#include "catch_capture_matchers.h"
-#include "catch_run_context.h"
-#include "catch_enforce.h"
-
-namespace Catch {
-
- namespace {
- auto operator <<( std::ostream& os, ITransientExpression const& expr ) -> std::ostream& {
- expr.streamReconstructedExpression( os );
- return os;
- }
- }
-
- LazyExpression::LazyExpression( bool isNegated )
- : m_isNegated( isNegated )
- {}
-
- LazyExpression::LazyExpression( LazyExpression const& other ) : m_isNegated( other.m_isNegated ) {}
-
- LazyExpression::operator bool() const {
- return m_transientExpression != nullptr;
- }
-
- auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream& {
- if( lazyExpr.m_isNegated )
- os << "!";
-
- if( lazyExpr ) {
- if( lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression() )
- os << "(" << *lazyExpr.m_transientExpression << ")";
- else
- os << *lazyExpr.m_transientExpression;
- }
- else {
- os << "{** error - unchecked empty expression requested **}";
- }
- return os;
- }
-
- AssertionHandler::AssertionHandler
- ( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- StringRef capturedExpression,
- ResultDisposition::Flags resultDisposition )
- : m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
- m_resultCapture( getResultCapture() )
- {}
-
- void AssertionHandler::handleExpr( ITransientExpression const& expr ) {
- m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction );
- }
- void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef const& message) {
- m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction );
- }
-
- auto AssertionHandler::allowThrows() const -> bool {
- return getCurrentContext().getConfig()->allowThrows();
- }
-
- void AssertionHandler::complete() {
- setCompleted();
- if( m_reaction.shouldDebugBreak ) {
-
- // If you find your debugger stopping you here then go one level up on the
- // call-stack for the code that caused it (typically a failed assertion)
-
- // (To go back to the test and change execution, jump over the throw, next)
- CATCH_BREAK_INTO_DEBUGGER();
- }
- if (m_reaction.shouldThrow) {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- throw Catch::TestFailureException();
-#else
- CATCH_ERROR( "Test failure requires aborting test!" );
-#endif
- }
- }
- void AssertionHandler::setCompleted() {
- m_completed = true;
- }
-
- void AssertionHandler::handleUnexpectedInflightException() {
- m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
- }
-
- void AssertionHandler::handleExceptionThrownAsExpected() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
- void AssertionHandler::handleExceptionNotThrownAsExpected() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
-
- void AssertionHandler::handleUnexpectedExceptionNotThrown() {
- m_resultCapture.handleUnexpectedExceptionNotThrown( m_assertionInfo, m_reaction );
- }
-
- void AssertionHandler::handleThrowingCallSkipped() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
-
- // This is the overload that takes a string and infers the Equals matcher from it
- // The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp
- void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString ) {
- handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString );
- }
-
-} // namespace Catch
diff --git a/include/internal/catch_assertionhandler.h b/include/internal/catch_assertionhandler.h
deleted file mode 100644
index 3089e662..00000000
--- a/include/internal/catch_assertionhandler.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Created by Phil on 8/8/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ASSERTIONHANDLER_H_INCLUDED
-#define TWOBLUECUBES_CATCH_ASSERTIONHANDLER_H_INCLUDED
-
-#include "catch_assertioninfo.h"
-#include "catch_decomposer.h"
-#include "catch_interfaces_capture.h"
-
-namespace Catch {
-
- struct TestFailureException{};
- struct AssertionResultData;
- struct IResultCapture;
- class RunContext;
-
- class LazyExpression {
- friend class AssertionHandler;
- friend struct AssertionStats;
- friend class RunContext;
-
- ITransientExpression const* m_transientExpression = nullptr;
- bool m_isNegated;
- public:
- LazyExpression( bool isNegated );
- LazyExpression( LazyExpression const& other );
- LazyExpression& operator = ( LazyExpression const& ) = delete;
-
- explicit operator bool() const;
-
- friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&;
- };
-
- struct AssertionReaction {
- bool shouldDebugBreak = false;
- bool shouldThrow = false;
- };
-
- class AssertionHandler {
- AssertionInfo m_assertionInfo;
- AssertionReaction m_reaction;
- bool m_completed = false;
- IResultCapture& m_resultCapture;
-
- public:
- AssertionHandler
- ( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- StringRef capturedExpression,
- ResultDisposition::Flags resultDisposition );
- ~AssertionHandler() {
- if ( !m_completed ) {
- m_resultCapture.handleIncomplete( m_assertionInfo );
- }
- }
-
-
- template<typename T>
- void handleExpr( ExprLhs<T> const& expr ) {
- handleExpr( expr.makeUnaryExpr() );
- }
- void handleExpr( ITransientExpression const& expr );
-
- void handleMessage(ResultWas::OfType resultType, StringRef const& message);
-
- void handleExceptionThrownAsExpected();
- void handleUnexpectedExceptionNotThrown();
- void handleExceptionNotThrownAsExpected();
- void handleThrowingCallSkipped();
- void handleUnexpectedInflightException();
-
- void complete();
- void setCompleted();
-
- // query
- auto allowThrows() const -> bool;
- };
-
- void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString );
-
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_ASSERTIONHANDLER_H_INCLUDED
diff --git a/include/internal/catch_assertioninfo.h b/include/internal/catch_assertioninfo.h
deleted file mode 100644
index 5f136bf7..00000000
--- a/include/internal/catch_assertioninfo.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Created by Phil on 8/8/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ASSERTIONINFO_H_INCLUDED
-#define TWOBLUECUBES_CATCH_ASSERTIONINFO_H_INCLUDED
-
-#include "catch_result_type.h"
-#include "catch_common.h"
-#include "catch_stringref.h"
-
-namespace Catch {
-
- struct AssertionInfo
- {
- StringRef macroName;
- SourceLineInfo lineInfo;
- StringRef capturedExpression;
- ResultDisposition::Flags resultDisposition;
-
- // We want to delete this constructor but a compiler bug in 4.8 means
- // the struct is then treated as non-aggregate
- //AssertionInfo() = delete;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_ASSERTIONINFO_H_INCLUDED
diff --git a/include/internal/catch_assertionresult.cpp b/include/internal/catch_assertionresult.cpp
deleted file mode 100644
index 608a9add..00000000
--- a/include/internal/catch_assertionresult.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Created by Phil on 8/8/12
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_assertionresult.h"
-
-namespace Catch {
- AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const & _lazyExpression):
- lazyExpression(_lazyExpression),
- resultType(_resultType) {}
-
- std::string AssertionResultData::reconstructExpression() const {
-
- if( reconstructedExpression.empty() ) {
- if( lazyExpression ) {
- ReusableStringStream rss;
- rss << lazyExpression;
- reconstructedExpression = rss.str();
- }
- }
- return reconstructedExpression;
- }
-
- AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
- : m_info( info ),
- m_resultData( data )
- {}
-
- // Result was a success
- bool AssertionResult::succeeded() const {
- return Catch::isOk( m_resultData.resultType );
- }
-
- // Result was a success, or failure is suppressed
- bool AssertionResult::isOk() const {
- return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
- }
-
- ResultWas::OfType AssertionResult::getResultType() const {
- return m_resultData.resultType;
- }
-
- bool AssertionResult::hasExpression() const {
- return !m_info.capturedExpression.empty();
- }
-
- bool AssertionResult::hasMessage() const {
- return !m_resultData.message.empty();
- }
-
- std::string AssertionResult::getExpression() const {
- // Possibly overallocating by 3 characters should be basically free
- std::string expr; expr.reserve(m_info.capturedExpression.size() + 3);
- if (isFalseTest(m_info.resultDisposition)) {
- expr += "!(";
- }
- expr += m_info.capturedExpression;
- if (isFalseTest(m_info.resultDisposition)) {
- expr += ')';
- }
- return expr;
- }
-
- std::string AssertionResult::getExpressionInMacro() const {
- std::string expr;
- if( m_info.macroName.empty() )
- expr = static_cast<std::string>(m_info.capturedExpression);
- else {
- expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
- expr += m_info.macroName;
- expr += "( ";
- expr += m_info.capturedExpression;
- expr += " )";
- }
- return expr;
- }
-
- bool AssertionResult::hasExpandedExpression() const {
- return hasExpression() && getExpandedExpression() != getExpression();
- }
-
- std::string AssertionResult::getExpandedExpression() const {
- std::string expr = m_resultData.reconstructExpression();
- return expr.empty()
- ? getExpression()
- : expr;
- }
-
- std::string AssertionResult::getMessage() const {
- return m_resultData.message;
- }
- SourceLineInfo AssertionResult::getSourceInfo() const {
- return m_info.lineInfo;
- }
-
- StringRef AssertionResult::getTestMacroName() const {
- return m_info.macroName;
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h
deleted file mode 100644
index 3c91ea58..00000000
--- a/include/internal/catch_assertionresult.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Created by Phil on 28/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
-#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
-
-#include <string>
-#include "catch_assertioninfo.h"
-#include "catch_result_type.h"
-#include "catch_common.h"
-#include "catch_stringref.h"
-#include "catch_assertionhandler.h"
-
-namespace Catch {
-
- struct AssertionResultData
- {
- AssertionResultData() = delete;
-
- AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression );
-
- std::string message;
- mutable std::string reconstructedExpression;
- LazyExpression lazyExpression;
- ResultWas::OfType resultType;
-
- std::string reconstructExpression() const;
- };
-
- class AssertionResult {
- public:
- AssertionResult() = delete;
- AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
-
- bool isOk() const;
- bool succeeded() const;
- ResultWas::OfType getResultType() const;
- bool hasExpression() const;
- bool hasMessage() const;
- std::string getExpression() const;
- std::string getExpressionInMacro() const;
- bool hasExpandedExpression() const;
- std::string getExpandedExpression() const;
- std::string getMessage() const;
- SourceLineInfo getSourceInfo() const;
- StringRef getTestMacroName() const;
-
- //protected:
- AssertionInfo m_info;
- AssertionResultData m_resultData;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
deleted file mode 100644
index 6b2f7727..00000000
--- a/include/internal/catch_capture.hpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Created by Phil on 18/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
-
-#include "catch_assertionhandler.h"
-#include "catch_interfaces_capture.h"
-#include "catch_message.h"
-#include "catch_stringref.h"
-
-#if !defined(CATCH_CONFIG_DISABLE)
-
-#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
- #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__
-#else
- #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
-#endif
-
-#if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-
-///////////////////////////////////////////////////////////////////////////////
-// Another way to speed-up compilation is to omit local try-catch for REQUIRE*
-// macros.
-#define INTERNAL_CATCH_TRY
-#define INTERNAL_CATCH_CATCH( capturer )
-
-#else // CATCH_CONFIG_FAST_COMPILE
-
-#define INTERNAL_CATCH_TRY try
-#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); }
-
-#endif
-
-#define INTERNAL_CATCH_REACT( handler ) handler.complete();
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
- do { \
- /* The expression should not be evaluated, but warnings should hopefully be checked */ \
- CATCH_INTERNAL_IGNORE_BUT_WARN(__VA_ARGS__); \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
- INTERNAL_CATCH_TRY { \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( Catch::getResultCapture().lastAssertionPassed() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( !Catch::getResultCapture().lastAssertionPassed() )
-
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-
-#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... )
-#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... )
-#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr )
-
-#else
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(expr); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( exceptionType const& ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-#endif // CATCH_CONFIG_DISABLE_EXCEPTIONS
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
- catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
- auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \
- varName.captureValues( 0, __VA_ARGS__ )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_INFO( macroName, log ) \
- Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log );
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
- Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
-
-///////////////////////////////////////////////////////////////////////////////
-// Although this is matcher-based, it can be used with just a string
-#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-#endif // CATCH_CONFIG_DISABLE
-
-#endif // TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
diff --git a/include/internal/catch_capture_matchers.cpp b/include/internal/catch_capture_matchers.cpp
deleted file mode 100644
index 6f320449..00000000
--- a/include/internal/catch_capture_matchers.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Created by Phil on 9/8/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#include "catch_capture_matchers.h"
-#include "catch_interfaces_registry_hub.h"
-
-namespace Catch {
-
- using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
-
- // This is the general overload that takes a any string matcher
- // There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
- // the Equals matcher (so the header does not mention matchers)
- void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ) {
- std::string exceptionMessage = Catch::translateActiveException();
- MatchExpr<std::string, StringMatcher const&> expr( exceptionMessage, matcher, matcherString );
- handler.handleExpr( expr );
- }
-
-} // namespace Catch
diff --git a/include/internal/catch_capture_matchers.h b/include/internal/catch_capture_matchers.h
deleted file mode 100644
index 5386e5e1..00000000
--- a/include/internal/catch_capture_matchers.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Created by Phil on 9/8/2017
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CAPTURE_MATCHERS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CAPTURE_MATCHERS_HPP_INCLUDED
-
-#include "catch_capture.hpp"
-#include "catch_matchers.h"
-#include "catch_matchers_exception.hpp"
-#include "catch_matchers_floating.h"
-#include "catch_matchers_generic.hpp"
-#include "catch_matchers_string.h"
-#include "catch_matchers_vector.h"
-#include "catch_stringref.h"
-
-namespace Catch {
-
- template<typename ArgT, typename MatcherT>
- class MatchExpr : public ITransientExpression {
- ArgT const& m_arg;
- MatcherT m_matcher;
- StringRef m_matcherString;
- public:
- MatchExpr( ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString )
- : ITransientExpression{ true, matcher.match( arg ) },
- m_arg( arg ),
- m_matcher( matcher ),
- m_matcherString( matcherString )
- {}
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- auto matcherAsString = m_matcher.toString();
- os << Catch::Detail::stringify( m_arg ) << ' ';
- if( matcherAsString == Detail::unprintableString )
- os << m_matcherString;
- else
- os << matcherAsString;
- }
- };
-
- using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
-
- void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString );
-
- template<typename ArgT, typename MatcherT>
- auto makeMatchExpr( ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString ) -> MatchExpr<ArgT, MatcherT> {
- return MatchExpr<ArgT, MatcherT>( arg, matcher, matcherString );
- }
-
-} // namespace Catch
-
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CHECK_THAT( macroName, matcher, resultDisposition, arg ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- INTERNAL_CATCH_TRY { \
- catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher, #matcher##_catch_sr ) ); \
- } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_MATCHES( macroName, exceptionType, resultDisposition, matcher, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__ ); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( exceptionType const& ex ) { \
- catchAssertionHandler.handleExpr( Catch::makeMatchExpr( ex, matcher, #matcher##_catch_sr ) ); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-#endif // TWOBLUECUBES_CATCH_CAPTURE_MATCHERS_HPP_INCLUDED
diff --git a/include/internal/catch_clara.h b/include/internal/catch_clara.h
deleted file mode 100644
index bdf70250..00000000
--- a/include/internal/catch_clara.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Created by Phil on 10/2/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
-#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
-
-// Use Catch's value for console width (store Clara's off to the side, if present)
-#ifdef CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#undef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#endif
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH-1
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#pragma clang diagnostic ignored "-Wexit-time-destructors"
-#pragma clang diagnostic ignored "-Wshadow"
-#endif
-
-#include "../external/clara.hpp"
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// Restore Clara's value for console width, if present
-#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-#endif // TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
diff --git a/include/internal/catch_commandline.cpp b/include/internal/catch_commandline.cpp
deleted file mode 100644
index a4010850..00000000
--- a/include/internal/catch_commandline.cpp
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Created by Phil on 02/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_commandline.h"
-
-#include "catch_string_manip.h"
-
-#include "catch_interfaces_registry_hub.h"
-#include "catch_interfaces_reporter.h"
-
-#include <fstream>
-#include <ctime>
-
-namespace Catch {
-
- clara::Parser makeCommandLineParser( ConfigData& config ) {
-
- using namespace clara;
-
- auto const setWarning = [&]( std::string const& warning ) {
- auto warningSet = [&]() {
- if( warning == "NoAssertions" )
- return WarnAbout::NoAssertions;
-
- if ( warning == "NoTests" )
- return WarnAbout::NoTests;
-
- return WarnAbout::Nothing;
- }();
-
- if (warningSet == WarnAbout::Nothing)
- return ParserResult::runtimeError( "Unrecognised warning: '" + warning + "'" );
- config.warnings = static_cast<WarnAbout::What>( config.warnings | warningSet );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const loadTestNamesFromFile = [&]( std::string const& filename ) {
- std::ifstream f( filename.c_str() );
- if( !f.is_open() )
- return ParserResult::runtimeError( "Unable to load input file: '" + filename + "'" );
-
- std::string line;
- while( std::getline( f, line ) ) {
- line = trim(line);
- if( !line.empty() && !startsWith( line, '#' ) ) {
- if( !startsWith( line, '"' ) )
- line = '"' + line + '"';
- config.testsOrTags.push_back( line );
- config.testsOrTags.emplace_back( "," );
- }
- }
- //Remove comma in the end
- if(!config.testsOrTags.empty())
- config.testsOrTags.erase( config.testsOrTags.end()-1 );
-
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setTestOrder = [&]( std::string const& order ) {
- if( startsWith( "declared", order ) )
- config.runOrder = RunTests::InDeclarationOrder;
- else if( startsWith( "lexical", order ) )
- config.runOrder = RunTests::InLexicographicalOrder;
- else if( startsWith( "random", order ) )
- config.runOrder = RunTests::InRandomOrder;
- else
- return clara::ParserResult::runtimeError( "Unrecognised ordering: '" + order + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setRngSeed = [&]( std::string const& seed ) {
- if( seed != "time" )
- return clara::detail::convertInto( seed, config.rngSeed );
- config.rngSeed = static_cast<unsigned int>( std::time(nullptr) );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setColourUsage = [&]( std::string const& useColour ) {
- auto mode = toLower( useColour );
-
- if( mode == "yes" )
- config.useColour = UseColour::Yes;
- else if( mode == "no" )
- config.useColour = UseColour::No;
- else if( mode == "auto" )
- config.useColour = UseColour::Auto;
- else
- return ParserResult::runtimeError( "colour mode must be one of: auto, yes or no. '" + useColour + "' not recognised" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setWaitForKeypress = [&]( std::string const& keypress ) {
- auto keypressLc = toLower( keypress );
- if (keypressLc == "never")
- config.waitForKeypress = WaitForKeypress::Never;
- else if( keypressLc == "start" )
- config.waitForKeypress = WaitForKeypress::BeforeStart;
- else if( keypressLc == "exit" )
- config.waitForKeypress = WaitForKeypress::BeforeExit;
- else if( keypressLc == "both" )
- config.waitForKeypress = WaitForKeypress::BeforeStartAndExit;
- else
- return ParserResult::runtimeError( "keypress argument must be one of: never, start, exit or both. '" + keypress + "' not recognised" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setVerbosity = [&]( std::string const& verbosity ) {
- auto lcVerbosity = toLower( verbosity );
- if( lcVerbosity == "quiet" )
- config.verbosity = Verbosity::Quiet;
- else if( lcVerbosity == "normal" )
- config.verbosity = Verbosity::Normal;
- else if( lcVerbosity == "high" )
- config.verbosity = Verbosity::High;
- else
- return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setReporter = [&]( std::string const& reporter ) {
- IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
-
- auto lcReporter = toLower( reporter );
- auto result = factories.find( lcReporter );
-
- if( factories.end() != result )
- config.reporterName = lcReporter;
- else
- return ParserResult::runtimeError( "Unrecognized reporter, '" + reporter + "'. Check available with --list-reporters" );
- return ParserResult::ok( ParseResultType::Matched );
- };
-
- auto cli
- = ExeName( config.processName )
- | Help( config.showHelp )
- | Opt( config.listTests )
- ["-l"]["--list-tests"]
- ( "list all/matching test cases" )
- | Opt( config.listTags )
- ["-t"]["--list-tags"]
- ( "list all/matching tags" )
- | Opt( config.showSuccessfulTests )
- ["-s"]["--success"]
- ( "include successful tests in output" )
- | Opt( config.shouldDebugBreak )
- ["-b"]["--break"]
- ( "break into debugger on failure" )
- | Opt( config.noThrow )
- ["-e"]["--nothrow"]
- ( "skip exception tests" )
- | Opt( config.showInvisibles )
- ["-i"]["--invisibles"]
- ( "show invisibles (tabs, newlines)" )
- | Opt( config.outputFilename, "filename" )
- ["-o"]["--out"]
- ( "output filename" )
- | Opt( setReporter, "name" )
- ["-r"]["--reporter"]
- ( "reporter to use (defaults to console)" )
- | Opt( config.name, "name" )
- ["-n"]["--name"]
- ( "suite name" )
- | Opt( [&]( bool ){ config.abortAfter = 1; } )
- ["-a"]["--abort"]
- ( "abort at first failure" )
- | Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" )
- ["-x"]["--abortx"]
- ( "abort after x failures" )
- | Opt( setWarning, "warning name" )
- ["-w"]["--warn"]
- ( "enable warnings" )
- | Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
- ["-d"]["--durations"]
- ( "show test durations" )
- | Opt( loadTestNamesFromFile, "filename" )
- ["-f"]["--input-file"]
- ( "load test names to run from a file" )
- | Opt( config.filenamesAsTags )
- ["-#"]["--filenames-as-tags"]
- ( "adds a tag for the filename" )
- | Opt( config.sectionsToRun, "section name" )
- ["-c"]["--section"]
- ( "specify section to run" )
- | Opt( setVerbosity, "quiet|normal|high" )
- ["-v"]["--verbosity"]
- ( "set output verbosity" )
- | Opt( config.listTestNamesOnly )
- ["--list-test-names-only"]
- ( "list all/matching test cases names only" )
- | Opt( config.listReporters )
- ["--list-reporters"]
- ( "list all reporters" )
- | Opt( setTestOrder, "decl|lex|rand" )
- ["--order"]
- ( "test case order (defaults to decl)" )
- | Opt( setRngSeed, "'time'|number" )
- ["--rng-seed"]
- ( "set a specific seed for random numbers" )
- | Opt( setColourUsage, "yes|no" )
- ["--use-colour"]
- ( "should output be colourised" )
- | Opt( config.libIdentify )
- ["--libidentify"]
- ( "report name and version according to libidentify standard" )
- | Opt( setWaitForKeypress, "never|start|exit|both" )
- ["--wait-for-keypress"]
- ( "waits for a keypress before exiting" )
- | Opt( config.benchmarkSamples, "samples" )
- ["--benchmark-samples"]
- ( "number of samples to collect (default: 100)" )
- | Opt( config.benchmarkResamples, "resamples" )
- ["--benchmark-resamples"]
- ( "number of resamples for the bootstrap (default: 100000)" )
- | Opt( config.benchmarkConfidenceInterval, "confidence interval" )
- ["--benchmark-confidence-interval"]
- ( "confidence interval for the bootstrap (between 0 and 1, default: 0.95)" )
- | Opt( config.benchmarkNoAnalysis )
- ["--benchmark-no-analysis"]
- ( "perform only measurements; do not perform any analysis" )
- | Opt( config.benchmarkWarmupTime, "benchmarkWarmupTime" )
- ["--benchmark-warmup-time"]
- ( "amount of time in milliseconds spent on warming up each test (default: 100)" )
- | Arg( config.testsOrTags, "test name|pattern|tags" )
- ( "which test or tests to use" );
-
- return cli;
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_commandline.h b/include/internal/catch_commandline.h
deleted file mode 100644
index b73cfa2d..00000000
--- a/include/internal/catch_commandline.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Created by Phil on 02/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
-
-#include "catch_config.hpp"
-#include "catch_clara.h"
-
-namespace Catch {
-
- clara::Parser makeCommandLineParser( ConfigData& config );
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
diff --git a/include/internal/catch_common.cpp b/include/internal/catch_common.cpp
deleted file mode 100644
index 790acbe5..00000000
--- a/include/internal/catch_common.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Created by Phil on 27/11/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_common.h"
-#include "catch_context.h"
-#include "catch_interfaces_config.h"
-
-#include <cstring>
-#include <ostream>
-
-namespace Catch {
-
- bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const noexcept {
- return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0);
- }
- bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const noexcept {
- // We can assume that the same file will usually have the same pointer.
- // Thus, if the pointers are the same, there is no point in calling the strcmp
- return line < other.line || ( line == other.line && file != other.file && (std::strcmp(file, other.file) < 0));
- }
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
-#ifndef __GNUG__
- os << info.file << '(' << info.line << ')';
-#else
- os << info.file << ':' << info.line;
-#endif
- return os;
- }
-
- std::string StreamEndStop::operator+() const {
- return std::string();
- }
-
- NonCopyable::NonCopyable() = default;
- NonCopyable::~NonCopyable() = default;
-
-}
diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h
deleted file mode 100644
index 5e097fbf..00000000
--- a/include/internal/catch_common.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Created by Phil on 29/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
-#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
-
-#include "catch_compiler_capabilities.h"
-
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
-#ifdef CATCH_CONFIG_COUNTER
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
-#else
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
-#endif
-
-#include <iosfwd>
-#include <string>
-#include <cstdint>
-
-// We need a dummy global operator<< so we can bring it into Catch namespace later
-struct Catch_global_namespace_dummy {};
-std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
-
-namespace Catch {
-
- struct CaseSensitive { enum Choice {
- Yes,
- No
- }; };
-
- class NonCopyable {
- NonCopyable( NonCopyable const& ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable& operator = ( NonCopyable const& ) = delete;
- NonCopyable& operator = ( NonCopyable && ) = delete;
-
- protected:
- NonCopyable();
- virtual ~NonCopyable();
- };
-
- struct SourceLineInfo {
-
- SourceLineInfo() = delete;
- SourceLineInfo( char const* _file, std::size_t _line ) noexcept
- : file( _file ),
- line( _line )
- {}
-
- SourceLineInfo( SourceLineInfo const& other ) = default;
- SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
- SourceLineInfo( SourceLineInfo&& ) noexcept = default;
- SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
-
- bool empty() const noexcept { return file[0] == '\0'; }
- bool operator == ( SourceLineInfo const& other ) const noexcept;
- bool operator < ( SourceLineInfo const& other ) const noexcept;
-
- char const* file;
- std::size_t line;
- };
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
-
- // Bring in operator<< from global namespace into Catch namespace
- // This is necessary because the overload of operator<< above makes
- // lookup stop at namespace Catch
- using ::operator<<;
-
- // Use this in variadic streaming macros to allow
- // >> +StreamEndStop
- // as well as
- // >> stuff +StreamEndStop
- struct StreamEndStop {
- std::string operator+() const;
- };
- template<typename T>
- T const& operator + ( T const& value, StreamEndStop ) {
- return value;
- }
-}
-
-#define CATCH_INTERNAL_LINEINFO \
- ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
-
-#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
-
diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h
deleted file mode 100644
index 0ea76137..00000000
--- a/include/internal/catch_compiler_capabilities.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Created by Phil on 15/04/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
-
-// Detect a number of compiler features - by compiler
-// The following features are defined:
-//
-// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
-// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
-// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
-// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled?
-// ****************
-// Note to maintainers: if new toggles are added please document them
-// in configuration.md, too
-// ****************
-
-// In general each macro has a _NO_<feature name> form
-// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature.
-// Many features, at point of detection, define an _INTERNAL_ macro, so they
-// can be combined, en-mass, with the _NO_ forms later.
-
-#include "catch_platform.h"
-
-#ifdef __cplusplus
-
-# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
-# define CATCH_CPP14_OR_GREATER
-# endif
-
-# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
-# define CATCH_CPP17_OR_GREATER
-# endif
-
-#endif
-
-#if defined(CATCH_CPP17_OR_GREATER)
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif
-
-// We have to avoid both ICC and Clang, because they try to mask themselves
-// as gcc, and we want only GCC in this block
-#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
-
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
-
-#endif
-
-#if defined(__clang__)
-
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
-
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
-
-
-# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
- _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
-
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
-
-#endif // __clang__
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Assume that non-Windows platforms support posix signals by default
-#if !defined(CATCH_PLATFORM_WINDOWS)
- #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// We know some environments not to support full POSIX signals
-#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
- #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
-#endif
-
-#ifdef __OS400__
-# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
-# define CATCH_CONFIG_COLOUR_NONE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Android somehow still does not support std::to_string
-#if defined(__ANDROID__)
-# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
-# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Not all Windows environments support SEH properly
-#if defined(__MINGW32__)
-# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// PS4
-#if defined(__ORBIS__)
-# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Cygwin
-#ifdef __CYGWIN__
-
-// Required for some versions of Cygwin to declare gettimeofday
-// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
-# define _BSD_SOURCE
-// some versions of cygwin (most) do not support std::to_string. Use the libstd check.
-// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
-# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
- && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
-
-# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
-
-# endif
-#endif // __CYGWIN__
-
-////////////////////////////////////////////////////////////////////////////////
-// Visual C++
-#if defined(_MSC_VER)
-
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
-
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)sizeof(__VA_ARGS__)
-
-# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-# endif
-
-// Universal Windows platform does not support SEH
-// Or console colours (or console at all...)
-# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
-# define CATCH_CONFIG_COLOUR_NONE
-# else
-# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
-# endif
-
-// MSVC traditional preprocessor needs some workaround for __VA_ARGS__
-// _MSVC_TRADITIONAL == 0 means new conformant preprocessor
-// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
-# if !defined(__clang__) // Handle Clang masquerading for msvc
-# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
-# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-# endif // MSVC_TRADITIONAL
-# endif // __clang__
-
-#endif // _MSC_VER
-
-#if defined(_REENTRANT) || defined(_MSC_VER)
-// Enable async processing, as -pthread is specified or no additional linking is required
-# define CATCH_INTERNAL_CONFIG_USE_ASYNC
-#endif // _MSC_VER
-
-////////////////////////////////////////////////////////////////////////////////
-// Check if we are compiled with -fno-exceptions or equivalent
-#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
-# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// DJGPP
-#ifdef __DJGPP__
-# define CATCH_INTERNAL_CONFIG_NO_WCHAR
-#endif // __DJGPP__
-
-////////////////////////////////////////////////////////////////////////////////
-// Embarcadero C++Build
-#if defined(__BORLANDC__)
- #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-
-// Use of __COUNTER__ is suppressed during code analysis in
-// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly
-// handled by it.
-// Otherwise all supported compilers support COUNTER macro,
-// but user still might want to turn it off
-#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L )
- #define CATCH_INTERNAL_CONFIG_COUNTER
-#endif
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-// RTX is a special version of Windows that is real time.
-// This means that it is detected as Windows, but does not provide
-// the same set of capabilities as real Windows does.
-#if defined(UNDER_RTSS) || defined(RTX64_BUILD)
- #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
- #define CATCH_INTERNAL_CONFIG_NO_ASYNC
- #define CATCH_CONFIG_COLOUR_NONE
-#endif
-
-#if !defined(_GLIBCXX_USE_C99_MATH_TR1)
-#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
-#endif
-
-// Various stdlib support checks that require __has_include
-#if defined(__has_include)
- // Check if string_view is available and usable
- #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
- #endif
-
- // Check if optional is available and usable
- # if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
- # endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
-
- // Check if byte is available and usable
- # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
- # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
-
- // Check if variant is available and usable
- # if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
- # if defined(__clang__) && (__clang_major__ < 8)
- // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
- // fix should be in clang 8, workaround in libstdc++ 8.2
- # include <ciso646>
- # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
- # define CATCH_CONFIG_NO_CPP17_VARIANT
- # else
- # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
- # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
- # else
- # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
- # endif // defined(__clang__) && (__clang_major__ < 8)
- # endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
-#endif // defined(__has_include)
-
-
-#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
-# define CATCH_CONFIG_COUNTER
-#endif
-#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)
-# define CATCH_CONFIG_WINDOWS_SEH
-#endif
-// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
-#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)
-# define CATCH_CONFIG_POSIX_SIGNALS
-#endif
-// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions.
-#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR)
-# define CATCH_CONFIG_WCHAR
-#endif
-
-#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
-# define CATCH_CONFIG_CPP11_TO_STRING
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
-# define CATCH_CONFIG_CPP17_OPTIONAL
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
-# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
-# define CATCH_CONFIG_CPP17_STRING_VIEW
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
-# define CATCH_CONFIG_CPP17_VARIANT
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
-# define CATCH_CONFIG_CPP17_BYTE
-#endif
-
-
-#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
-# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
-#endif
-
-#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)
-# define CATCH_CONFIG_NEW_CAPTURE
-#endif
-
-#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-# define CATCH_CONFIG_DISABLE_EXCEPTIONS
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
-# define CATCH_CONFIG_POLYFILL_ISNAN
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
-# define CATCH_CONFIG_USE_ASYNC
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE)
-# define CATCH_CONFIG_ANDROID_LOGWRITE
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
-# define CATCH_CONFIG_GLOBAL_NEXTAFTER
-#endif
-
-
-// Even if we do not think the compiler has that warning, we still have
-// to provide a macro that can be used by the code.
-#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
-#endif
-#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION)
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
-#endif
-
-// The goal of this macro is to avoid evaluation of the arguments, but
-// still have the compiler warn on problems inside...
-#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN)
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...)
-#endif
-
-#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
-# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#elif defined(__clang__) && (__clang_major__ < 5)
-# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#endif
-
-#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#endif
-
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-#define CATCH_TRY if ((true))
-#define CATCH_CATCH_ALL if ((false))
-#define CATCH_CATCH_ANON(type) if ((false))
-#else
-#define CATCH_TRY try
-#define CATCH_CATCH_ALL catch (...)
-#define CATCH_CATCH_ANON(type) catch (type)
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
-#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#endif
-
-#endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
-
diff --git a/include/internal/catch_config.cpp b/include/internal/catch_config.cpp
deleted file mode 100644
index 21cd6296..00000000
--- a/include/internal/catch_config.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_config.hpp"
-#include "catch_enforce.h"
-#include "catch_stringref.h"
-
-namespace Catch {
-
- Config::Config( ConfigData const& data )
- : m_data( data ),
- m_stream( openStream() )
- {
- // We need to trim filter specs to avoid trouble with superfluous
- // whitespace (esp. important for bdd macros, as those are manually
- // aligned with whitespace).
-
- for (auto& elem : m_data.testsOrTags) {
- elem = trim(elem);
- }
- for (auto& elem : m_data.sectionsToRun) {
- elem = trim(elem);
- }
-
- TestSpecParser parser(ITagAliasRegistry::get());
- if (!m_data.testsOrTags.empty()) {
- m_hasTestFilters = true;
- for (auto const& testOrTags : m_data.testsOrTags) {
- parser.parse(testOrTags);
- }
- }
- m_testSpec = parser.testSpec();
- }
-
- std::string const& Config::getFilename() const {
- return m_data.outputFilename ;
- }
-
- bool Config::listTests() const { return m_data.listTests; }
- bool Config::listTestNamesOnly() const { return m_data.listTestNamesOnly; }
- bool Config::listTags() const { return m_data.listTags; }
- bool Config::listReporters() const { return m_data.listReporters; }
-
- std::string Config::getProcessName() const { return m_data.processName; }
- std::string const& Config::getReporterName() const { return m_data.reporterName; }
-
- std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
- std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
-
- TestSpec const& Config::testSpec() const { return m_testSpec; }
- bool Config::hasTestFilters() const { return m_hasTestFilters; }
-
- bool Config::showHelp() const { return m_data.showHelp; }
-
- // IConfig interface
- bool Config::allowThrows() const { return !m_data.noThrow; }
- std::ostream& Config::stream() const { return m_stream->stream(); }
- std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
- bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
- bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
- bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
- ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
- RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
- unsigned int Config::rngSeed() const { return m_data.rngSeed; }
- UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
- bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
- int Config::abortAfter() const { return m_data.abortAfter; }
- bool Config::showInvisibles() const { return m_data.showInvisibles; }
- Verbosity Config::verbosity() const { return m_data.verbosity; }
-
- bool Config::benchmarkNoAnalysis() const { return m_data.benchmarkNoAnalysis; }
- int Config::benchmarkSamples() const { return m_data.benchmarkSamples; }
- double Config::benchmarkConfidenceInterval() const { return m_data.benchmarkConfidenceInterval; }
- unsigned int Config::benchmarkResamples() const { return m_data.benchmarkResamples; }
- std::chrono::milliseconds Config::benchmarkWarmupTime() const { return std::chrono::milliseconds(m_data.benchmarkWarmupTime); }
-
- IStream const* Config::openStream() {
- return Catch::makeStream(m_data.outputFilename);
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp
deleted file mode 100644
index 64d2c035..00000000
--- a/include/internal/catch_config.hpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Created by Phil on 08/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
-
-#include "catch_test_spec_parser.h"
-#include "catch_interfaces_config.h"
-
-// Libstdc++ doesn't like incomplete classes for unique_ptr
-#include "catch_stream.h"
-
-#include <memory>
-#include <vector>
-#include <string>
-
-#ifndef CATCH_CONFIG_CONSOLE_WIDTH
-#define CATCH_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-namespace Catch {
-
- struct IStream;
-
- struct ConfigData {
- bool listTests = false;
- bool listTags = false;
- bool listReporters = false;
- bool listTestNamesOnly = false;
-
- bool showSuccessfulTests = false;
- bool shouldDebugBreak = false;
- bool noThrow = false;
- bool showHelp = false;
- bool showInvisibles = false;
- bool filenamesAsTags = false;
- bool libIdentify = false;
-
- int abortAfter = -1;
- unsigned int rngSeed = 0;
-
- bool benchmarkNoAnalysis = false;
- unsigned int benchmarkSamples = 100;
- double benchmarkConfidenceInterval = 0.95;
- unsigned int benchmarkResamples = 100000;
- std::chrono::milliseconds::rep benchmarkWarmupTime = 100;
-
- Verbosity verbosity = Verbosity::Normal;
- WarnAbout::What warnings = WarnAbout::Nothing;
- ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
- RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
- UseColour::YesOrNo useColour = UseColour::Auto;
- WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
-
- std::string outputFilename;
- std::string name;
- std::string processName;
-#ifndef CATCH_CONFIG_DEFAULT_REPORTER
-#define CATCH_CONFIG_DEFAULT_REPORTER "console"
-#endif
- std::string reporterName = CATCH_CONFIG_DEFAULT_REPORTER;
-#undef CATCH_CONFIG_DEFAULT_REPORTER
-
- std::vector<std::string> testsOrTags;
- std::vector<std::string> sectionsToRun;
- };
-
-
- class Config : public IConfig {
- public:
-
- Config() = default;
- Config( ConfigData const& data );
- virtual ~Config() = default;
-
- std::string const& getFilename() const;
-
- bool listTests() const;
- bool listTestNamesOnly() const;
- bool listTags() const;
- bool listReporters() const;
-
- std::string getProcessName() const;
- std::string const& getReporterName() const;
-
- std::vector<std::string> const& getTestsOrTags() const override;
- std::vector<std::string> const& getSectionsToRun() const override;
-
- TestSpec const& testSpec() const override;
- bool hasTestFilters() const override;
-
- bool showHelp() const;
-
- // IConfig interface
- bool allowThrows() const override;
- std::ostream& stream() const override;
- std::string name() const override;
- bool includeSuccessfulResults() const override;
- bool warnAboutMissingAssertions() const override;
- bool warnAboutNoTests() const override;
- ShowDurations::OrNot showDurations() const override;
- RunTests::InWhatOrder runOrder() const override;
- unsigned int rngSeed() const override;
- UseColour::YesOrNo useColour() const override;
- bool shouldDebugBreak() const override;
- int abortAfter() const override;
- bool showInvisibles() const override;
- Verbosity verbosity() const override;
- bool benchmarkNoAnalysis() const override;
- int benchmarkSamples() const override;
- double benchmarkConfidenceInterval() const override;
- unsigned int benchmarkResamples() const override;
- std::chrono::milliseconds benchmarkWarmupTime() const override;
-
- private:
-
- IStream const* openStream();
- ConfigData m_data;
-
- std::unique_ptr<IStream const> m_stream;
- TestSpec m_testSpec;
- bool m_hasTestFilters = false;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
diff --git a/include/internal/catch_console_colour.cpp b/include/internal/catch_console_colour.cpp
deleted file mode 100644
index de0fff43..00000000
--- a/include/internal/catch_console_colour.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Created by Phil on 25/2/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-#endif
-
-
-#include "catch_console_colour.h"
-#include "catch_enforce.h"
-#include "catch_errno_guard.h"
-#include "catch_interfaces_config.h"
-#include "catch_stream.h"
-#include "catch_context.h"
-#include "catch_platform.h"
-#include "catch_debugger.h"
-#include "catch_windows_h_proxy.h"
-
-#include <sstream>
-
-namespace Catch {
- namespace {
-
- struct IColourImpl {
- virtual ~IColourImpl() = default;
- virtual void use( Colour::Code _colourCode ) = 0;
- };
-
- struct NoColourImpl : IColourImpl {
- void use( Colour::Code ) override {}
-
- static IColourImpl* instance() {
- static NoColourImpl s_instance;
- return &s_instance;
- }
- };
-
- } // anon namespace
-} // namespace Catch
-
-#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI )
-# ifdef CATCH_PLATFORM_WINDOWS
-# define CATCH_CONFIG_COLOUR_WINDOWS
-# else
-# define CATCH_CONFIG_COLOUR_ANSI
-# endif
-#endif
-
-
-#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
-
-namespace Catch {
-namespace {
-
- class Win32ColourImpl : public IColourImpl {
- public:
- Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) )
- {
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
- GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
- originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
- originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
- }
-
- void use( Colour::Code _colourCode ) override {
- switch( _colourCode ) {
- case Colour::None: return setTextAttribute( originalForegroundAttributes );
- case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
- case Colour::Red: return setTextAttribute( FOREGROUND_RED );
- case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
- case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE );
- case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
- case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
- case Colour::Grey: return setTextAttribute( 0 );
-
- case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY );
- case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
- case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
- case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
- case Colour::BrightYellow: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN );
-
- case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
-
- default:
- CATCH_ERROR( "Unknown colour requested" );
- }
- }
-
- private:
- void setTextAttribute( WORD _textAttribute ) {
- SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes );
- }
- HANDLE stdoutHandle;
- WORD originalForegroundAttributes;
- WORD originalBackgroundAttributes;
- };
-
- IColourImpl* platformColourInstance() {
- static Win32ColourImpl s_instance;
-
- IConfigPtr config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = UseColour::Yes;
- return colourMode == UseColour::Yes
- ? &s_instance
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
-
-#include <unistd.h>
-
-namespace Catch {
-namespace {
-
- // use POSIX/ ANSI console terminal codes
- // Thanks to Adam Strzelecki for original contribution
- // (http://github.com/nanoant)
- // https://github.com/philsquared/Catch/pull/131
- class PosixColourImpl : public IColourImpl {
- public:
- void use( Colour::Code _colourCode ) override {
- switch( _colourCode ) {
- case Colour::None:
- case Colour::White: return setColour( "[0m" );
- case Colour::Red: return setColour( "[0;31m" );
- case Colour::Green: return setColour( "[0;32m" );
- case Colour::Blue: return setColour( "[0;34m" );
- case Colour::Cyan: return setColour( "[0;36m" );
- case Colour::Yellow: return setColour( "[0;33m" );
- case Colour::Grey: return setColour( "[1;30m" );
-
- case Colour::LightGrey: return setColour( "[0;37m" );
- case Colour::BrightRed: return setColour( "[1;31m" );
- case Colour::BrightGreen: return setColour( "[1;32m" );
- case Colour::BrightWhite: return setColour( "[1;37m" );
- case Colour::BrightYellow: return setColour( "[1;33m" );
-
- case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
- default: CATCH_INTERNAL_ERROR( "Unknown colour requested" );
- }
- }
- static IColourImpl* instance() {
- static PosixColourImpl s_instance;
- return &s_instance;
- }
-
- private:
- void setColour( const char* _escapeCode ) {
- getCurrentContext().getConfig()->stream()
- << '\033' << _escapeCode;
- }
- };
-
- bool useColourOnPlatform() {
- return
-#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
- !isDebuggerActive() &&
-#endif
-#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
- isatty(STDOUT_FILENO)
-#else
- false
-#endif
- ;
- }
- IColourImpl* platformColourInstance() {
- ErrnoGuard guard;
- IConfigPtr config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = useColourOnPlatform()
- ? UseColour::Yes
- : UseColour::No;
- return colourMode == UseColour::Yes
- ? PosixColourImpl::instance()
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#else // not Windows or ANSI ///////////////////////////////////////////////
-
-namespace Catch {
-
- static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); }
-
-} // end namespace Catch
-
-#endif // Windows/ ANSI/ None
-
-namespace Catch {
-
- Colour::Colour( Code _colourCode ) { use( _colourCode ); }
- Colour::Colour( Colour&& other ) noexcept {
- m_moved = other.m_moved;
- other.m_moved = true;
- }
- Colour& Colour::operator=( Colour&& other ) noexcept {
- m_moved = other.m_moved;
- other.m_moved = true;
- return *this;
- }
-
- Colour::~Colour(){ if( !m_moved ) use( None ); }
-
- void Colour::use( Code _colourCode ) {
- static IColourImpl* impl = platformColourInstance();
- // Strictly speaking, this cannot possibly happen.
- // However, under some conditions it does happen (see #1626),
- // and this change is small enough that we can let practicality
- // triumph over purity in this case.
- if (impl != nullptr) {
- impl->use( _colourCode );
- }
- }
-
- std::ostream& operator << ( std::ostream& os, Colour const& ) {
- return os;
- }
-
-} // end namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-
diff --git a/include/internal/catch_console_colour.h b/include/internal/catch_console_colour.h
deleted file mode 100644
index ec653424..00000000
--- a/include/internal/catch_console_colour.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Created by Phil on 25/2/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
-
-#include "catch_common.h"
-
-namespace Catch {
-
- struct Colour {
- enum Code {
- None = 0,
-
- White,
- Red,
- Green,
- Blue,
- Cyan,
- Yellow,
- Grey,
-
- Bright = 0x10,
-
- BrightRed = Bright | Red,
- BrightGreen = Bright | Green,
- LightGrey = Bright | Grey,
- BrightWhite = Bright | White,
- BrightYellow = Bright | Yellow,
-
- // By intention
- FileName = LightGrey,
- Warning = BrightYellow,
- ResultError = BrightRed,
- ResultSuccess = BrightGreen,
- ResultExpectedFailure = Warning,
-
- Error = BrightRed,
- Success = Green,
-
- OriginalExpression = Cyan,
- ReconstructedExpression = BrightYellow,
-
- SecondaryText = LightGrey,
- Headers = White
- };
-
- // Use constructed object for RAII guard
- Colour( Code _colourCode );
- Colour( Colour&& other ) noexcept;
- Colour& operator=( Colour&& other ) noexcept;
- ~Colour();
-
- // Use static method for one-shot changes
- static void use( Code _colourCode );
-
- private:
- bool m_moved = false;
- };
-
- std::ostream& operator << ( std::ostream& os, Colour const& );
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
diff --git a/include/internal/catch_context.cpp b/include/internal/catch_context.cpp
deleted file mode 100644
index e444a6b3..00000000
--- a/include/internal/catch_context.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Created by Phil on 31/12/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#include "catch_context.h"
-#include "catch_common.h"
-#include "catch_random_number_generator.h"
-
-namespace Catch {
-
- class Context : public IMutableContext, NonCopyable {
-
- public: // IContext
- IResultCapture* getResultCapture() override {
- return m_resultCapture;
- }
- IRunner* getRunner() override {
- return m_runner;
- }
-
- IConfigPtr const& getConfig() const override {
- return m_config;
- }
-
- ~Context() override;
-
- public: // IMutableContext
- void setResultCapture( IResultCapture* resultCapture ) override {
- m_resultCapture = resultCapture;
- }
- void setRunner( IRunner* runner ) override {
- m_runner = runner;
- }
- void setConfig( IConfigPtr const& config ) override {
- m_config = config;
- }
-
- friend IMutableContext& getCurrentMutableContext();
-
- private:
- IConfigPtr m_config;
- IRunner* m_runner = nullptr;
- IResultCapture* m_resultCapture = nullptr;
- };
-
- IMutableContext *IMutableContext::currentContext = nullptr;
-
- void IMutableContext::createContext()
- {
- currentContext = new Context();
- }
-
- void cleanUpContext() {
- delete IMutableContext::currentContext;
- IMutableContext::currentContext = nullptr;
- }
- IContext::~IContext() = default;
- IMutableContext::~IMutableContext() = default;
- Context::~Context() = default;
-
-
- SimplePcg32& rng() {
- static SimplePcg32 s_rng;
- return s_rng;
- }
-
-}
diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h
deleted file mode 100644
index c579c399..00000000
--- a/include/internal/catch_context.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Created by Phil on 31/12/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
-#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
-
-#include <memory>
-
-namespace Catch {
-
- struct IResultCapture;
- struct IRunner;
- struct IConfig;
- struct IMutableContext;
-
- using IConfigPtr = std::shared_ptr<IConfig const>;
-
- struct IContext
- {
- virtual ~IContext();
-
- virtual IResultCapture* getResultCapture() = 0;
- virtual IRunner* getRunner() = 0;
- virtual IConfigPtr const& getConfig() const = 0;
- };
-
- struct IMutableContext : IContext
- {
- virtual ~IMutableContext();
- virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
- virtual void setRunner( IRunner* runner ) = 0;
- virtual void setConfig( IConfigPtr const& config ) = 0;
-
- private:
- static IMutableContext *currentContext;
- friend IMutableContext& getCurrentMutableContext();
- friend void cleanUpContext();
- static void createContext();
- };
-
- inline IMutableContext& getCurrentMutableContext()
- {
- if( !IMutableContext::currentContext )
- IMutableContext::createContext();
- // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn)
- return *IMutableContext::currentContext;
- }
-
- inline IContext& getCurrentContext()
- {
- return getCurrentMutableContext();
- }
-
- void cleanUpContext();
-
- class SimplePcg32;
- SimplePcg32& rng();
-}
-
-#endif // TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
diff --git a/include/internal/catch_debug_console.cpp b/include/internal/catch_debug_console.cpp
deleted file mode 100644
index a341d810..00000000
--- a/include/internal/catch_debug_console.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Created by Martin on 29/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-
-#include "catch_debug_console.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_stream.h"
-#include "catch_platform.h"
-#include "catch_windows_h_proxy.h"
-
-#if defined(CATCH_CONFIG_ANDROID_LOGWRITE)
-#include <android/log.h>
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- __android_log_write( ANDROID_LOG_DEBUG, "Catch", text.c_str() );
- }
- }
-
-#elif defined(CATCH_PLATFORM_WINDOWS)
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- ::OutputDebugStringA( text.c_str() );
- }
- }
-
-#else
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- // !TBD: Need a version for Mac/ XCode and other IDEs
- Catch::cout() << text;
- }
- }
-
-#endif // Platform
diff --git a/include/internal/catch_debug_console.h b/include/internal/catch_debug_console.h
deleted file mode 100644
index 2c229a83..00000000
--- a/include/internal/catch_debug_console.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Created by Martin on 29/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_DEBUG_CONSOLE_H_INCLUDED
-#define TWOBLUECUBES_CATCH_DEBUG_CONSOLE_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
- void writeToDebugConsole( std::string const& text );
-}
-
-#endif // TWOBLUECUBES_CATCH_DEBUG_CONSOLE_H_INCLUDED
diff --git a/include/internal/catch_debugger.cpp b/include/internal/catch_debugger.cpp
deleted file mode 100644
index fc78c36e..00000000
--- a/include/internal/catch_debugger.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Created by Phil on 27/12/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-
-#include "catch_debugger.h"
-#include "catch_errno_guard.h"
-#include "catch_stream.h"
-#include "catch_platform.h"
-
-#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
-
-# include <assert.h>
-# include <stdbool.h>
-# include <sys/types.h>
-# include <unistd.h>
-# include <cstddef>
-# include <ostream>
-
-#ifdef __apple_build_version__
- // These headers will only compile with AppleClang (XCode)
- // For other compilers (Clang, GCC, ... ) we need to exclude them
-# include <sys/sysctl.h>
-#endif
-
- namespace Catch {
- #ifdef __apple_build_version__
- // The following function is taken directly from the following technical note:
- // https://developer.apple.com/library/archive/qa/qa1361/_index.html
-
- // Returns true if the current process is being debugged (either
- // running under the debugger or has a debugger attached post facto).
- bool isDebuggerActive(){
- int mib[4];
- struct kinfo_proc info;
- std::size_t size;
-
- // Initialize the flags so that, if sysctl fails for some bizarre
- // reason, we get a predictable result.
-
- info.kp_proc.p_flag = 0;
-
- // Initialize mib, which tells sysctl the info we want, in this case
- // we're looking for information about a specific process ID.
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_PID;
- mib[3] = getpid();
-
- // Call sysctl.
-
- size = sizeof(info);
- if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, nullptr, 0) != 0 ) {
- Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl;
- return false;
- }
-
- // We're being debugged if the P_TRACED flag is set.
-
- return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
- }
- #else
- bool isDebuggerActive() {
- // We need to find another way to determine this for non-appleclang compilers on macOS
- return false;
- }
- #endif
- } // namespace Catch
-
-#elif defined(CATCH_PLATFORM_LINUX)
- #include <fstream>
- #include <string>
-
- namespace Catch{
- // The standard POSIX way of detecting a debugger is to attempt to
- // ptrace() the process, but this needs to be done from a child and not
- // this process itself to still allow attaching to this process later
- // if wanted, so is rather heavy. Under Linux we have the PID of the
- // "debugger" (which doesn't need to be gdb, of course, it could also
- // be strace, for example) in /proc/$PID/status, so just get it from
- // there instead.
- bool isDebuggerActive(){
- // Libstdc++ has a bug, where std::ifstream sets errno to 0
- // This way our users can properly assert over errno values
- ErrnoGuard guard;
- std::ifstream in("/proc/self/status");
- for( std::string line; std::getline(in, line); ) {
- static const int PREFIX_LEN = 11;
- if( line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0 ) {
- // We're traced if the PID is not 0 and no other PID starts
- // with 0 digit, so it's enough to check for just a single
- // character.
- return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0';
- }
- }
-
- return false;
- }
- } // namespace Catch
-#elif defined(_MSC_VER)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#else
- namespace Catch {
- bool isDebuggerActive() { return false; }
- }
-#endif // Platform
diff --git a/include/internal/catch_debugger.h b/include/internal/catch_debugger.h
deleted file mode 100644
index 77db8aed..00000000
--- a/include/internal/catch_debugger.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Created by Phil on 3/12/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED
-#define TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED
-
-#include "catch_platform.h"
-
-namespace Catch {
- bool isDebuggerActive();
-}
-
-#ifdef CATCH_PLATFORM_MAC
-
- #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
-
-#elif defined(CATCH_PLATFORM_IPHONE)
-
- // use inline assembler
- #if defined(__i386__) || defined(__x86_64__)
- #define CATCH_TRAP() __asm__("int $3")
- #elif defined(__aarch64__)
- #define CATCH_TRAP() __asm__(".inst 0xd4200000")
- #elif defined(__arm__) && !defined(__thumb__)
- #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
- #elif defined(__arm__) && defined(__thumb__)
- #define CATCH_TRAP() __asm__(".inst 0xde01")
- #endif
-
-#elif defined(CATCH_PLATFORM_LINUX)
- // If we can use inline assembler, do it because this allows us to break
- // directly at the location of the failing check instead of breaking inside
- // raise() called from it, i.e. one stack frame below.
- #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64))
- #define CATCH_TRAP() asm volatile ("int $3") /* NOLINT */
- #else // Fall back to the generic way.
- #include <signal.h>
-
- #define CATCH_TRAP() raise(SIGTRAP)
- #endif
-#elif defined(_MSC_VER)
- #define CATCH_TRAP() __debugbreak()
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) void __stdcall DebugBreak();
- #define CATCH_TRAP() DebugBreak()
-#endif
-
-#ifndef CATCH_BREAK_INTO_DEBUGGER
- #ifdef CATCH_TRAP
- #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
- #else
- #define CATCH_BREAK_INTO_DEBUGGER() []{}()
- #endif
-#endif
-
-#endif // TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED
diff --git a/include/internal/catch_decomposer.cpp b/include/internal/catch_decomposer.cpp
deleted file mode 100644
index 8c19629b..00000000
--- a/include/internal/catch_decomposer.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Created by Phil Nash on 8/8/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_decomposer.h"
-#include "catch_config.hpp"
-
-namespace Catch {
-
- ITransientExpression::~ITransientExpression() = default;
-
- void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
- if( lhs.size() + rhs.size() < 40 &&
- lhs.find('\n') == std::string::npos &&
- rhs.find('\n') == std::string::npos )
- os << lhs << " " << op << " " << rhs;
- else
- os << lhs << "\n" << op << "\n" << rhs;
- }
-}
diff --git a/include/internal/catch_decomposer.h b/include/internal/catch_decomposer.h
deleted file mode 100644
index 08075f0e..00000000
--- a/include/internal/catch_decomposer.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Created by Phil Nash on 8/8/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_DECOMPOSER_H_INCLUDED
-#define TWOBLUECUBES_CATCH_DECOMPOSER_H_INCLUDED
-
-#include "catch_tostring.h"
-#include "catch_stringref.h"
-#include "catch_meta.hpp"
-
-#include <iosfwd>
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
-#pragma warning(disable:4018) // more "signed/unsigned mismatch"
-#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform)
-#pragma warning(disable:4180) // qualifier applied to function type has no meaning
-#pragma warning(disable:4800) // Forcing result to true or false
-#endif
-
-namespace Catch {
-
- struct ITransientExpression {
- auto isBinaryExpression() const -> bool { return m_isBinaryExpression; }
- auto getResult() const -> bool { return m_result; }
- virtual void streamReconstructedExpression( std::ostream &os ) const = 0;
-
- ITransientExpression( bool isBinaryExpression, bool result )
- : m_isBinaryExpression( isBinaryExpression ),
- m_result( result )
- {}
-
- // We don't actually need a virtual destructor, but many static analysers
- // complain if it's not here :-(
- virtual ~ITransientExpression();
-
- bool m_isBinaryExpression;
- bool m_result;
-
- };
-
- void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );
-
- template<typename LhsT, typename RhsT>
- class BinaryExpr : public ITransientExpression {
- LhsT m_lhs;
- StringRef m_op;
- RhsT m_rhs;
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- formatReconstructedExpression
- ( os, Catch::Detail::stringify( m_lhs ), m_op, Catch::Detail::stringify( m_rhs ) );
- }
-
- public:
- BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs )
- : ITransientExpression{ true, comparisonResult },
- m_lhs( lhs ),
- m_op( op ),
- m_rhs( rhs )
- {}
-
- template<typename T>
- auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
- };
-
- template<typename LhsT>
- class UnaryExpr : public ITransientExpression {
- LhsT m_lhs;
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- os << Catch::Detail::stringify( m_lhs );
- }
-
- public:
- explicit UnaryExpr( LhsT lhs )
- : ITransientExpression{ false, static_cast<bool>(lhs) },
- m_lhs( lhs )
- {}
- };
-
-
- // Specialised comparison functions to handle equality comparisons between ints and pointers (NULL deduces as an int)
- template<typename LhsT, typename RhsT>
- auto compareEqual( LhsT const& lhs, RhsT const& rhs ) -> bool { return static_cast<bool>(lhs == rhs); }
- template<typename T>
- auto compareEqual( T* const& lhs, int rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareEqual( T* const& lhs, long rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
- template<typename T>
- auto compareEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
-
- template<typename LhsT, typename RhsT>
- auto compareNotEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return static_cast<bool>(lhs != rhs); }
- template<typename T>
- auto compareNotEqual( T* const& lhs, int rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareNotEqual( T* const& lhs, long rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareNotEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
- template<typename T>
- auto compareNotEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
-
-
- template<typename LhsT>
- class ExprLhs {
- LhsT m_lhs;
- public:
- explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {}
-
- template<typename RhsT>
- auto operator == ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { compareEqual( m_lhs, rhs ), m_lhs, "==", rhs };
- }
- auto operator == ( bool rhs ) -> BinaryExpr<LhsT, bool> const {
- return { m_lhs == rhs, m_lhs, "==", rhs };
- }
-
- template<typename RhsT>
- auto operator != ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { compareNotEqual( m_lhs, rhs ), m_lhs, "!=", rhs };
- }
- auto operator != ( bool rhs ) -> BinaryExpr<LhsT, bool> const {
- return { m_lhs != rhs, m_lhs, "!=", rhs };
- }
-
- template<typename RhsT>
- auto operator > ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs > rhs), m_lhs, ">", rhs };
- }
- template<typename RhsT>
- auto operator < ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs < rhs), m_lhs, "<", rhs };
- }
- template<typename RhsT>
- auto operator >= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs >= rhs), m_lhs, ">=", rhs };
- }
- template<typename RhsT>
- auto operator <= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs <= rhs), m_lhs, "<=", rhs };
- }
-
- template<typename RhsT>
- auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<RhsT>::value,
- "operator&& is not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename RhsT>
- auto operator || ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<RhsT>::value,
- "operator|| is not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- auto makeUnaryExpr() const -> UnaryExpr<LhsT> {
- return UnaryExpr<LhsT>{ m_lhs };
- }
- };
-
- void handleExpression( ITransientExpression const& expr );
-
- template<typename T>
- void handleExpression( ExprLhs<T> const& expr ) {
- handleExpression( expr.makeUnaryExpr() );
- }
-
- struct Decomposer {
- template<typename T>
- auto operator <= ( T const& lhs ) -> ExprLhs<T const&> {
- return ExprLhs<T const&>{ lhs };
- }
-
- auto operator <=( bool value ) -> ExprLhs<bool> {
- return ExprLhs<bool>{ value };
- }
- };
-
-} // end namespace Catch
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#endif // TWOBLUECUBES_CATCH_DECOMPOSER_H_INCLUDED
diff --git a/include/internal/catch_default_main.hpp b/include/internal/catch_default_main.hpp
deleted file mode 100644
index aab5cba3..00000000
--- a/include/internal/catch_default_main.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Created by Phil on 20/05/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
-
-#include "catch_session.h"
-#include "catch_platform.h"
-
-#ifndef __OBJC__
-
-#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
-// Standard C/C++ Win32 Unicode wmain entry point
-extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
-#else
-// Standard C/C++ main entry point
-int main (int argc, char * argv[]) {
-#endif
-
- return Catch::Session().run( argc, argv );
-}
-
-#else // __OBJC__
-
-// Objective-C entry point
-int main (int argc, char * const argv[]) {
-#if !CATCH_ARC_ENABLED
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-#endif
-
- Catch::registerTestMethods();
- int result = Catch::Session().run( argc, (char**)argv );
-
-#if !CATCH_ARC_ENABLED
- [pool drain];
-#endif
-
- return result;
-}
-
-#endif // __OBJC__
-
-#endif // TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
diff --git a/include/internal/catch_enforce.cpp b/include/internal/catch_enforce.cpp
deleted file mode 100644
index 903d43be..00000000
--- a/include/internal/catch_enforce.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Created by Martin on 03/09/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_enforce.h"
-
-#include <stdexcept>
-
-
-namespace Catch {
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER)
- [[noreturn]]
- void throw_exception(std::exception const& e) {
- Catch::cerr() << "Catch will terminate because it needed to throw an exception.\n"
- << "The message was: " << e.what() << '\n';
- std::terminate();
- }
-#endif
-
- [[noreturn]]
- void throw_logic_error(std::string const& msg) {
- throw_exception(std::logic_error(msg));
- }
-
- [[noreturn]]
- void throw_domain_error(std::string const& msg) {
- throw_exception(std::domain_error(msg));
- }
-
- [[noreturn]]
- void throw_runtime_error(std::string const& msg) {
- throw_exception(std::runtime_error(msg));
- }
-
-
-
-} // namespace Catch;
diff --git a/include/internal/catch_enforce.h b/include/internal/catch_enforce.h
deleted file mode 100644
index 0484724d..00000000
--- a/include/internal/catch_enforce.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Created by Martin on 01/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ENFORCE_H_INCLUDED
-#define TWOBLUECUBES_CATCH_ENFORCE_H_INCLUDED
-
-#include "catch_common.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_stream.h"
-
-#include <exception>
-
-namespace Catch {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- template <typename Ex>
- [[noreturn]]
- void throw_exception(Ex const& e) {
- throw e;
- }
-#else // ^^ Exceptions are enabled // Exceptions are disabled vv
- [[noreturn]]
- void throw_exception(std::exception const& e);
-#endif
-
- [[noreturn]]
- void throw_logic_error(std::string const& msg);
- [[noreturn]]
- void throw_domain_error(std::string const& msg);
- [[noreturn]]
- void throw_runtime_error(std::string const& msg);
-
-} // namespace Catch;
-
-#define CATCH_MAKE_MSG(...) \
- (Catch::ReusableStringStream() << __VA_ARGS__).str()
-
-#define CATCH_INTERNAL_ERROR(...) \
- Catch::throw_logic_error(CATCH_MAKE_MSG( CATCH_INTERNAL_LINEINFO << ": Internal Catch2 error: " << __VA_ARGS__))
-
-#define CATCH_ERROR(...) \
- Catch::throw_domain_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
-
-#define CATCH_RUNTIME_ERROR(...) \
- Catch::throw_runtime_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
-
-#define CATCH_ENFORCE( condition, ... ) \
- do{ if( !(condition) ) CATCH_ERROR( __VA_ARGS__ ); } while(false)
-
-
-#endif // TWOBLUECUBES_CATCH_ENFORCE_H_INCLUDED
diff --git a/include/internal/catch_enum_values_registry.cpp b/include/internal/catch_enum_values_registry.cpp
deleted file mode 100644
index 063f9d62..00000000
--- a/include/internal/catch_enum_values_registry.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Created by Phil on 4/4/2019.
- * Copyright 2019 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#include "catch_enum_values_registry.h"
-#include "catch_string_manip.h"
-#include "catch_stream.h"
-
-#include <map>
-#include <cassert>
-
-namespace Catch {
-
- IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() {}
-
- namespace Detail {
-
- namespace {
- // Extracts the actual name part of an enum instance
- // In other words, it returns the Blue part of Bikeshed::Colour::Blue
- StringRef extractInstanceName(StringRef enumInstance) {
- // Find last occurence of ":"
- size_t name_start = enumInstance.size();
- while (name_start > 0 && enumInstance[name_start - 1] != ':') {
- --name_start;
- }
- return enumInstance.substr(name_start, enumInstance.size() - name_start);
- }
- }
-
- std::vector<StringRef> parseEnums( StringRef enums ) {
- auto enumValues = splitStringRef( enums, ',' );
- std::vector<StringRef> parsed;
- parsed.reserve( enumValues.size() );
- for( auto const& enumValue : enumValues ) {
- parsed.push_back(trim(extractInstanceName(enumValue)));
- }
- return parsed;
- }
-
- EnumInfo::~EnumInfo() {}
-
- StringRef EnumInfo::lookup( int value ) const {
- for( auto const& valueToName : m_values ) {
- if( valueToName.first == value )
- return valueToName.second;
- }
- return "{** unexpected enum value **}"_sr;
- }
-
- std::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
- std::unique_ptr<EnumInfo> enumInfo( new EnumInfo );
- enumInfo->m_name = enumName;
- enumInfo->m_values.reserve( values.size() );
-
- const auto valueNames = Catch::Detail::parseEnums( allValueNames );
- assert( valueNames.size() == values.size() );
- std::size_t i = 0;
- for( auto value : values )
- enumInfo->m_values.emplace_back(value, valueNames[i++]);
-
- return enumInfo;
- }
-
- EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
- m_enumInfos.push_back(makeEnumInfo(enumName, allValueNames, values));
- return *m_enumInfos.back();
- }
-
- } // Detail
-} // Catch
-
diff --git a/include/internal/catch_enum_values_registry.h b/include/internal/catch_enum_values_registry.h
deleted file mode 100644
index ae252fbf..00000000
--- a/include/internal/catch_enum_values_registry.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Created by Phil on 4/4/2019.
- * Copyright 2019 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ENUMVALUESREGISTRY_H_INCLUDED
-#define TWOBLUECUBES_CATCH_ENUMVALUESREGISTRY_H_INCLUDED
-
-#include "catch_interfaces_enum_values_registry.h"
-
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- namespace Detail {
-
- std::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values );
-
- class EnumValuesRegistry : public IMutableEnumValuesRegistry {
-
- std::vector<std::unique_ptr<EnumInfo>> m_enumInfos;
-
- EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values) override;
- };
-
- std::vector<StringRef> parseEnums( StringRef enums );
-
- } // Detail
-
-} // Catch
-
-#endif //TWOBLUECUBES_CATCH_ENUMVALUESREGISTRY_H_INCLUDED \ No newline at end of file
diff --git a/include/internal/catch_errno_guard.cpp b/include/internal/catch_errno_guard.cpp
deleted file mode 100644
index 070583bc..00000000
--- a/include/internal/catch_errno_guard.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Created by Martin on 06/03/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_errno_guard.h"
-
-#include <cerrno>
-
-namespace Catch {
- ErrnoGuard::ErrnoGuard():m_oldErrno(errno){}
- ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; }
-}
diff --git a/include/internal/catch_errno_guard.h b/include/internal/catch_errno_guard.h
deleted file mode 100644
index b1d1fc1c..00000000
--- a/include/internal/catch_errno_guard.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Created by Martin on 06/03/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ERRNO_GUARD_H_INCLUDED
-#define TWOBLUECUBES_CATCH_ERRNO_GUARD_H_INCLUDED
-
-namespace Catch {
-
- class ErrnoGuard {
- public:
- ErrnoGuard();
- ~ErrnoGuard();
- private:
- int m_oldErrno;
- };
-
-}
-
-#endif // TWOBLUECUBES_CATCH_ERRNO_GUARD_H_INCLUDED
diff --git a/include/internal/catch_exception_translator_registry.cpp b/include/internal/catch_exception_translator_registry.cpp
deleted file mode 100644
index cef36e51..00000000
--- a/include/internal/catch_exception_translator_registry.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Created by Phil on 20/04/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_exception_translator_registry.h"
-#include "catch_assertionhandler.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_enforce.h"
-
-#ifdef __OBJC__
-#import "Foundation/Foundation.h"
-#endif
-
-namespace Catch {
-
- ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() {
- }
-
- void ExceptionTranslatorRegistry::registerTranslator( const IExceptionTranslator* translator ) {
- m_translators.push_back( std::unique_ptr<const IExceptionTranslator>( translator ) );
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- std::string ExceptionTranslatorRegistry::translateActiveException() const {
- try {
-#ifdef __OBJC__
- // In Objective-C try objective-c exceptions first
- @try {
- return tryTranslators();
- }
- @catch (NSException *exception) {
- return Catch::Detail::stringify( [exception description] );
- }
-#else
- // Compiling a mixed mode project with MSVC means that CLR
- // exceptions will be caught in (...) as well. However, these
- // do not fill-in std::current_exception and thus lead to crash
- // when attempting rethrow.
- // /EHa switch also causes structured exceptions to be caught
- // here, but they fill-in current_exception properly, so
- // at worst the output should be a little weird, instead of
- // causing a crash.
- if (std::current_exception() == nullptr) {
- return "Non C++ exception. Possibly a CLR exception.";
- }
- return tryTranslators();
-#endif
- }
- catch( TestFailureException& ) {
- std::rethrow_exception(std::current_exception());
- }
- catch( std::exception& ex ) {
- return ex.what();
- }
- catch( std::string& msg ) {
- return msg;
- }
- catch( const char* msg ) {
- return msg;
- }
- catch(...) {
- return "Unknown exception";
- }
- }
-
- std::string ExceptionTranslatorRegistry::tryTranslators() const {
- if (m_translators.empty()) {
- std::rethrow_exception(std::current_exception());
- } else {
- return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end());
- }
- }
-
-#else // ^^ Exceptions are enabled // Exceptions are disabled vv
- std::string ExceptionTranslatorRegistry::translateActiveException() const {
- CATCH_INTERNAL_ERROR("Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
- }
-
- std::string ExceptionTranslatorRegistry::tryTranslators() const {
- CATCH_INTERNAL_ERROR("Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
- }
-#endif
-
-
-}
diff --git a/include/internal/catch_exception_translator_registry.h b/include/internal/catch_exception_translator_registry.h
deleted file mode 100644
index bb07c131..00000000
--- a/include/internal/catch_exception_translator_registry.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Created by Phil on 20/04/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
-
-#include "catch_interfaces_exception.h"
-#include <vector>
-#include <string>
-#include <memory>
-
-namespace Catch {
-
- class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
- public:
- ~ExceptionTranslatorRegistry();
- virtual void registerTranslator( const IExceptionTranslator* translator );
- std::string translateActiveException() const override;
- std::string tryTranslators() const;
-
- private:
- std::vector<std::unique_ptr<IExceptionTranslator const>> m_translators;
- };
-}
-
-#endif // TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
diff --git a/include/internal/catch_external_interfaces.h b/include/internal/catch_external_interfaces.h
deleted file mode 100644
index d0254945..00000000
--- a/include/internal/catch_external_interfaces.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Created by Martin on 17/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_EXTERNAL_INTERFACES_H_INCLUDED
-#define TWOBLUECUBES_CATCH_EXTERNAL_INTERFACES_H_INCLUDED
-
-#include "../reporters/catch_reporter_bases.hpp"
-#include "catch_console_colour.h"
-#include "catch_reporter_registrars.hpp"
-
-// Allow users to base their work off existing reporters
-#include "../reporters/catch_reporter_compact.h"
-#include "../reporters/catch_reporter_console.h"
-#include "../reporters/catch_reporter_junit.h"
-#include "../reporters/catch_reporter_xml.h"
-
-#endif // TWOBLUECUBES_CATCH_EXTERNAL_INTERFACES_H_INCLUDED
diff --git a/include/internal/catch_fatal_condition.cpp b/include/internal/catch_fatal_condition.cpp
deleted file mode 100644
index 1eb6bb87..00000000
--- a/include/internal/catch_fatal_condition.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Created by Phil on 21/08/2014
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-
-#include "catch_fatal_condition.h"
-
-#include "catch_context.h"
-#include "catch_interfaces_capture.h"
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-#endif
-
-#if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS )
-
-namespace {
- // Report the error condition
- void reportFatal( char const * const message ) {
- Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message );
- }
-}
-
-#endif // signals/SEH handling
-
-#if defined( CATCH_CONFIG_WINDOWS_SEH )
-
-namespace Catch {
- struct SignalDefs { DWORD id; const char* name; };
-
- // There is no 1-1 mapping between signals and windows exceptions.
- // Windows can easily distinguish between SO and SigSegV,
- // but SigInt, SigTerm, etc are handled differently.
- static SignalDefs signalDefs[] = {
- { static_cast<DWORD>(EXCEPTION_ILLEGAL_INSTRUCTION), "SIGILL - Illegal instruction signal" },
- { static_cast<DWORD>(EXCEPTION_STACK_OVERFLOW), "SIGSEGV - Stack overflow" },
- { static_cast<DWORD>(EXCEPTION_ACCESS_VIOLATION), "SIGSEGV - Segmentation violation signal" },
- { static_cast<DWORD>(EXCEPTION_INT_DIVIDE_BY_ZERO), "Divide by zero error" },
- };
-
- LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) {
- for (auto const& def : signalDefs) {
- if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) {
- reportFatal(def.name);
- }
- }
- // If its not an exception we care about, pass it along.
- // This stops us from eating debugger breaks etc.
- return EXCEPTION_CONTINUE_SEARCH;
- }
-
- FatalConditionHandler::FatalConditionHandler() {
- isSet = true;
- // 32k seems enough for Catch to handle stack overflow,
- // but the value was found experimentally, so there is no strong guarantee
- guaranteeSize = 32 * 1024;
- exceptionHandlerHandle = nullptr;
- // Register as first handler in current chain
- exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
- // Pass in guarantee size to be filled
- SetThreadStackGuarantee(&guaranteeSize);
- }
-
- void FatalConditionHandler::reset() {
- if (isSet) {
- RemoveVectoredExceptionHandler(exceptionHandlerHandle);
- SetThreadStackGuarantee(&guaranteeSize);
- exceptionHandlerHandle = nullptr;
- isSet = false;
- }
- }
-
- FatalConditionHandler::~FatalConditionHandler() {
- reset();
- }
-
-bool FatalConditionHandler::isSet = false;
-ULONG FatalConditionHandler::guaranteeSize = 0;
-PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr;
-
-
-} // namespace Catch
-
-#elif defined( CATCH_CONFIG_POSIX_SIGNALS )
-
-namespace Catch {
-
- struct SignalDefs {
- int id;
- const char* name;
- };
-
- // 32kb for the alternate stack seems to be sufficient. However, this value
- // is experimentally determined, so that's not guaranteed.
- static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
-
- static SignalDefs signalDefs[] = {
- { SIGINT, "SIGINT - Terminal interrupt signal" },
- { SIGILL, "SIGILL - Illegal instruction signal" },
- { SIGFPE, "SIGFPE - Floating point error signal" },
- { SIGSEGV, "SIGSEGV - Segmentation violation signal" },
- { SIGTERM, "SIGTERM - Termination request signal" },
- { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" }
- };
-
-
- void FatalConditionHandler::handleSignal( int sig ) {
- char const * name = "<unknown signal>";
- for (auto const& def : signalDefs) {
- if (sig == def.id) {
- name = def.name;
- break;
- }
- }
- reset();
- reportFatal(name);
- raise( sig );
- }
-
- FatalConditionHandler::FatalConditionHandler() {
- isSet = true;
- stack_t sigStack;
- sigStack.ss_sp = altStackMem;
- sigStack.ss_size = sigStackSize;
- sigStack.ss_flags = 0;
- sigaltstack(&sigStack, &oldSigStack);
- struct sigaction sa = { };
-
- sa.sa_handler = handleSignal;
- sa.sa_flags = SA_ONSTACK;
- for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) {
- sigaction(signalDefs[i].id, &sa, &oldSigActions[i]);
- }
- }
-
-
- FatalConditionHandler::~FatalConditionHandler() {
- reset();
- }
-
- void FatalConditionHandler::reset() {
- if( isSet ) {
- // Set signals back to previous values -- hopefully nobody overwrote them in the meantime
- for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) {
- sigaction(signalDefs[i].id, &oldSigActions[i], nullptr);
- }
- // Return the old stack
- sigaltstack(&oldSigStack, nullptr);
- isSet = false;
- }
- }
-
- bool FatalConditionHandler::isSet = false;
- struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {};
- stack_t FatalConditionHandler::oldSigStack = {};
- char FatalConditionHandler::altStackMem[sigStackSize] = {};
-
-
-} // namespace Catch
-
-#else
-
-namespace Catch {
- void FatalConditionHandler::reset() {}
-}
-
-#endif // signals/SEH handling
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic pop
-#endif
diff --git a/include/internal/catch_fatal_condition.h b/include/internal/catch_fatal_condition.h
deleted file mode 100644
index a64fa628..00000000
--- a/include/internal/catch_fatal_condition.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Created by Phil on 21/08/2014
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
-#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
-
-#include "catch_platform.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_windows_h_proxy.h"
-
-
-#if defined( CATCH_CONFIG_WINDOWS_SEH )
-
-namespace Catch {
-
- struct FatalConditionHandler {
-
- static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo);
- FatalConditionHandler();
- static void reset();
- ~FatalConditionHandler();
-
- private:
- static bool isSet;
- static ULONG guaranteeSize;
- static PVOID exceptionHandlerHandle;
- };
-
-} // namespace Catch
-
-#elif defined ( CATCH_CONFIG_POSIX_SIGNALS )
-
-#include <signal.h>
-
-namespace Catch {
-
- struct FatalConditionHandler {
-
- static bool isSet;
- static struct sigaction oldSigActions[];
- static stack_t oldSigStack;
- static char altStackMem[];
-
- static void handleSignal( int sig );
-
- FatalConditionHandler();
- ~FatalConditionHandler();
- static void reset();
- };
-
-} // namespace Catch
-
-
-#else
-
-namespace Catch {
- struct FatalConditionHandler {
- void reset();
- };
-}
-
-#endif
-
-#endif // TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
diff --git a/include/internal/catch_generators.cpp b/include/internal/catch_generators.cpp
deleted file mode 100644
index 5fbe2d23..00000000
--- a/include/internal/catch_generators.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Created by Phil Nash on 15/6/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_generators.hpp"
-#include "catch_random_number_generator.h"
-#include "catch_interfaces_capture.h"
-
-#include <limits>
-#include <set>
-
-namespace Catch {
-
-IGeneratorTracker::~IGeneratorTracker() {}
-
-const char* GeneratorException::what() const noexcept {
- return m_msg;
-}
-
-namespace Generators {
-
- GeneratorUntypedBase::~GeneratorUntypedBase() {}
-
- auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
- return getResultCapture().acquireGeneratorTracker( lineInfo );
- }
-
-} // namespace Generators
-} // namespace Catch
diff --git a/include/internal/catch_generators.hpp b/include/internal/catch_generators.hpp
deleted file mode 100644
index d0fbe8bf..00000000
--- a/include/internal/catch_generators.hpp
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Created by Phil Nash on 15/6/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
-
-#include "catch_interfaces_generatortracker.h"
-#include "catch_common.h"
-#include "catch_enforce.h"
-
-#include <memory>
-#include <vector>
-#include <cassert>
-
-#include <utility>
-#include <exception>
-
-namespace Catch {
-
-class GeneratorException : public std::exception {
- const char* const m_msg = "";
-
-public:
- GeneratorException(const char* msg):
- m_msg(msg)
- {}
-
- const char* what() const noexcept override final;
-};
-
-namespace Generators {
-
- // !TBD move this into its own location?
- namespace pf{
- template<typename T, typename... Args>
- std::unique_ptr<T> make_unique( Args&&... args ) {
- return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
- }
- }
-
- template<typename T>
- struct IGenerator : GeneratorUntypedBase {
- virtual ~IGenerator() = default;
-
- // Returns the current element of the generator
- //
- // \Precondition The generator is either freshly constructed,
- // or the last call to `next()` returned true
- virtual T const& get() const = 0;
- using type = T;
- };
-
- template<typename T>
- class SingleValueGenerator final : public IGenerator<T> {
- T m_value;
- public:
- SingleValueGenerator(T&& value) : m_value(std::move(value)) {}
-
- T const& get() const override {
- return m_value;
- }
- bool next() override {
- return false;
- }
- };
-
- template<typename T>
- class FixedValuesGenerator final : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "FixedValuesGenerator does not support bools because of std::vector<bool>"
- "specialization, use SingleValue Generator instead.");
- std::vector<T> m_values;
- size_t m_idx = 0;
- public:
- FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
-
- T const& get() const override {
- return m_values[m_idx];
- }
- bool next() override {
- ++m_idx;
- return m_idx < m_values.size();
- }
- };
-
- template <typename T>
- class GeneratorWrapper final {
- std::unique_ptr<IGenerator<T>> m_generator;
- public:
- GeneratorWrapper(std::unique_ptr<IGenerator<T>> generator):
- m_generator(std::move(generator))
- {}
- T const& get() const {
- return m_generator->get();
- }
- bool next() {
- return m_generator->next();
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> value(T&& value) {
- return GeneratorWrapper<T>(pf::make_unique<SingleValueGenerator<T>>(std::forward<T>(value)));
- }
- template <typename T>
- GeneratorWrapper<T> values(std::initializer_list<T> values) {
- return GeneratorWrapper<T>(pf::make_unique<FixedValuesGenerator<T>>(values));
- }
-
- template<typename T>
- class Generators : public IGenerator<T> {
- std::vector<GeneratorWrapper<T>> m_generators;
- size_t m_current = 0;
-
- void populate(GeneratorWrapper<T>&& generator) {
- m_generators.emplace_back(std::move(generator));
- }
- void populate(T&& val) {
- m_generators.emplace_back(value(std::forward<T>(val)));
- }
- template<typename U>
- void populate(U&& val) {
- populate(T(std::forward<U>(val)));
- }
- template<typename U, typename... Gs>
- void populate(U&& valueOrGenerator, Gs &&... moreGenerators) {
- populate(std::forward<U>(valueOrGenerator));
- populate(std::forward<Gs>(moreGenerators)...);
- }
-
- public:
- template <typename... Gs>
- Generators(Gs &&... moreGenerators) {
- m_generators.reserve(sizeof...(Gs));
- populate(std::forward<Gs>(moreGenerators)...);
- }
-
- T const& get() const override {
- return m_generators[m_current].get();
- }
-
- bool next() override {
- if (m_current >= m_generators.size()) {
- return false;
- }
- const bool current_status = m_generators[m_current].next();
- if (!current_status) {
- ++m_current;
- }
- return m_current < m_generators.size();
- }
- };
-
-
- template<typename... Ts>
- GeneratorWrapper<std::tuple<Ts...>> table( std::initializer_list<std::tuple<typename std::decay<Ts>::type...>> tuples ) {
- return values<std::tuple<Ts...>>( tuples );
- }
-
- // Tag type to signal that a generator sequence should convert arguments to a specific type
- template <typename T>
- struct as {};
-
- template<typename T, typename... Gs>
- auto makeGenerators( GeneratorWrapper<T>&& generator, Gs &&... moreGenerators ) -> Generators<T> {
- return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...);
- }
- template<typename T>
- auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> {
- return Generators<T>(std::move(generator));
- }
- template<typename T, typename... Gs>
- auto makeGenerators( T&& val, Gs &&... moreGenerators ) -> Generators<T> {
- return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... );
- }
- template<typename T, typename U, typename... Gs>
- auto makeGenerators( as<T>, U&& val, Gs &&... moreGenerators ) -> Generators<T> {
- return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... );
- }
-
- auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
-
- template<typename L>
- // Note: The type after -> is weird, because VS2015 cannot parse
- // the expression used in the typedef inside, when it is in
- // return type. Yeah.
- auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
- using UnderlyingType = typename decltype(generatorExpression())::type;
-
- IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
- if (!tracker.hasGenerator()) {
- tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
- }
-
- auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
- return generator.get();
- }
-
-} // namespace Generators
-} // namespace Catch
-
-#define GENERATE( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-#define GENERATE_COPY( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-#define GENERATE_REF( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-
-#endif // TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
diff --git a/include/internal/catch_generators_generic.hpp b/include/internal/catch_generators_generic.hpp
deleted file mode 100644
index c3410147..00000000
--- a/include/internal/catch_generators_generic.hpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Created by Martin on 23/2/2019.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_GENERATORS_GENERIC_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_GENERATORS_GENERIC_HPP_INCLUDED
-
-#include "catch_generators.hpp"
-#include "catch_meta.hpp"
-
-namespace Catch {
-namespace Generators {
-
- template <typename T>
- class TakeGenerator : public IGenerator<T> {
- GeneratorWrapper<T> m_generator;
- size_t m_returned = 0;
- size_t m_target;
- public:
- TakeGenerator(size_t target, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_target(target)
- {
- assert(target != 0 && "Empty generators are not allowed");
- }
- T const& get() const override {
- return m_generator.get();
- }
- bool next() override {
- ++m_returned;
- if (m_returned >= m_target) {
- return false;
- }
-
- const auto success = m_generator.next();
- // If the underlying generator does not contain enough values
- // then we cut short as well
- if (!success) {
- m_returned = m_target;
- }
- return success;
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(pf::make_unique<TakeGenerator<T>>(target, std::move(generator)));
- }
-
-
- template <typename T, typename Predicate>
- class FilterGenerator : public IGenerator<T> {
- GeneratorWrapper<T> m_generator;
- Predicate m_predicate;
- public:
- template <typename P = Predicate>
- FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_predicate(std::forward<P>(pred))
- {
- if (!m_predicate(m_generator.get())) {
- // It might happen that there are no values that pass the
- // filter. In that case we throw an exception.
- auto has_initial_value = next();
- if (!has_initial_value) {
- Catch::throw_exception(GeneratorException("No valid value found in filtered generator"));
- }
- }
- }
-
- T const& get() const override {
- return m_generator.get();
- }
-
- bool next() override {
- bool success = m_generator.next();
- if (!success) {
- return false;
- }
- while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true);
- return success;
- }
- };
-
-
- template <typename T, typename Predicate>
- GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(std::unique_ptr<IGenerator<T>>(pf::make_unique<FilterGenerator<T, Predicate>>(std::forward<Predicate>(pred), std::move(generator))));
- }
-
- template <typename T>
- class RepeatGenerator : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "RepeatGenerator currently does not support bools"
- "because of std::vector<bool> specialization");
- GeneratorWrapper<T> m_generator;
- mutable std::vector<T> m_returned;
- size_t m_target_repeats;
- size_t m_current_repeat = 0;
- size_t m_repeat_index = 0;
- public:
- RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_target_repeats(repeats)
- {
- assert(m_target_repeats > 0 && "Repeat generator must repeat at least once");
- }
-
- T const& get() const override {
- if (m_current_repeat == 0) {
- m_returned.push_back(m_generator.get());
- return m_returned.back();
- }
- return m_returned[m_repeat_index];
- }
-
- bool next() override {
- // There are 2 basic cases:
- // 1) We are still reading the generator
- // 2) We are reading our own cache
-
- // In the first case, we need to poke the underlying generator.
- // If it happily moves, we are left in that state, otherwise it is time to start reading from our cache
- if (m_current_repeat == 0) {
- const auto success = m_generator.next();
- if (!success) {
- ++m_current_repeat;
- }
- return m_current_repeat < m_target_repeats;
- }
-
- // In the second case, we need to move indices forward and check that we haven't run up against the end
- ++m_repeat_index;
- if (m_repeat_index == m_returned.size()) {
- m_repeat_index = 0;
- ++m_current_repeat;
- }
- return m_current_repeat < m_target_repeats;
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(pf::make_unique<RepeatGenerator<T>>(repeats, std::move(generator)));
- }
-
- template <typename T, typename U, typename Func>
- class MapGenerator : public IGenerator<T> {
- // TBD: provide static assert for mapping function, for friendly error message
- GeneratorWrapper<U> m_generator;
- Func m_function;
- // To avoid returning dangling reference, we have to save the values
- T m_cache;
- public:
- template <typename F2 = Func>
- MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) :
- m_generator(std::move(generator)),
- m_function(std::forward<F2>(function)),
- m_cache(m_function(m_generator.get()))
- {}
-
- T const& get() const override {
- return m_cache;
- }
- bool next() override {
- const auto success = m_generator.next();
- if (success) {
- m_cache = m_function(m_generator.get());
- }
- return success;
- }
- };
-
- template <typename Func, typename U, typename T = FunctionReturnType<Func, U>>
- GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
- return GeneratorWrapper<T>(
- pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator))
- );
- }
-
- template <typename T, typename U, typename Func>
- GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
- return GeneratorWrapper<T>(
- pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator))
- );
- }
-
- template <typename T>
- class ChunkGenerator final : public IGenerator<std::vector<T>> {
- std::vector<T> m_chunk;
- size_t m_chunk_size;
- GeneratorWrapper<T> m_generator;
- bool m_used_up = false;
- public:
- ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
- m_chunk_size(size), m_generator(std::move(generator))
- {
- m_chunk.reserve(m_chunk_size);
- if (m_chunk_size != 0) {
- m_chunk.push_back(m_generator.get());
- for (size_t i = 1; i < m_chunk_size; ++i) {
- if (!m_generator.next()) {
- Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk"));
- }
- m_chunk.push_back(m_generator.get());
- }
- }
- }
- std::vector<T> const& get() const override {
- return m_chunk;
- }
- bool next() override {
- m_chunk.clear();
- for (size_t idx = 0; idx < m_chunk_size; ++idx) {
- if (!m_generator.next()) {
- return false;
- }
- m_chunk.push_back(m_generator.get());
- }
- return true;
- }
- };
-
- template <typename T>
- GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<std::vector<T>>(
- pf::make_unique<ChunkGenerator<T>>(size, std::move(generator))
- );
- }
-
-} // namespace Generators
-} // namespace Catch
-
-
-#endif // TWOBLUECUBES_CATCH_GENERATORS_GENERIC_HPP_INCLUDED
diff --git a/include/internal/catch_generators_specific.hpp b/include/internal/catch_generators_specific.hpp
deleted file mode 100644
index dee8e711..00000000
--- a/include/internal/catch_generators_specific.hpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Created by Martin on 15/6/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_GENERATORS_SPECIFIC_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_GENERATORS_SPECIFIC_HPP_INCLUDED
-
-#include "catch_context.h"
-#include "catch_generators.hpp"
-#include "catch_interfaces_config.h"
-#include "catch_random_number_generator.h"
-
-#include <random>
-
-namespace Catch {
-namespace Generators {
-
-template <typename Float>
-class RandomFloatingGenerator final : public IGenerator<Float> {
- Catch::SimplePcg32& m_rng;
- std::uniform_real_distribution<Float> m_dist;
- Float m_current_number;
-public:
-
- RandomFloatingGenerator(Float a, Float b):
- m_rng(rng()),
- m_dist(a, b) {
- static_cast<void>(next());
- }
-
- Float const& get() const override {
- return m_current_number;
- }
- bool next() override {
- m_current_number = m_dist(m_rng);
- return true;
- }
-};
-
-template <typename Integer>
-class RandomIntegerGenerator final : public IGenerator<Integer> {
- Catch::SimplePcg32& m_rng;
- std::uniform_int_distribution<Integer> m_dist;
- Integer m_current_number;
-public:
-
- RandomIntegerGenerator(Integer a, Integer b):
- m_rng(rng()),
- m_dist(a, b) {
- static_cast<void>(next());
- }
-
- Integer const& get() const override {
- return m_current_number;
- }
- bool next() override {
- m_current_number = m_dist(m_rng);
- return true;
- }
-};
-
-// TODO: Ideally this would be also constrained against the various char types,
-// but I don't expect users to run into that in practice.
-template <typename T>
-typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value,
-GeneratorWrapper<T>>::type
-random(T a, T b) {
- return GeneratorWrapper<T>(
- pf::make_unique<RandomIntegerGenerator<T>>(a, b)
- );
-}
-
-template <typename T>
-typename std::enable_if<std::is_floating_point<T>::value,
-GeneratorWrapper<T>>::type
-random(T a, T b) {
- return GeneratorWrapper<T>(
- pf::make_unique<RandomFloatingGenerator<T>>(a, b)
- );
-}
-
-
-template <typename T>
-class RangeGenerator final : public IGenerator<T> {
- T m_current;
- T m_end;
- T m_step;
- bool m_positive;
-
-public:
- RangeGenerator(T const& start, T const& end, T const& step):
- m_current(start),
- m_end(end),
- m_step(step),
- m_positive(m_step > T(0))
- {
- assert(m_current != m_end && "Range start and end cannot be equal");
- assert(m_step != T(0) && "Step size cannot be zero");
- assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end");
- }
-
- RangeGenerator(T const& start, T const& end):
- RangeGenerator(start, end, (start < end) ? T(1) : T(-1))
- {}
-
- T const& get() const override {
- return m_current;
- }
-
- bool next() override {
- m_current += m_step;
- return (m_positive) ? (m_current < m_end) : (m_current > m_end);
- }
-};
-
-template <typename T>
-GeneratorWrapper<T> range(T const& start, T const& end, T const& step) {
- static_assert(std::is_arithmetic<T>::value && !std::is_same<T, bool>::value, "Type must be numeric");
- return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end, step));
-}
-
-template <typename T>
-GeneratorWrapper<T> range(T const& start, T const& end) {
- static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer");
- return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end));
-}
-
-
-template <typename T>
-class IteratorGenerator final : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "IteratorGenerator currently does not support bools"
- "because of std::vector<bool> specialization");
-
- std::vector<T> m_elems;
- size_t m_current = 0;
-public:
- template <typename InputIterator, typename InputSentinel>
- IteratorGenerator(InputIterator first, InputSentinel last):m_elems(first, last) {
- if (m_elems.empty()) {
- Catch::throw_exception(GeneratorException("IteratorGenerator received no valid values"));
- }
- }
-
- T const& get() const override {
- return m_elems[m_current];
- }
-
- bool next() override {
- ++m_current;
- return m_current != m_elems.size();
- }
-};
-
-template <typename InputIterator,
- typename InputSentinel,
- typename ResultType = typename std::iterator_traits<InputIterator>::value_type>
-GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) {
- return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(from, to));
-}
-
-template <typename Container,
- typename ResultType = typename Container::value_type>
-GeneratorWrapper<ResultType> from_range(Container const& cnt) {
- return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(cnt.begin(), cnt.end()));
-}
-
-
-} // namespace Generators
-} // namespace Catch
-
-
-#endif // TWOBLUECUBES_CATCH_GENERATORS_SPECIFIC_HPP_INCLUDED
diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp
deleted file mode 100644
index 0b29a39f..00000000
--- a/include/internal/catch_impl.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Created by Phil on 5/8/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
-
-// Keep these here for external reporters
-#include "catch_test_spec.h"
-#include "catch_test_case_tracker.h"
-
-#include "catch_leak_detector.h"
-
-// Cpp files will be included in the single-header file here
-// ~*~* CATCH_CPP_STITCH_PLACE *~*~
-
-namespace Catch {
- LeakDetector leakDetector;
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
diff --git a/include/internal/catch_interfaces_capture.cpp b/include/internal/catch_interfaces_capture.cpp
deleted file mode 100644
index 3c090bfe..00000000
--- a/include/internal/catch_interfaces_capture.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "catch_interfaces_capture.h"
-
-namespace Catch {
- IResultCapture::~IResultCapture() = default;
-}
diff --git a/include/internal/catch_interfaces_capture.h b/include/internal/catch_interfaces_capture.h
deleted file mode 100644
index 8c25c8cf..00000000
--- a/include/internal/catch_interfaces_capture.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Created by Phil on 07/01/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
-
-#include <string>
-#include <chrono>
-
-#include "catch_stringref.h"
-#include "catch_result_type.h"
-
-namespace Catch {
-
- class AssertionResult;
- struct AssertionInfo;
- struct SectionInfo;
- struct SectionEndInfo;
- struct MessageInfo;
- struct MessageBuilder;
- struct Counts;
- struct AssertionReaction;
- struct SourceLineInfo;
-
- struct ITransientExpression;
- struct IGeneratorTracker;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- struct BenchmarkInfo;
- template <typename Duration = std::chrono::duration<double, std::nano>>
- struct BenchmarkStats;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- struct IResultCapture {
-
- virtual ~IResultCapture();
-
- virtual bool sectionStarted( SectionInfo const& sectionInfo,
- Counts& assertions ) = 0;
- virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
- virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
-
- virtual auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- virtual void benchmarkPreparing( std::string const& name ) = 0;
- virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0;
- virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0;
- virtual void benchmarkFailed( std::string const& error ) = 0;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- virtual void pushScopedMessage( MessageInfo const& message ) = 0;
- virtual void popScopedMessage( MessageInfo const& message ) = 0;
-
- virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0;
-
- virtual void handleFatalErrorCondition( StringRef message ) = 0;
-
- virtual void handleExpr
- ( AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction ) = 0;
- virtual void handleMessage
- ( AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction ) = 0;
- virtual void handleUnexpectedExceptionNotThrown
- ( AssertionInfo const& info,
- AssertionReaction& reaction ) = 0;
- virtual void handleUnexpectedInflightException
- ( AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction ) = 0;
- virtual void handleIncomplete
- ( AssertionInfo const& info ) = 0;
- virtual void handleNonExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction ) = 0;
-
-
-
- virtual bool lastAssertionPassed() = 0;
- virtual void assertionPassed() = 0;
-
- // Deprecated, do not use:
- virtual std::string getCurrentTestName() const = 0;
- virtual const AssertionResult* getLastResult() const = 0;
- virtual void exceptionEarlyReported() = 0;
- };
-
- IResultCapture& getResultCapture();
-}
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
diff --git a/include/internal/catch_interfaces_config.cpp b/include/internal/catch_interfaces_config.cpp
deleted file mode 100644
index 6617da69..00000000
--- a/include/internal/catch_interfaces_config.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "catch_interfaces_config.h"
-
-namespace Catch {
- IConfig::~IConfig() = default;
-}
diff --git a/include/internal/catch_interfaces_config.h b/include/internal/catch_interfaces_config.h
deleted file mode 100644
index 8fb986be..00000000
--- a/include/internal/catch_interfaces_config.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Created by Phil on 05/06/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED
-
-#include "catch_common.h"
-#include "catch_option.hpp"
-
-#include <chrono>
-#include <iosfwd>
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- enum class Verbosity {
- Quiet = 0,
- Normal,
- High
- };
-
- struct WarnAbout { enum What {
- Nothing = 0x00,
- NoAssertions = 0x01,
- NoTests = 0x02
- }; };
-
- struct ShowDurations { enum OrNot {
- DefaultForReporter,
- Always,
- Never
- }; };
- struct RunTests { enum InWhatOrder {
- InDeclarationOrder,
- InLexicographicalOrder,
- InRandomOrder
- }; };
- struct UseColour { enum YesOrNo {
- Auto,
- Yes,
- No
- }; };
- struct WaitForKeypress { enum When {
- Never,
- BeforeStart = 1,
- BeforeExit = 2,
- BeforeStartAndExit = BeforeStart | BeforeExit
- }; };
-
- class TestSpec;
-
- struct IConfig : NonCopyable {
-
- virtual ~IConfig();
-
- virtual bool allowThrows() const = 0;
- virtual std::ostream& stream() const = 0;
- virtual std::string name() const = 0;
- virtual bool includeSuccessfulResults() const = 0;
- virtual bool shouldDebugBreak() const = 0;
- virtual bool warnAboutMissingAssertions() const = 0;
- virtual bool warnAboutNoTests() const = 0;
- virtual int abortAfter() const = 0;
- virtual bool showInvisibles() const = 0;
- virtual ShowDurations::OrNot showDurations() const = 0;
- virtual TestSpec const& testSpec() const = 0;
- virtual bool hasTestFilters() const = 0;
- virtual std::vector<std::string> const& getTestsOrTags() const = 0;
- virtual RunTests::InWhatOrder runOrder() const = 0;
- virtual unsigned int rngSeed() const = 0;
- virtual UseColour::YesOrNo useColour() const = 0;
- virtual std::vector<std::string> const& getSectionsToRun() const = 0;
- virtual Verbosity verbosity() const = 0;
-
- virtual bool benchmarkNoAnalysis() const = 0;
- virtual int benchmarkSamples() const = 0;
- virtual double benchmarkConfidenceInterval() const = 0;
- virtual unsigned int benchmarkResamples() const = 0;
- virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0;
- };
-
- using IConfigPtr = std::shared_ptr<IConfig const>;
-}
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED
diff --git a/include/internal/catch_interfaces_enum_values_registry.h b/include/internal/catch_interfaces_enum_values_registry.h
deleted file mode 100644
index 81592c9b..00000000
--- a/include/internal/catch_interfaces_enum_values_registry.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Created by Phil on 4/4/2019.
- * Copyright 2019 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACESENUMVALUESREGISTRY_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACESENUMVALUESREGISTRY_H_INCLUDED
-
-#include "catch_stringref.h"
-
-#include <vector>
-
-namespace Catch {
-
- namespace Detail {
- struct EnumInfo {
- StringRef m_name;
- std::vector<std::pair<int, StringRef>> m_values;
-
- ~EnumInfo();
-
- StringRef lookup( int value ) const;
- };
- } // namespace Detail
-
- struct IMutableEnumValuesRegistry {
- virtual ~IMutableEnumValuesRegistry();
-
- virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
-
- template<typename E>
- Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::initializer_list<E> values ) {
- static_assert(sizeof(int) >= sizeof(E), "Cannot serialize enum to int");
- std::vector<int> intValues;
- intValues.reserve( values.size() );
- for( auto enumValue : values )
- intValues.push_back( static_cast<int>( enumValue ) );
- return registerEnum( enumName, allEnums, intValues );
- }
- };
-
-} // Catch
-
-#endif //TWOBLUECUBES_CATCH_INTERFACESENUMVALUESREGISTRY_H_INCLUDED
diff --git a/include/internal/catch_interfaces_exception.cpp b/include/internal/catch_interfaces_exception.cpp
deleted file mode 100644
index 705d8c87..00000000
--- a/include/internal/catch_interfaces_exception.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "catch_interfaces_exception.h"
-
-namespace Catch {
- IExceptionTranslator::~IExceptionTranslator() = default;
- IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default;
-}
diff --git a/include/internal/catch_interfaces_exception.h b/include/internal/catch_interfaces_exception.h
deleted file mode 100644
index a723772e..00000000
--- a/include/internal/catch_interfaces_exception.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Created by Phil on 20/04/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
-
-#include "catch_interfaces_registry_hub.h"
-
-#if defined(CATCH_CONFIG_DISABLE)
- #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( translatorName, signature) \
- static std::string translatorName( signature )
-#endif
-
-#include <exception>
-#include <string>
-#include <vector>
-
-namespace Catch {
- using exceptionTranslateFunction = std::string(*)();
-
- struct IExceptionTranslator;
- using ExceptionTranslators = std::vector<std::unique_ptr<IExceptionTranslator const>>;
-
- struct IExceptionTranslator {
- virtual ~IExceptionTranslator();
- virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
- };
-
- struct IExceptionTranslatorRegistry {
- virtual ~IExceptionTranslatorRegistry();
-
- virtual std::string translateActiveException() const = 0;
- };
-
- class ExceptionTranslatorRegistrar {
- template<typename T>
- class ExceptionTranslator : public IExceptionTranslator {
- public:
-
- ExceptionTranslator( std::string(*translateFunction)( T& ) )
- : m_translateFunction( translateFunction )
- {}
-
- std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
- CATCH_TRY {
- if( it == itEnd )
- std::rethrow_exception(std::current_exception());
- else
- return (*it)->translate( it+1, itEnd );
- }
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- catch( T& ex ) {
- return m_translateFunction( ex );
- }
-#endif
- }
-
- protected:
- std::string(*m_translateFunction)( T& );
- };
-
- public:
- template<typename T>
- ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) {
- getMutableRegistryHub().registerTranslator
- ( new ExceptionTranslator<T>( translateFunction ) );
- }
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
- static std::string translatorName( signature ); \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- static std::string translatorName( signature )
-
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
diff --git a/include/internal/catch_interfaces_generatortracker.h b/include/internal/catch_interfaces_generatortracker.h
deleted file mode 100644
index c1b1391f..00000000
--- a/include/internal/catch_interfaces_generatortracker.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Created by Phil Nash on 26/6/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_GENERATORTRACKER_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORTRACKER_INCLUDED
-
-#include <memory>
-
-namespace Catch {
-
- namespace Generators {
- class GeneratorUntypedBase {
- public:
- GeneratorUntypedBase() = default;
- virtual ~GeneratorUntypedBase();
- // Attempts to move the generator to the next element
- //
- // Returns true iff the move succeeded (and a valid element
- // can be retrieved).
- virtual bool next() = 0;
- };
- using GeneratorBasePtr = std::unique_ptr<GeneratorUntypedBase>;
-
- } // namespace Generators
-
- struct IGeneratorTracker {
- virtual ~IGeneratorTracker();
- virtual auto hasGenerator() const -> bool = 0;
- virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
- virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0;
- };
-
-} // namespace Catch
-
-#endif //TWOBLUECUBES_CATCH_INTERFACES_GENERATORTRACKER_INCLUDED
diff --git a/include/internal/catch_interfaces_registry_hub.cpp b/include/internal/catch_interfaces_registry_hub.cpp
deleted file mode 100644
index 7a22d649..00000000
--- a/include/internal/catch_interfaces_registry_hub.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "catch_interfaces_registry_hub.h"
-
-namespace Catch {
- IRegistryHub::~IRegistryHub() = default;
- IMutableRegistryHub::~IMutableRegistryHub() = default;
-}
diff --git a/include/internal/catch_interfaces_registry_hub.h b/include/internal/catch_interfaces_registry_hub.h
deleted file mode 100644
index 19ffbf26..00000000
--- a/include/internal/catch_interfaces_registry_hub.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Created by Phil on 5/8/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
-
-#include "catch_common.h"
-
-#include <string>
-#include <memory>
-
-namespace Catch {
-
- class TestCase;
- struct ITestCaseRegistry;
- struct IExceptionTranslatorRegistry;
- struct IExceptionTranslator;
- struct IReporterRegistry;
- struct IReporterFactory;
- struct ITagAliasRegistry;
- struct IMutableEnumValuesRegistry;
-
- class StartupExceptionRegistry;
-
- using IReporterFactoryPtr = std::shared_ptr<IReporterFactory>;
-
- struct IRegistryHub {
- virtual ~IRegistryHub();
-
- virtual IReporterRegistry const& getReporterRegistry() const = 0;
- virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
- virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0;
- virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0;
-
-
- virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0;
- };
-
- struct IMutableRegistryHub {
- virtual ~IMutableRegistryHub();
- virtual void registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) = 0;
- virtual void registerListener( IReporterFactoryPtr const& factory ) = 0;
- virtual void registerTest( TestCase const& testInfo ) = 0;
- virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
- virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
- virtual void registerStartupException() noexcept = 0;
- virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0;
- };
-
- IRegistryHub const& getRegistryHub();
- IMutableRegistryHub& getMutableRegistryHub();
- void cleanUp();
- std::string translateActiveException();
-
-}
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
diff --git a/include/internal/catch_interfaces_reporter.cpp b/include/internal/catch_interfaces_reporter.cpp
deleted file mode 100644
index 0c367c5b..00000000
--- a/include/internal/catch_interfaces_reporter.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_interfaces_reporter.h"
-#include "../reporters/catch_reporter_listening.h"
-
-namespace Catch {
-
- ReporterConfig::ReporterConfig( IConfigPtr const& _fullConfig )
- : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {}
-
- ReporterConfig::ReporterConfig( IConfigPtr const& _fullConfig, std::ostream& _stream )
- : m_stream( &_stream ), m_fullConfig( _fullConfig ) {}
-
- std::ostream& ReporterConfig::stream() const { return *m_stream; }
- IConfigPtr ReporterConfig::fullConfig() const { return m_fullConfig; }
-
-
- TestRunInfo::TestRunInfo( std::string const& _name ) : name( _name ) {}
-
- GroupInfo::GroupInfo( std::string const& _name,
- std::size_t _groupIndex,
- std::size_t _groupsCount )
- : name( _name ),
- groupIndex( _groupIndex ),
- groupsCounts( _groupsCount )
- {}
-
- AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
- std::vector<MessageInfo> const& _infoMessages,
- Totals const& _totals )
- : assertionResult( _assertionResult ),
- infoMessages( _infoMessages ),
- totals( _totals )
- {
- assertionResult.m_resultData.lazyExpression.m_transientExpression = _assertionResult.m_resultData.lazyExpression.m_transientExpression;
-
- if( assertionResult.hasMessage() ) {
- // Copy message into messages list.
- // !TBD This should have been done earlier, somewhere
- MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() );
- builder << assertionResult.getMessage();
- builder.m_info.message = builder.m_stream.str();
-
- infoMessages.push_back( builder.m_info );
- }
- }
-
- AssertionStats::~AssertionStats() = default;
-
- SectionStats::SectionStats( SectionInfo const& _sectionInfo,
- Counts const& _assertions,
- double _durationInSeconds,
- bool _missingAssertions )
- : sectionInfo( _sectionInfo ),
- assertions( _assertions ),
- durationInSeconds( _durationInSeconds ),
- missingAssertions( _missingAssertions )
- {}
-
- SectionStats::~SectionStats() = default;
-
-
- TestCaseStats::TestCaseStats( TestCaseInfo const& _testInfo,
- Totals const& _totals,
- std::string const& _stdOut,
- std::string const& _stdErr,
- bool _aborting )
- : testInfo( _testInfo ),
- totals( _totals ),
- stdOut( _stdOut ),
- stdErr( _stdErr ),
- aborting( _aborting )
- {}
-
- TestCaseStats::~TestCaseStats() = default;
-
-
- TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo,
- Totals const& _totals,
- bool _aborting )
- : groupInfo( _groupInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
-
- TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo )
- : groupInfo( _groupInfo ),
- aborting( false )
- {}
-
- TestGroupStats::~TestGroupStats() = default;
-
- TestRunStats::TestRunStats( TestRunInfo const& _runInfo,
- Totals const& _totals,
- bool _aborting )
- : runInfo( _runInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
-
- TestRunStats::~TestRunStats() = default;
-
- void IStreamingReporter::fatalErrorEncountered( StringRef ) {}
- bool IStreamingReporter::isMulti() const { return false; }
-
- IReporterFactory::~IReporterFactory() = default;
- IReporterRegistry::~IReporterRegistry() = default;
-
-} // end namespace Catch
diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h
deleted file mode 100644
index 751ef2c2..00000000
--- a/include/internal/catch_interfaces_reporter.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Created by Phil on 31/12/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED
-
-#include "catch_section_info.h"
-#include "catch_common.h"
-#include "catch_config.hpp"
-#include "catch_totals.h"
-#include "catch_test_case_info.h"
-#include "catch_assertionresult.h"
-#include "catch_message.h"
-#include "catch_option.hpp"
-#include "catch_stringref.h"
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#include "benchmark/catch_estimate.hpp"
-#include "benchmark/catch_outlier_classification.hpp"
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-
-#include <string>
-#include <iosfwd>
-#include <map>
-#include <set>
-#include <memory>
-#include <algorithm>
-
-namespace Catch {
-
- struct ReporterConfig {
- explicit ReporterConfig( IConfigPtr const& _fullConfig );
-
- ReporterConfig( IConfigPtr const& _fullConfig, std::ostream& _stream );
-
- std::ostream& stream() const;
- IConfigPtr fullConfig() const;
-
- private:
- std::ostream* m_stream;
- IConfigPtr m_fullConfig;
- };
-
- struct ReporterPreferences {
- bool shouldRedirectStdOut = false;
- bool shouldReportAllAssertions = false;
- };
-
- template<typename T>
- struct LazyStat : Option<T> {
- LazyStat& operator=( T const& _value ) {
- Option<T>::operator=( _value );
- used = false;
- return *this;
- }
- void reset() {
- Option<T>::reset();
- used = false;
- }
- bool used = false;
- };
-
- struct TestRunInfo {
- TestRunInfo( std::string const& _name );
- std::string name;
- };
- struct GroupInfo {
- GroupInfo( std::string const& _name,
- std::size_t _groupIndex,
- std::size_t _groupsCount );
-
- std::string name;
- std::size_t groupIndex;
- std::size_t groupsCounts;
- };
-
- struct AssertionStats {
- AssertionStats( AssertionResult const& _assertionResult,
- std::vector<MessageInfo> const& _infoMessages,
- Totals const& _totals );
-
- AssertionStats( AssertionStats const& ) = default;
- AssertionStats( AssertionStats && ) = default;
- AssertionStats& operator = ( AssertionStats const& ) = delete;
- AssertionStats& operator = ( AssertionStats && ) = delete;
- virtual ~AssertionStats();
-
- AssertionResult assertionResult;
- std::vector<MessageInfo> infoMessages;
- Totals totals;
- };
-
- struct SectionStats {
- SectionStats( SectionInfo const& _sectionInfo,
- Counts const& _assertions,
- double _durationInSeconds,
- bool _missingAssertions );
- SectionStats( SectionStats const& ) = default;
- SectionStats( SectionStats && ) = default;
- SectionStats& operator = ( SectionStats const& ) = default;
- SectionStats& operator = ( SectionStats && ) = default;
- virtual ~SectionStats();
-
- SectionInfo sectionInfo;
- Counts assertions;
- double durationInSeconds;
- bool missingAssertions;
- };
-
- struct TestCaseStats {
- TestCaseStats( TestCaseInfo const& _testInfo,
- Totals const& _totals,
- std::string const& _stdOut,
- std::string const& _stdErr,
- bool _aborting );
-
- TestCaseStats( TestCaseStats const& ) = default;
- TestCaseStats( TestCaseStats && ) = default;
- TestCaseStats& operator = ( TestCaseStats const& ) = default;
- TestCaseStats& operator = ( TestCaseStats && ) = default;
- virtual ~TestCaseStats();
-
- TestCaseInfo testInfo;
- Totals totals;
- std::string stdOut;
- std::string stdErr;
- bool aborting;
- };
-
- struct TestGroupStats {
- TestGroupStats( GroupInfo const& _groupInfo,
- Totals const& _totals,
- bool _aborting );
- TestGroupStats( GroupInfo const& _groupInfo );
-
- TestGroupStats( TestGroupStats const& ) = default;
- TestGroupStats( TestGroupStats && ) = default;
- TestGroupStats& operator = ( TestGroupStats const& ) = default;
- TestGroupStats& operator = ( TestGroupStats && ) = default;
- virtual ~TestGroupStats();
-
- GroupInfo groupInfo;
- Totals totals;
- bool aborting;
- };
-
- struct TestRunStats {
- TestRunStats( TestRunInfo const& _runInfo,
- Totals const& _totals,
- bool _aborting );
-
- TestRunStats( TestRunStats const& ) = default;
- TestRunStats( TestRunStats && ) = default;
- TestRunStats& operator = ( TestRunStats const& ) = default;
- TestRunStats& operator = ( TestRunStats && ) = default;
- virtual ~TestRunStats();
-
- TestRunInfo runInfo;
- Totals totals;
- bool aborting;
- };
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- struct BenchmarkInfo {
- std::string name;
- double estimatedDuration;
- int iterations;
- int samples;
- unsigned int resamples;
- double clockResolution;
- double clockCost;
- };
-
- template <class Duration>
- struct BenchmarkStats {
- BenchmarkInfo info;
-
- std::vector<Duration> samples;
- Benchmark::Estimate<Duration> mean;
- Benchmark::Estimate<Duration> standardDeviation;
- Benchmark::OutlierClassification outliers;
- double outlierVariance;
-
- template <typename Duration2>
- operator BenchmarkStats<Duration2>() const {
- std::vector<Duration2> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
- return {
- info,
- std::move(samples2),
- mean,
- standardDeviation,
- outliers,
- outlierVariance,
- };
- }
- };
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- struct IStreamingReporter {
- virtual ~IStreamingReporter() = default;
-
- // Implementing class must also provide the following static methods:
- // static std::string getDescription();
- // static std::set<Verbosity> getSupportedVerbosities()
-
- virtual ReporterPreferences getPreferences() const = 0;
-
- virtual void noMatchingTestCases( std::string const& spec ) = 0;
-
- virtual void reportInvalidArguments(std::string const&) {}
-
- virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0;
- virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0;
-
- virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0;
- virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- virtual void benchmarkPreparing( std::string const& ) {}
- virtual void benchmarkStarting( BenchmarkInfo const& ) {}
- virtual void benchmarkEnded( BenchmarkStats<> const& ) {}
- virtual void benchmarkFailed( std::string const& ) {}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
-
- // The return value indicates if the messages buffer should be cleared:
- virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
-
- virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0;
- virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;
-
- virtual void skipTest( TestCaseInfo const& testInfo ) = 0;
-
- // Default empty implementation provided
- virtual void fatalErrorEncountered( StringRef name );
-
- virtual bool isMulti() const;
- };
- using IStreamingReporterPtr = std::unique_ptr<IStreamingReporter>;
-
- struct IReporterFactory {
- virtual ~IReporterFactory();
- virtual IStreamingReporterPtr create( ReporterConfig const& config ) const = 0;
- virtual std::string getDescription() const = 0;
- };
- using IReporterFactoryPtr = std::shared_ptr<IReporterFactory>;
-
- struct IReporterRegistry {
- using FactoryMap = std::map<std::string, IReporterFactoryPtr>;
- using Listeners = std::vector<IReporterFactoryPtr>;
-
- virtual ~IReporterRegistry();
- virtual IStreamingReporterPtr create( std::string const& name, IConfigPtr const& config ) const = 0;
- virtual FactoryMap const& getFactories() const = 0;
- virtual Listeners const& getListeners() const = 0;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED
diff --git a/include/internal/catch_interfaces_runner.cpp b/include/internal/catch_interfaces_runner.cpp
deleted file mode 100644
index 8d419a14..00000000
--- a/include/internal/catch_interfaces_runner.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "catch_interfaces_runner.h"
-
-namespace Catch {
- IRunner::~IRunner() = default;
-}
diff --git a/include/internal/catch_interfaces_runner.h b/include/internal/catch_interfaces_runner.h
deleted file mode 100644
index a0deaf7e..00000000
--- a/include/internal/catch_interfaces_runner.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Created by Phil on 07/01/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
-
-namespace Catch {
-
- struct IRunner {
- virtual ~IRunner();
- virtual bool aborting() const = 0;
- };
-}
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
diff --git a/include/internal/catch_interfaces_tag_alias_registry.h b/include/internal/catch_interfaces_tag_alias_registry.h
deleted file mode 100644
index 24bc535c..00000000
--- a/include/internal/catch_interfaces_tag_alias_registry.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Created by Phil on 27/6/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_TAG_ALIAS_REGISTRY_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_TAG_ALIAS_REGISTRY_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
- struct TagAlias;
-
- struct ITagAliasRegistry {
- virtual ~ITagAliasRegistry();
- // Nullptr if not present
- virtual TagAlias const* find( std::string const& alias ) const = 0;
- virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0;
-
- static ITagAliasRegistry const& get();
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_TAG_ALIAS_REGISTRY_H_INCLUDED
diff --git a/include/internal/catch_interfaces_testcase.cpp b/include/internal/catch_interfaces_testcase.cpp
deleted file mode 100644
index 9b35e034..00000000
--- a/include/internal/catch_interfaces_testcase.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "catch_interfaces_testcase.h"
-
-namespace Catch {
- ITestInvoker::~ITestInvoker() = default;
- ITestCaseRegistry::~ITestCaseRegistry() = default;
-}
diff --git a/include/internal/catch_interfaces_testcase.h b/include/internal/catch_interfaces_testcase.h
deleted file mode 100644
index 2492c07d..00000000
--- a/include/internal/catch_interfaces_testcase.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Created by Phil on 07/01/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
-#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
-
-#include <vector>
-
-namespace Catch {
-
- class TestSpec;
-
- struct ITestInvoker {
- virtual void invoke () const = 0;
- virtual ~ITestInvoker();
- };
-
- class TestCase;
- struct IConfig;
-
- struct ITestCaseRegistry {
- virtual ~ITestCaseRegistry();
- virtual std::vector<TestCase> const& getAllTests() const = 0;
- virtual std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const = 0;
- };
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config );
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
-
-}
-
-#endif // TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
diff --git a/include/internal/catch_leak_detector.cpp b/include/internal/catch_leak_detector.cpp
deleted file mode 100644
index 7a30e8a1..00000000
--- a/include/internal/catch_leak_detector.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Created by Martin on 12/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- #include "catch_leak_detector.h"
- #include "catch_interfaces_registry_hub.h"
-
-
-#ifdef CATCH_CONFIG_WINDOWS_CRTDBG
-#include <crtdbg.h>
-
-namespace Catch {
-
- LeakDetector::LeakDetector() {
- int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- flag |= _CRTDBG_LEAK_CHECK_DF;
- flag |= _CRTDBG_ALLOC_MEM_DF;
- _CrtSetDbgFlag(flag);
- _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
- _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
- // Change this to leaking allocation's number to break there
- _CrtSetBreakAlloc(-1);
- }
-}
-
-#else
-
- Catch::LeakDetector::LeakDetector() {}
-
-#endif
-
-Catch::LeakDetector::~LeakDetector() {
- Catch::cleanUp();
-}
diff --git a/include/internal/catch_leak_detector.h b/include/internal/catch_leak_detector.h
deleted file mode 100644
index 633457ac..00000000
--- a/include/internal/catch_leak_detector.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Created by Martin on 12/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_LEAK_DETECTOR_H_INCLUDED
-#define TWOBLUECUBES_CATCH_LEAK_DETECTOR_H_INCLUDED
-
-namespace Catch {
-
- struct LeakDetector {
- LeakDetector();
- ~LeakDetector();
- };
-
-}
-#endif // TWOBLUECUBES_CATCH_LEAK_DETECTOR_H_INCLUDED
diff --git a/include/internal/catch_list.cpp b/include/internal/catch_list.cpp
deleted file mode 100644
index 9f748e4c..00000000
--- a/include/internal/catch_list.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Created by Phil on 5/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_list.h"
-
-#include "catch_interfaces_registry_hub.h"
-#include "catch_interfaces_reporter.h"
-#include "catch_interfaces_testcase.h"
-
-#include "catch_context.h"
-#include "catch_stream.h"
-#include "catch_text.h"
-
-#include "catch_console_colour.h"
-#include "catch_test_spec_parser.h"
-#include "catch_tostring.h"
-#include "catch_string_manip.h"
-
-#include <limits>
-#include <algorithm>
-#include <iomanip>
-
-namespace Catch {
-
- std::size_t listTests( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- if( config.hasTestFilters() )
- Catch::cout() << "Matching test cases:\n";
- else {
- Catch::cout() << "All available test cases:\n";
- }
-
- auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCaseInfo : matchedTestCases ) {
- Colour::Code colour = testCaseInfo.isHidden()
- ? Colour::SecondaryText
- : Colour::None;
- Colour colourGuard( colour );
-
- Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
- if( config.verbosity() >= Verbosity::High ) {
- Catch::cout() << Column( Catch::Detail::stringify( testCaseInfo.lineInfo ) ).indent(4) << std::endl;
- std::string description = testCaseInfo.description;
- if( description.empty() )
- description = "(NO DESCRIPTION)";
- Catch::cout() << Column( description ).indent(4) << std::endl;
- }
- if( !testCaseInfo.tags.empty() )
- Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
- }
-
- if( !config.hasTestFilters() )
- Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
- else
- Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
- return matchedTestCases.size();
- }
-
- std::size_t listTestsNamesOnly( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- std::size_t matchedTests = 0;
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCaseInfo : matchedTestCases ) {
- matchedTests++;
- if( startsWith( testCaseInfo.name, '#' ) )
- Catch::cout() << '"' << testCaseInfo.name << '"';
- else
- Catch::cout() << testCaseInfo.name;
- if ( config.verbosity() >= Verbosity::High )
- Catch::cout() << "\t@" << testCaseInfo.lineInfo;
- Catch::cout() << std::endl;
- }
- return matchedTests;
- }
-
- void TagInfo::add( std::string const& spelling ) {
- ++count;
- spellings.insert( spelling );
- }
-
- std::string TagInfo::all() const {
- size_t size = 0;
- for (auto const& spelling : spellings) {
- // Add 2 for the brackes
- size += spelling.size() + 2;
- }
-
- std::string out; out.reserve(size);
- for (auto const& spelling : spellings) {
- out += '[';
- out += spelling;
- out += ']';
- }
- return out;
- }
-
- std::size_t listTags( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- if( config.hasTestFilters() )
- Catch::cout() << "Tags for matching test cases:\n";
- else {
- Catch::cout() << "All available tags:\n";
- }
-
- std::map<std::string, TagInfo> tagCounts;
-
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCase : matchedTestCases ) {
- for( auto const& tagName : testCase.getTestCaseInfo().tags ) {
- std::string lcaseTagName = toLower( tagName );
- auto countIt = tagCounts.find( lcaseTagName );
- if( countIt == tagCounts.end() )
- countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first;
- countIt->second.add( tagName );
- }
- }
-
- for( auto const& tagCount : tagCounts ) {
- ReusableStringStream rss;
- rss << " " << std::setw(2) << tagCount.second.count << " ";
- auto str = rss.str();
- auto wrapper = Column( tagCount.second.all() )
- .initialIndent( 0 )
- .indent( str.size() )
- .width( CATCH_CONFIG_CONSOLE_WIDTH-10 );
- Catch::cout() << str << wrapper << '\n';
- }
- Catch::cout() << pluralise( tagCounts.size(), "tag" ) << '\n' << std::endl;
- return tagCounts.size();
- }
-
- std::size_t listReporters() {
- Catch::cout() << "Available reporters:\n";
- IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
- std::size_t maxNameLen = 0;
- for( auto const& factoryKvp : factories )
- maxNameLen = (std::max)( maxNameLen, factoryKvp.first.size() );
-
- for( auto const& factoryKvp : factories ) {
- Catch::cout()
- << Column( factoryKvp.first + ":" )
- .indent(2)
- .width( 5+maxNameLen )
- + Column( factoryKvp.second->getDescription() )
- .initialIndent(0)
- .indent(2)
- .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 )
- << "\n";
- }
- Catch::cout() << std::endl;
- return factories.size();
- }
-
- Option<std::size_t> list( std::shared_ptr<Config> const& config ) {
- Option<std::size_t> listedCount;
- getCurrentMutableContext().setConfig( config );
- if( config->listTests() )
- listedCount = listedCount.valueOr(0) + listTests( *config );
- if( config->listTestNamesOnly() )
- listedCount = listedCount.valueOr(0) + listTestsNamesOnly( *config );
- if( config->listTags() )
- listedCount = listedCount.valueOr(0) + listTags( *config );
- if( config->listReporters() )
- listedCount = listedCount.valueOr(0) + listReporters();
- return listedCount;
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_list.h b/include/internal/catch_list.h
deleted file mode 100644
index cea7bbab..00000000
--- a/include/internal/catch_list.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Created by Phil on 5/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_LIST_H_INCLUDED
-#define TWOBLUECUBES_CATCH_LIST_H_INCLUDED
-
-#include "catch_option.hpp"
-#include "catch_config.hpp"
-
-#include <set>
-
-namespace Catch {
-
- std::size_t listTests( Config const& config );
-
- std::size_t listTestsNamesOnly( Config const& config );
-
- struct TagInfo {
- void add( std::string const& spelling );
- std::string all() const;
-
- std::set<std::string> spellings;
- std::size_t count = 0;
- };
-
- std::size_t listTags( Config const& config );
-
- std::size_t listReporters();
-
- Option<std::size_t> list( std::shared_ptr<Config> const& config );
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_LIST_H_INCLUDED
diff --git a/include/internal/catch_matchers.cpp b/include/internal/catch_matchers.cpp
deleted file mode 100644
index 32104a11..00000000
--- a/include/internal/catch_matchers.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Created by Phil Nash on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_matchers.h"
-
-namespace Catch {
-namespace Matchers {
- namespace Impl {
-
- std::string MatcherUntypedBase::toString() const {
- if( m_cachedToString.empty() )
- m_cachedToString = describe();
- return m_cachedToString;
- }
-
- MatcherUntypedBase::~MatcherUntypedBase() = default;
-
- } // namespace Impl
-} // namespace Matchers
-
-using namespace Matchers;
-using Matchers::Impl::MatcherBase;
-
-} // namespace Catch
diff --git a/include/internal/catch_matchers.h b/include/internal/catch_matchers.h
deleted file mode 100644
index 518a6e0d..00000000
--- a/include/internal/catch_matchers.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Created by Phil Nash on 04/03/2012.
- * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
-
-#include "catch_common.h"
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-namespace Matchers {
- namespace Impl {
-
- template<typename ArgT> struct MatchAllOf;
- template<typename ArgT> struct MatchAnyOf;
- template<typename ArgT> struct MatchNotOf;
-
- class MatcherUntypedBase {
- public:
- MatcherUntypedBase() = default;
- MatcherUntypedBase ( MatcherUntypedBase const& ) = default;
- MatcherUntypedBase& operator = ( MatcherUntypedBase const& ) = delete;
- std::string toString() const;
-
- protected:
- virtual ~MatcherUntypedBase();
- virtual std::string describe() const = 0;
- mutable std::string m_cachedToString;
- };
-
-#ifdef __clang__
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wnon-virtual-dtor"
-#endif
-
- template<typename ObjectT>
- struct MatcherMethod {
- virtual bool match( ObjectT const& arg ) const = 0;
- };
-
-#if defined(__OBJC__)
- // Hack to fix Catch GH issue #1661. Could use id for generic Object support.
- // use of const for Object pointers is very uncommon and under ARC it causes some kind of signature mismatch that breaks compilation
- template<>
- struct MatcherMethod<NSString*> {
- virtual bool match( NSString* arg ) const = 0;
- };
-#endif
-
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-
- template<typename T>
- struct MatcherBase : MatcherUntypedBase, MatcherMethod<T> {
-
-
- MatchAllOf<T> operator && ( MatcherBase const& other ) const;
- MatchAnyOf<T> operator || ( MatcherBase const& other ) const;
- MatchNotOf<T> operator ! () const;
- };
-
- template<typename ArgT>
- struct MatchAllOf : MatcherBase<ArgT> {
- bool match( ArgT const& arg ) const override {
- for( auto matcher : m_matchers ) {
- if (!matcher->match(arg))
- return false;
- }
- return true;
- }
- std::string describe() const override {
- std::string description;
- description.reserve( 4 + m_matchers.size()*32 );
- description += "( ";
- bool first = true;
- for( auto matcher : m_matchers ) {
- if( first )
- first = false;
- else
- description += " and ";
- description += matcher->toString();
- }
- description += " )";
- return description;
- }
-
- MatchAllOf<ArgT> operator && ( MatcherBase<ArgT> const& other ) {
- auto copy(*this);
- copy.m_matchers.push_back( &other );
- return copy;
- }
-
- std::vector<MatcherBase<ArgT> const*> m_matchers;
- };
- template<typename ArgT>
- struct MatchAnyOf : MatcherBase<ArgT> {
-
- bool match( ArgT const& arg ) const override {
- for( auto matcher : m_matchers ) {
- if (matcher->match(arg))
- return true;
- }
- return false;
- }
- std::string describe() const override {
- std::string description;
- description.reserve( 4 + m_matchers.size()*32 );
- description += "( ";
- bool first = true;
- for( auto matcher : m_matchers ) {
- if( first )
- first = false;
- else
- description += " or ";
- description += matcher->toString();
- }
- description += " )";
- return description;
- }
-
- MatchAnyOf<ArgT> operator || ( MatcherBase<ArgT> const& other ) {
- auto copy(*this);
- copy.m_matchers.push_back( &other );
- return copy;
- }
-
- std::vector<MatcherBase<ArgT> const*> m_matchers;
- };
-
- template<typename ArgT>
- struct MatchNotOf : MatcherBase<ArgT> {
-
- MatchNotOf( MatcherBase<ArgT> const& underlyingMatcher ) : m_underlyingMatcher( underlyingMatcher ) {}
-
- bool match( ArgT const& arg ) const override {
- return !m_underlyingMatcher.match( arg );
- }
-
- std::string describe() const override {
- return "not " + m_underlyingMatcher.toString();
- }
- MatcherBase<ArgT> const& m_underlyingMatcher;
- };
-
- template<typename T>
- MatchAllOf<T> MatcherBase<T>::operator && ( MatcherBase const& other ) const {
- return MatchAllOf<T>() && *this && other;
- }
- template<typename T>
- MatchAnyOf<T> MatcherBase<T>::operator || ( MatcherBase const& other ) const {
- return MatchAnyOf<T>() || *this || other;
- }
- template<typename T>
- MatchNotOf<T> MatcherBase<T>::operator ! () const {
- return MatchNotOf<T>( *this );
- }
-
- } // namespace Impl
-
-} // namespace Matchers
-
-using namespace Matchers;
-using Matchers::Impl::MatcherBase;
-
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
diff --git a/include/internal/catch_matchers_exception.cpp b/include/internal/catch_matchers_exception.cpp
deleted file mode 100644
index b18810e8..00000000
--- a/include/internal/catch_matchers_exception.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Created by Martin Hořeňovský on 13/10/2019.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_matchers_exception.hpp"
-
-
-namespace Catch {
-namespace Matchers {
-namespace Exception {
-
-bool ExceptionMessageMatcher::match(std::exception const& ex) const {
- return ex.what() == m_message;
-}
-
-std::string ExceptionMessageMatcher::describe() const {
- return "exception message matches \"" + m_message + "\"";
-}
-
-}
-Exception::ExceptionMessageMatcher Message(std::string const& message) {
- return Exception::ExceptionMessageMatcher(message);
-}
-
-// namespace Exception
-} // namespace Matchers
-} // namespace Catch
diff --git a/include/internal/catch_matchers_exception.hpp b/include/internal/catch_matchers_exception.hpp
deleted file mode 100644
index a80b3607..00000000
--- a/include/internal/catch_matchers_exception.hpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Created by Martin Hořeňovský on 13/10/2019.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
-
-#include "catch_matchers.h"
-
-namespace Catch {
-namespace Matchers {
-namespace Exception {
-
-class ExceptionMessageMatcher : public MatcherBase<std::exception> {
- std::string m_message;
-public:
-
- ExceptionMessageMatcher(std::string const& message):
- m_message(message)
- {}
-
- bool match(std::exception const& ex) const override;
-
- std::string describe() const override;
-};
-
-} // namespace Exception
-
-Exception::ExceptionMessageMatcher Message(std::string const& message);
-
-} // namespace Matchers
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
diff --git a/include/internal/catch_matchers_floating.cpp b/include/internal/catch_matchers_floating.cpp
deleted file mode 100644
index bcca0725..00000000
--- a/include/internal/catch_matchers_floating.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Created by Martin on 07/11/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_matchers_floating.h"
-#include "catch_enforce.h"
-#include "catch_polyfills.hpp"
-#include "catch_to_string.hpp"
-#include "catch_tostring.h"
-
-#include <algorithm>
-#include <cmath>
-#include <cstdlib>
-#include <cstdint>
-#include <cstring>
-#include <sstream>
-#include <type_traits>
-#include <iomanip>
-#include <limits>
-
-
-namespace Catch {
-namespace {
-
- int32_t convert(float f) {
- static_assert(sizeof(float) == sizeof(int32_t), "Important ULP matcher assumption violated");
- int32_t i;
- std::memcpy(&i, &f, sizeof(f));
- return i;
- }
-
- int64_t convert(double d) {
- static_assert(sizeof(double) == sizeof(int64_t), "Important ULP matcher assumption violated");
- int64_t i;
- std::memcpy(&i, &d, sizeof(d));
- return i;
- }
-
- template <typename FP>
- bool almostEqualUlps(FP lhs, FP rhs, uint64_t maxUlpDiff) {
- // Comparison with NaN should always be false.
- // This way we can rule it out before getting into the ugly details
- if (Catch::isnan(lhs) || Catch::isnan(rhs)) {
- return false;
- }
-
- auto lc = convert(lhs);
- auto rc = convert(rhs);
-
- if ((lc < 0) != (rc < 0)) {
- // Potentially we can have +0 and -0
- return lhs == rhs;
- }
-
- auto ulpDiff = std::abs(lc - rc);
- return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff;
- }
-
-#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
-
- float nextafter(float x, float y) {
- return ::nextafterf(x, y);
- }
-
- double nextafter(double x, double y) {
- return ::nextafter(x, y);
- }
-
-#endif // ^^^ CATCH_CONFIG_GLOBAL_NEXTAFTER ^^^
-
-template <typename FP>
-FP step(FP start, FP direction, uint64_t steps) {
- for (uint64_t i = 0; i < steps; ++i) {
-#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
- start = Catch::nextafter(start, direction);
-#else
- start = std::nextafter(start, direction);
-#endif
- }
- return start;
-}
-
-// Performs equivalent check of std::fabs(lhs - rhs) <= margin
-// But without the subtraction to allow for INFINITY in comparison
-bool marginComparison(double lhs, double rhs, double margin) {
- return (lhs + margin >= rhs) && (rhs + margin >= lhs);
-}
-
-template <typename FloatingPoint>
-void write(std::ostream& out, FloatingPoint num) {
- out << std::scientific
- << std::setprecision(std::numeric_limits<FloatingPoint>::max_digits10 - 1)
- << num;
-}
-
-} // end anonymous namespace
-
-namespace Matchers {
-namespace Floating {
-
- enum class FloatingPointKind : uint8_t {
- Float,
- Double
- };
-
-
- WithinAbsMatcher::WithinAbsMatcher(double target, double margin)
- :m_target{ target }, m_margin{ margin } {
- CATCH_ENFORCE(margin >= 0, "Invalid margin: " << margin << '.'
- << " Margin has to be non-negative.");
- }
-
- // Performs equivalent check of std::fabs(lhs - rhs) <= margin
- // But without the subtraction to allow for INFINITY in comparison
- bool WithinAbsMatcher::match(double const& matchee) const {
- return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee);
- }
-
- std::string WithinAbsMatcher::describe() const {
- return "is within " + ::Catch::Detail::stringify(m_margin) + " of " + ::Catch::Detail::stringify(m_target);
- }
-
-
- WithinUlpsMatcher::WithinUlpsMatcher(double target, uint64_t ulps, FloatingPointKind baseType)
- :m_target{ target }, m_ulps{ ulps }, m_type{ baseType } {
- CATCH_ENFORCE(m_type == FloatingPointKind::Double
- || m_ulps < (std::numeric_limits<uint32_t>::max)(),
- "Provided ULP is impossibly large for a float comparison.");
- }
-
-#if defined(__clang__)
-#pragma clang diagnostic push
-// Clang <3.5 reports on the default branch in the switch below
-#pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
- bool WithinUlpsMatcher::match(double const& matchee) const {
- switch (m_type) {
- case FloatingPointKind::Float:
- return almostEqualUlps<float>(static_cast<float>(matchee), static_cast<float>(m_target), m_ulps);
- case FloatingPointKind::Double:
- return almostEqualUlps<double>(matchee, m_target, m_ulps);
- default:
- CATCH_INTERNAL_ERROR( "Unknown FloatingPointKind value" );
- }
- }
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
- std::string WithinUlpsMatcher::describe() const {
- std::stringstream ret;
-
- ret << "is within " << m_ulps << " ULPs of ";
-
- if (m_type == FloatingPointKind::Float) {
- write(ret, static_cast<float>(m_target));
- ret << 'f';
- } else {
- write(ret, m_target);
- }
-
- ret << " ([";
- if (m_type == FloatingPointKind::Double) {
- write(ret, step(m_target, static_cast<double>(-INFINITY), m_ulps));
- ret << ", ";
- write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps));
- } else {
- // We have to cast INFINITY to float because of MinGW, see #1782
- write(ret, step(static_cast<float>(m_target), static_cast<float>(-INFINITY), m_ulps));
- ret << ", ";
- write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps));
- }
- ret << "])";
-
- return ret.str();
- }
-
- WithinRelMatcher::WithinRelMatcher(double target, double epsilon):
- m_target(target),
- m_epsilon(epsilon){
- CATCH_ENFORCE(m_epsilon >= 0., "Relative comparison with epsilon < 0 does not make sense.");
- CATCH_ENFORCE(m_epsilon < 1., "Relative comparison with epsilon >= 1 does not make sense.");
- }
-
- bool WithinRelMatcher::match(double const& matchee) const {
- const auto relMargin = m_epsilon * (std::max)(std::fabs(matchee), std::fabs(m_target));
- return marginComparison(matchee, m_target,
- std::isinf(relMargin)? 0 : relMargin);
- }
-
- std::string WithinRelMatcher::describe() const {
- Catch::ReusableStringStream sstr;
- sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other";
- return sstr.str();
- }
-
-}// namespace Floating
-
-
-
-Floating::WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
- return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Double);
-}
-
-Floating::WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
- return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Float);
-}
-
-Floating::WithinAbsMatcher WithinAbs(double target, double margin) {
- return Floating::WithinAbsMatcher(target, margin);
-}
-
-Floating::WithinRelMatcher WithinRel(double target, double eps) {
- return Floating::WithinRelMatcher(target, eps);
-}
-
-Floating::WithinRelMatcher WithinRel(double target) {
- return Floating::WithinRelMatcher(target, std::numeric_limits<double>::epsilon() * 100);
-}
-
-Floating::WithinRelMatcher WithinRel(float target, float eps) {
- return Floating::WithinRelMatcher(target, eps);
-}
-
-Floating::WithinRelMatcher WithinRel(float target) {
- return Floating::WithinRelMatcher(target, std::numeric_limits<float>::epsilon() * 100);
-}
-
-
-} // namespace Matchers
-} // namespace Catch
-
diff --git a/include/internal/catch_matchers_floating.h b/include/internal/catch_matchers_floating.h
deleted file mode 100644
index 0f2ff49f..00000000
--- a/include/internal/catch_matchers_floating.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Created by Martin on 07/11/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
-#define TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
-
-#include "catch_matchers.h"
-
-namespace Catch {
-namespace Matchers {
-
- namespace Floating {
-
- enum class FloatingPointKind : uint8_t;
-
- struct WithinAbsMatcher : MatcherBase<double> {
- WithinAbsMatcher(double target, double margin);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- double m_margin;
- };
-
- struct WithinUlpsMatcher : MatcherBase<double> {
- WithinUlpsMatcher(double target, uint64_t ulps, FloatingPointKind baseType);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- uint64_t m_ulps;
- FloatingPointKind m_type;
- };
-
- // Given IEEE-754 format for floats and doubles, we can assume
- // that float -> double promotion is lossless. Given this, we can
- // assume that if we do the standard relative comparison of
- // |lhs - rhs| <= epsilon * max(fabs(lhs), fabs(rhs)), then we get
- // the same result if we do this for floats, as if we do this for
- // doubles that were promoted from floats.
- struct WithinRelMatcher : MatcherBase<double> {
- WithinRelMatcher(double target, double epsilon);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- double m_epsilon;
- };
-
- } // namespace Floating
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
- Floating::WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff);
- Floating::WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff);
- Floating::WithinAbsMatcher WithinAbs(double target, double margin);
- Floating::WithinRelMatcher WithinRel(double target, double eps);
- // defaults epsilon to 100*numeric_limits<double>::epsilon()
- Floating::WithinRelMatcher WithinRel(double target);
- Floating::WithinRelMatcher WithinRel(float target, float eps);
- // defaults epsilon to 100*numeric_limits<float>::epsilon()
- Floating::WithinRelMatcher WithinRel(float target);
-
-} // namespace Matchers
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
diff --git a/include/internal/catch_matchers_generic.cpp b/include/internal/catch_matchers_generic.cpp
deleted file mode 100644
index 300102e0..00000000
--- a/include/internal/catch_matchers_generic.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "catch_matchers_generic.hpp"
-
-std::string Catch::Matchers::Generic::Detail::finalizeDescription(const std::string& desc) {
- if (desc.empty()) {
- return "matches undescribed predicate";
- } else {
- return "matches predicate: \"" + desc + '"';
- }
-}
diff --git a/include/internal/catch_matchers_generic.hpp b/include/internal/catch_matchers_generic.hpp
deleted file mode 100644
index 7d57c9d4..00000000
--- a/include/internal/catch_matchers_generic.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Created by Martin Hořeňovský on 03/04/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED
-
-#include "catch_common.h"
-#include "catch_matchers.h"
-
-#include <functional>
-#include <string>
-
-namespace Catch {
-namespace Matchers {
-namespace Generic {
-
-namespace Detail {
- std::string finalizeDescription(const std::string& desc);
-}
-
-template <typename T>
-class PredicateMatcher : public MatcherBase<T> {
- std::function<bool(T const&)> m_predicate;
- std::string m_description;
-public:
-
- PredicateMatcher(std::function<bool(T const&)> const& elem, std::string const& descr)
- :m_predicate(std::move(elem)),
- m_description(Detail::finalizeDescription(descr))
- {}
-
- bool match( T const& item ) const override {
- return m_predicate(item);
- }
-
- std::string describe() const override {
- return m_description;
- }
-};
-
-} // namespace Generic
-
- // The following functions create the actual matcher objects.
- // The user has to explicitly specify type to the function, because
- // inferring std::function<bool(T const&)> is hard (but possible) and
- // requires a lot of TMP.
- template<typename T>
- Generic::PredicateMatcher<T> Predicate(std::function<bool(T const&)> const& predicate, std::string const& description = "") {
- return Generic::PredicateMatcher<T>(predicate, description);
- }
-
-} // namespace Matchers
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED
diff --git a/include/internal/catch_matchers_string.cpp b/include/internal/catch_matchers_string.cpp
deleted file mode 100644
index 1e3e72fd..00000000
--- a/include/internal/catch_matchers_string.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Created by Phil Nash on 08/02/2017.
- * Copyright (c) 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_matchers_string.h"
-#include "catch_string_manip.h"
-#include "catch_tostring.h"
-
-#include <regex>
-
-namespace Catch {
-namespace Matchers {
-
- namespace StdString {
-
- CasedString::CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_str( adjustString( str ) )
- {}
- std::string CasedString::adjustString( std::string const& str ) const {
- return m_caseSensitivity == CaseSensitive::No
- ? toLower( str )
- : str;
- }
- std::string CasedString::caseSensitivitySuffix() const {
- return m_caseSensitivity == CaseSensitive::No
- ? " (case insensitive)"
- : std::string();
- }
-
-
- StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator )
- : m_comparator( comparator ),
- m_operation( operation ) {
- }
-
- std::string StringMatcherBase::describe() const {
- std::string description;
- description.reserve(5 + m_operation.size() + m_comparator.m_str.size() +
- m_comparator.caseSensitivitySuffix().size());
- description += m_operation;
- description += ": \"";
- description += m_comparator.m_str;
- description += "\"";
- description += m_comparator.caseSensitivitySuffix();
- return description;
- }
-
- EqualsMatcher::EqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals", comparator ) {}
-
- bool EqualsMatcher::match( std::string const& source ) const {
- return m_comparator.adjustString( source ) == m_comparator.m_str;
- }
-
-
- ContainsMatcher::ContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains", comparator ) {}
-
- bool ContainsMatcher::match( std::string const& source ) const {
- return contains( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
-
- StartsWithMatcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with", comparator ) {}
-
- bool StartsWithMatcher::match( std::string const& source ) const {
- return startsWith( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
-
- EndsWithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with", comparator ) {}
-
- bool EndsWithMatcher::match( std::string const& source ) const {
- return endsWith( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
-
-
- RegexMatcher::RegexMatcher(std::string regex, CaseSensitive::Choice caseSensitivity): m_regex(std::move(regex)), m_caseSensitivity(caseSensitivity) {}
-
- bool RegexMatcher::match(std::string const& matchee) const {
- auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway
- if (m_caseSensitivity == CaseSensitive::Choice::No) {
- flags |= std::regex::icase;
- }
- auto reg = std::regex(m_regex, flags);
- return std::regex_match(matchee, reg);
- }
-
- std::string RegexMatcher::describe() const {
- return "matches " + ::Catch::Detail::stringify(m_regex) + ((m_caseSensitivity == CaseSensitive::Choice::Yes)? " case sensitively" : " case insensitively");
- }
-
- } // namespace StdString
-
-
- StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::EqualsMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::ContainsMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::EndsWithMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::StartsWithMatcher( StdString::CasedString( str, caseSensitivity) );
- }
-
- StdString::RegexMatcher Matches(std::string const& regex, CaseSensitive::Choice caseSensitivity) {
- return StdString::RegexMatcher(regex, caseSensitivity);
- }
-
-} // namespace Matchers
-} // namespace Catch
diff --git a/include/internal/catch_matchers_string.h b/include/internal/catch_matchers_string.h
deleted file mode 100644
index fdbc03ce..00000000
--- a/include/internal/catch_matchers_string.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Created by Phil Nash on 08/02/2017.
- * Copyright (c) 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
-#define TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
-
-#include "catch_matchers.h"
-
-#include <string>
-
-namespace Catch {
-namespace Matchers {
-
- namespace StdString {
-
- struct CasedString
- {
- CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity );
- std::string adjustString( std::string const& str ) const;
- std::string caseSensitivitySuffix() const;
-
- CaseSensitive::Choice m_caseSensitivity;
- std::string m_str;
- };
-
- struct StringMatcherBase : MatcherBase<std::string> {
- StringMatcherBase( std::string const& operation, CasedString const& comparator );
- std::string describe() const override;
-
- CasedString m_comparator;
- std::string m_operation;
- };
-
- struct EqualsMatcher : StringMatcherBase {
- EqualsMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct ContainsMatcher : StringMatcherBase {
- ContainsMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct StartsWithMatcher : StringMatcherBase {
- StartsWithMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct EndsWithMatcher : StringMatcherBase {
- EndsWithMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
-
- struct RegexMatcher : MatcherBase<std::string> {
- RegexMatcher( std::string regex, CaseSensitive::Choice caseSensitivity );
- bool match( std::string const& matchee ) const override;
- std::string describe() const override;
-
- private:
- std::string m_regex;
- CaseSensitive::Choice m_caseSensitivity;
- };
-
- } // namespace StdString
-
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
-
- StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::RegexMatcher Matches( std::string const& regex, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
-
-} // namespace Matchers
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
diff --git a/include/internal/catch_matchers_vector.h b/include/internal/catch_matchers_vector.h
deleted file mode 100644
index 2dc8a715..00000000
--- a/include/internal/catch_matchers_vector.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Created by Phil Nash on 21/02/2017.
- * Copyright (c) 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
-#define TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
-
-#include "catch_matchers.h"
-#include "catch_approx.h"
-
-#include <algorithm>
-
-namespace Catch {
-namespace Matchers {
-
- namespace Vector {
- template<typename T>
- struct ContainsElementMatcher : MatcherBase<std::vector<T>> {
-
- ContainsElementMatcher(T const &comparator) : m_comparator( comparator) {}
-
- bool match(std::vector<T> const &v) const override {
- for (auto const& el : v) {
- if (el == m_comparator) {
- return true;
- }
- }
- return false;
- }
-
- std::string describe() const override {
- return "Contains: " + ::Catch::Detail::stringify( m_comparator );
- }
-
- T const& m_comparator;
- };
-
- template<typename T>
- struct ContainsMatcher : MatcherBase<std::vector<T>> {
-
- ContainsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T> const &v) const override {
- // !TBD: see note in EqualsMatcher
- if (m_comparator.size() > v.size())
- return false;
- for (auto const& comparator : m_comparator) {
- auto present = false;
- for (const auto& el : v) {
- if (el == comparator) {
- present = true;
- break;
- }
- }
- if (!present) {
- return false;
- }
- }
- return true;
- }
- std::string describe() const override {
- return "Contains: " + ::Catch::Detail::stringify( m_comparator );
- }
-
- std::vector<T> const& m_comparator;
- };
-
- template<typename T>
- struct EqualsMatcher : MatcherBase<std::vector<T>> {
-
- EqualsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T> const &v) const override {
- // !TBD: This currently works if all elements can be compared using !=
- // - a more general approach would be via a compare template that defaults
- // to using !=. but could be specialised for, e.g. std::vector<T> etc
- // - then just call that directly
- if (m_comparator.size() != v.size())
- return false;
- for (std::size_t i = 0; i < v.size(); ++i)
- if (m_comparator[i] != v[i])
- return false;
- return true;
- }
- std::string describe() const override {
- return "Equals: " + ::Catch::Detail::stringify( m_comparator );
- }
- std::vector<T> const& m_comparator;
- };
-
- template<typename T>
- struct ApproxMatcher : MatcherBase<std::vector<T>> {
-
- ApproxMatcher(std::vector<T> const& comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T> const &v) const override {
- if (m_comparator.size() != v.size())
- return false;
- for (std::size_t i = 0; i < v.size(); ++i)
- if (m_comparator[i] != approx(v[i]))
- return false;
- return true;
- }
- std::string describe() const override {
- return "is approx: " + ::Catch::Detail::stringify( m_comparator );
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& epsilon( T const& newEpsilon ) {
- approx.epsilon(newEpsilon);
- return *this;
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& margin( T const& newMargin ) {
- approx.margin(newMargin);
- return *this;
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& scale( T const& newScale ) {
- approx.scale(newScale);
- return *this;
- }
-
- std::vector<T> const& m_comparator;
- mutable Catch::Detail::Approx approx = Catch::Detail::Approx::custom();
- };
-
- template<typename T>
- struct UnorderedEqualsMatcher : MatcherBase<std::vector<T>> {
- UnorderedEqualsMatcher(std::vector<T> const& target) : m_target(target) {}
- bool match(std::vector<T> const& vec) const override {
- // Note: This is a reimplementation of std::is_permutation,
- // because I don't want to include <algorithm> inside the common path
- if (m_target.size() != vec.size()) {
- return false;
- }
- return std::is_permutation(m_target.begin(), m_target.end(), vec.begin());
- }
-
- std::string describe() const override {
- return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target);
- }
- private:
- std::vector<T> const& m_target;
- };
-
- } // namespace Vector
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
-
- template<typename T>
- Vector::ContainsMatcher<T> Contains( std::vector<T> const& comparator ) {
- return Vector::ContainsMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::ContainsElementMatcher<T> VectorContains( T const& comparator ) {
- return Vector::ContainsElementMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::EqualsMatcher<T> Equals( std::vector<T> const& comparator ) {
- return Vector::EqualsMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::ApproxMatcher<T> Approx( std::vector<T> const& comparator ) {
- return Vector::ApproxMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::UnorderedEqualsMatcher<T> UnorderedEquals(std::vector<T> const& target) {
- return Vector::UnorderedEqualsMatcher<T>(target);
- }
-
-} // namespace Matchers
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
diff --git a/include/internal/catch_message.cpp b/include/internal/catch_message.cpp
deleted file mode 100644
index 64c817b7..00000000
--- a/include/internal/catch_message.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Created by Phil Nash on 1/2/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_message.h"
-#include "catch_interfaces_capture.h"
-#include "catch_uncaught_exceptions.h"
-#include "catch_enforce.h"
-
-#include <cassert>
-#include <stack>
-
-namespace Catch {
-
- MessageInfo::MessageInfo( StringRef const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type )
- : macroName( _macroName ),
- lineInfo( _lineInfo ),
- type( _type ),
- sequence( ++globalCount )
- {}
-
- bool MessageInfo::operator==( MessageInfo const& other ) const {
- return sequence == other.sequence;
- }
-
- bool MessageInfo::operator<( MessageInfo const& other ) const {
- return sequence < other.sequence;
- }
-
- // This may need protecting if threading support is added
- unsigned int MessageInfo::globalCount = 0;
-
-
- ////////////////////////////////////////////////////////////////////////////
-
- Catch::MessageBuilder::MessageBuilder( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- ResultWas::OfType type )
- :m_info(macroName, lineInfo, type) {}
-
- ////////////////////////////////////////////////////////////////////////////
-
-
- ScopedMessage::ScopedMessage( MessageBuilder const& builder )
- : m_info( builder.m_info ), m_moved()
- {
- m_info.message = builder.m_stream.str();
- getResultCapture().pushScopedMessage( m_info );
- }
-
- ScopedMessage::ScopedMessage( ScopedMessage&& old )
- : m_info( old.m_info ), m_moved()
- {
- old.m_moved = true;
- }
-
- ScopedMessage::~ScopedMessage() {
- if ( !uncaught_exceptions() && !m_moved ){
- getResultCapture().popScopedMessage(m_info);
- }
- }
-
-
- Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) {
- auto trimmed = [&] (size_t start, size_t end) {
- while (names[start] == ',' || isspace(names[start])) {
- ++start;
- }
- while (names[end] == ',' || isspace(names[end])) {
- --end;
- }
- return names.substr(start, end - start + 1);
- };
- auto skipq = [&] (size_t start, char quote) {
- for (auto i = start + 1; i < names.size() ; ++i) {
- if (names[i] == quote)
- return i;
- if (names[i] == '\\')
- ++i;
- }
- CATCH_INTERNAL_ERROR("CAPTURE parsing encountered unmatched quote");
- };
-
- size_t start = 0;
- std::stack<char> openings;
- for (size_t pos = 0; pos < names.size(); ++pos) {
- char c = names[pos];
- switch (c) {
- case '[':
- case '{':
- case '(':
- // It is basically impossible to disambiguate between
- // comparison and start of template args in this context
-// case '<':
- openings.push(c);
- break;
- case ']':
- case '}':
- case ')':
-// case '>':
- openings.pop();
- break;
- case '"':
- case '\'':
- pos = skipq(pos, c);
- break;
- case ',':
- if (start != pos && openings.empty()) {
- m_messages.emplace_back(macroName, lineInfo, resultType);
- m_messages.back().message = static_cast<std::string>(trimmed(start, pos));
- m_messages.back().message += " := ";
- start = pos;
- }
- }
- }
- assert(openings.empty() && "Mismatched openings");
- m_messages.emplace_back(macroName, lineInfo, resultType);
- m_messages.back().message = static_cast<std::string>(trimmed(start, names.size() - 1));
- m_messages.back().message += " := ";
- }
- Capturer::~Capturer() {
- if ( !uncaught_exceptions() ){
- assert( m_captured == m_messages.size() );
- for( size_t i = 0; i < m_captured; ++i )
- m_resultCapture.popScopedMessage( m_messages[i] );
- }
- }
-
- void Capturer::captureValue( size_t index, std::string const& value ) {
- assert( index < m_messages.size() );
- m_messages[index].message += value;
- m_resultCapture.pushScopedMessage( m_messages[index] );
- m_captured++;
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_message.h b/include/internal/catch_message.h
deleted file mode 100644
index 748f5ac5..00000000
--- a/include/internal/catch_message.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Created by Phil Nash on 1/2/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
-#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
-
-#include "catch_result_type.h"
-#include "catch_common.h"
-#include "catch_stream.h"
-#include "catch_interfaces_capture.h"
-#include "catch_tostring.h"
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-
- struct MessageInfo {
- MessageInfo( StringRef const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type );
-
- StringRef macroName;
- std::string message;
- SourceLineInfo lineInfo;
- ResultWas::OfType type;
- unsigned int sequence;
-
- bool operator == ( MessageInfo const& other ) const;
- bool operator < ( MessageInfo const& other ) const;
- private:
- static unsigned int globalCount;
- };
-
- struct MessageStream {
-
- template<typename T>
- MessageStream& operator << ( T const& value ) {
- m_stream << value;
- return *this;
- }
-
- ReusableStringStream m_stream;
- };
-
- struct MessageBuilder : MessageStream {
- MessageBuilder( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- ResultWas::OfType type );
-
- template<typename T>
- MessageBuilder& operator << ( T const& value ) {
- m_stream << value;
- return *this;
- }
-
- MessageInfo m_info;
- };
-
- class ScopedMessage {
- public:
- explicit ScopedMessage( MessageBuilder const& builder );
- ScopedMessage( ScopedMessage& duplicate ) = delete;
- ScopedMessage( ScopedMessage&& old );
- ~ScopedMessage();
-
- MessageInfo m_info;
- bool m_moved;
- };
-
- class Capturer {
- std::vector<MessageInfo> m_messages;
- IResultCapture& m_resultCapture = getResultCapture();
- size_t m_captured = 0;
- public:
- Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names );
- ~Capturer();
-
- void captureValue( size_t index, std::string const& value );
-
- template<typename T>
- void captureValues( size_t index, T const& value ) {
- captureValue( index, Catch::Detail::stringify( value ) );
- }
-
- template<typename T, typename... Ts>
- void captureValues( size_t index, T const& value, Ts const&... values ) {
- captureValue( index, Catch::Detail::stringify(value) );
- captureValues( index+1, values... );
- }
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
diff --git a/include/internal/catch_meta.hpp b/include/internal/catch_meta.hpp
deleted file mode 100644
index 4eca7efc..00000000
--- a/include/internal/catch_meta.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Created by Jozef on 02/12/2018.
- * Copyright 2018 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef TWOBLUECUBES_CATCH_META_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_META_HPP_INCLUDED
-
-#include <type_traits>
-
-namespace Catch {
- template<typename T>
- struct always_false : std::false_type {};
-
- template <typename> struct true_given : std::true_type {};
- struct is_callable_tester {
- template <typename Fun, typename... Args>
- true_given<decltype(std::declval<Fun>()(std::declval<Args>()...))> static test(int);
- template <typename...>
- std::false_type static test(...);
- };
-
- template <typename T>
- struct is_callable;
-
- template <typename Fun, typename... Args>
- struct is_callable<Fun(Args...)> : decltype(is_callable_tester::test<Fun, Args...>(0)) {};
-
-
-#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
- // std::result_of is deprecated in C++17 and removed in C++20. Hence, it is
- // replaced with std::invoke_result here. Also *_t format is preferred over
- // typename *::type format.
- template <typename Func, typename U>
- using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U>>>;
-#else
- template <typename Func, typename U>
- using FunctionReturnType = typename std::remove_reference<typename std::remove_cv<typename std::result_of<Func(U)>::type>::type>::type;
-#endif
-
-} // namespace Catch
-
-namespace mpl_{
- struct na;
-}
-
-#endif // TWOBLUECUBES_CATCH_META_HPP_INCLUDED
diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp
deleted file mode 100644
index a1c8e074..00000000
--- a/include/internal/catch_objc.hpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Created by Phil on 14/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
-
-#include "catch_objc_arc.hpp"
-
-#import <objc/runtime.h>
-
-#include <string>
-
-// NB. Any general catch headers included here must be included
-// in catch.hpp first to make sure they are included by the single
-// header for non obj-usage
-#include "catch_test_case_info.h"
-#include "catch_string_manip.h"
-#include "catch_tostring.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// This protocol is really only here for (self) documenting purposes, since
-// all its methods are optional.
-@protocol OcFixture
-
-@optional
-
--(void) setUp;
--(void) tearDown;
-
-@end
-
-namespace Catch {
-
- class OcMethod : public ITestInvoker {
-
- public:
- OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {}
-
- virtual void invoke() const {
- id obj = [[m_cls alloc] init];
-
- performOptionalSelector( obj, @selector(setUp) );
- performOptionalSelector( obj, m_sel );
- performOptionalSelector( obj, @selector(tearDown) );
-
- arcSafeRelease( obj );
- }
- private:
- virtual ~OcMethod() {}
-
- Class m_cls;
- SEL m_sel;
- };
-
- namespace Detail{
-
-
- inline std::string getAnnotation( Class cls,
- std::string const& annotationName,
- std::string const& testCaseName ) {
- NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()];
- SEL sel = NSSelectorFromString( selStr );
- arcSafeRelease( selStr );
- id value = performOptionalSelector( cls, sel );
- if( value )
- return [(NSString*)value UTF8String];
- return "";
- }
- }
-
- inline std::size_t registerTestMethods() {
- std::size_t noTestMethods = 0;
- int noClasses = objc_getClassList( nullptr, 0 );
-
- Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
- objc_getClassList( classes, noClasses );
-
- for( int c = 0; c < noClasses; c++ ) {
- Class cls = classes[c];
- {
- u_int count;
- Method* methods = class_copyMethodList( cls, &count );
- for( u_int m = 0; m < count ; m++ ) {
- SEL selector = method_getName(methods[m]);
- std::string methodName = sel_getName(selector);
- if( startsWith( methodName, "Catch_TestCase_" ) ) {
- std::string testCaseName = methodName.substr( 15 );
- std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
- std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
- const char* className = class_getName( cls );
-
- getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
- noTestMethods++;
- }
- }
- free(methods);
- }
- }
- return noTestMethods;
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-
- namespace Matchers {
- namespace Impl {
- namespace NSStringMatchers {
-
- struct StringHolder : MatcherBase<NSString*>{
- StringHolder( NSString* substr ) : m_substr( [substr copy] ){}
- StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){}
- StringHolder() {
- arcSafeRelease( m_substr );
- }
-
- bool match( NSString* str ) const override {
- return false;
- }
-
- NSString* CATCH_ARC_STRONG m_substr;
- };
-
- struct Equals : StringHolder {
- Equals( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str isEqualToString:m_substr];
- }
-
- std::string describe() const override {
- return "equals string: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- struct Contains : StringHolder {
- Contains( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location != NSNotFound;
- }
-
- std::string describe() const override {
- return "contains string: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- struct StartsWith : StringHolder {
- StartsWith( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == 0;
- }
-
- std::string describe() const override {
- return "starts with: " + Catch::Detail::stringify( m_substr );
- }
- };
- struct EndsWith : StringHolder {
- EndsWith( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == [str length] - [m_substr length];
- }
-
- std::string describe() const override {
- return "ends with: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- } // namespace NSStringMatchers
- } // namespace Impl
-
- inline Impl::NSStringMatchers::Equals
- Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); }
-
- inline Impl::NSStringMatchers::Contains
- Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); }
-
- inline Impl::NSStringMatchers::StartsWith
- StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); }
-
- inline Impl::NSStringMatchers::EndsWith
- EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); }
-
- } // namespace Matchers
-
- using namespace Matchers;
-
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-} // namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define OC_MAKE_UNIQUE_NAME( root, uniqueSuffix ) root##uniqueSuffix
-#define OC_TEST_CASE2( name, desc, uniqueSuffix ) \
-+(NSString*) OC_MAKE_UNIQUE_NAME( Catch_Name_test_, uniqueSuffix ) \
-{ \
-return @ name; \
-} \
-+(NSString*) OC_MAKE_UNIQUE_NAME( Catch_Description_test_, uniqueSuffix ) \
-{ \
-return @ desc; \
-} \
--(void) OC_MAKE_UNIQUE_NAME( Catch_TestCase_test_, uniqueSuffix )
-
-#define OC_TEST_CASE( name, desc ) OC_TEST_CASE2( name, desc, __LINE__ )
-
-#endif // TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
diff --git a/include/internal/catch_objc_arc.hpp b/include/internal/catch_objc_arc.hpp
deleted file mode 100644
index 6bcd6b82..00000000
--- a/include/internal/catch_objc_arc.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Created by Phil on 1/08/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED
-
-#import <Foundation/Foundation.h>
-
-#ifdef __has_feature
-#define CATCH_ARC_ENABLED __has_feature(objc_arc)
-#else
-#define CATCH_ARC_ENABLED 0
-#endif
-
-void arcSafeRelease( NSObject* obj );
-id performOptionalSelector( id obj, SEL sel );
-
-#if !CATCH_ARC_ENABLED
-inline void arcSafeRelease( NSObject* obj ) {
- [obj release];
-}
-inline id performOptionalSelector( id obj, SEL sel ) {
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED
-#define CATCH_ARC_STRONG
-#else
-inline void arcSafeRelease( NSObject* ){}
-inline id performOptionalSelector( id obj, SEL sel ) {
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
-#endif
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
-#define CATCH_ARC_STRONG __strong
-#endif
-
-#endif // TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED
diff --git a/include/internal/catch_option.hpp b/include/internal/catch_option.hpp
deleted file mode 100644
index d790b245..00000000
--- a/include/internal/catch_option.hpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Created by Phil on 02/12/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED
-
-namespace Catch {
-
- // An optional type
- template<typename T>
- class Option {
- public:
- Option() : nullableValue( nullptr ) {}
- Option( T const& _value )
- : nullableValue( new( storage ) T( _value ) )
- {}
- Option( Option const& _other )
- : nullableValue( _other ? new( storage ) T( *_other ) : nullptr )
- {}
-
- ~Option() {
- reset();
- }
-
- Option& operator= ( Option const& _other ) {
- if( &_other != this ) {
- reset();
- if( _other )
- nullableValue = new( storage ) T( *_other );
- }
- return *this;
- }
- Option& operator = ( T const& _value ) {
- reset();
- nullableValue = new( storage ) T( _value );
- return *this;
- }
-
- void reset() {
- if( nullableValue )
- nullableValue->~T();
- nullableValue = nullptr;
- }
-
- T& operator*() { return *nullableValue; }
- T const& operator*() const { return *nullableValue; }
- T* operator->() { return nullableValue; }
- const T* operator->() const { return nullableValue; }
-
- T valueOr( T const& defaultValue ) const {
- return nullableValue ? *nullableValue : defaultValue;
- }
-
- bool some() const { return nullableValue != nullptr; }
- bool none() const { return nullableValue == nullptr; }
-
- bool operator !() const { return nullableValue == nullptr; }
- explicit operator bool() const {
- return some();
- }
-
- private:
- T *nullableValue;
- alignas(alignof(T)) char storage[sizeof(T)];
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED
diff --git a/include/internal/catch_output_redirect.cpp b/include/internal/catch_output_redirect.cpp
deleted file mode 100644
index 1308bfe3..00000000
--- a/include/internal/catch_output_redirect.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Created by Martin on 28/04/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_output_redirect.h"
-#include "catch_enforce.h"
-
-#include <cstdio>
-#include <cstring>
-#include <fstream>
-#include <sstream>
-#include <stdexcept>
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
- #if defined(_MSC_VER)
- #include <io.h> //_dup and _dup2
- #define dup _dup
- #define dup2 _dup2
- #define fileno _fileno
- #else
- #include <unistd.h> // dup and dup2
- #endif
-#endif
-
-
-namespace Catch {
-
- RedirectedStream::RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream )
- : m_originalStream( originalStream ),
- m_redirectionStream( redirectionStream ),
- m_prevBuf( m_originalStream.rdbuf() )
- {
- m_originalStream.rdbuf( m_redirectionStream.rdbuf() );
- }
-
- RedirectedStream::~RedirectedStream() {
- m_originalStream.rdbuf( m_prevBuf );
- }
-
- RedirectedStdOut::RedirectedStdOut() : m_cout( Catch::cout(), m_rss.get() ) {}
- auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); }
-
- RedirectedStdErr::RedirectedStdErr()
- : m_cerr( Catch::cerr(), m_rss.get() ),
- m_clog( Catch::clog(), m_rss.get() )
- {}
- auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); }
-
- RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr)
- : m_redirectedCout(redirectedCout),
- m_redirectedCerr(redirectedCerr)
- {}
-
- RedirectedStreams::~RedirectedStreams() {
- m_redirectedCout += m_redirectedStdOut.str();
- m_redirectedCerr += m_redirectedStdErr.str();
- }
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
-
-#if defined(_MSC_VER)
- TempFile::TempFile() {
- if (tmpnam_s(m_buffer)) {
- CATCH_RUNTIME_ERROR("Could not get a temp filename");
- }
- if (fopen_s(&m_file, m_buffer, "w")) {
- char buffer[100];
- if (strerror_s(buffer, errno)) {
- CATCH_RUNTIME_ERROR("Could not translate errno to a string");
- }
- CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer);
- }
- }
-#else
- TempFile::TempFile() {
- m_file = std::tmpfile();
- if (!m_file) {
- CATCH_RUNTIME_ERROR("Could not create a temp file.");
- }
- }
-
-#endif
-
- TempFile::~TempFile() {
- // TBD: What to do about errors here?
- std::fclose(m_file);
- // We manually create the file on Windows only, on Linux
- // it will be autodeleted
-#if defined(_MSC_VER)
- std::remove(m_buffer);
-#endif
- }
-
-
- FILE* TempFile::getFile() {
- return m_file;
- }
-
- std::string TempFile::getContents() {
- std::stringstream sstr;
- char buffer[100] = {};
- std::rewind(m_file);
- while (std::fgets(buffer, sizeof(buffer), m_file)) {
- sstr << buffer;
- }
- return sstr.str();
- }
-
- OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) :
- m_originalStdout(dup(1)),
- m_originalStderr(dup(2)),
- m_stdoutDest(stdout_dest),
- m_stderrDest(stderr_dest) {
- dup2(fileno(m_stdoutFile.getFile()), 1);
- dup2(fileno(m_stderrFile.getFile()), 2);
- }
-
- OutputRedirect::~OutputRedirect() {
- Catch::cout() << std::flush;
- fflush(stdout);
- // Since we support overriding these streams, we flush cerr
- // even though std::cerr is unbuffered
- Catch::cerr() << std::flush;
- Catch::clog() << std::flush;
- fflush(stderr);
-
- dup2(m_originalStdout, 1);
- dup2(m_originalStderr, 2);
-
- m_stdoutDest += m_stdoutFile.getContents();
- m_stderrDest += m_stderrFile.getContents();
- }
-
-#endif // CATCH_CONFIG_NEW_CAPTURE
-
-} // namespace Catch
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
- #if defined(_MSC_VER)
- #undef dup
- #undef dup2
- #undef fileno
- #endif
-#endif
diff --git a/include/internal/catch_output_redirect.h b/include/internal/catch_output_redirect.h
deleted file mode 100644
index 3d1c2d45..00000000
--- a/include/internal/catch_output_redirect.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Created by Martin on 28/04/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-#define TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-
-#include "catch_platform.h"
-#include "catch_stream.h"
-
-#include <cstdio>
-#include <iosfwd>
-#include <string>
-
-namespace Catch {
-
- class RedirectedStream {
- std::ostream& m_originalStream;
- std::ostream& m_redirectionStream;
- std::streambuf* m_prevBuf;
-
- public:
- RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream );
- ~RedirectedStream();
- };
-
- class RedirectedStdOut {
- ReusableStringStream m_rss;
- RedirectedStream m_cout;
- public:
- RedirectedStdOut();
- auto str() const -> std::string;
- };
-
- // StdErr has two constituent streams in C++, std::cerr and std::clog
- // This means that we need to redirect 2 streams into 1 to keep proper
- // order of writes
- class RedirectedStdErr {
- ReusableStringStream m_rss;
- RedirectedStream m_cerr;
- RedirectedStream m_clog;
- public:
- RedirectedStdErr();
- auto str() const -> std::string;
- };
-
- class RedirectedStreams {
- public:
- RedirectedStreams(RedirectedStreams const&) = delete;
- RedirectedStreams& operator=(RedirectedStreams const&) = delete;
- RedirectedStreams(RedirectedStreams&&) = delete;
- RedirectedStreams& operator=(RedirectedStreams&&) = delete;
-
- RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr);
- ~RedirectedStreams();
- private:
- std::string& m_redirectedCout;
- std::string& m_redirectedCerr;
- RedirectedStdOut m_redirectedStdOut;
- RedirectedStdErr m_redirectedStdErr;
- };
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
-
- // Windows's implementation of std::tmpfile is terrible (it tries
- // to create a file inside system folder, thus requiring elevated
- // privileges for the binary), so we have to use tmpnam(_s) and
- // create the file ourselves there.
- class TempFile {
- public:
- TempFile(TempFile const&) = delete;
- TempFile& operator=(TempFile const&) = delete;
- TempFile(TempFile&&) = delete;
- TempFile& operator=(TempFile&&) = delete;
-
- TempFile();
- ~TempFile();
-
- std::FILE* getFile();
- std::string getContents();
-
- private:
- std::FILE* m_file = nullptr;
- #if defined(_MSC_VER)
- char m_buffer[L_tmpnam] = { 0 };
- #endif
- };
-
-
- class OutputRedirect {
- public:
- OutputRedirect(OutputRedirect const&) = delete;
- OutputRedirect& operator=(OutputRedirect const&) = delete;
- OutputRedirect(OutputRedirect&&) = delete;
- OutputRedirect& operator=(OutputRedirect&&) = delete;
-
-
- OutputRedirect(std::string& stdout_dest, std::string& stderr_dest);
- ~OutputRedirect();
-
- private:
- int m_originalStdout = -1;
- int m_originalStderr = -1;
- TempFile m_stdoutFile;
- TempFile m_stderrFile;
- std::string& m_stdoutDest;
- std::string& m_stderrDest;
- };
-
-#endif
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
diff --git a/include/internal/catch_platform.h b/include/internal/catch_platform.h
deleted file mode 100644
index e14cd332..00000000
--- a/include/internal/catch_platform.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Created by Phil on 16/8/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
-#define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
-
-#ifdef __APPLE__
-# include <TargetConditionals.h>
-# if TARGET_OS_OSX == 1
-# define CATCH_PLATFORM_MAC
-# elif TARGET_OS_IPHONE == 1
-# define CATCH_PLATFORM_IPHONE
-# endif
-
-#elif defined(linux) || defined(__linux) || defined(__linux__)
-# define CATCH_PLATFORM_LINUX
-
-#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
-# define CATCH_PLATFORM_WINDOWS
-#endif
-
-#endif // TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
diff --git a/include/internal/catch_polyfills.cpp b/include/internal/catch_polyfills.cpp
deleted file mode 100644
index 68a2c827..00000000
--- a/include/internal/catch_polyfills.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Created by Martin on 17/11/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_polyfills.hpp"
-
-#include <cmath>
-
-namespace Catch {
-
-#if !defined(CATCH_CONFIG_POLYFILL_ISNAN)
- bool isnan(float f) {
- return std::isnan(f);
- }
- bool isnan(double d) {
- return std::isnan(d);
- }
-#else
- // For now we only use this for embarcadero
- bool isnan(float f) {
- return std::_isnan(f);
- }
- bool isnan(double d) {
- return std::_isnan(d);
- }
-#endif
-
-} // end namespace Catch
diff --git a/include/internal/catch_polyfills.hpp b/include/internal/catch_polyfills.hpp
deleted file mode 100644
index ba4189ef..00000000
--- a/include/internal/catch_polyfills.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Created by Martin on 17/11/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_POLYFILLS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_POLYFILLS_HPP_INCLUDED
-
-namespace Catch {
- bool isnan(float f);
- bool isnan(double d);
-}
-
-#endif // TWOBLUECUBES_CATCH_POLYFILLS_HPP_INCLUDED
diff --git a/include/internal/catch_preprocessor.hpp b/include/internal/catch_preprocessor.hpp
deleted file mode 100644
index f1bd0905..00000000
--- a/include/internal/catch_preprocessor.hpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Created by Jozef on 12/11/2018.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef TWOBLUECUBES_CATCH_PREPROCESSOR_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_PREPROCESSOR_HPP_INCLUDED
-
-#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__
-#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__)))
-
-#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__
-// MSVC needs more evaluations
-#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__)))
-#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__))
-#else
-#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__)
-#endif
-
-#define CATCH_REC_END(...)
-#define CATCH_REC_OUT
-
-#define CATCH_EMPTY()
-#define CATCH_DEFER(id) id CATCH_EMPTY()
-
-#define CATCH_REC_GET_END2() 0, CATCH_REC_END
-#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2
-#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1
-#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT
-#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0)
-#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next)
-
-#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
-
-#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__ )
-#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__ )
-#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__ )
-
-// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results,
-// and passes userdata as the first parameter to each invocation,
-// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c)
-#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
-
-#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
-
-#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param)
-#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__
-#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__
-#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
-#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__)
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__
-#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param))
-#else
-// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
-#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__)
-#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__
-#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1)
-#endif
-
-#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__
-#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name)
-
-#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__)
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>())
-#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))
-#else
-#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>()))
-#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)))
-#endif
-
-#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\
- CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__)
-
-#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0)
-#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1)
-#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2)
-#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)
-#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)
-#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)
-#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, _4, _5, _6)
-#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)
-#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)
-#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)
-#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)
-
-#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
-
-#define INTERNAL_CATCH_TYPE_GEN\
- template<typename...> struct TypeList {};\
- template<typename...Ts>\
- constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
- template<template<typename...> class...> struct TemplateTypeList{};\
- template<template<typename...> class...Cs>\
- constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
- template<typename...>\
- struct append;\
- template<typename...>\
- struct rewrap;\
- template<template<typename...> class, typename...>\
- struct create;\
- template<template<typename...> class, typename>\
- struct convert;\
- \
- template<typename T> \
- struct append<T> { using type = T; };\
- template< template<typename...> class L1, typename...E1, template<typename...> class L2, typename...E2, typename...Rest>\
- struct append<L1<E1...>, L2<E2...>, Rest...> { using type = typename append<L1<E1...,E2...>, Rest...>::type; };\
- template< template<typename...> class L1, typename...E1, typename...Rest>\
- struct append<L1<E1...>, TypeList<mpl_::na>, Rest...> { using type = L1<E1...>; };\
- \
- template< template<typename...> class Container, template<typename...> class List, typename...elems>\
- struct rewrap<TemplateTypeList<Container>, List<elems...>> { using type = TypeList<Container<elems...>>; };\
- template< template<typename...> class Container, template<typename...> class List, class...Elems, typename...Elements>\
- struct rewrap<TemplateTypeList<Container>, List<Elems...>, Elements...> { using type = typename append<TypeList<Container<Elems...>>, typename rewrap<TemplateTypeList<Container>, Elements...>::type>::type; };\
- \
- template<template <typename...> class Final, template< typename...> class...Containers, typename...Types>\
- struct create<Final, TemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<TemplateTypeList<Containers>, Types...>::type...>::type; };\
- template<template <typename...> class Final, template <typename...> class List, typename...Ts>\
- struct convert<Final, List<Ts...>> { using type = typename append<Final<>,TypeList<Ts>...>::type; };
-
-#define INTERNAL_CATCH_NTTP_1(signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> struct Nttp{};\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> { return {}; } \
- template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...> struct NttpTemplateTypeList{};\
- template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Cs>\
- constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList<Cs...> { return {}; } \
- \
- template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>> { using type = TypeList<Container<__VA_ARGS__>>; };\
- template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature), typename...Elements>\
- struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>, Elements...> { using type = typename append<TypeList<Container<__VA_ARGS__>>, typename rewrap<NttpTemplateTypeList<Container>, Elements...>::type>::type; };\
- template<template <typename...> class Final, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Containers, typename...Types>\
- struct create<Final, NttpTemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<NttpTemplateTypeList<Containers>, Types...>::type...>::type; };
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST0(TestName)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST1(TestName, signature)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_X(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-
-#define INTERNAL_CATCH_DEFINE_SIG_TEST0(TestName)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST1(TestName, signature)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_X(TestName, signature,...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-
-#define INTERNAL_CATCH_NTTP_REGISTER0(TestFunc, signature)\
- template<typename Type>\
- void reg_test(TypeList<Type>, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<Type>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER(TestFunc, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- void reg_test(Nttp<__VA_ARGS__>, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<__VA_ARGS__>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER_METHOD0(TestName, signature, ...)\
- template<typename Type>\
- void reg_test(TypeList<Type>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestName<Type>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER_METHOD(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- void reg_test(Nttp<__VA_ARGS__>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestName<__VA_ARGS__>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
- }
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0(TestName, ClassName)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1(TestName, ClassName, signature)\
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<TestType> { \
- void test();\
- }
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X(TestName, ClassName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<__VA_ARGS__> { \
- void test();\
- }
-
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0(TestName)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1(TestName, signature)\
- template<typename TestType> \
- void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<TestType>::test()
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
- void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<__VA_ARGS__>::test()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_NTTP_0
-#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)
-#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__)
-#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__)
-#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__)
-#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__)
-#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__)
-#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__)
-#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__)
-#else
-#define INTERNAL_CATCH_NTTP_0(signature)
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#endif
-
-#endif // TWOBLUECUBES_CATCH_PREPROCESSOR_HPP_INCLUDED
diff --git a/include/internal/catch_random_number_generator.cpp b/include/internal/catch_random_number_generator.cpp
deleted file mode 100644
index 1ef08d4c..00000000
--- a/include/internal/catch_random_number_generator.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Created by Martin on 30/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_random_number_generator.h"
-#include "catch_context.h"
-#include "catch_run_context.h"
-#include "catch_interfaces_config.h"
-
-namespace Catch {
-
-namespace {
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4146) // we negate uint32 during the rotate
-#endif
- // Safe rotr implementation thanks to John Regehr
- uint32_t rotate_right(uint32_t val, uint32_t count) {
- const uint32_t mask = 31;
- count &= mask;
- return (val >> count) | (val << (-count & mask));
- }
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-}
-
-
- SimplePcg32::SimplePcg32(result_type seed_) {
- seed(seed_);
- }
-
-
- void SimplePcg32::seed(result_type seed_) {
- m_state = 0;
- (*this)();
- m_state += seed_;
- (*this)();
- }
-
- void SimplePcg32::discard(uint64_t skip) {
- // We could implement this to run in O(log n) steps, but this
- // should suffice for our use case.
- for (uint64_t s = 0; s < skip; ++s) {
- static_cast<void>((*this)());
- }
- }
-
- SimplePcg32::result_type SimplePcg32::operator()() {
- // prepare the output value
- const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u);
- const auto output = rotate_right(xorshifted, m_state >> 59u);
-
- // advance state
- m_state = m_state * 6364136223846793005ULL + s_inc;
-
- return output;
- }
-
- bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
- return lhs.m_state == rhs.m_state;
- }
-
- bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
- return lhs.m_state != rhs.m_state;
- }
-}
diff --git a/include/internal/catch_random_number_generator.h b/include/internal/catch_random_number_generator.h
deleted file mode 100644
index 79d62794..00000000
--- a/include/internal/catch_random_number_generator.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Created by Martin on 30/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_RANDOM_NUMBER_GENERATOR_H_INCLUDED
-#define TWOBLUECUBES_CATCH_RANDOM_NUMBER_GENERATOR_H_INCLUDED
-
-#include <cstdint>
-
-namespace Catch {
-
- // This is a simple implementation of C++11 Uniform Random Number
- // Generator. It does not provide all operators, because Catch2
- // does not use it, but it should behave as expected inside stdlib's
- // distributions.
- // The implementation is based on the PCG family (http://pcg-random.org)
- class SimplePcg32 {
- using state_type = std::uint64_t;
- public:
- using result_type = std::uint32_t;
- static constexpr result_type (min)() {
- return 0;
- }
- static constexpr result_type (max)() {
- return static_cast<result_type>(-1);
- }
-
- // Provide some default initial state for the default constructor
- SimplePcg32():SimplePcg32(0xed743cc4U) {}
-
- explicit SimplePcg32(result_type seed_);
-
- void seed(result_type seed_);
- void discard(uint64_t skip);
-
- result_type operator()();
-
- private:
- friend bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
- friend bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
-
- // In theory we also need operator<< and operator>>
- // In practice we do not use them, so we will skip them for now
-
-
- std::uint64_t m_state;
- // This part of the state determines which "stream" of the numbers
- // is chosen -- we take it as a constant for Catch2, so we only
- // need to deal with seeding the main state.
- // Picked by reading 8 bytes from `/dev/random` :-)
- static const std::uint64_t s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_RANDOM_NUMBER_GENERATOR_H_INCLUDED
diff --git a/include/internal/catch_reenable_warnings.h b/include/internal/catch_reenable_warnings.h
deleted file mode 100644
index 33574e05..00000000
--- a/include/internal/catch_reenable_warnings.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2014 Two Blue Cubes Ltd
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
-#define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(pop)
-# else
-# pragma clang diagnostic pop
-# endif
-#elif defined __GNUC__
-# pragma GCC diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
diff --git a/include/internal/catch_registry_hub.cpp b/include/internal/catch_registry_hub.cpp
deleted file mode 100644
index 8a3c7a97..00000000
--- a/include/internal/catch_registry_hub.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Created by Phil on 5/8/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_interfaces_registry_hub.h"
-
-#include "catch_context.h"
-#include "catch_test_case_registry_impl.h"
-#include "catch_reporter_registry.h"
-#include "catch_exception_translator_registry.h"
-#include "catch_tag_alias_registry.h"
-#include "catch_startup_exception_registry.h"
-#include "catch_singletons.hpp"
-#include "catch_enum_values_registry.h"
-
-namespace Catch {
-
- namespace {
-
- class RegistryHub : public IRegistryHub, public IMutableRegistryHub,
- private NonCopyable {
-
- public: // IRegistryHub
- RegistryHub() = default;
- IReporterRegistry const& getReporterRegistry() const override {
- return m_reporterRegistry;
- }
- ITestCaseRegistry const& getTestCaseRegistry() const override {
- return m_testCaseRegistry;
- }
- IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const override {
- return m_exceptionTranslatorRegistry;
- }
- ITagAliasRegistry const& getTagAliasRegistry() const override {
- return m_tagAliasRegistry;
- }
- StartupExceptionRegistry const& getStartupExceptionRegistry() const override {
- return m_exceptionRegistry;
- }
-
- public: // IMutableRegistryHub
- void registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) override {
- m_reporterRegistry.registerReporter( name, factory );
- }
- void registerListener( IReporterFactoryPtr const& factory ) override {
- m_reporterRegistry.registerListener( factory );
- }
- void registerTest( TestCase const& testInfo ) override {
- m_testCaseRegistry.registerTest( testInfo );
- }
- void registerTranslator( const IExceptionTranslator* translator ) override {
- m_exceptionTranslatorRegistry.registerTranslator( translator );
- }
- void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
- m_tagAliasRegistry.add( alias, tag, lineInfo );
- }
- void registerStartupException() noexcept override {
- m_exceptionRegistry.add(std::current_exception());
- }
- IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
- return m_enumValuesRegistry;
- }
-
- private:
- TestRegistry m_testCaseRegistry;
- ReporterRegistry m_reporterRegistry;
- ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
- TagAliasRegistry m_tagAliasRegistry;
- StartupExceptionRegistry m_exceptionRegistry;
- Detail::EnumValuesRegistry m_enumValuesRegistry;
- };
- }
-
- using RegistryHubSingleton = Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>;
-
- IRegistryHub const& getRegistryHub() {
- return RegistryHubSingleton::get();
- }
- IMutableRegistryHub& getMutableRegistryHub() {
- return RegistryHubSingleton::getMutable();
- }
- void cleanUp() {
- cleanupSingletons();
- cleanUpContext();
- }
- std::string translateActiveException() {
- return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
- }
-
-
-} // end namespace Catch
diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp
deleted file mode 100644
index a1950536..00000000
--- a/include/internal/catch_reporter_registrars.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
-
-/*
- * Created by Phil on 31/12/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
-
-#include "catch_interfaces_registry_hub.h"
-
-namespace Catch {
-
- template<typename T>
- class ReporterRegistrar {
-
- class ReporterFactory : public IReporterFactory {
-
- IStreamingReporterPtr create( ReporterConfig const& config ) const override {
- return std::unique_ptr<T>( new T( config ) );
- }
-
- std::string getDescription() const override {
- return T::getDescription();
- }
- };
-
- public:
-
- explicit ReporterRegistrar( std::string const& name ) {
- getMutableRegistryHub().registerReporter( name, std::make_shared<ReporterFactory>() );
- }
- };
-
- template<typename T>
- class ListenerRegistrar {
-
- class ListenerFactory : public IReporterFactory {
-
- IStreamingReporterPtr create( ReporterConfig const& config ) const override {
- return std::unique_ptr<T>( new T( config ) );
- }
- std::string getDescription() const override {
- return std::string();
- }
- };
-
- public:
-
- ListenerRegistrar() {
- getMutableRegistryHub().registerListener( std::make_shared<ListenerFactory>() );
- }
- };
-}
-
-#if !defined(CATCH_CONFIG_DISABLE)
-
-#define CATCH_REGISTER_REPORTER( name, reporterType ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#define CATCH_REGISTER_LISTENER( listenerType ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ListenerRegistrar<listenerType> catch_internal_RegistrarFor##listenerType; } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-#else // CATCH_CONFIG_DISABLE
-
-#define CATCH_REGISTER_REPORTER(name, reporterType)
-#define CATCH_REGISTER_LISTENER(listenerType)
-
-#endif // CATCH_CONFIG_DISABLE
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
diff --git a/include/internal/catch_reporter_registry.cpp b/include/internal/catch_reporter_registry.cpp
deleted file mode 100644
index f017e059..00000000
--- a/include/internal/catch_reporter_registry.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Created by Martin on 31/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#include "catch_reporter_registry.h"
-
-namespace Catch {
-
- ReporterRegistry::~ReporterRegistry() = default;
-
- IStreamingReporterPtr ReporterRegistry::create( std::string const& name, IConfigPtr const& config ) const {
- auto it = m_factories.find( name );
- if( it == m_factories.end() )
- return nullptr;
- return it->second->create( ReporterConfig( config ) );
- }
-
- void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) {
- m_factories.emplace(name, factory);
- }
- void ReporterRegistry::registerListener( IReporterFactoryPtr const& factory ) {
- m_listeners.push_back( factory );
- }
-
- IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const {
- return m_factories;
- }
- IReporterRegistry::Listeners const& ReporterRegistry::getListeners() const {
- return m_listeners;
- }
-
-}
diff --git a/include/internal/catch_reporter_registry.h b/include/internal/catch_reporter_registry.h
deleted file mode 100644
index 916e9247..00000000
--- a/include/internal/catch_reporter_registry.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Created by Phil on 29/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_REGISTRY_H_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_H_INCLUDED
-
-#include "catch_interfaces_reporter.h"
-
-#include <map>
-
-namespace Catch {
-
- class ReporterRegistry : public IReporterRegistry {
-
- public:
-
- ~ReporterRegistry() override;
-
- IStreamingReporterPtr create( std::string const& name, IConfigPtr const& config ) const override;
-
- void registerReporter( std::string const& name, IReporterFactoryPtr const& factory );
- void registerListener( IReporterFactoryPtr const& factory );
-
- FactoryMap const& getFactories() const override;
- Listeners const& getListeners() const override;
-
- private:
- FactoryMap m_factories;
- Listeners m_listeners;
- };
-}
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_REGISTRY_H_INCLUDED
diff --git a/include/internal/catch_result_type.cpp b/include/internal/catch_result_type.cpp
deleted file mode 100644
index 0f62f1b8..00000000
--- a/include/internal/catch_result_type.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Created by Phil on 07/01/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_result_type.h"
-
-namespace Catch {
-
- bool isOk( ResultWas::OfType resultType ) {
- return ( resultType & ResultWas::FailureBit ) == 0;
- }
- bool isJustInfo( int flags ) {
- return flags == ResultWas::Info;
- }
-
- ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
- return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
- }
-
- bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
- bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
-
-} // end namespace Catch
diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h
deleted file mode 100644
index 000b4f3d..00000000
--- a/include/internal/catch_result_type.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Created by Phil on 07/01/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED
-#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED
-
-namespace Catch {
-
- // ResultWas::OfType enum
- struct ResultWas { enum OfType {
- Unknown = -1,
- Ok = 0,
- Info = 1,
- Warning = 2,
-
- FailureBit = 0x10,
-
- ExpressionFailed = FailureBit | 1,
- ExplicitFailure = FailureBit | 2,
-
- Exception = 0x100 | FailureBit,
-
- ThrewException = Exception | 1,
- DidntThrowException = Exception | 2,
-
- FatalErrorCondition = 0x200 | FailureBit
-
- }; };
-
- bool isOk( ResultWas::OfType resultType );
- bool isJustInfo( int flags );
-
-
- // ResultDisposition::Flags enum
- struct ResultDisposition { enum Flags {
- Normal = 0x01,
-
- ContinueOnFailure = 0x02, // Failures fail test, but execution continues
- FalseTest = 0x04, // Prefix expression with !
- SuppressFail = 0x08 // Failures are reported but do not fail the test
- }; };
-
- ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs );
-
- bool shouldContinueOnFailure( int flags );
- inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
- bool shouldSuppressFailure( int flags );
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED
diff --git a/include/internal/catch_run_context.cpp b/include/internal/catch_run_context.cpp
deleted file mode 100644
index 2eb84fb9..00000000
--- a/include/internal/catch_run_context.cpp
+++ /dev/null
@@ -1,521 +0,0 @@
-#include "catch_run_context.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_context.h"
-#include "catch_enforce.h"
-#include "catch_random_number_generator.h"
-#include "catch_stream.h"
-#include "catch_output_redirect.h"
-
-#include <cassert>
-#include <algorithm>
-#include <sstream>
-
-namespace Catch {
-
- namespace Generators {
- struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker {
- GeneratorBasePtr m_generator;
-
- GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : TrackerBase( nameAndLocation, ctx, parent )
- {}
- ~GeneratorTracker();
-
- static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation ) {
- std::shared_ptr<GeneratorTracker> tracker;
-
- ITracker& currentTracker = ctx.currentTracker();
- if( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
- assert( childTracker );
- assert( childTracker->isGeneratorTracker() );
- tracker = std::static_pointer_cast<GeneratorTracker>( childTracker );
- }
- else {
- tracker = std::make_shared<GeneratorTracker>( nameAndLocation, ctx, &currentTracker );
- currentTracker.addChild( tracker );
- }
-
- if( !ctx.completedCycle() && !tracker->isComplete() ) {
- tracker->open();
- }
-
- return *tracker;
- }
-
- // TrackerBase interface
- bool isGeneratorTracker() const override { return true; }
- auto hasGenerator() const -> bool override {
- return !!m_generator;
- }
- void close() override {
- TrackerBase::close();
- // Generator interface only finds out if it has another item on atual move
- if (m_runState == CompletedSuccessfully && m_generator->next()) {
- m_children.clear();
- m_runState = Executing;
- }
- }
-
- // IGeneratorTracker interface
- auto getGenerator() const -> GeneratorBasePtr const& override {
- return m_generator;
- }
- void setGenerator( GeneratorBasePtr&& generator ) override {
- m_generator = std::move( generator );
- }
- };
- GeneratorTracker::~GeneratorTracker() {}
- }
-
- RunContext::RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter)
- : m_runInfo(_config->name()),
- m_context(getCurrentMutableContext()),
- m_config(_config),
- m_reporter(std::move(reporter)),
- m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
- m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
- {
- m_context.setRunner(this);
- m_context.setConfig(m_config);
- m_context.setResultCapture(this);
- m_reporter->testRunStarting(m_runInfo);
- }
-
- RunContext::~RunContext() {
- m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting()));
- }
-
- void RunContext::testGroupStarting(std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount) {
- m_reporter->testGroupStarting(GroupInfo(testSpec, groupIndex, groupsCount));
- }
-
- void RunContext::testGroupEnded(std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount) {
- m_reporter->testGroupEnded(TestGroupStats(GroupInfo(testSpec, groupIndex, groupsCount), totals, aborting()));
- }
-
- Totals RunContext::runTest(TestCase const& testCase) {
- Totals prevTotals = m_totals;
-
- std::string redirectedCout;
- std::string redirectedCerr;
-
- auto const& testInfo = testCase.getTestCaseInfo();
-
- m_reporter->testCaseStarting(testInfo);
-
- m_activeTestCase = &testCase;
-
-
- ITracker& rootTracker = m_trackerContext.startRun();
- assert(rootTracker.isSectionTracker());
- static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
- do {
- m_trackerContext.startCycle();
- m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo));
- runCurrentTest(redirectedCout, redirectedCerr);
- } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting());
-
- Totals deltaTotals = m_totals.delta(prevTotals);
- if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) {
- deltaTotals.assertions.failed++;
- deltaTotals.testCases.passed--;
- deltaTotals.testCases.failed++;
- }
- m_totals.testCases += deltaTotals.testCases;
- m_reporter->testCaseEnded(TestCaseStats(testInfo,
- deltaTotals,
- redirectedCout,
- redirectedCerr,
- aborting()));
-
- m_activeTestCase = nullptr;
- m_testCaseTracker = nullptr;
-
- return deltaTotals;
- }
-
- IConfigPtr RunContext::config() const {
- return m_config;
- }
-
- IStreamingReporter& RunContext::reporter() const {
- return *m_reporter;
- }
-
- void RunContext::assertionEnded(AssertionResult const & result) {
- if (result.getResultType() == ResultWas::Ok) {
- m_totals.assertions.passed++;
- m_lastAssertionPassed = true;
- } else if (!result.isOk()) {
- m_lastAssertionPassed = false;
- if( m_activeTestCase->getTestCaseInfo().okToFail() )
- m_totals.assertions.failedButOk++;
- else
- m_totals.assertions.failed++;
- }
- else {
- m_lastAssertionPassed = true;
- }
-
- // We have no use for the return value (whether messages should be cleared), because messages were made scoped
- // and should be let to clear themselves out.
- static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)));
-
- if (result.getResultType() != ResultWas::Warning)
- m_messageScopes.clear();
-
- // Reset working state
- resetAssertionInfo();
- m_lastResult = result;
- }
- void RunContext::resetAssertionInfo() {
- m_lastAssertionInfo.macroName = StringRef();
- m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr;
- }
-
- bool RunContext::sectionStarted(SectionInfo const & sectionInfo, Counts & assertions) {
- ITracker& sectionTracker = SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(sectionInfo.name, sectionInfo.lineInfo));
- if (!sectionTracker.isOpen())
- return false;
- m_activeSections.push_back(&sectionTracker);
-
- m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo;
-
- m_reporter->sectionStarting(sectionInfo);
-
- assertions = m_totals.assertions;
-
- return true;
- }
- auto RunContext::acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
- using namespace Generators;
- GeneratorTracker& tracker = GeneratorTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( "generator", lineInfo ) );
- assert( tracker.isOpen() );
- m_lastAssertionInfo.lineInfo = lineInfo;
- return tracker;
- }
-
- bool RunContext::testForMissingAssertions(Counts& assertions) {
- if (assertions.total() != 0)
- return false;
- if (!m_config->warnAboutMissingAssertions())
- return false;
- if (m_trackerContext.currentTracker().hasChildren())
- return false;
- m_totals.assertions.failed++;
- assertions.failed++;
- return true;
- }
-
- void RunContext::sectionEnded(SectionEndInfo const & endInfo) {
- Counts assertions = m_totals.assertions - endInfo.prevAssertions;
- bool missingAssertions = testForMissingAssertions(assertions);
-
- if (!m_activeSections.empty()) {
- m_activeSections.back()->close();
- m_activeSections.pop_back();
- }
-
- m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions));
- m_messages.clear();
- m_messageScopes.clear();
- }
-
- void RunContext::sectionEndedEarly(SectionEndInfo const & endInfo) {
- if (m_unfinishedSections.empty())
- m_activeSections.back()->fail();
- else
- m_activeSections.back()->close();
- m_activeSections.pop_back();
-
- m_unfinishedSections.push_back(endInfo);
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void RunContext::benchmarkPreparing(std::string const& name) {
- m_reporter->benchmarkPreparing(name);
- }
- void RunContext::benchmarkStarting( BenchmarkInfo const& info ) {
- m_reporter->benchmarkStarting( info );
- }
- void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) {
- m_reporter->benchmarkEnded( stats );
- }
- void RunContext::benchmarkFailed(std::string const & error) {
- m_reporter->benchmarkFailed(error);
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void RunContext::pushScopedMessage(MessageInfo const & message) {
- m_messages.push_back(message);
- }
-
- void RunContext::popScopedMessage(MessageInfo const & message) {
- m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end());
- }
-
- void RunContext::emplaceUnscopedMessage( MessageBuilder const& builder ) {
- m_messageScopes.emplace_back( builder );
- }
-
- std::string RunContext::getCurrentTestName() const {
- return m_activeTestCase
- ? m_activeTestCase->getTestCaseInfo().name
- : std::string();
- }
-
- const AssertionResult * RunContext::getLastResult() const {
- return &(*m_lastResult);
- }
-
- void RunContext::exceptionEarlyReported() {
- m_shouldReportUnexpected = false;
- }
-
- void RunContext::handleFatalErrorCondition( StringRef message ) {
- // First notify reporter that bad things happened
- m_reporter->fatalErrorEncountered(message);
-
- // Don't rebuild the result -- the stringification itself can cause more fatal errors
- // Instead, fake a result data.
- AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
- tempResult.message = static_cast<std::string>(message);
- AssertionResult result(m_lastAssertionInfo, tempResult);
-
- assertionEnded(result);
-
- handleUnfinishedSections();
-
- // Recreate section for test case (as we will lose the one that was in scope)
- auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
-
- Counts assertions;
- assertions.failed = 1;
- SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
- m_reporter->sectionEnded(testCaseSectionStats);
-
- auto const& testInfo = m_activeTestCase->getTestCaseInfo();
-
- Totals deltaTotals;
- deltaTotals.testCases.failed = 1;
- deltaTotals.assertions.failed = 1;
- m_reporter->testCaseEnded(TestCaseStats(testInfo,
- deltaTotals,
- std::string(),
- std::string(),
- false));
- m_totals.testCases.failed++;
- testGroupEnded(std::string(), m_totals, 1, 1);
- m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
- }
-
- bool RunContext::lastAssertionPassed() {
- return m_lastAssertionPassed;
- }
-
- void RunContext::assertionPassed() {
- m_lastAssertionPassed = true;
- ++m_totals.assertions.passed;
- resetAssertionInfo();
- m_messageScopes.clear();
- }
-
- bool RunContext::aborting() const {
- return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter());
- }
-
- void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) {
- auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
- m_reporter->sectionStarting(testCaseSection);
- Counts prevAssertions = m_totals.assertions;
- double duration = 0;
- m_shouldReportUnexpected = true;
- m_lastAssertionInfo = { "TEST_CASE"_sr, testCaseInfo.lineInfo, StringRef(), ResultDisposition::Normal };
-
- seedRng(*m_config);
-
- Timer timer;
- CATCH_TRY {
- if (m_reporter->getPreferences().shouldRedirectStdOut) {
-#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
- RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr);
-
- timer.start();
- invokeActiveTestCase();
-#else
- OutputRedirect r(redirectedCout, redirectedCerr);
- timer.start();
- invokeActiveTestCase();
-#endif
- } else {
- timer.start();
- invokeActiveTestCase();
- }
- duration = timer.getElapsedSeconds();
- } CATCH_CATCH_ANON (TestFailureException&) {
- // This just means the test was aborted due to failure
- } CATCH_CATCH_ALL {
- // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions
- // are reported without translation at the point of origin.
- if( m_shouldReportUnexpected ) {
- AssertionReaction dummyReaction;
- handleUnexpectedInflightException( m_lastAssertionInfo, translateActiveException(), dummyReaction );
- }
- }
- Counts assertions = m_totals.assertions - prevAssertions;
- bool missingAssertions = testForMissingAssertions(assertions);
-
- m_testCaseTracker->close();
- handleUnfinishedSections();
- m_messages.clear();
- m_messageScopes.clear();
-
- SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions);
- m_reporter->sectionEnded(testCaseSectionStats);
- }
-
- void RunContext::invokeActiveTestCase() {
- FatalConditionHandler fatalConditionHandler; // Handle signals
- m_activeTestCase->invoke();
- fatalConditionHandler.reset();
- }
-
- void RunContext::handleUnfinishedSections() {
- // If sections ended prematurely due to an exception we stored their
- // infos here so we can tear them down outside the unwind process.
- for (auto it = m_unfinishedSections.rbegin(),
- itEnd = m_unfinishedSections.rend();
- it != itEnd;
- ++it)
- sectionEnded(*it);
- m_unfinishedSections.clear();
- }
-
- void RunContext::handleExpr(
- AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction
- ) {
- m_reporter->assertionStarting( info );
-
- bool negated = isFalseTest( info.resultDisposition );
- bool result = expr.getResult() != negated;
-
- if( result ) {
- if (!m_includeSuccessfulResults) {
- assertionPassed();
- }
- else {
- reportExpr(info, ResultWas::Ok, &expr, negated);
- }
- }
- else {
- reportExpr(info, ResultWas::ExpressionFailed, &expr, negated );
- populateReaction( reaction );
- }
- }
- void RunContext::reportExpr(
- AssertionInfo const &info,
- ResultWas::OfType resultType,
- ITransientExpression const *expr,
- bool negated ) {
-
- m_lastAssertionInfo = info;
- AssertionResultData data( resultType, LazyExpression( negated ) );
-
- AssertionResult assertionResult{ info, data };
- assertionResult.m_resultData.lazyExpression.m_transientExpression = expr;
-
- assertionEnded( assertionResult );
- }
-
- void RunContext::handleMessage(
- AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction
- ) {
- m_reporter->assertionStarting( info );
-
- m_lastAssertionInfo = info;
-
- AssertionResultData data( resultType, LazyExpression( false ) );
- data.message = static_cast<std::string>(message);
- AssertionResult assertionResult{ m_lastAssertionInfo, data };
- assertionEnded( assertionResult );
- if( !assertionResult.isOk() )
- populateReaction( reaction );
- }
- void RunContext::handleUnexpectedExceptionNotThrown(
- AssertionInfo const& info,
- AssertionReaction& reaction
- ) {
- handleNonExpr(info, Catch::ResultWas::DidntThrowException, reaction);
- }
-
- void RunContext::handleUnexpectedInflightException(
- AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
- data.message = message;
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
- populateReaction( reaction );
- }
-
- void RunContext::populateReaction( AssertionReaction& reaction ) {
- reaction.shouldDebugBreak = m_config->shouldDebugBreak();
- reaction.shouldThrow = aborting() || (m_lastAssertionInfo.resultDisposition & ResultDisposition::Normal);
- }
-
- void RunContext::handleIncomplete(
- AssertionInfo const& info
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
- data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE";
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
- }
- void RunContext::handleNonExpr(
- AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( resultType, LazyExpression( false ) );
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
-
- if( !assertionResult.isOk() )
- populateReaction( reaction );
- }
-
-
- IResultCapture& getResultCapture() {
- if (auto* capture = getCurrentContext().getResultCapture())
- return *capture;
- else
- CATCH_INTERNAL_ERROR("No result capture instance");
- }
-
- void seedRng(IConfig const& config) {
- if (config.rngSeed() != 0) {
- std::srand(config.rngSeed());
- rng().seed(config.rngSeed());
- }
- }
-
- unsigned int rngSeed() {
- return getCurrentContext().getConfig()->rngSeed();
- }
-
-}
diff --git a/include/internal/catch_run_context.h b/include/internal/catch_run_context.h
deleted file mode 100644
index 2a8e72dc..00000000
--- a/include/internal/catch_run_context.h
+++ /dev/null
@@ -1,158 +0,0 @@
- /*
- * Created by Phil on 22/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
-
-#include "catch_interfaces_generatortracker.h"
-#include "catch_interfaces_runner.h"
-#include "catch_interfaces_reporter.h"
-#include "catch_interfaces_exception.h"
-#include "catch_config.hpp"
-#include "catch_test_registry.h"
-#include "catch_test_case_info.h"
-#include "catch_capture.hpp"
-#include "catch_totals.h"
-#include "catch_test_spec.h"
-#include "catch_test_case_tracker.h"
-#include "catch_timer.h"
-#include "catch_assertionhandler.h"
-#include "catch_fatal_condition.h"
-
-#include <string>
-
-namespace Catch {
-
- struct IMutableContext;
-
- ///////////////////////////////////////////////////////////////////////////
-
- class RunContext : public IResultCapture, public IRunner {
-
- public:
- RunContext( RunContext const& ) = delete;
- RunContext& operator =( RunContext const& ) = delete;
-
- explicit RunContext( IConfigPtr const& _config, IStreamingReporterPtr&& reporter );
-
- ~RunContext() override;
-
- void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount );
- void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount );
-
- Totals runTest(TestCase const& testCase);
-
- IConfigPtr config() const;
- IStreamingReporter& reporter() const;
-
- public: // IResultCapture
-
- // Assertion handlers
- void handleExpr
- ( AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction ) override;
- void handleMessage
- ( AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction ) override;
- void handleUnexpectedExceptionNotThrown
- ( AssertionInfo const& info,
- AssertionReaction& reaction ) override;
- void handleUnexpectedInflightException
- ( AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction ) override;
- void handleIncomplete
- ( AssertionInfo const& info ) override;
- void handleNonExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction ) override;
-
- bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) override;
-
- void sectionEnded( SectionEndInfo const& endInfo ) override;
- void sectionEndedEarly( SectionEndInfo const& endInfo ) override;
-
- auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing( std::string const& name ) override;
- void benchmarkStarting( BenchmarkInfo const& info ) override;
- void benchmarkEnded( BenchmarkStats<> const& stats ) override;
- void benchmarkFailed( std::string const& error ) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void pushScopedMessage( MessageInfo const& message ) override;
- void popScopedMessage( MessageInfo const& message ) override;
-
- void emplaceUnscopedMessage( MessageBuilder const& builder ) override;
-
- std::string getCurrentTestName() const override;
-
- const AssertionResult* getLastResult() const override;
-
- void exceptionEarlyReported() override;
-
- void handleFatalErrorCondition( StringRef message ) override;
-
- bool lastAssertionPassed() override;
-
- void assertionPassed() override;
-
- public:
- // !TBD We need to do this another way!
- bool aborting() const final;
-
- private:
-
- void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr );
- void invokeActiveTestCase();
-
- void resetAssertionInfo();
- bool testForMissingAssertions( Counts& assertions );
-
- void assertionEnded( AssertionResult const& result );
- void reportExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- ITransientExpression const *expr,
- bool negated );
-
- void populateReaction( AssertionReaction& reaction );
-
- private:
-
- void handleUnfinishedSections();
-
- TestRunInfo m_runInfo;
- IMutableContext& m_context;
- TestCase const* m_activeTestCase = nullptr;
- ITracker* m_testCaseTracker = nullptr;
- Option<AssertionResult> m_lastResult;
-
- IConfigPtr m_config;
- Totals m_totals;
- IStreamingReporterPtr m_reporter;
- std::vector<MessageInfo> m_messages;
- std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */
- AssertionInfo m_lastAssertionInfo;
- std::vector<SectionEndInfo> m_unfinishedSections;
- std::vector<ITracker*> m_activeSections;
- TrackerContext m_trackerContext;
- bool m_lastAssertionPassed = false;
- bool m_shouldReportUnexpected = true;
- bool m_includeSuccessfulResults;
- };
-
- void seedRng(IConfig const& config);
- unsigned int rngSeed();
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
diff --git a/include/internal/catch_section.cpp b/include/internal/catch_section.cpp
deleted file mode 100644
index 0646d36f..00000000
--- a/include/internal/catch_section.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Created by Phil on 03/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_section.h"
-#include "catch_capture.hpp"
-#include "catch_uncaught_exceptions.h"
-
-namespace Catch {
-
- Section::Section( SectionInfo const& info )
- : m_info( info ),
- m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
- {
- m_timer.start();
- }
-
- Section::~Section() {
- if( m_sectionIncluded ) {
- SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() };
- if( uncaught_exceptions() )
- getResultCapture().sectionEndedEarly( endInfo );
- else
- getResultCapture().sectionEnded( endInfo );
- }
- }
-
- // This indicates whether the section should be executed or not
- Section::operator bool() const {
- return m_sectionIncluded;
- }
-
-
-} // end namespace Catch
diff --git a/include/internal/catch_section.h b/include/internal/catch_section.h
deleted file mode 100644
index cc2b323d..00000000
--- a/include/internal/catch_section.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Created by Phil on 03/12/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
-#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
-
-#include "catch_compiler_capabilities.h"
-#include "catch_section_info.h"
-#include "catch_totals.h"
-#include "catch_timer.h"
-
-#include <string>
-
-namespace Catch {
-
- class Section : NonCopyable {
- public:
- Section( SectionInfo const& info );
- ~Section();
-
- // This indicates whether the section should be executed or not
- explicit operator bool() const;
-
- private:
- SectionInfo m_info;
-
- std::string m_name;
- Counts m_assertions;
- bool m_sectionIncluded;
- Timer m_timer;
- };
-
-} // end namespace Catch
-
-#define INTERNAL_CATCH_SECTION( ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, (Catch::ReusableStringStream() << __VA_ARGS__).str() ) ) \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#endif // TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
diff --git a/include/internal/catch_section_info.cpp b/include/internal/catch_section_info.cpp
deleted file mode 100644
index 89714e35..00000000
--- a/include/internal/catch_section_info.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Created by Martin on 01/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_section_info.h"
-
-namespace Catch {
-
- SectionInfo::SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name )
- : name( _name ),
- lineInfo( _lineInfo )
- {}
-
-} // end namespace Catch
diff --git a/include/internal/catch_section_info.h b/include/internal/catch_section_info.h
deleted file mode 100644
index 9cf792e8..00000000
--- a/include/internal/catch_section_info.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Created by Phil on 03/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED
-#define TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED
-
-#include "catch_common.h"
-#include "catch_totals.h"
-
-#include <string>
-
-namespace Catch {
-
- struct SectionInfo {
- SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name );
-
- // Deprecated
- SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name,
- std::string const& ) : SectionInfo( _lineInfo, _name ) {}
-
- std::string name;
- std::string description; // !Deprecated: this will always be empty
- SourceLineInfo lineInfo;
- };
-
- struct SectionEndInfo {
- SectionInfo sectionInfo;
- Counts prevAssertions;
- double durationInSeconds;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED
diff --git a/include/internal/catch_session.cpp b/include/internal/catch_session.cpp
deleted file mode 100644
index 24ebe4de..00000000
--- a/include/internal/catch_session.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Created by Martin on 31/08/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_session.h"
-#include "catch_commandline.h"
-#include "catch_console_colour.h"
-#include "catch_enforce.h"
-#include "catch_list.h"
-#include "catch_context.h"
-#include "catch_run_context.h"
-#include "catch_stream.h"
-#include "catch_test_spec.h"
-#include "catch_version.h"
-#include "catch_interfaces_reporter.h"
-#include "catch_random_number_generator.h"
-#include "catch_startup_exception_registry.h"
-#include "catch_text.h"
-#include "catch_stream.h"
-#include "catch_windows_h_proxy.h"
-#include "../reporters/catch_reporter_listening.h"
-
-#include <cstdlib>
-#include <iomanip>
-#include <set>
-#include <iterator>
-
-namespace Catch {
-
- namespace {
- const int MaxExitCode = 255;
-
- IStreamingReporterPtr createReporter(std::string const& reporterName, IConfigPtr const& config) {
- auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config);
- CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'");
-
- return reporter;
- }
-
- IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
- if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
- return createReporter(config->getReporterName(), config);
- }
-
- // On older platforms, returning std::unique_ptr<ListeningReporter>
- // when the return type is std::unique_ptr<IStreamingReporter>
- // doesn't compile without a std::move call. However, this causes
- // a warning on newer platforms. Thus, we have to work around
- // it a bit and downcast the pointer manually.
- auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter);
- auto& multi = static_cast<ListeningReporter&>(*ret);
- auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
- for (auto const& listener : listeners) {
- multi.addListener(listener->create(Catch::ReporterConfig(config)));
- }
- multi.addReporter(createReporter(config->getReporterName(), config));
- return ret;
- }
-
- class TestGroup {
- public:
- explicit TestGroup(std::shared_ptr<Config> const& config)
- : m_config{config}
- , m_context{config, makeReporter(config)}
- {
- auto const& allTestCases = getAllTestCasesSorted(*m_config);
- m_matches = m_config->testSpec().matchesByFilter(allTestCases, *m_config);
- auto const& invalidArgs = m_config->testSpec().getInvalidArgs();
-
- if (m_matches.empty() && invalidArgs.empty()) {
- for (auto const& test : allTestCases)
- if (!test.isHidden())
- m_tests.emplace(&test);
- } else {
- for (auto const& match : m_matches)
- m_tests.insert(match.tests.begin(), match.tests.end());
- }
- }
-
- Totals execute() {
- auto const& invalidArgs = m_config->testSpec().getInvalidArgs();
- Totals totals;
- m_context.testGroupStarting(m_config->name(), 1, 1);
- for (auto const& testCase : m_tests) {
- if (!m_context.aborting())
- totals += m_context.runTest(*testCase);
- else
- m_context.reporter().skipTest(*testCase);
- }
-
- for (auto const& match : m_matches) {
- if (match.tests.empty()) {
- m_context.reporter().noMatchingTestCases(match.name);
- totals.error = -1;
- }
- }
-
- if (!invalidArgs.empty()) {
- for (auto const& invalidArg: invalidArgs)
- m_context.reporter().reportInvalidArguments(invalidArg);
- }
-
- m_context.testGroupEnded(m_config->name(), totals, 1, 1);
- return totals;
- }
-
- private:
- using Tests = std::set<TestCase const*>;
-
- std::shared_ptr<Config> m_config;
- RunContext m_context;
- Tests m_tests;
- TestSpec::Matches m_matches;
- };
-
- void applyFilenamesAsTags(Catch::IConfig const& config) {
- auto& tests = const_cast<std::vector<TestCase>&>(getAllTestCasesSorted(config));
- for (auto& testCase : tests) {
- auto tags = testCase.tags;
-
- std::string filename = testCase.lineInfo.file;
- auto lastSlash = filename.find_last_of("\\/");
- if (lastSlash != std::string::npos) {
- filename.erase(0, lastSlash);
- filename[0] = '#';
- }
-
- auto lastDot = filename.find_last_of('.');
- if (lastDot != std::string::npos) {
- filename.erase(lastDot);
- }
-
- tags.push_back(std::move(filename));
- setTags(testCase, tags);
- }
- }
-
- } // anon namespace
-
- Session::Session() {
- static bool alreadyInstantiated = false;
- if( alreadyInstantiated ) {
- CATCH_TRY { CATCH_INTERNAL_ERROR( "Only one instance of Catch::Session can ever be used" ); }
- CATCH_CATCH_ALL { getMutableRegistryHub().registerStartupException(); }
- }
-
- // There cannot be exceptions at startup in no-exception mode.
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions();
- if ( !exceptions.empty() ) {
- config();
- getCurrentMutableContext().setConfig(m_config);
-
- m_startupExceptions = true;
- Colour colourGuard( Colour::Red );
- Catch::cerr() << "Errors occurred during startup!" << '\n';
- // iterate over all exceptions and notify user
- for ( const auto& ex_ptr : exceptions ) {
- try {
- std::rethrow_exception(ex_ptr);
- } catch ( std::exception const& ex ) {
- Catch::cerr() << Column( ex.what() ).indent(2) << '\n';
- }
- }
- }
-#endif
-
- alreadyInstantiated = true;
- m_cli = makeCommandLineParser( m_configData );
- }
- Session::~Session() {
- Catch::cleanUp();
- }
-
- void Session::showHelp() const {
- Catch::cout()
- << "\nCatch v" << libraryVersion() << "\n"
- << m_cli << std::endl
- << "For more detailed usage please see the project docs\n" << std::endl;
- }
- void Session::libIdentify() {
- Catch::cout()
- << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n"
- << std::left << std::setw(16) << "category: " << "testframework\n"
- << std::left << std::setw(16) << "framework: " << "Catch Test\n"
- << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl;
- }
-
- int Session::applyCommandLine( int argc, char const * const * argv ) {
- if( m_startupExceptions )
- return 1;
-
- auto result = m_cli.parse( clara::Args( argc, argv ) );
- if( !result ) {
- config();
- getCurrentMutableContext().setConfig(m_config);
- Catch::cerr()
- << Colour( Colour::Red )
- << "\nError(s) in input:\n"
- << Column( result.errorMessage() ).indent( 2 )
- << "\n\n";
- Catch::cerr() << "Run with -? for usage\n" << std::endl;
- return MaxExitCode;
- }
-
- if( m_configData.showHelp )
- showHelp();
- if( m_configData.libIdentify )
- libIdentify();
- m_config.reset();
- return 0;
- }
-
-#if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
- int Session::applyCommandLine( int argc, wchar_t const * const * argv ) {
-
- char **utf8Argv = new char *[ argc ];
-
- for ( int i = 0; i < argc; ++i ) {
- int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, nullptr, 0, nullptr, nullptr );
-
- utf8Argv[ i ] = new char[ bufSize ];
-
- WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, nullptr, nullptr );
- }
-
- int returnCode = applyCommandLine( argc, utf8Argv );
-
- for ( int i = 0; i < argc; ++i )
- delete [] utf8Argv[ i ];
-
- delete [] utf8Argv;
-
- return returnCode;
- }
-#endif
-
- void Session::useConfigData( ConfigData const& configData ) {
- m_configData = configData;
- m_config.reset();
- }
-
- int Session::run() {
- if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) {
- Catch::cout() << "...waiting for enter/ return before starting" << std::endl;
- static_cast<void>(std::getchar());
- }
- int exitCode = runInternal();
- if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) {
- Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl;
- static_cast<void>(std::getchar());
- }
- return exitCode;
- }
-
- clara::Parser const& Session::cli() const {
- return m_cli;
- }
- void Session::cli( clara::Parser const& newParser ) {
- m_cli = newParser;
- }
- ConfigData& Session::configData() {
- return m_configData;
- }
- Config& Session::config() {
- if( !m_config )
- m_config = std::make_shared<Config>( m_configData );
- return *m_config;
- }
-
- int Session::runInternal() {
- if( m_startupExceptions )
- return 1;
-
- if (m_configData.showHelp || m_configData.libIdentify) {
- return 0;
- }
-
- CATCH_TRY {
- config(); // Force config to be constructed
-
- seedRng( *m_config );
-
- if( m_configData.filenamesAsTags )
- applyFilenamesAsTags( *m_config );
-
- // Handle list request
- if( Option<std::size_t> listed = list( m_config ) )
- return static_cast<int>( *listed );
-
- TestGroup tests { m_config };
- auto const totals = tests.execute();
-
- if( m_config->warnAboutNoTests() && totals.error == -1 )
- return 2;
-
- // Note that on unices only the lower 8 bits are usually used, clamping
- // the return value to 255 prevents false negative when some multiple
- // of 256 tests has failed
- return (std::min) (MaxExitCode, (std::max) (totals.error, static_cast<int>(totals.assertions.failed)));
- }
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- catch( std::exception& ex ) {
- Catch::cerr() << ex.what() << std::endl;
- return MaxExitCode;
- }
-#endif
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_session.h b/include/internal/catch_session.h
deleted file mode 100644
index 4e83d520..00000000
--- a/include/internal/catch_session.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Created by Phil on 31/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
-
-#include "catch_commandline.h"
-#include "catch_config.hpp"
-#include "catch_text.h"
-
-#include <memory>
-
-namespace Catch {
-
- class Session : NonCopyable {
- public:
-
- Session();
- ~Session() override;
-
- void showHelp() const;
- void libIdentify();
-
- int applyCommandLine( int argc, char const * const * argv );
- #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
- int applyCommandLine( int argc, wchar_t const * const * argv );
- #endif
-
- void useConfigData( ConfigData const& configData );
-
- template<typename CharT>
- int run(int argc, CharT const * const argv[]) {
- if (m_startupExceptions)
- return 1;
- int returnCode = applyCommandLine(argc, argv);
- if (returnCode == 0)
- returnCode = run();
- return returnCode;
- }
-
- int run();
-
- clara::Parser const& cli() const;
- void cli( clara::Parser const& newParser );
- ConfigData& configData();
- Config& config();
- private:
- int runInternal();
-
- clara::Parser m_cli;
- ConfigData m_configData;
- std::shared_ptr<Config> m_config;
- bool m_startupExceptions = false;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
diff --git a/include/internal/catch_singletons.cpp b/include/internal/catch_singletons.cpp
deleted file mode 100644
index e5367cad..00000000
--- a/include/internal/catch_singletons.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Created by Phil Nash on 15/6/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_singletons.hpp"
-
-#include <vector>
-
-namespace Catch {
-
- namespace {
- static auto getSingletons() -> std::vector<ISingleton*>*& {
- static std::vector<ISingleton*>* g_singletons = nullptr;
- if( !g_singletons )
- g_singletons = new std::vector<ISingleton*>();
- return g_singletons;
- }
- }
-
- ISingleton::~ISingleton() {}
-
- void addSingleton(ISingleton* singleton ) {
- getSingletons()->push_back( singleton );
- }
- void cleanupSingletons() {
- auto& singletons = getSingletons();
- for( auto singleton : *singletons )
- delete singleton;
- delete singletons;
- singletons = nullptr;
- }
-
-} // namespace Catch
diff --git a/include/internal/catch_singletons.hpp b/include/internal/catch_singletons.hpp
deleted file mode 100644
index fbc4b32c..00000000
--- a/include/internal/catch_singletons.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Created by Phil Nash on 15/6/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_SINGLETONS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_SINGLETONS_HPP_INCLUDED
-
-namespace Catch {
-
- struct ISingleton {
- virtual ~ISingleton();
- };
-
-
- void addSingleton( ISingleton* singleton );
- void cleanupSingletons();
-
-
- template<typename SingletonImplT, typename InterfaceT = SingletonImplT, typename MutableInterfaceT = InterfaceT>
- class Singleton : SingletonImplT, public ISingleton {
-
- static auto getInternal() -> Singleton* {
- static Singleton* s_instance = nullptr;
- if( !s_instance ) {
- s_instance = new Singleton;
- addSingleton( s_instance );
- }
- return s_instance;
- }
-
- public:
- static auto get() -> InterfaceT const& {
- return *getInternal();
- }
- static auto getMutable() -> MutableInterfaceT& {
- return *getInternal();
- }
- };
-
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_SINGLETONS_HPP_INCLUDED
diff --git a/include/internal/catch_startup_exception_registry.cpp b/include/internal/catch_startup_exception_registry.cpp
deleted file mode 100644
index 3c5bd22f..00000000
--- a/include/internal/catch_startup_exception_registry.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Created by Martin on 04/06/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_startup_exception_registry.h"
-#include "catch_compiler_capabilities.h"
-
-namespace Catch {
-void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
- CATCH_TRY {
- m_exceptions.push_back(exception);
- } CATCH_CATCH_ALL {
- // If we run out of memory during start-up there's really not a lot more we can do about it
- std::terminate();
- }
- }
-
- std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept {
- return m_exceptions;
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_startup_exception_registry.h b/include/internal/catch_startup_exception_registry.h
deleted file mode 100644
index feb56601..00000000
--- a/include/internal/catch_startup_exception_registry.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Created by Martin on 04/06/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_STARTUP_EXCEPTION_REGISTRY_H_INCLUDED
-#define TWOBLUECUBES_CATCH_STARTUP_EXCEPTION_REGISTRY_H_INCLUDED
-
-
-#include <vector>
-#include <exception>
-
-namespace Catch {
-
- class StartupExceptionRegistry {
- public:
- void add(std::exception_ptr const& exception) noexcept;
- std::vector<std::exception_ptr> const& getExceptions() const noexcept;
- private:
- std::vector<std::exception_ptr> m_exceptions;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_STARTUP_EXCEPTION_REGISTRY_H_INCLUDED
diff --git a/include/internal/catch_stream.cpp b/include/internal/catch_stream.cpp
deleted file mode 100644
index 3e907c63..00000000
--- a/include/internal/catch_stream.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Created by Phil on 17/01/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-
-#include "catch_common.h"
-#include "catch_enforce.h"
-#include "catch_stream.h"
-#include "catch_debug_console.h"
-#include "catch_stringref.h"
-#include "catch_singletons.hpp"
-
-#include <cstdio>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- Catch::IStream::~IStream() = default;
-
- namespace Detail { namespace {
- template<typename WriterF, std::size_t bufferSize=256>
- class StreamBufImpl : public std::streambuf {
- char data[bufferSize];
- WriterF m_writer;
-
- public:
- StreamBufImpl() {
- setp( data, data + sizeof(data) );
- }
-
- ~StreamBufImpl() noexcept {
- StreamBufImpl::sync();
- }
-
- private:
- int overflow( int c ) override {
- sync();
-
- if( c != EOF ) {
- if( pbase() == epptr() )
- m_writer( std::string( 1, static_cast<char>( c ) ) );
- else
- sputc( static_cast<char>( c ) );
- }
- return 0;
- }
-
- int sync() override {
- if( pbase() != pptr() ) {
- m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) );
- setp( pbase(), epptr() );
- }
- return 0;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- struct OutputDebugWriter {
-
- void operator()( std::string const&str ) {
- writeToDebugConsole( str );
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class FileStream : public IStream {
- mutable std::ofstream m_ofs;
- public:
- FileStream( StringRef filename ) {
- m_ofs.open( filename.c_str() );
- CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << "'" );
- }
- ~FileStream() override = default;
- public: // IStream
- std::ostream& stream() const override {
- return m_ofs;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class CoutStream : public IStream {
- mutable std::ostream m_os;
- public:
- // Store the streambuf from cout up-front because
- // cout may get redirected when running tests
- CoutStream() : m_os( Catch::cout().rdbuf() ) {}
- ~CoutStream() override = default;
-
- public: // IStream
- std::ostream& stream() const override { return m_os; }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class DebugOutStream : public IStream {
- std::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf;
- mutable std::ostream m_os;
- public:
- DebugOutStream()
- : m_streamBuf( new StreamBufImpl<OutputDebugWriter>() ),
- m_os( m_streamBuf.get() )
- {}
-
- ~DebugOutStream() override = default;
-
- public: // IStream
- std::ostream& stream() const override { return m_os; }
- };
-
- }} // namespace anon::detail
-
- ///////////////////////////////////////////////////////////////////////////
-
- auto makeStream( StringRef const &filename ) -> IStream const* {
- if( filename.empty() )
- return new Detail::CoutStream();
- else if( filename[0] == '%' ) {
- if( filename == "%debug" )
- return new Detail::DebugOutStream();
- else
- CATCH_ERROR( "Unrecognised stream: '" << filename << "'" );
- }
- else
- return new Detail::FileStream( filename );
- }
-
-
- // This class encapsulates the idea of a pool of ostringstreams that can be reused.
- struct StringStreams {
- std::vector<std::unique_ptr<std::ostringstream>> m_streams;
- std::vector<std::size_t> m_unused;
- std::ostringstream m_referenceStream; // Used for copy state/ flags from
-
- auto add() -> std::size_t {
- if( m_unused.empty() ) {
- m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) );
- return m_streams.size()-1;
- }
- else {
- auto index = m_unused.back();
- m_unused.pop_back();
- return index;
- }
- }
-
- void release( std::size_t index ) {
- m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state
- m_unused.push_back(index);
- }
- };
-
- ReusableStringStream::ReusableStringStream()
- : m_index( Singleton<StringStreams>::getMutable().add() ),
- m_oss( Singleton<StringStreams>::getMutable().m_streams[m_index].get() )
- {}
-
- ReusableStringStream::~ReusableStringStream() {
- static_cast<std::ostringstream*>( m_oss )->str("");
- m_oss->clear();
- Singleton<StringStreams>::getMutable().release( m_index );
- }
-
- auto ReusableStringStream::str() const -> std::string {
- return static_cast<std::ostringstream*>( m_oss )->str();
- }
-
-
- ///////////////////////////////////////////////////////////////////////////
-
-
-#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these functions
- std::ostream& cout() { return std::cout; }
- std::ostream& cerr() { return std::cerr; }
- std::ostream& clog() { return std::clog; }
-#endif
-}
diff --git a/include/internal/catch_stream.h b/include/internal/catch_stream.h
deleted file mode 100644
index 999849c9..00000000
--- a/include/internal/catch_stream.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Created by Phil on 2/12/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
-#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
-
-#include "catch_common.h"
-
-#include <iosfwd>
-#include <cstddef>
-#include <ostream>
-
-namespace Catch {
-
- std::ostream& cout();
- std::ostream& cerr();
- std::ostream& clog();
-
- class StringRef;
-
- struct IStream {
- virtual ~IStream();
- virtual std::ostream& stream() const = 0;
- };
-
- auto makeStream( StringRef const &filename ) -> IStream const*;
-
- class ReusableStringStream : NonCopyable {
- std::size_t m_index;
- std::ostream* m_oss;
- public:
- ReusableStringStream();
- ~ReusableStringStream();
-
- auto str() const -> std::string;
-
- template<typename T>
- auto operator << ( T const& value ) -> ReusableStringStream& {
- *m_oss << value;
- return *this;
- }
- auto get() -> std::ostream& { return *m_oss; }
- };
-}
-
-#endif // TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
diff --git a/include/internal/catch_string_manip.cpp b/include/internal/catch_string_manip.cpp
deleted file mode 100644
index 65be34d0..00000000
--- a/include/internal/catch_string_manip.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Created by Martin on 25/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_string_manip.h"
-#include "catch_stringref.h"
-
-#include <algorithm>
-#include <ostream>
-#include <cstring>
-#include <cctype>
-#include <vector>
-
-namespace Catch {
-
- namespace {
- char toLowerCh(char c) {
- return static_cast<char>( std::tolower( c ) );
- }
- }
-
- bool startsWith( std::string const& s, std::string const& prefix ) {
- return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin());
- }
- bool startsWith( std::string const& s, char prefix ) {
- return !s.empty() && s[0] == prefix;
- }
- bool endsWith( std::string const& s, std::string const& suffix ) {
- return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
- }
- bool endsWith( std::string const& s, char suffix ) {
- return !s.empty() && s[s.size()-1] == suffix;
- }
- bool contains( std::string const& s, std::string const& infix ) {
- return s.find( infix ) != std::string::npos;
- }
- void toLowerInPlace( std::string& s ) {
- std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
- }
- std::string toLower( std::string const& s ) {
- std::string lc = s;
- toLowerInPlace( lc );
- return lc;
- }
- std::string trim( std::string const& str ) {
- static char const* whitespaceChars = "\n\r\t ";
- std::string::size_type start = str.find_first_not_of( whitespaceChars );
- std::string::size_type end = str.find_last_not_of( whitespaceChars );
-
- return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string();
- }
-
- StringRef trim(StringRef ref) {
- const auto is_ws = [](char c) {
- return c == ' ' || c == '\t' || c == '\n' || c == '\r';
- };
- size_t real_begin = 0;
- while (real_begin < ref.size() && is_ws(ref[real_begin])) { ++real_begin; }
- size_t real_end = ref.size();
- while (real_end > real_begin && is_ws(ref[real_end - 1])) { --real_end; }
-
- return ref.substr(real_begin, real_end - real_begin);
- }
-
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
- bool replaced = false;
- std::size_t i = str.find( replaceThis );
- while( i != std::string::npos ) {
- replaced = true;
- str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
- if( i < str.size()-withThis.size() )
- i = str.find( replaceThis, i+withThis.size() );
- else
- i = std::string::npos;
- }
- return replaced;
- }
-
- std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
- std::vector<StringRef> subStrings;
- std::size_t start = 0;
- for(std::size_t pos = 0; pos < str.size(); ++pos ) {
- if( str[pos] == delimiter ) {
- if( pos - start > 1 )
- subStrings.push_back( str.substr( start, pos-start ) );
- start = pos+1;
- }
- }
- if( start < str.size() )
- subStrings.push_back( str.substr( start, str.size()-start ) );
- return subStrings;
- }
-
- pluralise::pluralise( std::size_t count, std::string const& label )
- : m_count( count ),
- m_label( label )
- {}
-
- std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
- os << pluraliser.m_count << ' ' << pluraliser.m_label;
- if( pluraliser.m_count != 1 )
- os << 's';
- return os;
- }
-
-}
diff --git a/include/internal/catch_string_manip.h b/include/internal/catch_string_manip.h
deleted file mode 100644
index cdb7be5f..00000000
--- a/include/internal/catch_string_manip.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Created by Martin on 25/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_STRING_MANIP_H_INCLUDED
-#define TWOBLUECUBES_CATCH_STRING_MANIP_H_INCLUDED
-
-#include "catch_stringref.h"
-
-#include <string>
-#include <iosfwd>
-#include <vector>
-
-namespace Catch {
-
- bool startsWith( std::string const& s, std::string const& prefix );
- bool startsWith( std::string const& s, char prefix );
- bool endsWith( std::string const& s, std::string const& suffix );
- bool endsWith( std::string const& s, char suffix );
- bool contains( std::string const& s, std::string const& infix );
- void toLowerInPlace( std::string& s );
- std::string toLower( std::string const& s );
- //! Returns a new string without whitespace at the start/end
- std::string trim( std::string const& str );
- //! Returns a substring of the original ref without whitespace. Beware lifetimes!
- StringRef trim(StringRef ref);
-
- // !!! Be aware, returns refs into original string - make sure original string outlives them
- std::vector<StringRef> splitStringRef( StringRef str, char delimiter );
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
-
- struct pluralise {
- pluralise( std::size_t count, std::string const& label );
-
- friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
-
- std::size_t m_count;
- std::string m_label;
- };
-}
-
-#endif // TWOBLUECUBES_CATCH_STRING_MANIP_H_INCLUDED
-
diff --git a/include/internal/catch_stringref.cpp b/include/internal/catch_stringref.cpp
deleted file mode 100644
index 215feef3..00000000
--- a/include/internal/catch_stringref.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2016 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_enforce.h"
-#include "catch_stringref.h"
-
-#include <algorithm>
-#include <ostream>
-#include <cstring>
-#include <cstdint>
-
-namespace Catch {
- StringRef::StringRef( char const* rawChars ) noexcept
- : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) )
- {}
-
- auto StringRef::c_str() const -> char const* {
- CATCH_ENFORCE(isNullTerminated(), "Called StringRef::c_str() on a non-null-terminated instance");
- return m_start;
- }
- auto StringRef::data() const noexcept -> char const* {
- return m_start;
- }
-
- auto StringRef::substr( size_type start, size_type size ) const noexcept -> StringRef {
- if (start < m_size) {
- return StringRef(m_start + start, (std::min)(m_size - start, size));
- } else {
- return StringRef();
- }
- }
- auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool {
- return m_size == other.m_size
- && (std::memcmp( m_start, other.m_start, m_size ) == 0);
- }
-
- auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
- return os.write(str.data(), str.size());
- }
-
- auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& {
- lhs.append(rhs.data(), rhs.size());
- return lhs;
- }
-
-} // namespace Catch
diff --git a/include/internal/catch_stringref.h b/include/internal/catch_stringref.h
deleted file mode 100644
index dc2e748c..00000000
--- a/include/internal/catch_stringref.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2016 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef CATCH_STRINGREF_H_INCLUDED
-#define CATCH_STRINGREF_H_INCLUDED
-
-#include <cstddef>
-#include <string>
-#include <iosfwd>
-#include <cassert>
-
-namespace Catch {
-
- /// A non-owning string class (similar to the forthcoming std::string_view)
- /// Note that, because a StringRef may be a substring of another string,
- /// it may not be null terminated.
- class StringRef {
- public:
- using size_type = std::size_t;
- using const_iterator = const char*;
-
- private:
- static constexpr char const* const s_empty = "";
-
- char const* m_start = s_empty;
- size_type m_size = 0;
-
- public: // construction
- constexpr StringRef() noexcept = default;
-
- StringRef( char const* rawChars ) noexcept;
-
- constexpr StringRef( char const* rawChars, size_type size ) noexcept
- : m_start( rawChars ),
- m_size( size )
- {}
-
- StringRef( std::string const& stdString ) noexcept
- : m_start( stdString.c_str() ),
- m_size( stdString.size() )
- {}
-
- explicit operator std::string() const {
- return std::string(m_start, m_size);
- }
-
- public: // operators
- auto operator == ( StringRef const& other ) const noexcept -> bool;
- auto operator != (StringRef const& other) const noexcept -> bool {
- return !(*this == other);
- }
-
- auto operator[] ( size_type index ) const noexcept -> char {
- assert(index < m_size);
- return m_start[index];
- }
-
- public: // named queries
- constexpr auto empty() const noexcept -> bool {
- return m_size == 0;
- }
- constexpr auto size() const noexcept -> size_type {
- return m_size;
- }
-
- // Returns the current start pointer. If the StringRef is not
- // null-terminated, throws std::domain_exception
- auto c_str() const -> char const*;
-
- public: // substrings and searches
- // Returns a substring of [start, start + length).
- // If start + length > size(), then the substring is [start, size()).
- // If start > size(), then the substring is empty.
- auto substr( size_type start, size_type length ) const noexcept -> StringRef;
-
- // Returns the current start pointer. May not be null-terminated.
- auto data() const noexcept -> char const*;
-
- constexpr auto isNullTerminated() const noexcept -> bool {
- return m_start[m_size] == '\0';
- }
-
- public: // iterators
- constexpr const_iterator begin() const { return m_start; }
- constexpr const_iterator end() const { return m_start + m_size; }
- };
-
- auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
- auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
-
-
- constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
- return StringRef( rawChars, size );
- }
-} // namespace Catch
-
-constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
- return Catch::StringRef( rawChars, size );
-}
-
-#endif // CATCH_STRINGREF_H_INCLUDED
diff --git a/include/internal/catch_suppress_warnings.h b/include/internal/catch_suppress_warnings.h
deleted file mode 100644
index dc8c1da2..00000000
--- a/include/internal/catch_suppress_warnings.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2014 Two Blue Cubes Ltd
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(push)
-# pragma warning(disable: 161 1682)
-# else // __ICC
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wpadded"
-# pragma clang diagnostic ignored "-Wswitch-enum"
-# pragma clang diagnostic ignored "-Wcovered-switch-default"
-# endif
-#elif defined __GNUC__
- // Because REQUIREs trigger GCC's -Wparentheses, and because still
- // supported version of g++ have only buggy support for _Pragmas,
- // Wparentheses have to be suppressed globally.
-# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details
-
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wunused-variable"
-# pragma GCC diagnostic ignored "-Wpadded"
-#endif
diff --git a/include/internal/catch_tag_alias.cpp b/include/internal/catch_tag_alias.cpp
deleted file mode 100644
index 2ea4540e..00000000
--- a/include/internal/catch_tag_alias.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "catch_tag_alias.h"
-
-namespace Catch {
- TagAlias::TagAlias(std::string const & _tag, SourceLineInfo _lineInfo): tag(_tag), lineInfo(_lineInfo) {}
-}
diff --git a/include/internal/catch_tag_alias.h b/include/internal/catch_tag_alias.h
deleted file mode 100644
index a9e6eb37..00000000
--- a/include/internal/catch_tag_alias.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Created by Phil on 27/6/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TAG_ALIAS_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TAG_ALIAS_H_INCLUDED
-
-#include "catch_common.h"
-
-#include <string>
-
-namespace Catch {
-
- struct TagAlias {
- TagAlias(std::string const& _tag, SourceLineInfo _lineInfo);
-
- std::string tag;
- SourceLineInfo lineInfo;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_TAG_ALIAS_H_INCLUDED
diff --git a/include/internal/catch_tag_alias_autoregistrar.cpp b/include/internal/catch_tag_alias_autoregistrar.cpp
deleted file mode 100644
index 6a292edf..00000000
--- a/include/internal/catch_tag_alias_autoregistrar.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "catch_tag_alias_autoregistrar.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_interfaces_registry_hub.h"
-
-namespace Catch {
-
- RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) {
- CATCH_TRY {
- getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
- } CATCH_CATCH_ALL {
- // Do not throw when constructing global objects, instead register the exception to be processed later
- getMutableRegistryHub().registerStartupException();
- }
- }
-
-}
diff --git a/include/internal/catch_tag_alias_autoregistrar.h b/include/internal/catch_tag_alias_autoregistrar.h
deleted file mode 100644
index ebba8e25..00000000
--- a/include/internal/catch_tag_alias_autoregistrar.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Created by Martin on 27/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TAG_ALIAS_AUTOREGISTRAR_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TAG_ALIAS_AUTOREGISTRAR_H_INCLUDED
-
-#include "catch_common.h"
-
-namespace Catch {
-
- struct RegistrarForTagAliases {
- RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
- };
-
-} // end namespace Catch
-
-#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#endif // TWOBLUECUBES_CATCH_TAG_ALIAS_AUTOREGISTRAR_H_INCLUDED
diff --git a/include/internal/catch_tag_alias_registry.cpp b/include/internal/catch_tag_alias_registry.cpp
deleted file mode 100644
index 98aea26a..00000000
--- a/include/internal/catch_tag_alias_registry.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Created by Phil on 27/6/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_tag_alias_registry.h"
-#include "catch_console_colour.h"
-#include "catch_enforce.h"
-#include "catch_interfaces_registry_hub.h"
-#include "catch_string_manip.h"
-
-#include <sstream>
-
-namespace Catch {
-
- TagAliasRegistry::~TagAliasRegistry() {}
-
- TagAlias const* TagAliasRegistry::find( std::string const& alias ) const {
- auto it = m_registry.find( alias );
- if( it != m_registry.end() )
- return &(it->second);
- else
- return nullptr;
- }
-
- std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const {
- std::string expandedTestSpec = unexpandedTestSpec;
- for( auto const& registryKvp : m_registry ) {
- std::size_t pos = expandedTestSpec.find( registryKvp.first );
- if( pos != std::string::npos ) {
- expandedTestSpec = expandedTestSpec.substr( 0, pos ) +
- registryKvp.second.tag +
- expandedTestSpec.substr( pos + registryKvp.first.size() );
- }
- }
- return expandedTestSpec;
- }
-
- void TagAliasRegistry::add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) {
- CATCH_ENFORCE( startsWith(alias, "[@") && endsWith(alias, ']'),
- "error: tag alias, '" << alias << "' is not of the form [@alias name].\n" << lineInfo );
-
- CATCH_ENFORCE( m_registry.insert(std::make_pair(alias, TagAlias(tag, lineInfo))).second,
- "error: tag alias, '" << alias << "' already registered.\n"
- << "\tFirst seen at: " << find(alias)->lineInfo << "\n"
- << "\tRedefined at: " << lineInfo );
- }
-
- ITagAliasRegistry::~ITagAliasRegistry() {}
-
- ITagAliasRegistry const& ITagAliasRegistry::get() {
- return getRegistryHub().getTagAliasRegistry();
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_tag_alias_registry.h b/include/internal/catch_tag_alias_registry.h
deleted file mode 100644
index d3bb8ffb..00000000
--- a/include/internal/catch_tag_alias_registry.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Created by Phil on 27/6/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_H_INCLUDED
-
-#include "catch_interfaces_tag_alias_registry.h"
-#include "catch_tag_alias.h"
-
-#include <map>
-
-namespace Catch {
-
- class TagAliasRegistry : public ITagAliasRegistry {
- public:
- ~TagAliasRegistry() override;
- TagAlias const* find( std::string const& alias ) const override;
- std::string expandAliases( std::string const& unexpandedTestSpec ) const override;
- void add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo );
-
- private:
- std::map<std::string, TagAlias> m_registry;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_H_INCLUDED
diff --git a/include/internal/catch_test_case_info.cpp b/include/internal/catch_test_case_info.cpp
deleted file mode 100644
index cee972fa..00000000
--- a/include/internal/catch_test_case_info.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Created by Phil on 14/08/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_test_case_info.h"
-#include "catch_enforce.h"
-#include "catch_test_spec.h"
-#include "catch_interfaces_testcase.h"
-#include "catch_string_manip.h"
-
-#include <cctype>
-#include <exception>
-#include <algorithm>
-#include <sstream>
-
-namespace Catch {
-
- namespace {
- TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) {
- if( startsWith( tag, '.' ) ||
- tag == "!hide" )
- return TestCaseInfo::IsHidden;
- else if( tag == "!throws" )
- return TestCaseInfo::Throws;
- else if( tag == "!shouldfail" )
- return TestCaseInfo::ShouldFail;
- else if( tag == "!mayfail" )
- return TestCaseInfo::MayFail;
- else if( tag == "!nonportable" )
- return TestCaseInfo::NonPortable;
- else if( tag == "!benchmark" )
- return static_cast<TestCaseInfo::SpecialProperties>( TestCaseInfo::Benchmark | TestCaseInfo::IsHidden );
- else
- return TestCaseInfo::None;
- }
- bool isReservedTag( std::string const& tag ) {
- return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum( static_cast<unsigned char>(tag[0]) );
- }
- void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
- CATCH_ENFORCE( !isReservedTag(tag),
- "Tag name: [" << tag << "] is not allowed.\n"
- << "Tag names starting with non alphanumeric characters are reserved\n"
- << _lineInfo );
- }
- }
-
- TestCase makeTestCase( ITestInvoker* _testCase,
- std::string const& _className,
- NameAndTags const& nameAndTags,
- SourceLineInfo const& _lineInfo )
- {
- bool isHidden = false;
-
- // Parse out tags
- std::vector<std::string> tags;
- std::string desc, tag;
- bool inTag = false;
- for (char c : nameAndTags.tags) {
- if( !inTag ) {
- if( c == '[' )
- inTag = true;
- else
- desc += c;
- }
- else {
- if( c == ']' ) {
- TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
- if( ( prop & TestCaseInfo::IsHidden ) != 0 )
- isHidden = true;
- else if( prop == TestCaseInfo::None )
- enforceNotReservedTag( tag, _lineInfo );
-
- // Merged hide tags like `[.approvals]` should be added as
- // `[.][approvals]`. The `[.]` is added at later point, so
- // we only strip the prefix
- if (startsWith(tag, '.') && tag.size() > 1) {
- tag.erase(0, 1);
- }
- tags.push_back( tag );
- tag.clear();
- inTag = false;
- }
- else
- tag += c;
- }
- }
- if( isHidden ) {
- // Add all "hidden" tags to make them behave identically
- tags.insert( tags.end(), { ".", "!hide" } );
- }
-
- TestCaseInfo info( static_cast<std::string>(nameAndTags.name), _className, desc, tags, _lineInfo );
- return TestCase( _testCase, std::move(info) );
- }
-
- void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
- std::sort(begin(tags), end(tags));
- tags.erase(std::unique(begin(tags), end(tags)), end(tags));
- testCaseInfo.lcaseTags.clear();
-
- for( auto const& tag : tags ) {
- std::string lcaseTag = toLower( tag );
- testCaseInfo.properties = static_cast<TestCaseInfo::SpecialProperties>( testCaseInfo.properties | parseSpecialTag( lcaseTag ) );
- testCaseInfo.lcaseTags.push_back( lcaseTag );
- }
- testCaseInfo.tags = std::move(tags);
- }
-
- TestCaseInfo::TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::vector<std::string> const& _tags,
- SourceLineInfo const& _lineInfo )
- : name( _name ),
- className( _className ),
- description( _description ),
- lineInfo( _lineInfo ),
- properties( None )
- {
- setTags( *this, _tags );
- }
-
- bool TestCaseInfo::isHidden() const {
- return ( properties & IsHidden ) != 0;
- }
- bool TestCaseInfo::throws() const {
- return ( properties & Throws ) != 0;
- }
- bool TestCaseInfo::okToFail() const {
- return ( properties & (ShouldFail | MayFail ) ) != 0;
- }
- bool TestCaseInfo::expectedToFail() const {
- return ( properties & (ShouldFail ) ) != 0;
- }
-
- std::string TestCaseInfo::tagsAsString() const {
- std::string ret;
- // '[' and ']' per tag
- std::size_t full_size = 2 * tags.size();
- for (const auto& tag : tags) {
- full_size += tag.size();
- }
- ret.reserve(full_size);
- for (const auto& tag : tags) {
- ret.push_back('[');
- ret.append(tag);
- ret.push_back(']');
- }
-
- return ret;
- }
-
-
- TestCase::TestCase( ITestInvoker* testCase, TestCaseInfo&& info ) : TestCaseInfo( std::move(info) ), test( testCase ) {}
-
-
- TestCase TestCase::withName( std::string const& _newName ) const {
- TestCase other( *this );
- other.name = _newName;
- return other;
- }
-
- void TestCase::invoke() const {
- test->invoke();
- }
-
- bool TestCase::operator == ( TestCase const& other ) const {
- return test.get() == other.test.get() &&
- name == other.name &&
- className == other.className;
- }
-
- bool TestCase::operator < ( TestCase const& other ) const {
- return name < other.name;
- }
-
- TestCaseInfo const& TestCase::getTestCaseInfo() const
- {
- return *this;
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h
deleted file mode 100644
index 809c974f..00000000
--- a/include/internal/catch_test_case_info.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Created by Phil on 29/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED
-
-#include "catch_common.h"
-#include "catch_test_registry.h"
-
-#include <string>
-#include <vector>
-#include <memory>
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
- struct ITestInvoker;
-
- struct TestCaseInfo {
- enum SpecialProperties{
- None = 0,
- IsHidden = 1 << 1,
- ShouldFail = 1 << 2,
- MayFail = 1 << 3,
- Throws = 1 << 4,
- NonPortable = 1 << 5,
- Benchmark = 1 << 6
- };
-
- TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::vector<std::string> const& _tags,
- SourceLineInfo const& _lineInfo );
-
- friend void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags );
-
- bool isHidden() const;
- bool throws() const;
- bool okToFail() const;
- bool expectedToFail() const;
-
- std::string tagsAsString() const;
-
- std::string name;
- std::string className;
- std::string description;
- std::vector<std::string> tags;
- std::vector<std::string> lcaseTags;
- SourceLineInfo lineInfo;
- SpecialProperties properties;
- };
-
- class TestCase : public TestCaseInfo {
- public:
-
- TestCase( ITestInvoker* testCase, TestCaseInfo&& info );
-
- TestCase withName( std::string const& _newName ) const;
-
- void invoke() const;
-
- TestCaseInfo const& getTestCaseInfo() const;
-
- bool operator == ( TestCase const& other ) const;
- bool operator < ( TestCase const& other ) const;
-
- private:
- std::shared_ptr<ITestInvoker> test;
- };
-
- TestCase makeTestCase( ITestInvoker* testCase,
- std::string const& className,
- NameAndTags const& nameAndTags,
- SourceLineInfo const& lineInfo );
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED
diff --git a/include/internal/catch_test_case_registry_impl.cpp b/include/internal/catch_test_case_registry_impl.cpp
deleted file mode 100644
index b254ca08..00000000
--- a/include/internal/catch_test_case_registry_impl.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Created by Martin on 25/07/2017
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_test_case_registry_impl.h"
-
-#include "catch_context.h"
-#include "catch_enforce.h"
-#include "catch_interfaces_registry_hub.h"
-#include "catch_random_number_generator.h"
-#include "catch_run_context.h"
-#include "catch_string_manip.h"
-#include "catch_test_case_info.h"
-
-#include <sstream>
-
-namespace Catch {
-
- std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
-
- std::vector<TestCase> sorted = unsortedTestCases;
-
- switch( config.runOrder() ) {
- case RunTests::InLexicographicalOrder:
- std::sort( sorted.begin(), sorted.end() );
- break;
- case RunTests::InRandomOrder:
- seedRng( config );
- std::shuffle( sorted.begin(), sorted.end(), rng() );
- break;
- case RunTests::InDeclarationOrder:
- // already in declaration order
- break;
- }
- return sorted;
- }
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config ) {
- return !testCase.throws() || config.allowThrows();
- }
-
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
- return testSpec.matches( testCase ) && isThrowSafe( testCase, config );
- }
-
- void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions ) {
- std::set<TestCase> seenFunctions;
- for( auto const& function : functions ) {
- auto prev = seenFunctions.insert( function );
- CATCH_ENFORCE( prev.second,
- "error: TEST_CASE( \"" << function.name << "\" ) already defined.\n"
- << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n"
- << "\tRedefined at " << function.getTestCaseInfo().lineInfo );
- }
- }
-
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config ) {
- std::vector<TestCase> filtered;
- filtered.reserve( testCases.size() );
- for (auto const& testCase : testCases) {
- if ((!testSpec.hasFilters() && !testCase.isHidden()) ||
- (testSpec.hasFilters() && matchTest(testCase, testSpec, config))) {
- filtered.push_back(testCase);
- }
- }
- return filtered;
- }
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config ) {
- return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config );
- }
-
- void TestRegistry::registerTest( TestCase const& testCase ) {
- std::string name = testCase.getTestCaseInfo().name;
- if( name.empty() ) {
- ReusableStringStream rss;
- rss << "Anonymous test case " << ++m_unnamedCount;
- return registerTest( testCase.withName( rss.str() ) );
- }
- m_functions.push_back( testCase );
- }
-
- std::vector<TestCase> const& TestRegistry::getAllTests() const {
- return m_functions;
- }
- std::vector<TestCase> const& TestRegistry::getAllTestsSorted( IConfig const& config ) const {
- if( m_sortedFunctions.empty() )
- enforceNoDuplicateTestCases( m_functions );
-
- if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) {
- m_sortedFunctions = sortTests( config, m_functions );
- m_currentSortOrder = config.runOrder();
- }
- return m_sortedFunctions;
- }
-
-
-
- ///////////////////////////////////////////////////////////////////////////
- TestInvokerAsFunction::TestInvokerAsFunction( void(*testAsFunction)() ) noexcept : m_testAsFunction( testAsFunction ) {}
-
- void TestInvokerAsFunction::invoke() const {
- m_testAsFunction();
- }
-
- std::string extractClassName( StringRef const& classOrQualifiedMethodName ) {
- std::string className(classOrQualifiedMethodName);
- if( startsWith( className, '&' ) )
- {
- std::size_t lastColons = className.rfind( "::" );
- std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
- if( penultimateColons == std::string::npos )
- penultimateColons = 1;
- className = className.substr( penultimateColons, lastColons-penultimateColons );
- }
- return className;
- }
-
-} // end namespace Catch
diff --git a/include/internal/catch_test_case_registry_impl.h b/include/internal/catch_test_case_registry_impl.h
deleted file mode 100644
index 359ac3e3..00000000
--- a/include/internal/catch_test_case_registry_impl.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Created by Phil on 7/1/2011
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
-
-#include "catch_test_registry.h"
-#include "catch_test_spec.h"
-#include "catch_interfaces_config.h"
-
-#include <vector>
-#include <set>
-#include <algorithm>
-#include <ios>
-
-namespace Catch {
-
- class TestCase;
- struct IConfig;
-
- std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases );
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config );
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
-
- void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions );
-
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
-
- class TestRegistry : public ITestCaseRegistry {
- public:
- virtual ~TestRegistry() = default;
-
- virtual void registerTest( TestCase const& testCase );
-
- std::vector<TestCase> const& getAllTests() const override;
- std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const override;
-
- private:
- std::vector<TestCase> m_functions;
- mutable RunTests::InWhatOrder m_currentSortOrder = RunTests::InDeclarationOrder;
- mutable std::vector<TestCase> m_sortedFunctions;
- std::size_t m_unnamedCount = 0;
- std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class TestInvokerAsFunction : public ITestInvoker {
- void(*m_testAsFunction)();
- public:
- TestInvokerAsFunction( void(*testAsFunction)() ) noexcept;
-
- void invoke() const override;
- };
-
-
- std::string extractClassName( StringRef const& classOrQualifiedMethodName );
-
- ///////////////////////////////////////////////////////////////////////////
-
-
-} // end namespace Catch
-
-
-#endif // TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
diff --git a/include/internal/catch_test_case_tracker.cpp b/include/internal/catch_test_case_tracker.cpp
deleted file mode 100644
index 1fc820b1..00000000
--- a/include/internal/catch_test_case_tracker.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Created by Martin on 19/07/2017
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_test_case_tracker.h"
-
-#include "catch_enforce.h"
-#include "catch_string_manip.h"
-
-#include <algorithm>
-#include <cassert>
-#include <stdexcept>
-#include <memory>
-#include <sstream>
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-#endif
-
-namespace Catch {
-namespace TestCaseTracking {
-
- NameAndLocation::NameAndLocation( std::string const& _name, SourceLineInfo const& _location )
- : name( _name ),
- location( _location )
- {}
-
-
- ITracker::~ITracker() = default;
-
-
- ITracker& TrackerContext::startRun() {
- m_rootTracker = std::make_shared<SectionTracker>( NameAndLocation( "{root}", CATCH_INTERNAL_LINEINFO ), *this, nullptr );
- m_currentTracker = nullptr;
- m_runState = Executing;
- return *m_rootTracker;
- }
-
- void TrackerContext::endRun() {
- m_rootTracker.reset();
- m_currentTracker = nullptr;
- m_runState = NotStarted;
- }
-
- void TrackerContext::startCycle() {
- m_currentTracker = m_rootTracker.get();
- m_runState = Executing;
- }
- void TrackerContext::completeCycle() {
- m_runState = CompletedCycle;
- }
-
- bool TrackerContext::completedCycle() const {
- return m_runState == CompletedCycle;
- }
- ITracker& TrackerContext::currentTracker() {
- return *m_currentTracker;
- }
- void TrackerContext::setCurrentTracker( ITracker* tracker ) {
- m_currentTracker = tracker;
- }
-
-
- TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : m_nameAndLocation( nameAndLocation ),
- m_ctx( ctx ),
- m_parent( parent )
- {}
-
- NameAndLocation const& TrackerBase::nameAndLocation() const {
- return m_nameAndLocation;
- }
- bool TrackerBase::isComplete() const {
- return m_runState == CompletedSuccessfully || m_runState == Failed;
- }
- bool TrackerBase::isSuccessfullyCompleted() const {
- return m_runState == CompletedSuccessfully;
- }
- bool TrackerBase::isOpen() const {
- return m_runState != NotStarted && !isComplete();
- }
- bool TrackerBase::hasChildren() const {
- return !m_children.empty();
- }
-
-
- void TrackerBase::addChild( ITrackerPtr const& child ) {
- m_children.push_back( child );
- }
-
- ITrackerPtr TrackerBase::findChild( NameAndLocation const& nameAndLocation ) {
- auto it = std::find_if( m_children.begin(), m_children.end(),
- [&nameAndLocation]( ITrackerPtr const& tracker ){
- return
- tracker->nameAndLocation().location == nameAndLocation.location &&
- tracker->nameAndLocation().name == nameAndLocation.name;
- } );
- return( it != m_children.end() )
- ? *it
- : nullptr;
- }
- ITracker& TrackerBase::parent() {
- assert( m_parent ); // Should always be non-null except for root
- return *m_parent;
- }
-
- void TrackerBase::openChild() {
- if( m_runState != ExecutingChildren ) {
- m_runState = ExecutingChildren;
- if( m_parent )
- m_parent->openChild();
- }
- }
-
- bool TrackerBase::isSectionTracker() const { return false; }
- bool TrackerBase::isGeneratorTracker() const { return false; }
-
- void TrackerBase::open() {
- m_runState = Executing;
- moveToThis();
- if( m_parent )
- m_parent->openChild();
- }
-
- void TrackerBase::close() {
-
- // Close any still open children (e.g. generators)
- while( &m_ctx.currentTracker() != this )
- m_ctx.currentTracker().close();
-
- switch( m_runState ) {
- case NeedsAnotherRun:
- break;
-
- case Executing:
- m_runState = CompletedSuccessfully;
- break;
- case ExecutingChildren:
- if( std::all_of(m_children.begin(), m_children.end(), [](ITrackerPtr const& t){ return t->isComplete(); }) )
- m_runState = CompletedSuccessfully;
- break;
-
- case NotStarted:
- case CompletedSuccessfully:
- case Failed:
- CATCH_INTERNAL_ERROR( "Illogical state: " << m_runState );
-
- default:
- CATCH_INTERNAL_ERROR( "Unknown state: " << m_runState );
- }
- moveToParent();
- m_ctx.completeCycle();
- }
- void TrackerBase::fail() {
- m_runState = Failed;
- if( m_parent )
- m_parent->markAsNeedingAnotherRun();
- moveToParent();
- m_ctx.completeCycle();
- }
- void TrackerBase::markAsNeedingAnotherRun() {
- m_runState = NeedsAnotherRun;
- }
-
- void TrackerBase::moveToParent() {
- assert( m_parent );
- m_ctx.setCurrentTracker( m_parent );
- }
- void TrackerBase::moveToThis() {
- m_ctx.setCurrentTracker( this );
- }
-
- SectionTracker::SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : TrackerBase( nameAndLocation, ctx, parent ),
- m_trimmed_name(trim(nameAndLocation.name))
- {
- if( parent ) {
- while( !parent->isSectionTracker() )
- parent = &parent->parent();
-
- SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
- addNextFilters( parentSection.m_filters );
- }
- }
-
- bool SectionTracker::isComplete() const {
- bool complete = true;
-
- if ((m_filters.empty() || m_filters[0] == "")
- || std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
- complete = TrackerBase::isComplete();
- }
- return complete;
- }
-
- bool SectionTracker::isSectionTracker() const { return true; }
-
- SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) {
- std::shared_ptr<SectionTracker> section;
-
- ITracker& currentTracker = ctx.currentTracker();
- if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
- assert( childTracker );
- assert( childTracker->isSectionTracker() );
- section = std::static_pointer_cast<SectionTracker>( childTracker );
- }
- else {
- section = std::make_shared<SectionTracker>( nameAndLocation, ctx, &currentTracker );
- currentTracker.addChild( section );
- }
- if( !ctx.completedCycle() )
- section->tryOpen();
- return *section;
- }
-
- void SectionTracker::tryOpen() {
- if( !isComplete() )
- open();
- }
-
- void SectionTracker::addInitialFilters( std::vector<std::string> const& filters ) {
- if( !filters.empty() ) {
- m_filters.reserve( m_filters.size() + filters.size() + 2 );
- m_filters.emplace_back(""); // Root - should never be consulted
- m_filters.emplace_back(""); // Test Case - not a section filter
- m_filters.insert( m_filters.end(), filters.begin(), filters.end() );
- }
- }
- void SectionTracker::addNextFilters( std::vector<std::string> const& filters ) {
- if( filters.size() > 1 )
- m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
- }
-
-} // namespace TestCaseTracking
-
-using TestCaseTracking::ITracker;
-using TestCaseTracking::TrackerContext;
-using TestCaseTracking::SectionTracker;
-
-} // namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
diff --git a/include/internal/catch_test_case_tracker.h b/include/internal/catch_test_case_tracker.h
deleted file mode 100644
index 563dbef2..00000000
--- a/include/internal/catch_test_case_tracker.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Created by Phil Nash on 23/7/2013
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
-
-#include "catch_compiler_capabilities.h"
-#include "catch_common.h"
-
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-namespace TestCaseTracking {
-
- struct NameAndLocation {
- std::string name;
- SourceLineInfo location;
-
- NameAndLocation( std::string const& _name, SourceLineInfo const& _location );
- };
-
- struct ITracker;
-
- using ITrackerPtr = std::shared_ptr<ITracker>;
-
- struct ITracker {
- virtual ~ITracker();
-
- // static queries
- virtual NameAndLocation const& nameAndLocation() const = 0;
-
- // dynamic queries
- virtual bool isComplete() const = 0; // Successfully completed or failed
- virtual bool isSuccessfullyCompleted() const = 0;
- virtual bool isOpen() const = 0; // Started but not complete
- virtual bool hasChildren() const = 0;
-
- virtual ITracker& parent() = 0;
-
- // actions
- virtual void close() = 0; // Successfully complete
- virtual void fail() = 0;
- virtual void markAsNeedingAnotherRun() = 0;
-
- virtual void addChild( ITrackerPtr const& child ) = 0;
- virtual ITrackerPtr findChild( NameAndLocation const& nameAndLocation ) = 0;
- virtual void openChild() = 0;
-
- // Debug/ checking
- virtual bool isSectionTracker() const = 0;
- virtual bool isGeneratorTracker() const = 0;
- };
-
- class TrackerContext {
-
- enum RunState {
- NotStarted,
- Executing,
- CompletedCycle
- };
-
- ITrackerPtr m_rootTracker;
- ITracker* m_currentTracker = nullptr;
- RunState m_runState = NotStarted;
-
- public:
-
- ITracker& startRun();
- void endRun();
-
- void startCycle();
- void completeCycle();
-
- bool completedCycle() const;
- ITracker& currentTracker();
- void setCurrentTracker( ITracker* tracker );
- };
-
- class TrackerBase : public ITracker {
- protected:
- enum CycleState {
- NotStarted,
- Executing,
- ExecutingChildren,
- NeedsAnotherRun,
- CompletedSuccessfully,
- Failed
- };
-
- using Children = std::vector<ITrackerPtr>;
- NameAndLocation m_nameAndLocation;
- TrackerContext& m_ctx;
- ITracker* m_parent;
- Children m_children;
- CycleState m_runState = NotStarted;
-
- public:
- TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
-
- NameAndLocation const& nameAndLocation() const override;
- bool isComplete() const override;
- bool isSuccessfullyCompleted() const override;
- bool isOpen() const override;
- bool hasChildren() const override;
-
-
- void addChild( ITrackerPtr const& child ) override;
-
- ITrackerPtr findChild( NameAndLocation const& nameAndLocation ) override;
- ITracker& parent() override;
-
- void openChild() override;
-
- bool isSectionTracker() const override;
- bool isGeneratorTracker() const override;
-
- void open();
-
- void close() override;
- void fail() override;
- void markAsNeedingAnotherRun() override;
-
- private:
- void moveToParent();
- void moveToThis();
- };
-
- class SectionTracker : public TrackerBase {
- std::vector<std::string> m_filters;
- std::string m_trimmed_name;
- public:
- SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
-
- bool isSectionTracker() const override;
-
- bool isComplete() const override;
-
- static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation );
-
- void tryOpen();
-
- void addInitialFilters( std::vector<std::string> const& filters );
- void addNextFilters( std::vector<std::string> const& filters );
- };
-
-} // namespace TestCaseTracking
-
-using TestCaseTracking::ITracker;
-using TestCaseTracking::TrackerContext;
-using TestCaseTracking::SectionTracker;
-
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
diff --git a/include/internal/catch_test_registry.cpp b/include/internal/catch_test_registry.cpp
deleted file mode 100644
index 248bee4c..00000000
--- a/include/internal/catch_test_registry.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Created by Martin on 25/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_test_registry.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_test_case_registry_impl.h"
-#include "catch_interfaces_registry_hub.h"
-
-namespace Catch {
-
- auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker* {
- return new(std::nothrow) TestInvokerAsFunction( testAsFunction );
- }
-
- NameAndTags::NameAndTags( StringRef const& name_ , StringRef const& tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
-
- AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept {
- CATCH_TRY {
- getMutableRegistryHub()
- .registerTest(
- makeTestCase(
- invoker,
- extractClassName( classOrMethod ),
- nameAndTags,
- lineInfo));
- } CATCH_CATCH_ALL {
- // Do not throw when constructing global objects, instead register the exception to be processed later
- getMutableRegistryHub().registerStartupException();
- }
- }
-
- AutoReg::~AutoReg() = default;
-}
diff --git a/include/internal/catch_test_registry.h b/include/internal/catch_test_registry.h
deleted file mode 100644
index c9624fc7..00000000
--- a/include/internal/catch_test_registry.h
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Created by Phil on 18/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
-
-#include "catch_common.h"
-#include "catch_interfaces_testcase.h"
-#include "catch_compiler_capabilities.h"
-#include "catch_stringref.h"
-#include "catch_preprocessor.hpp"
-#include "catch_meta.hpp"
-
-namespace Catch {
-
-template<typename C>
-class TestInvokerAsMethod : public ITestInvoker {
- void (C::*m_testAsMethod)();
-public:
- TestInvokerAsMethod( void (C::*testAsMethod)() ) noexcept : m_testAsMethod( testAsMethod ) {}
-
- void invoke() const override {
- C obj;
- (obj.*m_testAsMethod)();
- }
-};
-
-auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker*;
-
-template<typename C>
-auto makeTestInvoker( void (C::*testAsMethod)() ) noexcept -> ITestInvoker* {
- return new(std::nothrow) TestInvokerAsMethod<C>( testAsMethod );
-}
-
-struct NameAndTags {
- NameAndTags( StringRef const& name_ = StringRef(), StringRef const& tags_ = StringRef() ) noexcept;
- StringRef name;
- StringRef tags;
-};
-
-struct AutoReg : NonCopyable {
- AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept;
- ~AutoReg();
-};
-
-} // end namespace Catch
-
-#if defined(CATCH_CONFIG_DISABLE)
- #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
- namespace{ \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
- void test(); \
- }; \
- } \
- void TestName::test()
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( TestName, TestFunc, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature))
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
- namespace{ \
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
- INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- } \
- } \
- INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
- #endif
-#endif
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
- static void TestName(); \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE( ... ) \
- INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &QualifiedMethod ), CATCH_INTERNAL_LINEINFO, "&" #QualifiedMethod, Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
- void test(); \
- }; \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
- } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- void TestName::test()
- #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
- INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, Signature, ... )\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
- INTERNAL_CATCH_TYPE_GEN\
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- INTERNAL_CATCH_NTTP_REG_GEN(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types> \
- struct TestName{\
- TestName(){\
- int index = 0; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
- using expander = int[];\
- (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
- return 0;\
- }();\
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> static void TestFuncName(); \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
- INTERNAL_CATCH_TYPE_GEN \
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
- template<typename... Types> \
- struct TestName { \
- void reg_tests() { \
- int index = 0; \
- using expander = int[]; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
- constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
- constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
- (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++, 0)... };/* NOLINT */\
- } \
- }; \
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
- 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; \
- TestInit t; \
- t.reg_tests(); \
- return 0; \
- }(); \
- } \
- } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- static void TestFuncName()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T,__VA_ARGS__)
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__)
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> static void TestFunc(); \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
- INTERNAL_CATCH_TYPE_GEN\
- template<typename... Types> \
- struct TestName { \
- void reg_tests() { \
- int index = 0; \
- using expander = int[]; \
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */\
- } \
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
- using TestInit = typename convert<TestName, TmplList>::type; \
- TestInit t; \
- t.reg_tests(); \
- return 0; \
- }(); \
- }}\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- static void TestFunc()
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList) \
- INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, TmplList )
-
-
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
- INTERNAL_CATCH_TYPE_GEN\
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types> \
- struct TestNameClass{\
- TestNameClass(){\
- int index = 0; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
- using expander = int[];\
- (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- TestNameClass<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
- return 0;\
- }();\
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
- void test();\
- };\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) {\
- INTERNAL_CATCH_TYPE_GEN \
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types>\
- struct TestNameClass{\
- void reg_tests(){\
- int index = 0;\
- using expander = int[];\
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
- constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
- constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
- (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++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- 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;\
- TestInit t;\
- t.reg_tests();\
- return 0;\
- }(); \
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- void TestName<TestType>::test()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, TmplList) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
- void test();\
- };\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
- INTERNAL_CATCH_TYPE_GEN\
- template<typename...Types>\
- struct TestNameClass{\
- void reg_tests(){\
- int index = 0;\
- using expander = int[];\
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- using TestInit = typename convert<TestNameClass, TmplList>::type;\
- TestInit t;\
- t.reg_tests();\
- return 0;\
- }(); \
- }}\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- void TestName<TestType>::test()
-
-#define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD(ClassName, Name, Tags, TmplList) \
- INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, TmplList )
-
-
-#endif // TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
diff --git a/include/internal/catch_test_spec.cpp b/include/internal/catch_test_spec.cpp
deleted file mode 100644
index 65d34d0e..00000000
--- a/include/internal/catch_test_spec.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_test_spec.h"
-#include "catch_string_manip.h"
-#include "catch_interfaces_config.h"
-
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- TestSpec::Pattern::Pattern( std::string const& name )
- : m_name( name )
- {}
-
- TestSpec::Pattern::~Pattern() = default;
-
- std::string const& TestSpec::Pattern::name() const {
- return m_name;
- }
-
-
- TestSpec::NamePattern::NamePattern( std::string const& name, std::string const& filterString )
- : Pattern( filterString )
- , m_wildcardPattern( toLower( name ), CaseSensitive::No )
- {}
-
- bool TestSpec::NamePattern::matches( TestCaseInfo const& testCase ) const {
- return m_wildcardPattern.matches( testCase.name );
- }
-
-
- TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString )
- : Pattern( filterString )
- , m_tag( toLower( tag ) )
- {}
-
- bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const {
- return std::find(begin(testCase.lcaseTags),
- end(testCase.lcaseTags),
- m_tag) != end(testCase.lcaseTags);
- }
-
-
- TestSpec::ExcludedPattern::ExcludedPattern( PatternPtr const& underlyingPattern )
- : Pattern( underlyingPattern->name() )
- , m_underlyingPattern( underlyingPattern )
- {}
-
- bool TestSpec::ExcludedPattern::matches( TestCaseInfo const& testCase ) const {
- return !m_underlyingPattern->matches( testCase );
- }
-
-
- bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const {
- return std::all_of( m_patterns.begin(), m_patterns.end(), [&]( PatternPtr const& p ){ return p->matches( testCase ); } );
- }
-
- std::string TestSpec::Filter::name() const {
- std::string name;
- for( auto const& p : m_patterns )
- name += p->name();
- return name;
- }
-
-
- bool TestSpec::hasFilters() const {
- return !m_filters.empty();
- }
-
- bool TestSpec::matches( TestCaseInfo const& testCase ) const {
- return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } );
- }
-
- TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCase> const& testCases, IConfig const& config ) const
- {
- Matches matches( m_filters.size() );
- std::transform( m_filters.begin(), m_filters.end(), matches.begin(), [&]( Filter const& filter ){
- std::vector<TestCase const*> currentMatches;
- for( auto const& test : testCases )
- if( isThrowSafe( test, config ) && filter.matches( test ) )
- currentMatches.emplace_back( &test );
- return FilterMatch{ filter.name(), currentMatches };
- } );
- return matches;
- }
-
- const TestSpec::vectorStrings& TestSpec::getInvalidArgs() const{
- return (m_invalidArgs);
- }
-
-}
diff --git a/include/internal/catch_test_spec.h b/include/internal/catch_test_spec.h
deleted file mode 100644
index 2e546463..00000000
--- a/include/internal/catch_test_spec.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Created by Phil on 14/8/2012.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-#include "catch_wildcard_pattern.h"
-#include "catch_test_case_info.h"
-
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- struct IConfig;
-
- class TestSpec {
- class Pattern {
- public:
- explicit Pattern( std::string const& name );
- virtual ~Pattern();
- virtual bool matches( TestCaseInfo const& testCase ) const = 0;
- std::string const& name() const;
- private:
- std::string const m_name;
- };
- using PatternPtr = std::shared_ptr<Pattern>;
-
- class NamePattern : public Pattern {
- public:
- explicit NamePattern( std::string const& name, std::string const& filterString );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- WildcardPattern m_wildcardPattern;
- };
-
- class TagPattern : public Pattern {
- public:
- explicit TagPattern( std::string const& tag, std::string const& filterString );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- std::string m_tag;
- };
-
- class ExcludedPattern : public Pattern {
- public:
- explicit ExcludedPattern( PatternPtr const& underlyingPattern );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- PatternPtr m_underlyingPattern;
- };
-
- struct Filter {
- std::vector<PatternPtr> m_patterns;
-
- bool matches( TestCaseInfo const& testCase ) const;
- std::string name() const;
- };
-
- public:
- struct FilterMatch {
- std::string name;
- std::vector<TestCase const*> tests;
- };
- using Matches = std::vector<FilterMatch>;
- using vectorStrings = std::vector<std::string>;
-
- bool hasFilters() const;
- bool matches( TestCaseInfo const& testCase ) const;
- Matches matchesByFilter( std::vector<TestCase> const& testCases, IConfig const& config ) const;
- const vectorStrings & getInvalidArgs() const;
-
- private:
- std::vector<Filter> m_filters;
- std::vector<std::string> m_invalidArgs;
- friend class TestSpecParser;
- };
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED
diff --git a/include/internal/catch_test_spec_parser.cpp b/include/internal/catch_test_spec_parser.cpp
deleted file mode 100644
index dad15c01..00000000
--- a/include/internal/catch_test_spec_parser.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_test_spec_parser.h"
-
-
-namespace Catch {
-
- TestSpecParser::TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {}
-
- TestSpecParser& TestSpecParser::parse( std::string const& arg ) {
- m_mode = None;
- m_exclusion = false;
- m_arg = m_tagAliases->expandAliases( arg );
- m_escapeChars.clear();
- m_substring.reserve(m_arg.size());
- m_patternName.reserve(m_arg.size());
- m_realPatternPos = 0;
-
- for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
- //if visitChar fails
- if( !visitChar( m_arg[m_pos] ) ){
- m_testSpec.m_invalidArgs.push_back(arg);
- break;
- }
- endMode();
- return *this;
- }
- TestSpec TestSpecParser::testSpec() {
- addFilter();
- return m_testSpec;
- }
- bool TestSpecParser::visitChar( char c ) {
- if( (m_mode != EscapedName) && (c == '\\') ) {
- escape();
- addCharToPattern(c);
- return true;
- }else if((m_mode != EscapedName) && (c == ',') ) {
- return separate();
- }
-
- switch( m_mode ) {
- case None:
- if( processNoneChar( c ) )
- return true;
- break;
- case Name:
- processNameChar( c );
- break;
- case EscapedName:
- endMode();
- addCharToPattern(c);
- return true;
- default:
- case Tag:
- case QuotedName:
- if( processOtherChar( c ) )
- return true;
- break;
- }
-
- m_substring += c;
- if( !isControlChar( c ) ) {
- m_patternName += c;
- m_realPatternPos++;
- }
- return true;
- }
- // Two of the processing methods return true to signal the caller to return
- // without adding the given character to the current pattern strings
- bool TestSpecParser::processNoneChar( char c ) {
- switch( c ) {
- case ' ':
- return true;
- case '~':
- m_exclusion = true;
- return false;
- case '[':
- startNewMode( Tag );
- return false;
- case '"':
- startNewMode( QuotedName );
- return false;
- default:
- startNewMode( Name );
- return false;
- }
- }
- void TestSpecParser::processNameChar( char c ) {
- if( c == '[' ) {
- if( m_substring == "exclude:" )
- m_exclusion = true;
- else
- endMode();
- startNewMode( Tag );
- }
- }
- bool TestSpecParser::processOtherChar( char c ) {
- if( !isControlChar( c ) )
- return false;
- m_substring += c;
- endMode();
- return true;
- }
- void TestSpecParser::startNewMode( Mode mode ) {
- m_mode = mode;
- }
- void TestSpecParser::endMode() {
- switch( m_mode ) {
- case Name:
- case QuotedName:
- return addNamePattern();
- case Tag:
- return addTagPattern();
- case EscapedName:
- revertBackToLastMode();
- return;
- case None:
- default:
- return startNewMode( None );
- }
- }
- void TestSpecParser::escape() {
- saveLastMode();
- m_mode = EscapedName;
- m_escapeChars.push_back(m_realPatternPos);
- }
- bool TestSpecParser::isControlChar( char c ) const {
- switch( m_mode ) {
- default:
- return false;
- case None:
- return c == '~';
- case Name:
- return c == '[';
- case EscapedName:
- return true;
- case QuotedName:
- return c == '"';
- case Tag:
- return c == '[' || c == ']';
- }
- }
-
- void TestSpecParser::addFilter() {
- if( !m_currentFilter.m_patterns.empty() ) {
- m_testSpec.m_filters.push_back( m_currentFilter );
- m_currentFilter = TestSpec::Filter();
- }
- }
-
- void TestSpecParser::saveLastMode() {
- lastMode = m_mode;
- }
-
- void TestSpecParser::revertBackToLastMode() {
- m_mode = lastMode;
- }
-
- bool TestSpecParser::separate() {
- if( (m_mode==QuotedName) || (m_mode==Tag) ){
- //invalid argument, signal failure to previous scope.
- m_mode = None;
- m_pos = m_arg.size();
- m_substring.clear();
- m_patternName.clear();
- return false;
- }
- endMode();
- addFilter();
- return true; //success
- }
-
- std::string TestSpecParser::preprocessPattern() {
- std::string token = m_patternName;
- for (std::size_t i = 0; i < m_escapeChars.size(); ++i)
- token = token.substr(0, m_escapeChars[i] - i) + token.substr(m_escapeChars[i] - i + 1);
- m_escapeChars.clear();
- if (startsWith(token, "exclude:")) {
- m_exclusion = true;
- token = token.substr(8);
- }
-
- m_patternName.clear();
-
- return token;
- }
-
- void TestSpecParser::addNamePattern() {
- auto token = preprocessPattern();
-
- if (!token.empty()) {
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::NamePattern>(token, m_substring);
- if (m_exclusion)
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- m_currentFilter.m_patterns.push_back(pattern);
- }
- m_substring.clear();
- m_exclusion = false;
- m_mode = None;
- }
-
- void TestSpecParser::addTagPattern() {
- auto token = preprocessPattern();
-
- if (!token.empty()) {
- // If the tag pattern is the "hide and tag" shorthand (e.g. [.foo])
- // we have to create a separate hide tag and shorten the real one
- if (token.size() > 1 && token[0] == '.') {
- token.erase(token.begin());
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(".", m_substring);
- if (m_exclusion) {
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- }
- m_currentFilter.m_patterns.push_back(pattern);
- }
-
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(token, m_substring);
-
- if (m_exclusion) {
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- }
- m_currentFilter.m_patterns.push_back(pattern);
- }
- m_substring.clear();
- m_exclusion = false;
- m_mode = None;
- }
-
- TestSpec parseTestSpec( std::string const& arg ) {
- return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec();
- }
-
-} // namespace Catch
diff --git a/include/internal/catch_test_spec_parser.h b/include/internal/catch_test_spec_parser.h
deleted file mode 100644
index 250d7c16..00000000
--- a/include/internal/catch_test_spec_parser.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Created by Phil on 15/5/2013.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-#include "catch_test_spec.h"
-#include "catch_string_manip.h"
-#include "catch_interfaces_tag_alias_registry.h"
-
-namespace Catch {
-
- class TestSpecParser {
- enum Mode{ None, Name, QuotedName, Tag, EscapedName };
- Mode m_mode = None;
- Mode lastMode = None;
- bool m_exclusion = false;
- std::size_t m_pos = 0;
- std::size_t m_realPatternPos = 0;
- std::string m_arg;
- std::string m_substring;
- std::string m_patternName;
- std::vector<std::size_t> m_escapeChars;
- TestSpec::Filter m_currentFilter;
- TestSpec m_testSpec;
- ITagAliasRegistry const* m_tagAliases = nullptr;
-
- public:
- TestSpecParser( ITagAliasRegistry const& tagAliases );
-
- TestSpecParser& parse( std::string const& arg );
- TestSpec testSpec();
-
- private:
- bool visitChar( char c );
- void startNewMode( Mode mode );
- bool processNoneChar( char c );
- void processNameChar( char c );
- bool processOtherChar( char c );
- void endMode();
- void escape();
- bool isControlChar( char c ) const;
- void saveLastMode();
- void revertBackToLastMode();
- void addFilter();
- bool separate();
-
- // Handles common preprocessing of the pattern for name/tag patterns
- std::string preprocessPattern();
- // Adds the current pattern as a test name
- void addNamePattern();
- // Adds the current pattern as a tag
- void addTagPattern();
-
- inline void addCharToPattern(char c) {
- m_substring += c;
- m_patternName += c;
- m_realPatternPos++;
- }
-
- };
- TestSpec parseTestSpec( std::string const& arg );
-
-} // namespace Catch
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED \ No newline at end of file
diff --git a/include/internal/catch_text.h b/include/internal/catch_text.h
deleted file mode 100644
index eeafe8e2..00000000
--- a/include/internal/catch_text.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Created by Phil on 10/2/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TEXT_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED
-
-#include "catch_clara.h"
-
-namespace Catch {
- using namespace clara::TextFlow;
-}
-
-#endif // TWOBLUECUBES_CATCH_TEXT_H_INCLUDED
diff --git a/include/internal/catch_timer.cpp b/include/internal/catch_timer.cpp
deleted file mode 100644
index ca383a2d..00000000
--- a/include/internal/catch_timer.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Created by Phil on 05/08/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_timer.h"
-
-#include <chrono>
-
-static const uint64_t nanosecondsInSecond = 1000000000;
-
-namespace Catch {
-
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
- return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
- }
-
- namespace {
- auto estimateClockResolution() -> uint64_t {
- uint64_t sum = 0;
- static const uint64_t iterations = 1000000;
-
- auto startTime = getCurrentNanosecondsSinceEpoch();
-
- for( std::size_t i = 0; i < iterations; ++i ) {
-
- uint64_t ticks;
- uint64_t baseTicks = getCurrentNanosecondsSinceEpoch();
- do {
- ticks = getCurrentNanosecondsSinceEpoch();
- } while( ticks == baseTicks );
-
- auto delta = ticks - baseTicks;
- sum += delta;
-
- // If we have been calibrating for over 3 seconds -- the clock
- // is terrible and we should move on.
- // TBD: How to signal that the measured resolution is probably wrong?
- if (ticks > startTime + 3 * nanosecondsInSecond) {
- return sum / ( i + 1u );
- }
- }
-
- // We're just taking the mean, here. To do better we could take the std. dev and exclude outliers
- // - and potentially do more iterations if there's a high variance.
- return sum/iterations;
- }
- }
- auto getEstimatedClockResolution() -> uint64_t {
- static auto s_resolution = estimateClockResolution();
- return s_resolution;
- }
-
- void Timer::start() {
- m_nanoseconds = getCurrentNanosecondsSinceEpoch();
- }
- auto Timer::getElapsedNanoseconds() const -> uint64_t {
- return getCurrentNanosecondsSinceEpoch() - m_nanoseconds;
- }
- auto Timer::getElapsedMicroseconds() const -> uint64_t {
- return getElapsedNanoseconds()/1000;
- }
- auto Timer::getElapsedMilliseconds() const -> unsigned int {
- return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
- }
- auto Timer::getElapsedSeconds() const -> double {
- return getElapsedMicroseconds()/1000000.0;
- }
-
-
-} // namespace Catch
diff --git a/include/internal/catch_timer.h b/include/internal/catch_timer.h
deleted file mode 100644
index 74ab428e..00000000
--- a/include/internal/catch_timer.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Created by Phil on 05/08/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TIMER_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED
-
-#include <cstdint>
-
-namespace Catch {
-
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t;
- auto getEstimatedClockResolution() -> uint64_t;
-
- class Timer {
- uint64_t m_nanoseconds = 0;
- public:
- void start();
- auto getElapsedNanoseconds() const -> uint64_t;
- auto getElapsedMicroseconds() const -> uint64_t;
- auto getElapsedMilliseconds() const -> unsigned int;
- auto getElapsedSeconds() const -> double;
- };
-
-} // namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_TIMER_H_INCLUDED
diff --git a/include/internal/catch_to_string.hpp b/include/internal/catch_to_string.hpp
deleted file mode 100644
index 3e2b5879..00000000
--- a/include/internal/catch_to_string.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Created by Martin on 9/5/2018.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TO_STRING_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TO_STRING_H_INCLUDED
-
-#include <string>
-
-#include "catch_compiler_capabilities.h"
-#include "catch_stream.h"
-
-namespace Catch {
- template <typename T>
- std::string to_string(T const& t) {
-#if defined(CATCH_CONFIG_CPP11_TO_STRING)
- return std::to_string(t);
-#else
- ReusableStringStream rss;
- rss << t;
- return rss.str();
-#endif
- }
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_TO_STRING_H_INCLUDED
diff --git a/include/internal/catch_tostring.cpp b/include/internal/catch_tostring.cpp
deleted file mode 100644
index a289c341..00000000
--- a/include/internal/catch_tostring.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Created by Phil on 23/4/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-# pragma clang diagnostic ignored "-Wglobal-constructors"
-#endif
-
-// Enable specific decls locally
-#if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-#endif
-
-#include "catch_tostring.h"
-#include "catch_interfaces_config.h"
-#include "catch_context.h"
-#include "catch_polyfills.hpp"
-
-#include <cmath>
-#include <iomanip>
-
-namespace Catch {
-
-namespace Detail {
-
- const std::string unprintableString = "{?}";
-
- namespace {
- const int hexThreshold = 255;
-
- struct Endianness {
- enum Arch { Big, Little };
-
- static Arch which() {
- int one = 1;
- // If the lowest byte we read is non-zero, we can assume
- // that little endian format is used.
- auto value = *reinterpret_cast<char*>(&one);
- return value ? Little : Big;
- }
- };
- }
-
- std::string rawMemoryToString( const void *object, std::size_t size ) {
- // Reverse order for little endian architectures
- int i = 0, end = static_cast<int>( size ), inc = 1;
- if( Endianness::which() == Endianness::Little ) {
- i = end-1;
- end = inc = -1;
- }
-
- unsigned char const *bytes = static_cast<unsigned char const *>(object);
- ReusableStringStream rss;
- rss << "0x" << std::setfill('0') << std::hex;
- for( ; i != end; i += inc )
- rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
- return rss.str();
- }
-}
-
-
-template<typename T>
-std::string fpToString( T value, int precision ) {
- if (Catch::isnan(value)) {
- return "nan";
- }
-
- ReusableStringStream rss;
- rss << std::setprecision( precision )
- << std::fixed
- << value;
- std::string d = rss.str();
- std::size_t i = d.find_last_not_of( '0' );
- if( i != std::string::npos && i != d.size()-1 ) {
- if( d[i] == '.' )
- i++;
- d = d.substr( 0, i+1 );
- }
- return d;
-}
-
-
-//// ======================================================= ////
-//
-// Out-of-line defs for full specialization of StringMaker
-//
-//// ======================================================= ////
-
-std::string StringMaker<std::string>::convert(const std::string& str) {
- if (!getCurrentContext().getConfig()->showInvisibles()) {
- return '"' + str + '"';
- }
-
- std::string s("\"");
- for (char c : str) {
- switch (c) {
- case '\n':
- s.append("\\n");
- break;
- case '\t':
- s.append("\\t");
- break;
- default:
- s.push_back(c);
- break;
- }
- }
- s.append("\"");
- return s;
-}
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-std::string StringMaker<std::string_view>::convert(std::string_view str) {
- return ::Catch::Detail::stringify(std::string{ str });
-}
-#endif
-
-std::string StringMaker<char const*>::convert(char const* str) {
- if (str) {
- return ::Catch::Detail::stringify(std::string{ str });
- } else {
- return{ "{null string}" };
- }
-}
-std::string StringMaker<char*>::convert(char* str) {
- if (str) {
- return ::Catch::Detail::stringify(std::string{ str });
- } else {
- return{ "{null string}" };
- }
-}
-
-#ifdef CATCH_CONFIG_WCHAR
-std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
- std::string s;
- s.reserve(wstr.size());
- for (auto c : wstr) {
- s += (c <= 0xff) ? static_cast<char>(c) : '?';
- }
- return ::Catch::Detail::stringify(s);
-}
-
-# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-std::string StringMaker<std::wstring_view>::convert(std::wstring_view str) {
- return StringMaker<std::wstring>::convert(std::wstring(str));
-}
-# endif
-
-std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
- if (str) {
- return ::Catch::Detail::stringify(std::wstring{ str });
- } else {
- return{ "{null string}" };
- }
-}
-std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
- if (str) {
- return ::Catch::Detail::stringify(std::wstring{ str });
- } else {
- return{ "{null string}" };
- }
-}
-#endif
-
-#if defined(CATCH_CONFIG_CPP17_BYTE)
-#include <cstddef>
-std::string StringMaker<std::byte>::convert(std::byte value) {
- return ::Catch::Detail::stringify(std::to_integer<unsigned long long>(value));
-}
-#endif // defined(CATCH_CONFIG_CPP17_BYTE)
-
-std::string StringMaker<int>::convert(int value) {
- return ::Catch::Detail::stringify(static_cast<long long>(value));
-}
-std::string StringMaker<long>::convert(long value) {
- return ::Catch::Detail::stringify(static_cast<long long>(value));
-}
-std::string StringMaker<long long>::convert(long long value) {
- ReusableStringStream rss;
- rss << value;
- if (value > Detail::hexThreshold) {
- rss << " (0x" << std::hex << value << ')';
- }
- return rss.str();
-}
-
-std::string StringMaker<unsigned int>::convert(unsigned int value) {
- return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
-}
-std::string StringMaker<unsigned long>::convert(unsigned long value) {
- return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
-}
-std::string StringMaker<unsigned long long>::convert(unsigned long long value) {
- ReusableStringStream rss;
- rss << value;
- if (value > Detail::hexThreshold) {
- rss << " (0x" << std::hex << value << ')';
- }
- return rss.str();
-}
-
-
-std::string StringMaker<bool>::convert(bool b) {
- return b ? "true" : "false";
-}
-
-std::string StringMaker<signed char>::convert(signed char value) {
- if (value == '\r') {
- return "'\\r'";
- } else if (value == '\f') {
- return "'\\f'";
- } else if (value == '\n') {
- return "'\\n'";
- } else if (value == '\t') {
- return "'\\t'";
- } else if ('\0' <= value && value < ' ') {
- return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
- } else {
- char chstr[] = "' '";
- chstr[1] = value;
- return chstr;
- }
-}
-std::string StringMaker<char>::convert(char c) {
- return ::Catch::Detail::stringify(static_cast<signed char>(c));
-}
-std::string StringMaker<unsigned char>::convert(unsigned char c) {
- return ::Catch::Detail::stringify(static_cast<char>(c));
-}
-
-std::string StringMaker<std::nullptr_t>::convert(std::nullptr_t) {
- return "nullptr";
-}
-
-int StringMaker<float>::precision = 5;
-
-std::string StringMaker<float>::convert(float value) {
- return fpToString(value, precision) + 'f';
-}
-
-int StringMaker<double>::precision = 10;
-
-std::string StringMaker<double>::convert(double value) {
- return fpToString(value, precision);
-}
-
-std::string ratio_string<std::atto>::symbol() { return "a"; }
-std::string ratio_string<std::femto>::symbol() { return "f"; }
-std::string ratio_string<std::pico>::symbol() { return "p"; }
-std::string ratio_string<std::nano>::symbol() { return "n"; }
-std::string ratio_string<std::micro>::symbol() { return "u"; }
-std::string ratio_string<std::milli>::symbol() { return "m"; }
-
-} // end namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-
diff --git a/include/internal/catch_tostring.h b/include/internal/catch_tostring.h
deleted file mode 100644
index 640fc8cb..00000000
--- a/include/internal/catch_tostring.h
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- * Created by Phil on 8/5/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
-#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
-
-
-#include <vector>
-#include <cstddef>
-#include <type_traits>
-#include <string>
-#include "catch_compiler_capabilities.h"
-#include "catch_stream.h"
-#include "catch_interfaces_enum_values_registry.h"
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-#include <string_view>
-#endif
-
-#ifdef __OBJC__
-#include "catch_objc_arc.hpp"
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
-#endif
-
-namespace Catch {
- namespace Detail {
-
- extern const std::string unprintableString;
-
- std::string rawMemoryToString( const void *object, std::size_t size );
-
- template<typename T>
- std::string rawMemoryToString( const T& object ) {
- return rawMemoryToString( &object, sizeof(object) );
- }
-
- template<typename T>
- class IsStreamInsertable {
- template<typename Stream, typename U>
- static auto test(int)
- -> decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type());
-
- template<typename, typename>
- static auto test(...)->std::false_type;
-
- public:
- static const bool value = decltype(test<std::ostream, const T&>(0))::value;
- };
-
- template<typename E>
- std::string convertUnknownEnumToString( E e );
-
- template<typename T>
- typename std::enable_if<
- !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value,
- std::string>::type convertUnstreamable( T const& ) {
- return Detail::unprintableString;
- }
- template<typename T>
- typename std::enable_if<
- !std::is_enum<T>::value && std::is_base_of<std::exception, T>::value,
- std::string>::type convertUnstreamable(T const& ex) {
- return ex.what();
- }
-
-
- template<typename T>
- typename std::enable_if<
- std::is_enum<T>::value
- , std::string>::type convertUnstreamable( T const& value ) {
- return convertUnknownEnumToString( value );
- }
-
-#if defined(_MANAGED)
- //! Convert a CLR string to a utf8 std::string
- template<typename T>
- std::string clrReferenceToString( T^ ref ) {
- if (ref == nullptr)
- return std::string("null");
- auto bytes = System::Text::Encoding::UTF8->GetBytes(ref->ToString());
- cli::pin_ptr<System::Byte> p = &bytes[0];
- return std::string(reinterpret_cast<char const *>(p), bytes->Length);
- }
-#endif
-
- } // namespace Detail
-
-
- // If we decide for C++14, change these to enable_if_ts
- template <typename T, typename = void>
- struct StringMaker {
- template <typename Fake = T>
- static
- typename std::enable_if<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
- convert(const Fake& value) {
- ReusableStringStream rss;
- // NB: call using the function-like syntax to avoid ambiguity with
- // user-defined templated operator<< under clang.
- rss.operator<<(value);
- return rss.str();
- }
-
- template <typename Fake = T>
- static
- typename std::enable_if<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
- convert( const Fake& value ) {
-#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
- return Detail::convertUnstreamable(value);
-#else
- return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
-#endif
- }
- };
-
- namespace Detail {
-
- // This function dispatches all stringification requests inside of Catch.
- // Should be preferably called fully qualified, like ::Catch::Detail::stringify
- template <typename T>
- std::string stringify(const T& e) {
- return ::Catch::StringMaker<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::convert(e);
- }
-
- template<typename E>
- std::string convertUnknownEnumToString( E e ) {
- return ::Catch::Detail::stringify(static_cast<typename std::underlying_type<E>::type>(e));
- }
-
-#if defined(_MANAGED)
- template <typename T>
- std::string stringify( T^ e ) {
- return ::Catch::StringMaker<T^>::convert(e);
- }
-#endif
-
- } // namespace Detail
-
- // Some predefined specializations
-
- template<>
- struct StringMaker<std::string> {
- static std::string convert(const std::string& str);
- };
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
- template<>
- struct StringMaker<std::string_view> {
- static std::string convert(std::string_view str);
- };
-#endif
-
- template<>
- struct StringMaker<char const *> {
- static std::string convert(char const * str);
- };
- template<>
- struct StringMaker<char *> {
- static std::string convert(char * str);
- };
-
-#ifdef CATCH_CONFIG_WCHAR
- template<>
- struct StringMaker<std::wstring> {
- static std::string convert(const std::wstring& wstr);
- };
-
-# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
- template<>
- struct StringMaker<std::wstring_view> {
- static std::string convert(std::wstring_view str);
- };
-# endif
-
- template<>
- struct StringMaker<wchar_t const *> {
- static std::string convert(wchar_t const * str);
- };
- template<>
- struct StringMaker<wchar_t *> {
- static std::string convert(wchar_t * str);
- };
-#endif
-
- // TBD: Should we use `strnlen` to ensure that we don't go out of the buffer,
- // while keeping string semantics?
- template<int SZ>
- struct StringMaker<char[SZ]> {
- static std::string convert(char const* str) {
- return ::Catch::Detail::stringify(std::string{ str });
- }
- };
- template<int SZ>
- struct StringMaker<signed char[SZ]> {
- static std::string convert(signed char const* str) {
- return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) });
- }
- };
- template<int SZ>
- struct StringMaker<unsigned char[SZ]> {
- static std::string convert(unsigned char const* str) {
- return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) });
- }
- };
-
-#if defined(CATCH_CONFIG_CPP17_BYTE)
- template<>
- struct StringMaker<std::byte> {
- static std::string convert(std::byte value);
- };
-#endif // defined(CATCH_CONFIG_CPP17_BYTE)
- template<>
- struct StringMaker<int> {
- static std::string convert(int value);
- };
- template<>
- struct StringMaker<long> {
- static std::string convert(long value);
- };
- template<>
- struct StringMaker<long long> {
- static std::string convert(long long value);
- };
- template<>
- struct StringMaker<unsigned int> {
- static std::string convert(unsigned int value);
- };
- template<>
- struct StringMaker<unsigned long> {
- static std::string convert(unsigned long value);
- };
- template<>
- struct StringMaker<unsigned long long> {
- static std::string convert(unsigned long long value);
- };
-
- template<>
- struct StringMaker<bool> {
- static std::string convert(bool b);
- };
-
- template<>
- struct StringMaker<char> {
- static std::string convert(char c);
- };
- template<>
- struct StringMaker<signed char> {
- static std::string convert(signed char c);
- };
- template<>
- struct StringMaker<unsigned char> {
- static std::string convert(unsigned char c);
- };
-
- template<>
- struct StringMaker<std::nullptr_t> {
- static std::string convert(std::nullptr_t);
- };
-
- template<>
- struct StringMaker<float> {
- static std::string convert(float value);
- static int precision;
- };
-
- template<>
- struct StringMaker<double> {
- static std::string convert(double value);
- static int precision;
- };
-
- template <typename T>
- struct StringMaker<T*> {
- template <typename U>
- static std::string convert(U* p) {
- if (p) {
- return ::Catch::Detail::rawMemoryToString(p);
- } else {
- return "nullptr";
- }
- }
- };
-
- template <typename R, typename C>
- struct StringMaker<R C::*> {
- static std::string convert(R C::* p) {
- if (p) {
- return ::Catch::Detail::rawMemoryToString(p);
- } else {
- return "nullptr";
- }
- }
- };
-
-#if defined(_MANAGED)
- template <typename T>
- struct StringMaker<T^> {
- static std::string convert( T^ ref ) {
- return ::Catch::Detail::clrReferenceToString(ref);
- }
- };
-#endif
-
- namespace Detail {
- template<typename InputIterator>
- std::string rangeToString(InputIterator first, InputIterator last) {
- ReusableStringStream rss;
- rss << "{ ";
- if (first != last) {
- rss << ::Catch::Detail::stringify(*first);
- for (++first; first != last; ++first)
- rss << ", " << ::Catch::Detail::stringify(*first);
- }
- rss << " }";
- return rss.str();
- }
- }
-
-#ifdef __OBJC__
- template<>
- struct StringMaker<NSString*> {
- static std::string convert(NSString * nsstring) {
- if (!nsstring)
- return "nil";
- return std::string("@") + [nsstring UTF8String];
- }
- };
- template<>
- struct StringMaker<NSObject*> {
- static std::string convert(NSObject* nsObject) {
- return ::Catch::Detail::stringify([nsObject description]);
- }
-
- };
- namespace Detail {
- inline std::string stringify( NSString* nsstring ) {
- return StringMaker<NSString*>::convert( nsstring );
- }
-
- } // namespace Detail
-#endif // __OBJC__
-
-} // namespace Catch
-
-//////////////////////////////////////////////////////
-// Separate std-lib types stringification, so it can be selectively enabled
-// This means that we do not bring in
-
-#if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS)
-# define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-#endif
-
-// Separate std::pair specialization
-#if defined(CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER)
-#include <utility>
-namespace Catch {
- template<typename T1, typename T2>
- struct StringMaker<std::pair<T1, T2> > {
- static std::string convert(const std::pair<T1, T2>& pair) {
- ReusableStringStream rss;
- rss << "{ "
- << ::Catch::Detail::stringify(pair.first)
- << ", "
- << ::Catch::Detail::stringify(pair.second)
- << " }";
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-
-#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
-#include <optional>
-namespace Catch {
- template<typename T>
- struct StringMaker<std::optional<T> > {
- static std::string convert(const std::optional<T>& optional) {
- ReusableStringStream rss;
- if (optional.has_value()) {
- rss << ::Catch::Detail::stringify(*optional);
- } else {
- rss << "{ }";
- }
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-
-// Separate std::tuple specialization
-#if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER)
-#include <tuple>
-namespace Catch {
- namespace Detail {
- template<
- typename Tuple,
- std::size_t N = 0,
- bool = (N < std::tuple_size<Tuple>::value)
- >
- struct TupleElementPrinter {
- static void print(const Tuple& tuple, std::ostream& os) {
- os << (N ? ", " : " ")
- << ::Catch::Detail::stringify(std::get<N>(tuple));
- TupleElementPrinter<Tuple, N + 1>::print(tuple, os);
- }
- };
-
- template<
- typename Tuple,
- std::size_t N
- >
- struct TupleElementPrinter<Tuple, N, false> {
- static void print(const Tuple&, std::ostream&) {}
- };
-
- }
-
-
- template<typename ...Types>
- struct StringMaker<std::tuple<Types...>> {
- static std::string convert(const std::tuple<Types...>& tuple) {
- ReusableStringStream rss;
- rss << '{';
- Detail::TupleElementPrinter<std::tuple<Types...>>::print(tuple, rss.get());
- rss << " }";
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-
-#if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_VARIANT)
-#include <variant>
-namespace Catch {
- template<>
- struct StringMaker<std::monostate> {
- static std::string convert(const std::monostate&) {
- return "{ }";
- }
- };
-
- template<typename... Elements>
- struct StringMaker<std::variant<Elements...>> {
- static std::string convert(const std::variant<Elements...>& variant) {
- if (variant.valueless_by_exception()) {
- return "{valueless variant}";
- } else {
- return std::visit(
- [](const auto& value) {
- return ::Catch::Detail::stringify(value);
- },
- variant
- );
- }
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-
-namespace Catch {
- struct not_this_one {}; // Tag type for detecting which begin/ end are being selected
-
- // Import begin/ end from std here so they are considered alongside the fallback (...) overloads in this namespace
- using std::begin;
- using std::end;
-
- not_this_one begin( ... );
- not_this_one end( ... );
-
- template <typename T>
- struct is_range {
- static const bool value =
- !std::is_same<decltype(begin(std::declval<T>())), not_this_one>::value &&
- !std::is_same<decltype(end(std::declval<T>())), not_this_one>::value;
- };
-
-#if defined(_MANAGED) // Managed types are never ranges
- template <typename T>
- struct is_range<T^> {
- static const bool value = false;
- };
-#endif
-
- template<typename Range>
- std::string rangeToString( Range const& range ) {
- return ::Catch::Detail::rangeToString( begin( range ), end( range ) );
- }
-
- // Handle vector<bool> specially
- template<typename Allocator>
- std::string rangeToString( std::vector<bool, Allocator> const& v ) {
- ReusableStringStream rss;
- rss << "{ ";
- bool first = true;
- for( bool b : v ) {
- if( first )
- first = false;
- else
- rss << ", ";
- rss << ::Catch::Detail::stringify( b );
- }
- rss << " }";
- return rss.str();
- }
-
- template<typename R>
- struct StringMaker<R, typename std::enable_if<is_range<R>::value && !::Catch::Detail::IsStreamInsertable<R>::value>::type> {
- static std::string convert( R const& range ) {
- return rangeToString( range );
- }
- };
-
- template <typename T, int SZ>
- struct StringMaker<T[SZ]> {
- static std::string convert(T const(&arr)[SZ]) {
- return rangeToString(arr);
- }
- };
-
-
-} // namespace Catch
-
-// Separate std::chrono::duration specialization
-#if defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-#include <ctime>
-#include <ratio>
-#include <chrono>
-
-
-namespace Catch {
-
-template <class Ratio>
-struct ratio_string {
- static std::string symbol();
-};
-
-template <class Ratio>
-std::string ratio_string<Ratio>::symbol() {
- Catch::ReusableStringStream rss;
- rss << '[' << Ratio::num << '/'
- << Ratio::den << ']';
- return rss.str();
-}
-template <>
-struct ratio_string<std::atto> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::femto> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::pico> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::nano> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::micro> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::milli> {
- static std::string symbol();
-};
-
- ////////////
- // std::chrono::duration specializations
- template<typename Value, typename Ratio>
- struct StringMaker<std::chrono::duration<Value, Ratio>> {
- static std::string convert(std::chrono::duration<Value, Ratio> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << ' ' << ratio_string<Ratio>::symbol() << 's';
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<1>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<1>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " s";
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<60>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<60>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " m";
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<3600>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<3600>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " h";
- return rss.str();
- }
- };
-
- ////////////
- // std::chrono::time_point specialization
- // Generic time_point cannot be specialized, only std::chrono::time_point<system_clock>
- template<typename Clock, typename Duration>
- struct StringMaker<std::chrono::time_point<Clock, Duration>> {
- static std::string convert(std::chrono::time_point<Clock, Duration> const& time_point) {
- return ::Catch::Detail::stringify(time_point.time_since_epoch()) + " since epoch";
- }
- };
- // std::chrono::time_point<system_clock> specialization
- template<typename Duration>
- struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>> {
- static std::string convert(std::chrono::time_point<std::chrono::system_clock, Duration> const& time_point) {
- auto converted = std::chrono::system_clock::to_time_t(time_point);
-
-#ifdef _MSC_VER
- std::tm timeInfo = {};
- gmtime_s(&timeInfo, &converted);
-#else
- std::tm* timeInfo = std::gmtime(&converted);
-#endif
-
- auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
- char timeStamp[timeStampSize];
- const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
-
-#ifdef _MSC_VER
- std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
-#else
- std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
-#endif
- return std::string(timeStamp);
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-
-#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
-namespace Catch { \
- template<> struct StringMaker<enumName> { \
- static std::string convert( enumName value ) { \
- static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
- return static_cast<std::string>(enumInfo.lookup( static_cast<int>( value ) )); \
- } \
- }; \
-}
-
-#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#endif // TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
diff --git a/include/internal/catch_totals.cpp b/include/internal/catch_totals.cpp
deleted file mode 100644
index 0391fe82..00000000
--- a/include/internal/catch_totals.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_totals.h"
-
-namespace Catch {
-
- Counts Counts::operator - ( Counts const& other ) const {
- Counts diff;
- diff.passed = passed - other.passed;
- diff.failed = failed - other.failed;
- diff.failedButOk = failedButOk - other.failedButOk;
- return diff;
- }
-
- Counts& Counts::operator += ( Counts const& other ) {
- passed += other.passed;
- failed += other.failed;
- failedButOk += other.failedButOk;
- return *this;
- }
-
- std::size_t Counts::total() const {
- return passed + failed + failedButOk;
- }
- bool Counts::allPassed() const {
- return failed == 0 && failedButOk == 0;
- }
- bool Counts::allOk() const {
- return failed == 0;
- }
-
- Totals Totals::operator - ( Totals const& other ) const {
- Totals diff;
- diff.assertions = assertions - other.assertions;
- diff.testCases = testCases - other.testCases;
- return diff;
- }
-
- Totals& Totals::operator += ( Totals const& other ) {
- assertions += other.assertions;
- testCases += other.testCases;
- return *this;
- }
-
- Totals Totals::delta( Totals const& prevTotals ) const {
- Totals diff = *this - prevTotals;
- if( diff.assertions.failed > 0 )
- ++diff.testCases.failed;
- else if( diff.assertions.failedButOk > 0 )
- ++diff.testCases.failedButOk;
- else
- ++diff.testCases.passed;
- return diff;
- }
-
-}
diff --git a/include/internal/catch_totals.h b/include/internal/catch_totals.h
deleted file mode 100644
index 56927283..00000000
--- a/include/internal/catch_totals.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Created by Phil Nash on 23/02/2012.
- * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED
-
-#include <cstddef>
-
-namespace Catch {
-
- struct Counts {
- Counts operator - ( Counts const& other ) const;
- Counts& operator += ( Counts const& other );
-
- std::size_t total() const;
- bool allPassed() const;
- bool allOk() const;
-
- std::size_t passed = 0;
- std::size_t failed = 0;
- std::size_t failedButOk = 0;
- };
-
- struct Totals {
-
- Totals operator - ( Totals const& other ) const;
- Totals& operator += ( Totals const& other );
-
- Totals delta( Totals const& prevTotals ) const;
-
- int error = 0;
- Counts assertions;
- Counts testCases;
- };
-}
-
-#endif // TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED
diff --git a/include/internal/catch_uncaught_exceptions.cpp b/include/internal/catch_uncaught_exceptions.cpp
deleted file mode 100644
index b990ccd8..00000000
--- a/include/internal/catch_uncaught_exceptions.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Created by Josh on 1/2/2018.
- * Copyright 2018 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_compiler_capabilities.h"
-#include "catch_uncaught_exceptions.h"
-#include <exception>
-
-namespace Catch {
- bool uncaught_exceptions() {
-#if defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
- return std::uncaught_exceptions() > 0;
-#else
- return std::uncaught_exception();
-#endif
- }
-} // end namespace Catch
diff --git a/include/internal/catch_uncaught_exceptions.h b/include/internal/catch_uncaught_exceptions.h
deleted file mode 100644
index c68d680c..00000000
--- a/include/internal/catch_uncaught_exceptions.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Created by Josh on 1/2/2018.
- * Copyright 2018 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_UNCAUGHT_EXCEPTIONS_H_INCLUDED
-#define TWOBLUECUBES_CATCH_UNCAUGHT_EXCEPTIONS_H_INCLUDED
-
-namespace Catch {
- bool uncaught_exceptions();
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_UNCAUGHT_EXCEPTIONS_H_INCLUDED
diff --git a/include/internal/catch_user_interfaces.h b/include/internal/catch_user_interfaces.h
deleted file mode 100644
index 35acb77b..00000000
--- a/include/internal/catch_user_interfaces.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Created by Martin on 21/11/2017.
- *
- * This file collects declaration that we want to expose to test files.
- * These declarations are expected to be duplicated elsewhere,
- * together with their implementation.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_USER_INTERFACES_H_INCLUDED
-#define TWOBLUECUBES_CATCH_USER_INTERFACES_H_INCLUDED
-
-namespace Catch {
- unsigned int rngSeed();
-}
-
-#endif // TWOBLUECUBES_CATCH_USER_INTERFACES_H_INCLUDED
diff --git a/include/internal/catch_version.cpp b/include/internal/catch_version.cpp
deleted file mode 100644
index 143a350e..00000000
--- a/include/internal/catch_version.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Created by Phil on 14/11/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_version.h"
-#include <ostream>
-
-namespace Catch {
-
- Version::Version
- ( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- char const * const _branchName,
- unsigned int _buildNumber )
- : majorVersion( _majorVersion ),
- minorVersion( _minorVersion ),
- patchNumber( _patchNumber ),
- branchName( _branchName ),
- buildNumber( _buildNumber )
- {}
-
- std::ostream& operator << ( std::ostream& os, Version const& version ) {
- os << version.majorVersion << '.'
- << version.minorVersion << '.'
- << version.patchNumber;
- // branchName is never null -> 0th char is \0 if it is empty
- if (version.branchName[0]) {
- os << '-' << version.branchName
- << '.' << version.buildNumber;
- }
- return os;
- }
-
- Version const& libraryVersion() {
- static Version version( 2, 11, 2, "", 0 );
- return version;
- }
-
-}
diff --git a/include/internal/catch_version.h b/include/internal/catch_version.h
deleted file mode 100644
index 018397f4..00000000
--- a/include/internal/catch_version.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Created by Phil on 13/11/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_VERSION_H_INCLUDED
-#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED
-
-#include <iosfwd>
-
-namespace Catch {
-
- // Versioning information
- struct Version {
- Version( Version const& ) = delete;
- Version& operator=( Version const& ) = delete;
- Version( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- char const * const _branchName,
- unsigned int _buildNumber );
-
- unsigned int const majorVersion;
- unsigned int const minorVersion;
- unsigned int const patchNumber;
-
- // buildNumber is only used if branchName is not null
- char const * const branchName;
- unsigned int const buildNumber;
-
- friend std::ostream& operator << ( std::ostream& os, Version const& version );
- };
-
- Version const& libraryVersion();
-}
-
-#endif // TWOBLUECUBES_CATCH_VERSION_H_INCLUDED
diff --git a/include/internal/catch_wildcard_pattern.cpp b/include/internal/catch_wildcard_pattern.cpp
deleted file mode 100644
index 95e5d3f0..00000000
--- a/include/internal/catch_wildcard_pattern.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_wildcard_pattern.h"
-#include "catch_enforce.h"
-#include "catch_string_manip.h"
-
-namespace Catch {
-
- WildcardPattern::WildcardPattern( std::string const& pattern,
- CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_pattern( normaliseString( pattern ) )
- {
- if( startsWith( m_pattern, '*' ) ) {
- m_pattern = m_pattern.substr( 1 );
- m_wildcard = WildcardAtStart;
- }
- if( endsWith( m_pattern, '*' ) ) {
- m_pattern = m_pattern.substr( 0, m_pattern.size()-1 );
- m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
- }
- }
-
- bool WildcardPattern::matches( std::string const& str ) const {
- switch( m_wildcard ) {
- case NoWildcard:
- return m_pattern == normaliseString( str );
- case WildcardAtStart:
- return endsWith( normaliseString( str ), m_pattern );
- case WildcardAtEnd:
- return startsWith( normaliseString( str ), m_pattern );
- case WildcardAtBothEnds:
- return contains( normaliseString( str ), m_pattern );
- default:
- CATCH_INTERNAL_ERROR( "Unknown enum" );
- }
- }
-
- std::string WildcardPattern::normaliseString( std::string const& str ) const {
- return trim( m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str );
- }
-}
diff --git a/include/internal/catch_wildcard_pattern.h b/include/internal/catch_wildcard_pattern.h
deleted file mode 100644
index 5d508f7b..00000000
--- a/include/internal/catch_wildcard_pattern.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Created by Phil on 13/7/2015.
- * Copyright 2015 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_WILDCARD_PATTERN_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_WILDCARD_PATTERN_HPP_INCLUDED
-
-#include "catch_common.h"
-
-
-namespace Catch
-{
- class WildcardPattern {
- enum WildcardPosition {
- NoWildcard = 0,
- WildcardAtStart = 1,
- WildcardAtEnd = 2,
- WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
- };
-
- public:
-
- WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity );
- virtual ~WildcardPattern() = default;
- virtual bool matches( std::string const& str ) const;
-
- private:
- std::string normaliseString( std::string const& str ) const;
- CaseSensitive::Choice m_caseSensitivity;
- WildcardPosition m_wildcard = NoWildcard;
- std::string m_pattern;
- };
-}
-
-#endif // TWOBLUECUBES_CATCH_WILDCARD_PATTERN_HPP_INCLUDED
diff --git a/include/internal/catch_windows_h_proxy.h b/include/internal/catch_windows_h_proxy.h
deleted file mode 100644
index a7a19c8e..00000000
--- a/include/internal/catch_windows_h_proxy.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Created by Martin on 16/01/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
-#define TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
-
-#include "catch_platform.h"
-
-#if defined(CATCH_PLATFORM_WINDOWS)
-
-#if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX)
-# define CATCH_DEFINED_NOMINMAX
-# define NOMINMAX
-#endif
-#if !defined(WIN32_LEAN_AND_MEAN) && !defined(CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN)
-# define CATCH_DEFINED_WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-
-#ifdef __AFXDLL
-#include <AfxWin.h>
-#else
-#include <windows.h>
-#endif
-
-#ifdef CATCH_DEFINED_NOMINMAX
-# undef NOMINMAX
-#endif
-#ifdef CATCH_DEFINED_WIN32_LEAN_AND_MEAN
-# undef WIN32_LEAN_AND_MEAN
-#endif
-
-#endif // defined(CATCH_PLATFORM_WINDOWS)
-
-#endif // TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
diff --git a/include/internal/catch_xmlwriter.cpp b/include/internal/catch_xmlwriter.cpp
deleted file mode 100644
index 30f3b0f1..00000000
--- a/include/internal/catch_xmlwriter.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Created by Phil on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_xmlwriter.h"
-
-#include "catch_enforce.h"
-
-#include <iomanip>
-#include <type_traits>
-
-namespace Catch {
-
-namespace {
-
- size_t trailingBytes(unsigned char c) {
- if ((c & 0xE0) == 0xC0) {
- return 2;
- }
- if ((c & 0xF0) == 0xE0) {
- return 3;
- }
- if ((c & 0xF8) == 0xF0) {
- return 4;
- }
- CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
- }
-
- uint32_t headerValue(unsigned char c) {
- if ((c & 0xE0) == 0xC0) {
- return c & 0x1F;
- }
- if ((c & 0xF0) == 0xE0) {
- return c & 0x0F;
- }
- if ((c & 0xF8) == 0xF0) {
- return c & 0x07;
- }
- CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
- }
-
- void hexEscapeChar(std::ostream& os, unsigned char c) {
- std::ios_base::fmtflags f(os.flags());
- os << "\\x"
- << std::uppercase << std::hex << std::setfill('0') << std::setw(2)
- << static_cast<int>(c);
- os.flags(f);
- }
-
- bool shouldNewline(XmlFormatting fmt) {
- return !!(static_cast<std::underlying_type<XmlFormatting>::type>(fmt & XmlFormatting::Newline));
- }
-
- bool shouldIndent(XmlFormatting fmt) {
- return !!(static_cast<std::underlying_type<XmlFormatting>::type>(fmt & XmlFormatting::Indent));
- }
-
-} // anonymous namespace
-
- XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) {
- return static_cast<XmlFormatting>(
- static_cast<std::underlying_type<XmlFormatting>::type>(lhs) |
- static_cast<std::underlying_type<XmlFormatting>::type>(rhs)
- );
- }
-
- XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) {
- return static_cast<XmlFormatting>(
- static_cast<std::underlying_type<XmlFormatting>::type>(lhs) &
- static_cast<std::underlying_type<XmlFormatting>::type>(rhs)
- );
- }
-
-
- XmlEncode::XmlEncode( std::string const& str, ForWhat forWhat )
- : m_str( str ),
- m_forWhat( forWhat )
- {}
-
- void XmlEncode::encodeTo( std::ostream& os ) const {
- // Apostrophe escaping not necessary if we always use " to write attributes
- // (see: http://www.w3.org/TR/xml/#syntax)
-
- for( std::size_t idx = 0; idx < m_str.size(); ++ idx ) {
- unsigned char c = m_str[idx];
- switch (c) {
- case '<': os << "&lt;"; break;
- case '&': os << "&amp;"; break;
-
- case '>':
- // See: http://www.w3.org/TR/xml/#syntax
- if (idx > 2 && m_str[idx - 1] == ']' && m_str[idx - 2] == ']')
- os << "&gt;";
- else
- os << c;
- break;
-
- case '\"':
- if (m_forWhat == ForAttributes)
- os << "&quot;";
- else
- os << c;
- break;
-
- default:
- // Check for control characters and invalid utf-8
-
- // Escape control characters in standard ascii
- // see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0
- if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 0x7F) {
- hexEscapeChar(os, c);
- break;
- }
-
- // Plain ASCII: Write it to stream
- if (c < 0x7F) {
- os << c;
- break;
- }
-
- // UTF-8 territory
- // Check if the encoding is valid and if it is not, hex escape bytes.
- // Important: We do not check the exact decoded values for validity, only the encoding format
- // First check that this bytes is a valid lead byte:
- // This means that it is not encoded as 1111 1XXX
- // Or as 10XX XXXX
- if (c < 0xC0 ||
- c >= 0xF8) {
- hexEscapeChar(os, c);
- break;
- }
-
- auto encBytes = trailingBytes(c);
- // Are there enough bytes left to avoid accessing out-of-bounds memory?
- if (idx + encBytes - 1 >= m_str.size()) {
- hexEscapeChar(os, c);
- break;
- }
- // The header is valid, check data
- // The next encBytes bytes must together be a valid utf-8
- // This means: bitpattern 10XX XXXX and the extracted value is sane (ish)
- bool valid = true;
- uint32_t value = headerValue(c);
- for (std::size_t n = 1; n < encBytes; ++n) {
- unsigned char nc = m_str[idx + n];
- valid &= ((nc & 0xC0) == 0x80);
- value = (value << 6) | (nc & 0x3F);
- }
-
- if (
- // Wrong bit pattern of following bytes
- (!valid) ||
- // Overlong encodings
- (value < 0x80) ||
- (0x80 <= value && value < 0x800 && encBytes > 2) ||
- (0x800 < value && value < 0x10000 && encBytes > 3) ||
- // Encoded value out of range
- (value >= 0x110000)
- ) {
- hexEscapeChar(os, c);
- break;
- }
-
- // If we got here, this is in fact a valid(ish) utf-8 sequence
- for (std::size_t n = 0; n < encBytes; ++n) {
- os << m_str[idx + n];
- }
- idx += encBytes - 1;
- break;
- }
- }
- }
-
- std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) {
- xmlEncode.encodeTo( os );
- return os;
- }
-
- XmlWriter::ScopedElement::ScopedElement( XmlWriter* writer, XmlFormatting fmt )
- : m_writer( writer ),
- m_fmt(fmt)
- {}
-
- XmlWriter::ScopedElement::ScopedElement( ScopedElement&& other ) noexcept
- : m_writer( other.m_writer ),
- m_fmt(other.m_fmt)
- {
- other.m_writer = nullptr;
- other.m_fmt = XmlFormatting::None;
- }
- XmlWriter::ScopedElement& XmlWriter::ScopedElement::operator=( ScopedElement&& other ) noexcept {
- if ( m_writer ) {
- m_writer->endElement();
- }
- m_writer = other.m_writer;
- other.m_writer = nullptr;
- m_fmt = other.m_fmt;
- other.m_fmt = XmlFormatting::None;
- return *this;
- }
-
-
- XmlWriter::ScopedElement::~ScopedElement() {
- if (m_writer) {
- m_writer->endElement(m_fmt);
- }
- }
-
- XmlWriter::ScopedElement& XmlWriter::ScopedElement::writeText( std::string const& text, XmlFormatting fmt ) {
- m_writer->writeText( text, fmt );
- return *this;
- }
-
- XmlWriter::XmlWriter( std::ostream& os ) : m_os( os )
- {
- writeDeclaration();
- }
-
- XmlWriter::~XmlWriter() {
- while (!m_tags.empty()) {
- endElement();
- }
- newlineIfNecessary();
- }
-
- XmlWriter& XmlWriter::startElement( std::string const& name, XmlFormatting fmt ) {
- ensureTagClosed();
- newlineIfNecessary();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- m_indent += " ";
- }
- m_os << '<' << name;
- m_tags.push_back( name );
- m_tagIsOpen = true;
- applyFormatting(fmt);
- return *this;
- }
-
- XmlWriter::ScopedElement XmlWriter::scopedElement( std::string const& name, XmlFormatting fmt ) {
- ScopedElement scoped( this, fmt );
- startElement( name, fmt );
- return scoped;
- }
-
- XmlWriter& XmlWriter::endElement(XmlFormatting fmt) {
- m_indent = m_indent.substr(0, m_indent.size() - 2);
-
- if( m_tagIsOpen ) {
- m_os << "/>";
- m_tagIsOpen = false;
- } else {
- newlineIfNecessary();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << "</" << m_tags.back() << ">";
- }
- m_os << std::flush;
- applyFormatting(fmt);
- m_tags.pop_back();
- return *this;
- }
-
- XmlWriter& XmlWriter::writeAttribute( std::string const& name, std::string const& attribute ) {
- if( !name.empty() && !attribute.empty() )
- m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"';
- return *this;
- }
-
- XmlWriter& XmlWriter::writeAttribute( std::string const& name, bool attribute ) {
- m_os << ' ' << name << "=\"" << ( attribute ? "true" : "false" ) << '"';
- return *this;
- }
-
- XmlWriter& XmlWriter::writeText( std::string const& text, XmlFormatting fmt) {
- if( !text.empty() ){
- bool tagWasOpen = m_tagIsOpen;
- ensureTagClosed();
- if (tagWasOpen && shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << XmlEncode( text );
- applyFormatting(fmt);
- }
- return *this;
- }
-
- XmlWriter& XmlWriter::writeComment( std::string const& text, XmlFormatting fmt) {
- ensureTagClosed();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << "<!--" << text << "-->";
- applyFormatting(fmt);
- return *this;
- }
-
- void XmlWriter::writeStylesheetRef( std::string const& url ) {
- m_os << "<?xml-stylesheet type=\"text/xsl\" href=\"" << url << "\"?>\n";
- }
-
- XmlWriter& XmlWriter::writeBlankLine() {
- ensureTagClosed();
- m_os << '\n';
- return *this;
- }
-
- void XmlWriter::ensureTagClosed() {
- if( m_tagIsOpen ) {
- m_os << '>' << std::flush;
- newlineIfNecessary();
- m_tagIsOpen = false;
- }
- }
-
- void XmlWriter::applyFormatting(XmlFormatting fmt) {
- m_needsNewline = shouldNewline(fmt);
- }
-
- void XmlWriter::writeDeclaration() {
- m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- }
-
- void XmlWriter::newlineIfNecessary() {
- if( m_needsNewline ) {
- m_os << std::endl;
- m_needsNewline = false;
- }
- }
-}
diff --git a/include/internal/catch_xmlwriter.h b/include/internal/catch_xmlwriter.h
deleted file mode 100644
index f551b233..00000000
--- a/include/internal/catch_xmlwriter.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Created by Phil on 09/12/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED
-
-#include "catch_stream.h"
-#include "catch_compiler_capabilities.h"
-
-#include <vector>
-
-namespace Catch {
- enum class XmlFormatting {
- None = 0x00,
- Indent = 0x01,
- Newline = 0x02,
- };
-
- XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs);
- XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs);
-
- class XmlEncode {
- public:
- enum ForWhat { ForTextNodes, ForAttributes };
-
- XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes );
-
- void encodeTo( std::ostream& os ) const;
-
- friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode );
-
- private:
- std::string m_str;
- ForWhat m_forWhat;
- };
-
- class XmlWriter {
- public:
-
- class ScopedElement {
- public:
- ScopedElement( XmlWriter* writer, XmlFormatting fmt );
-
- ScopedElement( ScopedElement&& other ) noexcept;
- ScopedElement& operator=( ScopedElement&& other ) noexcept;
-
- ~ScopedElement();
-
- ScopedElement& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent );
-
- template<typename T>
- ScopedElement& writeAttribute( std::string const& name, T const& attribute ) {
- m_writer->writeAttribute( name, attribute );
- return *this;
- }
-
- private:
- mutable XmlWriter* m_writer = nullptr;
- XmlFormatting m_fmt;
- };
-
- XmlWriter( std::ostream& os = Catch::cout() );
- ~XmlWriter();
-
- XmlWriter( XmlWriter const& ) = delete;
- XmlWriter& operator=( XmlWriter const& ) = delete;
-
- XmlWriter& startElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- ScopedElement scopedElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& endElement(XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& writeAttribute( std::string const& name, std::string const& attribute );
-
- XmlWriter& writeAttribute( std::string const& name, bool attribute );
-
- template<typename T>
- XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
- ReusableStringStream rss;
- rss << attribute;
- return writeAttribute( name, rss.str() );
- }
-
- XmlWriter& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& writeComment(std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- void writeStylesheetRef( std::string const& url );
-
- XmlWriter& writeBlankLine();
-
- void ensureTagClosed();
-
- private:
-
- void applyFormatting(XmlFormatting fmt);
-
- void writeDeclaration();
-
- void newlineIfNecessary();
-
- bool m_tagIsOpen = false;
- bool m_needsNewline = false;
- std::vector<std::string> m_tags;
- std::string m_indent;
- std::ostream& m_os;
- };
-
-}
-
-#endif // TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED
diff --git a/include/reporters/catch_reporter_automake.hpp b/include/reporters/catch_reporter_automake.hpp
deleted file mode 100644
index dbebe975..00000000
--- a/include/reporters/catch_reporter_automake.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Created by Justin R. Wilson on 2/19/2017.
- * Copyright 2017 Justin R. Wilson. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-namespace Catch {
-
- struct AutomakeReporter : StreamingReporterBase<AutomakeReporter> {
- AutomakeReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config )
- {}
-
- ~AutomakeReporter() override;
-
- static std::string getDescription() {
- return "Reports test results in the format of Automake .trs files";
- }
-
- void assertionStarting( AssertionInfo const& ) override {}
-
- bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; }
-
- void testCaseEnded( TestCaseStats const& _testCaseStats ) override {
- // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR.
- stream << ":test-result: ";
- if (_testCaseStats.totals.assertions.allPassed()) {
- stream << "PASS";
- } else if (_testCaseStats.totals.assertions.allOk()) {
- stream << "XFAIL";
- } else {
- stream << "FAIL";
- }
- stream << ' ' << _testCaseStats.testInfo.name << '\n';
- StreamingReporterBase::testCaseEnded( _testCaseStats );
- }
-
- void skipTest( TestCaseInfo const& testInfo ) override {
- stream << ":test-result: SKIP " << testInfo.name << '\n';
- }
-
- };
-
-#ifdef CATCH_IMPL
- AutomakeReporter::~AutomakeReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "automake", AutomakeReporter)
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
diff --git a/include/reporters/catch_reporter_bases.cpp b/include/reporters/catch_reporter_bases.cpp
deleted file mode 100644
index fcbafef5..00000000
--- a/include/reporters/catch_reporter_bases.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Created by Phil on 27/11/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "../internal/catch_interfaces_reporter.h"
-#include "../internal/catch_errno_guard.h"
-#include "catch_reporter_bases.hpp"
-
-#include <cstring>
-#include <cfloat>
-#include <cstdio>
-#include <cassert>
-#include <memory>
-
-namespace Catch {
- void prepareExpandedExpression(AssertionResult& result) {
- result.getExpandedExpression();
- }
-
- // Because formatting using c++ streams is stateful, drop down to C is required
- // Alternatively we could use stringstream, but its performance is... not good.
- std::string getFormattedDuration( double duration ) {
- // Max exponent + 1 is required to represent the whole part
- // + 1 for decimal point
- // + 3 for the 3 decimal places
- // + 1 for null terminator
- const std::size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1;
- char buffer[maxDoubleSize];
-
- // Save previous errno, to prevent sprintf from overwriting it
- ErrnoGuard guard;
-#ifdef _MSC_VER
- sprintf_s(buffer, "%.3f", duration);
-#else
- std::sprintf(buffer, "%.3f", duration);
-#endif
- return std::string(buffer);
- }
-
- std::string serializeFilters( std::vector<std::string> const& container ) {
- ReusableStringStream oss;
- bool first = true;
- for (auto&& filter : container)
- {
- if (!first)
- oss << ' ';
- else
- first = false;
-
- oss << filter;
- }
- return oss.str();
- }
-
- TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config)
- :StreamingReporterBase(_config) {}
-
- std::set<Verbosity> TestEventListenerBase::getSupportedVerbosities() {
- return { Verbosity::Quiet, Verbosity::Normal, Verbosity::High };
- }
-
- void TestEventListenerBase::assertionStarting(AssertionInfo const &) {}
-
- bool TestEventListenerBase::assertionEnded(AssertionStats const &) {
- return false;
- }
-
-
-} // end namespace Catch
diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp
deleted file mode 100644
index 66a891ff..00000000
--- a/include/reporters/catch_reporter_bases.hpp
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Created by Phil on 27/11/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED
-
-#include "../internal/catch_enforce.h"
-#include "../internal/catch_interfaces_reporter.h"
-
-#include <algorithm>
-#include <cstring>
-#include <cfloat>
-#include <cstdio>
-#include <cassert>
-#include <memory>
-#include <ostream>
-
-namespace Catch {
- void prepareExpandedExpression(AssertionResult& result);
-
- // Returns double formatted as %.3f (format expected on output)
- std::string getFormattedDuration( double duration );
-
- std::string serializeFilters( std::vector<std::string> const& container );
-
- template<typename DerivedT>
- struct StreamingReporterBase : IStreamingReporter {
-
- StreamingReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
- CATCH_ERROR( "Verbosity level not supported by this reporter" );
- }
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- ~StreamingReporterBase() override = default;
-
- void noMatchingTestCases(std::string const&) override {}
-
- void reportInvalidArguments(std::string const&) override {}
-
- void testRunStarting(TestRunInfo const& _testRunInfo) override {
- currentTestRunInfo = _testRunInfo;
- }
-
- void testGroupStarting(GroupInfo const& _groupInfo) override {
- currentGroupInfo = _groupInfo;
- }
-
- void testCaseStarting(TestCaseInfo const& _testInfo) override {
- currentTestCaseInfo = _testInfo;
- }
- void sectionStarting(SectionInfo const& _sectionInfo) override {
- m_sectionStack.push_back(_sectionInfo);
- }
-
- void sectionEnded(SectionStats const& /* _sectionStats */) override {
- m_sectionStack.pop_back();
- }
- void testCaseEnded(TestCaseStats const& /* _testCaseStats */) override {
- currentTestCaseInfo.reset();
- }
- void testGroupEnded(TestGroupStats const& /* _testGroupStats */) override {
- currentGroupInfo.reset();
- }
- void testRunEnded(TestRunStats const& /* _testRunStats */) override {
- currentTestCaseInfo.reset();
- currentGroupInfo.reset();
- currentTestRunInfo.reset();
- }
-
- void skipTest(TestCaseInfo const&) override {
- // Don't do anything with this by default.
- // It can optionally be overridden in the derived class.
- }
-
- IConfigPtr m_config;
- std::ostream& stream;
-
- LazyStat<TestRunInfo> currentTestRunInfo;
- LazyStat<GroupInfo> currentGroupInfo;
- LazyStat<TestCaseInfo> currentTestCaseInfo;
-
- std::vector<SectionInfo> m_sectionStack;
- ReporterPreferences m_reporterPrefs;
- };
-
- template<typename DerivedT>
- struct CumulativeReporterBase : IStreamingReporter {
- template<typename T, typename ChildNodeT>
- struct Node {
- explicit Node( T const& _value ) : value( _value ) {}
- virtual ~Node() {}
-
- using ChildNodes = std::vector<std::shared_ptr<ChildNodeT>>;
- T value;
- ChildNodes children;
- };
- struct SectionNode {
- explicit SectionNode(SectionStats const& _stats) : stats(_stats) {}
- virtual ~SectionNode() = default;
-
- bool operator == (SectionNode const& other) const {
- return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
- }
- bool operator == (std::shared_ptr<SectionNode> const& other) const {
- return operator==(*other);
- }
-
- SectionStats stats;
- using ChildSections = std::vector<std::shared_ptr<SectionNode>>;
- using Assertions = std::vector<AssertionStats>;
- ChildSections childSections;
- Assertions assertions;
- std::string stdOut;
- std::string stdErr;
- };
-
- struct BySectionInfo {
- BySectionInfo( SectionInfo const& other ) : m_other( other ) {}
- BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {}
- bool operator() (std::shared_ptr<SectionNode> const& node) const {
- return ((node->stats.sectionInfo.name == m_other.name) &&
- (node->stats.sectionInfo.lineInfo == m_other.lineInfo));
- }
- void operator=(BySectionInfo const&) = delete;
-
- private:
- SectionInfo const& m_other;
- };
-
-
- using TestCaseNode = Node<TestCaseStats, SectionNode>;
- using TestGroupNode = Node<TestGroupStats, TestCaseNode>;
- using TestRunNode = Node<TestRunStats, TestGroupNode>;
-
- CumulativeReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
- CATCH_ERROR( "Verbosity level not supported by this reporter" );
- }
- ~CumulativeReporterBase() override = default;
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- void testRunStarting( TestRunInfo const& ) override {}
- void testGroupStarting( GroupInfo const& ) override {}
-
- void testCaseStarting( TestCaseInfo const& ) override {}
-
- void sectionStarting( SectionInfo const& sectionInfo ) override {
- SectionStats incompleteStats( sectionInfo, Counts(), 0, false );
- std::shared_ptr<SectionNode> node;
- if( m_sectionStack.empty() ) {
- if( !m_rootSection )
- m_rootSection = std::make_shared<SectionNode>( incompleteStats );
- node = m_rootSection;
- }
- else {
- SectionNode& parentNode = *m_sectionStack.back();
- auto it =
- std::find_if( parentNode.childSections.begin(),
- parentNode.childSections.end(),
- BySectionInfo( sectionInfo ) );
- if( it == parentNode.childSections.end() ) {
- node = std::make_shared<SectionNode>( incompleteStats );
- parentNode.childSections.push_back( node );
- }
- else
- node = *it;
- }
- m_sectionStack.push_back( node );
- m_deepestSection = std::move(node);
- }
-
- void assertionStarting(AssertionInfo const&) override {}
-
- bool assertionEnded(AssertionStats const& assertionStats) override {
- assert(!m_sectionStack.empty());
- // AssertionResult holds a pointer to a temporary DecomposedExpression,
- // which getExpandedExpression() calls to build the expression string.
- // Our section stack copy of the assertionResult will likely outlive the
- // temporary, so it must be expanded or discarded now to avoid calling
- // a destroyed object later.
- prepareExpandedExpression(const_cast<AssertionResult&>( assertionStats.assertionResult ) );
- SectionNode& sectionNode = *m_sectionStack.back();
- sectionNode.assertions.push_back(assertionStats);
- return true;
- }
- void sectionEnded(SectionStats const& sectionStats) override {
- assert(!m_sectionStack.empty());
- SectionNode& node = *m_sectionStack.back();
- node.stats = sectionStats;
- m_sectionStack.pop_back();
- }
- void testCaseEnded(TestCaseStats const& testCaseStats) override {
- auto node = std::make_shared<TestCaseNode>(testCaseStats);
- assert(m_sectionStack.size() == 0);
- node->children.push_back(m_rootSection);
- m_testCases.push_back(node);
- m_rootSection.reset();
-
- assert(m_deepestSection);
- m_deepestSection->stdOut = testCaseStats.stdOut;
- m_deepestSection->stdErr = testCaseStats.stdErr;
- }
- void testGroupEnded(TestGroupStats const& testGroupStats) override {
- auto node = std::make_shared<TestGroupNode>(testGroupStats);
- node->children.swap(m_testCases);
- m_testGroups.push_back(node);
- }
- void testRunEnded(TestRunStats const& testRunStats) override {
- auto node = std::make_shared<TestRunNode>(testRunStats);
- node->children.swap(m_testGroups);
- m_testRuns.push_back(node);
- testRunEndedCumulative();
- }
- virtual void testRunEndedCumulative() = 0;
-
- void skipTest(TestCaseInfo const&) override {}
-
- IConfigPtr m_config;
- std::ostream& stream;
- std::vector<AssertionStats> m_assertions;
- std::vector<std::vector<std::shared_ptr<SectionNode>>> m_sections;
- std::vector<std::shared_ptr<TestCaseNode>> m_testCases;
- std::vector<std::shared_ptr<TestGroupNode>> m_testGroups;
-
- std::vector<std::shared_ptr<TestRunNode>> m_testRuns;
-
- std::shared_ptr<SectionNode> m_rootSection;
- std::shared_ptr<SectionNode> m_deepestSection;
- std::vector<std::shared_ptr<SectionNode>> m_sectionStack;
- ReporterPreferences m_reporterPrefs;
- };
-
- template<char C>
- char const* getLineOfChars() {
- static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
- if( !*line ) {
- std::memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
- line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
- }
- return line;
- }
-
-
- struct TestEventListenerBase : StreamingReporterBase<TestEventListenerBase> {
- TestEventListenerBase( ReporterConfig const& _config );
-
- static std::set<Verbosity> getSupportedVerbosities();
-
- void assertionStarting(AssertionInfo const&) override;
- bool assertionEnded(AssertionStats const&) override;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED \ No newline at end of file
diff --git a/include/reporters/catch_reporter_compact.cpp b/include/reporters/catch_reporter_compact.cpp
deleted file mode 100644
index 017f521f..00000000
--- a/include/reporters/catch_reporter_compact.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Created by Martin on 2017-11-14.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_reporter_compact.h"
-
-#include "../internal/catch_reporter_registrars.hpp"
-#include "../internal/catch_console_colour.h"
-
-namespace {
-
-#ifdef CATCH_PLATFORM_MAC
- const char* failedString() { return "FAILED"; }
- const char* passedString() { return "PASSED"; }
-#else
- const char* failedString() { return "failed"; }
- const char* passedString() { return "passed"; }
-#endif
-
- // Colour::LightGrey
- Catch::Colour::Code dimColour() { return Catch::Colour::FileName; }
-
- std::string bothOrAll( std::size_t count ) {
- return count == 1 ? std::string() :
- count == 2 ? "both " : "all " ;
- }
-
-} // anon namespace
-
-
-namespace Catch {
-namespace {
-// Colour, message variants:
-// - white: No tests ran.
-// - red: Failed [both/all] N test cases, failed [both/all] M assertions.
-// - white: Passed [both/all] N test cases (no assertions).
-// - red: Failed N tests cases, failed M assertions.
-// - green: Passed [both/all] N tests cases with M assertions.
-void printTotals(std::ostream& out, const Totals& totals) {
- if (totals.testCases.total() == 0) {
- out << "No tests ran.";
- } else if (totals.testCases.failed == totals.testCases.total()) {
- Colour colour(Colour::ResultError);
- const std::string qualify_assertions_failed =
- totals.assertions.failed == totals.assertions.total() ?
- bothOrAll(totals.assertions.failed) : std::string();
- out <<
- "Failed " << bothOrAll(totals.testCases.failed)
- << pluralise(totals.testCases.failed, "test case") << ", "
- "failed " << qualify_assertions_failed <<
- pluralise(totals.assertions.failed, "assertion") << '.';
- } else if (totals.assertions.total() == 0) {
- out <<
- "Passed " << bothOrAll(totals.testCases.total())
- << pluralise(totals.testCases.total(), "test case")
- << " (no assertions).";
- } else if (totals.assertions.failed) {
- Colour colour(Colour::ResultError);
- out <<
- "Failed " << pluralise(totals.testCases.failed, "test case") << ", "
- "failed " << pluralise(totals.assertions.failed, "assertion") << '.';
- } else {
- Colour colour(Colour::ResultSuccess);
- out <<
- "Passed " << bothOrAll(totals.testCases.passed)
- << pluralise(totals.testCases.passed, "test case") <<
- " with " << pluralise(totals.assertions.passed, "assertion") << '.';
- }
-}
-
-// Implementation of CompactReporter formatting
-class AssertionPrinter {
-public:
- AssertionPrinter& operator= (AssertionPrinter const&) = delete;
- AssertionPrinter(AssertionPrinter const&) = delete;
- AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages)
- : stream(_stream)
- , result(_stats.assertionResult)
- , messages(_stats.infoMessages)
- , itMessage(_stats.infoMessages.begin())
- , printInfoMessages(_printInfoMessages) {}
-
- void print() {
- printSourceInfo();
-
- itMessage = messages.begin();
-
- switch (result.getResultType()) {
- case ResultWas::Ok:
- printResultType(Colour::ResultSuccess, passedString());
- printOriginalExpression();
- printReconstructedExpression();
- if (!result.hasExpression())
- printRemainingMessages(Colour::None);
- else
- printRemainingMessages();
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk())
- printResultType(Colour::ResultSuccess, failedString() + std::string(" - but was ok"));
- else
- printResultType(Colour::Error, failedString());
- printOriginalExpression();
- printReconstructedExpression();
- printRemainingMessages();
- break;
- case ResultWas::ThrewException:
- printResultType(Colour::Error, failedString());
- printIssue("unexpected exception with message:");
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::FatalErrorCondition:
- printResultType(Colour::Error, failedString());
- printIssue("fatal error condition with message:");
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::DidntThrowException:
- printResultType(Colour::Error, failedString());
- printIssue("expected exception, got none");
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::Info:
- printResultType(Colour::None, "info");
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::Warning:
- printResultType(Colour::None, "warning");
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::ExplicitFailure:
- printResultType(Colour::Error, failedString());
- printIssue("explicitly");
- printRemainingMessages(Colour::None);
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- printResultType(Colour::Error, "** internal error **");
- break;
- }
- }
-
-private:
- void printSourceInfo() const {
- Colour colourGuard(Colour::FileName);
- stream << result.getSourceInfo() << ':';
- }
-
- void printResultType(Colour::Code colour, std::string const& passOrFail) const {
- if (!passOrFail.empty()) {
- {
- Colour colourGuard(colour);
- stream << ' ' << passOrFail;
- }
- stream << ':';
- }
- }
-
- void printIssue(std::string const& issue) const {
- stream << ' ' << issue;
- }
-
- void printExpressionWas() {
- if (result.hasExpression()) {
- stream << ';';
- {
- Colour colour(dimColour());
- stream << " expression was:";
- }
- printOriginalExpression();
- }
- }
-
- void printOriginalExpression() const {
- if (result.hasExpression()) {
- stream << ' ' << result.getExpression();
- }
- }
-
- void printReconstructedExpression() const {
- if (result.hasExpandedExpression()) {
- {
- Colour colour(dimColour());
- stream << " for: ";
- }
- stream << result.getExpandedExpression();
- }
- }
-
- void printMessage() {
- if (itMessage != messages.end()) {
- stream << " '" << itMessage->message << '\'';
- ++itMessage;
- }
- }
-
- void printRemainingMessages(Colour::Code colour = dimColour()) {
- if (itMessage == messages.end())
- return;
-
- const auto itEnd = messages.cend();
- const auto N = static_cast<std::size_t>(std::distance(itMessage, itEnd));
-
- {
- Colour colourGuard(colour);
- stream << " with " << pluralise(N, "message") << ':';
- }
-
- while (itMessage != itEnd) {
- // If this assertion is a warning ignore any INFO messages
- if (printInfoMessages || itMessage->type != ResultWas::Info) {
- printMessage();
- if (itMessage != itEnd) {
- Colour colourGuard(dimColour());
- stream << " and";
- }
- continue;
- }
- ++itMessage;
- }
- }
-
-private:
- std::ostream& stream;
- AssertionResult const& result;
- std::vector<MessageInfo> messages;
- std::vector<MessageInfo>::const_iterator itMessage;
- bool printInfoMessages;
-};
-
-} // anon namespace
-
- std::string CompactReporter::getDescription() {
- return "Reports test results on a single line, suitable for IDEs";
- }
-
- ReporterPreferences CompactReporter::getPreferences() const {
- return m_reporterPrefs;
- }
-
- void CompactReporter::noMatchingTestCases( std::string const& spec ) {
- stream << "No test cases matched '" << spec << '\'' << std::endl;
- }
-
- void CompactReporter::assertionStarting( AssertionInfo const& ) {}
-
- bool CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool printInfoMessages = true;
-
- // Drop out if result was successful and we're not printing those
- if( !m_config->includeSuccessfulResults() && result.isOk() ) {
- if( result.getResultType() != ResultWas::Warning )
- return false;
- printInfoMessages = false;
- }
-
- AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
- printer.print();
-
- stream << std::endl;
- return true;
- }
-
- void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
- if (m_config->showDurations() == ShowDurations::Always) {
- stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
- }
- }
-
- void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) {
- printTotals( stream, _testRunStats.totals );
- stream << '\n' << std::endl;
- StreamingReporterBase::testRunEnded( _testRunStats );
- }
-
- CompactReporter::~CompactReporter() {}
-
- CATCH_REGISTER_REPORTER( "compact", CompactReporter )
-
-} // end namespace Catch
diff --git a/include/reporters/catch_reporter_compact.h b/include/reporters/catch_reporter_compact.h
deleted file mode 100644
index 5002df7b..00000000
--- a/include/reporters/catch_reporter_compact.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Created by Martin Moene on 2013-12-05.
- * Copyright 2012 Martin Moene. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_COMPACT_H_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_COMPACT_H_INCLUDED
-
-
-#include "catch_reporter_bases.hpp"
-
-
-namespace Catch {
-
- struct CompactReporter : StreamingReporterBase<CompactReporter> {
-
- using StreamingReporterBase::StreamingReporterBase;
-
- ~CompactReporter() override;
-
- static std::string getDescription();
-
- ReporterPreferences getPreferences() const override;
-
- void noMatchingTestCases(std::string const& spec) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& _assertionStats) override;
-
- void sectionEnded(SectionStats const& _sectionStats) override;
-
- void testRunEnded(TestRunStats const& _testRunStats) override;
-
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_COMPACT_H_INCLUDED
diff --git a/include/reporters/catch_reporter_console.cpp b/include/reporters/catch_reporter_console.cpp
deleted file mode 100644
index 706f93f8..00000000
--- a/include/reporters/catch_reporter_console.cpp
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- * Created by Phil on 5/12/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_reporter_console.h"
-
-#include "../internal/catch_reporter_registrars.hpp"
-#include "../internal/catch_console_colour.h"
-#include "../internal/catch_version.h"
-#include "../internal/catch_text.h"
-#include "../internal/catch_stringref.h"
-
-#include <cfloat>
-#include <cstdio>
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled and default is missing) is enabled
-#endif
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-// For simplicity, benchmarking-only helpers are always enabled
-# pragma clang diagnostic ignored "-Wunused-function"
-#endif
-
-
-
-namespace Catch {
-
-namespace {
-
-// Formatter impl for ConsoleReporter
-class ConsoleAssertionPrinter {
-public:
- ConsoleAssertionPrinter& operator= (ConsoleAssertionPrinter const&) = delete;
- ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete;
- ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages)
- : stream(_stream),
- stats(_stats),
- result(_stats.assertionResult),
- colour(Colour::None),
- message(result.getMessage()),
- messages(_stats.infoMessages),
- printInfoMessages(_printInfoMessages) {
- switch (result.getResultType()) {
- case ResultWas::Ok:
- colour = Colour::Success;
- passOrFail = "PASSED";
- //if( result.hasMessage() )
- if (_stats.infoMessages.size() == 1)
- messageLabel = "with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "with messages";
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk()) {
- colour = Colour::Success;
- passOrFail = "FAILED - but was ok";
- } else {
- colour = Colour::Error;
- passOrFail = "FAILED";
- }
- if (_stats.infoMessages.size() == 1)
- messageLabel = "with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "with messages";
- break;
- case ResultWas::ThrewException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to unexpected exception with ";
- if (_stats.infoMessages.size() == 1)
- messageLabel += "message";
- if (_stats.infoMessages.size() > 1)
- messageLabel += "messages";
- break;
- case ResultWas::FatalErrorCondition:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to a fatal error condition";
- break;
- case ResultWas::DidntThrowException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "because no exception was thrown where one was expected";
- break;
- case ResultWas::Info:
- messageLabel = "info";
- break;
- case ResultWas::Warning:
- messageLabel = "warning";
- break;
- case ResultWas::ExplicitFailure:
- passOrFail = "FAILED";
- colour = Colour::Error;
- if (_stats.infoMessages.size() == 1)
- messageLabel = "explicitly with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "explicitly with messages";
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- passOrFail = "** internal error **";
- colour = Colour::Error;
- break;
- }
- }
-
- void print() const {
- printSourceInfo();
- if (stats.totals.assertions.total() > 0) {
- printResultType();
- printOriginalExpression();
- printReconstructedExpression();
- } else {
- stream << '\n';
- }
- printMessage();
- }
-
-private:
- void printResultType() const {
- if (!passOrFail.empty()) {
- Colour colourGuard(colour);
- stream << passOrFail << ":\n";
- }
- }
- void printOriginalExpression() const {
- if (result.hasExpression()) {
- Colour colourGuard(Colour::OriginalExpression);
- stream << " ";
- stream << result.getExpressionInMacro();
- stream << '\n';
- }
- }
- void printReconstructedExpression() const {
- if (result.hasExpandedExpression()) {
- stream << "with expansion:\n";
- Colour colourGuard(Colour::ReconstructedExpression);
- stream << Column(result.getExpandedExpression()).indent(2) << '\n';
- }
- }
- void printMessage() const {
- if (!messageLabel.empty())
- stream << messageLabel << ':' << '\n';
- for (auto const& msg : messages) {
- // If this assertion is a warning ignore any INFO messages
- if (printInfoMessages || msg.type != ResultWas::Info)
- stream << Column(msg.message).indent(2) << '\n';
- }
- }
- void printSourceInfo() const {
- Colour colourGuard(Colour::FileName);
- stream << result.getSourceInfo() << ": ";
- }
-
- std::ostream& stream;
- AssertionStats const& stats;
- AssertionResult const& result;
- Colour::Code colour;
- std::string passOrFail;
- std::string messageLabel;
- std::string message;
- std::vector<MessageInfo> messages;
- bool printInfoMessages;
-};
-
-std::size_t makeRatio(std::size_t number, std::size_t total) {
- std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number / total : 0;
- return (ratio == 0 && number > 0) ? 1 : ratio;
-}
-
-std::size_t& findMax(std::size_t& i, std::size_t& j, std::size_t& k) {
- if (i > j && i > k)
- return i;
- else if (j > k)
- return j;
- else
- return k;
-}
-
-struct ColumnInfo {
- enum Justification { Left, Right };
- std::string name;
- int width;
- Justification justification;
-};
-struct ColumnBreak {};
-struct RowBreak {};
-
-class Duration {
- enum class Unit {
- Auto,
- Nanoseconds,
- Microseconds,
- Milliseconds,
- Seconds,
- Minutes
- };
- static const uint64_t s_nanosecondsInAMicrosecond = 1000;
- static const uint64_t s_nanosecondsInAMillisecond = 1000 * s_nanosecondsInAMicrosecond;
- static const uint64_t s_nanosecondsInASecond = 1000 * s_nanosecondsInAMillisecond;
- static const uint64_t s_nanosecondsInAMinute = 60 * s_nanosecondsInASecond;
-
- double m_inNanoseconds;
- Unit m_units;
-
-public:
- explicit Duration(double inNanoseconds, Unit units = Unit::Auto)
- : m_inNanoseconds(inNanoseconds),
- m_units(units) {
- if (m_units == Unit::Auto) {
- if (m_inNanoseconds < s_nanosecondsInAMicrosecond)
- m_units = Unit::Nanoseconds;
- else if (m_inNanoseconds < s_nanosecondsInAMillisecond)
- m_units = Unit::Microseconds;
- else if (m_inNanoseconds < s_nanosecondsInASecond)
- m_units = Unit::Milliseconds;
- else if (m_inNanoseconds < s_nanosecondsInAMinute)
- m_units = Unit::Seconds;
- else
- m_units = Unit::Minutes;
- }
-
- }
-
- auto value() const -> double {
- switch (m_units) {
- case Unit::Microseconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMicrosecond);
- case Unit::Milliseconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMillisecond);
- case Unit::Seconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInASecond);
- case Unit::Minutes:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMinute);
- default:
- return m_inNanoseconds;
- }
- }
- auto unitsAsString() const -> std::string {
- switch (m_units) {
- case Unit::Nanoseconds:
- return "ns";
- case Unit::Microseconds:
- return "us";
- case Unit::Milliseconds:
- return "ms";
- case Unit::Seconds:
- return "s";
- case Unit::Minutes:
- return "m";
- default:
- return "** internal error **";
- }
-
- }
- friend auto operator << (std::ostream& os, Duration const& duration) -> std::ostream& {
- return os << duration.value() << ' ' << duration.unitsAsString();
- }
-};
-} // end anon namespace
-
-class TablePrinter {
- std::ostream& m_os;
- std::vector<ColumnInfo> m_columnInfos;
- std::ostringstream m_oss;
- int m_currentColumn = -1;
- bool m_isOpen = false;
-
-public:
- TablePrinter( std::ostream& os, std::vector<ColumnInfo> columnInfos )
- : m_os( os ),
- m_columnInfos( std::move( columnInfos ) ) {}
-
- auto columnInfos() const -> std::vector<ColumnInfo> const& {
- return m_columnInfos;
- }
-
- void open() {
- if (!m_isOpen) {
- m_isOpen = true;
- *this << RowBreak();
-
- Columns headerCols;
- Spacer spacer(2);
- for (auto const& info : m_columnInfos) {
- headerCols += Column(info.name).width(static_cast<std::size_t>(info.width - 2));
- headerCols += spacer;
- }
- m_os << headerCols << '\n';
-
- m_os << Catch::getLineOfChars<'-'>() << '\n';
- }
- }
- void close() {
- if (m_isOpen) {
- *this << RowBreak();
- m_os << std::endl;
- m_isOpen = false;
- }
- }
-
- template<typename T>
- friend TablePrinter& operator << (TablePrinter& tp, T const& value) {
- tp.m_oss << value;
- return tp;
- }
-
- friend TablePrinter& operator << (TablePrinter& tp, ColumnBreak) {
- auto colStr = tp.m_oss.str();
- const auto strSize = colStr.size();
- tp.m_oss.str("");
- tp.open();
- if (tp.m_currentColumn == static_cast<int>(tp.m_columnInfos.size() - 1)) {
- tp.m_currentColumn = -1;
- tp.m_os << '\n';
- }
- tp.m_currentColumn++;
-
- auto colInfo = tp.m_columnInfos[tp.m_currentColumn];
- auto padding = (strSize + 1 < static_cast<std::size_t>(colInfo.width))
- ? std::string(colInfo.width - (strSize + 1), ' ')
- : std::string();
- if (colInfo.justification == ColumnInfo::Left)
- tp.m_os << colStr << padding << ' ';
- else
- tp.m_os << padding << colStr << ' ';
- return tp;
- }
-
- friend TablePrinter& operator << (TablePrinter& tp, RowBreak) {
- if (tp.m_currentColumn > 0) {
- tp.m_os << '\n';
- tp.m_currentColumn = -1;
- }
- return tp;
- }
-};
-
-ConsoleReporter::ConsoleReporter(ReporterConfig const& config)
- : StreamingReporterBase(config),
- m_tablePrinter(new TablePrinter(config.stream(),
- [&config]() -> std::vector<ColumnInfo> {
- if (config.fullConfig()->benchmarkNoAnalysis())
- {
- return{
- { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, ColumnInfo::Left },
- { " samples", 14, ColumnInfo::Right },
- { " iterations", 14, ColumnInfo::Right },
- { " mean", 14, ColumnInfo::Right }
- };
- }
- else
- {
- return{
- { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 32, ColumnInfo::Left },
- { "samples mean std dev", 14, ColumnInfo::Right },
- { "iterations low mean low std dev", 14, ColumnInfo::Right },
- { "estimated high mean high std dev", 14, ColumnInfo::Right }
- };
- }
- }())) {}
-ConsoleReporter::~ConsoleReporter() = default;
-
-std::string ConsoleReporter::getDescription() {
- return "Reports test results as plain lines of text";
-}
-
-void ConsoleReporter::noMatchingTestCases(std::string const& spec) {
- stream << "No test cases matched '" << spec << '\'' << std::endl;
-}
-
-void ConsoleReporter::reportInvalidArguments(std::string const&arg){
- stream << "Invalid Filter: " << arg << std::endl;
-}
-
-void ConsoleReporter::assertionStarting(AssertionInfo const&) {}
-
-bool ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
-
- // Drop out if result was successful but we're not printing them.
- if (!includeResults && result.getResultType() != ResultWas::Warning)
- return false;
-
- lazyPrint();
-
- ConsoleAssertionPrinter printer(stream, _assertionStats, includeResults);
- printer.print();
- stream << std::endl;
- return true;
-}
-
-void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) {
- m_tablePrinter->close();
- m_headerPrinted = false;
- StreamingReporterBase::sectionStarting(_sectionInfo);
-}
-void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
- m_tablePrinter->close();
- if (_sectionStats.missingAssertions) {
- lazyPrint();
- Colour colour(Colour::ResultError);
- if (m_sectionStack.size() > 1)
- stream << "\nNo assertions in section";
- else
- stream << "\nNo assertions in test case";
- stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
- }
- if (m_config->showDurations() == ShowDurations::Always) {
- stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
- }
- if (m_headerPrinted) {
- m_headerPrinted = false;
- }
- StreamingReporterBase::sectionEnded(_sectionStats);
-}
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-void ConsoleReporter::benchmarkPreparing(std::string const& name) {
- lazyPrintWithoutClosingBenchmarkTable();
-
- auto nameCol = Column(name).width(static_cast<std::size_t>(m_tablePrinter->columnInfos()[0].width - 2));
-
- bool firstLine = true;
- for (auto line : nameCol) {
- if (!firstLine)
- (*m_tablePrinter) << ColumnBreak() << ColumnBreak() << ColumnBreak();
- else
- firstLine = false;
-
- (*m_tablePrinter) << line << ColumnBreak();
- }
-}
-
-void ConsoleReporter::benchmarkStarting(BenchmarkInfo const& info) {
- (*m_tablePrinter) << info.samples << ColumnBreak()
- << info.iterations << ColumnBreak();
- if (!m_config->benchmarkNoAnalysis())
- (*m_tablePrinter) << Duration(info.estimatedDuration) << ColumnBreak();
-}
-void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) {
- if (m_config->benchmarkNoAnalysis())
- {
- (*m_tablePrinter) << Duration(stats.mean.point.count()) << ColumnBreak();
- }
- else
- {
- (*m_tablePrinter) << ColumnBreak()
- << Duration(stats.mean.point.count()) << ColumnBreak()
- << Duration(stats.mean.lower_bound.count()) << ColumnBreak()
- << Duration(stats.mean.upper_bound.count()) << ColumnBreak() << ColumnBreak()
- << Duration(stats.standardDeviation.point.count()) << ColumnBreak()
- << Duration(stats.standardDeviation.lower_bound.count()) << ColumnBreak()
- << Duration(stats.standardDeviation.upper_bound.count()) << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak();
- }
-}
-
-void ConsoleReporter::benchmarkFailed(std::string const& error) {
- Colour colour(Colour::Red);
- (*m_tablePrinter)
- << "Benchmark failed (" << error << ')'
- << ColumnBreak() << RowBreak();
-}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) {
- m_tablePrinter->close();
- StreamingReporterBase::testCaseEnded(_testCaseStats);
- m_headerPrinted = false;
-}
-void ConsoleReporter::testGroupEnded(TestGroupStats const& _testGroupStats) {
- if (currentGroupInfo.used) {
- printSummaryDivider();
- stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n";
- printTotals(_testGroupStats.totals);
- stream << '\n' << std::endl;
- }
- StreamingReporterBase::testGroupEnded(_testGroupStats);
-}
-void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) {
- printTotalsDivider(_testRunStats.totals);
- printTotals(_testRunStats.totals);
- stream << std::endl;
- StreamingReporterBase::testRunEnded(_testRunStats);
-}
-void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) {
- StreamingReporterBase::testRunStarting(_testInfo);
- printTestFilters();
-}
-
-void ConsoleReporter::lazyPrint() {
-
- m_tablePrinter->close();
- lazyPrintWithoutClosingBenchmarkTable();
-}
-
-void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() {
-
- if (!currentTestRunInfo.used)
- lazyPrintRunInfo();
- if (!currentGroupInfo.used)
- lazyPrintGroupInfo();
-
- if (!m_headerPrinted) {
- printTestCaseAndSectionHeader();
- m_headerPrinted = true;
- }
-}
-void ConsoleReporter::lazyPrintRunInfo() {
- stream << '\n' << getLineOfChars<'~'>() << '\n';
- Colour colour(Colour::SecondaryText);
- stream << currentTestRunInfo->name
- << " is a Catch v" << libraryVersion() << " host application.\n"
- << "Run with -? for options\n\n";
-
- if (m_config->rngSeed() != 0)
- stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n";
-
- currentTestRunInfo.used = true;
-}
-void ConsoleReporter::lazyPrintGroupInfo() {
- if (!currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1) {
- printClosedHeader("Group: " + currentGroupInfo->name);
- currentGroupInfo.used = true;
- }
-}
-void ConsoleReporter::printTestCaseAndSectionHeader() {
- assert(!m_sectionStack.empty());
- printOpenHeader(currentTestCaseInfo->name);
-
- if (m_sectionStack.size() > 1) {
- Colour colourGuard(Colour::Headers);
-
- auto
- it = m_sectionStack.begin() + 1, // Skip first section (test case)
- itEnd = m_sectionStack.end();
- for (; it != itEnd; ++it)
- printHeaderString(it->name, 2);
- }
-
- SourceLineInfo lineInfo = m_sectionStack.back().lineInfo;
-
-
- stream << getLineOfChars<'-'>() << '\n';
- Colour colourGuard(Colour::FileName);
- stream << lineInfo << '\n';
- stream << getLineOfChars<'.'>() << '\n' << std::endl;
-}
-
-void ConsoleReporter::printClosedHeader(std::string const& _name) {
- printOpenHeader(_name);
- stream << getLineOfChars<'.'>() << '\n';
-}
-void ConsoleReporter::printOpenHeader(std::string const& _name) {
- stream << getLineOfChars<'-'>() << '\n';
- {
- Colour colourGuard(Colour::Headers);
- printHeaderString(_name);
- }
-}
-
-// if string has a : in first line will set indent to follow it on
-// subsequent lines
-void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t indent) {
- std::size_t i = _string.find(": ");
- if (i != std::string::npos)
- i += 2;
- else
- i = 0;
- stream << Column(_string).indent(indent + i).initialIndent(indent) << '\n';
-}
-
-struct SummaryColumn {
-
- SummaryColumn( std::string _label, Colour::Code _colour )
- : label( std::move( _label ) ),
- colour( _colour ) {}
- SummaryColumn addRow( std::size_t count ) {
- ReusableStringStream rss;
- rss << count;
- std::string row = rss.str();
- for (auto& oldRow : rows) {
- while (oldRow.size() < row.size())
- oldRow = ' ' + oldRow;
- while (oldRow.size() > row.size())
- row = ' ' + row;
- }
- rows.push_back(row);
- return *this;
- }
-
- std::string label;
- Colour::Code colour;
- std::vector<std::string> rows;
-
-};
-
-void ConsoleReporter::printTotals( Totals const& totals ) {
- if (totals.testCases.total() == 0) {
- stream << Colour(Colour::Warning) << "No tests ran\n";
- } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) {
- stream << Colour(Colour::ResultSuccess) << "All tests passed";
- stream << " ("
- << pluralise(totals.assertions.passed, "assertion") << " in "
- << pluralise(totals.testCases.passed, "test case") << ')'
- << '\n';
- } else {
-
- std::vector<SummaryColumn> columns;
- columns.push_back(SummaryColumn("", Colour::None)
- .addRow(totals.testCases.total())
- .addRow(totals.assertions.total()));
- columns.push_back(SummaryColumn("passed", Colour::Success)
- .addRow(totals.testCases.passed)
- .addRow(totals.assertions.passed));
- columns.push_back(SummaryColumn("failed", Colour::ResultError)
- .addRow(totals.testCases.failed)
- .addRow(totals.assertions.failed));
- columns.push_back(SummaryColumn("failed as expected", Colour::ResultExpectedFailure)
- .addRow(totals.testCases.failedButOk)
- .addRow(totals.assertions.failedButOk));
-
- printSummaryRow("test cases", columns, 0);
- printSummaryRow("assertions", columns, 1);
- }
-}
-void ConsoleReporter::printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row) {
- for (auto col : cols) {
- std::string value = col.rows[row];
- if (col.label.empty()) {
- stream << label << ": ";
- if (value != "0")
- stream << value;
- else
- stream << Colour(Colour::Warning) << "- none -";
- } else if (value != "0") {
- stream << Colour(Colour::LightGrey) << " | ";
- stream << Colour(col.colour)
- << value << ' ' << col.label;
- }
- }
- stream << '\n';
-}
-
-void ConsoleReporter::printTotalsDivider(Totals const& totals) {
- if (totals.testCases.total() > 0) {
- std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total());
- std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total());
- std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total());
- while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1)
- findMax(failedRatio, failedButOkRatio, passedRatio)++;
- while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1)
- findMax(failedRatio, failedButOkRatio, passedRatio)--;
-
- stream << Colour(Colour::Error) << std::string(failedRatio, '=');
- stream << Colour(Colour::ResultExpectedFailure) << std::string(failedButOkRatio, '=');
- if (totals.testCases.allPassed())
- stream << Colour(Colour::ResultSuccess) << std::string(passedRatio, '=');
- else
- stream << Colour(Colour::Success) << std::string(passedRatio, '=');
- } else {
- stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '=');
- }
- stream << '\n';
-}
-void ConsoleReporter::printSummaryDivider() {
- stream << getLineOfChars<'-'>() << '\n';
-}
-
-void ConsoleReporter::printTestFilters() {
- if (m_config->testSpec().hasFilters()) {
- Colour guard(Colour::BrightYellow);
- stream << "Filters: " << serializeFilters(m_config->getTestsOrTags()) << '\n';
- }
-}
-
-CATCH_REGISTER_REPORTER("console", ConsoleReporter)
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
diff --git a/include/reporters/catch_reporter_console.h b/include/reporters/catch_reporter_console.h
deleted file mode 100644
index 43024daf..00000000
--- a/include/reporters/catch_reporter_console.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Created by Phil on 5/12/2012.
- * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_CONSOLE_H_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_H_INCLUDED
-
-#include "catch_reporter_bases.hpp"
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled
- // and default is missing) is enabled
-#endif
-
-
-namespace Catch {
- // Fwd decls
- struct SummaryColumn;
- class TablePrinter;
-
- struct ConsoleReporter : StreamingReporterBase<ConsoleReporter> {
- std::unique_ptr<TablePrinter> m_tablePrinter;
-
- ConsoleReporter(ReporterConfig const& config);
- ~ConsoleReporter() override;
- static std::string getDescription();
-
- void noMatchingTestCases(std::string const& spec) override;
-
- void reportInvalidArguments(std::string const&arg) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& _assertionStats) override;
-
- void sectionStarting(SectionInfo const& _sectionInfo) override;
- void sectionEnded(SectionStats const& _sectionStats) override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting(BenchmarkInfo const& info) override;
- void benchmarkEnded(BenchmarkStats<> const& stats) override;
- void benchmarkFailed(std::string const& error) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void testCaseEnded(TestCaseStats const& _testCaseStats) override;
- void testGroupEnded(TestGroupStats const& _testGroupStats) override;
- void testRunEnded(TestRunStats const& _testRunStats) override;
- void testRunStarting(TestRunInfo const& _testRunInfo) override;
- private:
-
- void lazyPrint();
-
- void lazyPrintWithoutClosingBenchmarkTable();
- void lazyPrintRunInfo();
- void lazyPrintGroupInfo();
- void printTestCaseAndSectionHeader();
-
- void printClosedHeader(std::string const& _name);
- void printOpenHeader(std::string const& _name);
-
- // if string has a : in first line will set indent to follow it on
- // subsequent lines
- void printHeaderString(std::string const& _string, std::size_t indent = 0);
-
-
- void printTotals(Totals const& totals);
- void printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row);
-
- void printTotalsDivider(Totals const& totals);
- void printSummaryDivider();
- void printTestFilters();
-
- private:
- bool m_headerPrinted = false;
- };
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_CONSOLE_H_INCLUDED \ No newline at end of file
diff --git a/include/reporters/catch_reporter_junit.cpp b/include/reporters/catch_reporter_junit.cpp
deleted file mode 100644
index 7416a523..00000000
--- a/include/reporters/catch_reporter_junit.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Created by Phil on 26/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_reporter_bases.hpp"
-
-#include "catch_reporter_junit.h"
-
-#include "../internal/catch_tostring.h"
-#include "../internal/catch_reporter_registrars.hpp"
-#include "../internal/catch_text.h"
-
-#include <cassert>
-#include <sstream>
-#include <ctime>
-#include <algorithm>
-
-namespace Catch {
-
- namespace {
- std::string getCurrentTimestamp() {
- // Beware, this is not reentrant because of backward compatibility issues
- // Also, UTC only, again because of backward compatibility (%z is C++11)
- time_t rawtime;
- std::time(&rawtime);
- auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
-
-#ifdef _MSC_VER
- std::tm timeInfo = {};
- gmtime_s(&timeInfo, &rawtime);
-#else
- std::tm* timeInfo;
- timeInfo = std::gmtime(&rawtime);
-#endif
-
- char timeStamp[timeStampSize];
- const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
-
-#ifdef _MSC_VER
- std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
-#else
- std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
-#endif
- return std::string(timeStamp);
- }
-
- std::string fileNameTag(const std::vector<std::string> &tags) {
- auto it = std::find_if(begin(tags),
- end(tags),
- [] (std::string const& tag) {return tag.front() == '#'; });
- if (it != tags.end())
- return it->substr(1);
- return std::string();
- }
- } // anonymous namespace
-
- JunitReporter::JunitReporter( ReporterConfig const& _config )
- : CumulativeReporterBase( _config ),
- xml( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- JunitReporter::~JunitReporter() {}
-
- std::string JunitReporter::getDescription() {
- return "Reports test results in an XML format that looks like Ant's junitreport target";
- }
-
- void JunitReporter::noMatchingTestCases( std::string const& /*spec*/ ) {}
-
- void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) {
- CumulativeReporterBase::testRunStarting( runInfo );
- xml.startElement( "testsuites" );
- }
-
- void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- suiteTimer.start();
- stdOutForSuite.clear();
- stdErrForSuite.clear();
- unexpectedExceptions = 0;
- CumulativeReporterBase::testGroupStarting( groupInfo );
- }
-
- void JunitReporter::testCaseStarting( TestCaseInfo const& testCaseInfo ) {
- m_okToFail = testCaseInfo.okToFail();
- }
-
- bool JunitReporter::assertionEnded( AssertionStats const& assertionStats ) {
- if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail )
- unexpectedExceptions++;
- return CumulativeReporterBase::assertionEnded( assertionStats );
- }
-
- void JunitReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- stdOutForSuite += testCaseStats.stdOut;
- stdErrForSuite += testCaseStats.stdErr;
- CumulativeReporterBase::testCaseEnded( testCaseStats );
- }
-
- void JunitReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- double suiteTime = suiteTimer.getElapsedSeconds();
- CumulativeReporterBase::testGroupEnded( testGroupStats );
- writeGroup( *m_testGroups.back(), suiteTime );
- }
-
- void JunitReporter::testRunEndedCumulative() {
- xml.endElement();
- }
-
- void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
-
- TestGroupStats const& stats = groupNode.value;
- xml.writeAttribute( "name", stats.groupInfo.name );
- xml.writeAttribute( "errors", unexpectedExceptions );
- xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions );
- xml.writeAttribute( "tests", stats.totals.assertions.total() );
- xml.writeAttribute( "hostname", "tbd" ); // !TBD
- if( m_config->showDurations() == ShowDurations::Never )
- xml.writeAttribute( "time", "" );
- else
- xml.writeAttribute( "time", suiteTime );
- xml.writeAttribute( "timestamp", getCurrentTimestamp() );
-
- // Write properties if there are any
- if (m_config->hasTestFilters() || m_config->rngSeed() != 0) {
- auto properties = xml.scopedElement("properties");
- if (m_config->hasTestFilters()) {
- xml.scopedElement("property")
- .writeAttribute("name", "filters")
- .writeAttribute("value", serializeFilters(m_config->getTestsOrTags()));
- }
- if (m_config->rngSeed() != 0) {
- xml.scopedElement("property")
- .writeAttribute("name", "random-seed")
- .writeAttribute("value", m_config->rngSeed());
- }
- }
-
- // Write test cases
- for( auto const& child : groupNode.children )
- writeTestCase( *child );
-
- xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline );
- xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline );
- }
-
- void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) {
- TestCaseStats const& stats = testCaseNode.value;
-
- // All test cases have exactly one section - which represents the
- // test case itself. That section may have 0-n nested sections
- assert( testCaseNode.children.size() == 1 );
- SectionNode const& rootSection = *testCaseNode.children.front();
-
- std::string className = stats.testInfo.className;
-
- if( className.empty() ) {
- className = fileNameTag(stats.testInfo.tags);
- if ( className.empty() )
- className = "global";
- }
-
- if ( !m_config->name().empty() )
- className = m_config->name() + "." + className;
-
- writeSection( className, "", rootSection );
- }
-
- void JunitReporter::writeSection( std::string const& className,
- std::string const& rootName,
- SectionNode const& sectionNode ) {
- std::string name = trim( sectionNode.stats.sectionInfo.name );
- if( !rootName.empty() )
- name = rootName + '/' + name;
-
- if( !sectionNode.assertions.empty() ||
- !sectionNode.stdOut.empty() ||
- !sectionNode.stdErr.empty() ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
- if( className.empty() ) {
- xml.writeAttribute( "classname", name );
- xml.writeAttribute( "name", "root" );
- }
- else {
- xml.writeAttribute( "classname", className );
- xml.writeAttribute( "name", name );
- }
- xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) );
-
- writeAssertions( sectionNode );
-
- if( !sectionNode.stdOut.empty() )
- xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline );
- if( !sectionNode.stdErr.empty() )
- xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), XmlFormatting::Newline );
- }
- for( auto const& childNode : sectionNode.childSections )
- if( className.empty() )
- writeSection( name, "", *childNode );
- else
- writeSection( className, name, *childNode );
- }
-
- void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
- for( auto const& assertion : sectionNode.assertions )
- writeAssertion( assertion );
- }
-
- void JunitReporter::writeAssertion( AssertionStats const& stats ) {
- AssertionResult const& result = stats.assertionResult;
- if( !result.isOk() ) {
- std::string elementName;
- switch( result.getResultType() ) {
- case ResultWas::ThrewException:
- case ResultWas::FatalErrorCondition:
- elementName = "error";
- break;
- case ResultWas::ExplicitFailure:
- case ResultWas::ExpressionFailed:
- case ResultWas::DidntThrowException:
- elementName = "failure";
- break;
-
- // We should never see these here:
- case ResultWas::Info:
- case ResultWas::Warning:
- case ResultWas::Ok:
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- elementName = "internalError";
- break;
- }
-
- XmlWriter::ScopedElement e = xml.scopedElement( elementName );
-
- xml.writeAttribute( "message", result.getExpression() );
- xml.writeAttribute( "type", result.getTestMacroName() );
-
- ReusableStringStream rss;
- if (stats.totals.assertions.total() > 0) {
- rss << "FAILED" << ":\n";
- if (result.hasExpression()) {
- rss << " ";
- rss << result.getExpressionInMacro();
- rss << '\n';
- }
- if (result.hasExpandedExpression()) {
- rss << "with expansion:\n";
- rss << Column(result.getExpandedExpression()).indent(2) << '\n';
- }
- } else {
- rss << '\n';
- }
-
- if( !result.getMessage().empty() )
- rss << result.getMessage() << '\n';
- for( auto const& msg : stats.infoMessages )
- if( msg.type == ResultWas::Info )
- rss << msg.message << '\n';
-
- rss << "at " << result.getSourceInfo();
- xml.writeText( rss.str(), XmlFormatting::Newline );
- }
- }
-
- CATCH_REGISTER_REPORTER( "junit", JunitReporter )
-
-} // end namespace Catch
diff --git a/include/reporters/catch_reporter_junit.h b/include/reporters/catch_reporter_junit.h
deleted file mode 100644
index 5ee3a570..00000000
--- a/include/reporters/catch_reporter_junit.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Created by Martin on 14/11/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_JUNIT_H_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_JUNIT_H_INCLUDED
-
-
-#include "catch_reporter_bases.hpp"
-#include "../internal/catch_xmlwriter.h"
-#include "../internal/catch_timer.h"
-
-namespace Catch {
-
- class JunitReporter : public CumulativeReporterBase<JunitReporter> {
- public:
- JunitReporter(ReporterConfig const& _config);
-
- ~JunitReporter() override;
-
- static std::string getDescription();
-
- void noMatchingTestCases(std::string const& /*spec*/) override;
-
- void testRunStarting(TestRunInfo const& runInfo) override;
-
- void testGroupStarting(GroupInfo const& groupInfo) override;
-
- void testCaseStarting(TestCaseInfo const& testCaseInfo) override;
- bool assertionEnded(AssertionStats const& assertionStats) override;
-
- void testCaseEnded(TestCaseStats const& testCaseStats) override;
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override;
-
- void testRunEndedCumulative() override;
-
- void writeGroup(TestGroupNode const& groupNode, double suiteTime);
-
- void writeTestCase(TestCaseNode const& testCaseNode);
-
- void writeSection(std::string const& className,
- std::string const& rootName,
- SectionNode const& sectionNode);
-
- void writeAssertions(SectionNode const& sectionNode);
- void writeAssertion(AssertionStats const& stats);
-
- XmlWriter xml;
- Timer suiteTimer;
- std::string stdOutForSuite;
- std::string stdErrForSuite;
- unsigned int unexpectedExceptions = 0;
- bool m_okToFail = false;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_JUNIT_H_INCLUDED
diff --git a/include/reporters/catch_reporter_listening.cpp b/include/reporters/catch_reporter_listening.cpp
deleted file mode 100644
index 91e6b39a..00000000
--- a/include/reporters/catch_reporter_listening.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Created by Phil on 5/08/2015.
- * Copyright 2015 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
- #include "catch_reporter_listening.h"
-#include <cassert>
-
-namespace Catch {
-
- ListeningReporter::ListeningReporter() {
- // We will assume that listeners will always want all assertions
- m_preferences.shouldReportAllAssertions = true;
- }
-
- void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) {
- m_listeners.push_back( std::move( listener ) );
- }
-
- void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) {
- assert(!m_reporter && "Listening reporter can wrap only 1 real reporter");
- m_reporter = std::move( reporter );
- m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut;
- }
-
- ReporterPreferences ListeningReporter::getPreferences() const {
- return m_preferences;
- }
-
- std::set<Verbosity> ListeningReporter::getSupportedVerbosities() {
- return std::set<Verbosity>{ };
- }
-
-
- void ListeningReporter::noMatchingTestCases( std::string const& spec ) {
- for ( auto const& listener : m_listeners ) {
- listener->noMatchingTestCases( spec );
- }
- m_reporter->noMatchingTestCases( spec );
- }
-
- void ListeningReporter::reportInvalidArguments(std::string const&arg){
- for ( auto const& listener : m_listeners ) {
- listener->reportInvalidArguments( arg );
- }
- m_reporter->reportInvalidArguments( arg );
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void ListeningReporter::benchmarkPreparing( std::string const& name ) {
- for (auto const& listener : m_listeners) {
- listener->benchmarkPreparing(name);
- }
- m_reporter->benchmarkPreparing(name);
- }
- void ListeningReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->benchmarkStarting( benchmarkInfo );
- }
- m_reporter->benchmarkStarting( benchmarkInfo );
- }
- void ListeningReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->benchmarkEnded( benchmarkStats );
- }
- m_reporter->benchmarkEnded( benchmarkStats );
- }
-
- void ListeningReporter::benchmarkFailed( std::string const& error ) {
- for (auto const& listener : m_listeners) {
- listener->benchmarkFailed(error);
- }
- m_reporter->benchmarkFailed(error);
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void ListeningReporter::testRunStarting( TestRunInfo const& testRunInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testRunStarting( testRunInfo );
- }
- m_reporter->testRunStarting( testRunInfo );
- }
-
- void ListeningReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testGroupStarting( groupInfo );
- }
- m_reporter->testGroupStarting( groupInfo );
- }
-
-
- void ListeningReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testCaseStarting( testInfo );
- }
- m_reporter->testCaseStarting( testInfo );
- }
-
- void ListeningReporter::sectionStarting( SectionInfo const& sectionInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->sectionStarting( sectionInfo );
- }
- m_reporter->sectionStarting( sectionInfo );
- }
-
- void ListeningReporter::assertionStarting( AssertionInfo const& assertionInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->assertionStarting( assertionInfo );
- }
- m_reporter->assertionStarting( assertionInfo );
- }
-
- // The return value indicates if the messages buffer should be cleared:
- bool ListeningReporter::assertionEnded( AssertionStats const& assertionStats ) {
- for( auto const& listener : m_listeners ) {
- static_cast<void>( listener->assertionEnded( assertionStats ) );
- }
- return m_reporter->assertionEnded( assertionStats );
- }
-
- void ListeningReporter::sectionEnded( SectionStats const& sectionStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->sectionEnded( sectionStats );
- }
- m_reporter->sectionEnded( sectionStats );
- }
-
- void ListeningReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testCaseEnded( testCaseStats );
- }
- m_reporter->testCaseEnded( testCaseStats );
- }
-
- void ListeningReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testGroupEnded( testGroupStats );
- }
- m_reporter->testGroupEnded( testGroupStats );
- }
-
- void ListeningReporter::testRunEnded( TestRunStats const& testRunStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testRunEnded( testRunStats );
- }
- m_reporter->testRunEnded( testRunStats );
- }
-
-
- void ListeningReporter::skipTest( TestCaseInfo const& testInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->skipTest( testInfo );
- }
- m_reporter->skipTest( testInfo );
- }
-
- bool ListeningReporter::isMulti() const {
- return true;
- }
-
-} // end namespace Catch \ No newline at end of file
diff --git a/include/reporters/catch_reporter_listening.h b/include/reporters/catch_reporter_listening.h
deleted file mode 100644
index bfaa3085..00000000
--- a/include/reporters/catch_reporter_listening.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Created by Martin on 19/07/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_MULTI_REPORTER_H_INCLUDED
-#define TWOBLUECUBES_CATCH_MULTI_REPORTER_H_INCLUDED
-
-#include "../internal/catch_interfaces_reporter.h"
-
-namespace Catch {
-
- class ListeningReporter : public IStreamingReporter {
- using Reporters = std::vector<IStreamingReporterPtr>;
- Reporters m_listeners;
- IStreamingReporterPtr m_reporter = nullptr;
- ReporterPreferences m_preferences;
-
- public:
- ListeningReporter();
-
- void addListener( IStreamingReporterPtr&& listener );
- void addReporter( IStreamingReporterPtr&& reporter );
-
- public: // IStreamingReporter
-
- ReporterPreferences getPreferences() const override;
-
- void noMatchingTestCases( std::string const& spec ) override;
-
- void reportInvalidArguments(std::string const&arg) override;
-
- static std::set<Verbosity> getSupportedVerbosities();
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override;
- void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override;
- void benchmarkFailed(std::string const&) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void testRunStarting( TestRunInfo const& testRunInfo ) override;
- void testGroupStarting( GroupInfo const& groupInfo ) override;
- void testCaseStarting( TestCaseInfo const& testInfo ) override;
- void sectionStarting( SectionInfo const& sectionInfo ) override;
- void assertionStarting( AssertionInfo const& assertionInfo ) override;
-
- // The return value indicates if the messages buffer should be cleared:
- bool assertionEnded( AssertionStats const& assertionStats ) override;
- void sectionEnded( SectionStats const& sectionStats ) override;
- void testCaseEnded( TestCaseStats const& testCaseStats ) override;
- void testGroupEnded( TestGroupStats const& testGroupStats ) override;
- void testRunEnded( TestRunStats const& testRunStats ) override;
-
- void skipTest( TestCaseInfo const& testInfo ) override;
- bool isMulti() const override;
-
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_MULTI_REPORTER_H_INCLUDED \ No newline at end of file
diff --git a/include/reporters/catch_reporter_sonarqube.hpp b/include/reporters/catch_reporter_sonarqube.hpp
deleted file mode 100644
index bf7d9299..00000000
--- a/include/reporters/catch_reporter_sonarqube.hpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Created by Daniel Garcia on 2018-12-04.
- * Copyright Social Point SL. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
-#define CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
-
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-#include <map>
-
-namespace Catch {
-
- struct SonarQubeReporter : CumulativeReporterBase<SonarQubeReporter> {
-
- SonarQubeReporter(ReporterConfig const& config)
- : CumulativeReporterBase(config)
- , xml(config.stream()) {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- ~SonarQubeReporter() override;
-
- static std::string getDescription() {
- return "Reports test results in the Generic Test Data SonarQube XML format";
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- void noMatchingTestCases(std::string const& /*spec*/) override {}
-
- void testRunStarting(TestRunInfo const& testRunInfo) override {
- CumulativeReporterBase::testRunStarting(testRunInfo);
- xml.startElement("testExecutions");
- xml.writeAttribute("version", "1");
- }
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override {
- CumulativeReporterBase::testGroupEnded(testGroupStats);
- writeGroup(*m_testGroups.back());
- }
-
- void testRunEndedCumulative() override {
- xml.endElement();
- }
-
- void writeGroup(TestGroupNode const& groupNode) {
- std::map<std::string, TestGroupNode::ChildNodes> testsPerFile;
- for(auto const& child : groupNode.children)
- testsPerFile[child->value.testInfo.lineInfo.file].push_back(child);
-
- for(auto const& kv : testsPerFile)
- writeTestFile(kv.first.c_str(), kv.second);
- }
-
- void writeTestFile(const char* filename, TestGroupNode::ChildNodes const& testCaseNodes) {
- XmlWriter::ScopedElement e = xml.scopedElement("file");
- xml.writeAttribute("path", filename);
-
- for(auto const& child : testCaseNodes)
- writeTestCase(*child);
- }
-
- void writeTestCase(TestCaseNode const& testCaseNode) {
- // All test cases have exactly one section - which represents the
- // test case itself. That section may have 0-n nested sections
- assert(testCaseNode.children.size() == 1);
- SectionNode const& rootSection = *testCaseNode.children.front();
- writeSection("", rootSection, testCaseNode.value.testInfo.okToFail());
- }
-
- void writeSection(std::string const& rootName, SectionNode const& sectionNode, bool okToFail) {
- std::string name = trim(sectionNode.stats.sectionInfo.name);
- if(!rootName.empty())
- name = rootName + '/' + name;
-
- if(!sectionNode.assertions.empty() || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty()) {
- XmlWriter::ScopedElement e = xml.scopedElement("testCase");
- xml.writeAttribute("name", name);
- xml.writeAttribute("duration", static_cast<long>(sectionNode.stats.durationInSeconds * 1000));
-
- writeAssertions(sectionNode, okToFail);
- }
-
- for(auto const& childNode : sectionNode.childSections)
- writeSection(name, *childNode, okToFail);
- }
-
- void writeAssertions(SectionNode const& sectionNode, bool okToFail) {
- for(auto const& assertion : sectionNode.assertions)
- writeAssertion( assertion, okToFail);
- }
-
- void writeAssertion(AssertionStats const& stats, bool okToFail) {
- AssertionResult const& result = stats.assertionResult;
- if(!result.isOk()) {
- std::string elementName;
- if(okToFail) {
- elementName = "skipped";
- }
- else {
- switch(result.getResultType()) {
- case ResultWas::ThrewException:
- case ResultWas::FatalErrorCondition:
- elementName = "error";
- break;
- case ResultWas::ExplicitFailure:
- elementName = "failure";
- break;
- case ResultWas::ExpressionFailed:
- elementName = "failure";
- break;
- case ResultWas::DidntThrowException:
- elementName = "failure";
- break;
-
- // We should never see these here:
- case ResultWas::Info:
- case ResultWas::Warning:
- case ResultWas::Ok:
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- elementName = "internalError";
- break;
- }
- }
-
- XmlWriter::ScopedElement e = xml.scopedElement(elementName);
-
- ReusableStringStream messageRss;
- messageRss << result.getTestMacroName() << "(" << result.getExpression() << ")";
- xml.writeAttribute("message", messageRss.str());
-
- ReusableStringStream textRss;
- if (stats.totals.assertions.total() > 0) {
- textRss << "FAILED:\n";
- if (result.hasExpression()) {
- textRss << "\t" << result.getExpressionInMacro() << "\n";
- }
- if (result.hasExpandedExpression()) {
- textRss << "with expansion:\n\t" << result.getExpandedExpression() << "\n";
- }
- }
-
- if(!result.getMessage().empty())
- textRss << result.getMessage() << "\n";
-
- for(auto const& msg : stats.infoMessages)
- if(msg.type == ResultWas::Info)
- textRss << msg.message << "\n";
-
- textRss << "at " << result.getSourceInfo();
- xml.writeText(textRss.str(), XmlFormatting::Newline);
- }
- }
-
- private:
- XmlWriter xml;
- };
-
-#ifdef CATCH_IMPL
- SonarQubeReporter::~SonarQubeReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "sonarqube", SonarQubeReporter )
-
-} // end namespace Catch
-
-#endif // CATCH_REPORTER_SONARQUBE_HPP_INCLUDED \ No newline at end of file
diff --git a/include/reporters/catch_reporter_tap.hpp b/include/reporters/catch_reporter_tap.hpp
deleted file mode 100644
index 1bfe4f5e..00000000
--- a/include/reporters/catch_reporter_tap.hpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Created by Colton Wolkins on 2015-08-15.
- * Copyright 2015 Martin Moene. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
-
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-#include <algorithm>
-
-namespace Catch {
-
- struct TAPReporter : StreamingReporterBase<TAPReporter> {
-
- using StreamingReporterBase::StreamingReporterBase;
-
- ~TAPReporter() override;
-
- static std::string getDescription() {
- return "Reports test results in TAP format, suitable for test harnesses";
- }
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- void noMatchingTestCases( std::string const& spec ) override {
- stream << "# No test cases matched '" << spec << "'" << std::endl;
- }
-
- void assertionStarting( AssertionInfo const& ) override {}
-
- bool assertionEnded( AssertionStats const& _assertionStats ) override {
- ++counter;
-
- stream << "# " << currentTestCaseInfo->name << std::endl;
- AssertionPrinter printer( stream, _assertionStats, counter );
- printer.print();
-
- stream << std::endl;
- return true;
- }
-
- void testRunEnded( TestRunStats const& _testRunStats ) override {
- printTotals( _testRunStats.totals );
- stream << "\n" << std::endl;
- StreamingReporterBase::testRunEnded( _testRunStats );
- }
-
- private:
- std::size_t counter = 0;
- class AssertionPrinter {
- public:
- AssertionPrinter& operator= ( AssertionPrinter const& ) = delete;
- AssertionPrinter( AssertionPrinter const& ) = delete;
- AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, std::size_t _counter )
- : stream( _stream )
- , result( _stats.assertionResult )
- , messages( _stats.infoMessages )
- , itMessage( _stats.infoMessages.begin() )
- , printInfoMessages( true )
- , counter(_counter)
- {}
-
- void print() {
- itMessage = messages.begin();
-
- switch( result.getResultType() ) {
- case ResultWas::Ok:
- printResultType( passedString() );
- printOriginalExpression();
- printReconstructedExpression();
- if ( ! result.hasExpression() )
- printRemainingMessages( Colour::None );
- else
- printRemainingMessages();
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk()) {
- printResultType(passedString());
- } else {
- printResultType(failedString());
- }
- printOriginalExpression();
- printReconstructedExpression();
- if (result.isOk()) {
- printIssue(" # TODO");
- }
- printRemainingMessages();
- break;
- case ResultWas::ThrewException:
- printResultType( failedString() );
- printIssue( "unexpected exception with message:" );
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::FatalErrorCondition:
- printResultType( failedString() );
- printIssue( "fatal error condition with message:" );
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::DidntThrowException:
- printResultType( failedString() );
- printIssue( "expected exception, got none" );
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::Info:
- printResultType( "info" );
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::Warning:
- printResultType( "warning" );
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::ExplicitFailure:
- printResultType( failedString() );
- printIssue( "explicitly" );
- printRemainingMessages( Colour::None );
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- printResultType( "** internal error **" );
- break;
- }
- }
-
- private:
- static Colour::Code dimColour() { return Colour::FileName; }
-
- static const char* failedString() { return "not ok"; }
- static const char* passedString() { return "ok"; }
-
- void printSourceInfo() const {
- Colour colourGuard( dimColour() );
- stream << result.getSourceInfo() << ":";
- }
-
- void printResultType( std::string const& passOrFail ) const {
- if( !passOrFail.empty() ) {
- stream << passOrFail << ' ' << counter << " -";
- }
- }
-
- void printIssue( std::string const& issue ) const {
- stream << " " << issue;
- }
-
- void printExpressionWas() {
- if( result.hasExpression() ) {
- stream << ";";
- {
- Colour colour( dimColour() );
- stream << " expression was:";
- }
- printOriginalExpression();
- }
- }
-
- void printOriginalExpression() const {
- if( result.hasExpression() ) {
- stream << " " << result.getExpression();
- }
- }
-
- void printReconstructedExpression() const {
- if( result.hasExpandedExpression() ) {
- {
- Colour colour( dimColour() );
- stream << " for: ";
- }
- std::string expr = result.getExpandedExpression();
- std::replace( expr.begin(), expr.end(), '\n', ' ');
- stream << expr;
- }
- }
-
- void printMessage() {
- if ( itMessage != messages.end() ) {
- stream << " '" << itMessage->message << "'";
- ++itMessage;
- }
- }
-
- void printRemainingMessages( Colour::Code colour = dimColour() ) {
- if (itMessage == messages.end()) {
- return;
- }
-
- // using messages.end() directly (or auto) yields compilation error:
- std::vector<MessageInfo>::const_iterator itEnd = messages.end();
- const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
-
- {
- Colour colourGuard( colour );
- stream << " with " << pluralise( N, "message" ) << ":";
- }
-
- for(; itMessage != itEnd; ) {
- // If this assertion is a warning ignore any INFO messages
- if( printInfoMessages || itMessage->type != ResultWas::Info ) {
- stream << " '" << itMessage->message << "'";
- if ( ++itMessage != itEnd ) {
- Colour colourGuard( dimColour() );
- stream << " and";
- }
- }
- }
- }
-
- private:
- std::ostream& stream;
- AssertionResult const& result;
- std::vector<MessageInfo> messages;
- std::vector<MessageInfo>::const_iterator itMessage;
- bool printInfoMessages;
- std::size_t counter;
- };
-
- void printTotals( const Totals& totals ) const {
- if( totals.testCases.total() == 0 ) {
- stream << "1..0 # Skipped: No tests ran.";
- } else {
- stream << "1.." << counter;
- }
- }
- };
-
-#ifdef CATCH_IMPL
- TAPReporter::~TAPReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "tap", TAPReporter )
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp
deleted file mode 100644
index 47b7e4aa..00000000
--- a/include/reporters/catch_reporter_teamcity.hpp
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Created by Phil Nash on 19th December 2014
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-#include <cstring>
-
-#ifdef __clang__
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
- struct TeamCityReporter : StreamingReporterBase<TeamCityReporter> {
- TeamCityReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config )
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- }
-
- static std::string escape( std::string const& str ) {
- std::string escaped = str;
- replaceInPlace( escaped, "|", "||" );
- replaceInPlace( escaped, "'", "|'" );
- replaceInPlace( escaped, "\n", "|n" );
- replaceInPlace( escaped, "\r", "|r" );
- replaceInPlace( escaped, "[", "|[" );
- replaceInPlace( escaped, "]", "|]" );
- return escaped;
- }
- ~TeamCityReporter() override;
-
- static std::string getDescription() {
- return "Reports test results as TeamCity service messages";
- }
-
- void skipTest( TestCaseInfo const& /* testInfo */ ) override {
- }
-
- void noMatchingTestCases( std::string const& /* spec */ ) override {}
-
- void testGroupStarting( GroupInfo const& groupInfo ) override {
- StreamingReporterBase::testGroupStarting( groupInfo );
- stream << "##teamcity[testSuiteStarted name='"
- << escape( groupInfo.name ) << "']\n";
- }
- void testGroupEnded( TestGroupStats const& testGroupStats ) override {
- StreamingReporterBase::testGroupEnded( testGroupStats );
- stream << "##teamcity[testSuiteFinished name='"
- << escape( testGroupStats.groupInfo.name ) << "']\n";
- }
-
-
- void assertionStarting( AssertionInfo const& ) override {}
-
- bool assertionEnded( AssertionStats const& assertionStats ) override {
- AssertionResult const& result = assertionStats.assertionResult;
- if( !result.isOk() ) {
-
- ReusableStringStream msg;
- if( !m_headerPrintedForThisSection )
- printSectionHeader( msg.get() );
- m_headerPrintedForThisSection = true;
-
- msg << result.getSourceInfo() << "\n";
-
- switch( result.getResultType() ) {
- case ResultWas::ExpressionFailed:
- msg << "expression failed";
- break;
- case ResultWas::ThrewException:
- msg << "unexpected exception";
- break;
- case ResultWas::FatalErrorCondition:
- msg << "fatal error condition";
- break;
- case ResultWas::DidntThrowException:
- msg << "no exception was thrown where one was expected";
- break;
- case ResultWas::ExplicitFailure:
- msg << "explicit failure";
- break;
-
- // We shouldn't get here because of the isOk() test
- case ResultWas::Ok:
- case ResultWas::Info:
- case ResultWas::Warning:
- CATCH_ERROR( "Internal error in TeamCity reporter" );
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- CATCH_ERROR( "Not implemented" );
- }
- if( assertionStats.infoMessages.size() == 1 )
- msg << " with message:";
- if( assertionStats.infoMessages.size() > 1 )
- msg << " with messages:";
- for( auto const& messageInfo : assertionStats.infoMessages )
- msg << "\n \"" << messageInfo.message << "\"";
-
-
- if( result.hasExpression() ) {
- msg <<
- "\n " << result.getExpressionInMacro() << "\n"
- "with expansion:\n" <<
- " " << result.getExpandedExpression() << "\n";
- }
-
- if( currentTestCaseInfo->okToFail() ) {
- msg << "- failure ignore as test marked as 'ok to fail'\n";
- stream << "##teamcity[testIgnored"
- << " name='" << escape( currentTestCaseInfo->name )<< "'"
- << " message='" << escape( msg.str() ) << "'"
- << "]\n";
- }
- else {
- stream << "##teamcity[testFailed"
- << " name='" << escape( currentTestCaseInfo->name )<< "'"
- << " message='" << escape( msg.str() ) << "'"
- << "]\n";
- }
- }
- stream.flush();
- return true;
- }
-
- void sectionStarting( SectionInfo const& sectionInfo ) override {
- m_headerPrintedForThisSection = false;
- StreamingReporterBase::sectionStarting( sectionInfo );
- }
-
- void testCaseStarting( TestCaseInfo const& testInfo ) override {
- m_testTimer.start();
- StreamingReporterBase::testCaseStarting( testInfo );
- stream << "##teamcity[testStarted name='"
- << escape( testInfo.name ) << "']\n";
- stream.flush();
- }
-
- void testCaseEnded( TestCaseStats const& testCaseStats ) override {
- StreamingReporterBase::testCaseEnded( testCaseStats );
- if( !testCaseStats.stdOut.empty() )
- stream << "##teamcity[testStdOut name='"
- << escape( testCaseStats.testInfo.name )
- << "' out='" << escape( testCaseStats.stdOut ) << "']\n";
- if( !testCaseStats.stdErr.empty() )
- stream << "##teamcity[testStdErr name='"
- << escape( testCaseStats.testInfo.name )
- << "' out='" << escape( testCaseStats.stdErr ) << "']\n";
- stream << "##teamcity[testFinished name='"
- << escape( testCaseStats.testInfo.name ) << "' duration='"
- << m_testTimer.getElapsedMilliseconds() << "']\n";
- stream.flush();
- }
-
- private:
- void printSectionHeader( std::ostream& os ) {
- assert( !m_sectionStack.empty() );
-
- if( m_sectionStack.size() > 1 ) {
- os << getLineOfChars<'-'>() << "\n";
-
- std::vector<SectionInfo>::const_iterator
- it = m_sectionStack.begin()+1, // Skip first section (test case)
- itEnd = m_sectionStack.end();
- for( ; it != itEnd; ++it )
- printHeaderString( os, it->name );
- os << getLineOfChars<'-'>() << "\n";
- }
-
- SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
-
- os << lineInfo << "\n";
- os << getLineOfChars<'.'>() << "\n\n";
- }
-
- // if string has a : in first line will set indent to follow it on
- // subsequent lines
- static void printHeaderString( std::ostream& os, std::string const& _string, std::size_t indent = 0 ) {
- std::size_t i = _string.find( ": " );
- if( i != std::string::npos )
- i+=2;
- else
- i = 0;
- os << Column( _string )
- .indent( indent+i)
- .initialIndent( indent ) << "\n";
- }
- private:
- bool m_headerPrintedForThisSection = false;
- Timer m_testTimer;
- };
-
-#ifdef CATCH_IMPL
- TeamCityReporter::~TeamCityReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "teamcity", TeamCityReporter )
-
-} // end namespace Catch
-
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
diff --git a/include/reporters/catch_reporter_xml.cpp b/include/reporters/catch_reporter_xml.cpp
deleted file mode 100644
index 0fb78be0..00000000
--- a/include/reporters/catch_reporter_xml.cpp
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Created by Phil on 28/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch_reporter_xml.h"
-
-#include "../internal/catch_capture.hpp"
-#include "../internal/catch_reporter_registrars.hpp"
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled
- // and default is missing) is enabled
-#endif
-
-namespace Catch {
- XmlReporter::XmlReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config ),
- m_xml(_config.stream())
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- XmlReporter::~XmlReporter() = default;
-
- std::string XmlReporter::getDescription() {
- return "Reports test results as an XML document";
- }
-
- std::string XmlReporter::getStylesheetRef() const {
- return std::string();
- }
-
- void XmlReporter::writeSourceInfo( SourceLineInfo const& sourceInfo ) {
- m_xml
- .writeAttribute( "filename", sourceInfo.file )
- .writeAttribute( "line", sourceInfo.line );
- }
-
- void XmlReporter::noMatchingTestCases( std::string const& s ) {
- StreamingReporterBase::noMatchingTestCases( s );
- }
-
- void XmlReporter::testRunStarting( TestRunInfo const& testInfo ) {
- StreamingReporterBase::testRunStarting( testInfo );
- std::string stylesheetRef = getStylesheetRef();
- if( !stylesheetRef.empty() )
- m_xml.writeStylesheetRef( stylesheetRef );
- m_xml.startElement( "Catch" );
- if( !m_config->name().empty() )
- m_xml.writeAttribute( "name", m_config->name() );
- if (m_config->testSpec().hasFilters())
- m_xml.writeAttribute( "filters", serializeFilters( m_config->getTestsOrTags() ) );
- if( m_config->rngSeed() != 0 )
- m_xml.scopedElement( "Randomness" )
- .writeAttribute( "seed", m_config->rngSeed() );
- }
-
- void XmlReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- StreamingReporterBase::testGroupStarting( groupInfo );
- m_xml.startElement( "Group" )
- .writeAttribute( "name", groupInfo.name );
- }
-
- void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
- StreamingReporterBase::testCaseStarting(testInfo);
- m_xml.startElement( "TestCase" )
- .writeAttribute( "name", trim( testInfo.name ) )
- .writeAttribute( "description", testInfo.description )
- .writeAttribute( "tags", testInfo.tagsAsString() );
-
- writeSourceInfo( testInfo.lineInfo );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- m_testCaseTimer.start();
- m_xml.ensureTagClosed();
- }
-
- void XmlReporter::sectionStarting( SectionInfo const& sectionInfo ) {
- StreamingReporterBase::sectionStarting( sectionInfo );
- if( m_sectionDepth++ > 0 ) {
- m_xml.startElement( "Section" )
- .writeAttribute( "name", trim( sectionInfo.name ) );
- writeSourceInfo( sectionInfo.lineInfo );
- m_xml.ensureTagClosed();
- }
- }
-
- void XmlReporter::assertionStarting( AssertionInfo const& ) { }
-
- bool XmlReporter::assertionEnded( AssertionStats const& assertionStats ) {
-
- AssertionResult const& result = assertionStats.assertionResult;
-
- bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
-
- if( includeResults || result.getResultType() == ResultWas::Warning ) {
- // Print any info messages in <Info> tags.
- for( auto const& msg : assertionStats.infoMessages ) {
- if( msg.type == ResultWas::Info && includeResults ) {
- m_xml.scopedElement( "Info" )
- .writeText( msg.message );
- } else if ( msg.type == ResultWas::Warning ) {
- m_xml.scopedElement( "Warning" )
- .writeText( msg.message );
- }
- }
- }
-
- // Drop out if result was successful but we're not printing them.
- if( !includeResults && result.getResultType() != ResultWas::Warning )
- return true;
-
-
- // Print the expression if there is one.
- if( result.hasExpression() ) {
- m_xml.startElement( "Expression" )
- .writeAttribute( "success", result.succeeded() )
- .writeAttribute( "type", result.getTestMacroName() );
-
- writeSourceInfo( result.getSourceInfo() );
-
- m_xml.scopedElement( "Original" )
- .writeText( result.getExpression() );
- m_xml.scopedElement( "Expanded" )
- .writeText( result.getExpandedExpression() );
- }
-
- // And... Print a result applicable to each result type.
- switch( result.getResultType() ) {
- case ResultWas::ThrewException:
- m_xml.startElement( "Exception" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- case ResultWas::FatalErrorCondition:
- m_xml.startElement( "FatalErrorCondition" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- case ResultWas::Info:
- m_xml.scopedElement( "Info" )
- .writeText( result.getMessage() );
- break;
- case ResultWas::Warning:
- // Warning will already have been written
- break;
- case ResultWas::ExplicitFailure:
- m_xml.startElement( "Failure" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- default:
- break;
- }
-
- if( result.hasExpression() )
- m_xml.endElement();
-
- return true;
- }
-
- void XmlReporter::sectionEnded( SectionStats const& sectionStats ) {
- StreamingReporterBase::sectionEnded( sectionStats );
- if( --m_sectionDepth > 0 ) {
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" );
- e.writeAttribute( "successes", sectionStats.assertions.passed );
- e.writeAttribute( "failures", sectionStats.assertions.failed );
- e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds );
-
- m_xml.endElement();
- }
- }
-
- void XmlReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- StreamingReporterBase::testCaseEnded( testCaseStats );
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" );
- e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() );
-
- if( !testCaseStats.stdOut.empty() )
- m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), XmlFormatting::Newline );
- if( !testCaseStats.stdErr.empty() )
- m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), XmlFormatting::Newline );
-
- m_xml.endElement();
- }
-
- void XmlReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- StreamingReporterBase::testGroupEnded( testGroupStats );
- // TODO: Check testGroupStats.aborting and act accordingly.
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testGroupStats.totals.assertions.passed )
- .writeAttribute( "failures", testGroupStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
- m_xml.endElement();
- }
-
- void XmlReporter::testRunEnded( TestRunStats const& testRunStats ) {
- StreamingReporterBase::testRunEnded( testRunStats );
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testRunStats.totals.assertions.passed )
- .writeAttribute( "failures", testRunStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk );
- m_xml.endElement();
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void XmlReporter::benchmarkPreparing(std::string const& name) {
- m_xml.startElement("BenchmarkResults")
- .writeAttribute("name", name);
- }
-
- void XmlReporter::benchmarkStarting(BenchmarkInfo const &info) {
- m_xml.writeAttribute("samples", info.samples)
- .writeAttribute("resamples", info.resamples)
- .writeAttribute("iterations", info.iterations)
- .writeAttribute("clockResolution", info.clockResolution)
- .writeAttribute("estimatedDuration", info.estimatedDuration)
- .writeComment("All values in nano seconds");
- }
-
- void XmlReporter::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) {
- m_xml.startElement("mean")
- .writeAttribute("value", benchmarkStats.mean.point.count())
- .writeAttribute("lowerBound", benchmarkStats.mean.lower_bound.count())
- .writeAttribute("upperBound", benchmarkStats.mean.upper_bound.count())
- .writeAttribute("ci", benchmarkStats.mean.confidence_interval);
- m_xml.endElement();
- m_xml.startElement("standardDeviation")
- .writeAttribute("value", benchmarkStats.standardDeviation.point.count())
- .writeAttribute("lowerBound", benchmarkStats.standardDeviation.lower_bound.count())
- .writeAttribute("upperBound", benchmarkStats.standardDeviation.upper_bound.count())
- .writeAttribute("ci", benchmarkStats.standardDeviation.confidence_interval);
- m_xml.endElement();
- m_xml.startElement("outliers")
- .writeAttribute("variance", benchmarkStats.outlierVariance)
- .writeAttribute("lowMild", benchmarkStats.outliers.low_mild)
- .writeAttribute("lowSevere", benchmarkStats.outliers.low_severe)
- .writeAttribute("highMild", benchmarkStats.outliers.high_mild)
- .writeAttribute("highSevere", benchmarkStats.outliers.high_severe);
- m_xml.endElement();
- m_xml.endElement();
- }
-
- void XmlReporter::benchmarkFailed(std::string const &error) {
- m_xml.scopedElement("failed").
- writeAttribute("message", error);
- m_xml.endElement();
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- CATCH_REGISTER_REPORTER( "xml", XmlReporter )
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
diff --git a/include/reporters/catch_reporter_xml.h b/include/reporters/catch_reporter_xml.h
deleted file mode 100644
index 5b6ba310..00000000
--- a/include/reporters/catch_reporter_xml.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Created by Martin on 14/11/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_XML_H_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_XML_H_INCLUDED
-
-#include "catch_reporter_bases.hpp"
-
-#include "../internal/catch_xmlwriter.h"
-#include "../internal/catch_timer.h"
-
-
-namespace Catch {
- class XmlReporter : public StreamingReporterBase<XmlReporter> {
- public:
- XmlReporter(ReporterConfig const& _config);
-
- ~XmlReporter() override;
-
- static std::string getDescription();
-
- virtual std::string getStylesheetRef() const;
-
- void writeSourceInfo(SourceLineInfo const& sourceInfo);
-
- public: // StreamingReporterBase
-
- void noMatchingTestCases(std::string const& s) override;
-
- void testRunStarting(TestRunInfo const& testInfo) override;
-
- void testGroupStarting(GroupInfo const& groupInfo) override;
-
- void testCaseStarting(TestCaseInfo const& testInfo) override;
-
- void sectionStarting(SectionInfo const& sectionInfo) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& assertionStats) override;
-
- void sectionEnded(SectionStats const& sectionStats) override;
-
- void testCaseEnded(TestCaseStats const& testCaseStats) override;
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override;
-
- void testRunEnded(TestRunStats const& testRunStats) override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting(BenchmarkInfo const&) override;
- void benchmarkEnded(BenchmarkStats<> const&) override;
- void benchmarkFailed(std::string const&) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- private:
- Timer m_testCaseTimer;
- XmlWriter m_xml;
- int m_sectionDepth = 0;
- };
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_XML_H_INCLUDED
diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt
deleted file mode 100644
index bf80846c..00000000
--- a/misc/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-cmake_minimum_required(VERSION 3.0)
-
-project(CatchCoverageHelper)
-
-add_executable(CoverageHelper coverage-helper.cpp)
-set_property(TARGET CoverageHelper PROPERTY CXX_STANDARD 11)
-set_property(TARGET CoverageHelper PROPERTY CXX_STANDARD_REQUIRED ON)
-set_property(TARGET CoverageHelper PROPERTY CXX_EXTENSIONS OFF)
-if (MSVC)
- target_compile_options( CoverageHelper PRIVATE /W4 /w44265 /WX /w44061 /w44062 )
-endif()
diff --git a/misc/SelfTest.vcxproj.user b/misc/SelfTest.vcxproj.user
deleted file mode 100644
index ffffc575..00000000
--- a/misc/SelfTest.vcxproj.user
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <UseFullPaths>false</UseFullPaths>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <UseFullPaths>false</UseFullPaths>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <UseFullPaths>false</UseFullPaths>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <UseFullPaths>false</UseFullPaths>
- </ClCompile>
- </ItemDefinitionGroup>
-</Project>
diff --git a/misc/appveyorBuildConfigurationScript.bat b/misc/appveyorBuildConfigurationScript.bat
deleted file mode 100644
index f07bb707..00000000
--- a/misc/appveyorBuildConfigurationScript.bat
+++ /dev/null
@@ -1,22 +0,0 @@
-SETLOCAL EnableDelayedExpansion
-
-@REM # Possibilities:
-@REM # Debug build + coverage
-@REM # Debug build + examples
-@REM # Debug build + ---
-@REM # Release build
-if "%CONFIGURATION%"=="Debug" (
- if "%coverage%"=="1" (
- @REM # coverage needs to build the special helper as well as the main
- cmake -Hmisc -Bbuild-misc -A%PLATFORM% || exit /b !ERRORLEVEL!
- cmake --build build-misc || exit /b !ERRORLEVEL!
- cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind || exit /b !ERRORLEVEL! || exit /b !ERRORLEVEL!
- ) else (
- @REM # We know that coverage is 0
- python scripts\generateSingleHeader.py || exit /b !ERRORLEVEL!
- cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% || exit /b !ERRORLEVEL!
- )
-)
-if "%CONFIGURATION%"=="Release" (
- cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% || exit /b !ERRORLEVEL!
-)
diff --git a/misc/appveyorMergeCoverageScript.py b/misc/appveyorMergeCoverageScript.py
deleted file mode 100644
index 93a47fff..00000000
--- a/misc/appveyorMergeCoverageScript.py
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env python2
-
-import glob
-import subprocess
-
-if __name__ == '__main__':
- cov_files = list(glob.glob('projects/cov-report*.bin'))
- base_cmd = ['OpenCppCoverage', '--quiet', '--export_type=cobertura:cobertura.xml'] + ['--input_coverage={}'.format(f) for f in cov_files]
- subprocess.check_call(base_cmd)
diff --git a/misc/appveyorTestRunScript.bat b/misc/appveyorTestRunScript.bat
deleted file mode 100644
index c129d99e..00000000
--- a/misc/appveyorTestRunScript.bat
+++ /dev/null
@@ -1,15 +0,0 @@
-SETLOCAL EnableDelayedExpansion
-
-cd Build
-if "%CONFIGURATION%"=="Debug" (
- if "%coverage%"=="1" (
- ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck || exit /b !ERRORLEVEL!
- python ..\misc\appveyorMergeCoverageScript.py || exit /b !ERRORLEVEL!
- codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN% || exit /b !ERRORLEVEL!
- ) else (
- ctest -j 2 -C %CONFIGURATION% || exit /b !ERRORLEVEL!
- )
-)
-if "%CONFIGURATION%"=="Release" (
- ctest -j 2 -C %CONFIGURATION% || exit /b !ERRORLEVEL!
-)
diff --git a/misc/coverage-helper.cpp b/misc/coverage-helper.cpp
deleted file mode 100644
index a31e927f..00000000
--- a/misc/coverage-helper.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-#include <algorithm>
-#include <array>
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <memory>
-#include <numeric>
-#include <regex>
-#include <string>
-#include <vector>
-
-std::string escape_arg(const std::string& arg) {
- if (arg.empty() == false &&
- arg.find_first_of(" \t\n\v\"") == arg.npos) {
- return arg;
- }
-
- std::string escaped;
- escaped.push_back('"');
- for (auto it = arg.begin(); ; ++it) {
- int num_backslashes = 0;
-
- while (it != arg.end() && *it == '\\') {
- ++it;
- ++num_backslashes;
- }
-
- if (it == arg.end()) {
- escaped.append(num_backslashes * 2, '\\');
- break;
- } else if (*it == '"') {
- escaped.append((num_backslashes + 1) * 2, '\\');
- escaped.push_back('"');
- escaped.push_back(*it);
- } else {
- escaped.append(num_backslashes, '\\');
- escaped.push_back(*it);
- }
- }
- escaped.push_back('"');
-
- return escaped;
-}
-
-
-void create_empty_file(std::string const& path) {
- std::ofstream ofs(path);
- ofs << '\n';
-}
-
-const std::string separator = "--sep--";
-const std::string logfile_prefix = "--log-file=";
-
-bool starts_with(std::string const& str, std::string const& pref) {
- return str.find(pref) == 0;
-}
-
-int parse_log_file_arg(std::string const& arg) {
- assert(starts_with(arg, logfile_prefix) && "Attempting to parse incorrect arg!");
- auto fname = arg.substr(logfile_prefix.size());
- create_empty_file(fname);
- std::regex regex("MemoryChecker\\.(\\d+)\\.log", std::regex::icase);
- std::smatch match;
- if (std::regex_search(fname, match, regex)) {
- return std::stoi(match[1]);
- } else {
- throw std::domain_error("Couldn't find desired expression in string: " + fname);
- }
-}
-
-std::string catch_path(std::string path) {
- auto start = path.find("catch");
- // try capitalized instead
- if (start == std::string::npos) {
- start = path.find("Catch");
- }
- if (start == std::string::npos) {
- throw std::domain_error("Couldn't find Catch's base path");
- }
- auto end = path.find_first_of("\\/", start);
- return path.substr(0, end);
-}
-
-std::string windowsify_path(std::string path) {
- for (auto& c : path) {
- if (c == '/') {
- c = '\\';
- }
- }
- return path;
-}
-
-int exec_cmd(std::string const& cmd, int log_num, std::string const& path) {
- std::array<char, 128> buffer;
-
- // cmd has already been escaped outside this function.
- auto real_cmd = "OpenCppCoverage --export_type binary:cov-report" + std::to_string(log_num)
- + ".bin --quiet " + "--sources " + escape_arg(path) + " --cover_children -- " + cmd;
- std::cout << "=== Marker ===: Cmd: " << real_cmd << '\n';
- auto pipe = _popen(real_cmd.c_str(), "r");
-
- if (!pipe) {
- throw std::runtime_error("popen() failed!");
- }
- while (!feof(pipe)) {
- if (fgets(buffer.data(), 128, pipe) != nullptr) {
- std::cout << buffer.data();
- }
- }
-
- auto ret = _pclose(pipe);
- if (ret == -1) {
- throw std::runtime_error("underlying error in pclose()");
- }
-
- return ret;
-}
-
-// argv should be:
-// [0]: our path
-// [1]: "--log-file=<path>"
-// [2]: "--sep--"
-// [3]+: the actual command
-
-int main(int argc, char** argv) {
- std::vector<std::string> args(argv, argv + argc);
- auto sep = std::find(begin(args), end(args), separator);
- assert(sep - begin(args) == 2 && "Structure differs from expected!");
-
- auto num = parse_log_file_arg(args[1]);
-
- auto cmdline = std::accumulate(++sep, end(args), std::string{}, [] (const std::string& lhs, const std::string& rhs) {
- return lhs + ' ' + escape_arg(rhs);
- });
-
- try {
- return exec_cmd(cmdline, num, windowsify_path(catch_path(args[0])));
- } catch (std::exception const& ex) {
- std::cerr << "Helper failed with: '" << ex.what() << "'\n";
- return 12;
- }
-}
diff --git a/misc/installOpenCppCoverage.ps1 b/misc/installOpenCppCoverage.ps1
deleted file mode 100644
index d277a55d..00000000
--- a/misc/installOpenCppCoverage.ps1
+++ /dev/null
@@ -1,19 +0,0 @@
-# Downloads are done from the official github release page links
-$downloadUrl = "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.7.0/OpenCppCoverageSetup-x64-0.9.7.0.exe"
-$installerPath = [System.IO.Path]::Combine($Env:USERPROFILE, "Downloads", "OpenCppCoverageSetup.exe")
-
-if(-Not (Test-Path $installerPath)) {
- Write-Host -ForegroundColor White ("Downloading OpenCppCoverage from: " + $downloadUrl)
- Start-FileDownload $downloadUrl -FileName $installerPath
-}
-
-Write-Host -ForegroundColor White "About to install OpenCppCoverage..."
-
-$installProcess = (Start-Process $installerPath -ArgumentList '/VERYSILENT' -PassThru -Wait)
-if($installProcess.ExitCode -ne 0) {
- throw [System.String]::Format("Failed to install OpenCppCoverage, ExitCode: {0}.", $installProcess.ExitCode)
-}
-
-# Assume standard, boring, installation path of ".../Program Files/OpenCppCoverage"
-$installPath = [System.IO.Path]::Combine(${Env:ProgramFiles}, "OpenCppCoverage")
-$env:Path="$env:Path;$installPath"
diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt
deleted file mode 100644
index 0aafc178..00000000
--- a/projects/CMakeLists.txt
+++ /dev/null
@@ -1,461 +0,0 @@
-include(MiscFunctions)
-
-####
-# Temporary workaround for VS toolset changes in 2017
-# We need to disable <UseFullPaths> property, but CMake doesn't support it
-# until 3.13 (not yet released)
-####
-if (MSVC)
-configure_file(${CATCH_DIR}/misc/SelfTest.vcxproj.user
- ${CMAKE_BINARY_DIR}/projects
- COPYONLY)
-endif(MSVC) #Temporary workaround
-
-
-# define the sources of the self test
-# Please keep these ordered alphabetically
-set(TEST_SOURCES
- ${SELF_TEST_DIR}/TestMain.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/CmdLine.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/Details.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/GeneratorsImpl.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/InternalBenchmark.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/PartTracker.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/RandomNumberGeneration.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/Tag.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/String.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/StringManip.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/Xml.tests.cpp
- ${SELF_TEST_DIR}/IntrospectiveTests/ToString.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Approx.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/BDD.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Benchmark.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Class.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Compilation.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Condition.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Decomposition.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/EnumToString.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Exception.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Generators.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Message.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Misc.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringByte.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringChrono.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringGeneral.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringOptional.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringPair.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringTuple.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringVariant.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringVector.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/ToStringWhich.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Tricky.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/VariadicMacros.tests.cpp
- ${SELF_TEST_DIR}/UsageTests/Matchers.tests.cpp
- )
-CheckFileList(TEST_SOURCES ${SELF_TEST_DIR})
-
-# A set of impl files that just #include a single header
-# Please keep these ordered alphabetically
-set(SURROGATE_SOURCES
- ${SELF_TEST_DIR}/SurrogateCpps/catch_console_colour.cpp
- ${SELF_TEST_DIR}/SurrogateCpps/catch_debugger.cpp
- ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_reporter.cpp
- ${SELF_TEST_DIR}/SurrogateCpps/catch_option.cpp
- ${SELF_TEST_DIR}/SurrogateCpps/catch_stream.cpp
- ${SELF_TEST_DIR}/SurrogateCpps/catch_test_case_tracker.cpp
- ${SELF_TEST_DIR}/SurrogateCpps/catch_test_spec.cpp
- ${SELF_TEST_DIR}/SurrogateCpps/catch_xmlwriter.cpp
- )
-CheckFileList(SURROGATE_SOURCES ${SELF_TEST_DIR}/SurrogateCpps)
-
-
-# Please keep these ordered alphabetically
-set(TOP_LEVEL_HEADERS
- ${HEADER_DIR}/catch.hpp
- ${HEADER_DIR}/catch_with_main.hpp
- )
-CheckFileList(TOP_LEVEL_HEADERS ${HEADER_DIR})
-
-# Please keep these ordered alphabetically
-set(EXTERNAL_HEADERS
- ${HEADER_DIR}/external/clara.hpp
- )
-CheckFileList(EXTERNAL_HEADERS ${HEADER_DIR}/external)
-
-
-# Please keep these ordered alphabetically
-set(BENCHMARK_HEADERS
- ${HEADER_DIR}/internal/benchmark/catch_benchmark.hpp
- ${HEADER_DIR}/internal/benchmark/catch_chronometer.hpp
- ${HEADER_DIR}/internal/benchmark/catch_clock.hpp
- ${HEADER_DIR}/internal/benchmark/catch_constructor.hpp
- ${HEADER_DIR}/internal/benchmark/catch_environment.hpp
- ${HEADER_DIR}/internal/benchmark/catch_estimate.hpp
- ${HEADER_DIR}/internal/benchmark/catch_execution_plan.hpp
- ${HEADER_DIR}/internal/benchmark/catch_optimizer.hpp
- ${HEADER_DIR}/internal/benchmark/catch_outlier_classification.hpp
- ${HEADER_DIR}/internal/benchmark/catch_sample_analysis.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_analyse.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_benchmark_function.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_complete_invoke.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_estimate_clock.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_measure.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_repeat.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_run_for_at_least.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_stats.hpp
- ${HEADER_DIR}/internal/benchmark/detail/catch_timing.hpp
-)
-set(BENCHMARK_SOURCES
- ${HEADER_DIR}/internal/benchmark/detail/catch_stats.cpp
-)
-
-SOURCE_GROUP("benchmark" FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES})
-
-set(INTERNAL_HEADERS
- ${HEADER_DIR}/internal/catch_approx.h
- ${HEADER_DIR}/internal/catch_assertionhandler.h
- ${HEADER_DIR}/internal/catch_assertioninfo.h
- ${HEADER_DIR}/internal/catch_assertionresult.h
- ${HEADER_DIR}/internal/catch_capture.hpp
- ${HEADER_DIR}/internal/catch_capture_matchers.h
- ${HEADER_DIR}/internal/catch_clara.h
- ${HEADER_DIR}/internal/catch_commandline.h
- ${HEADER_DIR}/internal/catch_common.h
- ${HEADER_DIR}/internal/catch_compiler_capabilities.h
- ${HEADER_DIR}/internal/catch_config.hpp
- ${HEADER_DIR}/internal/catch_console_colour.h
- ${HEADER_DIR}/internal/catch_context.h
- ${HEADER_DIR}/internal/catch_debug_console.h
- ${HEADER_DIR}/internal/catch_debugger.h
- ${HEADER_DIR}/internal/catch_decomposer.h
- ${HEADER_DIR}/internal/catch_default_main.hpp
- ${HEADER_DIR}/internal/catch_enforce.h
- ${HEADER_DIR}/internal/catch_enum_values_registry.h
- ${HEADER_DIR}/internal/catch_errno_guard.h
- ${HEADER_DIR}/internal/catch_exception_translator_registry.h
- ${HEADER_DIR}/internal/catch_external_interfaces.h
- ${HEADER_DIR}/internal/catch_fatal_condition.h
- ${HEADER_DIR}/internal/catch_generators.hpp
- ${HEADER_DIR}/internal/catch_generators_generic.hpp
- ${HEADER_DIR}/internal/catch_generators_specific.hpp
- ${HEADER_DIR}/internal/catch_impl.hpp
- ${HEADER_DIR}/internal/catch_interfaces_capture.h
- ${HEADER_DIR}/internal/catch_interfaces_config.h
- ${HEADER_DIR}/internal/catch_interfaces_enum_values_registry.h
- ${HEADER_DIR}/internal/catch_interfaces_exception.h
- ${HEADER_DIR}/internal/catch_interfaces_registry_hub.h
- ${HEADER_DIR}/internal/catch_interfaces_reporter.h
- ${HEADER_DIR}/internal/catch_interfaces_runner.h
- ${HEADER_DIR}/internal/catch_interfaces_tag_alias_registry.h
- ${HEADER_DIR}/internal/catch_interfaces_testcase.h
- ${HEADER_DIR}/internal/catch_leak_detector.h
- ${HEADER_DIR}/internal/catch_list.h
- ${HEADER_DIR}/internal/catch_matchers.h
- ${HEADER_DIR}/internal/catch_matchers_exception.hpp
- ${HEADER_DIR}/internal/catch_matchers_floating.h
- ${HEADER_DIR}/internal/catch_matchers_generic.hpp
- ${HEADER_DIR}/internal/catch_matchers_string.h
- ${HEADER_DIR}/internal/catch_matchers_vector.h
- ${HEADER_DIR}/internal/catch_message.h
- ${HEADER_DIR}/internal/catch_meta.hpp
- ${HEADER_DIR}/internal/catch_objc.hpp
- ${HEADER_DIR}/internal/catch_objc_arc.hpp
- ${HEADER_DIR}/internal/catch_option.hpp
- ${HEADER_DIR}/internal/catch_output_redirect.h
- ${HEADER_DIR}/internal/catch_platform.h
- ${HEADER_DIR}/internal/catch_polyfills.hpp
- ${HEADER_DIR}/internal/catch_preprocessor.hpp
- ${HEADER_DIR}/internal/catch_random_number_generator.h
- ${HEADER_DIR}/internal/catch_reenable_warnings.h
- ${HEADER_DIR}/internal/catch_reporter_registrars.hpp
- ${HEADER_DIR}/internal/catch_reporter_registry.h
- ${HEADER_DIR}/internal/catch_result_type.h
- ${HEADER_DIR}/internal/catch_run_context.h
- ${HEADER_DIR}/internal/catch_section.h
- ${HEADER_DIR}/internal/catch_section_info.h
- ${HEADER_DIR}/internal/catch_session.h
- ${HEADER_DIR}/internal/catch_singletons.hpp
- ${HEADER_DIR}/internal/catch_startup_exception_registry.h
- ${HEADER_DIR}/internal/catch_stream.h
- ${HEADER_DIR}/internal/catch_stringref.h
- ${HEADER_DIR}/internal/catch_string_manip.h
- ${HEADER_DIR}/internal/catch_suppress_warnings.h
- ${HEADER_DIR}/internal/catch_tag_alias.h
- ${HEADER_DIR}/internal/catch_tag_alias_autoregistrar.h
- ${HEADER_DIR}/internal/catch_tag_alias_registry.h
- ${HEADER_DIR}/internal/catch_test_case_info.h
- ${HEADER_DIR}/internal/catch_test_case_registry_impl.h
- ${HEADER_DIR}/internal/catch_test_case_tracker.h
- ${HEADER_DIR}/internal/catch_test_registry.h
- ${HEADER_DIR}/internal/catch_test_spec.h
- ${HEADER_DIR}/internal/catch_test_spec_parser.h
- ${HEADER_DIR}/internal/catch_text.h
- ${HEADER_DIR}/internal/catch_timer.h
- ${HEADER_DIR}/internal/catch_to_string.hpp
- ${HEADER_DIR}/internal/catch_tostring.h
- ${HEADER_DIR}/internal/catch_totals.h
- ${HEADER_DIR}/internal/catch_uncaught_exceptions.h
- ${HEADER_DIR}/internal/catch_user_interfaces.h
- ${HEADER_DIR}/internal/catch_version.h
- ${HEADER_DIR}/internal/catch_wildcard_pattern.h
- ${HEADER_DIR}/internal/catch_windows_h_proxy.h
- ${HEADER_DIR}/internal/catch_xmlwriter.h
- )
-set(IMPL_SOURCES
- ${HEADER_DIR}/internal/catch_approx.cpp
- ${HEADER_DIR}/internal/catch_assertionhandler.cpp
- ${HEADER_DIR}/internal/catch_assertionresult.cpp
- ${HEADER_DIR}/internal/catch_capture_matchers.cpp
- ${HEADER_DIR}/internal/catch_commandline.cpp
- ${HEADER_DIR}/internal/catch_common.cpp
- ${HEADER_DIR}/internal/catch_config.cpp
- ${HEADER_DIR}/internal/catch_console_colour.cpp
- ${HEADER_DIR}/internal/catch_context.cpp
- ${HEADER_DIR}/internal/catch_debug_console.cpp
- ${HEADER_DIR}/internal/catch_debugger.cpp
- ${HEADER_DIR}/internal/catch_decomposer.cpp
- ${HEADER_DIR}/internal/catch_enforce.cpp
- ${HEADER_DIR}/internal/catch_enum_values_registry.cpp
- ${HEADER_DIR}/internal/catch_errno_guard.cpp
- ${HEADER_DIR}/internal/catch_exception_translator_registry.cpp
- ${HEADER_DIR}/internal/catch_fatal_condition.cpp
- ${HEADER_DIR}/internal/catch_generators.cpp
- ${HEADER_DIR}/internal/catch_interfaces_capture.cpp
- ${HEADER_DIR}/internal/catch_interfaces_config.cpp
- ${HEADER_DIR}/internal/catch_interfaces_exception.cpp
- ${HEADER_DIR}/internal/catch_interfaces_generatortracker.h
- ${HEADER_DIR}/internal/catch_interfaces_registry_hub.cpp
- ${HEADER_DIR}/internal/catch_interfaces_runner.cpp
- ${HEADER_DIR}/internal/catch_interfaces_testcase.cpp
- ${HEADER_DIR}/internal/catch_list.cpp
- ${HEADER_DIR}/internal/catch_leak_detector.cpp
- ${HEADER_DIR}/internal/catch_matchers.cpp
- ${HEADER_DIR}/internal/catch_matchers_exception.cpp
- ${HEADER_DIR}/internal/catch_matchers_floating.cpp
- ${HEADER_DIR}/internal/catch_matchers_generic.cpp
- ${HEADER_DIR}/internal/catch_matchers_string.cpp
- ${HEADER_DIR}/internal/catch_message.cpp
- ${HEADER_DIR}/internal/catch_output_redirect.cpp
- ${HEADER_DIR}/internal/catch_registry_hub.cpp
- ${HEADER_DIR}/internal/catch_interfaces_reporter.cpp
- ${HEADER_DIR}/internal/catch_polyfills.cpp
- ${HEADER_DIR}/internal/catch_random_number_generator.cpp
- ${HEADER_DIR}/internal/catch_reporter_registry.cpp
- ${HEADER_DIR}/internal/catch_result_type.cpp
- ${HEADER_DIR}/internal/catch_run_context.cpp
- ${HEADER_DIR}/internal/catch_section.cpp
- ${HEADER_DIR}/internal/catch_section_info.cpp
- ${HEADER_DIR}/internal/catch_session.cpp
- ${HEADER_DIR}/internal/catch_singletons.cpp
- ${HEADER_DIR}/internal/catch_startup_exception_registry.cpp
- ${HEADER_DIR}/internal/catch_stream.cpp
- ${HEADER_DIR}/internal/catch_stringref.cpp
- ${HEADER_DIR}/internal/catch_string_manip.cpp
- ${HEADER_DIR}/internal/catch_tag_alias.cpp
- ${HEADER_DIR}/internal/catch_tag_alias_autoregistrar.cpp
- ${HEADER_DIR}/internal/catch_tag_alias_registry.cpp
- ${HEADER_DIR}/internal/catch_test_case_info.cpp
- ${HEADER_DIR}/internal/catch_test_case_registry_impl.cpp
- ${HEADER_DIR}/internal/catch_test_case_tracker.cpp
- ${HEADER_DIR}/internal/catch_test_registry.cpp
- ${HEADER_DIR}/internal/catch_test_spec.cpp
- ${HEADER_DIR}/internal/catch_test_spec_parser.cpp
- ${HEADER_DIR}/internal/catch_timer.cpp
- ${HEADER_DIR}/internal/catch_tostring.cpp
- ${HEADER_DIR}/internal/catch_totals.cpp
- ${HEADER_DIR}/internal/catch_uncaught_exceptions.cpp
- ${HEADER_DIR}/internal/catch_version.cpp
- ${HEADER_DIR}/internal/catch_wildcard_pattern.cpp
- ${HEADER_DIR}/internal/catch_xmlwriter.cpp
- )
-set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS})
-CheckFileList(INTERNAL_FILES ${HEADER_DIR}/internal)
-
-# Please keep these ordered alphabetically
-set(REPORTER_HEADERS
- ${HEADER_DIR}/reporters/catch_reporter_automake.hpp
- ${HEADER_DIR}/reporters/catch_reporter_bases.hpp
- ${HEADER_DIR}/reporters/catch_reporter_compact.h
- ${HEADER_DIR}/reporters/catch_reporter_console.h
- ${HEADER_DIR}/reporters/catch_reporter_junit.h
- ${HEADER_DIR}/reporters/catch_reporter_listening.h
- ${HEADER_DIR}/reporters/catch_reporter_tap.hpp
- ${HEADER_DIR}/reporters/catch_reporter_teamcity.hpp
- ${HEADER_DIR}/reporters/catch_reporter_xml.h
- ${HEADER_DIR}/reporters/catch_reporter_sonarqube.hpp
- )
-set(REPORTER_SOURCES
- ${HEADER_DIR}/reporters/catch_reporter_bases.cpp
- ${HEADER_DIR}/reporters/catch_reporter_compact.cpp
- ${HEADER_DIR}/reporters/catch_reporter_console.cpp
- ${HEADER_DIR}/reporters/catch_reporter_junit.cpp
- ${HEADER_DIR}/reporters/catch_reporter_listening.cpp
- ${HEADER_DIR}/reporters/catch_reporter_xml.cpp
- )
-set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES})
-CheckFileList(REPORTER_FILES ${HEADER_DIR}/reporters)
-
-# Specify the headers, too, so CLion recognises them as project files
-set(HEADERS
- ${TOP_LEVEL_HEADERS}
- ${EXTERNAL_HEADERS}
- ${INTERNAL_HEADERS}
- ${REPORTER_HEADERS}
- ${BENCHMARK_HEADERS}
- ${BENCHMARK_SOURCES}
-)
-
-# Provide some groupings for IDEs
-SOURCE_GROUP("Tests" FILES ${TEST_SOURCES})
-SOURCE_GROUP("Surrogates" FILES ${SURROGATE_SOURCES})
-
-include(CTest)
-
-add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${REPORTER_SOURCES} ${SURROGATE_SOURCES} ${HEADERS})
-target_include_directories(SelfTest PRIVATE ${HEADER_DIR})
-
-# It took CMake until 3.8 to abandon the doomed approach of enumerating
-# required features so we just list C++11 features to support older ones.
-target_compile_features(SelfTest
- PRIVATE
- cxx_alignas
- cxx_alignof
- cxx_attributes
- cxx_auto_type
- cxx_constexpr
- cxx_defaulted_functions
- cxx_deleted_functions
- cxx_final
- cxx_lambdas
- cxx_noexcept
- cxx_override
- cxx_range_for
- cxx_rvalue_references
- cxx_static_assert
- cxx_strong_enums
- cxx_trailing_return_types
- cxx_unicode_literals
- cxx_user_literals
- cxx_variadic_macros
-)
-
-
-if (CATCH_ENABLE_COVERAGE)
- set(ENABLE_COVERAGE ON CACHE BOOL "Enable coverage build." FORCE)
- find_package(codecov)
- add_coverage(SelfTest)
- list(APPEND LCOV_REMOVE_PATTERNS "'/usr/*'")
- coverage_evaluate()
-endif()
-
-# Add per compiler options
-if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
- target_compile_options( SelfTest PRIVATE -Wall -Wextra -Wunreachable-code -Wpedantic -Wmissing-declarations )
- if (CATCH_ENABLE_WERROR)
- target_compile_options( SelfTest PRIVATE -Werror )
- endif()
-endif()
-# Clang specific options go here
-if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
- target_compile_options( SelfTest PRIVATE -Wweak-vtables -Wexit-time-destructors -Wglobal-constructors -Wmissing-noreturn )
-endif()
-if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
- STRING(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # override default warning level
- target_compile_options( SelfTest PRIVATE /w44265 /w44061 /w44062 /w45038 )
- if (CATCH_ENABLE_WERROR)
- target_compile_options( SelfTest PRIVATE /WX)
- endif()
- # Force MSVC to consider everything as encoded in utf-8
- target_compile_options( SelfTest PRIVATE /utf-8 )
-endif()
-
-
-# configure unit tests via CTest
-add_test(NAME RunTests COMMAND $<TARGET_FILE:SelfTest>)
-set_tests_properties(RunTests PROPERTIES
- FAIL_REGULAR_EXPRESSION "Filters:"
-)
-
-add_test(NAME ListTests COMMAND $<TARGET_FILE:SelfTest> --list-tests --verbosity high)
-set_tests_properties(ListTests PROPERTIES
- PASS_REGULAR_EXPRESSION "[0-9]+ test cases"
- FAIL_REGULAR_EXPRESSION "Hidden Test"
-)
-
-add_test(NAME ListTags COMMAND $<TARGET_FILE:SelfTest> --list-tags)
-set_tests_properties(ListTags PROPERTIES
- PASS_REGULAR_EXPRESSION "[0-9]+ tags"
- FAIL_REGULAR_EXPRESSION "\\[\\.\\]")
-
-add_test(NAME ListReporters COMMAND $<TARGET_FILE:SelfTest> --list-reporters)
-set_tests_properties(ListReporters PROPERTIES PASS_REGULAR_EXPRESSION "Available reporters:")
-
-add_test(NAME ListTestNamesOnly COMMAND $<TARGET_FILE:SelfTest> --list-test-names-only)
-set_tests_properties(ListTestNamesOnly PROPERTIES
- PASS_REGULAR_EXPRESSION "Regex string matcher"
- FAIL_REGULAR_EXPRESSION "Hidden Test")
-
-add_test(NAME NoAssertions COMMAND $<TARGET_FILE:SelfTest> -w NoAssertions)
-set_tests_properties(NoAssertions PROPERTIES PASS_REGULAR_EXPRESSION "No assertions in test case")
-
-add_test(NAME NoTest COMMAND $<TARGET_FILE:SelfTest> Tracker, "___nonexistent_test___")
-set_tests_properties(NoTest PROPERTIES
- PASS_REGULAR_EXPRESSION "No test cases matched '___nonexistent_test___'"
- FAIL_REGULAR_EXPRESSION "No tests ran"
-)
-
-add_test(NAME WarnAboutNoTests COMMAND ${CMAKE_COMMAND} -P ${CATCH_DIR}/projects/SelfTest/WarnAboutNoTests.cmake $<TARGET_FILE:SelfTest>)
-
-add_test(NAME UnmatchedOutputFilter COMMAND $<TARGET_FILE:SelfTest> [this-tag-does-not-exist] -w NoTests)
-set_tests_properties(UnmatchedOutputFilter
- PROPERTIES
- PASS_REGULAR_EXPRESSION "No test cases matched '\\[this-tag-does-not-exist\\]'"
-)
-
-add_test(NAME FilteredSection-1 COMMAND $<TARGET_FILE:SelfTest> \#1394 -c RunSection)
-set_tests_properties(FilteredSection-1 PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran")
-add_test(NAME FilteredSection-2 COMMAND $<TARGET_FILE:SelfTest> \#1394\ nested -c NestedRunSection -c s1)
-set_tests_properties(FilteredSection-2 PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran")
-
-# AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable
-add_test(NAME ApprovalTests COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/scripts/approvalTests.py $<TARGET_FILE:SelfTest>)
-set_tests_properties(ApprovalTests PROPERTIES FAIL_REGULAR_EXPRESSION "Results differed")
-
-add_test(NAME RegressionCheck-1670 COMMAND $<TARGET_FILE:SelfTest> "#1670 regression check" -c A -r compact)
-set_tests_properties(RegressionCheck-1670 PROPERTIES PASS_REGULAR_EXPRESSION "Passed 1 test case with 2 assertions.")
-
-add_test(NAME VersionCheck COMMAND $<TARGET_FILE:SelfTest> -h)
-set_tests_properties(VersionCheck PROPERTIES PASS_REGULAR_EXPRESSION "Catch v${PROJECT_VERSION}")
-
-add_test(NAME LibIdentityTest COMMAND $<TARGET_FILE:SelfTest> --libidentify)
-set_tests_properties(LibIdentityTest PROPERTIES PASS_REGULAR_EXPRESSION "description: A Catch2 test executable")
-
-add_test(NAME FilenameAsTagsTest COMMAND $<TARGET_FILE:SelfTest> -\# --list-tags)
-set_tests_properties(FilenameAsTagsTest PROPERTIES PASS_REGULAR_EXPRESSION "\\[#Approx.tests\\]")
-
-add_test(NAME EscapeSpecialCharactersInTestNames COMMAND $<TARGET_FILE:SelfTest> "Test with special\\, characters \"in name")
-set_tests_properties(EscapeSpecialCharactersInTestNames PROPERTIES PASS_REGULAR_EXPRESSION "1 assertion in 1 test case")
-
-add_test(NAME TestsInFile::SimpleSpecs COMMAND $<TARGET_FILE:SelfTest> "-f ${CATCH_DIR}/projects/SelfTest/Misc/plain-old-tests.input")
-set_tests_properties(TestsInFile::SimpleSpecs PROPERTIES PASS_REGULAR_EXPRESSION "6 assertions in 2 test cases")
-
-add_test(NAME TestsInFile::EscapeSpecialCharacters COMMAND $<TARGET_FILE:SelfTest> "-f ${CATCH_DIR}/projects/SelfTest/Misc/special-characters-in-file.input")
-set_tests_properties(TestsInFile::EscapeSpecialCharacters PROPERTIES PASS_REGULAR_EXPRESSION "1 assertion in 1 test case")
-
-# CTest does not allow us to create an AND of required regular expressions,
-# so we have to split the test into 2 parts and look for parts of the expected
-# output separately.
-add_test(NAME TestsInFile::InvalidTestNames-1 COMMAND $<TARGET_FILE:SelfTest> "-f ${CATCH_DIR}/projects/SelfTest/Misc/invalid-test-names.input")
-set_tests_properties(TestsInFile::InvalidTestNames-1 PROPERTIES PASS_REGULAR_EXPRESSION "Invalid Filter: \"Test with special, characters in \\\\\" name\"")
-
-add_test(NAME TestsInFile::InvalidTestNames-2 COMMAND $<TARGET_FILE:SelfTest> "-f ${CATCH_DIR}/projects/SelfTest/Misc/invalid-test-names.input")
-set_tests_properties(TestsInFile::InvalidTestNames-2 PROPERTIES PASS_REGULAR_EXPRESSION "No tests ran")
-
-
-if (CATCH_USE_VALGRIND)
- add_test(NAME ValgrindRunTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest>)
- add_test(NAME ValgrindListTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest> --list-tests --verbosity high)
- set_tests_properties(ValgrindListTests PROPERTIES PASS_REGULAR_EXPRESSION "definitely lost: 0 bytes in 0 blocks")
- add_test(NAME ValgrindListTags COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest> --list-tags)
- set_tests_properties(ValgrindListTags PROPERTIES PASS_REGULAR_EXPRESSION "definitely lost: 0 bytes in 0 blocks")
-endif()
diff --git a/projects/ExtraTests/CMakeLists.txt b/projects/ExtraTests/CMakeLists.txt
deleted file mode 100644
index 0e514d96..00000000
--- a/projects/ExtraTests/CMakeLists.txt
+++ /dev/null
@@ -1,167 +0,0 @@
-#
-# Build extra tests.
-#
-# Requires CATCH_BUILD_EXTRA_TESTS to be defined 'true', see ../CMakeLists.txt.
-#
-
-cmake_minimum_required( VERSION 3.5 )
-
-project( Catch2ExtraTests LANGUAGES CXX )
-
-message( STATUS "Extra tests included" )
-
-# define folders used:
-
-set( TESTS_DIR ${CATCH_DIR}/projects/ExtraTests )
-set( SINGLE_INCLUDE_PATH ${CATCH_DIR}/single_include )
-
-
-add_executable(PrefixedMacros ${TESTS_DIR}/X01-PrefixedMacros.cpp)
-target_compile_definitions( PrefixedMacros PRIVATE CATCH_CONFIG_PREFIX_ALL )
-
-add_test(NAME CATCH_CONFIG_PREFIX_ALL COMMAND PrefixedMacros -s)
-set_tests_properties(
- CATCH_CONFIG_PREFIX_ALL
- PROPERTIES
- PASS_REGULAR_EXPRESSION "CATCH_"
- FAIL_REGULAR_EXPRESSION
- # The spaces are important -> They disambiguate between CATCH_REQUIRE
- # and REQUIRE without prefix.
- " REQUIRE; REQUIRE_FALSE; REQUIRE_THROWS; REQUIRE_THROWS_AS; REQUIRE_THROWS_WITH; REQUIRE_THROWS_MATCHES; REQUIRE_NOTHROW; CHECK; CHECK_FALSE; CHECKED_IF; CHECKED_ELSE; CHECK_NOFAIL; CHECK_THROWS; CHECK_THROWS_AS; CHECK_THROWS_WITH; CHECK_THROWS_MATCHES; CHECK_NOTHROW; REQUIRE_THAT; CHECK_THAT"
-)
-
-add_executable(DisabledMacros ${TESTS_DIR}/X02-DisabledMacros.cpp)
-target_compile_definitions( DisabledMacros PRIVATE CATCH_CONFIG_DISABLE )
-
-add_test(NAME CATCH_CONFIG_DISABLE-1 COMMAND DisabledMacros -s)
-set_tests_properties(
- CATCH_CONFIG_DISABLE-1
- PROPERTIES
- PASS_REGULAR_EXPRESSION "No tests ran"
- FAIL_REGULAR_EXPRESSION "This should not happen"
-)
-add_test(NAME CATCH_CONFIG_DISABLE-2 COMMAND DisabledMacros --list-tests)
-set_tests_properties(
- CATCH_CONFIG_DISABLE-2
- PROPERTIES
- PASS_REGULAR_EXPRESSION "0 test cases"
-)
-
-
-add_executable( DisabledExceptions-DefaultHandler ${TESTS_DIR}/X03-DisabledExceptions-DefaultHandler.cpp )
-add_executable( DisabledExceptions-CustomHandler ${TESTS_DIR}/X04-DisabledExceptions-CustomHandler.cpp )
-
-foreach(target DisabledExceptions-DefaultHandler DisabledExceptions-CustomHandler)
-target_compile_options( ${target}
- PRIVATE
- $<$<CXX_COMPILER_ID:MSVC>:/EHs-c-;/D_HAS_EXCEPTIONS=0>
- $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:AppleClang>>:-fno-exceptions>
-# $<$<CXX_COMPILER_ID:Clang>:-fno-exceptions>
-# $<$<CXX_COMPILER_ID:GNU>:-fno-exceptions>
-)
-endforeach()
-
-
-add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-1 COMMAND DisabledExceptions-DefaultHandler "Tests that run")
-set_tests_properties(
- CATCH_CONFIG_DISABLE_EXCEPTIONS-1
- PROPERTIES
- PASS_REGULAR_EXPRESSION "assertions: 4 \| 2 passed \| 2 failed"
- FAIL_REGULAR_EXPRESSION "abort;terminate;fatal"
-)
-
-add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-2 COMMAND DisabledExceptions-DefaultHandler "Tests that abort")
-set_tests_properties(
- CATCH_CONFIG_DISABLE_EXCEPTIONS-2
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Catch will terminate"
-)
-
-add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-3 COMMAND DisabledExceptions-CustomHandler "Tests that run")
-set_tests_properties(
- CATCH_CONFIG_DISABLE_EXCEPTIONS-3
- PROPERTIES
- PASS_REGULAR_EXPRESSION "assertions: 4 \| 2 passed \| 2 failed"
- FAIL_REGULAR_EXPRESSION "====== CUSTOM HANDLER ======"
-)
-
-add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-4 COMMAND DisabledExceptions-CustomHandler "Tests that abort")
-set_tests_properties(
- CATCH_CONFIG_DISABLE_EXCEPTIONS-4
- PROPERTIES
- PASS_REGULAR_EXPRESSION "====== CUSTOM HANDLER ======"
-)
-
-
-
-add_executable(FallbackStringifier ${TESTS_DIR}/X10-FallbackStringifier.cpp)
-target_compile_definitions( FallbackStringifier PRIVATE CATCH_CONFIG_FALLBACK_STRINGIFIER=fallbackStringifier )
-
-add_test(NAME FallbackStringifier COMMAND FallbackStringifier -r compact -s)
-set_tests_properties(
- FallbackStringifier
- PROPERTIES
- PASS_REGULAR_EXPRESSION "foo{} for: { !!! }"
-)
-
-
-add_executable(DisableStringification ${TESTS_DIR}/X11-DisableStringification.cpp)
-target_compile_definitions( DisableStringification PRIVATE CATCH_CONFIG_DISABLE_STRINGIFICATION )
-add_test(NAME CATCH_CONFIG_DISABLE_STRINGIFICATION COMMAND DisableStringification -r compact -s)
-set_tests_properties(
- CATCH_CONFIG_DISABLE_STRINGIFICATION
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
- FAIL_REGULAR_EXPRESSION "Hidden{} == Hidden{}"
-)
-
-
-add_executable(BenchmarkingMacros ${TESTS_DIR}/X20-BenchmarkingMacros.cpp)
-target_compile_definitions( BenchmarkingMacros PRIVATE CATCH_CONFIG_ENABLE_BENCHMARKING )
-
-add_test(NAME BenchmarkingMacros COMMAND BenchmarkingMacros -r console -s)
-set_tests_properties(
- BenchmarkingMacros
- PROPERTIES
- PASS_REGULAR_EXPRESSION "benchmark name samples iterations estimated"
-)
-
-# This test touches windows.h, so it should only be compiled under msvc
-if (MSVC)
- # This test fails if it does not compile and succeeds otherwise
- add_executable(WindowsHeader ${TESTS_DIR}/X90-WindowsHeaderInclusion.cpp)
- set_property( TARGET WindowsHeader PROPERTY CXX_STANDARD 11 )
- set_property( TARGET WindowsHeader PROPERTY CXX_STANDARD_REQUIRED ON )
- set_property( TARGET WindowsHeader PROPERTY CXX_EXTENSIONS OFF )
- target_include_directories( WindowsHeader PRIVATE ${SINGLE_INCLUDE_PATH} )
- add_test(NAME WindowsHeader COMMAND WindowsHeader -r compact)
-endif()
-
-add_executable(DebugBreakMacros ${TESTS_DIR}/X12-CustomDebugBreakMacro.cpp)
-add_test(NAME DebugBreakMacros COMMAND DebugBreakMacros --break)
-set_tests_properties(
- DebugBreakMacros
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Pretty please, break into debugger"
-)
-
-set( EXTRA_TEST_BINARIES
- PrefixedMacros
- DisabledMacros
- DisabledExceptions-DefaultHandler
- DisabledExceptions-CustomHandler
- FallbackStringifier
- DisableStringification
- BenchmarkingMacros
- DebugBreakMacros
-)
-
-# Shared config
-foreach( test ${EXTRA_TEST_BINARIES} )
- set_property( TARGET ${test} PROPERTY CXX_STANDARD 11 )
- set_property( TARGET ${test} PROPERTY CXX_STANDARD_REQUIRED ON )
- set_property( TARGET ${test} PROPERTY CXX_EXTENSIONS OFF )
- target_include_directories( ${test} PRIVATE ${SINGLE_INCLUDE_PATH} )
-endforeach()
-
-
diff --git a/projects/ExtraTests/ToDo.txt b/projects/ExtraTests/ToDo.txt
deleted file mode 100644
index ab68bd3e..00000000
--- a/projects/ExtraTests/ToDo.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Configuration options that are left default and thus are not properly tested
-yet:
-
- CATCH_CONFIG_COUNTER // Use __COUNTER__ to generate unique names for test cases
- CATCH_CONFIG_WINDOWS_SEH // Enable SEH handling on Windows
- CATCH_CONFIG_FAST_COMPILE // Sacrifices some (rather minor) features for compilation speed
- CATCH_CONFIG_DISABLE_MATCHERS // Do not compile Matchers in this compilation unit
- CATCH_CONFIG_POSIX_SIGNALS // Enable handling POSIX signals
- CATCH_CONFIG_WINDOWS_CRTDBG // Enable leak checking using Windows's CRT Debug Heap
- CATCH_CONFIG_DEFAULT_REPORTER
- CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS
diff --git a/projects/ExtraTests/X01-PrefixedMacros.cpp b/projects/ExtraTests/X01-PrefixedMacros.cpp
deleted file mode 100644
index 3d2ab9c1..00000000
--- a/projects/ExtraTests/X01-PrefixedMacros.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// X11-DisableStringification.cpp
-// Test that Catch's prefixed macros compile and run properly.
-
-#define CATCH_CONFIG_MAIN
-// This won't provide full coverage, but it might be worth checking
-// the other branch as well
-#define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
-#include <catch2/catch.hpp>
-
-#include <type_traits>
-#include <stdexcept>
-
-[[noreturn]]
-void this_throws() {
- throw std::runtime_error("Some msg");
-}
-void this_doesnt_throw() {}
-
-CATCH_TEST_CASE("PrefixedMacros") {
- using namespace Catch::Matchers;
-
- CATCH_REQUIRE( 1 == 1 );
- CATCH_REQUIRE_FALSE( 1 != 1 );
-
- CATCH_REQUIRE_THROWS(this_throws());
- CATCH_REQUIRE_THROWS_AS(this_throws(), std::runtime_error);
- CATCH_REQUIRE_THROWS_WITH(this_throws(), "Some msg");
- CATCH_REQUIRE_THROWS_MATCHES(this_throws(), std::runtime_error, Predicate<std::runtime_error>([](std::runtime_error const&) { return true; }));
- CATCH_REQUIRE_NOTHROW(this_doesnt_throw());
-
- CATCH_CHECK( 1 == 1 );
- CATCH_CHECK_FALSE( 1 != 1 );
- CATCH_CHECKED_IF( 1 == 1 ) {
- CATCH_SUCCEED("don't care");
- } CATCH_CHECKED_ELSE ( 1 == 1 ) {
- CATCH_SUCCEED("don't care");
- }
-
- CATCH_CHECK_NOFAIL(1 == 2);
-
- CATCH_CHECK_THROWS(this_throws());
- CATCH_CHECK_THROWS_AS(this_throws(), std::runtime_error);
- CATCH_CHECK_THROWS_WITH(this_throws(), "Some msg");
- CATCH_CHECK_THROWS_MATCHES(this_throws(), std::runtime_error, Predicate<std::runtime_error>([](std::runtime_error const&) { return true; }));
- CATCH_CHECK_NOTHROW(this_doesnt_throw());
-
- CATCH_REQUIRE_THAT("abcd", Equals("abcd"));
- CATCH_CHECK_THAT("bdef", Equals("bdef"));
-
- CATCH_INFO( "some info" );
- CATCH_UNSCOPED_INFO( "some info" );
- CATCH_WARN( "some warn" );
- CATCH_SECTION("some section") {
- int i = 1;
- CATCH_CAPTURE( i );
- CATCH_DYNAMIC_SECTION("Dynamic section: " << i) {
- CATCH_FAIL_CHECK( "failure" );
- }
- }
-
- CATCH_STATIC_REQUIRE( std::is_void<void>::value );
- CATCH_STATIC_REQUIRE_FALSE( std::is_void<int>::value );
-}
-
-CATCH_ANON_TEST_CASE() {
- CATCH_FAIL("");
-}
-
-// Missing:
-
-//
-// #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-// #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-// #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-//
-// // "BDD-style" convenience wrappers
-// #define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
-// #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-// #define CATCH_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
-// #define CATCH_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
-// #define CATCH_AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And when: " << desc )
-// #define CATCH_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
-// #define CATCH_AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
-//
diff --git a/projects/ExtraTests/X02-DisabledMacros.cpp b/projects/ExtraTests/X02-DisabledMacros.cpp
deleted file mode 100644
index 3a969d76..00000000
--- a/projects/ExtraTests/X02-DisabledMacros.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-// X02-DisabledMacros.cpp
-// Test that CATCH_CONFIG_DISABLE turns off TEST_CASE autoregistration
-// and expressions in assertion macros are not run.
-
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-
-// CATCH_CONFIG_DISABLE also prevents reporter registration.
-// We need to manually register at least one reporter for our tests
-static Catch::ReporterRegistrar<Catch::ConsoleReporter> temporary( "console" );
-
-#include <iostream>
-
-struct foo {
- foo(){
- REQUIRE_NOTHROW( print() );
- }
- void print() const {
- std::cout << "This should not happen\n";
- }
-};
-
-// Construct foo, but `foo::print` should not be run
-foo f;
-
-// This test should not be run, because it won't be registered
-TEST_CASE( "Disabled Macros" ) {
- std::cout << "This should not happen\n";
- FAIL();
-}
diff --git a/projects/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp b/projects/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp
deleted file mode 100644
index 846c9b0f..00000000
--- a/projects/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-TEST_CASE("Tests that run") {
- // All of these should be run and be reported
- CHECK(1 == 2);
- CHECK(1 == 1);
- CHECK(1 != 3);
- CHECK(1 == 4);
-}
-
-
-
-TEST_CASE("Tests that abort") {
- // Avoid abort and other exceptional exits -- there is no way
- // to tell CMake that abort is the desired outcome of a test.
- std::set_terminate([](){exit(1);});
- REQUIRE(1 == 1);
- REQUIRE(1 != 2);
- REQUIRE(1 == 3);
- // We should not get here, because the test above aborts
- REQUIRE(1 != 4);
-}
diff --git a/projects/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp b/projects/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp
deleted file mode 100644
index 96f3ceb8..00000000
--- a/projects/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#define CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER
-
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-namespace Catch {
- [[noreturn]]
- void throw_exception(std::exception const& e) {
- Catch::cerr() << "====== CUSTOM HANDLER ====== run terminates because an exception was thrown.\n"
- << "The message was: " << e.what() << '\n';
- // Avoid abort and other exceptional exits -- there is no way
- // to tell CMake that abort is the desired outcome of a test.
- exit(1);
- }
-}
-
-TEST_CASE("Tests that run") {
- // All of these should be run and be reported
- CHECK(1 == 2);
- CHECK(1 == 1);
- CHECK(1 != 3);
- CHECK(1 == 4);
-}
-
-
-
-TEST_CASE("Tests that abort") {
- REQUIRE(1 == 1);
- REQUIRE(1 != 2);
- REQUIRE(1 == 3);
- // We should not get here, because the test above aborts
- REQUIRE(1 != 4);
-}
diff --git a/projects/ExtraTests/X10-FallbackStringifier.cpp b/projects/ExtraTests/X10-FallbackStringifier.cpp
deleted file mode 100644
index 0522d1af..00000000
--- a/projects/ExtraTests/X10-FallbackStringifier.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// X10-FallbackStringifier.cpp
-// Test that defining fallbackStringifier compiles
-
-#include <string>
-
-// A catch-all stringifier
-template <typename T>
-std::string fallbackStringifier(T const&) {
- return "{ !!! }";
-}
-
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-struct foo {
- explicit operator bool() const {
- return true;
- }
-};
-
-TEST_CASE("aa") {
- REQUIRE(foo{});
-}
diff --git a/projects/ExtraTests/X11-DisableStringification.cpp b/projects/ExtraTests/X11-DisableStringification.cpp
deleted file mode 100644
index 7a93f6e2..00000000
--- a/projects/ExtraTests/X11-DisableStringification.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// X11-DisableStringification.cpp
-// Test that stringification of original expression can be disabled
-// this is a workaround for VS 2017 issue with Raw String literal
-// and preprocessor token pasting. In other words, hopefully this test
-// will be deleted soon :-)
-
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-struct Hidden {};
-
-bool operator==(Hidden, Hidden) { return true; }
-
-TEST_CASE("DisableStringification") {
- REQUIRE( Hidden{} == Hidden{} );
-}
diff --git a/projects/ExtraTests/X12-CustomDebugBreakMacro.cpp b/projects/ExtraTests/X12-CustomDebugBreakMacro.cpp
deleted file mode 100644
index 25ab4a0e..00000000
--- a/projects/ExtraTests/X12-CustomDebugBreakMacro.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// X12-CustomDebugBreakMacro.cpp
-// Test that user-defined `CATCH_BREAK_INTO_DEBUGGER` is respected and used.
-
-#include <iostream>
-
-void custom_debug_break() {
- std::cerr << "Pretty please, break into debugger\n";
-}
-
-#define CATCH_BREAK_INTO_DEBUGGER() custom_debug_break()
-
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-TEST_CASE("Failing test that breaks into debugger", "[macros]") {
- REQUIRE(1 == 2);
-}
diff --git a/projects/ExtraTests/X20-BenchmarkingMacros.cpp b/projects/ExtraTests/X20-BenchmarkingMacros.cpp
deleted file mode 100644
index ca2f056b..00000000
--- a/projects/ExtraTests/X20-BenchmarkingMacros.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-// X20-BenchmarkingMacros.cpp
-// Test that the benchmarking support macros compile properly with the single header
-
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-namespace {
-std::uint64_t factorial(std::uint64_t number) {
- if (number < 2) {
- return 1;
- }
- return number * factorial(number - 1);
-}
-}
-
-TEST_CASE("Benchmark factorial", "[benchmark]") {
- CHECK(factorial(0) == 1);
- // some more asserts..
- CHECK(factorial(10) == 3628800);
-
- BENCHMARK("factorial 10") {
- return factorial(10);
- };
-
- CHECK(factorial(14) == 87178291200ull);
- BENCHMARK("factorial 14") {
- return factorial(14);
- };
-}
-
-TEST_CASE("Benchmark containers", "[.][benchmark]") {
- static const int size = 100;
-
- std::vector<int> v;
- std::map<int, int> m;
-
- SECTION("without generator") {
- BENCHMARK("Load up a vector") {
- v = std::vector<int>();
- for (int i = 0; i < size; ++i)
- v.push_back(i);
- };
- REQUIRE(v.size() == size);
-
- // test optimizer control
- BENCHMARK("Add up a vector's content") {
- uint64_t add = 0;
- for (int i = 0; i < size; ++i)
- add += v[i];
- return add;
- };
-
- BENCHMARK("Load up a map") {
- m = std::map<int, int>();
- for (int i = 0; i < size; ++i)
- m.insert({ i, i + 1 });
- };
- REQUIRE(m.size() == size);
-
- BENCHMARK("Reserved vector") {
- v = std::vector<int>();
- v.reserve(size);
- for (int i = 0; i < size; ++i)
- v.push_back(i);
- };
- REQUIRE(v.size() == size);
-
- BENCHMARK("Resized vector") {
- v = std::vector<int>();
- v.resize(size);
- for (int i = 0; i < size; ++i)
- v[i] = i;
- };
- REQUIRE(v.size() == size);
-
- int array[size];
- BENCHMARK("A fixed size array that should require no allocations") {
- for (int i = 0; i < size; ++i)
- array[i] = i;
- };
- int sum = 0;
- for (int i = 0; i < size; ++i)
- sum += array[i];
- REQUIRE(sum > size);
-
- SECTION("XYZ") {
-
- BENCHMARK_ADVANCED("Load up vector with chronometer")(Catch::Benchmark::Chronometer meter) {
- std::vector<int> k;
- meter.measure([&](int idx) {
- k = std::vector<int>();
- for (int i = 0; i < size; ++i)
- k.push_back(idx);
- });
- REQUIRE(k.size() == size);
- };
-
- int runs = 0;
- BENCHMARK("Fill vector indexed", benchmarkIndex) {
- v = std::vector<int>();
- v.resize(size);
- for (int i = 0; i < size; ++i)
- v[i] = benchmarkIndex;
- runs = benchmarkIndex;
- };
-
- for (size_t i = 0; i < v.size(); ++i) {
- REQUIRE(v[i] == runs);
- }
- }
- }
-
- SECTION("with generator") {
- auto generated = GENERATE(range(0, 10));
- BENCHMARK("Fill vector generated") {
- v = std::vector<int>();
- v.resize(size);
- for (int i = 0; i < size; ++i)
- v[i] = generated;
- };
- for (size_t i = 0; i < v.size(); ++i) {
- REQUIRE(v[i] == generated);
- }
- }
-}
diff --git a/projects/ExtraTests/X90-WindowsHeaderInclusion.cpp b/projects/ExtraTests/X90-WindowsHeaderInclusion.cpp
deleted file mode 100644
index 2b7a074e..00000000
--- a/projects/ExtraTests/X90-WindowsHeaderInclusion.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// X90-WindowsHeaderInclusion.cpp
-// Test that the Catch2 header compiles even after including windows.h
-// without defining NOMINMAX first. As an FYI, if you do that, you are
-// wrong.
-
-#include <windows.h>
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
-
-TEST_CASE("Catch2 did survive compilation with windows.h", "[compile-test]") {
- SUCCEED();
-}
diff --git a/projects/SelfTest/Baselines/automake.std.approved.txt b/projects/SelfTest/Baselines/automake.std.approved.txt
deleted file mode 100644
index 057be069..00000000
--- a/projects/SelfTest/Baselines/automake.std.approved.txt
+++ /dev/null
@@ -1,168 +0,0 @@
-:test-result: PASS # A test name that starts with a #
-:test-result: PASS #542
-:test-result: PASS #809
-:test-result: FAIL 'Not' checks that should fail
-:test-result: PASS 'Not' checks that should succeed
-:test-result: PASS (unimplemented) static bools can be evaluated
-:test-result: FAIL A METHOD_AS_TEST_CASE based test run that fails
-:test-result: PASS A METHOD_AS_TEST_CASE based test run that succeeds
-:test-result: FAIL A TEST_CASE_METHOD based test run that fails
-:test-result: PASS A TEST_CASE_METHOD based test run that succeeds
-:test-result: FAIL A couple of nested sections followed by a failure
-:test-result: FAIL A failing expression with a non streamable type is still captured
-:test-result: PASS AllOf matcher
-:test-result: PASS An empty test with no assertions
-:test-result: PASS An expression with side-effects should only be evaluated once
-:test-result: FAIL An unchecked exception reports the line of the last assertion
-:test-result: PASS Anonymous test case 1
-:test-result: PASS AnyOf matcher
-:test-result: PASS Approximate PI
-:test-result: PASS Approximate comparisons with different epsilons
-:test-result: PASS Approximate comparisons with floats
-:test-result: PASS Approximate comparisons with ints
-:test-result: PASS Approximate comparisons with mixed numeric types
-:test-result: PASS Assertions then sections
-:test-result: PASS Character pretty printing
-:test-result: PASS Comparing function pointers
-:test-result: PASS Comparing member function pointers
-:test-result: PASS Comparisons between ints where one side is computed
-:test-result: PASS Comparisons between unsigned ints and negative signed ints match c++ standard behaviour
-:test-result: PASS Comparisons with int literals don't warn when mixing signed/ unsigned
-:test-result: FAIL Contains string matcher
-:test-result: FAIL Custom exceptions can be translated when testing for nothrow
-:test-result: FAIL Custom exceptions can be translated when testing for throwing as something else
-:test-result: FAIL Custom std-exceptions can be custom translated
-:test-result: PASS Demonstrate that a non-const == is not used
-:test-result: FAIL EndsWith string matcher
-:test-result: XFAIL Equality checks that should fail
-:test-result: PASS Equality checks that should succeed
-:test-result: PASS Equals
-:test-result: FAIL Equals string matcher
-:test-result: PASS Exception messages can be tested for
-:test-result: FAIL Expected exceptions that don't throw or unexpected exceptions fail the test
-:test-result: FAIL FAIL aborts the test
-:test-result: FAIL FAIL does not require an argument
-:test-result: PASS Factorials are computed
-:test-result: PASS Generator over a range of pairs
-:test-result: PASS Generators over two ranges
-:test-result: PASS Greater-than inequalities with different epsilons
-:test-result: PASS INFO and WARN do not abort tests
-:test-result: FAIL INFO gets logged on failure
-:test-result: FAIL INFO gets logged on failure, even if captured before successful assertions
-:test-result: XFAIL Inequality checks that should fail
-:test-result: PASS Inequality checks that should succeed
-:test-result: PASS Less-than inequalities with different epsilons
-:test-result: PASS Long strings can be wrapped
-:test-result: PASS Long text is truncated
-:test-result: PASS ManuallyRegistered
-:test-result: PASS Matchers can be (AllOf) composed with the && operator
-:test-result: PASS Matchers can be (AnyOf) composed with the || operator
-:test-result: PASS Matchers can be composed with both && and ||
-:test-result: FAIL Matchers can be composed with both && and || - failing
-:test-result: PASS Matchers can be negated (Not) with the ! operator
-:test-result: FAIL Matchers can be negated (Not) with the ! operator - failing
-:test-result: FAIL Mismatching exception messages failing the test
-:test-result: PASS Nice descriptive name
-:test-result: FAIL Non-std exceptions can be translated
-:test-result: PASS NotImplemented exception
-:test-result: PASS Objects that evaluated in boolean contexts can be checked
-:test-result: PASS Operators at different namespace levels not hijacked by Koenig lookup
-:test-result: FAIL Ordering comparison checks that should fail
-:test-result: PASS Ordering comparison checks that should succeed
-:test-result: FAIL Output from all sections is reported
-:test-result: PASS Parse test names and tags
-:test-result: PASS Parsing a std::pair
-:test-result: PASS Pointers can be compared to null
-:test-result: PASS Pointers can be converted to strings
-:test-result: PASS Process can be configured on command line
-:test-result: FAIL SCOPED_INFO is reset for each loop
-:test-result: PASS SUCCEED counts as a test pass
-:test-result: PASS SUCCESS does not require an argument
-:test-result: PASS Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods
-:test-result: PASS Scenario: Do that thing with the thing
-:test-result: PASS Scenario: This is a really long scenario name to see how the list command deals with wrapping
-:test-result: PASS Scenario: Vector resizing affects size and capacity
-A string sent directly to stdout
-A string sent directly to stderr
-:test-result: PASS Sends stuff to stdout and stderr
-:test-result: PASS Some simple comparisons between doubles
-Message from section one
-Message from section two
-:test-result: PASS Standard output from all sections is reported
-:test-result: FAIL StartsWith string matcher
-:test-result: PASS String matchers
-hello
-hello
-:test-result: PASS Strings can be rendered with colour
-:test-result: FAIL Tabs and newlines show in output
-:test-result: PASS Tag alias can be registered against tag patterns
-:test-result: PASS Test case with one argument
-:test-result: PASS Test enum bit values
-:test-result: PASS Text can be formatted using the Text class
-:test-result: PASS The NO_FAIL macro reports a failure but does not fail the test
-:test-result: FAIL This test 'should' fail but doesn't
-:test-result: PASS Tracker
-:test-result: FAIL Unexpected exceptions can be translated
-:test-result: PASS Use a custom approx
-:test-result: PASS Variadic macros
-:test-result: PASS When checked exceptions are thrown they can be expected or unexpected
-:test-result: FAIL When unchecked exceptions are thrown directly they are always failures
-:test-result: FAIL When unchecked exceptions are thrown during a CHECK the test should continue
-:test-result: FAIL When unchecked exceptions are thrown during a REQUIRE the test should abort fail
-:test-result: FAIL When unchecked exceptions are thrown from functions they are always failures
-:test-result: FAIL When unchecked exceptions are thrown from sections they are always failures
-:test-result: PASS When unchecked exceptions are thrown, but caught, they do not affect the test
-:test-result: PASS Where the LHS is not a simple value
-:test-result: PASS Where there is more to the expression after the RHS
-:test-result: PASS X/level/0/a
-:test-result: PASS X/level/0/b
-:test-result: PASS X/level/1/a
-:test-result: PASS X/level/1/b
-:test-result: PASS XmlEncode
-:test-result: PASS atomic if
-:test-result: PASS boolean member
-:test-result: PASS checkedElse
-:test-result: FAIL checkedElse, failing
-:test-result: PASS checkedIf
-:test-result: FAIL checkedIf, failing
-:test-result: PASS comparisons between const int variables
-:test-result: PASS comparisons between int variables
-:test-result: PASS even more nested SECTION tests
-:test-result: PASS first tag
-spanner:test-result: PASS has printf
-:test-result: FAIL just failure
-:test-result: PASS just info
-:test-result: FAIL looped SECTION tests
-:test-result: FAIL looped tests
-:test-result: FAIL more nested SECTION tests
-:test-result: PASS nested SECTION tests
-:test-result: PASS non streamable - with conv. op
-:test-result: PASS not allowed
-:test-result: PASS null strings
-:test-result: PASS pair<pair<int,const char *,pair<std::string,int> > -> toString
-:test-result: PASS pointer to class
-:test-result: PASS random SECTION tests
-:test-result: PASS replaceInPlace
-:test-result: PASS second tag
-:test-result: FAIL send a single char to INFO
-:test-result: FAIL sends information to INFO
-:test-result: PASS std::pair<int,const std::string> -> toString
-:test-result: PASS std::pair<int,std::string> -> toString
-:test-result: PASS std::vector<std::pair<std::string,int> > -> toString
-:test-result: FAIL string literals of different sizes can be compared
-:test-result: PASS toString on const wchar_t const pointer returns the string contents
-:test-result: PASS toString on const wchar_t pointer returns the string contents
-:test-result: PASS toString on wchar_t const pointer returns the string contents
-:test-result: PASS toString on wchar_t returns the string contents
-:test-result: PASS toString( has_maker )
-:test-result: PASS toString( has_maker_and_toString )
-:test-result: PASS toString( has_toString )
-:test-result: PASS toString( vectors<has_maker )
-:test-result: SKIP toString( vectors<has_maker_and_toString )
-:test-result: SKIP toString( vectors<has_toString )
-:test-result: PASS toString(enum w/operator<<)
-:test-result: PASS toString(enum)
-:test-result: PASS vector<int> -> toString
-:test-result: PASS vector<string> -> toString
-:test-result: PASS vectors can be sized and resized
-:test-result: PASS xmlentitycheck
diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt
deleted file mode 100644
index c61028a2..00000000
--- a/projects/SelfTest/Baselines/compact.sw.approved.txt
+++ /dev/null
@@ -1,1816 +0,0 @@
-Misc.tests.cpp:<line number>: passed: with 1 message: 'yay'
-Decomposition.tests.cpp:<line number>: passed: fptr == 0 for: 0 == 0
-Decomposition.tests.cpp:<line number>: passed: fptr == 0l for: 0 == 0
-Compilation.tests.cpp:<line number>: passed: y.v == 0 for: 0 == 0
-Compilation.tests.cpp:<line number>: passed: 0 == y.v for: 0 == 0
-Compilation.tests.cpp:<line number>: passed: y.v == 0 for: 0 == 0
-Compilation.tests.cpp:<line number>: passed: 0 == y.v for: 0 == 0
-Compilation.tests.cpp:<line number>: passed: t1 == t2 for: {?} == {?}
-Compilation.tests.cpp:<line number>: passed: t1 != t2 for: {?} != {?}
-Compilation.tests.cpp:<line number>: passed: t1 < t2 for: {?} < {?}
-Compilation.tests.cpp:<line number>: passed: t1 > t2 for: {?} > {?}
-Compilation.tests.cpp:<line number>: passed: t1 <= t2 for: {?} <= {?}
-Compilation.tests.cpp:<line number>: passed: t1 >= t2 for: {?} >= {?}
-Misc.tests.cpp:<line number>: passed:
-Compilation.tests.cpp:<line number>: passed: std::memcmp(uarr, "123", sizeof(uarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"'
-Compilation.tests.cpp:<line number>: passed: std::memcmp(sarr, "456", sizeof(sarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"'
-Compilation.tests.cpp:<line number>: passed:
-Compilation.tests.cpp:<line number>: passed: h1 == h2 for: [1403 helper] == [1403 helper]
-Message.tests.cpp:<line number>: warning: '
-This info message starts with a linebreak' with 1 message: '
-This warning message starts with a linebreak'
-This would not be caught previously
-Nor would this
-Tricky.tests.cpp:<line number>: failed: explicitly with 1 message: '1514'
-Compilation.tests.cpp:<line number>: passed: std::is_same<TypeList<int>, TypeList<int>>::value for: true
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42' with 1 message: 'expected exception'
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42'; expression was: thisThrows() with 1 message: 'expected exception'
-Exception.tests.cpp:<line number>: passed: thisThrows() with 1 message: 'answer := 42'
-Compilation.tests.cpp:<line number>: passed: 42 == f for: 42 == {?}
-Compilation.tests.cpp:<line number>: passed: a == t for: 3 == 3
-Compilation.tests.cpp:<line number>: passed: a == t for: 3 == 3
-Compilation.tests.cpp:<line number>: passed: throws_int(true)
-Compilation.tests.cpp:<line number>: passed: throws_int(true), int
-Compilation.tests.cpp:<line number>: passed: throws_int(false)
-Compilation.tests.cpp:<line number>: passed: "aaa", Catch::EndsWith("aaa") for: "aaa" ends with: "aaa"
-Compilation.tests.cpp:<line number>: passed: templated_tests<int>(3) for: true
-Misc.tests.cpp:<line number>: failed: f() == 0 for: 1 == 0
-Misc.tests.cpp:<line number>: passed: errno == 1 for: 1 == 1
-Compilation.tests.cpp:<line number>: passed: x == 4 for: {?} == 4 with 1 message: 'dummy := 0'
-Misc.tests.cpp:<line number>: passed: with 1 message: 'Everything is OK'
-Misc.tests.cpp:<line number>: passed: with 1 message: 'Everything is OK'
-Misc.tests.cpp:<line number>: passed: with 1 message: 'Everything is OK'
-Misc.tests.cpp:<line number>: passed: with 1 message: 'Everything is OK'
-Misc.tests.cpp:<line number>: passed: with 1 message: 'Everything is OK'
-Condition.tests.cpp:<line number>: failed: false != false
-Condition.tests.cpp:<line number>: failed: true != true
-Condition.tests.cpp:<line number>: failed: !true for: false
-Condition.tests.cpp:<line number>: failed: !(true) for: !true
-Condition.tests.cpp:<line number>: failed: !trueValue for: false
-Condition.tests.cpp:<line number>: failed: !(trueValue) for: !true
-Condition.tests.cpp:<line number>: failed: !(1 == 1) for: false
-Condition.tests.cpp:<line number>: failed: !(1 == 1)
-Condition.tests.cpp:<line number>: passed: false == false
-Condition.tests.cpp:<line number>: passed: true == true
-Condition.tests.cpp:<line number>: passed: !false for: true
-Condition.tests.cpp:<line number>: passed: !(false) for: !false
-Condition.tests.cpp:<line number>: passed: !falseValue for: true
-Condition.tests.cpp:<line number>: passed: !(falseValue) for: !false
-Condition.tests.cpp:<line number>: passed: !(1 == 2) for: true
-Condition.tests.cpp:<line number>: passed: !(1 == 2)
-Tricky.tests.cpp:<line number>: passed: is_true<true>::value == true for: true == true
-Tricky.tests.cpp:<line number>: passed: true == is_true<true>::value for: true == true
-Tricky.tests.cpp:<line number>: passed: is_true<false>::value == false for: false == false
-Tricky.tests.cpp:<line number>: passed: false == is_true<false>::value for: false == false
-Tricky.tests.cpp:<line number>: passed: !is_true<false>::value for: true
-Tricky.tests.cpp:<line number>: passed: !!is_true<true>::value for: true
-Tricky.tests.cpp:<line number>: passed: is_true<true>::value for: true
-Tricky.tests.cpp:<line number>: passed: !(is_true<false>::value) for: !false
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 1 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 1 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 2 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 2 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 4
-Generators.tests.cpp:<line number>: passed: y < z for: 4 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 5
-Generators.tests.cpp:<line number>: passed: y < z for: 5 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 9
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 7
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 7
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 8
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 8
-Generators.tests.cpp:<line number>: passed: x < y for: 3 < 6
-Generators.tests.cpp:<line number>: passed: y < z for: 6 < 9
-Generators.tests.cpp:<line number>: passed: x < z for: 3 < 9
-Class.tests.cpp:<line number>: failed: s == "world" for: "hello" == "world"
-Class.tests.cpp:<line number>: passed: s == "hello" for: "hello" == "hello"
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 6 < 2
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 2 < 2
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 6 < 2
-Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 2 < 2
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 6 >= 2
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 2 >= 2
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 6 >= 2
-Class.tests.cpp:<line number>: passed: Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 2 >= 2
-Class.tests.cpp:<line number>: failed: Template_Fixture<TestType>::m_a == 2 for: 1.0 == 2
-Class.tests.cpp:<line number>: failed: Template_Fixture<TestType>::m_a == 2 for: 1.0f == 2
-Class.tests.cpp:<line number>: failed: Template_Fixture<TestType>::m_a == 2 for: 1 == 2
-Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
-Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0f == 1
-Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
-Class.tests.cpp:<line number>: failed: Nttp_Fixture<V>::value == 0 for: 1 == 0
-Class.tests.cpp:<line number>: failed: Nttp_Fixture<V>::value == 0 for: 3 == 0
-Class.tests.cpp:<line number>: failed: Nttp_Fixture<V>::value == 0 for: 6 == 0
-Class.tests.cpp:<line number>: passed: Nttp_Fixture<V>::value > 0 for: 1 > 0
-Class.tests.cpp:<line number>: passed: Nttp_Fixture<V>::value > 0 for: 3 > 0
-Class.tests.cpp:<line number>: passed: Nttp_Fixture<V>::value > 0 for: 6 > 0
-Class.tests.cpp:<line number>: failed: m_a == 2 for: 1 == 2
-Class.tests.cpp:<line number>: passed: m_a == 1 for: 1 == 1
-Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: x.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: x.size() > 0 for: 42 > 0
-Misc.tests.cpp:<line number>: passed: x.size() > 0 for: 9 > 0
-Misc.tests.cpp:<line number>: passed: x.size() > 0 for: 42 > 0
-Misc.tests.cpp:<line number>: passed: x.size() > 0 for: 9 > 0
-Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.23 == Approx( 1.23 )
-Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.23 != Approx( 1.22 )
-Approx.tests.cpp:<line number>: passed: -d == -1.23_a for: -1.23 == Approx( -1.23 )
-Approx.tests.cpp:<line number>: passed: d == 1.2_a .epsilon(.1) for: 1.23 == Approx( 1.2 )
-Approx.tests.cpp:<line number>: passed: d != 1.2_a .epsilon(.001) for: 1.23 != Approx( 1.2 )
-Approx.tests.cpp:<line number>: passed: d == 1_a .epsilon(.3) for: 1.23 == Approx( 1.0 )
-Misc.tests.cpp:<line number>: passed: with 1 message: 'that's not flying - that's failing in style'
-Misc.tests.cpp:<line number>: failed: explicitly with 1 message: 'to infinity and beyond'
-Tricky.tests.cpp:<line number>: failed: &o1 == &o2 for: 0x<hex digits> == 0x<hex digits>
-Tricky.tests.cpp:<line number>: failed: o1 == o2 for: {?} == {?}
-Approx.tests.cpp:<line number>: passed: 104.0 != Approx(100.0) for: 104.0 != Approx( 100.0 )
-Approx.tests.cpp:<line number>: passed: 104.0 == Approx(100.0).margin(5) for: 104.0 == Approx( 100.0 )
-Approx.tests.cpp:<line number>: passed: 104.0 == Approx(100.0).margin(4) for: 104.0 == Approx( 100.0 )
-Approx.tests.cpp:<line number>: passed: 104.0 != Approx(100.0).margin(3) for: 104.0 != Approx( 100.0 )
-Approx.tests.cpp:<line number>: passed: 100.3 != Approx(100.0) for: 100.3 != Approx( 100.0 )
-Approx.tests.cpp:<line number>: passed: 100.3 == Approx(100.0).margin(0.5) for: 100.3 == Approx( 100.0 )
-Tricky.tests.cpp:<line number>: passed: i++ == 7 for: 7 == 7
-Tricky.tests.cpp:<line number>: passed: i++ == 8 for: 8 == 8
-Exception.tests.cpp:<line number>: passed: 1 == 1
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'unexpected exception'; expression was: {Unknown expression after the reported line}
-VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'anonymous test case'
-Approx.tests.cpp:<line number>: passed: Approx(0).margin(0)
-Approx.tests.cpp:<line number>: passed: Approx(0).margin(1234656)
-Approx.tests.cpp:<line number>: passed: Approx(0).margin(-2), std::domain_error
-Approx.tests.cpp:<line number>: passed: Approx(0).epsilon(0)
-Approx.tests.cpp:<line number>: passed: Approx(0).epsilon(1)
-Approx.tests.cpp:<line number>: passed: Approx(0).epsilon(-0.001), std::domain_error
-Approx.tests.cpp:<line number>: passed: Approx(0).epsilon(1.0001), std::domain_error
-Approx.tests.cpp:<line number>: passed: 0.25f == Approx(0.0f).margin(0.25f) for: 0.25f == Approx( 0.0 )
-Approx.tests.cpp:<line number>: passed: 0.0f == Approx(0.25f).margin(0.25f) for: 0.0f == Approx( 0.25 )
-Approx.tests.cpp:<line number>: passed: 0.5f == Approx(0.25f).margin(0.25f) for: 0.5f == Approx( 0.25 )
-Approx.tests.cpp:<line number>: passed: 245.0f == Approx(245.25f).margin(0.25f) for: 245.0f == Approx( 245.25 )
-Approx.tests.cpp:<line number>: passed: 245.5f == Approx(245.25f).margin(0.25f) for: 245.5f == Approx( 245.25 )
-Approx.tests.cpp:<line number>: passed: divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) for: 3.1428571429 == Approx( 3.141 )
-Approx.tests.cpp:<line number>: passed: divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.1428571429 != Approx( 3.141 )
-Approx.tests.cpp:<line number>: passed: d != Approx( 1.231 ) for: 1.23 != Approx( 1.231 )
-Approx.tests.cpp:<line number>: passed: d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.23 == Approx( 1.231 )
-Approx.tests.cpp:<line number>: passed: 1.23f == Approx( 1.23f ) for: 1.23f == Approx( 1.2300000191 )
-Approx.tests.cpp:<line number>: passed: 0.0f == Approx( 0.0f ) for: 0.0f == Approx( 0.0 )
-Approx.tests.cpp:<line number>: passed: 1 == Approx( 1 ) for: 1 == Approx( 1.0 )
-Approx.tests.cpp:<line number>: passed: 0 == Approx( 0 ) for: 0 == Approx( 0.0 )
-Approx.tests.cpp:<line number>: passed: 1.0f == Approx( 1 ) for: 1.0f == Approx( 1.0 )
-Approx.tests.cpp:<line number>: passed: 0 == Approx( dZero) for: 0 == Approx( 0.0 )
-Approx.tests.cpp:<line number>: passed: 0 == Approx( dSmall ).margin( 0.001 ) for: 0 == Approx( 0.00001 )
-Approx.tests.cpp:<line number>: passed: 1.234f == Approx( dMedium ) for: 1.234f == Approx( 1.234 )
-Approx.tests.cpp:<line number>: passed: dMedium == Approx( 1.234f ) for: 1.234 == Approx( 1.2339999676 )
-Matchers.tests.cpp:<line number>: passed: 1, Predicate<int>(alwaysTrue, "always true") for: 1 matches predicate: "always true"
-Matchers.tests.cpp:<line number>: passed: 1, !Predicate<int>(alwaysFalse, "always false") for: 1 not matches predicate: "always false"
-Matchers.tests.cpp:<line number>: passed: "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") for: "Hello olleH" matches predicate: "First and last character should be equal"
-Matchers.tests.cpp:<line number>: passed: "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) for: "This wouldn't pass" not matches undescribed predicate
-Tricky.tests.cpp:<line number>: passed: true
-Tricky.tests.cpp:<line number>: passed: true
-Tricky.tests.cpp:<line number>: passed: true
-Tricky.tests.cpp:<line number>: passed: true
-Tricky.tests.cpp:<line number>: passed: true
-Tricky.tests.cpp:<line number>: passed: true
-Message.tests.cpp:<line number>: passed: with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true'
-Message.tests.cpp:<line number>: passed: with 7 messages: 'std::vector<int>{1, 2, 3}[0, 1, 2] := 3' and 'std::vector<int>{1, 2, 3}[(0, 1)] := 2' and 'std::vector<int>{1, 2, 3}[0] := 1' and '(helper_1436<int, int>{12, -12}) := { 12, -12 }' and '(helper_1436<int, int>(-12, 12)) := { -12, 12 }' and '(1, 2) := 2' and '(2, 3) := 3'
-Message.tests.cpp:<line number>: passed: with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{''
-ToStringGeneral.tests.cpp:<line number>: passed: true with 1 message: 'i := 2'
-ToStringGeneral.tests.cpp:<line number>: passed: true with 1 message: '3'
-ToStringGeneral.tests.cpp:<line number>: passed: tab == '\t' for: '\t' == '\t'
-ToStringGeneral.tests.cpp:<line number>: passed: newline == '\n' for: '\n' == '\n'
-ToStringGeneral.tests.cpp:<line number>: passed: carr_return == '\r' for: '\r' == '\r'
-ToStringGeneral.tests.cpp:<line number>: passed: form_feed == '\f' for: '\f' == '\f'
-ToStringGeneral.tests.cpp:<line number>: passed: space == ' ' for: ' ' == ' '
-ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'a' == 'a'
-ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'z' == 'z'
-ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'A' == 'A'
-ToStringGeneral.tests.cpp:<line number>: passed: c == chars[i] for: 'Z' == 'Z'
-ToStringGeneral.tests.cpp:<line number>: passed: null_terminator == '\0' for: 0 == 0
-ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 2 == 2
-ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 3 == 3
-ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 4 == 4
-ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 5 == 5
-Tricky.tests.cpp:<line number>: passed: std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}}
-Tricky.tests.cpp:<line number>: passed: std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}}
-Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3}
-Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3}
-Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
-Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
-Tricky.tests.cpp:<line number>: passed: !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) for: !({ 1, 2 } == { 1, 2, 3 })
-Tricky.tests.cpp:<line number>: passed: !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) for: !({ 1, 2 } == { 1, 2, 3 })
-Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
-Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
-Tricky.tests.cpp:<line number>: passed: true
-Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
-Tricky.tests.cpp:<line number>: passed: a for: 0x<hex digits>
-Tricky.tests.cpp:<line number>: passed: a == &foo for: 0x<hex digits> == 0x<hex digits>
-RandomNumberGeneration.tests.cpp:<line number>: passed: SimplePcg32{} == SimplePcg32{} for: {?} == {?}
-RandomNumberGeneration.tests.cpp:<line number>: passed: SimplePcg32{ 0 } != SimplePcg32{} for: {?} != {?}
-RandomNumberGeneration.tests.cpp:<line number>: passed: !(SimplePcg32{ 1 } == SimplePcg32{ 2 }) for: !({?} == {?})
-RandomNumberGeneration.tests.cpp:<line number>: passed: !(SimplePcg32{ 1 } != SimplePcg32{ 1 }) for: !({?} != {?})
-Approx.tests.cpp:<line number>: passed: td == Approx(10.0) for: StrongDoubleTypedef(10) == Approx( 10.0 )
-Approx.tests.cpp:<line number>: passed: Approx(10.0) == td for: Approx( 10.0 ) == StrongDoubleTypedef(10)
-Approx.tests.cpp:<line number>: passed: td != Approx(11.0) for: StrongDoubleTypedef(10) != Approx( 11.0 )
-Approx.tests.cpp:<line number>: passed: Approx(11.0) != td for: Approx( 11.0 ) != StrongDoubleTypedef(10)
-Approx.tests.cpp:<line number>: passed: td <= Approx(10.0) for: StrongDoubleTypedef(10) <= Approx( 10.0 )
-Approx.tests.cpp:<line number>: passed: td <= Approx(11.0) for: StrongDoubleTypedef(10) <= Approx( 11.0 )
-Approx.tests.cpp:<line number>: passed: Approx(10.0) <= td for: Approx( 10.0 ) <= StrongDoubleTypedef(10)
-Approx.tests.cpp:<line number>: passed: Approx(9.0) <= td for: Approx( 9.0 ) <= StrongDoubleTypedef(10)
-Approx.tests.cpp:<line number>: passed: td >= Approx(9.0) for: StrongDoubleTypedef(10) >= Approx( 9.0 )
-Approx.tests.cpp:<line number>: passed: td >= Approx(td) for: StrongDoubleTypedef(10) >= Approx( 10.0 )
-Approx.tests.cpp:<line number>: passed: Approx(td) >= td for: Approx( 10.0 ) >= StrongDoubleTypedef(10)
-Approx.tests.cpp:<line number>: passed: Approx(11.0) >= td for: Approx( 11.0 ) >= StrongDoubleTypedef(10)
-Condition.tests.cpp:<line number>: passed: 54 == 6*9 for: 54 == 54
-Condition.tests.cpp:<line number>: passed: ( -1 > 2u ) for: true
-Condition.tests.cpp:<line number>: passed: -1 > 2u for: -1 > 2
-Condition.tests.cpp:<line number>: passed: ( 2u < -1 ) for: true
-Condition.tests.cpp:<line number>: passed: 2u < -1 for: 2 < -1
-Condition.tests.cpp:<line number>: passed: ( minInt > 2u ) for: true
-Condition.tests.cpp:<line number>: passed: minInt > 2u for: -2147483648 > 2
-Condition.tests.cpp:<line number>: passed: i == 1 for: 1 == 1
-Condition.tests.cpp:<line number>: passed: ui == 2 for: 2 == 2
-Condition.tests.cpp:<line number>: passed: l == 3 for: 3 == 3
-Condition.tests.cpp:<line number>: passed: ul == 4 for: 4 == 4
-Condition.tests.cpp:<line number>: passed: c == 5 for: 5 == 5
-Condition.tests.cpp:<line number>: passed: uc == 6 for: 6 == 6
-Condition.tests.cpp:<line number>: passed: 1 == i for: 1 == 1
-Condition.tests.cpp:<line number>: passed: 2 == ui for: 2 == 2
-Condition.tests.cpp:<line number>: passed: 3 == l for: 3 == 3
-Condition.tests.cpp:<line number>: passed: 4 == ul for: 4 == 4
-Condition.tests.cpp:<line number>: passed: 5 == c for: 5 == 5
-Condition.tests.cpp:<line number>: passed: 6 == uc for: 6 == 6
-Condition.tests.cpp:<line number>: passed: (std::numeric_limits<uint32_t>::max)() > ul for: 4294967295 (0x<hex digits>) > 4
-Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), !composed1 for: "some completely different text that contains one common word" not ( contains: "string" or contains: "random" )
-Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), composed2 for: "some completely different text that contains one common word" ( contains: "string" or contains: "random" or contains: "different" )
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("STRING") for: "this string contains 'abc' as a substring" contains: "STRING"
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: call_count == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: make_data().size() == test_count for: 6 == 6
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'custom exception - not std'; expression was: throwCustom()
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'custom exception - not std'; expression was: throwCustom(), std::exception
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'custom std exception'
-Approx.tests.cpp:<line number>: passed: 101.000001 != Approx(100).epsilon(0.01) for: 101.000001 != Approx( 100.0 )
-Approx.tests.cpp:<line number>: passed: std::pow(10, -5) != Approx(std::pow(10, -7)) for: 0.00001 != Approx( 0.0000001 )
-ToString.tests.cpp:<line number>: passed: enumInfo->lookup(0) == "Value1" for: Value1 == "Value1"
-ToString.tests.cpp:<line number>: passed: enumInfo->lookup(1) == "Value2" for: Value2 == "Value2"
-ToString.tests.cpp:<line number>: passed: enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **}
-==
-"{** unexpected enum value **}"
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith("Substring") for: "this string contains 'abc' as a substring" ends with: "Substring"
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive)
-EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1"
-EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value2 ) == "Value2" for: "Value2" == "Value2"
-EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value3 ) == "Value3" for: "Value3" == "Value3"
-EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}" for: "{** unexpected enum value **}"
-==
-"{** unexpected enum value **}"
-EnumToString.tests.cpp:<line number>: passed: stringify( ec3 ) == "Value2" for: "Value2" == "Value2"
-EnumToString.tests.cpp:<line number>: passed: stringify( Bikeshed::Colours::Red ) == "Red" for: "Red" == "Red"
-EnumToString.tests.cpp:<line number>: passed: stringify( Bikeshed::Colours::Blue ) == "Blue" for: "Blue" == "Blue"
-Approx.tests.cpp:<line number>: passed: 101.01 != Approx(100).epsilon(0.01) for: 101.01 != Approx( 100.0 )
-Condition.tests.cpp:<line number>: failed: data.int_seven == 6 for: 7 == 6
-Condition.tests.cpp:<line number>: failed: data.int_seven == 8 for: 7 == 8
-Condition.tests.cpp:<line number>: failed: data.int_seven == 0 for: 7 == 0
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 9.11f ) for: 9.1f == Approx( 9.1099996567 )
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 9.0f ) for: 9.1f == Approx( 9.0 )
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 1 ) for: 9.1f == Approx( 1.0 )
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 0 ) for: 9.1f == Approx( 0.0 )
-Condition.tests.cpp:<line number>: failed: data.double_pi == Approx( 3.1415 ) for: 3.1415926535 == Approx( 3.1415 )
-Condition.tests.cpp:<line number>: failed: data.str_hello == "goodbye" for: "hello" == "goodbye"
-Condition.tests.cpp:<line number>: failed: data.str_hello == "hell" for: "hello" == "hell"
-Condition.tests.cpp:<line number>: failed: data.str_hello == "hello1" for: "hello" == "hello1"
-Condition.tests.cpp:<line number>: failed: data.str_hello.size() == 6 for: 5 == 6
-Condition.tests.cpp:<line number>: failed: x == Approx( 1.301 ) for: 1.3 == Approx( 1.301 )
-Condition.tests.cpp:<line number>: passed: data.int_seven == 7 for: 7 == 7
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one == Approx( 9.1f ) for: 9.1f == Approx( 9.1000003815 )
-Condition.tests.cpp:<line number>: passed: data.double_pi == Approx( 3.1415926535 ) for: 3.1415926535 == Approx( 3.1415926535 )
-Condition.tests.cpp:<line number>: passed: data.str_hello == "hello" for: "hello" == "hello"
-Condition.tests.cpp:<line number>: passed: "hello" == data.str_hello for: "hello" == "hello"
-Condition.tests.cpp:<line number>: passed: data.str_hello.size() == 5 for: 5 == 5
-Condition.tests.cpp:<line number>: passed: x == Approx( 1.3 ) for: 1.3 == Approx( 1.3 )
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals("this string contains 'abc' as a substring") for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring"
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals("this string contains 'ABC' as a substring") for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring"
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive)
-ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" for: "This exception has overridden what() method"
-==
-"This exception has overridden what() method"
-ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" for: "OperatorException" == "OperatorException"
-ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" for: "StringMakerException"
-==
-"StringMakerException"
-Matchers.tests.cpp:<line number>: failed: expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{1}
-Matchers.tests.cpp:<line number>: failed: expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{1}
-Matchers.tests.cpp:<line number>: failed: unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt(1), SpecialException, ExceptionMatcher{1}
-Matchers.tests.cpp:<line number>: failed: unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt(1), SpecialException, ExceptionMatcher{1}
-Matchers.tests.cpp:<line number>: failed: throwsSpecialException(3), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1
-Matchers.tests.cpp:<line number>: failed: throwsSpecialException(4), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1
-Matchers.tests.cpp:<line number>: passed: throwsSpecialException(1), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1
-Matchers.tests.cpp:<line number>: passed: throwsSpecialException(2), SpecialException, ExceptionMatcher{2} for: SpecialException::what special exception has value of 2
-Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception"
-Exception.tests.cpp:<line number>: passed: thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive)
-Exception.tests.cpp:<line number>: passed: thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected"
-Exception.tests.cpp:<line number>: passed: thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception"
-Exception.tests.cpp:<line number>: passed: thisThrows(), Contains( "except" ) for: "expected exception" contains: "except"
-Exception.tests.cpp:<line number>: passed: thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
-Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, Message("DerivedException::what") for: DerivedException::what exception message matches "DerivedException::what"
-Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, !Message("derivedexception::what") for: DerivedException::what not exception message matches "derivedexception::what"
-Matchers.tests.cpp:<line number>: passed: throwsSpecialException(2), SpecialException, !Message("DerivedException::what") for: SpecialException::what not exception message matches "DerivedException::what"
-Matchers.tests.cpp:<line number>: passed: throwsSpecialException(2), SpecialException, Message("SpecialException::what") for: SpecialException::what exception message matches "SpecialException::what"
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows(), std::string
-Exception.tests.cpp:<line number>: failed: expected exception, got none; expression was: thisDoesntThrow(), std::domain_error
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows()
-Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'This is a failure'
-Message.tests.cpp:<line number>: failed: explicitly
-Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'This is a failure'
-Message.tests.cpp:<line number>: warning: 'This message appears in the output'
-Misc.tests.cpp:<line number>: passed: Factorial(0) == 1 for: 1 == 1
-Misc.tests.cpp:<line number>: passed: Factorial(1) == 1 for: 1 == 1
-Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2
-Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6
-Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
-Matchers.tests.cpp:<line number>: passed: 10., WithinRel(11.1, 0.1) for: 10.0 and 11.1 are within 10% of each other
-Matchers.tests.cpp:<line number>: passed: 10., !WithinRel(11.2, 0.1) for: 10.0 not and 11.2 are within 10% of each other
-Matchers.tests.cpp:<line number>: passed: 1., !WithinRel(0., 0.99) for: 1.0 not and 0 are within 99% of each other
-Matchers.tests.cpp:<line number>: passed: -0., WithinRel(0.) for: -0.0 and 0 are within 2.22045e-12% of each other
-Matchers.tests.cpp:<line number>: passed: v1, WithinRel(v2) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other
-Matchers.tests.cpp:<line number>: passed: 1., WithinAbs(1., 0) for: 1.0 is within 0.0 of 1.0
-Matchers.tests.cpp:<line number>: passed: 0., WithinAbs(1., 1) for: 0.0 is within 1.0 of 1.0
-Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs(1., 0.99) for: 0.0 not is within 0.99 of 1.0
-Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs(1., 0.99) for: 0.0 not is within 0.99 of 1.0
-Matchers.tests.cpp:<line number>: passed: 11., !WithinAbs(10., 0.5) for: 11.0 not is within 0.5 of 10.0
-Matchers.tests.cpp:<line number>: passed: 10., !WithinAbs(11., 0.5) for: 10.0 not is within 0.5 of 11.0
-Matchers.tests.cpp:<line number>: passed: -10., WithinAbs(-10., 0.5) for: -10.0 is within 0.5 of -10.0
-Matchers.tests.cpp:<line number>: passed: -10., WithinAbs(-9.6, 0.5) for: -10.0 is within 0.5 of -9.6
-Matchers.tests.cpp:<line number>: passed: 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00])
-Matchers.tests.cpp:<line number>: passed: nextafter(1., 2.), WithinULP(1., 1) for: 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00])
-Matchers.tests.cpp:<line number>: passed: 0., WithinULP(nextafter(0., 1.), 1) for: 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324])
-Matchers.tests.cpp:<line number>: passed: 1., WithinULP(nextafter(1., 0.), 1) for: 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00])
-Matchers.tests.cpp:<line number>: passed: 1., !WithinULP(nextafter(1., 2.), 0) for: 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00])
-Matchers.tests.cpp:<line number>: passed: 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00])
-Matchers.tests.cpp:<line number>: passed: -0., WithinULP(0., 0) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00])
-Matchers.tests.cpp:<line number>: passed: 1., WithinAbs(1., 0.5) || WithinULP(2., 1) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) )
-Matchers.tests.cpp:<line number>: passed: 1., WithinAbs(2., 0.5) || WithinULP(1., 0) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) )
-Matchers.tests.cpp:<line number>: passed: 0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
-Matchers.tests.cpp:<line number>: passed: WithinAbs(1., 0.)
-Matchers.tests.cpp:<line number>: passed: WithinAbs(1., -1.), std::domain_error
-Matchers.tests.cpp:<line number>: passed: WithinULP(1., 0)
-Matchers.tests.cpp:<line number>: passed: WithinRel(1., 0.)
-Matchers.tests.cpp:<line number>: passed: WithinRel(1., -0.2), std::domain_error
-Matchers.tests.cpp:<line number>: passed: WithinRel(1., 1.), std::domain_error
-Matchers.tests.cpp:<line number>: passed: 10.f, WithinRel(11.1f, 0.1f) for: 10.0f and 11.1 are within 10% of each other
-Matchers.tests.cpp:<line number>: passed: 10.f, !WithinRel(11.2f, 0.1f) for: 10.0f not and 11.2 are within 10% of each other
-Matchers.tests.cpp:<line number>: passed: 1.f, !WithinRel(0.f, 0.99f) for: 1.0f not and 0 are within 99% of each other
-Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel(0.f) for: -0.0f and 0 are within 0.00119209% of each other
-Matchers.tests.cpp:<line number>: passed: v1, WithinRel(v2) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other
-Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs(1.f, 0) for: 1.0f is within 0.0 of 1.0
-Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs(1.f, 1) for: 0.0f is within 1.0 of 1.0
-Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs(1.f, 0.99f) for: 0.0f not is within 0.9900000095 of 1.0
-Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs(1.f, 0.99f) for: 0.0f not is within 0.9900000095 of 1.0
-Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs(-0.f, 0) for: 0.0f is within 0.0 of -0.0
-Matchers.tests.cpp:<line number>: passed: 11.f, !WithinAbs(10.f, 0.5f) for: 11.0f not is within 0.5 of 10.0
-Matchers.tests.cpp:<line number>: passed: 10.f, !WithinAbs(11.f, 0.5f) for: 10.0f not is within 0.5 of 11.0
-Matchers.tests.cpp:<line number>: passed: -10.f, WithinAbs(-10.f, 0.5f) for: -10.0f is within 0.5 of -10.0
-Matchers.tests.cpp:<line number>: passed: -10.f, WithinAbs(-9.6f, 0.5f) for: -10.0f is within 0.5 of -9.6000003815
-Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00])
-Matchers.tests.cpp:<line number>: passed: nextafter(1.f, 2.f), WithinULP(1.f, 1) for: 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00])
-Matchers.tests.cpp:<line number>: passed: 0.f, WithinULP(nextafter(0.f, 1.f), 1) for: 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45])
-Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(nextafter(1.f, 0.f), 1) for: 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00])
-Matchers.tests.cpp:<line number>: passed: 1.f, !WithinULP(nextafter(1.f, 2.f), 0) for: 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00])
-Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00])
-Matchers.tests.cpp:<line number>: passed: -0.f, WithinULP(0.f, 0) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00])
-Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) )
-Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) )
-Matchers.tests.cpp:<line number>: passed: 0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
-Matchers.tests.cpp:<line number>: passed: WithinAbs(1.f, 0.f)
-Matchers.tests.cpp:<line number>: passed: WithinAbs(1.f, -1.f), std::domain_error
-Matchers.tests.cpp:<line number>: passed: WithinULP(1.f, 0)
-Matchers.tests.cpp:<line number>: passed: WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error
-Matchers.tests.cpp:<line number>: passed: WithinRel(1.f, 0.f)
-Matchers.tests.cpp:<line number>: passed: WithinRel(1.f, -0.2f), std::domain_error
-Matchers.tests.cpp:<line number>: passed: WithinRel(1.f, 1.f), std::domain_error
-Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: filter([] (int) {return false; }, value(1)), Catch::GeneratorException
-Generators.tests.cpp:<line number>: passed: i < 4 for: 1 < 4
-Generators.tests.cpp:<line number>: passed: i < 4 for: 2 < 4
-Generators.tests.cpp:<line number>: passed: i < 4 for: 3 < 4
-Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1
-Generators.tests.cpp:<line number>: passed: j > 0 for: 1 > 0
-Generators.tests.cpp:<line number>: passed: j > 0 for: 2 > 0
-Generators.tests.cpp:<line number>: passed: j > 0 for: 3 > 0
-Generators.tests.cpp:<line number>: passed: j > 0 for: 1 > 0
-Generators.tests.cpp:<line number>: passed: j > 0 for: 2 > 0
-Generators.tests.cpp:<line number>: passed: j > 0 for: 3 > 0
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2
-Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 1 == 1
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2
-Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 2 == 2
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2
-Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 3 == 3
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2
-Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 1 == 1
-Generators.tests.cpp:<line number>: passed: chunk2.front() < 3 for: 1 < 3
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2
-Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 2 == 2
-Generators.tests.cpp:<line number>: passed: chunk2.front() < 3 for: 2 < 3
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: chunk2.size() == 0 for: 0 == 0
-Generators.tests.cpp:<line number>: passed: chunk(2, value(1)), Catch::GeneratorException
-Generators.tests.cpp:<line number>: passed: j < i for: -3 < 1
-Generators.tests.cpp:<line number>: passed: j < i for: -2 < 1
-Generators.tests.cpp:<line number>: passed: j < i for: -1 < 1
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 4 > 1
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 4 > 2
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 4 > 3
-Generators.tests.cpp:<line number>: passed: j < i for: -3 < 2
-Generators.tests.cpp:<line number>: passed: j < i for: -2 < 2
-Generators.tests.cpp:<line number>: passed: j < i for: -1 < 2
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 8 > 1
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 8 > 2
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 8 > 3
-Generators.tests.cpp:<line number>: passed: j < i for: -3 < 3
-Generators.tests.cpp:<line number>: passed: j < i for: -2 < 3
-Generators.tests.cpp:<line number>: passed: j < i for: -1 < 3
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 1
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 2
-Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 3
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 123 for: 123 == 123
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 4 for: 4 == 4
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 0 for: 0 == 0
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get().size() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == "aa" for: "aa" == "aa"
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == "bb" for: "bb" == "bb"
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == "cc" for: "cc" == "cc"
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: filter([] (int) { return false; }, value(1)), Catch::GeneratorException
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2.0 for: 2.0 == 2.0
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 4.0 for: 4.0 == 4.0
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 6.0 for: 6.0 == 6.0
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2.0 for: 2.0 == 2.0
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 4.0 for: 4.0 == 4.0
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 6.0 for: 6.0 == 6.0
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -2 for: -2 == -2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 0 for: 0 == 0
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 0 for: 0 == 0
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.9 == Approx( -0.9 ) with 1 message: 'Current expected value is -0.9'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.9'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.8 == Approx( -0.8 ) with 1 message: 'Current expected value is -0.8'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.8'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.6 == Approx( -0.6 ) with 1 message: 'Current expected value is -0.6'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.6'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.5 == Approx( -0.5 ) with 1 message: 'Current expected value is -0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.3 == Approx( -0.3 ) with 1 message: 'Current expected value is -0.3'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.3'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.2 == Approx( -0.2 ) with 1 message: 'Current expected value is -0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.0 == Approx( -0.0 ) with 1 message: 'Current expected value is -1.38778e-16'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1.38778e-16'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.1 == Approx( 0.1 ) with 1 message: 'Current expected value is 0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.3 == Approx( 0.3 ) with 1 message: 'Current expected value is 0.3'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.3'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.4 == Approx( 0.4 ) with 1 message: 'Current expected value is 0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.6 == Approx( 0.6 ) with 1 message: 'Current expected value is 0.6'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.6'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.7 == Approx( 0.7 ) with 1 message: 'Current expected value is 0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.8 == Approx( 0.8 ) with 1 message: 'Current expected value is 0.8'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.8'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.9 == Approx( 0.9 ) with 1 message: 'Current expected value is 0.9'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.9'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx( rangeEnd ) for: 1.0 == Approx( 1.0 )
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.7'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.4'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.1'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.2'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.5'
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
-GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7
-GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
-Approx.tests.cpp:<line number>: passed: d >= Approx( 1.22 ) for: 1.23 >= Approx( 1.22 )
-Approx.tests.cpp:<line number>: passed: d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 )
-Approx.tests.cpp:<line number>: passed: !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 ))
-Approx.tests.cpp:<line number>: passed: d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 )
-Message.tests.cpp:<line number>: warning: 'this is a message' with 1 message: 'this is a warning'
-Message.tests.cpp:<line number>: failed: a == 1 for: 2 == 1 with 2 messages: 'this message should be logged' and 'so should this'
-Message.tests.cpp:<line number>: passed: a == 2 for: 2 == 2 with 1 message: 'this message may be logged later'
-Message.tests.cpp:<line number>: failed: a == 1 for: 2 == 1 with 2 messages: 'this message may be logged later' and 'this message should be logged'
-Message.tests.cpp:<line number>: failed: a == 0 for: 2 == 0 with 3 messages: 'this message may be logged later' and 'this message should be logged' and 'and this, but later'
-Message.tests.cpp:<line number>: passed: a == 2 for: 2 == 2 with 4 messages: 'this message may be logged later' and 'this message should be logged' and 'and this, but later' and 'but not this'
-Message.tests.cpp:<line number>: passed: i < 10 for: 0 < 10 with 2 messages: 'current counter 0' and 'i := 0'
-Message.tests.cpp:<line number>: passed: i < 10 for: 1 < 10 with 2 messages: 'current counter 1' and 'i := 1'
-Message.tests.cpp:<line number>: passed: i < 10 for: 2 < 10 with 2 messages: 'current counter 2' and 'i := 2'
-Message.tests.cpp:<line number>: passed: i < 10 for: 3 < 10 with 2 messages: 'current counter 3' and 'i := 3'
-Message.tests.cpp:<line number>: passed: i < 10 for: 4 < 10 with 2 messages: 'current counter 4' and 'i := 4'
-Message.tests.cpp:<line number>: passed: i < 10 for: 5 < 10 with 2 messages: 'current counter 5' and 'i := 5'
-Message.tests.cpp:<line number>: passed: i < 10 for: 6 < 10 with 2 messages: 'current counter 6' and 'i := 6'
-Message.tests.cpp:<line number>: passed: i < 10 for: 7 < 10 with 2 messages: 'current counter 7' and 'i := 7'
-Message.tests.cpp:<line number>: passed: i < 10 for: 8 < 10 with 2 messages: 'current counter 8' and 'i := 8'
-Message.tests.cpp:<line number>: passed: i < 10 for: 9 < 10 with 2 messages: 'current counter 9' and 'i := 9'
-Message.tests.cpp:<line number>: failed: i < 10 for: 10 < 10 with 2 messages: 'current counter 10' and 'i := 10'
-Condition.tests.cpp:<line number>: failed: data.int_seven != 7 for: 7 != 7
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one != Approx( 9.1f ) for: 9.1f != Approx( 9.1000003815 )
-Condition.tests.cpp:<line number>: failed: data.double_pi != Approx( 3.1415926535 ) for: 3.1415926535 != Approx( 3.1415926535 )
-Condition.tests.cpp:<line number>: failed: data.str_hello != "hello" for: "hello" != "hello"
-Condition.tests.cpp:<line number>: failed: data.str_hello.size() != 5 for: 5 != 5
-Condition.tests.cpp:<line number>: passed: data.int_seven != 6 for: 7 != 6
-Condition.tests.cpp:<line number>: passed: data.int_seven != 8 for: 7 != 8
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 9.11f ) for: 9.1f != Approx( 9.1099996567 )
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 9.0f ) for: 9.1f != Approx( 9.0 )
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 1 ) for: 9.1f != Approx( 1.0 )
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 0 ) for: 9.1f != Approx( 0.0 )
-Condition.tests.cpp:<line number>: passed: data.double_pi != Approx( 3.1415 ) for: 3.1415926535 != Approx( 3.1415 )
-Condition.tests.cpp:<line number>: passed: data.str_hello != "goodbye" for: "hello" != "goodbye"
-Condition.tests.cpp:<line number>: passed: data.str_hello != "hell" for: "hello" != "hell"
-Condition.tests.cpp:<line number>: passed: data.str_hello != "hello1" for: "hello" != "hello1"
-Condition.tests.cpp:<line number>: passed: data.str_hello.size() != 6 for: 5 != 6
-Approx.tests.cpp:<line number>: passed: d <= Approx( 1.24 ) for: 1.23 <= Approx( 1.24 )
-Approx.tests.cpp:<line number>: passed: d <= Approx( 1.23 ) for: 1.23 <= Approx( 1.23 )
-Approx.tests.cpp:<line number>: passed: !(d <= Approx( 1.22 )) for: !(1.23 <= Approx( 1.22 ))
-Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 )
-Misc.tests.cpp:<line number>: passed: with 1 message: 'was called'
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string") || Contains("different") || Contains("random") for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" )
-Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" )
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" )
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !Contains("different") for: "this string contains 'abc' as a substring" not contains: "different"
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !Contains("substring") for: "this string contains 'abc' as a substring" not contains: "substring"
-Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception"
-Exception.tests.cpp:<line number>: failed: thisThrows(), "should fail" for: "expected exception" equals: "should fail"
-Generators.tests.cpp:<line number>: passed: values > -6 for: 3 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 4 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 5 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 6 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: -5 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: -4 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 90 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 91 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 92 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 93 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 94 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 95 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 96 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 97 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 98 > -6
-Generators.tests.cpp:<line number>: passed: values > -6 for: 99 > -6
-Misc.tests.cpp:<line number>: warning: 'This one ran'
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'custom exception'
-Tricky.tests.cpp:<line number>: passed: True for: {?}
-Tricky.tests.cpp:<line number>: passed: !False for: true
-Tricky.tests.cpp:<line number>: passed: !(False) for: !{?}
-Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void<void>::value'
-Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void<int>::value)'
-Condition.tests.cpp:<line number>: failed: data.int_seven > 7 for: 7 > 7
-Condition.tests.cpp:<line number>: failed: data.int_seven < 7 for: 7 < 7
-Condition.tests.cpp:<line number>: failed: data.int_seven > 8 for: 7 > 8
-Condition.tests.cpp:<line number>: failed: data.int_seven < 6 for: 7 < 6
-Condition.tests.cpp:<line number>: failed: data.int_seven < 0 for: 7 < 0
-Condition.tests.cpp:<line number>: failed: data.int_seven < -1 for: 7 < -1
-Condition.tests.cpp:<line number>: failed: data.int_seven >= 8 for: 7 >= 8
-Condition.tests.cpp:<line number>: failed: data.int_seven <= 6 for: 7 <= 6
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one < 9 for: 9.1f < 9
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one > 10 for: 9.1f > 10
-Condition.tests.cpp:<line number>: failed: data.float_nine_point_one > 9.2 for: 9.1f > 9.2
-Condition.tests.cpp:<line number>: failed: data.str_hello > "hello" for: "hello" > "hello"
-Condition.tests.cpp:<line number>: failed: data.str_hello < "hello" for: "hello" < "hello"
-Condition.tests.cpp:<line number>: failed: data.str_hello > "hellp" for: "hello" > "hellp"
-Condition.tests.cpp:<line number>: failed: data.str_hello > "z" for: "hello" > "z"
-Condition.tests.cpp:<line number>: failed: data.str_hello < "hellm" for: "hello" < "hellm"
-Condition.tests.cpp:<line number>: failed: data.str_hello < "a" for: "hello" < "a"
-Condition.tests.cpp:<line number>: failed: data.str_hello >= "z" for: "hello" >= "z"
-Condition.tests.cpp:<line number>: failed: data.str_hello <= "a" for: "hello" <= "a"
-Condition.tests.cpp:<line number>: passed: data.int_seven < 8 for: 7 < 8
-Condition.tests.cpp:<line number>: passed: data.int_seven > 6 for: 7 > 6
-Condition.tests.cpp:<line number>: passed: data.int_seven > 0 for: 7 > 0
-Condition.tests.cpp:<line number>: passed: data.int_seven > -1 for: 7 > -1
-Condition.tests.cpp:<line number>: passed: data.int_seven >= 7 for: 7 >= 7
-Condition.tests.cpp:<line number>: passed: data.int_seven >= 6 for: 7 >= 6
-Condition.tests.cpp:<line number>: passed: data.int_seven <= 7 for: 7 <= 7
-Condition.tests.cpp:<line number>: passed: data.int_seven <= 8 for: 7 <= 8
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one > 9 for: 9.1f > 9
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one < 10 for: 9.1f < 10
-Condition.tests.cpp:<line number>: passed: data.float_nine_point_one < 9.2 for: 9.1f < 9.2
-Condition.tests.cpp:<line number>: passed: data.str_hello <= "hello" for: "hello" <= "hello"
-Condition.tests.cpp:<line number>: passed: data.str_hello >= "hello" for: "hello" >= "hello"
-Condition.tests.cpp:<line number>: passed: data.str_hello < "hellp" for: "hello" < "hellp"
-Condition.tests.cpp:<line number>: passed: data.str_hello < "zebra" for: "hello" < "zebra"
-Condition.tests.cpp:<line number>: passed: data.str_hello > "hellm" for: "hello" > "hellm"
-Condition.tests.cpp:<line number>: passed: data.str_hello > "a" for: "hello" > "a"
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 4242248763 (0x<hex digits>)
-==
-4242248763 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 1867888929 (0x<hex digits>)
-==
-1867888929 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 1276619030 (0x<hex digits>)
-==
-1276619030 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 1911218783 (0x<hex digits>)
-==
-1911218783 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 1827115164 (0x<hex digits>)
-==
-1827115164 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 1472234645 (0x<hex digits>)
-==
-1472234645 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 868832940 (0x<hex digits>)
-==
-868832940 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 570883446 (0x<hex digits>)
-==
-570883446 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 889299803 (0x<hex digits>)
-==
-889299803 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 4261393167 (0x<hex digits>)
-==
-4261393167 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 1472234645 (0x<hex digits>)
-==
-1472234645 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 868832940 (0x<hex digits>)
-==
-868832940 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 570883446 (0x<hex digits>)
-==
-570883446 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 889299803 (0x<hex digits>)
-==
-889299803 (0x<hex digits>)
-RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> for: 4261393167 (0x<hex digits>)
-==
-4261393167 (0x<hex digits>)
-Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'Message from section one'
-Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'Message from section two'
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches(tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: parseTestSpec( "*a" ).matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: parseTestSpec( "a*" ).matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: parseTestSpec( "*a*" ).matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcA ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcB ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcC ) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: spec.matches( tcD ) == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( " aardvark " ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( " aardvark" ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( " aardvark " ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( "aardvark " ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( "aardvark" ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( " aardvark " ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( " aardvark" ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( " aardvark " ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( "aardvark " ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches( fakeTestCase( "aardvark" ) ) for: true
-CmdLine.tests.cpp:<line number>: passed: spec.matches(fakeTestCase("hidden and foo", "[.][foo]")) for: true
-CmdLine.tests.cpp:<line number>: passed: !(spec.matches(fakeTestCase("only foo", "[foo]"))) for: !false
-CmdLine.tests.cpp:<line number>: passed: !(spec.matches(fakeTestCase("hidden and foo", "[.][foo]"))) for: !false
-CmdLine.tests.cpp:<line number>: passed: !(spec.matches(fakeTestCase("only foo", "[foo]"))) for: !false
-CmdLine.tests.cpp:<line number>: passed: !(spec.matches(fakeTestCase("only hidden", "[.]"))) for: !false
-CmdLine.tests.cpp:<line number>: passed: spec.matches(fakeTestCase("neither foo nor hidden", "[bar]")) for: true
-Condition.tests.cpp:<line number>: passed: p == 0 for: 0 == 0
-Condition.tests.cpp:<line number>: passed: p == pNULL for: 0 == 0
-Condition.tests.cpp:<line number>: passed: p != 0 for: 0x<hex digits> != 0
-Condition.tests.cpp:<line number>: passed: cp != 0 for: 0x<hex digits> != 0
-Condition.tests.cpp:<line number>: passed: cpc != 0 for: 0x<hex digits> != 0
-Condition.tests.cpp:<line number>: passed: returnsNull() == 0 for: {null string} == 0
-Condition.tests.cpp:<line number>: passed: returnsConstNull() == 0 for: {null string} == 0
-Condition.tests.cpp:<line number>: passed: 0 != p for: 0 != 0x<hex digits>
-ToStringGeneral.tests.cpp:<line number>: passed: str1.size() == 3 + 5 for: 8 == 8
-ToStringGeneral.tests.cpp:<line number>: passed: str2.size() == 3 + 10 for: 13 == 13
-ToStringGeneral.tests.cpp:<line number>: passed: str1.size() == 2 + 5 for: 7 == 7
-ToStringGeneral.tests.cpp:<line number>: passed: str2.size() == 2 + 15 for: 17 == 17
-Matchers.tests.cpp:<line number>: passed: "foo", Predicate<const char*>([] (const char* const&) { return true; }) for: "foo" matches undescribed predicate
-CmdLine.tests.cpp:<line number>: passed: result for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.processName == "" for: "" == ""
-CmdLine.tests.cpp:<line number>: passed: result for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.processName == "test" for: "test" == "test"
-CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: config.abortAfter == -1 for: -1 == -1
-CmdLine.tests.cpp:<line number>: passed: config.noThrow == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: config.reporterName == "console" for: "console" == "console"
-CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false
-CmdLine.tests.cpp:<line number>: passed: result for: {?}
-CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
-CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("notIncluded")) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("test1")) for: true
-CmdLine.tests.cpp:<line number>: passed: result for: {?}
-CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
-CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("test1")) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) for: true
-CmdLine.tests.cpp:<line number>: passed: result for: {?}
-CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
-CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("test1")) == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) for: true
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-r", "console"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.reporterName == "console" for: "console" == "console"
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-r", "xml"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.reporterName == "xml" for: "xml" == "xml"
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--reporter", "junit"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.reporterName == "junit" for: "junit" == "junit"
-CmdLine.tests.cpp:<line number>: passed: !(cli.parse({ "test", "-r", "xml", "-r", "junit" })) for: !{?}
-CmdLine.tests.cpp:<line number>: passed: !result for: true
-CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), Contains("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter"
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-b"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--break"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak for: true
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-a"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.abortAfter == 1 for: 1 == 1
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-x", "2"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.abortAfter == 2 for: 2 == 2
-CmdLine.tests.cpp:<line number>: passed: !result for: true
-CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), Contains("convert") && Contains("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" )
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.waitForKeypress == std::get<1>(input) for: 0 == 0
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.waitForKeypress == std::get<1>(input) for: 1 == 1
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.waitForKeypress == std::get<1>(input) for: 2 == 2
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.waitForKeypress == std::get<1>(input) for: 3 == 3
-CmdLine.tests.cpp:<line number>: passed: !result for: true
-CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), Contains("never") && Contains("both") for: "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" )
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-e"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.noThrow for: true
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--nothrow"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.noThrow for: true
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-o", "filename.ext"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.outputFilename == "filename.ext" for: "filename.ext" == "filename.ext"
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--out", "filename.ext"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.outputFilename == "filename.ext" for: "filename.ext" == "filename.ext"
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-abe"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.abortAfter == 1 for: 1 == 1
-CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak for: true
-CmdLine.tests.cpp:<line number>: passed: config.noThrow == true for: true == true
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.useColour == UseColour::Auto for: 0 == 0
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--use-colour", "auto"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.useColour == UseColour::Auto for: 0 == 0
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--use-colour", "yes"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.useColour == UseColour::Yes for: 1 == 1
-CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--use-colour", "no"}) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.useColour == UseColour::No for: 2 == 2
-CmdLine.tests.cpp:<line number>: passed: !result for: true
-CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), Contains( "colour mode must be one of" ) for: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of"
-CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-samples=200" }) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.benchmarkSamples == 200 for: 200 == 200
-CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-resamples=20000" }) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.benchmarkResamples == 20000 for: 20000 (0x<hex digits>) == 20000 (0x<hex digits>)
-CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-confidence-interval=0.99" }) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.benchmarkConfidenceInterval == Catch::Detail::Approx(0.99) for: 0.99 == Approx( 0.99 )
-CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-no-analysis" }) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.benchmarkNoAnalysis for: true
-CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-warmup-time=10" }) for: {?}
-CmdLine.tests.cpp:<line number>: passed: config.benchmarkWarmupTime == 10 for: 10 == 10
-Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1
-Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1
-Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1
-Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this string contains 'abc' as a") for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
-Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals(expected) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
-Message.tests.cpp:<line number>: passed: with 1 message: 'this is a success'
-Message.tests.cpp:<line number>: passed:
-BDD.tests.cpp:<line number>: passed: before == 0 for: 0 == 0
-BDD.tests.cpp:<line number>: passed: after > before for: 1 > 0
-BDD.tests.cpp:<line number>: passed: itDoesThis() for: true
-BDD.tests.cpp:<line number>: passed: itDoesThat() for: true
-BDD.tests.cpp:<line number>: passed: with 1 message: 'boo!'
-BDD.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-BDD.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10
-BDD.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-BDD.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-BDD.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-BDD.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-BDD.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-BDD.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-A string sent directly to stdout
-A string sent directly to stderr
-A string sent to stderr via clog
-Approx.tests.cpp:<line number>: passed: d == Approx( 1.23 ) for: 1.23 == Approx( 1.23 )
-Approx.tests.cpp:<line number>: passed: d != Approx( 1.22 ) for: 1.23 != Approx( 1.22 )
-Approx.tests.cpp:<line number>: passed: d != Approx( 1.24 ) for: 1.23 != Approx( 1.24 )
-Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.23 == Approx( 1.23 )
-Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.23 != Approx( 1.22 )
-Approx.tests.cpp:<line number>: passed: Approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23
-Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.22 for: Approx( 1.23 ) != 1.22
-Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.24 for: Approx( 1.23 ) != 1.24
-Message from section one
-Message from section two
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), StartsWith("This String") for: "this string contains 'abc' as a substring" starts with: "This String"
-Matchers.tests.cpp:<line number>: failed: testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" starts with: "string" (case insensitive)
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(singular) == "{ 1 }" for: "{ 1 }" == "{ 1 }"
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" for: "{ 3, 2, 1 }" == "{ 3, 2, 1 }"
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" for: "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }"
-==
-"{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }"
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string") for: "this string contains 'abc' as a substring" contains: "string"
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive)
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("abc") for: "this string contains 'abc' as a substring" contains: "abc"
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive)
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith("this") for: "this string contains 'abc' as a substring" starts with: "this"
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive)
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith("substring") for: "this string contains 'abc' as a substring" ends with: "substring"
-Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
-String.tests.cpp:<line number>: passed: empty.empty() for: true
-String.tests.cpp:<line number>: passed: empty.size() == 0 for: 0 == 0
-String.tests.cpp:<line number>: passed: empty.isNullTerminated() for: true
-String.tests.cpp:<line number>: passed: std::strcmp( empty.c_str(), "" ) == 0 for: 0 == 0
-String.tests.cpp:<line number>: passed: s.empty() == false for: false == false
-String.tests.cpp:<line number>: passed: s.size() == 5 for: 5 == 5
-String.tests.cpp:<line number>: passed: s.isNullTerminated() for: true
-String.tests.cpp:<line number>: passed: std::strcmp( rawChars, "hello" ) == 0 for: 0 == 0
-String.tests.cpp:<line number>: passed: s.c_str()
-String.tests.cpp:<line number>: passed: s.c_str() == rawChars for: "hello" == "hello"
-String.tests.cpp:<line number>: passed: s.data() == rawChars for: "hello" == "hello"
-String.tests.cpp:<line number>: passed: original == "original"
-String.tests.cpp:<line number>: passed: !(original.isNullTerminated()) for: !false
-String.tests.cpp:<line number>: passed: original.c_str()
-String.tests.cpp:<line number>: passed: original.data()
-String.tests.cpp:<line number>: passed: ss.empty() == false for: false == false
-String.tests.cpp:<line number>: passed: ss.size() == 5 for: 5 == 5
-String.tests.cpp:<line number>: passed: std::strncmp( ss.data(), "hello", 5 ) == 0 for: 0 == 0
-String.tests.cpp:<line number>: passed: ss == "hello" for: hello == "hello"
-String.tests.cpp:<line number>: passed: ss.size() == 6 for: 6 == 6
-String.tests.cpp:<line number>: passed: std::strcmp( ss.c_str(), "world!" ) == 0 for: 0 == 0
-String.tests.cpp:<line number>: passed: s.data() == s2.data() for: "hello world!" == "hello world!"
-String.tests.cpp:<line number>: passed: s.data() == ss.data() for: "hello world!" == "hello world!"
-String.tests.cpp:<line number>: passed: s.substr(s.size() + 1, 123).empty() for: true
-String.tests.cpp:<line number>: passed: std::strcmp(ss.c_str(), "world!") == 0 for: 0 == 0
-String.tests.cpp:<line number>: passed: (char*)buffer1 != (char*)buffer2 for: "Hello" != "Hello"
-String.tests.cpp:<line number>: passed: left == right for: Hello == Hello
-String.tests.cpp:<line number>: passed: left != left.substr(0, 3) for: Hello != Hel
-String.tests.cpp:<line number>: passed: sr == "a standard string" for: a standard string == "a standard string"
-String.tests.cpp:<line number>: passed: sr.size() == stdStr.size() for: 17 == 17
-String.tests.cpp:<line number>: passed: sr == "a standard string" for: a standard string == "a standard string"
-String.tests.cpp:<line number>: passed: sr.size() == stdStr.size() for: 17 == 17
-String.tests.cpp:<line number>: passed: sr == "a standard string" for: a standard string == "a standard string"
-String.tests.cpp:<line number>: passed: sr.size() == stdStr.size() for: 17 == 17
-String.tests.cpp:<line number>: passed: stdStr == "a stringref" for: "a stringref" == "a stringref"
-String.tests.cpp:<line number>: passed: stdStr.size() == sr.size() for: 11 == 11
-String.tests.cpp:<line number>: passed: stdStr == "a stringref" for: "a stringref" == "a stringref"
-String.tests.cpp:<line number>: passed: stdStr.size() == sr.size() for: 11 == 11
-String.tests.cpp:<line number>: passed: with 1 message: 'StringRef{}.size() == 0'
-String.tests.cpp:<line number>: passed: with 1 message: 'StringRef{ "abc", 3 }.size() == 3'
-String.tests.cpp:<line number>: passed: with 1 message: 'StringRef{ "abc", 3 }.isNullTerminated()'
-String.tests.cpp:<line number>: passed: with 1 message: 'StringRef{ "abc", 2 }.size() == 2'
-String.tests.cpp:<line number>: passed: with 1 message: '!(StringRef{ "abc", 2 }.isNullTerminated())'
-String.tests.cpp:<line number>: passed: with 1 message: '!(sr1.empty())'
-String.tests.cpp:<line number>: passed: with 1 message: 'sr1.size() == 3'
-String.tests.cpp:<line number>: passed: with 1 message: 'sr1.isNullTerminated()'
-String.tests.cpp:<line number>: passed: with 1 message: 'sr2.empty()'
-String.tests.cpp:<line number>: passed: with 1 message: 'sr2.size() == 0'
-String.tests.cpp:<line number>: passed: with 1 message: 'sr2.isNullTerminated()'
-ToStringChrono.tests.cpp:<line number>: passed: minute == seconds for: 1 m == 60 s
-ToStringChrono.tests.cpp:<line number>: passed: hour != seconds for: 1 h != 60 s
-ToStringChrono.tests.cpp:<line number>: passed: micro != milli for: 1 us != 1 ms
-ToStringChrono.tests.cpp:<line number>: passed: nano != micro for: 1 ns != 1 us
-ToStringChrono.tests.cpp:<line number>: passed: half_minute != femto_second for: 1 [30/1]s != 1 fs
-ToStringChrono.tests.cpp:<line number>: passed: pico_second != atto_second for: 1 ps != 1 as
-ToStringChrono.tests.cpp:<line number>: passed: now != later for: {iso8601-timestamp}
-!=
-{iso8601-timestamp}
-Misc.tests.cpp:<line number>: failed: s1 == s2 for: "if ($b == 10) {
- $a = 20;
-}"
-==
-"if ($b == 10) {
- $a = 20;
-}
-"
-Tag.tests.cpp:<line number>: passed: what, Contains( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "[@zzz]"
-Tag.tests.cpp:<line number>: passed: what, Contains( "file" ) for: "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "file"
-Tag.tests.cpp:<line number>: passed: what, Contains( "2" ) for: "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "2"
-Tag.tests.cpp:<line number>: passed: what, Contains( "10" ) for: "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "10"
-Tag.tests.cpp:<line number>: passed: registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) )
-Tag.tests.cpp:<line number>: passed: registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) )
-Tag.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) )
-Tag.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
-Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
-Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
-Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
-Misc.tests.cpp:<line number>: passed: sizeof(TestType) > 0 for: 1 > 0
-Misc.tests.cpp:<line number>: passed: sizeof(TestType) > 0 for: 4 > 0
-Misc.tests.cpp:<line number>: passed: sizeof(TestType) > 0 for: 1 > 0
-Misc.tests.cpp:<line number>: passed: sizeof(TestType) > 0 for: 4 > 0
-Misc.tests.cpp:<line number>: passed: sizeof(TestType) > 0 for: 4 > 0
-Misc.tests.cpp:<line number>: passed: sizeof(TestType) > 0 for: 1 > 0
-Misc.tests.cpp:<line number>: passed: sizeof(TestType) > 0 for: 4 > 0
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 6 == 6
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 6 >= 6
-Misc.tests.cpp:<line number>: passed: v.size() == 2 * V for: 12 == 12
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 12 >= 12
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 6 == 6
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 6 >= 6
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 6 >= 6
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 6 == 6
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 6 >= 6
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 6 == 6
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 12 >= 12
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 6 == 6
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 6 >= 6
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 6 == 6
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 6 >= 6
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 4 == 4
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 4 >= 4
-Misc.tests.cpp:<line number>: passed: v.size() == 2 * V for: 8 == 8
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 8 >= 8
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 4 == 4
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 4 >= 4
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 4 >= 4
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 4 == 4
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 4 >= 4
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 4 == 4
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 8 >= 8
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 4 == 4
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 4 >= 4
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 4 == 4
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 4 >= 4
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 2 * V for: 10 == 10
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 15 == 15
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 15 >= 15
-Misc.tests.cpp:<line number>: passed: v.size() == 2 * V for: 30 == 30
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 30 >= 30
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 15 == 15
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 15 >= 15
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 15 >= 15
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 15 == 15
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 15 >= 15
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 15 == 15
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 2 * V for: 30 >= 30
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 15 == 15
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 15 >= 15
-Misc.tests.cpp:<line number>: passed: v.size() == V for: 15 == 15
-Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 15 >= 15
-VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions'
-Tricky.tests.cpp:<line number>: passed: 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472
-CmdLine.tests.cpp:<line number>: passed:
-Message.tests.cpp:<line number>: failed - but was ok: 1 == 2
-Misc.tests.cpp:<line number>: passed: with 1 message: 'oops!'
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'For some reason someone is throwing a string literal!'
-PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isSuccessfullyCompleted() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isSuccessfullyCompleted() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isComplete() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isSuccessfullyCompleted() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isSuccessfullyCompleted() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isSuccessfullyCompleted() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isComplete() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isSuccessfullyCompleted() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isSuccessfullyCompleted() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: s2.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isSuccessfullyCompleted() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s2.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: s2b.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() for: true
-PartTracker.tests.cpp:<line number>: passed: s2b.isSuccessfullyCompleted() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase2.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase2.isSuccessfullyCompleted() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s2.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: s2b.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: ctx.completedCycle() for: true
-PartTracker.tests.cpp:<line number>: passed: s2b.isComplete() for: true
-PartTracker.tests.cpp:<line number>: passed: s2b.isSuccessfullyCompleted() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase2.isSuccessfullyCompleted() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase3.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1c.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: s2c.isOpen() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase3.isSuccessfullyCompleted() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s2.isOpen() for: true
-PartTracker.tests.cpp:<line number>: passed: s2.isComplete() for: true
-PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: s1.isComplete() for: true
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
-PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() for: true
-StringManip.tests.cpp:<line number>: passed: trim(std::string(no_whitespace)) == no_whitespace for: "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
-StringManip.tests.cpp:<line number>: passed: trim(std::string(leading_whitespace)) == no_whitespace for: "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
-StringManip.tests.cpp:<line number>: passed: trim(std::string(trailing_whitespace)) == no_whitespace for: "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
-StringManip.tests.cpp:<line number>: passed: trim(std::string(whitespace_at_both_ends)) == no_whitespace for: "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
-StringManip.tests.cpp:<line number>: passed: trim(StringRef(no_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here
-==
-There is no extra whitespace here
-StringManip.tests.cpp:<line number>: passed: trim(StringRef(leading_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here
-==
-There is no extra whitespace here
-StringManip.tests.cpp:<line number>: passed: trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here
-==
-There is no extra whitespace here
-StringManip.tests.cpp:<line number>: passed: trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) for: There is no extra whitespace here
-==
-There is no extra whitespace here
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14'
-Approx.tests.cpp:<line number>: passed: d == approx( 1.23 ) for: 1.23 == Approx( 1.23 )
-Approx.tests.cpp:<line number>: passed: d == approx( 1.22 ) for: 1.23 == Approx( 1.22 )
-Approx.tests.cpp:<line number>: passed: d == approx( 1.24 ) for: 1.23 == Approx( 1.24 )
-Approx.tests.cpp:<line number>: passed: d != approx( 1.25 ) for: 1.23 != Approx( 1.25 )
-Approx.tests.cpp:<line number>: passed: approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23
-Approx.tests.cpp:<line number>: passed: approx( d ) == 1.22 for: Approx( 1.23 ) == 1.22
-Approx.tests.cpp:<line number>: passed: approx( d ) == 1.24 for: Approx( 1.23 ) == 1.24
-Approx.tests.cpp:<line number>: passed: approx( d ) != 1.25 for: Approx( 1.23 ) != 1.25
-VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions'
-Matchers.tests.cpp:<line number>: passed: empty, Approx(empty) for: { } is approx: { }
-Matchers.tests.cpp:<line number>: passed: v1, Approx(v1) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 }
-Matchers.tests.cpp:<line number>: passed: v1, !Approx(temp) for: { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 }
-Matchers.tests.cpp:<line number>: passed: v1, !Approx(v2) for: { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 }
-Matchers.tests.cpp:<line number>: passed: v1, Approx(v2).margin(0.5) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
-Matchers.tests.cpp:<line number>: passed: v1, Approx(v2).epsilon(0.5) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
-Matchers.tests.cpp:<line number>: passed: v1, Approx(v2).epsilon(0.1).scale(500) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
-Matchers.tests.cpp:<line number>: failed: empty, Approx(t1) for: { } is approx: { 1.0, 2.0 }
-Matchers.tests.cpp:<line number>: failed: v1, Approx(v2) for: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
-Matchers.tests.cpp:<line number>: passed: v, VectorContains(1) for: { 1, 2, 3 } Contains: 1
-Matchers.tests.cpp:<line number>: passed: v, VectorContains(2) for: { 1, 2, 3 } Contains: 2
-Matchers.tests.cpp:<line number>: passed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2 }
-Matchers.tests.cpp:<line number>: passed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: passed: v, Contains(empty) for: { 1, 2, 3 } Contains: { }
-Matchers.tests.cpp:<line number>: passed: empty, Contains(empty) for: { } Contains: { }
-Matchers.tests.cpp:<line number>: passed: v, VectorContains(1) && VectorContains(2) for: { 1, 2, 3 } ( Contains: 1 and Contains: 2 )
-Matchers.tests.cpp:<line number>: passed: v, Equals(v) for: { 1, 2, 3 } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: passed: empty, Equals(empty) for: { } Equals: { }
-Matchers.tests.cpp:<line number>: passed: v, Equals(v2) for: { 1, 2, 3 } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: passed: v, UnorderedEquals(v) for: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: passed: empty, UnorderedEquals(empty) for: { } UnorderedEquals: { }
-Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals(v) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals(v) for: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: failed: v, VectorContains(-1) for: { 1, 2, 3 } Contains: -1
-Matchers.tests.cpp:<line number>: failed: empty, VectorContains(1) for: { } Contains: 1
-Matchers.tests.cpp:<line number>: failed: empty, Contains(v) for: { } Contains: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: failed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2, 4 }
-Matchers.tests.cpp:<line number>: failed: v, Equals(v2) for: { 1, 2, 3 } Equals: { 1, 2 }
-Matchers.tests.cpp:<line number>: failed: v2, Equals(v) for: { 1, 2 } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: failed: empty, Equals(v) for: { } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: failed: v, Equals(empty) for: { 1, 2, 3 } Equals: { }
-Matchers.tests.cpp:<line number>: failed: v, UnorderedEquals(empty) for: { 1, 2, 3 } UnorderedEquals: { }
-Matchers.tests.cpp:<line number>: failed: empty, UnorderedEquals(v) for: { } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: failed: permuted, UnorderedEquals(v) for: { 1, 3 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>: failed: permuted, UnorderedEquals(v) for: { 3, 1 } UnorderedEquals: { 1, 2, 3 }
-Exception.tests.cpp:<line number>: passed: thisThrows(), std::domain_error
-Exception.tests.cpp:<line number>: passed: thisDoesntThrow()
-Exception.tests.cpp:<line number>: passed: thisThrows()
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'unexpected exception'
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows() == 0
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows() == 0
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows() == 0
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'unexpected exception'
-Tricky.tests.cpp:<line number>: warning: 'Uncomment the code in this test to check that it gives a sensible compiler error'
-Tricky.tests.cpp:<line number>: warning: 'Uncomment the code in this test to check that it gives a sensible compiler error'
-Tricky.tests.cpp:<line number>: passed:
-Tricky.tests.cpp:<line number>: passed:
-Tricky.tests.cpp:<line number>: passed:
-Tricky.tests.cpp:<line number>: passed:
-Xml.tests.cpp:<line number>: passed: encode( "normal string" ) == "normal string" for: "normal string" == "normal string"
-Xml.tests.cpp:<line number>: passed: encode( "" ) == "" for: "" == ""
-Xml.tests.cpp:<line number>: passed: encode( "smith & jones" ) == "smith &amp; jones" for: "smith &amp; jones" == "smith &amp; jones"
-Xml.tests.cpp:<line number>: passed: encode( "smith < jones" ) == "smith &lt; jones" for: "smith &lt; jones" == "smith &lt; jones"
-Xml.tests.cpp:<line number>: passed: encode( "smith > jones" ) == "smith > jones" for: "smith > jones" == "smith > jones"
-Xml.tests.cpp:<line number>: passed: encode( "smith ]]> jones" ) == "smith ]]&gt; jones" for: "smith ]]&gt; jones"
-==
-"smith ]]&gt; jones"
-Xml.tests.cpp:<line number>: passed: encode( stringWithQuotes ) == stringWithQuotes for: "don't "quote" me on that"
-==
-"don't "quote" me on that"
-Xml.tests.cpp:<line number>: passed: encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" for: "don't &quot;quote&quot; me on that"
-==
-"don't &quot;quote&quot; me on that"
-Xml.tests.cpp:<line number>: passed: encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]"
-Xml.tests.cpp:<line number>: passed: encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]"
-Tag.tests.cpp:<line number>: passed: testcase.tags, VectorContains(std::string(".")) && VectorContains(std::string("!hide")) for: { "!hide", "." } ( Contains: "." and Contains: "!hide" )
-Tag.tests.cpp:<line number>: passed: testcase.tags, VectorContains(std::string(".")) && VectorContains(std::string("!hide")) for: { "!hide", "." } ( Contains: "." and Contains: "!hide" )
-Tag.tests.cpp:<line number>: passed: testcase.tags, VectorContains(std::string(".")) && VectorContains(std::string("!hide")) for: { "!hide", ".", "foo" } ( Contains: "." and Contains: "!hide" )
-ToStringVector.tests.cpp:<line number>: passed: Catch::Detail::stringify( empty ) == "{ }" for: "{ }" == "{ }"
-ToStringVector.tests.cpp:<line number>: passed: Catch::Detail::stringify( oneValue ) == "{ 42 }" for: "{ 42 }" == "{ 42 }"
-ToStringVector.tests.cpp:<line number>: passed: Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }"
-Misc.tests.cpp:<line number>: passed: x == 0 for: 0 == 0
-Tricky.tests.cpp:<line number>: passed: obj.prop != 0 for: 0x<hex digits> != 0
-Misc.tests.cpp:<line number>: passed: flag for: true
-Misc.tests.cpp:<line number>: passed: testCheckedElse( true ) for: true
-Misc.tests.cpp:<line number>: failed: flag for: false
-Misc.tests.cpp:<line number>: failed: testCheckedElse( false ) for: false
-Misc.tests.cpp:<line number>: passed: flag for: true
-Misc.tests.cpp:<line number>: passed: testCheckedIf( true ) for: true
-Misc.tests.cpp:<line number>: failed: flag for: false
-Misc.tests.cpp:<line number>: failed: testCheckedIf( false ) for: false
-Condition.tests.cpp:<line number>: passed: unsigned_char_var == 1 for: 1 == 1
-Condition.tests.cpp:<line number>: passed: unsigned_short_var == 1 for: 1 == 1
-Condition.tests.cpp:<line number>: passed: unsigned_int_var == 1 for: 1 == 1
-Condition.tests.cpp:<line number>: passed: unsigned_long_var == 1 for: 1 == 1
-Condition.tests.cpp:<line number>: passed: long_var == unsigned_char_var for: 1 == 1
-Condition.tests.cpp:<line number>: passed: long_var == unsigned_short_var for: 1 == 1
-Condition.tests.cpp:<line number>: passed: long_var == unsigned_int_var for: 1 == 1
-Condition.tests.cpp:<line number>: passed: long_var == unsigned_long_var for: 1 == 1
-Misc.tests.cpp:<line number>: passed:
-Misc.tests.cpp:<line number>: passed:
-Misc.tests.cpp:<line number>: passed:
-loose text artifact
-Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'Previous info should not be seen'
-Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'previous unscoped info SHOULD not be seen'
-Misc.tests.cpp:<line number>: passed: l == std::numeric_limits<long long>::max() for: 9223372036854775807 (0x<hex digits>)
-==
-9223372036854775807 (0x<hex digits>)
-Misc.tests.cpp:<line number>: failed: b > a for: 0 > 1
-Misc.tests.cpp:<line number>: failed: b > a for: 1 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 2 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 3 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 4 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 5 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 6 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 7 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 8 > 1
-Misc.tests.cpp:<line number>: passed: b > a for: 9 > 1
-Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[0] (1) is even'
-Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[1] (1) is even'
-Misc.tests.cpp:<line number>: passed: ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[2] (2) is even'
-Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[3] (3) is even'
-Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[4] (5) is even'
-Misc.tests.cpp:<line number>: passed: ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[5] (8) is even'
-Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even'
-Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even'
-Message.tests.cpp:<line number>: warning: 'info' with 2 messages: 'unscoped info' and 'and warn may mix'
-Message.tests.cpp:<line number>: warning: 'info' with 2 messages: 'unscoped info' and 'they are not cleared after warnings'
-Misc.tests.cpp:<line number>: failed: a == b for: 1 == 2
-Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
-Misc.tests.cpp:<line number>: passed: a < b for: 1 < 2
-Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
-Misc.tests.cpp:<line number>: passed: b != a for: 2 != 1
-Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
-Tricky.tests.cpp:<line number>: passed: s == "7" for: "7" == "7"
-Tricky.tests.cpp:<line number>: passed: ti == typeid(int) for: {?} == {?}
-Misc.tests.cpp:<line number>: passed:
-Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen only for the FIRST assertion IF info is printed for passing assertions'
-Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen only for the SECOND assertion IF info is printed for passing assertions'
-Message.tests.cpp:<line number>: failed: false with 1 message: 'this SHOULD be seen'
-Misc.tests.cpp:<line number>: passed: makeString( false ) != static_cast<char*>(0) for: "valid string" != {null string}
-Misc.tests.cpp:<line number>: passed: makeString( true ) == static_cast<char*>(0) for: {null string} == {null string}
-Tricky.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0
-ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }"
-==
-"{ { 42, "Arthur" }, { "Ford", 24 } }"
-ToString.tests.cpp:<line number>: passed: parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) for: { } Equals: { }
-ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
-ToString.tests.cpp:<line number>: passed: parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
-ToString.tests.cpp:<line number>: passed: parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
-ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) for: { Value1, Value2 } Equals: { Value1, Value2 }
-ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
-ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
-Tricky.tests.cpp:<line number>: passed: p == 0 for: 0 == 0
-Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen IF info is printed for passing assertions'
-Message.tests.cpp:<line number>: failed: false with 2 messages: 'this SHOULD be seen' and 'this SHOULD also be seen'
-Message.tests.cpp:<line number>: failed: false with 1 message: 'this SHOULD be seen only ONCE'
-Message.tests.cpp:<line number>: passed: true
-Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY also be seen only ONCE IF info is printed for passing assertions'
-Message.tests.cpp:<line number>: passed: true
-Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
-Misc.tests.cpp:<line number>: passed: b != a for: 2 != 1
-Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
-StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(letters, "b", "z") for: true
-StringManip.tests.cpp:<line number>: passed: letters == "azcdefcg" for: "azcdefcg" == "azcdefcg"
-StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(letters, "c", "z") for: true
-StringManip.tests.cpp:<line number>: passed: letters == "abzdefzg" for: "abzdefzg" == "abzdefzg"
-StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(letters, "a", "z") for: true
-StringManip.tests.cpp:<line number>: passed: letters == "zbcdefcg" for: "zbcdefcg" == "zbcdefcg"
-StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(letters, "g", "z") for: true
-StringManip.tests.cpp:<line number>: passed: letters == "abcdefcz" for: "abcdefcz" == "abcdefcz"
-StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(letters, letters, "replaced") for: true
-StringManip.tests.cpp:<line number>: passed: letters == "replaced" for: "replaced" == "replaced"
-StringManip.tests.cpp:<line number>: passed: !(Catch::replaceInPlace(letters, "x", "z")) for: !false
-StringManip.tests.cpp:<line number>: passed: letters == letters for: "abcdefcg" == "abcdefcg"
-StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(s, "'", "|'") for: true
-StringManip.tests.cpp:<line number>: passed: s == "didn|'t" for: "didn|'t" == "didn|'t"
-Misc.tests.cpp:<line number>: failed: false with 1 message: '3'
-Message.tests.cpp:<line number>: failed: false with 2 messages: 'hi' and 'i := 7'
-Tag.tests.cpp:<line number>: passed: testcase.tags, Catch::VectorContains(std::string("magic-tag")) && Catch::VectorContains(std::string(".")) for: { "!hide", ".", "magic-tag" } ( Contains: "magic-tag" and Contains: "." )
-StringManip.tests.cpp:<line number>: passed: splitStringRef("", ','), Equals(std::vector<StringRef>()) for: { } Equals: { }
-StringManip.tests.cpp:<line number>: passed: splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}) for: { abc } Equals: { abc }
-StringManip.tests.cpp:<line number>: passed: splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}) for: { abc, def } Equals: { abc, def }
-Message.tests.cpp:<line number>: failed: false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3'
-Message.tests.cpp:<line number>: failed: false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6'
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( emptyMap ) == "{ }" for: "{ }" == "{ }"
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }"
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }"
-==
-"{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }"
-ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
-ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( emptySet ) == "{ }" for: "{ }" == "{ }"
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( set ) == "{ \"one\" }" for: "{ "one" }" == "{ "one" }"
-ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" for: "{ "abc", "def", "ghi" }"
-==
-"{ "abc", "def", "ghi" }"
-ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" for: "{ { "green", 55 } }"
-==
-"{ { "green", 55 } }"
-Tricky.tests.cpp:<line number>: failed: std::string( "first" ) == "second" for: "first" == "second"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" for: "op<<(streamable_range)"
-==
-"op<<(streamable_range)"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" for: "stringmaker(streamable_range)"
-==
-"stringmaker(streamable_range)"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" for: "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" for: "{ !!! }" == "{ !!! }"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" for: "StringMaker<has_maker>"
-==
-"StringMaker<has_maker>"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" for: "StringMaker<has_maker_and_operator>"
-==
-"StringMaker<has_maker_and_operator>"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(item) == "{ !!! }" for: "{ !!! }" == "{ !!! }"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" for: "operator<<( has_operator )"
-==
-"operator<<( has_operator )"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" for: "operator<<( has_template_operator )"
-==
-"operator<<( has_template_operator )"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" for: "{ StringMaker<has_maker> }"
-==
-"{ StringMaker<has_maker> }"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" for: "{ StringMaker<has_maker_and_operator> }"
-==
-"{ StringMaker<has_maker_and_operator> }"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" for: "{ operator<<( has_operator ) }"
-==
-"{ operator<<( has_operator ) }"
-Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 == 3
-Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 == 3
-Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 5 == 5
-Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 4 == 4
-Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
-Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
-Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
-Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
-Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'Why would you throw a std::string?'
-Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
-Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
-Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
-Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load""
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == "E2/V0" for: "E2/V0" == "E2/V0"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e1) == "E2/V1" for: "E2/V1" == "E2/V1"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e3) == "Unknown enum value 10" for: "Unknown enum value 10"
-==
-"Unknown enum value 10"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == "0" for: "0" == "0"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e1) == "1" for: "1" == "1"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == "E2{0}" for: "E2{0}" == "E2{0}"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e1) == "E2{1}" for: "E2{1}" == "E2{1}"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == "0" for: "0" == "0"
-EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e1) == "1" for: "1" == "1"
-ToStringTuple.tests.cpp:<line number>: passed: "{ }" == ::Catch::Detail::stringify(type{}) for: "{ }" == "{ }"
-ToStringTuple.tests.cpp:<line number>: passed: "{ }" == ::Catch::Detail::stringify(value) for: "{ }" == "{ }"
-ToStringTuple.tests.cpp:<line number>: passed: "1.2f" == ::Catch::Detail::stringify(float(1.2)) for: "1.2f" == "1.2f"
-ToStringTuple.tests.cpp:<line number>: passed: "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) for: "{ 1.2f, 0 }" == "{ 1.2f, 0 }"
-ToStringTuple.tests.cpp:<line number>: passed: "{ 0 }" == ::Catch::Detail::stringify(type{0}) for: "{ 0 }" == "{ 0 }"
-ToStringTuple.tests.cpp:<line number>: passed: "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) for: "{ 0, 42, "Catch me" }"
-==
-"{ 0, 42, "Catch me" }"
-ToStringTuple.tests.cpp:<line number>: passed: "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) for: "{ "hello", "world" }"
-==
-"{ "hello", "world" }"
-ToStringTuple.tests.cpp:<line number>: passed: "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.2f }"
-==
-"{ { 42 }, { }, 1.2f }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(v) == "{ }" for: "{ }" == "{ }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" for: "{ { "hello" }, { "world" } }"
-==
-"{ { "hello" }, { "world" } }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(bools) == "{ }" for: "{ }" == "{ }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(bools) == "{ true }" for: "{ true }" == "{ true }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(bools) == "{ true, false }" for: "{ true, false }" == "{ true, false }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ 42 }" for: "{ 42 }" == "{ 42 }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ 42 }" for: "{ 42 }" == "{ 42 }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ \"hello\" }" for: "{ "hello" }" == "{ "hello" }"
-ToStringVector.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" for: "{ "hello", "world" }"
-==
-"{ "hello", "world" }"
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.capacity() == 0 for: 0 == 0
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 10 for: 10 >= 10
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
-Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
-Misc.tests.cpp:<line number>: passed:
-Misc.tests.cpp:<line number>: passed:
-Failed 86 test cases, failed 148 assertions.
-
diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt
deleted file mode 100644
index ba4f79d7..00000000
--- a/projects/SelfTest/Baselines/console.std.approved.txt
+++ /dev/null
@@ -1,1385 +0,0 @@
-Filters: ~[!nonportable]~[!benchmark]~[approvals]
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<exe-name> is a <version> host application.
-Run with -? for options
-
-Randomness seeded to: 1
-
--------------------------------------------------------------------------------
-#1455 - INFO and WARN can start with a linebreak
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: warning:
-
-This warning message starts with a linebreak
-
-This would not be caught previously
-Nor would this
--------------------------------------------------------------------------------
-#1514: stderr/stdout is not captured in tests aborted by an exception
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: FAILED:
-explicitly with message:
- 1514
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- outside assertions
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with messages:
- answer := 42
- expected exception
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- inside REQUIRE_NOTHROW
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_NOTHROW( thisThrows() )
-due to unexpected exception with messages:
- answer := 42
- expected exception
-
--------------------------------------------------------------------------------
-#835 -- errno should not be touched by Catch
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( f() == 0 )
-with expansion:
- 1 == 0
-
--------------------------------------------------------------------------------
-'Not' checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( false != false )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( true != true )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( !true )
-with expansion:
- false
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK_FALSE( true )
-with expansion:
- !true
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( !trueValue )
-with expansion:
- false
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK_FALSE( trueValue )
-with expansion:
- !true
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( !(1 == 1) )
-with expansion:
- false
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK_FALSE( 1 == 1 )
-
--------------------------------------------------------------------------------
-A METHOD_AS_TEST_CASE based test run that fails
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( s == "world" )
-with expansion:
- "hello" == "world"
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
-<float>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
-<int>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
-<float>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
-<int>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails -
-Template_Foo_2<float, 6>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 6 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails -
-Template_Foo_2<int, 2>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 2 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array
-<float, 6>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 6 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array
-<int, 2>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 2 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that fails - double
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture<TestType>::m_a == 2 )
-with expansion:
- 1.0 == 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that fails - float
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture<TestType>::m_a == 2 )
-with expansion:
- 1.0f == 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that fails - int
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture<TestType>::m_a == 2 )
-with expansion:
- 1 == 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Nttp_Fixture<V>::value == 0 )
-with expansion:
- 1 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Nttp_Fixture<V>::value == 0 )
-with expansion:
- 3 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Nttp_Fixture<V>::value == 0 )
-with expansion:
- 6 == 0
-
--------------------------------------------------------------------------------
-A TEST_CASE_METHOD based test run that fails
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( m_a == 2 )
-with expansion:
- 1 == 2
-
--------------------------------------------------------------------------------
-A couple of nested sections followed by a failure
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
-explicitly with message:
- to infinity and beyond
-
--------------------------------------------------------------------------------
-A failing expression with a non streamable type is still captured
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: FAILED:
- CHECK( &o1 == &o2 )
-with expansion:
- 0x<hex digits> == 0x<hex digits>
-
-Tricky.tests.cpp:<line number>: FAILED:
- CHECK( o1 == o2 )
-with expansion:
- {?} == {?}
-
--------------------------------------------------------------------------------
-An unchecked exception reports the line of the last assertion
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- {Unknown expression after the reported line}
-due to unexpected exception with message:
- unexpected exception
-
--------------------------------------------------------------------------------
-Contains string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" contains: "not there" (case
- insensitive)
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Contains("STRING") )
-with expansion:
- "this string contains 'abc' as a substring" contains: "STRING"
-
--------------------------------------------------------------------------------
-Custom exceptions can be translated when testing for nothrow
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_NOTHROW( throwCustom() )
-due to unexpected exception with message:
- custom exception - not std
-
--------------------------------------------------------------------------------
-Custom exceptions can be translated when testing for throwing as something else
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_AS( throwCustom(), std::exception )
-due to unexpected exception with message:
- custom exception - not std
-
--------------------------------------------------------------------------------
-Custom std-exceptions can be custom translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- custom std exception
-
--------------------------------------------------------------------------------
-EndsWith string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("Substring") )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "Substring"
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "this" (case
- insensitive)
-
--------------------------------------------------------------------------------
-Equality checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven == 6 )
-with expansion:
- 7 == 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven == 8 )
-with expansion:
- 7 == 8
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven == 0 )
-with expansion:
- 7 == 0
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.11f ) )
-with expansion:
- 9.1f == Approx( 9.1099996567 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.0f ) )
-with expansion:
- 9.1f == Approx( 9.0 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 1 ) )
-with expansion:
- 9.1f == Approx( 1.0 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 0 ) )
-with expansion:
- 9.1f == Approx( 0.0 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.double_pi == Approx( 3.1415 ) )
-with expansion:
- 3.1415926535 == Approx( 3.1415 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello == "goodbye" )
-with expansion:
- "hello" == "goodbye"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello == "hell" )
-with expansion:
- "hello" == "hell"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello == "hello1" )
-with expansion:
- "hello" == "hello1"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello.size() == 6 )
-with expansion:
- 5 == 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( x == Approx( 1.301 ) )
-with expansion:
- 1.3 == Approx( 1.301 )
-
--------------------------------------------------------------------------------
-Equals string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" equals: "this string contains
- 'ABC' as a substring"
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" equals: "something else" (case
- insensitive)
-
--------------------------------------------------------------------------------
-Exception matchers that fail
- No exception
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-because no exception was thrown where one was expected:
-
-Matchers.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-because no exception was thrown where one was expected:
-
--------------------------------------------------------------------------------
-Exception matchers that fail
- Type mismatch
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-due to unexpected exception with message:
- Unknown exception
-
-Matchers.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-due to unexpected exception with message:
- Unknown exception
-
--------------------------------------------------------------------------------
-Exception matchers that fail
- Contents are wrong
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-
-Matchers.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-
--------------------------------------------------------------------------------
-Expected exceptions that don't throw or unexpected exceptions fail the test
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_AS( thisThrows(), std::string )
-due to unexpected exception with message:
- expected exception
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )
-because no exception was thrown where one was expected:
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK_NOTHROW( thisThrows() )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-FAIL aborts the test
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- This is a failure
-
--------------------------------------------------------------------------------
-FAIL does not require an argument
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-
--------------------------------------------------------------------------------
-FAIL_CHECK does not abort the test
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- This is a failure
-
-Message.tests.cpp:<line number>: warning:
- This message appears in the output
-
--------------------------------------------------------------------------------
-INFO and WARN do not abort tests
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: warning:
- this is a warning
-
--------------------------------------------------------------------------------
-INFO gets logged on failure
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( a == 1 )
-with expansion:
- 2 == 1
-with messages:
- this message should be logged
- so should this
-
--------------------------------------------------------------------------------
-INFO gets logged on failure, even if captured before successful assertions
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( a == 1 )
-with expansion:
- 2 == 1
-with messages:
- this message may be logged later
- this message should be logged
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( a == 0 )
-with expansion:
- 2 == 0
-with messages:
- this message may be logged later
- this message should be logged
- and this, but later
-
--------------------------------------------------------------------------------
-INFO is reset for each loop
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( i < 10 )
-with expansion:
- 10 < 10
-with messages:
- current counter 10
- i := 10
-
--------------------------------------------------------------------------------
-Inequality checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven != 7 )
-with expansion:
- 7 != 7
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one != Approx( 9.1f ) )
-with expansion:
- 9.1f != Approx( 9.1000003815 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.double_pi != Approx( 3.1415926535 ) )
-with expansion:
- 3.1415926535 != Approx( 3.1415926535 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello != "hello" )
-with expansion:
- "hello" != "hello"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello.size() != 5 )
-with expansion:
- 5 != 5
-
--------------------------------------------------------------------------------
-Matchers can be composed with both && and || - failing
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") )
-with expansion:
- "this string contains 'abc' as a substring" ( ( contains: "string" or
- contains: "different" ) and contains: "random" )
-
--------------------------------------------------------------------------------
-Matchers can be negated (Not) with the ! operator - failing
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), !Contains("substring") )
-with expansion:
- "this string contains 'abc' as a substring" not contains: "substring"
-
--------------------------------------------------------------------------------
-Mismatching exception messages failing the test
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_WITH( thisThrows(), "should fail" )
-with expansion:
- "expected exception" equals: "should fail"
-
--------------------------------------------------------------------------------
-Nice descriptive name
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: warning:
- This one ran
-
--------------------------------------------------------------------------------
-Non-std exceptions can be translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- custom exception
-
--------------------------------------------------------------------------------
-Ordering comparison checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven > 7 )
-with expansion:
- 7 > 7
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < 7 )
-with expansion:
- 7 < 7
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven > 8 )
-with expansion:
- 7 > 8
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < 6 )
-with expansion:
- 7 < 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < 0 )
-with expansion:
- 7 < 0
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < -1 )
-with expansion:
- 7 < -1
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven >= 8 )
-with expansion:
- 7 >= 8
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven <= 6 )
-with expansion:
- 7 <= 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one < 9 )
-with expansion:
- 9.1f < 9
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one > 10 )
-with expansion:
- 9.1f > 10
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one > 9.2 )
-with expansion:
- 9.1f > 9.2
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello > "hello" )
-with expansion:
- "hello" > "hello"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello < "hello" )
-with expansion:
- "hello" < "hello"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello > "hellp" )
-with expansion:
- "hello" > "hellp"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello > "z" )
-with expansion:
- "hello" > "z"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello < "hellm" )
-with expansion:
- "hello" < "hellm"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello < "a" )
-with expansion:
- "hello" < "a"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello >= "z" )
-with expansion:
- "hello" >= "z"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello <= "a" )
-with expansion:
- "hello" <= "a"
-
--------------------------------------------------------------------------------
-Output from all sections is reported
- one
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- Message from section one
-
--------------------------------------------------------------------------------
-Output from all sections is reported
- two
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- Message from section two
-
--------------------------------------------------------------------------------
-Reconstruction should be based on stringification: #914
--------------------------------------------------------------------------------
-Decomposition.tests.cpp:<line number>
-...............................................................................
-
-Decomposition.tests.cpp:<line number>: FAILED:
- CHECK( truthy(false) )
-with expansion:
- Hey, its truthy!
-
--------------------------------------------------------------------------------
-Regex string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this STRING contains
- 'abc' as a substring" case sensitively
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "contains 'abc' as a
- substring" case sensitively
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this string contains
- 'abc' as a" case sensitively
-
-A string sent directly to stdout
-A string sent directly to stderr
-A string sent to stderr via clog
-Message from section one
-Message from section two
--------------------------------------------------------------------------------
-StartsWith string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("This String") )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "This String"
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "string" (case
- insensitive)
-
--------------------------------------------------------------------------------
-Tabs and newlines show in output
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( s1 == s2 )
-with expansion:
- "if ($b == 10) {
- $a = 20;
- }"
- ==
- "if ($b == 10) {
- $a = 20;
- }
- "
-
--------------------------------------------------------------------------------
-Thrown string literals are translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- For some reason someone is throwing a string literal!
-
--------------------------------------------------------------------------------
-Unexpected exceptions can be translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- 3.14
-
--------------------------------------------------------------------------------
-Vector Approx matcher -- failing
- Empty and non empty vectors are not approx equal
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, Approx(t1) )
-with expansion:
- { } is approx: { 1.0, 2.0 }
-
--------------------------------------------------------------------------------
-Vector Approx matcher -- failing
- Just different vectors
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v1, Approx(v2) )
-with expansion:
- { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- Contains (element)
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, VectorContains(-1) )
-with expansion:
- { 1, 2, 3 } Contains: -1
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, VectorContains(1) )
-with expansion:
- { } Contains: 1
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- Contains (vector)
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, Contains(v) )
-with expansion:
- { } Contains: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, Contains(v2) )
-with expansion:
- { 1, 2, 3 } Contains: { 1, 2, 4 }
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- Equals
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, Equals(v2) )
-with expansion:
- { 1, 2, 3 } Equals: { 1, 2 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v2, Equals(v) )
-with expansion:
- { 1, 2 } Equals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, Equals(v) )
-with expansion:
- { } Equals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, Equals(empty) )
-with expansion:
- { 1, 2, 3 } Equals: { }
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- UnorderedEquals
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, UnorderedEquals(empty) )
-with expansion:
- { 1, 2, 3 } UnorderedEquals: { }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, UnorderedEquals(v) )
-with expansion:
- { } UnorderedEquals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 1, 3 } UnorderedEquals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 3, 1 } UnorderedEquals: { 1, 2, 3 }
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown directly they are always failures
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- unexpected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown during a CHECK the test should continue
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK( thisThrows() == 0 )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown during a REQUIRE the test should abort
-fail
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE( thisThrows() == 0 )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown from functions they are always failures
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK( thisThrows() == 0 )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown from sections they are always failures
- section name
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- unexpected exception
-
--------------------------------------------------------------------------------
-Where the LHS is not a simple value
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: warning:
- Uncomment the code in this test to check that it gives a sensible compiler
- error
-
--------------------------------------------------------------------------------
-Where there is more to the expression after the RHS
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: warning:
- Uncomment the code in this test to check that it gives a sensible compiler
- error
-
--------------------------------------------------------------------------------
-checkedElse, failing
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECKED_ELSE( flag )
-with expansion:
- false
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( testCheckedElse( false ) )
-with expansion:
- false
-
--------------------------------------------------------------------------------
-checkedIf, failing
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECKED_IF( flag )
-with expansion:
- false
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( testCheckedIf( false ) )
-with expansion:
- false
-
-loose text artifact
--------------------------------------------------------------------------------
-just failure
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- Previous info should not be seen
-
--------------------------------------------------------------------------------
-just failure after unscoped info
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- previous unscoped info SHOULD not be seen
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 0
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( b > a )
-with expansion:
- 0 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 1
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( b > a )
-with expansion:
- 1 > 1
-
--------------------------------------------------------------------------------
-looped tests
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[0] (1) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[1] (1) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[3] (3) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[4] (5) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[6] (13) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[7] (21) is even
-
--------------------------------------------------------------------------------
-mix info, unscoped info and warning
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: warning:
- and warn may mix
-
-Message.tests.cpp:<line number>: warning:
- they are not cleared after warnings
-
--------------------------------------------------------------------------------
-more nested SECTION tests
- doesn't equal
- equal
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( a == b )
-with expansion:
- 1 == 2
-
--------------------------------------------------------------------------------
-not prints unscoped info from previous failures
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with message:
- this SHOULD be seen
-
--------------------------------------------------------------------------------
-prints unscoped info on failure
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with messages:
- this SHOULD be seen
- this SHOULD also be seen
-
--------------------------------------------------------------------------------
-prints unscoped info only for the first assertion
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( false )
-with message:
- this SHOULD be seen only ONCE
-
--------------------------------------------------------------------------------
-send a single char to INFO
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with message:
- 3
-
--------------------------------------------------------------------------------
-sends information to INFO
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with messages:
- hi
- i := 7
-
--------------------------------------------------------------------------------
-stacks unscoped info in loops
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( false )
-with messages:
- Count 1 to 3...
- 1
- 2
- 3
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( false )
-with messages:
- Count 4 to 6...
- 4
- 5
- 6
-
--------------------------------------------------------------------------------
-string literals of different sizes can be compared
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: FAILED:
- REQUIRE( std::string( "first" ) == "second" )
-with expansion:
- "first" == "second"
-
--------------------------------------------------------------------------------
-thrown std::strings are translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- Why would you throw a std::string?
-
-===============================================================================
-test cases: 306 | 232 passed | 70 failed | 4 failed as expected
-assertions: 1676 | 1524 passed | 131 failed | 21 failed as expected
-
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
deleted file mode 100644
index e06366c4..00000000
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ /dev/null
@@ -1,13421 +0,0 @@
-Filters: ~[!nonportable]~[!benchmark]~[approvals]
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<exe-name> is a <version> host application.
-Run with -? for options
-
-Randomness seeded to: 1
-
--------------------------------------------------------------------------------
-# A test name that starts with a #
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- yay
-
--------------------------------------------------------------------------------
-#1005: Comparing pointer to int and long (NULL can be either on various
- systems)
--------------------------------------------------------------------------------
-Decomposition.tests.cpp:<line number>
-...............................................................................
-
-Decomposition.tests.cpp:<line number>: PASSED:
- REQUIRE( fptr == 0 )
-with expansion:
- 0 == 0
-
-Decomposition.tests.cpp:<line number>: PASSED:
- REQUIRE( fptr == 0l )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-#1027
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( y.v == 0 )
-with expansion:
- 0 == 0
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == y.v )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-#1027: Bitfields can be captured
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( y.v == 0 )
-with expansion:
- 0 == 0
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == y.v )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-#1147
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 == t2 )
-with expansion:
- {?} == {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 != t2 )
-with expansion:
- {?} != {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 < t2 )
-with expansion:
- {?} < {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 > t2 )
-with expansion:
- {?} > {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 <= t2 )
-with expansion:
- {?} <= {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 >= t2 )
-with expansion:
- {?} >= {?}
-
--------------------------------------------------------------------------------
-#1175 - Hidden Test
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-#1238
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( std::memcmp(uarr, "123", sizeof(uarr)) == 0 )
-with expansion:
- 0 == 0
-with messages:
- uarr := "123"
- sarr := "456"
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( std::memcmp(sarr, "456", sizeof(sarr)) == 0 )
-with expansion:
- 0 == 0
-with messages:
- uarr := "123"
- sarr := "456"
-
--------------------------------------------------------------------------------
-#1245
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-#1403
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( h1 == h2 )
-with expansion:
- [1403 helper] == [1403 helper]
-
--------------------------------------------------------------------------------
-#1455 - INFO and WARN can start with a linebreak
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: warning:
-
-This info message starts with a linebreak
-
-This warning message starts with a linebreak
-
-
-No assertions in test case '#1455 - INFO and WARN can start with a linebreak'
-
-This would not be caught previously
-Nor would this
--------------------------------------------------------------------------------
-#1514: stderr/stdout is not captured in tests aborted by an exception
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: FAILED:
-explicitly with message:
- 1514
-
--------------------------------------------------------------------------------
-#1548
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( std::is_same<TypeList<int>, TypeList<int>>::value )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- outside assertions
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with messages:
- answer := 42
- expected exception
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- inside REQUIRE_NOTHROW
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_NOTHROW( thisThrows() )
-due to unexpected exception with messages:
- answer := 42
- expected exception
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- inside REQUIRE_THROWS
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS( thisThrows() )
-with message:
- answer := 42
-
--------------------------------------------------------------------------------
-#809
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( 42 == f )
-with expansion:
- 42 == {?}
-
--------------------------------------------------------------------------------
-#833
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( a == t )
-with expansion:
- 3 == 3
-
-Compilation.tests.cpp:<line number>: PASSED:
- CHECK( a == t )
-with expansion:
- 3 == 3
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS( throws_int(true) )
-
-Compilation.tests.cpp:<line number>: PASSED:
- CHECK_THROWS_AS( throws_int(true), int )
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( throws_int(false) )
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") )
-with expansion:
- "aaa" ends with: "aaa"
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( templated_tests<int>(3) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-#835 -- errno should not be touched by Catch
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( f() == 0 )
-with expansion:
- 1 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( errno == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-#872
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( x == 4 )
-with expansion:
- {?} == 4
-with message:
- dummy := 0
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 0
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 1
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 2
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 3
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 4
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-'Not' checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( false != false )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( true != true )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( !true )
-with expansion:
- false
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK_FALSE( true )
-with expansion:
- !true
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( !trueValue )
-with expansion:
- false
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK_FALSE( trueValue )
-with expansion:
- !true
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( !(1 == 1) )
-with expansion:
- false
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK_FALSE( 1 == 1 )
-
--------------------------------------------------------------------------------
-'Not' checks that should succeed
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( false == false )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( true == true )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( !false )
-with expansion:
- true
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( false )
-with expansion:
- !false
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( !falseValue )
-with expansion:
- true
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( falseValue )
-with expansion:
- !false
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( !(1 == 2) )
-with expansion:
- true
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( 1 == 2 )
-
--------------------------------------------------------------------------------
-(unimplemented) static bools can be evaluated
- compare to true
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( is_true<true>::value == true )
-with expansion:
- true == true
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true == is_true<true>::value )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-(unimplemented) static bools can be evaluated
- compare to false
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( is_true<false>::value == false )
-with expansion:
- false == false
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( false == is_true<false>::value )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-(unimplemented) static bools can be evaluated
- negation
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( !is_true<false>::value )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-(unimplemented) static bools can be evaluated
- double negation
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( !!is_true<true>::value )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-(unimplemented) static bools can be evaluated
- direct
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( is_true<true>::value )
-with expansion:
- true
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( is_true<false>::value )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 1 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 1 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 2 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 2 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 4
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 4 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 5
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 5 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 9
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 7
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 7
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 8
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 8
-
--------------------------------------------------------------------------------
-3x3x3 ints
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( x < y )
-with expansion:
- 3 < 6
-
-Generators.tests.cpp:<line number>: PASSED:
- CHECK( y < z )
-with expansion:
- 6 < 9
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( x < z )
-with expansion:
- 3 < 9
-
--------------------------------------------------------------------------------
-A METHOD_AS_TEST_CASE based test run that fails
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( s == "world" )
-with expansion:
- "hello" == "world"
-
--------------------------------------------------------------------------------
-A METHOD_AS_TEST_CASE based test run that succeeds
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( s == "hello" )
-with expansion:
- "hello" == "hello"
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
-<float>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
-<int>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
-<float>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
-<int>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo
-<float>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo
-<int>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector
-<float>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector
-<int>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails -
-Template_Foo_2<float, 6>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 6 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails -
-Template_Foo_2<int, 2>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 2 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array
-<float, 6>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 6 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array
-<int, 2>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
-with expansion:
- 2 < 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds -
-Template_Foo_2<float,6>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() >= 2 )
-with expansion:
- 6 >= 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds -
-Template_Foo_2<int,2>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() >= 2 )
-with expansion:
- 2 >= 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::
-array<float,6>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() >= 2 )
-with expansion:
- 6 >= 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::
-array<int,2>
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() >= 2 )
-with expansion:
- 2 >= 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that fails - double
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture<TestType>::m_a == 2 )
-with expansion:
- 1.0 == 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that fails - float
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture<TestType>::m_a == 2 )
-with expansion:
- 1.0f == 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that fails - int
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Template_Fixture<TestType>::m_a == 2 )
-with expansion:
- 1 == 2
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture<TestType>::m_a == 1 )
-with expansion:
- 1.0 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture<TestType>::m_a == 1 )
-with expansion:
- 1.0f == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture<TestType>::m_a == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Nttp_Fixture<V>::value == 0 )
-with expansion:
- 1 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Nttp_Fixture<V>::value == 0 )
-with expansion:
- 3 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( Nttp_Fixture<V>::value == 0 )
-with expansion:
- 6 == 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Nttp_Fixture<V>::value > 0 )
-with expansion:
- 1 > 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Nttp_Fixture<V>::value > 0 )
-with expansion:
- 3 > 0
-
--------------------------------------------------------------------------------
-A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Nttp_Fixture<V>::value > 0 )
-with expansion:
- 6 > 0
-
--------------------------------------------------------------------------------
-A TEST_CASE_METHOD based test run that fails
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: FAILED:
- REQUIRE( m_a == 2 )
-with expansion:
- 1 == 2
-
--------------------------------------------------------------------------------
-A TEST_CASE_METHOD based test run that succeeds
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( m_a == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-A Template product test case - Foo<float>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A Template product test case - Foo<int>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A Template product test case - std::vector<float>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A Template product test case - std::vector<int>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-A Template product test case with array signature - Bar<float, 42>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() > 0 )
-with expansion:
- 42 > 0
-
--------------------------------------------------------------------------------
-A Template product test case with array signature - Bar<int, 9>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() > 0 )
-with expansion:
- 9 > 0
-
--------------------------------------------------------------------------------
-A Template product test case with array signature - std::array<float, 42>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() > 0 )
-with expansion:
- 42 > 0
-
--------------------------------------------------------------------------------
-A Template product test case with array signature - std::array<int, 9>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x.size() > 0 )
-with expansion:
- 9 > 0
-
--------------------------------------------------------------------------------
-A comparison that uses literals instead of the normal constructor
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == 1.23_a )
-with expansion:
- 1.23 == Approx( 1.23 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d != 1.22_a )
-with expansion:
- 1.23 != Approx( 1.22 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( -d == -1.23_a )
-with expansion:
- -1.23 == Approx( -1.23 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == 1.2_a .epsilon(.1) )
-with expansion:
- 1.23 == Approx( 1.2 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d != 1.2_a .epsilon(.001) )
-with expansion:
- 1.23 != Approx( 1.2 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == 1_a .epsilon(.3) )
-with expansion:
- 1.23 == Approx( 1.0 )
-
--------------------------------------------------------------------------------
-A couple of nested sections followed by a failure
- Outer
- Inner
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- that's not flying - that's failing in style
-
--------------------------------------------------------------------------------
-A couple of nested sections followed by a failure
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
-explicitly with message:
- to infinity and beyond
-
--------------------------------------------------------------------------------
-A failing expression with a non streamable type is still captured
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: FAILED:
- CHECK( &o1 == &o2 )
-with expansion:
- 0x<hex digits> == 0x<hex digits>
-
-Tricky.tests.cpp:<line number>: FAILED:
- CHECK( o1 == o2 )
-with expansion:
- {?} == {?}
-
--------------------------------------------------------------------------------
-Absolute margin
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 104.0 != Approx(100.0) )
-with expansion:
- 104.0 != Approx( 100.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 104.0 == Approx(100.0).margin(5) )
-with expansion:
- 104.0 == Approx( 100.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 104.0 == Approx(100.0).margin(4) )
-with expansion:
- 104.0 == Approx( 100.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 104.0 != Approx(100.0).margin(3) )
-with expansion:
- 104.0 != Approx( 100.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 100.3 != Approx(100.0) )
-with expansion:
- 100.3 != Approx( 100.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 100.3 == Approx(100.0).margin(0.5) )
-with expansion:
- 100.3 == Approx( 100.0 )
-
--------------------------------------------------------------------------------
-An empty test with no assertions
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'An empty test with no assertions'
-
--------------------------------------------------------------------------------
-An expression with side-effects should only be evaluated once
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( i++ == 7 )
-with expansion:
- 7 == 7
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( i++ == 8 )
-with expansion:
- 8 == 8
-
--------------------------------------------------------------------------------
-An unchecked exception reports the line of the last assertion
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- CHECK( 1 == 1 )
-
-Exception.tests.cpp:<line number>: FAILED:
- {Unknown expression after the reported line}
-due to unexpected exception with message:
- unexpected exception
-
--------------------------------------------------------------------------------
-Anonymous test case 1
--------------------------------------------------------------------------------
-VariadicMacros.tests.cpp:<line number>
-...............................................................................
-
-VariadicMacros.tests.cpp:<line number>: PASSED:
-with message:
- anonymous test case
-
--------------------------------------------------------------------------------
-Approx setters validate their arguments
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( Approx(0).margin(0) )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( Approx(0).margin(1234656) )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( Approx(0).margin(-2), std::domain_error )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( Approx(0).epsilon(0) )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( Approx(0).epsilon(1) )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( Approx(0).epsilon(-0.001), std::domain_error )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( Approx(0).epsilon(1.0001), std::domain_error )
-
--------------------------------------------------------------------------------
-Approx with exactly-representable margin
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- CHECK( 0.25f == Approx(0.0f).margin(0.25f) )
-with expansion:
- 0.25f == Approx( 0.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- CHECK( 0.0f == Approx(0.25f).margin(0.25f) )
-with expansion:
- 0.0f == Approx( 0.25 )
-
-Approx.tests.cpp:<line number>: PASSED:
- CHECK( 0.5f == Approx(0.25f).margin(0.25f) )
-with expansion:
- 0.5f == Approx( 0.25 )
-
-Approx.tests.cpp:<line number>: PASSED:
- CHECK( 245.0f == Approx(245.25f).margin(0.25f) )
-with expansion:
- 245.0f == Approx( 245.25 )
-
-Approx.tests.cpp:<line number>: PASSED:
- CHECK( 245.5f == Approx(245.25f).margin(0.25f) )
-with expansion:
- 245.5f == Approx( 245.25 )
-
--------------------------------------------------------------------------------
-Approximate PI
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) )
-with expansion:
- 3.1428571429 == Approx( 3.141 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) )
-with expansion:
- 3.1428571429 != Approx( 3.141 )
-
--------------------------------------------------------------------------------
-Approximate comparisons with different epsilons
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d != Approx( 1.231 ) )
-with expansion:
- 1.23 != Approx( 1.231 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) )
-with expansion:
- 1.23 == Approx( 1.231 )
-
--------------------------------------------------------------------------------
-Approximate comparisons with floats
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 1.23f == Approx( 1.23f ) )
-with expansion:
- 1.23f == Approx( 1.2300000191 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 0.0f == Approx( 0.0f ) )
-with expansion:
- 0.0f == Approx( 0.0 )
-
--------------------------------------------------------------------------------
-Approximate comparisons with ints
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 1 == Approx( 1 ) )
-with expansion:
- 1 == Approx( 1.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == Approx( 0 ) )
-with expansion:
- 0 == Approx( 0.0 )
-
--------------------------------------------------------------------------------
-Approximate comparisons with mixed numeric types
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 1.0f == Approx( 1 ) )
-with expansion:
- 1.0f == Approx( 1.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == Approx( dZero) )
-with expansion:
- 0 == Approx( 0.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == Approx( dSmall ).margin( 0.001 ) )
-with expansion:
- 0 == Approx( 0.00001 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 1.234f == Approx( dMedium ) )
-with expansion:
- 1.234f == Approx( 1.234 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( dMedium == Approx( 1.234f ) )
-with expansion:
- 1.234 == Approx( 1.2339999676 )
-
--------------------------------------------------------------------------------
-Arbitrary predicate matcher
- Function pointer
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1, Predicate<int>(alwaysTrue, "always true") )
-with expansion:
- 1 matches predicate: "always true"
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1, !Predicate<int>(alwaysFalse, "always false") )
-with expansion:
- 1 not matches predicate: "always false"
-
--------------------------------------------------------------------------------
-Arbitrary predicate matcher
- Lambdas + different type
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") )
-with expansion:
- "Hello olleH" matches predicate: "First and last character should be equal"
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) )
-with expansion:
- "This wouldn't pass" not matches undescribed predicate
-
--------------------------------------------------------------------------------
-Assertions then sections
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-
--------------------------------------------------------------------------------
-Assertions then sections
- A section
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-
--------------------------------------------------------------------------------
-Assertions then sections
- A section
- Another section
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-
--------------------------------------------------------------------------------
-Assertions then sections
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-
--------------------------------------------------------------------------------
-Assertions then sections
- A section
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-
--------------------------------------------------------------------------------
-Assertions then sections
- A section
- Another other section
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-
--------------------------------------------------------------------------------
-CAPTURE can deal with complex expressions
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
-with messages:
- a := 1
- b := 2
- c := 3
- a + b := 3
- a+b := 3
- c > b := true
- a == 1 := true
-
--------------------------------------------------------------------------------
-CAPTURE can deal with complex expressions involving commas
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
-with messages:
- std::vector<int>{1, 2, 3}[0, 1, 2] := 3
- std::vector<int>{1, 2, 3}[(0, 1)] := 2
- std::vector<int>{1, 2, 3}[0] := 1
- (helper_1436<int, int>{12, -12}) := { 12, -12 }
- (helper_1436<int, int>(-12, 12)) := { -12, 12 }
- (1, 2) := 2
- (2, 3) := 3
-
--------------------------------------------------------------------------------
-CAPTURE parses string and character constants
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
-with messages:
- ("comma, in string", "escaped, \", ") := "escaped, ", "
- "single quote in string,'," := "single quote in string,',"
- "some escapes, \\,\\\\" := "some escapes, \,\\"
- "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[
- <"
- '"' := '"'
- '\'' := '''
- ',' := ','
- '}' := '}'
- ')' := ')'
- '(' := '('
- '{' := '{'
-
--------------------------------------------------------------------------------
-Capture and info messages
- Capture should stringify like assertions
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-with message:
- i := 2
-
--------------------------------------------------------------------------------
-Capture and info messages
- Info should NOT stringify the way assertions do
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-with message:
- 3
-
--------------------------------------------------------------------------------
-Character pretty printing
- Specifically escaped
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( tab == '\t' )
-with expansion:
- '\t' == '\t'
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( newline == '\n' )
-with expansion:
- '\n' == '\n'
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( carr_return == '\r' )
-with expansion:
- '\r' == '\r'
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( form_feed == '\f' )
-with expansion:
- '\f' == '\f'
-
--------------------------------------------------------------------------------
-Character pretty printing
- General chars
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( space == ' ' )
-with expansion:
- ' ' == ' '
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == chars[i] )
-with expansion:
- 'a' == 'a'
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == chars[i] )
-with expansion:
- 'z' == 'z'
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == chars[i] )
-with expansion:
- 'A' == 'A'
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == chars[i] )
-with expansion:
- 'Z' == 'Z'
-
--------------------------------------------------------------------------------
-Character pretty printing
- Low ASCII
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( null_terminator == '\0' )
-with expansion:
- 0 == 0
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == i )
-with expansion:
- 2 == 2
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == i )
-with expansion:
- 3 == 3
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == i )
-with expansion:
- 4 == 4
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( c == i )
-with expansion:
- 5 == 5
-
--------------------------------------------------------------------------------
-Commas in various macros are allowed
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} )
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} )
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} )
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} )
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( std::vector<int>{1, 2} == std::vector<int>{1, 2} )
-with expansion:
- { 1, 2 } == { 1, 2 }
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK( std::vector<int>{1, 2} == std::vector<int>{1, 2} )
-with expansion:
- { 1, 2 } == { 1, 2 }
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} )
-with expansion:
- !({ 1, 2 } == { 1, 2, 3 })
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} )
-with expansion:
- !({ 1, 2 } == { 1, 2, 3 })
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK_NOFAIL( std::vector<int>{1, 2} == std::vector<int>{1, 2} )
-with expansion:
- { 1, 2 } == { 1, 2 }
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECKED_IF( std::vector<int>{1, 2} == std::vector<int>{1, 2} )
-with expansion:
- { 1, 2 } == { 1, 2 }
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECKED_ELSE( std::vector<int>{1, 2} == std::vector<int>{1, 2} )
-with expansion:
- { 1, 2 } == { 1, 2 }
-
--------------------------------------------------------------------------------
-Comparing function pointers
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( a )
-with expansion:
- 0x<hex digits>
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( a == &foo )
-with expansion:
- 0x<hex digits> == 0x<hex digits>
-
--------------------------------------------------------------------------------
-Comparison ops
--------------------------------------------------------------------------------
-RandomNumberGeneration.tests.cpp:<line number>
-...............................................................................
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( SimplePcg32{} == SimplePcg32{} )
-with expansion:
- {?} == {?}
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( SimplePcg32{ 0 } != SimplePcg32{} )
-with expansion:
- {?} != {?}
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( SimplePcg32{ 1 } == SimplePcg32{ 2 } )
-with expansion:
- !({?} == {?})
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( SimplePcg32{ 1 } != SimplePcg32{ 1 } )
-with expansion:
- !({?} != {?})
-
--------------------------------------------------------------------------------
-Comparison with explicitly convertible types
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( td == Approx(10.0) )
-with expansion:
- StrongDoubleTypedef(10) == Approx( 10.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx(10.0) == td )
-with expansion:
- Approx( 10.0 ) == StrongDoubleTypedef(10)
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( td != Approx(11.0) )
-with expansion:
- StrongDoubleTypedef(10) != Approx( 11.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx(11.0) != td )
-with expansion:
- Approx( 11.0 ) != StrongDoubleTypedef(10)
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( td <= Approx(10.0) )
-with expansion:
- StrongDoubleTypedef(10) <= Approx( 10.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( td <= Approx(11.0) )
-with expansion:
- StrongDoubleTypedef(10) <= Approx( 11.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx(10.0) <= td )
-with expansion:
- Approx( 10.0 ) <= StrongDoubleTypedef(10)
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx(9.0) <= td )
-with expansion:
- Approx( 9.0 ) <= StrongDoubleTypedef(10)
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( td >= Approx(9.0) )
-with expansion:
- StrongDoubleTypedef(10) >= Approx( 9.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( td >= Approx(td) )
-with expansion:
- StrongDoubleTypedef(10) >= Approx( 10.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx(td) >= td )
-with expansion:
- Approx( 10.0 ) >= StrongDoubleTypedef(10)
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx(11.0) >= td )
-with expansion:
- Approx( 11.0 ) >= StrongDoubleTypedef(10)
-
--------------------------------------------------------------------------------
-Comparisons between ints where one side is computed
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- CHECK( 54 == 6*9 )
-with expansion:
- 54 == 54
-
--------------------------------------------------------------------------------
-Comparisons between unsigned ints and negative signed ints match c++ standard
-behaviour
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- CHECK( ( -1 > 2u ) )
-with expansion:
- true
-
-Condition.tests.cpp:<line number>: PASSED:
- CHECK( -1 > 2u )
-with expansion:
- -1 > 2
-
-Condition.tests.cpp:<line number>: PASSED:
- CHECK( ( 2u < -1 ) )
-with expansion:
- true
-
-Condition.tests.cpp:<line number>: PASSED:
- CHECK( 2u < -1 )
-with expansion:
- 2 < -1
-
-Condition.tests.cpp:<line number>: PASSED:
- CHECK( ( minInt > 2u ) )
-with expansion:
- true
-
-Condition.tests.cpp:<line number>: PASSED:
- CHECK( minInt > 2u )
-with expansion:
- -2147483648 > 2
-
--------------------------------------------------------------------------------
-Comparisons with int literals don't warn when mixing signed/ unsigned
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( i == 1 )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( ui == 2 )
-with expansion:
- 2 == 2
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( l == 3 )
-with expansion:
- 3 == 3
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( ul == 4 )
-with expansion:
- 4 == 4
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( c == 5 )
-with expansion:
- 5 == 5
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( uc == 6 )
-with expansion:
- 6 == 6
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( 1 == i )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( 2 == ui )
-with expansion:
- 2 == 2
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( 3 == l )
-with expansion:
- 3 == 3
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( 4 == ul )
-with expansion:
- 4 == 4
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( 5 == c )
-with expansion:
- 5 == 5
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( 6 == uc )
-with expansion:
- 6 == 6
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( (std::numeric_limits<uint32_t>::max)() > ul )
-with expansion:
- 4294967295 (0x<hex digits>) > 4
-
--------------------------------------------------------------------------------
-Composed matchers are distinct
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testStringForMatching2(), !composed1 )
-with expansion:
- "some completely different text that contains one common word" not (
- contains: "string" or contains: "random" )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testStringForMatching2(), composed2 )
-with expansion:
- "some completely different text that contains one common word" ( contains:
- "string" or contains: "random" or contains: "different" )
-
--------------------------------------------------------------------------------
-Contains string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" contains: "not there" (case
- insensitive)
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Contains("STRING") )
-with expansion:
- "this string contains 'abc' as a substring" contains: "STRING"
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- from var and iterators
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- from var and iterators
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- from var and iterators
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- from var and iterators
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- from var and iterators
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- from var and iterators
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- From a temporary container
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- From a temporary container
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- From a temporary container
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- From a temporary container
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- From a temporary container
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- From a temporary container
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( elem % 2 == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Copy and then generate a range
- Final validation
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( call_count == 1 )
-with expansion:
- 1 == 1
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( make_data().size() == test_count )
-with expansion:
- 6 == 6
-
--------------------------------------------------------------------------------
-Custom exceptions can be translated when testing for nothrow
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_NOTHROW( throwCustom() )
-due to unexpected exception with message:
- custom exception - not std
-
--------------------------------------------------------------------------------
-Custom exceptions can be translated when testing for throwing as something else
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_AS( throwCustom(), std::exception )
-due to unexpected exception with message:
- custom exception - not std
-
--------------------------------------------------------------------------------
-Custom std-exceptions can be custom translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- custom std exception
-
--------------------------------------------------------------------------------
-Default scale is invisible to comparison
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 101.000001 != Approx(100).epsilon(0.01) )
-with expansion:
- 101.000001 != Approx( 100.0 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( std::pow(10, -5) != Approx(std::pow(10, -7)) )
-with expansion:
- 0.00001 != Approx( 0.0000001 )
-
--------------------------------------------------------------------------------
-Directly creating an EnumInfo
--------------------------------------------------------------------------------
-ToString.tests.cpp:<line number>
-...............................................................................
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK( enumInfo->lookup(0) == "Value1" )
-with expansion:
- Value1 == "Value1"
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK( enumInfo->lookup(1) == "Value2" )
-with expansion:
- Value2 == "Value2"
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" )
-with expansion:
- {** unexpected enum value **}
- ==
- "{** unexpected enum value **}"
-
--------------------------------------------------------------------------------
-EndsWith string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("Substring") )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "Substring"
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "this" (case
- insensitive)
-
--------------------------------------------------------------------------------
-Enums can quickly have stringification enabled using REGISTER_ENUM
--------------------------------------------------------------------------------
-EnumToString.tests.cpp:<line number>
-...............................................................................
-
-EnumToString.tests.cpp:<line number>: PASSED:
- REQUIRE( stringify( EnumClass3::Value1 ) == "Value1" )
-with expansion:
- "Value1" == "Value1"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- REQUIRE( stringify( EnumClass3::Value2 ) == "Value2" )
-with expansion:
- "Value2" == "Value2"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- REQUIRE( stringify( EnumClass3::Value3 ) == "Value3" )
-with expansion:
- "Value3" == "Value3"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- REQUIRE( stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}" )
-with expansion:
- "{** unexpected enum value **}"
- ==
- "{** unexpected enum value **}"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- REQUIRE( stringify( ec3 ) == "Value2" )
-with expansion:
- "Value2" == "Value2"
-
--------------------------------------------------------------------------------
-Enums in namespaces can quickly have stringification enabled using
-REGISTER_ENUM
--------------------------------------------------------------------------------
-EnumToString.tests.cpp:<line number>
-...............................................................................
-
-EnumToString.tests.cpp:<line number>: PASSED:
- REQUIRE( stringify( Bikeshed::Colours::Red ) == "Red" )
-with expansion:
- "Red" == "Red"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- REQUIRE( stringify( Bikeshed::Colours::Blue ) == "Blue" )
-with expansion:
- "Blue" == "Blue"
-
--------------------------------------------------------------------------------
-Epsilon only applies to Approx's value
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( 101.01 != Approx(100).epsilon(0.01) )
-with expansion:
- 101.01 != Approx( 100.0 )
-
--------------------------------------------------------------------------------
-Equality checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven == 6 )
-with expansion:
- 7 == 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven == 8 )
-with expansion:
- 7 == 8
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven == 0 )
-with expansion:
- 7 == 0
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.11f ) )
-with expansion:
- 9.1f == Approx( 9.1099996567 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.0f ) )
-with expansion:
- 9.1f == Approx( 9.0 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 1 ) )
-with expansion:
- 9.1f == Approx( 1.0 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one == Approx( 0 ) )
-with expansion:
- 9.1f == Approx( 0.0 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.double_pi == Approx( 3.1415 ) )
-with expansion:
- 3.1415926535 == Approx( 3.1415 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello == "goodbye" )
-with expansion:
- "hello" == "goodbye"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello == "hell" )
-with expansion:
- "hello" == "hell"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello == "hello1" )
-with expansion:
- "hello" == "hello1"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello.size() == 6 )
-with expansion:
- 5 == 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( x == Approx( 1.301 ) )
-with expansion:
- 1.3 == Approx( 1.301 )
-
--------------------------------------------------------------------------------
-Equality checks that should succeed
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven == 7 )
-with expansion:
- 7 == 7
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one == Approx( 9.1f ) )
-with expansion:
- 9.1f == Approx( 9.1000003815 )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.double_pi == Approx( 3.1415926535 ) )
-with expansion:
- 3.1415926535 == Approx( 3.1415926535 )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello == "hello" )
-with expansion:
- "hello" == "hello"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( "hello" == data.str_hello )
-with expansion:
- "hello" == "hello"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello.size() == 5 )
-with expansion:
- 5 == 5
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( x == Approx( 1.3 ) )
-with expansion:
- 1.3 == Approx( 1.3 )
-
--------------------------------------------------------------------------------
-Equals
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), Equals("this string contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" equals: "this string contains
- 'abc' as a substring"
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" equals: "this string contains
- 'abc' as a substring" (case insensitive)
-
--------------------------------------------------------------------------------
-Equals string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" equals: "this string contains
- 'ABC' as a substring"
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" equals: "something else" (case
- insensitive)
-
--------------------------------------------------------------------------------
-Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" )
-with expansion:
- "This exception has overridden what() method"
- ==
- "This exception has overridden what() method"
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" )
-with expansion:
- "OperatorException" == "OperatorException"
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" )
-with expansion:
- "StringMakerException"
- ==
- "StringMakerException"
-
--------------------------------------------------------------------------------
-Exception matchers that fail
- No exception
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-because no exception was thrown where one was expected:
-
-Matchers.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-because no exception was thrown where one was expected:
-
--------------------------------------------------------------------------------
-Exception matchers that fail
- Type mismatch
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-due to unexpected exception with message:
- Unknown exception
-
-Matchers.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-due to unexpected exception with message:
- Unknown exception
-
--------------------------------------------------------------------------------
-Exception matchers that fail
- Contents are wrong
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-
-Matchers.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-
--------------------------------------------------------------------------------
-Exception matchers that succeed
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THROWS_MATCHES( throwsSpecialException(1), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_MATCHES( throwsSpecialException(2), SpecialException, ExceptionMatcher{2} )
-with expansion:
- SpecialException::what special exception has value of 2
-
--------------------------------------------------------------------------------
-Exception messages can be tested for
- exact match
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_WITH( thisThrows(), "expected exception" )
-with expansion:
- "expected exception" equals: "expected exception"
-
--------------------------------------------------------------------------------
-Exception messages can be tested for
- different case
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_WITH( thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) )
-with expansion:
- "expected exception" equals: "expected exception" (case insensitive)
-
--------------------------------------------------------------------------------
-Exception messages can be tested for
- wildcarded
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_WITH( thisThrows(), StartsWith( "expected" ) )
-with expansion:
- "expected exception" starts with: "expected"
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_WITH( thisThrows(), EndsWith( "exception" ) )
-with expansion:
- "expected exception" ends with: "exception"
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) )
-with expansion:
- "expected exception" contains: "except"
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) )
-with expansion:
- "expected exception" contains: "except" (case insensitive)
-
--------------------------------------------------------------------------------
-Exceptions matchers
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_MATCHES( throwsDerivedException(), DerivedException, Message("DerivedException::what") )
-with expansion:
- DerivedException::what exception message matches "DerivedException::what"
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_MATCHES( throwsDerivedException(), DerivedException, !Message("derivedexception::what") )
-with expansion:
- DerivedException::what not exception message matches "derivedexception::what"
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_MATCHES( throwsSpecialException(2), SpecialException, !Message("DerivedException::what") )
-with expansion:
- SpecialException::what not exception message matches "DerivedException::what"
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_MATCHES( throwsSpecialException(2), SpecialException, Message("SpecialException::what") )
-with expansion:
- SpecialException::what exception message matches "SpecialException::what"
-
--------------------------------------------------------------------------------
-Expected exceptions that don't throw or unexpected exceptions fail the test
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_AS( thisThrows(), std::string )
-due to unexpected exception with message:
- expected exception
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )
-because no exception was thrown where one was expected:
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK_NOTHROW( thisThrows() )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-FAIL aborts the test
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- This is a failure
-
--------------------------------------------------------------------------------
-FAIL does not require an argument
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-
--------------------------------------------------------------------------------
-FAIL_CHECK does not abort the test
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- This is a failure
-
-Message.tests.cpp:<line number>: warning:
- This message appears in the output
-
--------------------------------------------------------------------------------
-Factorials are computed
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( Factorial(0) == 1 )
-with expansion:
- 1 == 1
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( Factorial(1) == 1 )
-with expansion:
- 1 == 1
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( Factorial(2) == 2 )
-with expansion:
- 2 == 2
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( Factorial(3) == 6 )
-with expansion:
- 6 == 6
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( Factorial(10) == 3628800 )
-with expansion:
- 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
-
--------------------------------------------------------------------------------
-Floating point matchers: double
- Relative
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 10., WithinRel(11.1, 0.1) )
-with expansion:
- 10.0 and 11.1 are within 10% of each other
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 10., !WithinRel(11.2, 0.1) )
-with expansion:
- 10.0 not and 11.2 are within 10% of each other
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., !WithinRel(0., 0.99) )
-with expansion:
- 1.0 not and 0 are within 99% of each other
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -0., WithinRel(0.) )
-with expansion:
- -0.0 and 0 are within 2.22045e-12% of each other
-
--------------------------------------------------------------------------------
-Floating point matchers: double
- Relative
- Some subnormal values
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, WithinRel(v2) )
-with expansion:
- 0.0 and 2.22507e-308 are within 2.22045e-12% of each other
-
--------------------------------------------------------------------------------
-Floating point matchers: double
- Margin
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., WithinAbs(1., 0) )
-with expansion:
- 1.0 is within 0.0 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0., WithinAbs(1., 1) )
-with expansion:
- 0.0 is within 1.0 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0., !WithinAbs(1., 0.99) )
-with expansion:
- 0.0 not is within 0.99 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0., !WithinAbs(1., 0.99) )
-with expansion:
- 0.0 not is within 0.99 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 11., !WithinAbs(10., 0.5) )
-with expansion:
- 11.0 not is within 0.5 of 10.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 10., !WithinAbs(11., 0.5) )
-with expansion:
- 10.0 not is within 0.5 of 11.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -10., WithinAbs(-10., 0.5) )
-with expansion:
- -10.0 is within 0.5 of -10.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -10., WithinAbs(-9.6, 0.5) )
-with expansion:
- -10.0 is within 0.5 of -9.6
-
--------------------------------------------------------------------------------
-Floating point matchers: double
- ULPs
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., WithinULP(1., 0) )
-with expansion:
- 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.
- 0000000000000000e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( nextafter(1., 2.), WithinULP(1., 1) )
-with expansion:
- 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.
- 0000000000000002e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0., WithinULP(nextafter(0., 1.), 1) )
-with expansion:
- 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.
- 8813129168249309e-324])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., WithinULP(nextafter(1., 0.), 1) )
-with expansion:
- 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.
- 0000000000000000e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., !WithinULP(nextafter(1., 2.), 0) )
-with expansion:
- 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00,
- 1.0000000000000002e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., WithinULP(1., 0) )
-with expansion:
- 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.
- 0000000000000000e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -0., WithinULP(0., 0) )
-with expansion:
- -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.
- 0000000000000000e+00])
-
--------------------------------------------------------------------------------
-Floating point matchers: double
- Composed
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., WithinAbs(1., 0.5) || WithinULP(2., 1) )
-with expansion:
- 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.
- 9999999999999998e+00, 2.0000000000000004e+00]) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1., WithinAbs(2., 0.5) || WithinULP(1., 0) )
-with expansion:
- 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.
- 0000000000000000e+00, 1.0000000000000000e+00]) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1) )
-with expansion:
- 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
-
--------------------------------------------------------------------------------
-Floating point matchers: double
- Constructor validation
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( WithinAbs(1., 0.) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( WithinAbs(1., -1.), std::domain_error )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( WithinULP(1., 0) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( WithinRel(1., 0.) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( WithinRel(1., -0.2), std::domain_error )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( WithinRel(1., 1.), std::domain_error )
-
--------------------------------------------------------------------------------
-Floating point matchers: float
- Relative
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 10.f, WithinRel(11.1f, 0.1f) )
-with expansion:
- 10.0f and 11.1 are within 10% of each other
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 10.f, !WithinRel(11.2f, 0.1f) )
-with expansion:
- 10.0f not and 11.2 are within 10% of each other
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, !WithinRel(0.f, 0.99f) )
-with expansion:
- 1.0f not and 0 are within 99% of each other
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -0.f, WithinRel(0.f) )
-with expansion:
- -0.0f and 0 are within 0.00119209% of each other
-
--------------------------------------------------------------------------------
-Floating point matchers: float
- Relative
- Some subnormal values
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, WithinRel(v2) )
-with expansion:
- 0.0f and 1.17549e-38 are within 0.00119209% of each other
-
--------------------------------------------------------------------------------
-Floating point matchers: float
- Margin
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, WithinAbs(1.f, 0) )
-with expansion:
- 1.0f is within 0.0 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0.f, WithinAbs(1.f, 1) )
-with expansion:
- 0.0f is within 1.0 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) )
-with expansion:
- 0.0f not is within 0.9900000095 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) )
-with expansion:
- 0.0f not is within 0.9900000095 of 1.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0.f, WithinAbs(-0.f, 0) )
-with expansion:
- 0.0f is within 0.0 of -0.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 11.f, !WithinAbs(10.f, 0.5f) )
-with expansion:
- 11.0f not is within 0.5 of 10.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 10.f, !WithinAbs(11.f, 0.5f) )
-with expansion:
- 10.0f not is within 0.5 of 11.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -10.f, WithinAbs(-10.f, 0.5f) )
-with expansion:
- -10.0f is within 0.5 of -10.0
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -10.f, WithinAbs(-9.6f, 0.5f) )
-with expansion:
- -10.0f is within 0.5 of -9.6000003815
-
--------------------------------------------------------------------------------
-Floating point matchers: float
- ULPs
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, WithinULP(1.f, 0) )
-with expansion:
- 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( nextafter(1.f, 2.f), WithinULP(1.f, 1) )
-with expansion:
- 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0.f, WithinULP(nextafter(0.f, 1.f), 1) )
-with expansion:
- 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, WithinULP(nextafter(1.f, 0.f), 1) )
-with expansion:
- 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, !WithinULP(nextafter(1.f, 2.f), 0) )
-with expansion:
- 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+
- 00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, WithinULP(1.f, 0) )
-with expansion:
- 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00])
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( -0.f, WithinULP(0.f, 0) )
-with expansion:
- -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00])
-
--------------------------------------------------------------------------------
-Floating point matchers: float
- Composed
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) )
-with expansion:
- 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.
- 99999940e-01, 1.00000012e+00]) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) )
-with expansion:
- 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.
- 00000000e+00, 1.00000000e+00]) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( 0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f) )
-with expansion:
- 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
-
--------------------------------------------------------------------------------
-Floating point matchers: float
- Constructor validation
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( WithinAbs(1.f, 0.f) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( WithinAbs(1.f, -1.f), std::domain_error )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( WithinULP(1.f, 0) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( WithinRel(1.f, 0.f) )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( WithinRel(1.f, -0.2f), std::domain_error )
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( WithinRel(1.f, 1.f), std::domain_error )
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Filtering by predicate
- Basic usage
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i % 2 == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Filtering by predicate
- Basic usage
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i % 2 == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Filtering by predicate
- Basic usage
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i % 2 == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Filtering by predicate
- Throws if there are no matching values
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( filter([] (int) {return false; }, value(1)), Catch::GeneratorException )
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Shortening a range
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 4 )
-with expansion:
- 1 < 4
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Shortening a range
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 4 )
-with expansion:
- 2 < 4
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Shortening a range
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 4 )
-with expansion:
- 3 < 4
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Same type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i % 2 == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Same type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i % 2 == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Same type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i % 2 == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Different type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i.size() == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Different type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i.size() == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Different type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i.size() == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Different deduced type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i.size() == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Different deduced type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i.size() == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Transforming elements
- Different deduced type
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( i.size() == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Repeating a generator
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j > 0 )
-with expansion:
- 1 > 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Repeating a generator
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j > 0 )
-with expansion:
- 2 > 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Repeating a generator
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j > 0 )
-with expansion:
- 3 > 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Repeating a generator
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j > 0 )
-with expansion:
- 1 > 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Repeating a generator
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j > 0 )
-with expansion:
- 2 > 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Repeating a generator
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j > 0 )
-with expansion:
- 3 > 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Number of elements in source is divisible by chunk size
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 2 )
-with expansion:
- 2 == 2
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.front() == chunk2.back() )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Number of elements in source is divisible by chunk size
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 2 )
-with expansion:
- 2 == 2
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.front() == chunk2.back() )
-with expansion:
- 2 == 2
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Number of elements in source is divisible by chunk size
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 2 )
-with expansion:
- 2 == 2
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.front() == chunk2.back() )
-with expansion:
- 3 == 3
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Number of elements in source is not divisible by chunk size
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 2 )
-with expansion:
- 2 == 2
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.front() == chunk2.back() )
-with expansion:
- 1 == 1
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.front() < 3 )
-with expansion:
- 1 < 3
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Number of elements in source is not divisible by chunk size
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 2 )
-with expansion:
- 2 == 2
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.front() == chunk2.back() )
-with expansion:
- 2 == 2
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.front() < 3 )
-with expansion:
- 2 < 3
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Chunk size of zero
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Chunk size of zero
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Chunk size of zero
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( chunk2.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Generators -- adapters
- Chunking a generator into sized pieces
- Throws on too small generators
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( chunk(2, value(1)), Catch::GeneratorException )
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -3 < 1
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -2 < 1
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -1 < 1
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 4 > 1
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 4 > 2
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 4 > 3
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -3 < 2
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -2 < 2
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -1 < 2
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 8 > 1
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 8 > 2
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 8 > 3
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -3 < 3
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -2 < 3
-
--------------------------------------------------------------------------------
-Generators -- simple
- one
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( j < i )
-with expansion:
- -1 < 3
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 12 > 1
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 12 > 2
-
--------------------------------------------------------------------------------
-Generators -- simple
- two
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( 4u * i > str.size() )
-with expansion:
- 12 > 3
-
--------------------------------------------------------------------------------
-Generators internals
- Single value
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 123 )
-with expansion:
- 123 == 123
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Preset values
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 3 )
-with expansion:
- 3 == 3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 5 )
-with expansion:
- 5 == 5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Generator combinator
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 5 )
-with expansion:
- 5 == 5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 4 )
-with expansion:
- 4 == 4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 0 )
-with expansion:
- 0 == 0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Explicitly typed generator sequence
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get().size() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == "aa" )
-with expansion:
- "aa" == "aa"
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == "bb" )
-with expansion:
- "bb" == "bb"
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == "cc" )
-with expansion:
- "cc" == "cc"
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Filter generator
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 3 )
-with expansion:
- 3 == 3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( filter([] (int) { return false; }, value(1)), Catch::GeneratorException )
-
--------------------------------------------------------------------------------
-Generators internals
- Take generator
- Take less
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Take generator
- Take more
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Map with explicit return type
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2.0 )
-with expansion:
- 2.0 == 2.0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 4.0 )
-with expansion:
- 4.0 == 4.0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 6.0 )
-with expansion:
- 6.0 == 6.0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Map with deduced return type
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2.0 )
-with expansion:
- 2.0 == 2.0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 4.0 )
-with expansion:
- 4.0 == 4.0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 6.0 )
-with expansion:
- 6.0 == 6.0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Repeat
- Singular repeat
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 3 )
-with expansion:
- 3 == 3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Repeat
- Actual repeat
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 3 )
-with expansion:
- 3 == 3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 3 )
-with expansion:
- 3 == 3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Positive auto step
- Integer
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -2 )
-with expansion:
- -2 == -2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 0 )
-with expansion:
- 0 == 0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Negative auto step
- Integer
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 1 )
-with expansion:
- 1 == 1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 0 )
-with expansion:
- 0 == 0
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Positive manual step
- Integer
- Exact
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -7 )
-with expansion:
- -7 == -7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -4 )
-with expansion:
- -4 == -4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Positive manual step
- Integer
- Slightly over end
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -7 )
-with expansion:
- -7 == -7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -4 )
-with expansion:
- -4 == -4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Positive manual step
- Integer
- Slightly under end
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -7 )
-with expansion:
- -7 == -7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -4 )
-with expansion:
- -4 == -4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 5 )
-with expansion:
- 5 == 5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Positive manual step
- Floating Point
- Exact
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -1.0 == Approx( -1.0 )
-with message:
- Current expected value is -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.9 == Approx( -0.9 )
-with message:
- Current expected value is -0.9
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.9
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.8 == Approx( -0.8 )
-with message:
- Current expected value is -0.8
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.8
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.7 == Approx( -0.7 )
-with message:
- Current expected value is -0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.6 == Approx( -0.6 )
-with message:
- Current expected value is -0.6
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.6
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.5 == Approx( -0.5 )
-with message:
- Current expected value is -0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.4 == Approx( -0.4 )
-with message:
- Current expected value is -0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.3 == Approx( -0.3 )
-with message:
- Current expected value is -0.3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.2 == Approx( -0.2 )
-with message:
- Current expected value is -0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.1 == Approx( -0.1 )
-with message:
- Current expected value is -0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.0 == Approx( -0.0 )
-with message:
- Current expected value is -1.38778e-16
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -1.38778e-16
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.1 == Approx( 0.1 )
-with message:
- Current expected value is 0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.2 == Approx( 0.2 )
-with message:
- Current expected value is 0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.3 == Approx( 0.3 )
-with message:
- Current expected value is 0.3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.3
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.4 == Approx( 0.4 )
-with message:
- Current expected value is 0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.5 == Approx( 0.5 )
-with message:
- Current expected value is 0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.6 == Approx( 0.6 )
-with message:
- Current expected value is 0.6
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.6
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.7 == Approx( 0.7 )
-with message:
- Current expected value is 0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.8 == Approx( 0.8 )
-with message:
- Current expected value is 0.8
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.8
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.9 == Approx( 0.9 )
-with message:
- Current expected value is 0.9
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.9
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx( rangeEnd ) )
-with expansion:
- 1.0 == Approx( 1.0 )
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Positive manual step
- Floating Point
- Slightly over end
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -1.0 == Approx( -1.0 )
-with message:
- Current expected value is -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.7 == Approx( -0.7 )
-with message:
- Current expected value is -0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.4 == Approx( -0.4 )
-with message:
- Current expected value is -0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.1 == Approx( -0.1 )
-with message:
- Current expected value is -0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.2 == Approx( 0.2 )
-with message:
- Current expected value is 0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.5 == Approx( 0.5 )
-with message:
- Current expected value is 0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Positive manual step
- Floating Point
- Slightly under end
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -1.0 == Approx( -1.0 )
-with message:
- Current expected value is -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.7 == Approx( -0.7 )
-with message:
- Current expected value is -0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.4 == Approx( -0.4 )
-with message:
- Current expected value is -0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- -0.1 == Approx( -0.1 )
-with message:
- Current expected value is -0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is -0.1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.2 == Approx( 0.2 )
-with message:
- Current expected value is 0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == Approx(expected) )
-with expansion:
- 0.5 == Approx( 0.5 )
-with message:
- Current expected value is 0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-with message:
- Current expected value is 0.5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Negative manual step
- Integer
- Exact
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 5 )
-with expansion:
- 5 == 5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -4 )
-with expansion:
- -4 == -4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Negative manual step
- Integer
- Slightly over end
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 5 )
-with expansion:
- 5 == 5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -4 )
-with expansion:
- -4 == -4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Generators internals
- Range
- Negative manual step
- Integer
- Slightly under end
--------------------------------------------------------------------------------
-GeneratorsImpl.tests.cpp:<line number>
-...............................................................................
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 5 )
-with expansion:
- 5 == 5
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == 2 )
-with expansion:
- 2 == 2
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -1 )
-with expansion:
- -1 == -1
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -4 )
-with expansion:
- -4 == -4
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.next() )
-with expansion:
- true
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE( gen.get() == -7 )
-with expansion:
- -7 == -7
-
-GeneratorsImpl.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( gen.next() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Greater-than inequalities with different epsilons
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d >= Approx( 1.22 ) )
-with expansion:
- 1.23 >= Approx( 1.22 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d >= Approx( 1.23 ) )
-with expansion:
- 1.23 >= Approx( 1.23 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( d >= Approx( 1.24 ) )
-with expansion:
- !(1.23 >= Approx( 1.24 ))
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d >= Approx( 1.24 ).epsilon(0.1) )
-with expansion:
- 1.23 >= Approx( 1.24 )
-
--------------------------------------------------------------------------------
-INFO and WARN do not abort tests
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: warning:
- this is a message
- this is a warning
-
-
-No assertions in test case 'INFO and WARN do not abort tests'
-
--------------------------------------------------------------------------------
-INFO gets logged on failure
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( a == 1 )
-with expansion:
- 2 == 1
-with messages:
- this message should be logged
- so should this
-
--------------------------------------------------------------------------------
-INFO gets logged on failure, even if captured before successful assertions
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
- CHECK( a == 2 )
-with expansion:
- 2 == 2
-with message:
- this message may be logged later
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( a == 1 )
-with expansion:
- 2 == 1
-with messages:
- this message may be logged later
- this message should be logged
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( a == 0 )
-with expansion:
- 2 == 0
-with messages:
- this message may be logged later
- this message should be logged
- and this, but later
-
-Message.tests.cpp:<line number>: PASSED:
- CHECK( a == 2 )
-with expansion:
- 2 == 2
-with messages:
- this message may be logged later
- this message should be logged
- and this, but later
- but not this
-
--------------------------------------------------------------------------------
-INFO is reset for each loop
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 0 < 10
-with messages:
- current counter 0
- i := 0
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 1 < 10
-with messages:
- current counter 1
- i := 1
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 2 < 10
-with messages:
- current counter 2
- i := 2
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 3 < 10
-with messages:
- current counter 3
- i := 3
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 4 < 10
-with messages:
- current counter 4
- i := 4
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 5 < 10
-with messages:
- current counter 5
- i := 5
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 6 < 10
-with messages:
- current counter 6
- i := 6
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 7 < 10
-with messages:
- current counter 7
- i := 7
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 8 < 10
-with messages:
- current counter 8
- i := 8
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( i < 10 )
-with expansion:
- 9 < 10
-with messages:
- current counter 9
- i := 9
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( i < 10 )
-with expansion:
- 10 < 10
-with messages:
- current counter 10
- i := 10
-
--------------------------------------------------------------------------------
-Inequality checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven != 7 )
-with expansion:
- 7 != 7
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one != Approx( 9.1f ) )
-with expansion:
- 9.1f != Approx( 9.1000003815 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.double_pi != Approx( 3.1415926535 ) )
-with expansion:
- 3.1415926535 != Approx( 3.1415926535 )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello != "hello" )
-with expansion:
- "hello" != "hello"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello.size() != 5 )
-with expansion:
- 5 != 5
-
--------------------------------------------------------------------------------
-Inequality checks that should succeed
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven != 6 )
-with expansion:
- 7 != 6
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven != 8 )
-with expansion:
- 7 != 8
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one != Approx( 9.11f ) )
-with expansion:
- 9.1f != Approx( 9.1099996567 )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one != Approx( 9.0f ) )
-with expansion:
- 9.1f != Approx( 9.0 )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one != Approx( 1 ) )
-with expansion:
- 9.1f != Approx( 1.0 )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one != Approx( 0 ) )
-with expansion:
- 9.1f != Approx( 0.0 )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.double_pi != Approx( 3.1415 ) )
-with expansion:
- 3.1415926535 != Approx( 3.1415 )
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello != "goodbye" )
-with expansion:
- "hello" != "goodbye"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello != "hell" )
-with expansion:
- "hello" != "hell"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello != "hello1" )
-with expansion:
- "hello" != "hello1"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello.size() != 6 )
-with expansion:
- 5 != 6
-
--------------------------------------------------------------------------------
-Less-than inequalities with different epsilons
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d <= Approx( 1.24 ) )
-with expansion:
- 1.23 <= Approx( 1.24 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d <= Approx( 1.23 ) )
-with expansion:
- 1.23 <= Approx( 1.23 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( d <= Approx( 1.22 ) )
-with expansion:
- !(1.23 <= Approx( 1.22 ))
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d <= Approx( 1.22 ).epsilon(0.1) )
-with expansion:
- 1.23 <= Approx( 1.22 )
-
--------------------------------------------------------------------------------
-ManuallyRegistered
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- was called
-
--------------------------------------------------------------------------------
-Matchers can be (AllOf) composed with the && operator
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") )
-with expansion:
- "this string contains 'abc' as a substring" ( contains: "string" and
- contains: "abc" and contains: "substring" and contains: "contains" )
-
--------------------------------------------------------------------------------
-Matchers can be (AnyOf) composed with the || operator
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), Contains("string") || Contains("different") || Contains("random") )
-with expansion:
- "this string contains 'abc' as a substring" ( contains: "string" or contains:
- "different" or contains: "random" )
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") )
-with expansion:
- "some completely different text that contains one common word" ( contains:
- "string" or contains: "different" or contains: "random" )
-
--------------------------------------------------------------------------------
-Matchers can be composed with both && and ||
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") )
-with expansion:
- "this string contains 'abc' as a substring" ( ( contains: "string" or
- contains: "different" ) and contains: "substring" )
-
--------------------------------------------------------------------------------
-Matchers can be composed with both && and || - failing
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") )
-with expansion:
- "this string contains 'abc' as a substring" ( ( contains: "string" or
- contains: "different" ) and contains: "random" )
-
--------------------------------------------------------------------------------
-Matchers can be negated (Not) with the ! operator
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), !Contains("different") )
-with expansion:
- "this string contains 'abc' as a substring" not contains: "different"
-
--------------------------------------------------------------------------------
-Matchers can be negated (Not) with the ! operator - failing
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), !Contains("substring") )
-with expansion:
- "this string contains 'abc' as a substring" not contains: "substring"
-
--------------------------------------------------------------------------------
-Mismatching exception messages failing the test
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_WITH( thisThrows(), "expected exception" )
-with expansion:
- "expected exception" equals: "expected exception"
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_THROWS_WITH( thisThrows(), "should fail" )
-with expansion:
- "expected exception" equals: "should fail"
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 3 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 4 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 5 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 6 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- -5 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- -4 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 90 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 91 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 92 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 93 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 94 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 95 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 96 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 97 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 98 > -6
-
--------------------------------------------------------------------------------
-Nested generators and captured variables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( values > -6 )
-with expansion:
- 99 > -6
-
--------------------------------------------------------------------------------
-Nice descriptive name
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: warning:
- This one ran
-
-
-No assertions in test case 'Nice descriptive name'
-
--------------------------------------------------------------------------------
-Non-std exceptions can be translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- custom exception
-
--------------------------------------------------------------------------------
-Objects that evaluated in boolean contexts can be checked
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK( True )
-with expansion:
- {?}
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK( !False )
-with expansion:
- true
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( False )
-with expansion:
- !{?}
-
--------------------------------------------------------------------------------
-Optionally static assertions
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
-with message:
- std::is_void<void>::value
-
-Compilation.tests.cpp:<line number>: PASSED:
-with message:
- !(std::is_void<int>::value)
-
--------------------------------------------------------------------------------
-Ordering comparison checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven > 7 )
-with expansion:
- 7 > 7
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < 7 )
-with expansion:
- 7 < 7
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven > 8 )
-with expansion:
- 7 > 8
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < 6 )
-with expansion:
- 7 < 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < 0 )
-with expansion:
- 7 < 0
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven < -1 )
-with expansion:
- 7 < -1
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven >= 8 )
-with expansion:
- 7 >= 8
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.int_seven <= 6 )
-with expansion:
- 7 <= 6
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one < 9 )
-with expansion:
- 9.1f < 9
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one > 10 )
-with expansion:
- 9.1f > 10
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.float_nine_point_one > 9.2 )
-with expansion:
- 9.1f > 9.2
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello > "hello" )
-with expansion:
- "hello" > "hello"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello < "hello" )
-with expansion:
- "hello" < "hello"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello > "hellp" )
-with expansion:
- "hello" > "hellp"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello > "z" )
-with expansion:
- "hello" > "z"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello < "hellm" )
-with expansion:
- "hello" < "hellm"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello < "a" )
-with expansion:
- "hello" < "a"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello >= "z" )
-with expansion:
- "hello" >= "z"
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( data.str_hello <= "a" )
-with expansion:
- "hello" <= "a"
-
--------------------------------------------------------------------------------
-Ordering comparison checks that should succeed
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven < 8 )
-with expansion:
- 7 < 8
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven > 6 )
-with expansion:
- 7 > 6
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven > 0 )
-with expansion:
- 7 > 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven > -1 )
-with expansion:
- 7 > -1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven >= 7 )
-with expansion:
- 7 >= 7
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven >= 6 )
-with expansion:
- 7 >= 6
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven <= 7 )
-with expansion:
- 7 <= 7
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.int_seven <= 8 )
-with expansion:
- 7 <= 8
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one > 9 )
-with expansion:
- 9.1f > 9
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one < 10 )
-with expansion:
- 9.1f < 10
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.float_nine_point_one < 9.2 )
-with expansion:
- 9.1f < 9.2
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello <= "hello" )
-with expansion:
- "hello" <= "hello"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello >= "hello" )
-with expansion:
- "hello" >= "hello"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello < "hellp" )
-with expansion:
- "hello" < "hellp"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello < "zebra" )
-with expansion:
- "hello" < "zebra"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello > "hellm" )
-with expansion:
- "hello" > "hellm"
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str_hello > "a" )
-with expansion:
- "hello" > "a"
-
--------------------------------------------------------------------------------
-Our PCG implementation provides expected results for known seeds
- Default seeded
--------------------------------------------------------------------------------
-RandomNumberGeneration.tests.cpp:<line number>
-...............................................................................
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 4242248763 (0x<hex digits>)
- ==
- 4242248763 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 1867888929 (0x<hex digits>)
- ==
- 1867888929 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 1276619030 (0x<hex digits>)
- ==
- 1276619030 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 1911218783 (0x<hex digits>)
- ==
- 1911218783 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 1827115164 (0x<hex digits>)
- ==
- 1827115164 (0x<hex digits>)
-
--------------------------------------------------------------------------------
-Our PCG implementation provides expected results for known seeds
- Specific seed
--------------------------------------------------------------------------------
-RandomNumberGeneration.tests.cpp:<line number>
-...............................................................................
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 1472234645 (0x<hex digits>)
- ==
- 1472234645 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 868832940 (0x<hex digits>)
- ==
- 868832940 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 570883446 (0x<hex digits>)
- ==
- 570883446 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 889299803 (0x<hex digits>)
- ==
- 889299803 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 4261393167 (0x<hex digits>)
- ==
- 4261393167 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 1472234645 (0x<hex digits>)
- ==
- 1472234645 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 868832940 (0x<hex digits>)
- ==
- 868832940 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 570883446 (0x<hex digits>)
- ==
- 570883446 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 889299803 (0x<hex digits>)
- ==
- 889299803 (0x<hex digits>)
-
-RandomNumberGeneration.tests.cpp:<line number>: PASSED:
- REQUIRE( rng() == 0x<hex digits> )
-with expansion:
- 4261393167 (0x<hex digits>)
- ==
- 4261393167 (0x<hex digits>)
-
--------------------------------------------------------------------------------
-Output from all sections is reported
- one
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- Message from section one
-
--------------------------------------------------------------------------------
-Output from all sections is reported
- two
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- Message from section two
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Empty test spec should have no filters
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Test spec from empty string should have no filters
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches(tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Test spec from just a comma should have no filters
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Test spec from name should have one filter
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Test spec from quoted name should have one filter
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Test spec from name should have one filter
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Wildcard at the start
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( parseTestSpec( "*a" ).matches( tcA ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Wildcard at the end
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( parseTestSpec( "a*" ).matches( tcA ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Wildcard at both ends
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( parseTestSpec( "*a*" ).matches( tcA ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Redundant wildcard at the start
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Redundant wildcard at the end
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Redundant wildcard at both ends
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Wildcard at both ends, redundant at start
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Just wildcard
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Single tag
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Single tag, two matches
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Two tags
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Two tags, spare separated
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Wildcarded name and tag
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Single tag exclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- One tag exclusion and one tag inclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- One tag exclusion and one wldcarded name inclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- One tag exclusion, using exclude:, and one wldcarded name inclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- name exclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- wildcarded name exclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- wildcarded name exclusion with tag inclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- wildcarded name exclusion, using exclude:, with tag inclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- two wildcarded names
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- empty tag
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- empty quoted name
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- quoted string followed by tag exclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.hasFilters() == true )
-with expansion:
- true == true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcA ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcB ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcC ) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( tcD ) == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Leading and trailing spaces in test spec
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( " aardvark" ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( "aardvark " ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( "aardvark" ) ) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Leading and trailing spaces in test name
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( " aardvark" ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( "aardvark " ) ) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches( fakeTestCase( "aardvark" ) ) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Shortened hide tags are split apart when parsing
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches(fakeTestCase("hidden and foo", "[.][foo]")) )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( spec.matches(fakeTestCase("only foo", "[foo]")) )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Parse test names and tags
- Shortened hide tags also properly handle exclusion
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( spec.matches(fakeTestCase("hidden and foo", "[.][foo]")) )
-with expansion:
- !false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( spec.matches(fakeTestCase("only foo", "[foo]")) )
-with expansion:
- !false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( spec.matches(fakeTestCase("only hidden", "[.]")) )
-with expansion:
- !false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( spec.matches(fakeTestCase("neither foo nor hidden", "[bar]")) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Pointers can be compared to null
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( p == 0 )
-with expansion:
- 0 == 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( p == pNULL )
-with expansion:
- 0 == 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( p != 0 )
-with expansion:
- 0x<hex digits> != 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( cp != 0 )
-with expansion:
- 0x<hex digits> != 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( cpc != 0 )
-with expansion:
- 0x<hex digits> != 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( returnsNull() == 0 )
-with expansion:
- {null string} == 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( returnsConstNull() == 0 )
-with expansion:
- {null string} == 0
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 != p )
-with expansion:
- 0 != 0x<hex digits>
-
--------------------------------------------------------------------------------
-Precision of floating point stringification can be set
- Floats
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( str1.size() == 3 + 5 )
-with expansion:
- 8 == 8
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( str2.size() == 3 + 10 )
-with expansion:
- 13 == 13
-
--------------------------------------------------------------------------------
-Precision of floating point stringification can be set
- Double
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- CHECK( str1.size() == 2 + 5 )
-with expansion:
- 7 == 7
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( str2.size() == 2 + 15 )
-with expansion:
- 17 == 17
-
--------------------------------------------------------------------------------
-Predicate matcher can accept const char*
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( "foo", Predicate<const char*>([] (const char* const&) { return true; }) )
-with expansion:
- "foo" matches undescribed predicate
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- empty args don't cause a crash
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( result )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.processName == "" )
-with expansion:
- "" == ""
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- default - no arguments
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( result )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.processName == "test" )
-with expansion:
- "test" == "test"
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.shouldDebugBreak == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.abortAfter == -1 )
-with expansion:
- -1 == -1
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.noThrow == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.reporterName == "console" )
-with expansion:
- "console" == "console"
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( cfg.hasTestFilters() )
-with expansion:
- !false
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- test lists
- Specify one test case using
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( result )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.hasTestFilters() )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.testSpec().matches(fakeTestCase("notIncluded")) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- test lists
- Specify one test case exclusion using exclude:
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( result )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.hasTestFilters() )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- test lists
- Specify one test case exclusion using ~
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( result )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.hasTestFilters() )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false )
-with expansion:
- false == false
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- reporter
- -r/console
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-r", "console"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.reporterName == "console" )
-with expansion:
- "console" == "console"
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- reporter
- -r/xml
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-r", "xml"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.reporterName == "xml" )
-with expansion:
- "xml" == "xml"
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- reporter
- --reporter/junit
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--reporter", "junit"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.reporterName == "junit" )
-with expansion:
- "junit" == "junit"
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- reporter
- Only one reporter is accepted
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( cli.parse({ "test", "-r", "xml", "-r", "junit" }) )
-with expansion:
- !{?}
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- reporter
- must match one of the available ones
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( !result )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( result.errorMessage(), Contains("Unrecognized reporter") )
-with expansion:
- "Unrecognized reporter, 'unsupported'. Check available with --list-reporters"
- contains: "Unrecognized reporter"
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- debugger
- -b
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-b"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.shouldDebugBreak == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- debugger
- --break
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--break"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.shouldDebugBreak )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- -a aborts after first failure
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-a"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.abortAfter == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- -x 2 aborts after two failures
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-x", "2"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.abortAfter == 2 )
-with expansion:
- 2 == 2
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- -x must be numeric
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( !result )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( result.errorMessage(), Contains("convert") && Contains("oops") )
-with expansion:
- "Unable to convert 'oops' to destination type" ( contains: "convert" and
- contains: "oops" )
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- wait-for-keypress
- Accepted options
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.waitForKeypress == std::get<1>(input) )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- wait-for-keypress
- Accepted options
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.waitForKeypress == std::get<1>(input) )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- wait-for-keypress
- Accepted options
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.waitForKeypress == std::get<1>(input) )
-with expansion:
- 2 == 2
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- wait-for-keypress
- Accepted options
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.waitForKeypress == std::get<1>(input) )
-with expansion:
- 3 == 3
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- abort
- wait-for-keypress
- invalid options are reported
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( !result )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( result.errorMessage(), Contains("never") && Contains("both") )
-with expansion:
- "keypress argument must be one of: never, start, exit or both. 'sometimes'
- not recognised" ( contains: "never" and contains: "both" )
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- nothrow
- -e
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-e"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.noThrow )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- nothrow
- --nothrow
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--nothrow"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.noThrow )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- output filename
- -o filename
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-o", "filename.ext"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.outputFilename == "filename.ext" )
-with expansion:
- "filename.ext" == "filename.ext"
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- output filename
- --out
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--out", "filename.ext"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.outputFilename == "filename.ext" )
-with expansion:
- "filename.ext" == "filename.ext"
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- combinations
- Single character flags can be combined
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "-abe"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.abortAfter == 1 )
-with expansion:
- 1 == 1
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.shouldDebugBreak )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( config.noThrow == true )
-with expansion:
- true == true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- use-colour
- without option
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.useColour == UseColour::Auto )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- use-colour
- auto
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--use-colour", "auto"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.useColour == UseColour::Auto )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- use-colour
- yes
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--use-colour", "yes"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.useColour == UseColour::Yes )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- use-colour
- no
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({"test", "--use-colour", "no"}) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.useColour == UseColour::No )
-with expansion:
- 2 == 2
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- use-colour
- error
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( !result )
-with expansion:
- true
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) )
-with expansion:
- "colour mode must be one of: auto, yes or no. 'wrong' not recognised"
- contains: "colour mode must be one of"
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- Benchmark options
- samples
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({ "test", "--benchmark-samples=200" }) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.benchmarkSamples == 200 )
-with expansion:
- 200 == 200
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- Benchmark options
- resamples
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({ "test", "--benchmark-resamples=20000" }) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.benchmarkResamples == 20000 )
-with expansion:
- 20000 (0x<hex digits>) == 20000 (0x<hex digits>)
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- Benchmark options
- confidence-interval
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({ "test", "--benchmark-confidence-interval=0.99" }) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.benchmarkConfidenceInterval == Catch::Detail::Approx(0.99) )
-with expansion:
- 0.99 == Approx( 0.99 )
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- Benchmark options
- no-analysis
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({ "test", "--benchmark-no-analysis" }) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.benchmarkNoAnalysis )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Process can be configured on command line
- Benchmark options
- warmup-time
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
- CHECK( cli.parse({ "test", "--benchmark-warmup-time=10" }) )
-with expansion:
- {?}
-
-CmdLine.tests.cpp:<line number>: PASSED:
- REQUIRE( config.benchmarkWarmupTime == 10 )
-with expansion:
- 10 == 10
-
--------------------------------------------------------------------------------
-Product with differing arities - std::tuple<int, double, float>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( std::tuple_size<TestType>::value >= 1 )
-with expansion:
- 3 >= 1
-
--------------------------------------------------------------------------------
-Product with differing arities - std::tuple<int, double>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( std::tuple_size<TestType>::value >= 1 )
-with expansion:
- 2 >= 1
-
--------------------------------------------------------------------------------
-Product with differing arities - std::tuple<int>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( std::tuple_size<TestType>::value >= 1 )
-with expansion:
- 1 >= 1
-
--------------------------------------------------------------------------------
-Reconstruction should be based on stringification: #914
--------------------------------------------------------------------------------
-Decomposition.tests.cpp:<line number>
-...............................................................................
-
-Decomposition.tests.cpp:<line number>: FAILED:
- CHECK( truthy(false) )
-with expansion:
- Hey, its truthy!
-
--------------------------------------------------------------------------------
-Regex string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this STRING contains
- 'abc' as a substring" case sensitively
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "contains 'abc' as a
- substring" case sensitively
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this string contains
- 'abc' as a" case sensitively
-
--------------------------------------------------------------------------------
-Regression test #1
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( actual, !UnorderedEquals(expected) )
-with expansion:
- { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
-
--------------------------------------------------------------------------------
-SUCCEED counts as a test pass
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
-with message:
- this is a success
-
--------------------------------------------------------------------------------
-SUCCEED does not require an argument
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or
- methods
- Given: No operations precede me
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( before == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or
- methods
- Given: No operations precede me
- When: We get the count
- Then: Subsequently values are higher
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( after > before )
-with expansion:
- 1 > 0
-
--------------------------------------------------------------------------------
-Scenario: Do that thing with the thing
- Given: This stuff exists
- And given: And some assumption
- When: I do this
- Then: it should do this
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( itDoesThis() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Scenario: Do that thing with the thing
- Given: This stuff exists
- And given: And some assumption
- When: I do this
- Then: it should do this
- And: do that
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( itDoesThat() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Scenario: This is a really long scenario name to see how the list command deals
- with wrapping
- Given: A section name that is so long that it cannot fit in a single
- console width
- When: The test headers are printed as part of the normal running of the
- scenario
- Then: The, deliberately very long and overly verbose (you see what I did
- there?) section names must wrap, along with an indent
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
-with message:
- boo!
-
--------------------------------------------------------------------------------
-Scenario: Vector resizing affects size and capacity
- Given: an empty vector
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Scenario: Vector resizing affects size and capacity
- Given: an empty vector
- When: it is made larger
- Then: the size and capacity go up
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 10 )
-with expansion:
- 10 == 10
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-Scenario: Vector resizing affects size and capacity
- Given: an empty vector
- When: it is made larger
- Then: the size and capacity go up
- And when: it is made smaller again
- Then: the size goes down but the capacity stays the same
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-Scenario: Vector resizing affects size and capacity
- Given: an empty vector
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-Scenario: Vector resizing affects size and capacity
- Given: an empty vector
- When: we reserve more space
- Then: The capacity is increased but the size remains the same
--------------------------------------------------------------------------------
-BDD.tests.cpp:<line number>
-...............................................................................
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
-BDD.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-A string sent directly to stdout
-A string sent directly to stderr
-A string sent to stderr via clog
--------------------------------------------------------------------------------
-Sends stuff to stdout and stderr
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'Sends stuff to stdout and stderr'
-
--------------------------------------------------------------------------------
-Some simple comparisons between doubles
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == Approx( 1.23 ) )
-with expansion:
- 1.23 == Approx( 1.23 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d != Approx( 1.22 ) )
-with expansion:
- 1.23 != Approx( 1.22 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d != Approx( 1.24 ) )
-with expansion:
- 1.23 != Approx( 1.24 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == 1.23_a )
-with expansion:
- 1.23 == Approx( 1.23 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d != 1.22_a )
-with expansion:
- 1.23 != Approx( 1.22 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx( d ) == 1.23 )
-with expansion:
- Approx( 1.23 ) == 1.23
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx( d ) != 1.22 )
-with expansion:
- Approx( 1.23 ) != 1.22
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( Approx( d ) != 1.24 )
-with expansion:
- Approx( 1.23 ) != 1.24
-
-Message from section one
--------------------------------------------------------------------------------
-Standard output from all sections is reported
- one
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in section 'one'
-
-Message from section two
--------------------------------------------------------------------------------
-Standard output from all sections is reported
- two
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in section 'two'
-
--------------------------------------------------------------------------------
-StartsWith string matcher
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("This String") )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "This String"
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "string" (case
- insensitive)
-
--------------------------------------------------------------------------------
-Static arrays are convertible to string
- Single item
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify(singular) == "{ 1 }" )
-with expansion:
- "{ 1 }" == "{ 1 }"
-
--------------------------------------------------------------------------------
-Static arrays are convertible to string
- Multiple
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" )
-with expansion:
- "{ 3, 2, 1 }" == "{ 3, 2, 1 }"
-
--------------------------------------------------------------------------------
-Static arrays are convertible to string
- Non-trivial inner items
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" )
-with expansion:
- "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }"
- ==
- "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }"
-
--------------------------------------------------------------------------------
-String matchers
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testStringForMatching(), Contains("string") )
-with expansion:
- "this string contains 'abc' as a substring" contains: "string"
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testStringForMatching(), Contains("string", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" contains: "string" (case
- insensitive)
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), Contains("abc") )
-with expansion:
- "this string contains 'abc' as a substring" contains: "abc"
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" contains: "abc" (case
- insensitive)
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), StartsWith("this") )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "this"
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "this" (case
- insensitive)
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), EndsWith("substring") )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "substring"
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" ends with: " substring" (case
- insensitive)
-
--------------------------------------------------------------------------------
-StringRef
- Empty string
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( empty.empty() )
-with expansion:
- true
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( empty.size() == 0 )
-with expansion:
- 0 == 0
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( empty.isNullTerminated() )
-with expansion:
- true
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-StringRef
- From string literal
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.empty() == false )
-with expansion:
- false == false
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.size() == 5 )
-with expansion:
- 5 == 5
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.isNullTerminated() )
-with expansion:
- true
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( std::strcmp( rawChars, "hello" ) == 0 )
-with expansion:
- 0 == 0
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( s.c_str() )
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.c_str() == rawChars )
-with expansion:
- "hello" == "hello"
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.data() == rawChars )
-with expansion:
- "hello" == "hello"
-
--------------------------------------------------------------------------------
-StringRef
- From sub-string
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( original == "original" )
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE_FALSE( original.isNullTerminated() )
-with expansion:
- !false
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS( original.c_str() )
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( original.data() )
-
--------------------------------------------------------------------------------
-StringRef
- Substrings
- zero-based substring
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( ss.empty() == false )
-with expansion:
- false == false
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( ss.size() == 5 )
-with expansion:
- 5 == 5
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( std::strncmp( ss.data(), "hello", 5 ) == 0 )
-with expansion:
- 0 == 0
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( ss == "hello" )
-with expansion:
- hello == "hello"
-
--------------------------------------------------------------------------------
-StringRef
- Substrings
- non-zero-based substring
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( ss.size() == 6 )
-with expansion:
- 6 == 6
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( std::strcmp( ss.c_str(), "world!" ) == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-StringRef
- Substrings
- Pointer values of full refs should match
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.data() == s2.data() )
-with expansion:
- "hello world!" == "hello world!"
-
--------------------------------------------------------------------------------
-StringRef
- Substrings
- Pointer values of substring refs should also match
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.data() == ss.data() )
-with expansion:
- "hello world!" == "hello world!"
-
--------------------------------------------------------------------------------
-StringRef
- Substrings
- Past the end substring
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( s.substr(s.size() + 1, 123).empty() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-StringRef
- Substrings
- Substring off the end are trimmed
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( std::strcmp(ss.c_str(), "world!") == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-StringRef
- Comparisons are deep
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- CHECK( (char*)buffer1 != (char*)buffer2 )
-with expansion:
- "Hello" != "Hello"
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( left == right )
-with expansion:
- Hello == Hello
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( left != left.substr(0, 3) )
-with expansion:
- Hello != Hel
-
--------------------------------------------------------------------------------
-StringRef
- from std::string
- implicitly constructed
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( sr == "a standard string" )
-with expansion:
- a standard string == "a standard string"
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( sr.size() == stdStr.size() )
-with expansion:
- 17 == 17
-
--------------------------------------------------------------------------------
-StringRef
- from std::string
- explicitly constructed
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( sr == "a standard string" )
-with expansion:
- a standard string == "a standard string"
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( sr.size() == stdStr.size() )
-with expansion:
- 17 == 17
-
--------------------------------------------------------------------------------
-StringRef
- from std::string
- assigned
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( sr == "a standard string" )
-with expansion:
- a standard string == "a standard string"
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( sr.size() == stdStr.size() )
-with expansion:
- 17 == 17
-
--------------------------------------------------------------------------------
-StringRef
- to std::string
- explicitly constructed
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( stdStr == "a stringref" )
-with expansion:
- "a stringref" == "a stringref"
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( stdStr.size() == sr.size() )
-with expansion:
- 11 == 11
-
--------------------------------------------------------------------------------
-StringRef
- to std::string
- assigned
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( stdStr == "a stringref" )
-with expansion:
- "a stringref" == "a stringref"
-
-String.tests.cpp:<line number>: PASSED:
- REQUIRE( stdStr.size() == sr.size() )
-with expansion:
- 11 == 11
-
--------------------------------------------------------------------------------
-StringRef at compilation time
- Simple constructors
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- StringRef{}.size() == 0
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- StringRef{ "abc", 3 }.size() == 3
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- StringRef{ "abc", 3 }.isNullTerminated()
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- StringRef{ "abc", 2 }.size() == 2
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- !(StringRef{ "abc", 2 }.isNullTerminated())
-
--------------------------------------------------------------------------------
-StringRef at compilation time
- UDL construction
--------------------------------------------------------------------------------
-String.tests.cpp:<line number>
-...............................................................................
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- !(sr1.empty())
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- sr1.size() == 3
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- sr1.isNullTerminated()
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- sr2.empty()
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- sr2.size() == 0
-
-String.tests.cpp:<line number>: PASSED:
-with message:
- sr2.isNullTerminated()
-
--------------------------------------------------------------------------------
-Stringifying std::chrono::duration helpers
--------------------------------------------------------------------------------
-ToStringChrono.tests.cpp:<line number>
-...............................................................................
-
-ToStringChrono.tests.cpp:<line number>: PASSED:
- REQUIRE( minute == seconds )
-with expansion:
- 1 m == 60 s
-
-ToStringChrono.tests.cpp:<line number>: PASSED:
- REQUIRE( hour != seconds )
-with expansion:
- 1 h != 60 s
-
-ToStringChrono.tests.cpp:<line number>: PASSED:
- REQUIRE( micro != milli )
-with expansion:
- 1 us != 1 ms
-
-ToStringChrono.tests.cpp:<line number>: PASSED:
- REQUIRE( nano != micro )
-with expansion:
- 1 ns != 1 us
-
--------------------------------------------------------------------------------
-Stringifying std::chrono::duration with weird ratios
--------------------------------------------------------------------------------
-ToStringChrono.tests.cpp:<line number>
-...............................................................................
-
-ToStringChrono.tests.cpp:<line number>: PASSED:
- REQUIRE( half_minute != femto_second )
-with expansion:
- 1 [30/1]s != 1 fs
-
-ToStringChrono.tests.cpp:<line number>: PASSED:
- REQUIRE( pico_second != atto_second )
-with expansion:
- 1 ps != 1 as
-
--------------------------------------------------------------------------------
-Stringifying std::chrono::time_point<system_clock>
--------------------------------------------------------------------------------
-ToStringChrono.tests.cpp:<line number>
-...............................................................................
-
-ToStringChrono.tests.cpp:<line number>: PASSED:
- REQUIRE( now != later )
-with expansion:
- {iso8601-timestamp}
- !=
- {iso8601-timestamp}
-
--------------------------------------------------------------------------------
-Tabs and newlines show in output
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( s1 == s2 )
-with expansion:
- "if ($b == 10) {
- $a = 20;
- }"
- ==
- "if ($b == 10) {
- $a = 20;
- }
- "
-
--------------------------------------------------------------------------------
-Tag alias can be registered against tag patterns
- The same tag alias can only be registered once
--------------------------------------------------------------------------------
-Tag.tests.cpp:<line number>
-...............................................................................
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THAT( what, Contains( "[@zzz]" ) )
-with expansion:
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "[@zzz]"
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THAT( what, Contains( "file" ) )
-with expansion:
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "file"
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THAT( what, Contains( "2" ) )
-with expansion:
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "2"
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THAT( what, Contains( "10" ) )
-with expansion:
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "10"
-
--------------------------------------------------------------------------------
-Tag alias can be registered against tag patterns
- Tag aliases must be of the form [@name]
--------------------------------------------------------------------------------
-Tag.tests.cpp:<line number>
-...............................................................................
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) )
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) )
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) )
-
-Tag.tests.cpp:<line number>: PASSED:
- CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) )
-
--------------------------------------------------------------------------------
-Template test case method with test types specified inside std::tuple - MyTypes
-- 0
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture<TestType>::m_a == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Template test case method with test types specified inside std::tuple - MyTypes
-- 1
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture<TestType>::m_a == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-Template test case method with test types specified inside std::tuple - MyTypes
-- 2
--------------------------------------------------------------------------------
-Class.tests.cpp:<line number>
-...............................................................................
-
-Class.tests.cpp:<line number>: PASSED:
- REQUIRE( Template_Fixture<TestType>::m_a == 1 )
-with expansion:
- 1.0 == 1
-
--------------------------------------------------------------------------------
-Template test case with test types specified inside non-copyable and non-
-movable std::tuple - NonCopyableAndNonMovableTypes - 0
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( sizeof(TestType) > 0 )
-with expansion:
- 1 > 0
-
--------------------------------------------------------------------------------
-Template test case with test types specified inside non-copyable and non-
-movable std::tuple - NonCopyableAndNonMovableTypes - 1
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( sizeof(TestType) > 0 )
-with expansion:
- 4 > 0
-
--------------------------------------------------------------------------------
-Template test case with test types specified inside non-default-constructible
-std::tuple - MyNonDefaultConstructibleTypes - 0
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( sizeof(TestType) > 0 )
-with expansion:
- 1 > 0
-
--------------------------------------------------------------------------------
-Template test case with test types specified inside non-default-constructible
-std::tuple - MyNonDefaultConstructibleTypes - 1
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( sizeof(TestType) > 0 )
-with expansion:
- 4 > 0
-
--------------------------------------------------------------------------------
-Template test case with test types specified inside std::tuple - MyTypes - 0
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( sizeof(TestType) > 0 )
-with expansion:
- 4 > 0
-
--------------------------------------------------------------------------------
-Template test case with test types specified inside std::tuple - MyTypes - 1
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( sizeof(TestType) > 0 )
-with expansion:
- 1 > 0
-
--------------------------------------------------------------------------------
-Template test case with test types specified inside std::tuple - MyTypes - 2
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( sizeof(TestType) > 0 )
-with expansion:
- 4 > 0
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 10 )
-with expansion:
- 10 == 10
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - float
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 10 )
-with expansion:
- 10 == 10
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - int
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 10 )
-with expansion:
- 10 == 10
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::string
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 10 )
-with expansion:
- 10 == 10
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTest: vectors can be sized and resized - std::tuple<int,float>
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 6 == 6
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 6 >= 6
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 2 * V )
-with expansion:
- 12 == 12
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 12 >= 12
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 6 == 6
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 6 >= 6
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 6 >= 6
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 6 == 6
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 6 >= 6
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 6 == 6
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 12 >= 12
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 6 == 6
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 6 >= 6
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 6 == 6
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 6 >= 6
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 4 == 4
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 4 >= 4
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 2 * V )
-with expansion:
- 8 == 8
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 8 >= 8
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 4 == 4
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 4 >= 4
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 4 >= 4
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 4 == 4
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 4 >= 4
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 4 == 4
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 8 >= 8
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 4 == 4
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 4 >= 4
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - float,4
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 4 == 4
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 4 >= 4
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 2 * V )
-with expansion:
- 10 == 10
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - int,5
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 15 == 15
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 15 >= 15
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 2 * V )
-with expansion:
- 30 == 30
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 30 >= 30
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 15 == 15
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 15 >= 15
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 15 >= 15
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 15 == 15
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 15 >= 15
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 15 == 15
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 2 * V )
-with expansion:
- 30 >= 30
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 15 == 15
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 15 >= 15
-
--------------------------------------------------------------------------------
-TemplateTestSig: vectors can be sized and resized - std::string,15
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == V )
-with expansion:
- 15 == 15
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= V )
-with expansion:
- 15 >= 15
-
--------------------------------------------------------------------------------
-Test case with one argument
--------------------------------------------------------------------------------
-VariadicMacros.tests.cpp:<line number>
-...............................................................................
-
-VariadicMacros.tests.cpp:<line number>: PASSED:
-with message:
- no assertions
-
--------------------------------------------------------------------------------
-Test enum bit values
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( 0x<hex digits> == bit30and31 )
-with expansion:
- 3221225472 (0x<hex digits>) == 3221225472
-
--------------------------------------------------------------------------------
-Test with special, characters "in name
--------------------------------------------------------------------------------
-CmdLine.tests.cpp:<line number>
-...............................................................................
-
-CmdLine.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-The NO_FAIL macro reports a failure but does not fail the test
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED - but was ok:
- CHECK_NOFAIL( 1 == 2 )
-
-
-No assertions in test case 'The NO_FAIL macro reports a failure but does not fail the test'
-
--------------------------------------------------------------------------------
-This test 'should' fail but doesn't
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- oops!
-
--------------------------------------------------------------------------------
-Thrown string literals are translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- For some reason someone is throwing a string literal!
-
--------------------------------------------------------------------------------
-Tracker
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isOpen() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
- successfully close one section
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isSuccessfullyCompleted() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isSuccessfullyCompleted() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isOpen() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
- fail one section
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isComplete() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isSuccessfullyCompleted() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isSuccessfullyCompleted() == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Tracker
- fail one section
- re-enter after failed section
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase2.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1b.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isSuccessfullyCompleted() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isOpen() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
- fail one section
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isComplete() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isSuccessfullyCompleted() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isSuccessfullyCompleted() == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Tracker
- fail one section
- re-enter after failed section and find next section
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase2.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1b.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isSuccessfullyCompleted() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isOpen() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
- successfully close one section, then find another
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Tracker
- successfully close one section, then find another
- Re-enter - skips S1 and enters S2
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase2.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1b.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2b.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Tracker
- successfully close one section, then find another
- Re-enter - skips S1 and enters S2
- Successfully close S2
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2b.isSuccessfullyCompleted() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase2.isComplete() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase2.isSuccessfullyCompleted() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isOpen() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
- successfully close one section, then find another
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Tracker
- successfully close one section, then find another
- Re-enter - skips S1 and enters S2
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase2.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1b.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2b.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() == false )
-with expansion:
- false == false
-
--------------------------------------------------------------------------------
-Tracker
- successfully close one section, then find another
- Re-enter - skips S1 and enters S2
- fail S2
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( ctx.completedCycle() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2b.isComplete() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2b.isSuccessfullyCompleted() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase2.isSuccessfullyCompleted() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase3.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1c.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2c.isOpen() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase3.isSuccessfullyCompleted() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isOpen() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Tracker
- open a nested section
--------------------------------------------------------------------------------
-PartTracker.tests.cpp:<line number>
-...............................................................................
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2.isOpen() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s2.isComplete() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isComplete() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( s1.isComplete() )
-with expansion:
- true
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() == false )
-with expansion:
- false == false
-
-PartTracker.tests.cpp:<line number>: PASSED:
- REQUIRE( testCase.isComplete() )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-Trim strings
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(std::string(no_whitespace)) == no_whitespace )
-with expansion:
- "There is no extra whitespace here"
- ==
- "There is no extra whitespace here"
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(std::string(leading_whitespace)) == no_whitespace )
-with expansion:
- "There is no extra whitespace here"
- ==
- "There is no extra whitespace here"
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(std::string(trailing_whitespace)) == no_whitespace )
-with expansion:
- "There is no extra whitespace here"
- ==
- "There is no extra whitespace here"
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(std::string(whitespace_at_both_ends)) == no_whitespace )
-with expansion:
- "There is no extra whitespace here"
- ==
- "There is no extra whitespace here"
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(StringRef(no_whitespace)) == StringRef(no_whitespace) )
-with expansion:
- There is no extra whitespace here
- ==
- There is no extra whitespace here
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(StringRef(leading_whitespace)) == StringRef(no_whitespace) )
-with expansion:
- There is no extra whitespace here
- ==
- There is no extra whitespace here
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace) )
-with expansion:
- There is no extra whitespace here
- ==
- There is no extra whitespace here
-
-StringManip.tests.cpp:<line number>: PASSED:
- REQUIRE( trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) )
-with expansion:
- There is no extra whitespace here
- ==
- There is no extra whitespace here
-
--------------------------------------------------------------------------------
-Unexpected exceptions can be translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- 3.14
-
--------------------------------------------------------------------------------
-Use a custom approx
--------------------------------------------------------------------------------
-Approx.tests.cpp:<line number>
-...............................................................................
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == approx( 1.23 ) )
-with expansion:
- 1.23 == Approx( 1.23 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == approx( 1.22 ) )
-with expansion:
- 1.23 == Approx( 1.22 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d == approx( 1.24 ) )
-with expansion:
- 1.23 == Approx( 1.24 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( d != approx( 1.25 ) )
-with expansion:
- 1.23 != Approx( 1.25 )
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( approx( d ) == 1.23 )
-with expansion:
- Approx( 1.23 ) == 1.23
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( approx( d ) == 1.22 )
-with expansion:
- Approx( 1.23 ) == 1.22
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( approx( d ) == 1.24 )
-with expansion:
- Approx( 1.23 ) == 1.24
-
-Approx.tests.cpp:<line number>: PASSED:
- REQUIRE( approx( d ) != 1.25 )
-with expansion:
- Approx( 1.23 ) != 1.25
-
--------------------------------------------------------------------------------
-Variadic macros
- Section with one argument
--------------------------------------------------------------------------------
-VariadicMacros.tests.cpp:<line number>
-...............................................................................
-
-VariadicMacros.tests.cpp:<line number>: PASSED:
-with message:
- no assertions
-
--------------------------------------------------------------------------------
-Vector Approx matcher
- Empty vector is roughly equal to an empty vector
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( empty, Approx(empty) )
-with expansion:
- { } is approx: { }
-
--------------------------------------------------------------------------------
-Vector Approx matcher
- Vectors with elements
- A vector is approx equal to itself
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, Approx(v1) )
-with expansion:
- { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 }
-
--------------------------------------------------------------------------------
-Vector Approx matcher
- Vectors with elements
- Different length
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, !Approx(temp) )
-with expansion:
- { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 }
-
--------------------------------------------------------------------------------
-Vector Approx matcher
- Vectors with elements
- Same length, different elements
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, !Approx(v2) )
-with expansion:
- { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, Approx(v2).margin(0.5) )
-with expansion:
- { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, Approx(v2).epsilon(0.5) )
-with expansion:
- { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( v1, Approx(v2).epsilon(0.1).scale(500) )
-with expansion:
- { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
-
--------------------------------------------------------------------------------
-Vector Approx matcher -- failing
- Empty and non empty vectors are not approx equal
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, Approx(t1) )
-with expansion:
- { } is approx: { 1.0, 2.0 }
-
--------------------------------------------------------------------------------
-Vector Approx matcher -- failing
- Just different vectors
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v1, Approx(v2) )
-with expansion:
- { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
-
--------------------------------------------------------------------------------
-Vector matchers
- Contains (element)
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, VectorContains(1) )
-with expansion:
- { 1, 2, 3 } Contains: 1
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, VectorContains(2) )
-with expansion:
- { 1, 2, 3 } Contains: 2
-
--------------------------------------------------------------------------------
-Vector matchers
- Contains (vector)
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, Contains(v2) )
-with expansion:
- { 1, 2, 3 } Contains: { 1, 2 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, Contains(v2) )
-with expansion:
- { 1, 2, 3 } Contains: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, Contains(empty) )
-with expansion:
- { 1, 2, 3 } Contains: { }
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( empty, Contains(empty) )
-with expansion:
- { } Contains: { }
-
--------------------------------------------------------------------------------
-Vector matchers
- Contains (element), composed
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, VectorContains(1) && VectorContains(2) )
-with expansion:
- { 1, 2, 3 } ( Contains: 1 and Contains: 2 )
-
--------------------------------------------------------------------------------
-Vector matchers
- Equals
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, Equals(v) )
-with expansion:
- { 1, 2, 3 } Equals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( empty, Equals(empty) )
-with expansion:
- { } Equals: { }
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, Equals(v2) )
-with expansion:
- { 1, 2, 3 } Equals: { 1, 2, 3 }
-
--------------------------------------------------------------------------------
-Vector matchers
- UnorderedEquals
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( v, UnorderedEquals(v) )
-with expansion:
- { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- CHECK_THAT( empty, UnorderedEquals(empty) )
-with expansion:
- { } UnorderedEquals: { }
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 }
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- Contains (element)
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, VectorContains(-1) )
-with expansion:
- { 1, 2, 3 } Contains: -1
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, VectorContains(1) )
-with expansion:
- { } Contains: 1
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- Contains (vector)
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, Contains(v) )
-with expansion:
- { } Contains: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, Contains(v2) )
-with expansion:
- { 1, 2, 3 } Contains: { 1, 2, 4 }
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- Equals
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, Equals(v2) )
-with expansion:
- { 1, 2, 3 } Equals: { 1, 2 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v2, Equals(v) )
-with expansion:
- { 1, 2 } Equals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, Equals(v) )
-with expansion:
- { } Equals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, Equals(empty) )
-with expansion:
- { 1, 2, 3 } Equals: { }
-
--------------------------------------------------------------------------------
-Vector matchers that fail
- UnorderedEquals
--------------------------------------------------------------------------------
-Matchers.tests.cpp:<line number>
-...............................................................................
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( v, UnorderedEquals(empty) )
-with expansion:
- { 1, 2, 3 } UnorderedEquals: { }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( empty, UnorderedEquals(v) )
-with expansion:
- { } UnorderedEquals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 1, 3 } UnorderedEquals: { 1, 2, 3 }
-
-Matchers.tests.cpp:<line number>: FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 3, 1 } UnorderedEquals: { 1, 2, 3 }
-
--------------------------------------------------------------------------------
-When checked exceptions are thrown they can be expected or unexpected
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS_AS( thisThrows(), std::domain_error )
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( thisDoesntThrow() )
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS( thisThrows() )
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown directly they are always failures
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- unexpected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown during a CHECK the test should continue
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK( thisThrows() == 0 )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown during a REQUIRE the test should abort
-fail
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE( thisThrows() == 0 )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown from functions they are always failures
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- CHECK( thisThrows() == 0 )
-due to unexpected exception with message:
- expected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown from sections they are always failures
- section name
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- unexpected exception
-
--------------------------------------------------------------------------------
-When unchecked exceptions are thrown, but caught, they do not affect the test
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'When unchecked exceptions are thrown, but caught, they do not affect the test'
-
--------------------------------------------------------------------------------
-Where the LHS is not a simple value
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: warning:
- Uncomment the code in this test to check that it gives a sensible compiler
- error
-
-
-No assertions in test case 'Where the LHS is not a simple value'
-
--------------------------------------------------------------------------------
-Where there is more to the expression after the RHS
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: warning:
- Uncomment the code in this test to check that it gives a sensible compiler
- error
-
-
-No assertions in test case 'Where there is more to the expression after the RHS'
-
--------------------------------------------------------------------------------
-X/level/0/a
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-X/level/0/b
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-X/level/1/a
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-X/level/1/b
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-XmlEncode
- normal string
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "normal string" ) == "normal string" )
-with expansion:
- "normal string" == "normal string"
-
--------------------------------------------------------------------------------
-XmlEncode
- empty string
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "" ) == "" )
-with expansion:
- "" == ""
-
--------------------------------------------------------------------------------
-XmlEncode
- string with ampersand
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "smith & jones" ) == "smith &amp; jones" )
-with expansion:
- "smith &amp; jones" == "smith &amp; jones"
-
--------------------------------------------------------------------------------
-XmlEncode
- string with less-than
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "smith < jones" ) == "smith &lt; jones" )
-with expansion:
- "smith &lt; jones" == "smith &lt; jones"
-
--------------------------------------------------------------------------------
-XmlEncode
- string with greater-than
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "smith > jones" ) == "smith > jones" )
-with expansion:
- "smith > jones" == "smith > jones"
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "smith ]]> jones" ) == "smith ]]&gt; jones" )
-with expansion:
- "smith ]]&gt; jones"
- ==
- "smith ]]&gt; jones"
-
--------------------------------------------------------------------------------
-XmlEncode
- string with quotes
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( stringWithQuotes ) == stringWithQuotes )
-with expansion:
- "don't "quote" me on that"
- ==
- "don't "quote" me on that"
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" )
-with expansion:
- "don't &quot;quote&quot; me on that"
- ==
- "don't &quot;quote&quot; me on that"
-
--------------------------------------------------------------------------------
-XmlEncode
- string with control char (1)
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "[\x01]" ) == "[\\x01]" )
-with expansion:
- "[\x01]" == "[\x01]"
-
--------------------------------------------------------------------------------
-XmlEncode
- string with control char (x7F)
--------------------------------------------------------------------------------
-Xml.tests.cpp:<line number>
-...............................................................................
-
-Xml.tests.cpp:<line number>: PASSED:
- REQUIRE( encode( "[\x7F]" ) == "[\\x7F]" )
-with expansion:
- "[\x7F]" == "[\x7F]"
-
--------------------------------------------------------------------------------
-adding a hide tag implicitly enables all others
--------------------------------------------------------------------------------
-Tag.tests.cpp:<line number>
-...............................................................................
-
-Tag.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testcase.tags, VectorContains(std::string(".")) && VectorContains(std::string("!hide")) )
-with expansion:
- { "!hide", "." } ( Contains: "." and Contains: "!hide" )
-
--------------------------------------------------------------------------------
-adding a hide tag implicitly enables all others
--------------------------------------------------------------------------------
-Tag.tests.cpp:<line number>
-...............................................................................
-
-Tag.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testcase.tags, VectorContains(std::string(".")) && VectorContains(std::string("!hide")) )
-with expansion:
- { "!hide", "." } ( Contains: "." and Contains: "!hide" )
-
--------------------------------------------------------------------------------
-adding a hide tag implicitly enables all others
--------------------------------------------------------------------------------
-Tag.tests.cpp:<line number>
-...............................................................................
-
-Tag.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testcase.tags, VectorContains(std::string(".")) && VectorContains(std::string("!hide")) )
-with expansion:
- { "!hide", ".", "foo" } ( Contains: "." and Contains: "!hide" )
-
--------------------------------------------------------------------------------
-array<int, N> -> toString
--------------------------------------------------------------------------------
-ToStringVector.tests.cpp:<line number>
-...............................................................................
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( empty ) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( oneValue ) == "{ 42 }" )
-with expansion:
- "{ 42 }" == "{ 42 }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" )
-with expansion:
- "{ 42, 250 }" == "{ 42, 250 }"
-
--------------------------------------------------------------------------------
-atomic if
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( x == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-boolean member
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( obj.prop != 0 )
-with expansion:
- 0x<hex digits> != 0
-
--------------------------------------------------------------------------------
-checkedElse
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECKED_ELSE( flag )
-with expansion:
- true
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( testCheckedElse( true ) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-checkedElse, failing
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECKED_ELSE( flag )
-with expansion:
- false
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( testCheckedElse( false ) )
-with expansion:
- false
-
--------------------------------------------------------------------------------
-checkedIf
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECKED_IF( flag )
-with expansion:
- true
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( testCheckedIf( true ) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-checkedIf, failing
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECKED_IF( flag )
-with expansion:
- false
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( testCheckedIf( false ) )
-with expansion:
- false
-
--------------------------------------------------------------------------------
-comparisons between const int variables
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( unsigned_char_var == 1 )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( unsigned_short_var == 1 )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( unsigned_int_var == 1 )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( unsigned_long_var == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-comparisons between int variables
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( long_var == unsigned_char_var )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( long_var == unsigned_short_var )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( long_var == unsigned_int_var )
-with expansion:
- 1 == 1
-
-Condition.tests.cpp:<line number>: PASSED:
- REQUIRE( long_var == unsigned_long_var )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-even more nested SECTION tests
- c
- d (leaf)
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-even more nested SECTION tests
- c
- e (leaf)
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-even more nested SECTION tests
- f (leaf)
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-first tag
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'first tag'
-
-loose text artifact
--------------------------------------------------------------------------------
-has printf
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'has printf'
-
--------------------------------------------------------------------------------
-just failure
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- Previous info should not be seen
-
--------------------------------------------------------------------------------
-just failure after unscoped info
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
-explicitly with message:
- previous unscoped info SHOULD not be seen
-
--------------------------------------------------------------------------------
-just info
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'just info'
-
--------------------------------------------------------------------------------
-just unscoped info
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'just unscoped info'
-
--------------------------------------------------------------------------------
-long long
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( l == std::numeric_limits<long long>::max() )
-with expansion:
- 9223372036854775807 (0x<hex digits>)
- ==
- 9223372036854775807 (0x<hex digits>)
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 0
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( b > a )
-with expansion:
- 0 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 1
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( b > a )
-with expansion:
- 1 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 2
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 2 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 3
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 3 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 4
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 4 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 5
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 5 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 6
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 6 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 7
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 7 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 8
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 8 > 1
-
--------------------------------------------------------------------------------
-looped SECTION tests
- b is currently: 9
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( b > a )
-with expansion:
- 9 > 1
-
--------------------------------------------------------------------------------
-looped tests
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[0] (1) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[1] (1) is even
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 0 == 0
-with message:
- Testing if fib[2] (2) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[3] (3) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[4] (5) is even
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 0 == 0
-with message:
- Testing if fib[5] (8) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[6] (13) is even
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-with message:
- Testing if fib[7] (21) is even
-
--------------------------------------------------------------------------------
-mix info, unscoped info and warning
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: warning:
- info
- unscoped info
- and warn may mix
-
-Message.tests.cpp:<line number>: warning:
- info
- unscoped info
- they are not cleared after warnings
-
-
-No assertions in test case 'mix info, unscoped info and warning'
-
--------------------------------------------------------------------------------
-more nested SECTION tests
- doesn't equal
- equal
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( a == b )
-with expansion:
- 1 == 2
-
--------------------------------------------------------------------------------
-more nested SECTION tests
- doesn't equal
- not equal
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( a != b )
-with expansion:
- 1 != 2
-
--------------------------------------------------------------------------------
-more nested SECTION tests
- doesn't equal
- less than
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( a < b )
-with expansion:
- 1 < 2
-
--------------------------------------------------------------------------------
-nested SECTION tests
- doesn't equal
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( a != b )
-with expansion:
- 1 != 2
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( b != a )
-with expansion:
- 2 != 1
-
--------------------------------------------------------------------------------
-nested SECTION tests
- doesn't equal
- not equal
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( a != b )
-with expansion:
- 1 != 2
-
--------------------------------------------------------------------------------
-non streamable - with conv. op
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( s == "7" )
-with expansion:
- "7" == "7"
-
--------------------------------------------------------------------------------
-non-copyable objects
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- CHECK( ti == typeid(int) )
-with expansion:
- {?} == {?}
-
--------------------------------------------------------------------------------
-not allowed
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-not prints unscoped info from previous failures
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-with message:
- this MAY be seen only for the FIRST assertion IF info is printed for passing
- assertions
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-with message:
- this MAY be seen only for the SECOND assertion IF info is printed for passing
- assertions
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with message:
- this SHOULD be seen
-
--------------------------------------------------------------------------------
-null strings
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( makeString( false ) != static_cast<char*>(0) )
-with expansion:
- "valid string" != {null string}
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( makeString( true ) == static_cast<char*>(0) )
-with expansion:
- {null string} == {null string}
-
--------------------------------------------------------------------------------
-null_ptr
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( ptr.get() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-pair<pair<int,const char *,pair<std::string,int> > -> toString
--------------------------------------------------------------------------------
-ToStringPair.tests.cpp:<line number>
-...............................................................................
-
-ToStringPair.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" )
-with expansion:
- "{ { 42, "Arthur" }, { "Ford", 24 } }"
- ==
- "{ { 42, "Arthur" }, { "Ford", 24 } }"
-
--------------------------------------------------------------------------------
-parseEnums
- No enums
--------------------------------------------------------------------------------
-ToString.tests.cpp:<line number>
-...............................................................................
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK_THAT( parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) )
-with expansion:
- { } Equals: { }
-
--------------------------------------------------------------------------------
-parseEnums
- One enum value
--------------------------------------------------------------------------------
-ToString.tests.cpp:<line number>
-...............................................................................
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) )
-with expansion:
- { Value1 } Equals: { Value1 }
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK_THAT( parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) )
-with expansion:
- { Value1 } Equals: { Value1 }
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK_THAT( parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) )
-with expansion:
- { Value1 } Equals: { Value1 }
-
--------------------------------------------------------------------------------
-parseEnums
- Multiple enum values
--------------------------------------------------------------------------------
-ToString.tests.cpp:<line number>
-...............................................................................
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) )
-with expansion:
- { Value1, Value2 } Equals: { Value1, Value2 }
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) )
-with expansion:
- { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
-
-ToString.tests.cpp:<line number>: PASSED:
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) )
-with expansion:
- { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
-
--------------------------------------------------------------------------------
-pointer to class
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: PASSED:
- REQUIRE( p == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-print unscoped info if passing unscoped info is printed
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: PASSED:
- REQUIRE( true )
-with message:
- this MAY be seen IF info is printed for passing assertions
-
--------------------------------------------------------------------------------
-prints unscoped info on failure
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with messages:
- this SHOULD be seen
- this SHOULD also be seen
-
--------------------------------------------------------------------------------
-prints unscoped info only for the first assertion
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( false )
-with message:
- this SHOULD be seen only ONCE
-
-Message.tests.cpp:<line number>: PASSED:
- CHECK( true )
-
-Message.tests.cpp:<line number>: PASSED:
- CHECK( true )
-with message:
- this MAY also be seen only ONCE IF info is printed for passing assertions
-
-Message.tests.cpp:<line number>: PASSED:
- CHECK( true )
-
--------------------------------------------------------------------------------
-random SECTION tests
- doesn't equal
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( a != b )
-with expansion:
- 1 != 2
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( b != a )
-with expansion:
- 2 != 1
-
--------------------------------------------------------------------------------
-random SECTION tests
- not equal
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( a != b )
-with expansion:
- 1 != 2
-
--------------------------------------------------------------------------------
-replaceInPlace
- replace single char
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( Catch::replaceInPlace(letters, "b", "z") )
-with expansion:
- true
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( letters == "azcdefcg" )
-with expansion:
- "azcdefcg" == "azcdefcg"
-
--------------------------------------------------------------------------------
-replaceInPlace
- replace two chars
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( Catch::replaceInPlace(letters, "c", "z") )
-with expansion:
- true
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( letters == "abzdefzg" )
-with expansion:
- "abzdefzg" == "abzdefzg"
-
--------------------------------------------------------------------------------
-replaceInPlace
- replace first char
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( Catch::replaceInPlace(letters, "a", "z") )
-with expansion:
- true
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( letters == "zbcdefcg" )
-with expansion:
- "zbcdefcg" == "zbcdefcg"
-
--------------------------------------------------------------------------------
-replaceInPlace
- replace last char
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( Catch::replaceInPlace(letters, "g", "z") )
-with expansion:
- true
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( letters == "abcdefcz" )
-with expansion:
- "abcdefcz" == "abcdefcz"
-
--------------------------------------------------------------------------------
-replaceInPlace
- replace all chars
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( Catch::replaceInPlace(letters, letters, "replaced") )
-with expansion:
- true
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( letters == "replaced" )
-with expansion:
- "replaced" == "replaced"
-
--------------------------------------------------------------------------------
-replaceInPlace
- replace no chars
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK_FALSE( Catch::replaceInPlace(letters, "x", "z") )
-with expansion:
- !false
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( letters == letters )
-with expansion:
- "abcdefcg" == "abcdefcg"
-
--------------------------------------------------------------------------------
-replaceInPlace
- escape '
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( Catch::replaceInPlace(s, "'", "|'") )
-with expansion:
- true
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK( s == "didn|'t" )
-with expansion:
- "didn|'t" == "didn|'t"
-
--------------------------------------------------------------------------------
-second tag
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-
-No assertions in test case 'second tag'
-
--------------------------------------------------------------------------------
-send a single char to INFO
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with message:
- 3
-
--------------------------------------------------------------------------------
-sends information to INFO
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- REQUIRE( false )
-with messages:
- hi
- i := 7
-
--------------------------------------------------------------------------------
-shortened hide tags are split apart
--------------------------------------------------------------------------------
-Tag.tests.cpp:<line number>
-...............................................................................
-
-Tag.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( testcase.tags, Catch::VectorContains(std::string("magic-tag")) && Catch::VectorContains(std::string(".")) )
-with expansion:
- { "!hide", ".", "magic-tag" } ( Contains: "magic-tag" and Contains: "." )
-
--------------------------------------------------------------------------------
-splitString
--------------------------------------------------------------------------------
-StringManip.tests.cpp:<line number>
-...............................................................................
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK_THAT( splitStringRef("", ','), Equals(std::vector<StringRef>()) )
-with expansion:
- { } Equals: { }
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK_THAT( splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}) )
-with expansion:
- { abc } Equals: { abc }
-
-StringManip.tests.cpp:<line number>: PASSED:
- CHECK_THAT( splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}) )
-with expansion:
- { abc, def } Equals: { abc, def }
-
--------------------------------------------------------------------------------
-stacks unscoped info in loops
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( false )
-with messages:
- Count 1 to 3...
- 1
- 2
- 3
-
-Message.tests.cpp:<line number>: FAILED:
- CHECK( false )
-with messages:
- Count 4 to 6...
- 4
- 5
- 6
-
--------------------------------------------------------------------------------
-std::map is convertible string
- empty
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( emptyMap ) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
--------------------------------------------------------------------------------
-std::map is convertible string
- single item
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" )
-with expansion:
- "{ { "one", 1 } }" == "{ { "one", 1 } }"
-
--------------------------------------------------------------------------------
-std::map is convertible string
- several items
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" )
-with expansion:
- "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }"
- ==
- "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }"
-
--------------------------------------------------------------------------------
-std::pair<int,const std::string> -> toString
--------------------------------------------------------------------------------
-ToStringPair.tests.cpp:<line number>
-...............................................................................
-
-ToStringPair.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" )
-with expansion:
- "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
-
--------------------------------------------------------------------------------
-std::pair<int,std::string> -> toString
--------------------------------------------------------------------------------
-ToStringPair.tests.cpp:<line number>
-...............................................................................
-
-ToStringPair.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" )
-with expansion:
- "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
-
--------------------------------------------------------------------------------
-std::set is convertible string
- empty
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( emptySet ) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
--------------------------------------------------------------------------------
-std::set is convertible string
- single item
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( set ) == "{ \"one\" }" )
-with expansion:
- "{ "one" }" == "{ "one" }"
-
--------------------------------------------------------------------------------
-std::set is convertible string
- several items
--------------------------------------------------------------------------------
-ToStringGeneral.tests.cpp:<line number>
-...............................................................................
-
-ToStringGeneral.tests.cpp:<line number>: PASSED:
- REQUIRE( Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" )
-with expansion:
- "{ "abc", "def", "ghi" }"
- ==
- "{ "abc", "def", "ghi" }"
-
--------------------------------------------------------------------------------
-std::vector<std::pair<std::string,int> > -> toString
--------------------------------------------------------------------------------
-ToStringPair.tests.cpp:<line number>
-...............................................................................
-
-ToStringPair.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" )
-with expansion:
- "{ { "green", 55 } }"
- ==
- "{ { "green", 55 } }"
-
--------------------------------------------------------------------------------
-string literals of different sizes can be compared
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: FAILED:
- REQUIRE( std::string( "first" ) == "second" )
-with expansion:
- "first" == "second"
-
--------------------------------------------------------------------------------
-stringify ranges
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" )
-with expansion:
- "op<<(streamable_range)"
- ==
- "op<<(streamable_range)"
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" )
-with expansion:
- "stringmaker(streamable_range)"
- ==
- "stringmaker(streamable_range)"
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" )
-with expansion:
- "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" )
-with expansion:
- "{ !!! }" == "{ !!! }"
-
--------------------------------------------------------------------------------
-stringify( has_maker )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" )
-with expansion:
- "StringMaker<has_maker>"
- ==
- "StringMaker<has_maker>"
-
--------------------------------------------------------------------------------
-stringify( has_maker_and_operator )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" )
-with expansion:
- "StringMaker<has_maker_and_operator>"
- ==
- "StringMaker<has_maker_and_operator>"
-
--------------------------------------------------------------------------------
-stringify( has_neither )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" )
-with expansion:
- "{ !!! }" == "{ !!! }"
-
--------------------------------------------------------------------------------
-stringify( has_operator )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" )
-with expansion:
- "operator<<( has_operator )"
- ==
- "operator<<( has_operator )"
-
--------------------------------------------------------------------------------
-stringify( has_template_operator )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" )
-with expansion:
- "operator<<( has_template_operator )"
- ==
- "operator<<( has_template_operator )"
-
--------------------------------------------------------------------------------
-stringify( vectors<has_maker> )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" )
-with expansion:
- "{ StringMaker<has_maker> }"
- ==
- "{ StringMaker<has_maker> }"
-
--------------------------------------------------------------------------------
-stringify( vectors<has_maker_and_operator> )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" )
-with expansion:
- "{ StringMaker<has_maker_and_operator> }"
- ==
- "{ StringMaker<has_maker_and_operator> }"
-
--------------------------------------------------------------------------------
-stringify( vectors<has_operator> )
--------------------------------------------------------------------------------
-ToStringWhich.tests.cpp:<line number>
-...............................................................................
-
-ToStringWhich.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" )
-with expansion:
- "{ operator<<( has_operator ) }"
- ==
- "{ operator<<( has_operator ) }"
-
--------------------------------------------------------------------------------
-strlen3
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str.size() == data.len )
-with expansion:
- 3 == 3
-
--------------------------------------------------------------------------------
-strlen3
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str.size() == data.len )
-with expansion:
- 3 == 3
-
--------------------------------------------------------------------------------
-strlen3
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str.size() == data.len )
-with expansion:
- 5 == 5
-
--------------------------------------------------------------------------------
-strlen3
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( data.str.size() == data.len )
-with expansion:
- 4 == 4
-
--------------------------------------------------------------------------------
-tables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) )
-with expansion:
- 5 == 5
-
--------------------------------------------------------------------------------
-tables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) )
-with expansion:
- 6 == 6
-
--------------------------------------------------------------------------------
-tables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) )
-with expansion:
- 5 == 5
-
--------------------------------------------------------------------------------
-tables
--------------------------------------------------------------------------------
-Generators.tests.cpp:<line number>
-...............................................................................
-
-Generators.tests.cpp:<line number>: PASSED:
- REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) )
-with expansion:
- 6 == 6
-
--------------------------------------------------------------------------------
-thrown std::strings are translated
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with message:
- Why would you throw a std::string?
-
--------------------------------------------------------------------------------
-toString on const wchar_t const pointer returns the string contents
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( result == "\"wide load\"" )
-with expansion:
- ""wide load"" == ""wide load""
-
--------------------------------------------------------------------------------
-toString on const wchar_t pointer returns the string contents
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( result == "\"wide load\"" )
-with expansion:
- ""wide load"" == ""wide load""
-
--------------------------------------------------------------------------------
-toString on wchar_t const pointer returns the string contents
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( result == "\"wide load\"" )
-with expansion:
- ""wide load"" == ""wide load""
-
--------------------------------------------------------------------------------
-toString on wchar_t returns the string contents
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- CHECK( result == "\"wide load\"" )
-with expansion:
- ""wide load"" == ""wide load""
-
--------------------------------------------------------------------------------
-toString(enum class w/operator<<)
--------------------------------------------------------------------------------
-EnumToString.tests.cpp:<line number>
-...............................................................................
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e0) == "E2/V0" )
-with expansion:
- "E2/V0" == "E2/V0"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e1) == "E2/V1" )
-with expansion:
- "E2/V1" == "E2/V1"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e3) == "Unknown enum value 10" )
-with expansion:
- "Unknown enum value 10"
- ==
- "Unknown enum value 10"
-
--------------------------------------------------------------------------------
-toString(enum class)
--------------------------------------------------------------------------------
-EnumToString.tests.cpp:<line number>
-...............................................................................
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e0) == "0" )
-with expansion:
- "0" == "0"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e1) == "1" )
-with expansion:
- "1" == "1"
-
--------------------------------------------------------------------------------
-toString(enum w/operator<<)
--------------------------------------------------------------------------------
-EnumToString.tests.cpp:<line number>
-...............................................................................
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e0) == "E2{0}" )
-with expansion:
- "E2{0}" == "E2{0}"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e1) == "E2{1}" )
-with expansion:
- "E2{1}" == "E2{1}"
-
--------------------------------------------------------------------------------
-toString(enum)
--------------------------------------------------------------------------------
-EnumToString.tests.cpp:<line number>
-...............................................................................
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e0) == "0" )
-with expansion:
- "0" == "0"
-
-EnumToString.tests.cpp:<line number>: PASSED:
- CHECK( ::Catch::Detail::stringify(e1) == "1" )
-with expansion:
- "1" == "1"
-
--------------------------------------------------------------------------------
-tuple<>
--------------------------------------------------------------------------------
-ToStringTuple.tests.cpp:<line number>
-...............................................................................
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "{ }" == ::Catch::Detail::stringify(type{}) )
-with expansion:
- "{ }" == "{ }"
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "{ }" == ::Catch::Detail::stringify(value) )
-with expansion:
- "{ }" == "{ }"
-
--------------------------------------------------------------------------------
-tuple<float,int>
--------------------------------------------------------------------------------
-ToStringTuple.tests.cpp:<line number>
-...............................................................................
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) )
-with expansion:
- "1.2f" == "1.2f"
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) )
-with expansion:
- "{ 1.2f, 0 }" == "{ 1.2f, 0 }"
-
--------------------------------------------------------------------------------
-tuple<int>
--------------------------------------------------------------------------------
-ToStringTuple.tests.cpp:<line number>
-...............................................................................
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "{ 0 }" == ::Catch::Detail::stringify(type{0}) )
-with expansion:
- "{ 0 }" == "{ 0 }"
-
--------------------------------------------------------------------------------
-tuple<0,int,const char *>
--------------------------------------------------------------------------------
-ToStringTuple.tests.cpp:<line number>
-...............................................................................
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) )
-with expansion:
- "{ 0, 42, "Catch me" }"
- ==
- "{ 0, 42, "Catch me" }"
-
--------------------------------------------------------------------------------
-tuple<string,string>
--------------------------------------------------------------------------------
-ToStringTuple.tests.cpp:<line number>
-...............................................................................
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) )
-with expansion:
- "{ "hello", "world" }"
- ==
- "{ "hello", "world" }"
-
--------------------------------------------------------------------------------
-tuple<tuple<int>,tuple<>,float>
--------------------------------------------------------------------------------
-ToStringTuple.tests.cpp:<line number>
-...............................................................................
-
-ToStringTuple.tests.cpp:<line number>: PASSED:
- CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) )
-with expansion:
- "{ { 42 }, { }, 1.2f }"
- ==
- "{ { 42 }, { }, 1.2f }"
-
--------------------------------------------------------------------------------
-vec<vec<string,alloc>> -> toString
--------------------------------------------------------------------------------
-ToStringVector.tests.cpp:<line number>
-...............................................................................
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(v) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" )
-with expansion:
- "{ { "hello" }, { "world" } }"
- ==
- "{ { "hello" }, { "world" } }"
-
--------------------------------------------------------------------------------
-vector<bool> -> toString
--------------------------------------------------------------------------------
-ToStringVector.tests.cpp:<line number>
-...............................................................................
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(bools) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(bools) == "{ true }" )
-with expansion:
- "{ true }" == "{ true }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(bools) == "{ true, false }" )
-with expansion:
- "{ true, false }" == "{ true, false }"
-
--------------------------------------------------------------------------------
-vector<int,allocator> -> toString
--------------------------------------------------------------------------------
-ToStringVector.tests.cpp:<line number>
-...............................................................................
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42 }" )
-with expansion:
- "{ 42 }" == "{ 42 }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" )
-with expansion:
- "{ 42, 250 }" == "{ 42, 250 }"
-
--------------------------------------------------------------------------------
-vector<int> -> toString
--------------------------------------------------------------------------------
-ToStringVector.tests.cpp:<line number>
-...............................................................................
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42 }" )
-with expansion:
- "{ 42 }" == "{ 42 }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" )
-with expansion:
- "{ 42, 250 }" == "{ 42, 250 }"
-
--------------------------------------------------------------------------------
-vector<string> -> toString
--------------------------------------------------------------------------------
-ToStringVector.tests.cpp:<line number>
-...............................................................................
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" )
-with expansion:
- "{ }" == "{ }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ \"hello\" }" )
-with expansion:
- "{ "hello" }" == "{ "hello" }"
-
-ToStringVector.tests.cpp:<line number>: PASSED:
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" )
-with expansion:
- "{ "hello", "world" }"
- ==
- "{ "hello", "world" }"
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
- resizing bigger changes size and capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 10 )
-with expansion:
- 10 == 10
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
- resizing smaller changes size but not capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 0 )
-with expansion:
- 0 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
- resizing smaller changes size but not capacity
- We can use the 'swap trick' to reset the capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() == 0 )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
- reserving bigger changes capacity but not size
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 10 )
-with expansion:
- 10 >= 10
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-vectors can be sized and resized
- reserving smaller does not change size or capacity
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.size() == 5 )
-with expansion:
- 5 == 5
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( v.capacity() >= 5 )
-with expansion:
- 5 >= 5
-
--------------------------------------------------------------------------------
-xmlentitycheck
- embedded xml: <test>it should be possible to embed xml characters, such as <,
- " or &, or even whole <xml>documents</xml> within an attribute
- </test>
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-xmlentitycheck
- encoded chars: these should all be encoded: &&&"""<<<&"<<&"
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
-===============================================================================
-test cases: 306 | 216 passed | 86 failed | 4 failed as expected
-assertions: 1693 | 1524 passed | 148 failed | 21 failed as expected
-
diff --git a/projects/SelfTest/Baselines/console.swa4.approved.txt b/projects/SelfTest/Baselines/console.swa4.approved.txt
deleted file mode 100644
index 322b8158..00000000
--- a/projects/SelfTest/Baselines/console.swa4.approved.txt
+++ /dev/null
@@ -1,373 +0,0 @@
-Filters: ~[!nonportable]~[!benchmark]~[approvals]
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<exe-name> is a <version> host application.
-Run with -? for options
-
-Randomness seeded to: 1
-
--------------------------------------------------------------------------------
-# A test name that starts with a #
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- yay
-
--------------------------------------------------------------------------------
-#1005: Comparing pointer to int and long (NULL can be either on various
- systems)
--------------------------------------------------------------------------------
-Decomposition.tests.cpp:<line number>
-...............................................................................
-
-Decomposition.tests.cpp:<line number>: PASSED:
- REQUIRE( fptr == 0 )
-with expansion:
- 0 == 0
-
-Decomposition.tests.cpp:<line number>: PASSED:
- REQUIRE( fptr == 0l )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-#1027
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( y.v == 0 )
-with expansion:
- 0 == 0
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == y.v )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-#1027: Bitfields can be captured
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( y.v == 0 )
-with expansion:
- 0 == 0
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( 0 == y.v )
-with expansion:
- 0 == 0
-
--------------------------------------------------------------------------------
-#1147
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 == t2 )
-with expansion:
- {?} == {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 != t2 )
-with expansion:
- {?} != {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 < t2 )
-with expansion:
- {?} < {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 > t2 )
-with expansion:
- {?} > {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 <= t2 )
-with expansion:
- {?} <= {?}
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( t1 >= t2 )
-with expansion:
- {?} >= {?}
-
--------------------------------------------------------------------------------
-#1175 - Hidden Test
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-#1238
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( std::memcmp(uarr, "123", sizeof(uarr)) == 0 )
-with expansion:
- 0 == 0
-with messages:
- uarr := "123"
- sarr := "456"
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( std::memcmp(sarr, "456", sizeof(sarr)) == 0 )
-with expansion:
- 0 == 0
-with messages:
- uarr := "123"
- sarr := "456"
-
--------------------------------------------------------------------------------
-#1245
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
-
--------------------------------------------------------------------------------
-#1403
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( h1 == h2 )
-with expansion:
- [1403 helper] == [1403 helper]
-
--------------------------------------------------------------------------------
-#1455 - INFO and WARN can start with a linebreak
--------------------------------------------------------------------------------
-Message.tests.cpp:<line number>
-...............................................................................
-
-Message.tests.cpp:<line number>: warning:
-
-This info message starts with a linebreak
-
-This warning message starts with a linebreak
-
-
-No assertions in test case '#1455 - INFO and WARN can start with a linebreak'
-
-This would not be caught previously
-Nor would this
--------------------------------------------------------------------------------
-#1514: stderr/stdout is not captured in tests aborted by an exception
--------------------------------------------------------------------------------
-Tricky.tests.cpp:<line number>
-...............................................................................
-
-Tricky.tests.cpp:<line number>: FAILED:
-explicitly with message:
- 1514
-
--------------------------------------------------------------------------------
-#1548
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( std::is_same<TypeList<int>, TypeList<int>>::value )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- outside assertions
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
-due to unexpected exception with messages:
- answer := 42
- expected exception
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- inside REQUIRE_NOTHROW
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: FAILED:
- REQUIRE_NOTHROW( thisThrows() )
-due to unexpected exception with messages:
- answer := 42
- expected exception
-
--------------------------------------------------------------------------------
-#748 - captures with unexpected exceptions
- inside REQUIRE_THROWS
--------------------------------------------------------------------------------
-Exception.tests.cpp:<line number>
-...............................................................................
-
-Exception.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS( thisThrows() )
-with message:
- answer := 42
-
--------------------------------------------------------------------------------
-#809
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( 42 == f )
-with expansion:
- 42 == {?}
-
--------------------------------------------------------------------------------
-#833
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( a == t )
-with expansion:
- 3 == 3
-
-Compilation.tests.cpp:<line number>: PASSED:
- CHECK( a == t )
-with expansion:
- 3 == 3
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE_THROWS( throws_int(true) )
-
-Compilation.tests.cpp:<line number>: PASSED:
- CHECK_THROWS_AS( throws_int(true), int )
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE_NOTHROW( throws_int(false) )
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") )
-with expansion:
- "aaa" ends with: "aaa"
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( templated_tests<int>(3) )
-with expansion:
- true
-
--------------------------------------------------------------------------------
-#835 -- errno should not be touched by Catch
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: FAILED:
- CHECK( f() == 0 )
-with expansion:
- 1 == 0
-
-Misc.tests.cpp:<line number>: PASSED:
- REQUIRE( errno == 1 )
-with expansion:
- 1 == 1
-
--------------------------------------------------------------------------------
-#872
--------------------------------------------------------------------------------
-Compilation.tests.cpp:<line number>
-...............................................................................
-
-Compilation.tests.cpp:<line number>: PASSED:
- REQUIRE( x == 4 )
-with expansion:
- {?} == 4
-with message:
- dummy := 0
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 0
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 1
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 2
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 3
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-#961 -- Dynamically created sections should all be reported
- Looped section 4
--------------------------------------------------------------------------------
-Misc.tests.cpp:<line number>
-...............................................................................
-
-Misc.tests.cpp:<line number>: PASSED:
-with message:
- Everything is OK
-
--------------------------------------------------------------------------------
-'Not' checks that should fail
--------------------------------------------------------------------------------
-Condition.tests.cpp:<line number>
-...............................................................................
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( false != false )
-
-Condition.tests.cpp:<line number>: FAILED:
- CHECK( true != true )
-
-===============================================================================
-test cases: 19 | 14 passed | 3 failed | 2 failed as expected
-assertions: 42 | 35 passed | 4 failed | 3 failed as expected
-
diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt
deleted file mode 100644
index 6dd03a98..00000000
--- a/projects/SelfTest/Baselines/junit.sw.approved.txt
+++ /dev/null
@@ -1,1718 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<testsuitesloose text artifact
->
- <testsuite name="<exe-name>" errors="17" failures="132" tests="1694" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
- <properties>
- <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
- <property name="random-seed" value="1"/>
- </properties>
- <testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1027" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1027: Bitfields can be captured" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1147" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1175 - Hidden Test" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1238" time="{duration}"/>
- <testcase classname="<exe-name>.(Fixture_1245&lt;int, int>)" name="#1245" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1403" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1455 - INFO and WARN can start with a linebreak" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#1514: stderr/stdout is not captured in tests aborted by an exception" time="{duration}">
- <failure type="FAIL">
-FAILED:
-1514
-Tricky.tests.cpp:<line number>
- </failure>
- <system-out>
-This would not be caught previously
- </system-out>
- <system-err>
-Nor would this
- </system-err>
- </testcase>
- <testcase classname="<exe-name>.global" name="#1548" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-expected exception
-answer := 42
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/inside REQUIRE_NOTHROW" time="{duration}">
- <error message="thisThrows()" type="REQUIRE_NOTHROW">
-FAILED:
- REQUIRE_NOTHROW( thisThrows() )
-expected exception
-answer := 42
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/inside REQUIRE_THROWS" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#809" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#833" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#835 -- errno should not be touched by Catch" time="{duration}">
- <failure message="f() == 0" type="CHECK">
-FAILED:
- CHECK( f() == 0 )
-with expansion:
- 1 == 0
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="#872" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 0" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 1" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 2" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 3" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 4" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="'Not' checks that should fail" time="{duration}">
- <failure message="false != false" type="CHECK">
-FAILED:
- CHECK( false != false )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="true != true" type="CHECK">
-FAILED:
- CHECK( true != true )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="!true" type="CHECK">
-FAILED:
- CHECK( !true )
-with expansion:
- false
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="!(true)" type="CHECK_FALSE">
-FAILED:
- CHECK_FALSE( true )
-with expansion:
- !true
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="!trueValue" type="CHECK">
-FAILED:
- CHECK( !trueValue )
-with expansion:
- false
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="!(trueValue)" type="CHECK_FALSE">
-FAILED:
- CHECK_FALSE( trueValue )
-with expansion:
- !true
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="!(1 == 1)" type="CHECK">
-FAILED:
- CHECK( !(1 == 1) )
-with expansion:
- false
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="!(1 == 1)" type="CHECK_FALSE">
-FAILED:
- CHECK_FALSE( 1 == 1 )
-Condition.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="'Not' checks that should succeed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/compare to true" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/compare to false" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/negation" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/double negation" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/direct" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="3x3x3 ints" time="{duration}"/>
- <testcase classname="<exe-name>.TestClass" name="A METHOD_AS_TEST_CASE based test run that fails" time="{duration}">
- <failure message="s == &quot;world&quot;" type="REQUIRE">
-FAILED:
- REQUIRE( s == "world" )
-with expansion:
- "hello" == "world"
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.TestClass" name="A METHOD_AS_TEST_CASE based test run that succeeds" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo&lt;float>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>::m_a.size() == 1" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo&lt;int>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>::m_a.size() == 1" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector&lt;float>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>::m_a.size() == 1" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector&lt;int>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>::m_a.size() == 1" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo&lt;float>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo&lt;int>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector&lt;float>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector&lt;int>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2&lt;float, 6>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 6 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2&lt;int, 2>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 2 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array&lt;float, 6>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 6 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array&lt;int, 2>" time="{duration}">
- <failure message="Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 2 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2&lt;float,6>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2&lt;int,2>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array&lt;float,6>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array&lt;int,2>" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" time="{duration}">
- <failure message="Template_Fixture&lt;TestType>::m_a == 2" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture&lt;TestType>::m_a == 2 )
-with expansion:
- 1.0 == 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" time="{duration}">
- <failure message="Template_Fixture&lt;TestType>::m_a == 2" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture&lt;TestType>::m_a == 2 )
-with expansion:
- 1.0f == 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" time="{duration}">
- <failure message="Template_Fixture&lt;TestType>::m_a == 2" type="REQUIRE">
-FAILED:
- REQUIRE( Template_Fixture&lt;TestType>::m_a == 2 )
-with expansion:
- 1 == 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" time="{duration}"/>
- <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1" time="{duration}">
- <failure message="Nttp_Fixture&lt;V>::value == 0" type="REQUIRE">
-FAILED:
- REQUIRE( Nttp_Fixture&lt;V>::value == 0 )
-with expansion:
- 1 == 0
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3" time="{duration}">
- <failure message="Nttp_Fixture&lt;V>::value == 0" type="REQUIRE">
-FAILED:
- REQUIRE( Nttp_Fixture&lt;V>::value == 0 )
-with expansion:
- 3 == 0
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6" time="{duration}">
- <failure message="Nttp_Fixture&lt;V>::value == 0" type="REQUIRE">
-FAILED:
- REQUIRE( Nttp_Fixture&lt;V>::value == 0 )
-with expansion:
- 6 == 0
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1" time="{duration}"/>
- <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3" time="{duration}"/>
- <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6" time="{duration}"/>
- <testcase classname="<exe-name>.Fixture" name="A TEST_CASE_METHOD based test run that fails" time="{duration}">
- <failure message="m_a == 2" type="REQUIRE">
-FAILED:
- REQUIRE( m_a == 2 )
-with expansion:
- 1 == 2
-Class.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.Fixture" name="A TEST_CASE_METHOD based test run that succeeds" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case - Foo&lt;float>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case - Foo&lt;int>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case - std::vector&lt;float>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case - std::vector&lt;int>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case with array signature - Bar&lt;float, 42>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case with array signature - Bar&lt;int, 9>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case with array signature - std::array&lt;float, 42>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A Template product test case with array signature - std::array&lt;int, 9>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A comparison that uses literals instead of the normal constructor" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A couple of nested sections followed by a failure" time="{duration}">
- <failure type="FAIL">
-FAILED:
-to infinity and beyond
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="A couple of nested sections followed by a failure/Outer/Inner" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="A failing expression with a non streamable type is still captured" time="{duration}">
- <failure message="&amp;o1 == &amp;o2" type="CHECK">
-FAILED:
- CHECK( &amp;o1 == &amp;o2 )
-with expansion:
- 0x<hex digits> == 0x<hex digits>
-Tricky.tests.cpp:<line number>
- </failure>
- <failure message="o1 == o2" type="CHECK">
-FAILED:
- CHECK( o1 == o2 )
-with expansion:
- {?} == {?}
-Tricky.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Absolute margin" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="An expression with side-effects should only be evaluated once" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="An unchecked exception reports the line of the last assertion" time="{duration}">
- <error message="{Unknown expression after the reported line}">
-FAILED:
- {Unknown expression after the reported line}
-unexpected exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Anonymous test case 1" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Approx setters validate their arguments" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Approx with exactly-representable margin" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Approximate PI" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Approximate comparisons with different epsilons" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Approximate comparisons with floats" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Approximate comparisons with ints" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Approximate comparisons with mixed numeric types" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Function pointer" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Lambdas + different type" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Assertions then sections" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Assertions then sections/A section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another other section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions involving commas" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="CAPTURE parses string and character constants" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Capture and info messages/Capture should stringify like assertions" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Capture and info messages/Info should NOT stringify the way assertions do" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Character pretty printing/Specifically escaped" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Character pretty printing/General chars" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Character pretty printing/Low ASCII" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Comparisons between ints where one side is computed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Comparisons with int literals don't warn when mixing signed/ unsigned" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Composed matchers are distinct" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}">
- <failure message="testStringForMatching(), Contains(&quot;not there&quot;, Catch::CaseSensitive::No)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" contains: "not there" (case
- insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="testStringForMatching(), Contains(&quot;STRING&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), Contains("STRING") )
-with expansion:
- "this string contains 'abc' as a substring" contains: "STRING"
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Copy and then generate a range/from var and iterators" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Copy and then generate a range/From a temporary container" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Copy and then generate a range/Final validation" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Custom exceptions can be translated when testing for nothrow" time="{duration}">
- <error message="throwCustom()" type="REQUIRE_NOTHROW">
-FAILED:
- REQUIRE_NOTHROW( throwCustom() )
-custom exception - not std
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Custom exceptions can be translated when testing for throwing as something else" time="{duration}">
- <error message="throwCustom(), std::exception" type="REQUIRE_THROWS_AS">
-FAILED:
- REQUIRE_THROWS_AS( throwCustom(), std::exception )
-custom exception - not std
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Custom std-exceptions can be custom translated" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-custom std exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Default scale is invisible to comparison" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Directly creating an EnumInfo" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="EndsWith string matcher" time="{duration}">
- <failure message="testStringForMatching(), EndsWith(&quot;Substring&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("Substring") )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "Substring"
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="testStringForMatching(), EndsWith(&quot;this&quot;, Catch::CaseSensitive::No)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "this" (case
- insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Enums can quickly have stringification enabled using REGISTER_ENUM" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Epsilon only applies to Approx's value" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Equality checks that should fail" time="{duration}">
- <failure message="data.int_seven == 6" type="CHECK">
-FAILED:
- CHECK( data.int_seven == 6 )
-with expansion:
- 7 == 6
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven == 8" type="CHECK">
-FAILED:
- CHECK( data.int_seven == 8 )
-with expansion:
- 7 == 8
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven == 0" type="CHECK">
-FAILED:
- CHECK( data.int_seven == 0 )
-with expansion:
- 7 == 0
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one == Approx( 9.11f )" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.11f ) )
-with expansion:
- 9.1f == Approx( 9.1099996567 )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one == Approx( 9.0f )" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.0f ) )
-with expansion:
- 9.1f == Approx( 9.0 )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one == Approx( 1 )" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 1 ) )
-with expansion:
- 9.1f == Approx( 1.0 )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one == Approx( 0 )" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 0 ) )
-with expansion:
- 9.1f == Approx( 0.0 )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.double_pi == Approx( 3.1415 )" type="CHECK">
-FAILED:
- CHECK( data.double_pi == Approx( 3.1415 ) )
-with expansion:
- 3.1415926535 == Approx( 3.1415 )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello == &quot;goodbye&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello == "goodbye" )
-with expansion:
- "hello" == "goodbye"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello == &quot;hell&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello == "hell" )
-with expansion:
- "hello" == "hell"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello == &quot;hello1&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello == "hello1" )
-with expansion:
- "hello" == "hello1"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello.size() == 6" type="CHECK">
-FAILED:
- CHECK( data.str_hello.size() == 6 )
-with expansion:
- 5 == 6
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="x == Approx( 1.301 )" type="CHECK">
-FAILED:
- CHECK( x == Approx( 1.301 ) )
-with expansion:
- 1.3 == Approx( 1.301 )
-Condition.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Equality checks that should succeed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Equals" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Equals string matcher" time="{duration}">
- <failure message="testStringForMatching(), Equals(&quot;this string contains 'ABC' as a substring&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" equals: "this string contains
- 'ABC' as a substring"
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="testStringForMatching(), Equals(&quot;something else&quot;, Catch::CaseSensitive::No)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" equals: "something else" (case
- insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Exception matchers that fail/No exception" time="{duration}">
- <failure message="doesNotThrow(), SpecialException, ExceptionMatcher{1}" type="CHECK_THROWS_MATCHES">
-FAILED:
- CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="doesNotThrow(), SpecialException, ExceptionMatcher{1}" type="REQUIRE_THROWS_MATCHES">
-FAILED:
- REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Exception matchers that fail/Type mismatch" time="{duration}">
- <error message="throwsAsInt(1), SpecialException, ExceptionMatcher{1}" type="CHECK_THROWS_MATCHES">
-FAILED:
- CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-Unknown exception
-Matchers.tests.cpp:<line number>
- </error>
- <error message="throwsAsInt(1), SpecialException, ExceptionMatcher{1}" type="REQUIRE_THROWS_MATCHES">
-FAILED:
- REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-Unknown exception
-Matchers.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Exception matchers that fail/Contents are wrong" time="{duration}">
- <failure message="throwsSpecialException(3), SpecialException, ExceptionMatcher{1}" type="CHECK_THROWS_MATCHES">
-FAILED:
- CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="throwsSpecialException(4), SpecialException, ExceptionMatcher{1}" type="REQUIRE_THROWS_MATCHES">
-FAILED:
- REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Exception matchers that succeed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Exception messages can be tested for/exact match" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Exception messages can be tested for/different case" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Exception messages can be tested for/wildcarded" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Exceptions matchers" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Expected exceptions that don't throw or unexpected exceptions fail the test" time="{duration}">
- <error message="thisThrows(), std::string" type="CHECK_THROWS_AS">
-FAILED:
- CHECK_THROWS_AS( thisThrows(), std::string )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- <failure message="thisDoesntThrow(), std::domain_error" type="CHECK_THROWS_AS">
-FAILED:
- CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )
-Exception.tests.cpp:<line number>
- </failure>
- <error message="thisThrows()" type="CHECK_NOTHROW">
-FAILED:
- CHECK_NOTHROW( thisThrows() )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="FAIL aborts the test" time="{duration}">
- <failure type="FAIL">
-FAILED:
-This is a failure
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="FAIL does not require an argument" time="{duration}">
- <failure type="FAIL">
-FAILED:
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="FAIL_CHECK does not abort the test" time="{duration}">
- <failure type="FAIL_CHECK">
-FAILED:
-This is a failure
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: double/Margin" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: double/ULPs" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: double/Composed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: double/Constructor validation" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: float/Relative" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: float/Relative/Some subnormal values" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: float/Margin" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: float/ULPs" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: float/Composed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Shortening a range" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Same type" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Different type" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Different deduced type" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Repeating a generator" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Number of elements in source is divisible by chunk size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Number of elements in source is not divisible by chunk size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Chunk size of zero" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Throws on too small generators" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- simple/one" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators -- simple/two" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Single value" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Preset values" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Generator combinator" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Explicitly typed generator sequence" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Filter generator" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take less" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take more" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Map with explicit return type" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Map with deduced return type" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Repeat/Singular repeat" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Repeat/Actual repeat" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive auto step/Integer" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative auto step/Integer" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Exact" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly over end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly under end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Exact" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Slightly over end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Slightly under end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Exact" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly over end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly under end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Greater-than inequalities with different epsilons" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="INFO and WARN do not abort tests" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="INFO gets logged on failure" time="{duration}">
- <failure message="a == 1" type="REQUIRE">
-FAILED:
- REQUIRE( a == 1 )
-with expansion:
- 2 == 1
-this message should be logged
-so should this
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="INFO gets logged on failure, even if captured before successful assertions" time="{duration}">
- <failure message="a == 1" type="CHECK">
-FAILED:
- CHECK( a == 1 )
-with expansion:
- 2 == 1
-this message may be logged later
-this message should be logged
-Message.tests.cpp:<line number>
- </failure>
- <failure message="a == 0" type="CHECK">
-FAILED:
- CHECK( a == 0 )
-with expansion:
- 2 == 0
-this message may be logged later
-this message should be logged
-and this, but later
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="INFO is reset for each loop" time="{duration}">
- <failure message="i &lt; 10" type="REQUIRE">
-FAILED:
- REQUIRE( i &lt; 10 )
-with expansion:
- 10 &lt; 10
-current counter 10
-i := 10
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Inequality checks that should fail" time="{duration}">
- <failure message="data.int_seven != 7" type="CHECK">
-FAILED:
- CHECK( data.int_seven != 7 )
-with expansion:
- 7 != 7
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one != Approx( 9.1f )" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one != Approx( 9.1f ) )
-with expansion:
- 9.1f != Approx( 9.1000003815 )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.double_pi != Approx( 3.1415926535 )" type="CHECK">
-FAILED:
- CHECK( data.double_pi != Approx( 3.1415926535 ) )
-with expansion:
- 3.1415926535 != Approx( 3.1415926535 )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello != &quot;hello&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello != "hello" )
-with expansion:
- "hello" != "hello"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello.size() != 5" type="CHECK">
-FAILED:
- CHECK( data.str_hello.size() != 5 )
-with expansion:
- 5 != 5
-Condition.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Inequality checks that should succeed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Less-than inequalities with different epsilons" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="ManuallyRegistered" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Matchers can be (AllOf) composed with the &amp;&amp; operator" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Matchers can be (AnyOf) composed with the || operator" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Matchers can be composed with both &amp;&amp; and ||" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Matchers can be composed with both &amp;&amp; and || - failing" time="{duration}">
- <failure message="testStringForMatching(), (Contains(&quot;string&quot;) || Contains(&quot;different&quot;)) &amp;&amp; Contains(&quot;random&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) &amp;&amp; Contains("random") )
-with expansion:
- "this string contains 'abc' as a substring" ( ( contains: "string" or
- contains: "different" ) and contains: "random" )
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Matchers can be negated (Not) with the ! operator" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Matchers can be negated (Not) with the ! operator - failing" time="{duration}">
- <failure message="testStringForMatching(), !Contains(&quot;substring&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), !Contains("substring") )
-with expansion:
- "this string contains 'abc' as a substring" not contains: "substring"
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Mismatching exception messages failing the test" time="{duration}">
- <failure message="thisThrows(), &quot;should fail&quot;" type="REQUIRE_THROWS_WITH">
-FAILED:
- REQUIRE_THROWS_WITH( thisThrows(), "should fail" )
-with expansion:
- "expected exception" equals: "should fail"
-Exception.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Nested generators and captured variables" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Nice descriptive name" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Non-std exceptions can be translated" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-custom exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Objects that evaluated in boolean contexts can be checked" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Optionally static assertions" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Ordering comparison checks that should fail" time="{duration}">
- <failure message="data.int_seven > 7" type="CHECK">
-FAILED:
- CHECK( data.int_seven > 7 )
-with expansion:
- 7 > 7
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven &lt; 7" type="CHECK">
-FAILED:
- CHECK( data.int_seven &lt; 7 )
-with expansion:
- 7 &lt; 7
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven > 8" type="CHECK">
-FAILED:
- CHECK( data.int_seven > 8 )
-with expansion:
- 7 > 8
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven &lt; 6" type="CHECK">
-FAILED:
- CHECK( data.int_seven &lt; 6 )
-with expansion:
- 7 &lt; 6
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven &lt; 0" type="CHECK">
-FAILED:
- CHECK( data.int_seven &lt; 0 )
-with expansion:
- 7 &lt; 0
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven &lt; -1" type="CHECK">
-FAILED:
- CHECK( data.int_seven &lt; -1 )
-with expansion:
- 7 &lt; -1
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven >= 8" type="CHECK">
-FAILED:
- CHECK( data.int_seven >= 8 )
-with expansion:
- 7 >= 8
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.int_seven &lt;= 6" type="CHECK">
-FAILED:
- CHECK( data.int_seven &lt;= 6 )
-with expansion:
- 7 &lt;= 6
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one &lt; 9" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one &lt; 9 )
-with expansion:
- 9.1f &lt; 9
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one > 10" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one > 10 )
-with expansion:
- 9.1f > 10
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.float_nine_point_one > 9.2" type="CHECK">
-FAILED:
- CHECK( data.float_nine_point_one > 9.2 )
-with expansion:
- 9.1f > 9.2
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello > &quot;hello&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello > "hello" )
-with expansion:
- "hello" > "hello"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello &lt; &quot;hello&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello &lt; "hello" )
-with expansion:
- "hello" &lt; "hello"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello > &quot;hellp&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello > "hellp" )
-with expansion:
- "hello" > "hellp"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello > &quot;z&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello > "z" )
-with expansion:
- "hello" > "z"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello &lt; &quot;hellm&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello &lt; "hellm" )
-with expansion:
- "hello" &lt; "hellm"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello &lt; &quot;a&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello &lt; "a" )
-with expansion:
- "hello" &lt; "a"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello >= &quot;z&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello >= "z" )
-with expansion:
- "hello" >= "z"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="data.str_hello &lt;= &quot;a&quot;" type="CHECK">
-FAILED:
- CHECK( data.str_hello &lt;= "a" )
-with expansion:
- "hello" &lt;= "a"
-Condition.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Ordering comparison checks that should succeed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Our PCG implementation provides expected results for known seeds/Default seeded" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Our PCG implementation provides expected results for known seeds/Specific seed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Output from all sections is reported/one" time="{duration}">
- <failure type="FAIL">
-FAILED:
-Message from section one
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Output from all sections is reported/two" time="{duration}">
- <failure type="FAIL">
-FAILED:
-Message from section two
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Empty test spec should have no filters" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from empty string should have no filters" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from just a comma should have no filters" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from name should have one filter" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from quoted name should have one filter" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from name should have one filter" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at the start" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at the end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at both ends" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Redundant wildcard at the start" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Redundant wildcard at the end" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Redundant wildcard at both ends" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at both ends, redundant at start" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Just wildcard" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Single tag" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Single tag, two matches" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Two tags" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Two tags, spare separated" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcarded name and tag" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Single tag exclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/One tag exclusion and one tag inclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/One tag exclusion and one wldcarded name inclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/One tag exclusion, using exclude:, and one wldcarded name inclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/name exclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/wildcarded name exclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/wildcarded name exclusion with tag inclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/wildcarded name exclusion, using exclude:, with tag inclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/two wildcarded names" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/empty tag" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/empty quoted name" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/quoted string followed by tag exclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Leading and trailing spaces in test spec" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Leading and trailing spaces in test name" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Shortened hide tags are split apart when parsing" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Parse test names and tags/Shortened hide tags also properly handle exclusion" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Pointers can be compared to null" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Precision of floating point stringification can be set/Floats" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Precision of floating point stringification can be set/Double" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Predicate matcher can accept const char*" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/empty args don't cause a crash" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/default - no arguments" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/test lists/Specify one test case using" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/test lists/Specify one test case exclusion using exclude:" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/test lists/Specify one test case exclusion using ~" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/-r/console" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/-r/xml" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/--reporter/junit" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Only one reporter is accepted" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/must match one of the available ones" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/-b" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/--break" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-a aborts after first failure" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-x 2 aborts after two failures" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-x must be numeric" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/wait-for-keypress/Accepted options" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/wait-for-keypress/invalid options are reported" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/nothrow/-e" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/nothrow/--nothrow" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/output filename/-o filename" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/output filename/--out" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/combinations/Single character flags can be combined" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/without option" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/auto" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/yes" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/no" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/error" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/resamples" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/confidence-interval" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/no-analysis" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/warmup-time" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int, double, float>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int, double>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}">
- <failure message="truthy(false)" type="CHECK">
-FAILED:
- CHECK( truthy(false) )
-with expansion:
- Hey, its truthy!
-Decomposition.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Regex string matcher" time="{duration}">
- <failure message="testStringForMatching(), Matches(&quot;this STRING contains 'abc' as a substring&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this STRING contains
- 'abc' as a substring" case sensitively
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="testStringForMatching(), Matches(&quot;contains 'abc' as a substring&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "contains 'abc' as a
- substring" case sensitively
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="testStringForMatching(), Matches(&quot;this string contains 'abc' as a&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this string contains
- 'abc' as a" case sensitively
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="SUCCEED counts as a test pass" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="SUCCEED does not require an argument" time="{duration}"/>
- <testcase classname="<exe-name>.Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me" time="{duration}"/>
- <testcase classname="<exe-name>.Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me/When: We get the count/Then: Subsequently values are higher" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I do this/Then: it should do this" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I do this/Then: it should do this/And: do that" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Scenario: This is a really long scenario name to see how the list command deals with wrapping/Given: A section name that is so long that it cannot fit in a single console width/When: The test headers are printed as part of the normal running of the scenario/Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: it is made larger/Then: the size and capacity go up" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: it is made larger/Then: the size and capacity go up/And when: it is made smaller again/Then: the size goes down but the capacity stays the same" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: we reserve more space/Then: The capacity is increased but the size remains the same" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Sends stuff to stdout and stderr" time="{duration}">
- <system-out>
-A string sent directly to stdout
- </system-out>
- <system-err>
-A string sent directly to stderr
-A string sent to stderr via clog
- </system-err>
- </testcase>
- <testcase classname="<exe-name>.global" name="Some simple comparisons between doubles" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Standard output from all sections is reported/two" time="{duration}">
- <system-out>
-Message from section one
-Message from section two
- </system-out>
- </testcase>
- <testcase classname="<exe-name>.global" name="StartsWith string matcher" time="{duration}">
- <failure message="testStringForMatching(), StartsWith(&quot;This String&quot;)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("This String") )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "This String"
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="testStringForMatching(), StartsWith(&quot;string&quot;, Catch::CaseSensitive::No)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "string" (case
- insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Static arrays are convertible to string/Single item" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Static arrays are convertible to string/Multiple" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Static arrays are convertible to string/Non-trivial inner items" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="String matchers" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Empty string" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/From string literal" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/From sub-string" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Substrings/zero-based substring" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Substrings/non-zero-based substring" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Substrings/Pointer values of full refs should match" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Substrings/Pointer values of substring refs should also match" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Substrings/Past the end substring" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Substrings/Substring off the end are trimmed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/Comparisons are deep" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/from std::string/implicitly constructed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/from std::string/explicitly constructed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/from std::string/assigned" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/to std::string/explicitly constructed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef/to std::string/assigned" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef at compilation time/Simple constructors" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="StringRef at compilation time/UDL construction" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Stringifying std::chrono::duration helpers" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Stringifying std::chrono::duration with weird ratios" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Stringifying std::chrono::time_point&lt;system_clock>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tabs and newlines show in output" time="{duration}">
- <failure message="s1 == s2" type="CHECK">
-FAILED:
- CHECK( s1 == s2 )
-with expansion:
- "if ($b == 10) {
- $a = 20;
- }"
- ==
- "if ($b == 10) {
- $a = 20;
- }
- "
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/The same tag alias can only be registered once" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 0" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 1" time="{duration}"/>
- <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 2" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Template test case with test types specified inside std::tuple - MyTypes - 0" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Template test case with test types specified inside std::tuple - MyTypes - 1" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Template test case with test types specified inside std::tuple - MyTypes - 2" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Test case with one argument" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Test with special, characters &quot;in name" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="The NO_FAIL macro reports a failure but does not fail the test" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="This test 'should' fail but doesn't" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Thrown string literals are translated" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-For some reason someone is throwing a string literal!
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Tracker" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/successfully close one section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/fail one section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/fail one section/re-enter after failed section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/fail one section/re-enter after failed section and find next section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/successfully close one section, then find another" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2/Successfully close S2" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2/fail S2" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Tracker/open a nested section" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Trim strings" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Unexpected exceptions can be translated" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-3.14
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Use a custom approx" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Variadic macros/Section with one argument" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector Approx matcher/Empty vector is roughly equal to an empty vector" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/A vector is approx equal to itself" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/Different length" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/Same length, different elements" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector Approx matcher -- failing/Empty and non empty vectors are not approx equal" time="{duration}">
- <failure message="empty, Approx(t1)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( empty, Approx(t1) )
-with expansion:
- { } is approx: { 1.0, 2.0 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Vector Approx matcher -- failing/Just different vectors" time="{duration}">
- <failure message="v1, Approx(v2)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( v1, Approx(v2) )
-with expansion:
- { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Vector matchers/Contains (element)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector matchers/Contains (vector)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector matchers/Contains (element), composed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector matchers/Equals" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector matchers/UnorderedEquals" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Vector matchers that fail/Contains (element)" time="{duration}">
- <failure message="v, VectorContains(-1)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( v, VectorContains(-1) )
-with expansion:
- { 1, 2, 3 } Contains: -1
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="empty, VectorContains(1)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( empty, VectorContains(1) )
-with expansion:
- { } Contains: 1
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Vector matchers that fail/Contains (vector)" time="{duration}">
- <failure message="empty, Contains(v)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( empty, Contains(v) )
-with expansion:
- { } Contains: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="v, Contains(v2)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( v, Contains(v2) )
-with expansion:
- { 1, 2, 3 } Contains: { 1, 2, 4 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Vector matchers that fail/Equals" time="{duration}">
- <failure message="v, Equals(v2)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( v, Equals(v2) )
-with expansion:
- { 1, 2, 3 } Equals: { 1, 2 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="v2, Equals(v)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( v2, Equals(v) )
-with expansion:
- { 1, 2 } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="empty, Equals(v)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( empty, Equals(v) )
-with expansion:
- { } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="v, Equals(empty)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( v, Equals(empty) )
-with expansion:
- { 1, 2, 3 } Equals: { }
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="Vector matchers that fail/UnorderedEquals" time="{duration}">
- <failure message="v, UnorderedEquals(empty)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( v, UnorderedEquals(empty) )
-with expansion:
- { 1, 2, 3 } UnorderedEquals: { }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="empty, UnorderedEquals(v)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( empty, UnorderedEquals(v) )
-with expansion:
- { } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="permuted, UnorderedEquals(v)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 1, 3 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="permuted, UnorderedEquals(v)" type="CHECK_THAT">
-FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 3, 1 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="When checked exceptions are thrown they can be expected or unexpected" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown directly they are always failures" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-unexpected exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown during a CHECK the test should continue" time="{duration}">
- <error message="thisThrows() == 0" type="CHECK">
-FAILED:
- CHECK( thisThrows() == 0 )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown during a REQUIRE the test should abort fail" time="{duration}">
- <error message="thisThrows() == 0" type="REQUIRE">
-FAILED:
- REQUIRE( thisThrows() == 0 )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown from functions they are always failures" time="{duration}">
- <error message="thisThrows() == 0" type="CHECK">
-FAILED:
- CHECK( thisThrows() == 0 )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown from sections they are always failures/section name" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-unexpected exception
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="Where the LHS is not a simple value" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="Where there is more to the expression after the RHS" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="X/level/0/a" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="X/level/0/b" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="X/level/1/a" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="X/level/1/b" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/normal string" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/empty string" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/string with ampersand" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/string with less-than" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/string with greater-than" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/string with quotes" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/string with control char (1)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="XmlEncode/string with control char (x7F)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="adding a hide tag implicitly enables all others" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="array&lt;int, N> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="atomic if" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="boolean member" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="checkedElse" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="checkedElse, failing" time="{duration}">
- <failure message="flag" type="CHECKED_ELSE">
-FAILED:
- CHECKED_ELSE( flag )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="testCheckedElse( false )" type="REQUIRE">
-FAILED:
- REQUIRE( testCheckedElse( false ) )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="checkedIf" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="checkedIf, failing" time="{duration}">
- <failure message="flag" type="CHECKED_IF">
-FAILED:
- CHECKED_IF( flag )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="testCheckedIf( false )" type="REQUIRE">
-FAILED:
- REQUIRE( testCheckedIf( false ) )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="comparisons between const int variables" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="comparisons between int variables" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c/d (leaf)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c/e (leaf)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="even more nested SECTION tests/f (leaf)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="just failure" time="{duration}">
- <failure type="FAIL">
-FAILED:
-Previous info should not be seen
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="just failure after unscoped info" time="{duration}">
- <failure type="FAIL">
-FAILED:
-previous unscoped info SHOULD not be seen
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="long long" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 0" time="{duration}">
- <failure message="b > a" type="CHECK">
-FAILED:
- CHECK( b > a )
-with expansion:
- 0 > 1
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 1" time="{duration}">
- <failure message="b > a" type="CHECK">
-FAILED:
- CHECK( b > a )
-with expansion:
- 1 > 1
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 2" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 3" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 4" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 5" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 6" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 7" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 8" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 9" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="looped tests" time="{duration}">
- <failure message="( fib[i] % 2 ) == 0" type="CHECK">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[0] (1) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="( fib[i] % 2 ) == 0" type="CHECK">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[1] (1) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="( fib[i] % 2 ) == 0" type="CHECK">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[3] (3) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="( fib[i] % 2 ) == 0" type="CHECK">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[4] (5) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="( fib[i] % 2 ) == 0" type="CHECK">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[6] (13) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="( fib[i] % 2 ) == 0" type="CHECK">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[7] (21) is even
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="mix info, unscoped info and warning" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="more nested SECTION tests/equal/doesn't equal" time="{duration}">
- <failure message="a == b" type="REQUIRE">
-FAILED:
- REQUIRE( a == b )
-with expansion:
- 1 == 2
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="more nested SECTION tests/doesn't equal/not equal" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="more nested SECTION tests/doesn't equal/less than" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="nested SECTION tests/doesn't equal" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="nested SECTION tests/doesn't equal/not equal" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="non streamable - with conv. op" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="non-copyable objects" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="not allowed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="not prints unscoped info from previous failures" time="{duration}">
- <failure message="false" type="REQUIRE">
-FAILED:
- REQUIRE( false )
-this SHOULD be seen
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="null strings" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="null_ptr" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="pair&lt;pair&lt;int,const char *,pair&lt;std::string,int> > -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="parseEnums/No enums" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="parseEnums/One enum value" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="parseEnums/Multiple enum values" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="pointer to class" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="print unscoped info if passing unscoped info is printed" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="prints unscoped info on failure" time="{duration}">
- <failure message="false" type="REQUIRE">
-FAILED:
- REQUIRE( false )
-this SHOULD be seen
-this SHOULD also be seen
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="prints unscoped info only for the first assertion" time="{duration}">
- <failure message="false" type="CHECK">
-FAILED:
- CHECK( false )
-this SHOULD be seen only ONCE
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="random SECTION tests/doesn't equal" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="random SECTION tests/not equal" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="replaceInPlace/replace single char" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="replaceInPlace/replace two chars" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="replaceInPlace/replace first char" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="replaceInPlace/replace last char" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="replaceInPlace/replace all chars" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="replaceInPlace/replace no chars" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="replaceInPlace/escape '" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="send a single char to INFO" time="{duration}">
- <failure message="false" type="REQUIRE">
-FAILED:
- REQUIRE( false )
-3
-Misc.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="sends information to INFO" time="{duration}">
- <failure message="false" type="REQUIRE">
-FAILED:
- REQUIRE( false )
-hi
-i := 7
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="shortened hide tags are split apart" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="splitString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stacks unscoped info in loops" time="{duration}">
- <failure message="false" type="CHECK">
-FAILED:
- CHECK( false )
-Count 1 to 3...
-1
-2
-3
-Message.tests.cpp:<line number>
- </failure>
- <failure message="false" type="CHECK">
-FAILED:
- CHECK( false )
-Count 4 to 6...
-4
-5
-6
-Message.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="std::map is convertible string/empty" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::map is convertible string/single item" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::map is convertible string/several items" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::pair&lt;int,const std::string> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::pair&lt;int,std::string> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::set is convertible string/empty" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::set is convertible string/single item" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::set is convertible string/several items" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="std::vector&lt;std::pair&lt;std::string,int> > -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="string literals of different sizes can be compared" time="{duration}">
- <failure message="std::string( &quot;first&quot; ) == &quot;second&quot;" type="REQUIRE">
-FAILED:
- REQUIRE( std::string( "first" ) == "second" )
-with expansion:
- "first" == "second"
-Tricky.tests.cpp:<line number>
- </failure>
- </testcase>
- <testcase classname="<exe-name>.global" name="stringify ranges" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( has_maker )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( has_maker_and_operator )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( has_neither )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( has_operator )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( has_template_operator )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( vectors&lt;has_maker> )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( vectors&lt;has_maker_and_operator> )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="stringify( vectors&lt;has_operator> )" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="strlen3" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="tables" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="thrown std::strings are translated" time="{duration}">
- <error type="TEST_CASE">
-FAILED:
-Why would you throw a std::string?
-Exception.tests.cpp:<line number>
- </error>
- </testcase>
- <testcase classname="<exe-name>.global" name="toString on const wchar_t const pointer returns the string contents" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="toString on const wchar_t pointer returns the string contents" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="toString on wchar_t const pointer returns the string contents" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="toString on wchar_t returns the string contents" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="toString(enum class w/operator&lt;&lt;)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="toString(enum class)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="toString(enum w/operator&lt;&lt;)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="toString(enum)" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="tuple&lt;>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="tuple&lt;float,int>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="tuple&lt;int>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="tuple&lt;0,int,const char *>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="tuple&lt;string,string>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="tuple&lt;tuple&lt;int>,tuple&lt;>,float>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vec&lt;vec&lt;string,alloc>> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vector&lt;bool> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vector&lt;int,allocator> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vector&lt;int> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vector&lt;string> -> toString" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vectors can be sized and resized" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vectors can be sized and resized/resizing bigger changes size and capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vectors can be sized and resized/resizing smaller changes size but not capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vectors can be sized and resized/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vectors can be sized and resized/reserving bigger changes capacity but not size" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="vectors can be sized and resized/reserving smaller does not change size or capacity" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="xmlentitycheck/embedded xml: &lt;test>it should be possible to embed xml characters, such as &lt;, &quot; or &amp;, or even whole &lt;xml>documents&lt;/xml> within an attribute&lt;/test>" time="{duration}"/>
- <testcase classname="<exe-name>.global" name="xmlentitycheck/encoded chars: these should all be encoded: &amp;&amp;&amp;&quot;&quot;&quot;&lt;&lt;&lt;&amp;&quot;&lt;&lt;&amp;&quot;" time="{duration}"/>
- <system-out>
-This would not be caught previously
-A string sent directly to stdout
-Message from section one
-Message from section two
- </system-out>
- <system-err>
-Nor would this
-A string sent directly to stderr
-A string sent to stderr via clog
- </system-err>
- </testsuite>
-</testsuites>
diff --git a/projects/SelfTest/Baselines/sonarqube.sw.approved.txt b/projects/SelfTest/Baselines/sonarqube.sw.approved.txt
deleted file mode 100644
index 1f89e99c..00000000
--- a/projects/SelfTest/Baselines/sonarqube.sw.approved.txt
+++ /dev/null
@@ -1,1731 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<testExecutions version="1"loose text artifact
->
- <file path="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp">
- <testCase name="Parse test names and tags/Empty test spec should have no filters" duration="{duration}"/>
- <testCase name="Parse test names and tags/Test spec from empty string should have no filters" duration="{duration}"/>
- <testCase name="Parse test names and tags/Test spec from just a comma should have no filters" duration="{duration}"/>
- <testCase name="Parse test names and tags/Test spec from name should have one filter" duration="{duration}"/>
- <testCase name="Parse test names and tags/Test spec from quoted name should have one filter" duration="{duration}"/>
- <testCase name="Parse test names and tags/Test spec from name should have one filter" duration="{duration}"/>
- <testCase name="Parse test names and tags/Wildcard at the start" duration="{duration}"/>
- <testCase name="Parse test names and tags/Wildcard at the end" duration="{duration}"/>
- <testCase name="Parse test names and tags/Wildcard at both ends" duration="{duration}"/>
- <testCase name="Parse test names and tags/Redundant wildcard at the start" duration="{duration}"/>
- <testCase name="Parse test names and tags/Redundant wildcard at the end" duration="{duration}"/>
- <testCase name="Parse test names and tags/Redundant wildcard at both ends" duration="{duration}"/>
- <testCase name="Parse test names and tags/Wildcard at both ends, redundant at start" duration="{duration}"/>
- <testCase name="Parse test names and tags/Just wildcard" duration="{duration}"/>
- <testCase name="Parse test names and tags/Single tag" duration="{duration}"/>
- <testCase name="Parse test names and tags/Single tag, two matches" duration="{duration}"/>
- <testCase name="Parse test names and tags/Two tags" duration="{duration}"/>
- <testCase name="Parse test names and tags/Two tags, spare separated" duration="{duration}"/>
- <testCase name="Parse test names and tags/Wildcarded name and tag" duration="{duration}"/>
- <testCase name="Parse test names and tags/Single tag exclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/One tag exclusion and one tag inclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/One tag exclusion and one wldcarded name inclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/One tag exclusion, using exclude:, and one wldcarded name inclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/name exclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/wildcarded name exclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/wildcarded name exclusion with tag inclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/wildcarded name exclusion, using exclude:, with tag inclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/two wildcarded names" duration="{duration}"/>
- <testCase name="Parse test names and tags/empty tag" duration="{duration}"/>
- <testCase name="Parse test names and tags/empty quoted name" duration="{duration}"/>
- <testCase name="Parse test names and tags/quoted string followed by tag exclusion" duration="{duration}"/>
- <testCase name="Parse test names and tags/Leading and trailing spaces in test spec" duration="{duration}"/>
- <testCase name="Parse test names and tags/Leading and trailing spaces in test name" duration="{duration}"/>
- <testCase name="Parse test names and tags/Shortened hide tags are split apart when parsing" duration="{duration}"/>
- <testCase name="Parse test names and tags/Shortened hide tags also properly handle exclusion" duration="{duration}"/>
- <testCase name="Process can be configured on command line/empty args don't cause a crash" duration="{duration}"/>
- <testCase name="Process can be configured on command line/default - no arguments" duration="{duration}"/>
- <testCase name="Process can be configured on command line/test lists/Specify one test case using" duration="{duration}"/>
- <testCase name="Process can be configured on command line/test lists/Specify one test case exclusion using exclude:" duration="{duration}"/>
- <testCase name="Process can be configured on command line/test lists/Specify one test case exclusion using ~" duration="{duration}"/>
- <testCase name="Process can be configured on command line/reporter/-r/console" duration="{duration}"/>
- <testCase name="Process can be configured on command line/reporter/-r/xml" duration="{duration}"/>
- <testCase name="Process can be configured on command line/reporter/--reporter/junit" duration="{duration}"/>
- <testCase name="Process can be configured on command line/reporter/Only one reporter is accepted" duration="{duration}"/>
- <testCase name="Process can be configured on command line/reporter/must match one of the available ones" duration="{duration}"/>
- <testCase name="Process can be configured on command line/debugger/-b" duration="{duration}"/>
- <testCase name="Process can be configured on command line/debugger/--break" duration="{duration}"/>
- <testCase name="Process can be configured on command line/abort/-a aborts after first failure" duration="{duration}"/>
- <testCase name="Process can be configured on command line/abort/-x 2 aborts after two failures" duration="{duration}"/>
- <testCase name="Process can be configured on command line/abort/-x must be numeric" duration="{duration}"/>
- <testCase name="Process can be configured on command line/abort/wait-for-keypress/Accepted options" duration="{duration}"/>
- <testCase name="Process can be configured on command line/abort/wait-for-keypress/invalid options are reported" duration="{duration}"/>
- <testCase name="Process can be configured on command line/nothrow/-e" duration="{duration}"/>
- <testCase name="Process can be configured on command line/nothrow/--nothrow" duration="{duration}"/>
- <testCase name="Process can be configured on command line/output filename/-o filename" duration="{duration}"/>
- <testCase name="Process can be configured on command line/output filename/--out" duration="{duration}"/>
- <testCase name="Process can be configured on command line/combinations/Single character flags can be combined" duration="{duration}"/>
- <testCase name="Process can be configured on command line/use-colour/without option" duration="{duration}"/>
- <testCase name="Process can be configured on command line/use-colour/auto" duration="{duration}"/>
- <testCase name="Process can be configured on command line/use-colour/yes" duration="{duration}"/>
- <testCase name="Process can be configured on command line/use-colour/no" duration="{duration}"/>
- <testCase name="Process can be configured on command line/use-colour/error" duration="{duration}"/>
- <testCase name="Process can be configured on command line/Benchmark options/samples" duration="{duration}"/>
- <testCase name="Process can be configured on command line/Benchmark options/resamples" duration="{duration}"/>
- <testCase name="Process can be configured on command line/Benchmark options/confidence-interval" duration="{duration}"/>
- <testCase name="Process can be configured on command line/Benchmark options/no-analysis" duration="{duration}"/>
- <testCase name="Process can be configured on command line/Benchmark options/warmup-time" duration="{duration}"/>
- <testCase name="Test with special, characters &quot;in name" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp">
- <testCase name="Generators internals/Single value" duration="{duration}"/>
- <testCase name="Generators internals/Preset values" duration="{duration}"/>
- <testCase name="Generators internals/Generator combinator" duration="{duration}"/>
- <testCase name="Generators internals/Explicitly typed generator sequence" duration="{duration}"/>
- <testCase name="Generators internals/Filter generator" duration="{duration}"/>
- <testCase name="Generators internals/Take generator/Take less" duration="{duration}"/>
- <testCase name="Generators internals/Take generator/Take more" duration="{duration}"/>
- <testCase name="Generators internals/Map with explicit return type" duration="{duration}"/>
- <testCase name="Generators internals/Map with deduced return type" duration="{duration}"/>
- <testCase name="Generators internals/Repeat/Singular repeat" duration="{duration}"/>
- <testCase name="Generators internals/Repeat/Actual repeat" duration="{duration}"/>
- <testCase name="Generators internals/Range/Positive auto step/Integer" duration="{duration}"/>
- <testCase name="Generators internals/Range/Negative auto step/Integer" duration="{duration}"/>
- <testCase name="Generators internals/Range/Positive manual step/Integer/Exact" duration="{duration}"/>
- <testCase name="Generators internals/Range/Positive manual step/Integer/Slightly over end" duration="{duration}"/>
- <testCase name="Generators internals/Range/Positive manual step/Integer/Slightly under end" duration="{duration}"/>
- <testCase name="Generators internals/Range/Positive manual step/Floating Point/Exact" duration="{duration}"/>
- <testCase name="Generators internals/Range/Positive manual step/Floating Point/Slightly over end" duration="{duration}"/>
- <testCase name="Generators internals/Range/Positive manual step/Floating Point/Slightly under end" duration="{duration}"/>
- <testCase name="Generators internals/Range/Negative manual step/Integer/Exact" duration="{duration}"/>
- <testCase name="Generators internals/Range/Negative manual step/Integer/Slightly over end" duration="{duration}"/>
- <testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp">
- <testCase name="Tracker" duration="{duration}"/>
- <testCase name="Tracker/successfully close one section" duration="{duration}"/>
- <testCase name="Tracker/fail one section" duration="{duration}"/>
- <testCase name="Tracker/fail one section/re-enter after failed section" duration="{duration}"/>
- <testCase name="Tracker/fail one section/re-enter after failed section and find next section" duration="{duration}"/>
- <testCase name="Tracker/successfully close one section, then find another" duration="{duration}"/>
- <testCase name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2" duration="{duration}"/>
- <testCase name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2/Successfully close S2" duration="{duration}"/>
- <testCase name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2/fail S2" duration="{duration}"/>
- <testCase name="Tracker/open a nested section" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp">
- <testCase name="Comparison ops" duration="{duration}"/>
- <testCase name="Our PCG implementation provides expected results for known seeds/Default seeded" duration="{duration}"/>
- <testCase name="Our PCG implementation provides expected results for known seeds/Specific seed" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/String.tests.cpp">
- <testCase name="StringRef/Empty string" duration="{duration}"/>
- <testCase name="StringRef/From string literal" duration="{duration}"/>
- <testCase name="StringRef/From sub-string" duration="{duration}"/>
- <testCase name="StringRef/Substrings/zero-based substring" duration="{duration}"/>
- <testCase name="StringRef/Substrings/non-zero-based substring" duration="{duration}"/>
- <testCase name="StringRef/Substrings/Pointer values of full refs should match" duration="{duration}"/>
- <testCase name="StringRef/Substrings/Pointer values of substring refs should also match" duration="{duration}"/>
- <testCase name="StringRef/Substrings/Past the end substring" duration="{duration}"/>
- <testCase name="StringRef/Substrings/Substring off the end are trimmed" duration="{duration}"/>
- <testCase name="StringRef/Comparisons are deep" duration="{duration}"/>
- <testCase name="StringRef/from std::string/implicitly constructed" duration="{duration}"/>
- <testCase name="StringRef/from std::string/explicitly constructed" duration="{duration}"/>
- <testCase name="StringRef/from std::string/assigned" duration="{duration}"/>
- <testCase name="StringRef/to std::string/explicitly constructed" duration="{duration}"/>
- <testCase name="StringRef/to std::string/assigned" duration="{duration}"/>
- <testCase name="StringRef at compilation time/Simple constructors" duration="{duration}"/>
- <testCase name="StringRef at compilation time/UDL construction" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp">
- <testCase name="Trim strings" duration="{duration}"/>
- <testCase name="replaceInPlace/replace single char" duration="{duration}"/>
- <testCase name="replaceInPlace/replace two chars" duration="{duration}"/>
- <testCase name="replaceInPlace/replace first char" duration="{duration}"/>
- <testCase name="replaceInPlace/replace last char" duration="{duration}"/>
- <testCase name="replaceInPlace/replace all chars" duration="{duration}"/>
- <testCase name="replaceInPlace/replace no chars" duration="{duration}"/>
- <testCase name="replaceInPlace/escape '" duration="{duration}"/>
- <testCase name="splitString" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp">
- <testCase name="Tag alias can be registered against tag patterns/The same tag alias can only be registered once" duration="{duration}"/>
- <testCase name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" duration="{duration}"/>
- <testCase name="adding a hide tag implicitly enables all others" duration="{duration}"/>
- <testCase name="shortened hide tags are split apart" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp">
- <testCase name="Directly creating an EnumInfo" duration="{duration}"/>
- <testCase name="parseEnums/No enums" duration="{duration}"/>
- <testCase name="parseEnums/One enum value" duration="{duration}"/>
- <testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp">
- <testCase name="XmlEncode/normal string" duration="{duration}"/>
- <testCase name="XmlEncode/empty string" duration="{duration}"/>
- <testCase name="XmlEncode/string with ampersand" duration="{duration}"/>
- <testCase name="XmlEncode/string with less-than" duration="{duration}"/>
- <testCase name="XmlEncode/string with greater-than" duration="{duration}"/>
- <testCase name="XmlEncode/string with quotes" duration="{duration}"/>
- <testCase name="XmlEncode/string with control char (1)" duration="{duration}"/>
- <testCase name="XmlEncode/string with control char (x7F)" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Approx.tests.cpp">
- <testCase name="A comparison that uses literals instead of the normal constructor" duration="{duration}"/>
- <testCase name="Absolute margin" duration="{duration}"/>
- <testCase name="Approx setters validate their arguments" duration="{duration}"/>
- <testCase name="Approx with exactly-representable margin" duration="{duration}"/>
- <testCase name="Approximate PI" duration="{duration}"/>
- <testCase name="Approximate comparisons with different epsilons" duration="{duration}"/>
- <testCase name="Approximate comparisons with floats" duration="{duration}"/>
- <testCase name="Approximate comparisons with ints" duration="{duration}"/>
- <testCase name="Approximate comparisons with mixed numeric types" duration="{duration}"/>
- <testCase name="Comparison with explicitly convertible types" duration="{duration}"/>
- <testCase name="Default scale is invisible to comparison" duration="{duration}"/>
- <testCase name="Epsilon only applies to Approx's value" duration="{duration}"/>
- <testCase name="Greater-than inequalities with different epsilons" duration="{duration}"/>
- <testCase name="Less-than inequalities with different epsilons" duration="{duration}"/>
- <testCase name="Some simple comparisons between doubles" duration="{duration}"/>
- <testCase name="Use a custom approx" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/BDD.tests.cpp">
- <testCase name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me" duration="{duration}"/>
- <testCase name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me/When: We get the count/Then: Subsequently values are higher" duration="{duration}"/>
- <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I do this/Then: it should do this" duration="{duration}"/>
- <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I do this/Then: it should do this/And: do that" duration="{duration}"/>
- <testCase name="Scenario: This is a really long scenario name to see how the list command deals with wrapping/Given: A section name that is so long that it cannot fit in a single console width/When: The test headers are printed as part of the normal running of the scenario/Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" duration="{duration}"/>
- <testCase name="Scenario: Vector resizing affects size and capacity/Given: an empty vector" duration="{duration}"/>
- <testCase name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: it is made larger/Then: the size and capacity go up" duration="{duration}"/>
- <testCase name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: it is made larger/Then: the size and capacity go up/And when: it is made smaller again/Then: the size goes down but the capacity stays the same" duration="{duration}"/>
- <testCase name="Scenario: Vector resizing affects size and capacity/Given: an empty vector/When: we reserve more space/Then: The capacity is increased but the size remains the same" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Class.tests.cpp">
- <testCase name="A METHOD_AS_TEST_CASE based test run that fails" duration="{duration}">
- <failure message="REQUIRE(s == &quot;world&quot;)">
-FAILED:
- REQUIRE( s == "world" )
-with expansion:
- "hello" == "world"
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A METHOD_AS_TEST_CASE based test run that succeeds" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo&lt;float>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>::m_a.size() == 1)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo&lt;int>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>::m_a.size() == 1)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector&lt;float>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>::m_a.size() == 1)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector&lt;int>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>::m_a.size() == 1)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>::m_a.size() == 1 )
-with expansion:
- 0 == 1
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo&lt;float>" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo&lt;int>" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector&lt;float>" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector&lt;int>" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2&lt;float, 6>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 6 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2&lt;int, 2>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 2 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array&lt;float, 6>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 6 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array&lt;int, 2>" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2)">
-FAILED:
- REQUIRE( Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2 )
-with expansion:
- 2 &lt; 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2&lt;float,6>" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2&lt;int,2>" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array&lt;float,6>" duration="{duration}"/>
- <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array&lt;int,2>" duration="{duration}"/>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture&lt;TestType>::m_a == 2)">
-FAILED:
- REQUIRE( Template_Fixture&lt;TestType>::m_a == 2 )
-with expansion:
- 1.0 == 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture&lt;TestType>::m_a == 2)">
-FAILED:
- REQUIRE( Template_Fixture&lt;TestType>::m_a == 2 )
-with expansion:
- 1.0f == 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" duration="{duration}">
- <failure message="REQUIRE(Template_Fixture&lt;TestType>::m_a == 2)">
-FAILED:
- REQUIRE( Template_Fixture&lt;TestType>::m_a == 2 )
-with expansion:
- 1 == 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" duration="{duration}"/>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" duration="{duration}"/>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" duration="{duration}"/>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1" duration="{duration}">
- <failure message="REQUIRE(Nttp_Fixture&lt;V>::value == 0)">
-FAILED:
- REQUIRE( Nttp_Fixture&lt;V>::value == 0 )
-with expansion:
- 1 == 0
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3" duration="{duration}">
- <failure message="REQUIRE(Nttp_Fixture&lt;V>::value == 0)">
-FAILED:
- REQUIRE( Nttp_Fixture&lt;V>::value == 0 )
-with expansion:
- 3 == 0
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6" duration="{duration}">
- <failure message="REQUIRE(Nttp_Fixture&lt;V>::value == 0)">
-FAILED:
- REQUIRE( Nttp_Fixture&lt;V>::value == 0 )
-with expansion:
- 6 == 0
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1" duration="{duration}"/>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3" duration="{duration}"/>
- <testCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6" duration="{duration}"/>
- <testCase name="A TEST_CASE_METHOD based test run that fails" duration="{duration}">
- <failure message="REQUIRE(m_a == 2)">
-FAILED:
- REQUIRE( m_a == 2 )
-with expansion:
- 1 == 2
-Class.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A TEST_CASE_METHOD based test run that succeeds" duration="{duration}"/>
- <testCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" duration="{duration}"/>
- <testCase name="Template test case method with test types specified inside std::tuple - MyTypes - 1" duration="{duration}"/>
- <testCase name="Template test case method with test types specified inside std::tuple - MyTypes - 2" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Compilation.tests.cpp">
- <testCase name="#1027" duration="{duration}"/>
- <testCase name="#1027: Bitfields can be captured" duration="{duration}"/>
- <testCase name="#1147" duration="{duration}"/>
- <testCase name="#1238" duration="{duration}"/>
- <testCase name="#1245" duration="{duration}"/>
- <testCase name="#1403" duration="{duration}"/>
- <testCase name="#1548" duration="{duration}"/>
- <testCase name="#809" duration="{duration}"/>
- <testCase name="#833" duration="{duration}"/>
- <testCase name="#872" duration="{duration}"/>
- <testCase name="Optionally static assertions" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Condition.tests.cpp">
- <testCase name="'Not' checks that should fail" duration="{duration}">
- <failure message="CHECK(false != false)">
-FAILED:
- CHECK( false != false )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(true != true)">
-FAILED:
- CHECK( true != true )
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(!true)">
-FAILED:
- CHECK( !true )
-with expansion:
- false
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_FALSE(!(true))">
-FAILED:
- CHECK_FALSE( true )
-with expansion:
- !true
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(!trueValue)">
-FAILED:
- CHECK( !trueValue )
-with expansion:
- false
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_FALSE(!(trueValue))">
-FAILED:
- CHECK_FALSE( trueValue )
-with expansion:
- !true
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(!(1 == 1))">
-FAILED:
- CHECK( !(1 == 1) )
-with expansion:
- false
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_FALSE(!(1 == 1))">
-FAILED:
- CHECK_FALSE( 1 == 1 )
-Condition.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="'Not' checks that should succeed" duration="{duration}"/>
- <testCase name="Comparisons between ints where one side is computed" duration="{duration}"/>
- <testCase name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" duration="{duration}"/>
- <testCase name="Comparisons with int literals don't warn when mixing signed/ unsigned" duration="{duration}"/>
- <testCase name="Equality checks that should fail" duration="{duration}">
- <skipped message="CHECK(data.int_seven == 6)">
-FAILED:
- CHECK( data.int_seven == 6 )
-with expansion:
- 7 == 6
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.int_seven == 8)">
-FAILED:
- CHECK( data.int_seven == 8 )
-with expansion:
- 7 == 8
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.int_seven == 0)">
-FAILED:
- CHECK( data.int_seven == 0 )
-with expansion:
- 7 == 0
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.float_nine_point_one == Approx( 9.11f ))">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.11f ) )
-with expansion:
- 9.1f == Approx( 9.1099996567 )
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.float_nine_point_one == Approx( 9.0f ))">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 9.0f ) )
-with expansion:
- 9.1f == Approx( 9.0 )
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.float_nine_point_one == Approx( 1 ))">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 1 ) )
-with expansion:
- 9.1f == Approx( 1.0 )
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.float_nine_point_one == Approx( 0 ))">
-FAILED:
- CHECK( data.float_nine_point_one == Approx( 0 ) )
-with expansion:
- 9.1f == Approx( 0.0 )
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.double_pi == Approx( 3.1415 ))">
-FAILED:
- CHECK( data.double_pi == Approx( 3.1415 ) )
-with expansion:
- 3.1415926535 == Approx( 3.1415 )
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.str_hello == &quot;goodbye&quot;)">
-FAILED:
- CHECK( data.str_hello == "goodbye" )
-with expansion:
- "hello" == "goodbye"
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.str_hello == &quot;hell&quot;)">
-FAILED:
- CHECK( data.str_hello == "hell" )
-with expansion:
- "hello" == "hell"
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.str_hello == &quot;hello1&quot;)">
-FAILED:
- CHECK( data.str_hello == "hello1" )
-with expansion:
- "hello" == "hello1"
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.str_hello.size() == 6)">
-FAILED:
- CHECK( data.str_hello.size() == 6 )
-with expansion:
- 5 == 6
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(x == Approx( 1.301 ))">
-FAILED:
- CHECK( x == Approx( 1.301 ) )
-with expansion:
- 1.3 == Approx( 1.301 )
-Condition.tests.cpp:<line number>
- </skipped>
- </testCase>
- <testCase name="Equality checks that should succeed" duration="{duration}"/>
- <testCase name="Inequality checks that should fail" duration="{duration}">
- <skipped message="CHECK(data.int_seven != 7)">
-FAILED:
- CHECK( data.int_seven != 7 )
-with expansion:
- 7 != 7
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.float_nine_point_one != Approx( 9.1f ))">
-FAILED:
- CHECK( data.float_nine_point_one != Approx( 9.1f ) )
-with expansion:
- 9.1f != Approx( 9.1000003815 )
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.double_pi != Approx( 3.1415926535 ))">
-FAILED:
- CHECK( data.double_pi != Approx( 3.1415926535 ) )
-with expansion:
- 3.1415926535 != Approx( 3.1415926535 )
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.str_hello != &quot;hello&quot;)">
-FAILED:
- CHECK( data.str_hello != "hello" )
-with expansion:
- "hello" != "hello"
-Condition.tests.cpp:<line number>
- </skipped>
- <skipped message="CHECK(data.str_hello.size() != 5)">
-FAILED:
- CHECK( data.str_hello.size() != 5 )
-with expansion:
- 5 != 5
-Condition.tests.cpp:<line number>
- </skipped>
- </testCase>
- <testCase name="Inequality checks that should succeed" duration="{duration}"/>
- <testCase name="Ordering comparison checks that should fail" duration="{duration}">
- <failure message="CHECK(data.int_seven > 7)">
-FAILED:
- CHECK( data.int_seven > 7 )
-with expansion:
- 7 > 7
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.int_seven &lt; 7)">
-FAILED:
- CHECK( data.int_seven &lt; 7 )
-with expansion:
- 7 &lt; 7
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.int_seven > 8)">
-FAILED:
- CHECK( data.int_seven > 8 )
-with expansion:
- 7 > 8
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.int_seven &lt; 6)">
-FAILED:
- CHECK( data.int_seven &lt; 6 )
-with expansion:
- 7 &lt; 6
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.int_seven &lt; 0)">
-FAILED:
- CHECK( data.int_seven &lt; 0 )
-with expansion:
- 7 &lt; 0
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.int_seven &lt; -1)">
-FAILED:
- CHECK( data.int_seven &lt; -1 )
-with expansion:
- 7 &lt; -1
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.int_seven >= 8)">
-FAILED:
- CHECK( data.int_seven >= 8 )
-with expansion:
- 7 >= 8
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.int_seven &lt;= 6)">
-FAILED:
- CHECK( data.int_seven &lt;= 6 )
-with expansion:
- 7 &lt;= 6
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.float_nine_point_one &lt; 9)">
-FAILED:
- CHECK( data.float_nine_point_one &lt; 9 )
-with expansion:
- 9.1f &lt; 9
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.float_nine_point_one > 10)">
-FAILED:
- CHECK( data.float_nine_point_one > 10 )
-with expansion:
- 9.1f > 10
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.float_nine_point_one > 9.2)">
-FAILED:
- CHECK( data.float_nine_point_one > 9.2 )
-with expansion:
- 9.1f > 9.2
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello > &quot;hello&quot;)">
-FAILED:
- CHECK( data.str_hello > "hello" )
-with expansion:
- "hello" > "hello"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello &lt; &quot;hello&quot;)">
-FAILED:
- CHECK( data.str_hello &lt; "hello" )
-with expansion:
- "hello" &lt; "hello"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello > &quot;hellp&quot;)">
-FAILED:
- CHECK( data.str_hello > "hellp" )
-with expansion:
- "hello" > "hellp"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello > &quot;z&quot;)">
-FAILED:
- CHECK( data.str_hello > "z" )
-with expansion:
- "hello" > "z"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello &lt; &quot;hellm&quot;)">
-FAILED:
- CHECK( data.str_hello &lt; "hellm" )
-with expansion:
- "hello" &lt; "hellm"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello &lt; &quot;a&quot;)">
-FAILED:
- CHECK( data.str_hello &lt; "a" )
-with expansion:
- "hello" &lt; "a"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello >= &quot;z&quot;)">
-FAILED:
- CHECK( data.str_hello >= "z" )
-with expansion:
- "hello" >= "z"
-Condition.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(data.str_hello &lt;= &quot;a&quot;)">
-FAILED:
- CHECK( data.str_hello &lt;= "a" )
-with expansion:
- "hello" &lt;= "a"
-Condition.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Ordering comparison checks that should succeed" duration="{duration}"/>
- <testCase name="Pointers can be compared to null" duration="{duration}"/>
- <testCase name="comparisons between const int variables" duration="{duration}"/>
- <testCase name="comparisons between int variables" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Decomposition.tests.cpp">
- <testCase name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" duration="{duration}"/>
- <testCase name="Reconstruction should be based on stringification: #914" duration="{duration}">
- <failure message="CHECK(truthy(false))">
-FAILED:
- CHECK( truthy(false) )
-with expansion:
- Hey, its truthy!
-Decomposition.tests.cpp:<line number>
- </failure>
- </testCase>
- </file>
- <file path="projects/<exe-name>/UsageTests/EnumToString.tests.cpp">
- <testCase name="Enums can quickly have stringification enabled using REGISTER_ENUM" duration="{duration}"/>
- <testCase name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" duration="{duration}"/>
- <testCase name="toString(enum class w/operator&lt;&lt;)" duration="{duration}"/>
- <testCase name="toString(enum class)" duration="{duration}"/>
- <testCase name="toString(enum w/operator&lt;&lt;)" duration="{duration}"/>
- <testCase name="toString(enum)" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Exception.tests.cpp">
- <testCase name="#748 - captures with unexpected exceptions/outside assertions" duration="{duration}">
- <skipped message="TEST_CASE()">
-FAILED:
-expected exception
-answer := 42
-Exception.tests.cpp:<line number>
- </skipped>
- </testCase>
- <testCase name="#748 - captures with unexpected exceptions/inside REQUIRE_NOTHROW" duration="{duration}">
- <skipped message="REQUIRE_NOTHROW(thisThrows())">
-FAILED:
- REQUIRE_NOTHROW( thisThrows() )
-expected exception
-answer := 42
-Exception.tests.cpp:<line number>
- </skipped>
- </testCase>
- <testCase name="#748 - captures with unexpected exceptions/inside REQUIRE_THROWS" duration="{duration}"/>
- <testCase name="An unchecked exception reports the line of the last assertion" duration="{duration}">
- <error message="({Unknown expression after the reported line})">
-FAILED:
- {Unknown expression after the reported line}
-unexpected exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Custom exceptions can be translated when testing for nothrow" duration="{duration}">
- <error message="REQUIRE_NOTHROW(throwCustom())">
-FAILED:
- REQUIRE_NOTHROW( throwCustom() )
-custom exception - not std
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Custom exceptions can be translated when testing for throwing as something else" duration="{duration}">
- <error message="REQUIRE_THROWS_AS(throwCustom(), std::exception)">
-FAILED:
- REQUIRE_THROWS_AS( throwCustom(), std::exception )
-custom exception - not std
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Custom std-exceptions can be custom translated" duration="{duration}">
- <error message="TEST_CASE()">
-FAILED:
-custom std exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Exception messages can be tested for/exact match" duration="{duration}"/>
- <testCase name="Exception messages can be tested for/different case" duration="{duration}"/>
- <testCase name="Exception messages can be tested for/wildcarded" duration="{duration}"/>
- <testCase name="Expected exceptions that don't throw or unexpected exceptions fail the test" duration="{duration}">
- <error message="CHECK_THROWS_AS(thisThrows(), std::string)">
-FAILED:
- CHECK_THROWS_AS( thisThrows(), std::string )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- <failure message="CHECK_THROWS_AS(thisDoesntThrow(), std::domain_error)">
-FAILED:
- CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )
-Exception.tests.cpp:<line number>
- </failure>
- <error message="CHECK_NOTHROW(thisThrows())">
-FAILED:
- CHECK_NOTHROW( thisThrows() )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Mismatching exception messages failing the test" duration="{duration}">
- <failure message="REQUIRE_THROWS_WITH(thisThrows(), &quot;should fail&quot;)">
-FAILED:
- REQUIRE_THROWS_WITH( thisThrows(), "should fail" )
-with expansion:
- "expected exception" equals: "should fail"
-Exception.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Non-std exceptions can be translated" duration="{duration}">
- <error message="TEST_CASE()">
-FAILED:
-custom exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Thrown string literals are translated" duration="{duration}">
- <error message="TEST_CASE()">
-FAILED:
-For some reason someone is throwing a string literal!
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Unexpected exceptions can be translated" duration="{duration}">
- <error message="TEST_CASE()">
-FAILED:
-3.14
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="When checked exceptions are thrown they can be expected or unexpected" duration="{duration}"/>
- <testCase name="When unchecked exceptions are thrown directly they are always failures" duration="{duration}">
- <error message="TEST_CASE()">
-FAILED:
-unexpected exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="When unchecked exceptions are thrown during a CHECK the test should continue" duration="{duration}">
- <error message="CHECK(thisThrows() == 0)">
-FAILED:
- CHECK( thisThrows() == 0 )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="When unchecked exceptions are thrown during a REQUIRE the test should abort fail" duration="{duration}">
- <error message="REQUIRE(thisThrows() == 0)">
-FAILED:
- REQUIRE( thisThrows() == 0 )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="When unchecked exceptions are thrown from functions they are always failures" duration="{duration}">
- <error message="CHECK(thisThrows() == 0)">
-FAILED:
- CHECK( thisThrows() == 0 )
-expected exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="When unchecked exceptions are thrown from sections they are always failures/section name" duration="{duration}">
- <error message="TEST_CASE()">
-FAILED:
-unexpected exception
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="thrown std::strings are translated" duration="{duration}">
- <error message="TEST_CASE()">
-FAILED:
-Why would you throw a std::string?
-Exception.tests.cpp:<line number>
- </error>
- </testCase>
- </file>
- <file path="projects/<exe-name>/UsageTests/Generators.tests.cpp">
- <testCase name="3x3x3 ints" duration="{duration}"/>
- <testCase name="Copy and then generate a range/from var and iterators" duration="{duration}"/>
- <testCase name="Copy and then generate a range/From a temporary container" duration="{duration}"/>
- <testCase name="Copy and then generate a range/Final validation" duration="{duration}"/>
- <testCase name="Generators -- adapters/Filtering by predicate/Basic usage" duration="{duration}"/>
- <testCase name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" duration="{duration}"/>
- <testCase name="Generators -- adapters/Shortening a range" duration="{duration}"/>
- <testCase name="Generators -- adapters/Transforming elements/Same type" duration="{duration}"/>
- <testCase name="Generators -- adapters/Transforming elements/Different type" duration="{duration}"/>
- <testCase name="Generators -- adapters/Transforming elements/Different deduced type" duration="{duration}"/>
- <testCase name="Generators -- adapters/Repeating a generator" duration="{duration}"/>
- <testCase name="Generators -- adapters/Chunking a generator into sized pieces/Number of elements in source is divisible by chunk size" duration="{duration}"/>
- <testCase name="Generators -- adapters/Chunking a generator into sized pieces/Number of elements in source is not divisible by chunk size" duration="{duration}"/>
- <testCase name="Generators -- adapters/Chunking a generator into sized pieces/Chunk size of zero" duration="{duration}"/>
- <testCase name="Generators -- adapters/Chunking a generator into sized pieces/Throws on too small generators" duration="{duration}"/>
- <testCase name="Generators -- simple/one" duration="{duration}"/>
- <testCase name="Generators -- simple/two" duration="{duration}"/>
- <testCase name="Nested generators and captured variables" duration="{duration}"/>
- <testCase name="strlen3" duration="{duration}"/>
- <testCase name="tables" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Matchers.tests.cpp">
- <testCase name="Arbitrary predicate matcher/Function pointer" duration="{duration}"/>
- <testCase name="Arbitrary predicate matcher/Lambdas + different type" duration="{duration}"/>
- <testCase name="Composed matchers are distinct" duration="{duration}"/>
- <testCase name="Contains string matcher" duration="{duration}">
- <failure message="CHECK_THAT(testStringForMatching(), Contains(&quot;not there&quot;, Catch::CaseSensitive::No))">
-FAILED:
- CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(testStringForMatching(), Contains(&quot;STRING&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), Contains("STRING") )
-with expansion:
- "this string contains 'abc' as a substring" contains: "STRING"
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="EndsWith string matcher" duration="{duration}">
- <failure message="CHECK_THAT(testStringForMatching(), EndsWith(&quot;Substring&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("Substring") )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "Substring"
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(testStringForMatching(), EndsWith(&quot;this&quot;, Catch::CaseSensitive::No))">
-FAILED:
- CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" ends with: "this" (case insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Equals" duration="{duration}"/>
- <testCase name="Equals string matcher" duration="{duration}">
- <failure message="CHECK_THAT(testStringForMatching(), Equals(&quot;this string contains 'ABC' as a substring&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring"
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(testStringForMatching(), Equals(&quot;something else&quot;, Catch::CaseSensitive::No))">
-FAILED:
- CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" equals: "something else" (case insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Exception matchers that fail/No exception" duration="{duration}">
- <failure message="CHECK_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1})">
-FAILED:
- CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="REQUIRE_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1})">
-FAILED:
- REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Exception matchers that fail/Type mismatch" duration="{duration}">
- <error message="CHECK_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1})">
-FAILED:
- CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-Unknown exception
-Matchers.tests.cpp:<line number>
- </error>
- <error message="REQUIRE_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1})">
-FAILED:
- REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )
-Unknown exception
-Matchers.tests.cpp:<line number>
- </error>
- </testCase>
- <testCase name="Exception matchers that fail/Contents are wrong" duration="{duration}">
- <failure message="CHECK_THROWS_MATCHES(throwsSpecialException(3), SpecialException, ExceptionMatcher{1})">
-FAILED:
- CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="REQUIRE_THROWS_MATCHES(throwsSpecialException(4), SpecialException, ExceptionMatcher{1})">
-FAILED:
- REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} )
-with expansion:
- SpecialException::what special exception has value of 1
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Exception matchers that succeed" duration="{duration}"/>
- <testCase name="Exceptions matchers" duration="{duration}"/>
- <testCase name="Floating point matchers: double/Relative" duration="{duration}"/>
- <testCase name="Floating point matchers: double/Relative/Some subnormal values" duration="{duration}"/>
- <testCase name="Floating point matchers: double/Margin" duration="{duration}"/>
- <testCase name="Floating point matchers: double/ULPs" duration="{duration}"/>
- <testCase name="Floating point matchers: double/Composed" duration="{duration}"/>
- <testCase name="Floating point matchers: double/Constructor validation" duration="{duration}"/>
- <testCase name="Floating point matchers: float/Relative" duration="{duration}"/>
- <testCase name="Floating point matchers: float/Relative/Some subnormal values" duration="{duration}"/>
- <testCase name="Floating point matchers: float/Margin" duration="{duration}"/>
- <testCase name="Floating point matchers: float/ULPs" duration="{duration}"/>
- <testCase name="Floating point matchers: float/Composed" duration="{duration}"/>
- <testCase name="Floating point matchers: float/Constructor validation" duration="{duration}"/>
- <testCase name="Matchers can be (AllOf) composed with the &amp;&amp; operator" duration="{duration}"/>
- <testCase name="Matchers can be (AnyOf) composed with the || operator" duration="{duration}"/>
- <testCase name="Matchers can be composed with both &amp;&amp; and ||" duration="{duration}"/>
- <testCase name="Matchers can be composed with both &amp;&amp; and || - failing" duration="{duration}">
- <failure message="CHECK_THAT(testStringForMatching(), (Contains(&quot;string&quot;) || Contains(&quot;different&quot;)) &amp;&amp; Contains(&quot;random&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) &amp;&amp; Contains("random") )
-with expansion:
- "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Matchers can be negated (Not) with the ! operator" duration="{duration}"/>
- <testCase name="Matchers can be negated (Not) with the ! operator - failing" duration="{duration}">
- <failure message="CHECK_THAT(testStringForMatching(), !Contains(&quot;substring&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), !Contains("substring") )
-with expansion:
- "this string contains 'abc' as a substring" not contains: "substring"
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Predicate matcher can accept const char*" duration="{duration}"/>
- <testCase name="Regex string matcher" duration="{duration}">
- <failure message="CHECK_THAT(testStringForMatching(), Matches(&quot;this STRING contains 'abc' as a substring&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(testStringForMatching(), Matches(&quot;contains 'abc' as a substring&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") )
-with expansion:
- "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(testStringForMatching(), Matches(&quot;this string contains 'abc' as a&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") )
-with expansion:
- "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Regression test #1" duration="{duration}"/>
- <testCase name="StartsWith string matcher" duration="{duration}">
- <failure message="CHECK_THAT(testStringForMatching(), StartsWith(&quot;This String&quot;))">
-FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("This String") )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "This String"
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(testStringForMatching(), StartsWith(&quot;string&quot;, Catch::CaseSensitive::No))">
-FAILED:
- CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) )
-with expansion:
- "this string contains 'abc' as a substring" starts with: "string" (case insensitive)
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="String matchers" duration="{duration}"/>
- <testCase name="Vector Approx matcher/Empty vector is roughly equal to an empty vector" duration="{duration}"/>
- <testCase name="Vector Approx matcher/Vectors with elements/A vector is approx equal to itself" duration="{duration}"/>
- <testCase name="Vector Approx matcher/Vectors with elements/Different length" duration="{duration}"/>
- <testCase name="Vector Approx matcher/Vectors with elements/Same length, different elements" duration="{duration}"/>
- <testCase name="Vector Approx matcher -- failing/Empty and non empty vectors are not approx equal" duration="{duration}">
- <failure message="CHECK_THAT(empty, Approx(t1))">
-FAILED:
- CHECK_THAT( empty, Approx(t1) )
-with expansion:
- { } is approx: { 1.0, 2.0 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Vector Approx matcher -- failing/Just different vectors" duration="{duration}">
- <failure message="CHECK_THAT(v1, Approx(v2))">
-FAILED:
- CHECK_THAT( v1, Approx(v2) )
-with expansion:
- { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Vector matchers/Contains (element)" duration="{duration}"/>
- <testCase name="Vector matchers/Contains (vector)" duration="{duration}"/>
- <testCase name="Vector matchers/Contains (element), composed" duration="{duration}"/>
- <testCase name="Vector matchers/Equals" duration="{duration}"/>
- <testCase name="Vector matchers/UnorderedEquals" duration="{duration}"/>
- <testCase name="Vector matchers that fail/Contains (element)" duration="{duration}">
- <failure message="CHECK_THAT(v, VectorContains(-1))">
-FAILED:
- CHECK_THAT( v, VectorContains(-1) )
-with expansion:
- { 1, 2, 3 } Contains: -1
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(empty, VectorContains(1))">
-FAILED:
- CHECK_THAT( empty, VectorContains(1) )
-with expansion:
- { } Contains: 1
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Vector matchers that fail/Contains (vector)" duration="{duration}">
- <failure message="CHECK_THAT(empty, Contains(v))">
-FAILED:
- CHECK_THAT( empty, Contains(v) )
-with expansion:
- { } Contains: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(v, Contains(v2))">
-FAILED:
- CHECK_THAT( v, Contains(v2) )
-with expansion:
- { 1, 2, 3 } Contains: { 1, 2, 4 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Vector matchers that fail/Equals" duration="{duration}">
- <failure message="CHECK_THAT(v, Equals(v2))">
-FAILED:
- CHECK_THAT( v, Equals(v2) )
-with expansion:
- { 1, 2, 3 } Equals: { 1, 2 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(v2, Equals(v))">
-FAILED:
- CHECK_THAT( v2, Equals(v) )
-with expansion:
- { 1, 2 } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(empty, Equals(v))">
-FAILED:
- CHECK_THAT( empty, Equals(v) )
-with expansion:
- { } Equals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(v, Equals(empty))">
-FAILED:
- CHECK_THAT( v, Equals(empty) )
-with expansion:
- { 1, 2, 3 } Equals: { }
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Vector matchers that fail/UnorderedEquals" duration="{duration}">
- <failure message="CHECK_THAT(v, UnorderedEquals(empty))">
-FAILED:
- CHECK_THAT( v, UnorderedEquals(empty) )
-with expansion:
- { 1, 2, 3 } UnorderedEquals: { }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(empty, UnorderedEquals(v))">
-FAILED:
- CHECK_THAT( empty, UnorderedEquals(v) )
-with expansion:
- { } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(permuted, UnorderedEquals(v))">
-FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 1, 3 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- <failure message="CHECK_THAT(permuted, UnorderedEquals(v))">
-FAILED:
- CHECK_THAT( permuted, UnorderedEquals(v) )
-with expansion:
- { 3, 1 } UnorderedEquals: { 1, 2, 3 }
-Matchers.tests.cpp:<line number>
- </failure>
- </testCase>
- </file>
- <file path="projects/<exe-name>/UsageTests/Message.tests.cpp">
- <testCase name="#1455 - INFO and WARN can start with a linebreak" duration="{duration}"/>
- <testCase name="CAPTURE can deal with complex expressions" duration="{duration}"/>
- <testCase name="CAPTURE can deal with complex expressions involving commas" duration="{duration}"/>
- <testCase name="CAPTURE parses string and character constants" duration="{duration}"/>
- <testCase name="FAIL aborts the test" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-This is a failure
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="FAIL does not require an argument" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="FAIL_CHECK does not abort the test" duration="{duration}">
- <failure message="FAIL_CHECK()">
-FAILED:
-This is a failure
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="INFO and WARN do not abort tests" duration="{duration}"/>
- <testCase name="INFO gets logged on failure" duration="{duration}">
- <failure message="REQUIRE(a == 1)">
-FAILED:
- REQUIRE( a == 1 )
-with expansion:
- 2 == 1
-this message should be logged
-so should this
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="INFO gets logged on failure, even if captured before successful assertions" duration="{duration}">
- <failure message="CHECK(a == 1)">
-FAILED:
- CHECK( a == 1 )
-with expansion:
- 2 == 1
-this message may be logged later
-this message should be logged
-Message.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(a == 0)">
-FAILED:
- CHECK( a == 0 )
-with expansion:
- 2 == 0
-this message may be logged later
-this message should be logged
-and this, but later
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="INFO is reset for each loop" duration="{duration}">
- <failure message="REQUIRE(i &lt; 10)">
-FAILED:
- REQUIRE( i &lt; 10 )
-with expansion:
- 10 &lt; 10
-current counter 10
-i := 10
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Output from all sections is reported/one" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-Message from section one
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Output from all sections is reported/two" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-Message from section two
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="SUCCEED counts as a test pass" duration="{duration}"/>
- <testCase name="SUCCEED does not require an argument" duration="{duration}"/>
- <testCase name="Standard output from all sections is reported/two" duration="{duration}"/>
- <testCase name="The NO_FAIL macro reports a failure but does not fail the test" duration="{duration}"/>
- <testCase name="just failure" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-Previous info should not be seen
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="just failure after unscoped info" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-previous unscoped info SHOULD not be seen
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="mix info, unscoped info and warning" duration="{duration}"/>
- <testCase name="not prints unscoped info from previous failures" duration="{duration}">
- <failure message="REQUIRE(false)">
-FAILED:
- REQUIRE( false )
-this SHOULD be seen
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="print unscoped info if passing unscoped info is printed" duration="{duration}"/>
- <testCase name="prints unscoped info on failure" duration="{duration}">
- <failure message="REQUIRE(false)">
-FAILED:
- REQUIRE( false )
-this SHOULD be seen
-this SHOULD also be seen
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="prints unscoped info only for the first assertion" duration="{duration}">
- <failure message="CHECK(false)">
-FAILED:
- CHECK( false )
-this SHOULD be seen only ONCE
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="sends information to INFO" duration="{duration}">
- <failure message="REQUIRE(false)">
-FAILED:
- REQUIRE( false )
-hi
-i := 7
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="stacks unscoped info in loops" duration="{duration}">
- <failure message="CHECK(false)">
-FAILED:
- CHECK( false )
-Count 1 to 3...
-1
-2
-3
-Message.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(false)">
-FAILED:
- CHECK( false )
-Count 4 to 6...
-4
-5
-6
-Message.tests.cpp:<line number>
- </failure>
- </testCase>
- </file>
- <file path="projects/<exe-name>/UsageTests/Misc.tests.cpp">
- <testCase name="# A test name that starts with a #" duration="{duration}"/>
- <testCase name="#1175 - Hidden Test" duration="{duration}"/>
- <testCase name="#835 -- errno should not be touched by Catch" duration="{duration}">
- <skipped message="CHECK(f() == 0)">
-FAILED:
- CHECK( f() == 0 )
-with expansion:
- 1 == 0
-Misc.tests.cpp:<line number>
- </skipped>
- </testCase>
- <testCase name="#961 -- Dynamically created sections should all be reported/Looped section 0" duration="{duration}"/>
- <testCase name="#961 -- Dynamically created sections should all be reported/Looped section 1" duration="{duration}"/>
- <testCase name="#961 -- Dynamically created sections should all be reported/Looped section 2" duration="{duration}"/>
- <testCase name="#961 -- Dynamically created sections should all be reported/Looped section 3" duration="{duration}"/>
- <testCase name="#961 -- Dynamically created sections should all be reported/Looped section 4" duration="{duration}"/>
- <testCase name="A Template product test case - Foo&lt;float>" duration="{duration}"/>
- <testCase name="A Template product test case - Foo&lt;int>" duration="{duration}"/>
- <testCase name="A Template product test case - std::vector&lt;float>" duration="{duration}"/>
- <testCase name="A Template product test case - std::vector&lt;int>" duration="{duration}"/>
- <testCase name="A Template product test case with array signature - Bar&lt;float, 42>" duration="{duration}"/>
- <testCase name="A Template product test case with array signature - Bar&lt;int, 9>" duration="{duration}"/>
- <testCase name="A Template product test case with array signature - std::array&lt;float, 42>" duration="{duration}"/>
- <testCase name="A Template product test case with array signature - std::array&lt;int, 9>" duration="{duration}"/>
- <testCase name="A couple of nested sections followed by a failure" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-to infinity and beyond
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/>
- <testCase name="Factorials are computed" duration="{duration}"/>
- <testCase name="ManuallyRegistered" duration="{duration}"/>
- <testCase name="Nice descriptive name" duration="{duration}"/>
- <testCase name="Product with differing arities - std::tuple&lt;int, double, float>" duration="{duration}"/>
- <testCase name="Product with differing arities - std::tuple&lt;int, double>" duration="{duration}"/>
- <testCase name="Product with differing arities - std::tuple&lt;int>" duration="{duration}"/>
- <testCase name="Sends stuff to stdout and stderr" duration="{duration}"/>
- <testCase name="Tabs and newlines show in output" duration="{duration}">
- <failure message="CHECK(s1 == s2)">
-FAILED:
- CHECK( s1 == s2 )
-with expansion:
- "if ($b == 10) {
- $a = 20;
-}"
-==
-"if ($b == 10) {
- $a = 20;
-}
-"
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0" duration="{duration}"/>
- <testCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1" duration="{duration}"/>
- <testCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0" duration="{duration}"/>
- <testCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1" duration="{duration}"/>
- <testCase name="Template test case with test types specified inside std::tuple - MyTypes - 0" duration="{duration}"/>
- <testCase name="Template test case with test types specified inside std::tuple - MyTypes - 1" duration="{duration}"/>
- <testCase name="Template test case with test types specified inside std::tuple - MyTypes - 2" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - float" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - float/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - float/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - float/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - float/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - float/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - int" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - int/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - int/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - int/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - int/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - int/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::string" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::string/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::string/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::string/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::string/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::string/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - float,4" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - float,4/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - float,4/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - float,4/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - float,4/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - float,4/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - int,5" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - int,5/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - int,5/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - int,5/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - int,5/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - int,5/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="This test 'should' fail but doesn't" duration="{duration}"/>
- <testCase name="atomic if" duration="{duration}"/>
- <testCase name="checkedElse" duration="{duration}"/>
- <testCase name="checkedElse, failing" duration="{duration}">
- <failure message="CHECKED_ELSE(flag)">
-FAILED:
- CHECKED_ELSE( flag )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="REQUIRE(testCheckedElse( false ))">
-FAILED:
- REQUIRE( testCheckedElse( false ) )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="checkedIf" duration="{duration}"/>
- <testCase name="checkedIf, failing" duration="{duration}">
- <failure message="CHECKED_IF(flag)">
-FAILED:
- CHECKED_IF( flag )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="REQUIRE(testCheckedIf( false ))">
-FAILED:
- REQUIRE( testCheckedIf( false ) )
-with expansion:
- false
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="even more nested SECTION tests/c/d (leaf)" duration="{duration}"/>
- <testCase name="even more nested SECTION tests/c/e (leaf)" duration="{duration}"/>
- <testCase name="even more nested SECTION tests/f (leaf)" duration="{duration}"/>
- <testCase name="long long" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 0" duration="{duration}">
- <failure message="CHECK(b > a)">
-FAILED:
- CHECK( b > a )
-with expansion:
- 0 > 1
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="looped SECTION tests/b is currently: 1" duration="{duration}">
- <failure message="CHECK(b > a)">
-FAILED:
- CHECK( b > a )
-with expansion:
- 1 > 1
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="looped SECTION tests/b is currently: 2" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 3" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 4" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 5" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 6" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 7" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 8" duration="{duration}"/>
- <testCase name="looped SECTION tests/b is currently: 9" duration="{duration}"/>
- <testCase name="looped tests" duration="{duration}">
- <failure message="CHECK(( fib[i] % 2 ) == 0)">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[0] (1) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(( fib[i] % 2 ) == 0)">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[1] (1) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(( fib[i] % 2 ) == 0)">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[3] (3) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(( fib[i] % 2 ) == 0)">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[4] (5) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(( fib[i] % 2 ) == 0)">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[6] (13) is even
-Misc.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(( fib[i] % 2 ) == 0)">
-FAILED:
- CHECK( ( fib[i] % 2 ) == 0 )
-with expansion:
- 1 == 0
-Testing if fib[7] (21) is even
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="more nested SECTION tests/equal/doesn't equal" duration="{duration}">
- <failure message="REQUIRE(a == b)">
-FAILED:
- REQUIRE( a == b )
-with expansion:
- 1 == 2
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="more nested SECTION tests/doesn't equal/not equal" duration="{duration}"/>
- <testCase name="more nested SECTION tests/doesn't equal/less than" duration="{duration}"/>
- <testCase name="nested SECTION tests/doesn't equal" duration="{duration}"/>
- <testCase name="nested SECTION tests/doesn't equal/not equal" duration="{duration}"/>
- <testCase name="not allowed" duration="{duration}"/>
- <testCase name="null strings" duration="{duration}"/>
- <testCase name="random SECTION tests/doesn't equal" duration="{duration}"/>
- <testCase name="random SECTION tests/not equal" duration="{duration}"/>
- <testCase name="send a single char to INFO" duration="{duration}">
- <failure message="REQUIRE(false)">
-FAILED:
- REQUIRE( false )
-3
-Misc.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="toString on const wchar_t const pointer returns the string contents" duration="{duration}"/>
- <testCase name="toString on const wchar_t pointer returns the string contents" duration="{duration}"/>
- <testCase name="toString on wchar_t const pointer returns the string contents" duration="{duration}"/>
- <testCase name="toString on wchar_t returns the string contents" duration="{duration}"/>
- <testCase name="vectors can be sized and resized" duration="{duration}"/>
- <testCase name="vectors can be sized and resized/resizing bigger changes size and capacity" duration="{duration}"/>
- <testCase name="vectors can be sized and resized/resizing smaller changes size but not capacity" duration="{duration}"/>
- <testCase name="vectors can be sized and resized/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/>
- <testCase name="vectors can be sized and resized/reserving bigger changes capacity but not size" duration="{duration}"/>
- <testCase name="vectors can be sized and resized/reserving smaller does not change size or capacity" duration="{duration}"/>
- <testCase name="xmlentitycheck/embedded xml: &lt;test>it should be possible to embed xml characters, such as &lt;, &quot; or &amp;, or even whole &lt;xml>documents&lt;/xml> within an attribute&lt;/test>" duration="{duration}"/>
- <testCase name="xmlentitycheck/encoded chars: these should all be encoded: &amp;&amp;&amp;&quot;&quot;&quot;&lt;&lt;&lt;&amp;&quot;&lt;&lt;&amp;&quot;" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp">
- <testCase name="Stringifying std::chrono::duration helpers" duration="{duration}"/>
- <testCase name="Stringifying std::chrono::duration with weird ratios" duration="{duration}"/>
- <testCase name="Stringifying std::chrono::time_point&lt;system_clock>" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp">
- <testCase name="Capture and info messages/Capture should stringify like assertions" duration="{duration}"/>
- <testCase name="Capture and info messages/Info should NOT stringify the way assertions do" duration="{duration}"/>
- <testCase name="Character pretty printing/Specifically escaped" duration="{duration}"/>
- <testCase name="Character pretty printing/General chars" duration="{duration}"/>
- <testCase name="Character pretty printing/Low ASCII" duration="{duration}"/>
- <testCase name="Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified" duration="{duration}"/>
- <testCase name="Precision of floating point stringification can be set/Floats" duration="{duration}"/>
- <testCase name="Precision of floating point stringification can be set/Double" duration="{duration}"/>
- <testCase name="Static arrays are convertible to string/Single item" duration="{duration}"/>
- <testCase name="Static arrays are convertible to string/Multiple" duration="{duration}"/>
- <testCase name="Static arrays are convertible to string/Non-trivial inner items" duration="{duration}"/>
- <testCase name="std::map is convertible string/empty" duration="{duration}"/>
- <testCase name="std::map is convertible string/single item" duration="{duration}"/>
- <testCase name="std::map is convertible string/several items" duration="{duration}"/>
- <testCase name="std::set is convertible string/empty" duration="{duration}"/>
- <testCase name="std::set is convertible string/single item" duration="{duration}"/>
- <testCase name="std::set is convertible string/several items" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp">
- <testCase name="pair&lt;pair&lt;int,const char *,pair&lt;std::string,int> > -> toString" duration="{duration}"/>
- <testCase name="std::pair&lt;int,const std::string> -> toString" duration="{duration}"/>
- <testCase name="std::pair&lt;int,std::string> -> toString" duration="{duration}"/>
- <testCase name="std::vector&lt;std::pair&lt;std::string,int> > -> toString" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp">
- <testCase name="tuple&lt;>" duration="{duration}"/>
- <testCase name="tuple&lt;float,int>" duration="{duration}"/>
- <testCase name="tuple&lt;int>" duration="{duration}"/>
- <testCase name="tuple&lt;0,int,const char *>" duration="{duration}"/>
- <testCase name="tuple&lt;string,string>" duration="{duration}"/>
- <testCase name="tuple&lt;tuple&lt;int>,tuple&lt;>,float>" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp">
- <testCase name="array&lt;int, N> -> toString" duration="{duration}"/>
- <testCase name="vec&lt;vec&lt;string,alloc>> -> toString" duration="{duration}"/>
- <testCase name="vector&lt;bool> -> toString" duration="{duration}"/>
- <testCase name="vector&lt;int,allocator> -> toString" duration="{duration}"/>
- <testCase name="vector&lt;int> -> toString" duration="{duration}"/>
- <testCase name="vector&lt;string> -> toString" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp">
- <testCase name="stringify ranges" duration="{duration}"/>
- <testCase name="stringify( has_maker )" duration="{duration}"/>
- <testCase name="stringify( has_maker_and_operator )" duration="{duration}"/>
- <testCase name="stringify( has_neither )" duration="{duration}"/>
- <testCase name="stringify( has_operator )" duration="{duration}"/>
- <testCase name="stringify( has_template_operator )" duration="{duration}"/>
- <testCase name="stringify( vectors&lt;has_maker> )" duration="{duration}"/>
- <testCase name="stringify( vectors&lt;has_maker_and_operator> )" duration="{duration}"/>
- <testCase name="stringify( vectors&lt;has_operator> )" duration="{duration}"/>
- </file>
- <file path="projects/<exe-name>/UsageTests/Tricky.tests.cpp">
- <testCase name="#1514: stderr/stdout is not captured in tests aborted by an exception" duration="{duration}">
- <failure message="FAIL()">
-FAILED:
-1514
-Tricky.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="(unimplemented) static bools can be evaluated/compare to true" duration="{duration}"/>
- <testCase name="(unimplemented) static bools can be evaluated/compare to false" duration="{duration}"/>
- <testCase name="(unimplemented) static bools can be evaluated/negation" duration="{duration}"/>
- <testCase name="(unimplemented) static bools can be evaluated/double negation" duration="{duration}"/>
- <testCase name="(unimplemented) static bools can be evaluated/direct" duration="{duration}"/>
- <testCase name="A failing expression with a non streamable type is still captured" duration="{duration}">
- <failure message="CHECK(&amp;o1 == &amp;o2)">
-FAILED:
- CHECK( &amp;o1 == &amp;o2 )
-with expansion:
- 0x<hex digits> == 0x<hex digits>
-Tricky.tests.cpp:<line number>
- </failure>
- <failure message="CHECK(o1 == o2)">
-FAILED:
- CHECK( o1 == o2 )
-with expansion:
- {?} == {?}
-Tricky.tests.cpp:<line number>
- </failure>
- </testCase>
- <testCase name="An expression with side-effects should only be evaluated once" duration="{duration}"/>
- <testCase name="Assertions then sections" duration="{duration}"/>
- <testCase name="Assertions then sections/A section" duration="{duration}"/>
- <testCase name="Assertions then sections/A section/Another section" duration="{duration}"/>
- <testCase name="Assertions then sections/A section/Another other section" duration="{duration}"/>
- <testCase name="Commas in various macros are allowed" duration="{duration}"/>
- <testCase name="Comparing function pointers" duration="{duration}"/>
- <testCase name="Objects that evaluated in boolean contexts can be checked" duration="{duration}"/>
- <testCase name="Test enum bit values" duration="{duration}"/>
- <testCase name="Where the LHS is not a simple value" duration="{duration}"/>
- <testCase name="Where there is more to the expression after the RHS" duration="{duration}"/>
- <testCase name="X/level/0/a" duration="{duration}"/>
- <testCase name="X/level/0/b" duration="{duration}"/>
- <testCase name="X/level/1/a" duration="{duration}"/>
- <testCase name="X/level/1/b" duration="{duration}"/>
- <testCase name="boolean member" duration="{duration}"/>
- <testCase name="non streamable - with conv. op" duration="{duration}"/>
- <testCase name="non-copyable objects" duration="{duration}"/>
- <testCase name="null_ptr" duration="{duration}"/>
- <testCase name="pointer to class" duration="{duration}"/>
- <testCase name="string literals of different sizes can be compared" duration="{duration}">
- <failure message="REQUIRE(std::string( &quot;first&quot; ) == &quot;second&quot;)">
-FAILED:
- REQUIRE( std::string( "first" ) == "second" )
-with expansion:
- "first" == "second"
-Tricky.tests.cpp:<line number>
- </failure>
- </testCase>
- </file>
- <file path="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp">
- <testCase name="Anonymous test case 1" duration="{duration}"/>
- <testCase name="Test case with one argument" duration="{duration}"/>
- <testCase name="Variadic macros/Section with one argument" duration="{duration}"/>
- </file>
-</testExecutions>
diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt
deleted file mode 100644
index 4eed7125..00000000
--- a/projects/SelfTest/Baselines/xml.sw.approved.txt
+++ /dev/null
@@ -1,16043 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Catch name="<exe-name>" filters="~[!nonportable]~[!benchmark]~[approvals]">
- <Randomness seed="1"/>
- <Group name="<exe-name>">
- <TestCase name="# A test name that starts with a #" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" tags="[Decomposition]" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
- <Original>
- fptr == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
- <Original>
- fptr == 0l
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1027" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- y.v == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- 0 == y.v
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1027: Bitfields can be captured" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- y.v == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- 0 == y.v
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1147" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- t1 == t2
- </Original>
- <Expanded>
- {?} == {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- t1 != t2
- </Original>
- <Expanded>
- {?} != {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- t1 &lt; t2
- </Original>
- <Expanded>
- {?} &lt; {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- t1 > t2
- </Original>
- <Expanded>
- {?} > {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- t1 &lt;= t2
- </Original>
- <Expanded>
- {?} &lt;= {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- t1 >= t2
- </Original>
- <Expanded>
- {?} >= {?}
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1175 - Hidden Test" tags="[!hide][.]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1238" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Info>
- uarr := "123"
- </Info>
- <Info>
- sarr := "456"
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- std::memcmp(uarr, "123", sizeof(uarr)) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Info>
- uarr := "123"
- </Info>
- <Info>
- sarr := "456"
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- std::memcmp(sarr, "456", sizeof(sarr)) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1245" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1403" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- h1 == h2
- </Original>
- <Expanded>
- [1403 helper] == [1403 helper]
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#1455 - INFO and WARN can start with a linebreak" tags="[!hide][.][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
-
-This info message starts with a linebreak
- </Info>
- <Warning>
-
-This warning message starts with a linebreak
- </Warning>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="#1514: stderr/stdout is not captured in tests aborted by an exception" tags="[!hide][.][output-capture][regression]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- 1514
- </Failure>
- <OverallResult success="false">
- <StdOut>
-This would not be caught previously
- </StdOut>
- <StdErr>
-Nor would this
- </StdErr>
- </OverallResult>
- </TestCase>
- <TestCase name="#1548" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- std::is_same&lt;TypeList&lt;int>, TypeList&lt;int>>::value
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#748 - captures with unexpected exceptions" tags="[!hide][!shouldfail][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Section name="outside assertions" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Info>
- answer := 42
- </Info>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- expected exception
- </Exception>
- <OverallResults successes="0" failures="0" expectedFailures="1"/>
- </Section>
- <Section name="inside REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Info>
- answer := 42
- </Info>
- <Expression success="false" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows()
- </Original>
- <Expanded>
- thisThrows()
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- expected exception
- </Exception>
- </Expression>
- <OverallResults successes="0" failures="0" expectedFailures="1"/>
- </Section>
- <Section name="inside REQUIRE_THROWS" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Info>
- answer := 42
- </Info>
- <Expression success="true" type="REQUIRE_THROWS" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows()
- </Original>
- <Expanded>
- thisThrows()
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#809" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- 42 == f
- </Original>
- <Expanded>
- 42 == {?}
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#833" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- a == t
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- a == t
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- throws_int(true)
- </Original>
- <Expanded>
- throws_int(true)
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THROWS_AS" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- throws_int(true), int
- </Original>
- <Expanded>
- throws_int(true), int
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- throws_int(false)
- </Original>
- <Expanded>
- throws_int(false)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- "aaa", Catch::EndsWith("aaa")
- </Original>
- <Expanded>
- "aaa" ends with: "aaa"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- templated_tests&lt;int>(3)
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#835 -- errno should not be touched by Catch" tags="[!hide][!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- f() == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- errno == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#872" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Info>
- dummy := 0
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <Original>
- x == 4
- </Original>
- <Expanded>
- {?} == 4
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="#961 -- Dynamically created sections should all be reported" tags="[!hide][.]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="Looped section 0" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Looped section 1" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Looped section 2" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Looped section 3" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Looped section 4" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="'Not' checks that should fail" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- false != false
- </Original>
- <Expanded>
- false != false
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- true != true
- </Original>
- <Expanded>
- true != true
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !true
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_FALSE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(true)
- </Original>
- <Expanded>
- !true
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !trueValue
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_FALSE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(trueValue)
- </Original>
- <Expanded>
- !true
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(1 == 1)
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_FALSE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(1 == 1)
- </Original>
- <Expanded>
- !(1 == 1)
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="'Not' checks that should succeed" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- false == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- true == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !false
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(false)
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !falseValue
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(falseValue)
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(1 == 2)
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- !(1 == 2)
- </Original>
- <Expanded>
- !(1 == 2)
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="(unimplemented) static bools can be evaluated" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Section name="compare to true" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- is_true&lt;true>::value == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true == is_true&lt;true>::value
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="compare to false" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- is_true&lt;false>::value == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- false == is_true&lt;false>::value
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="negation" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- !is_true&lt;false>::value
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="double negation" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- !!is_true&lt;true>::value
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="direct" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- is_true&lt;true>::value
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- !(is_true&lt;false>::value)
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="3x3x3 ints" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 1 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 1 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 2 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 2 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 4
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 4 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 5
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 5 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; y
- </Original>
- <Expanded>
- 3 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- y &lt; z
- </Original>
- <Expanded>
- 6 &lt; 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- x &lt; z
- </Original>
- <Expanded>
- 3 &lt; 9
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A METHOD_AS_TEST_CASE based test run that fails" tags="[!hide][.][class][failing]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- s == "world"
- </Original>
- <Expanded>
- "hello" == "world"
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds" tags="[class]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- s == "hello"
- </Original>
- <Expanded>
- "hello" == "hello"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo&lt;float>" tags="[!hide][.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 1
- </Original>
- <Expanded>
- 0 == 1
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo&lt;int>" tags="[!hide][.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 1
- </Original>
- <Expanded>
- 0 == 1
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector&lt;float>" tags="[!hide][.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 1
- </Original>
- <Expanded>
- 0 == 1
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector&lt;int>" tags="[!hide][.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 1
- </Original>
- <Expanded>
- 0 == 1
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo&lt;float>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo&lt;int>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector&lt;float>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector&lt;int>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>::m_a.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2&lt;float, 6>" tags="[!hide][.][class][failing][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2
- </Original>
- <Expanded>
- 6 &lt; 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2&lt;int, 2>" tags="[!hide][.][class][failing][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2
- </Original>
- <Expanded>
- 2 &lt; 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array&lt;float, 6>" tags="[!hide][.][class][failing][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2
- </Original>
- <Expanded>
- 6 &lt; 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array&lt;int, 2>" tags="[!hide][.][class][failing][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() &lt; 2
- </Original>
- <Expanded>
- 2 &lt; 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2&lt;float,6>" tags="[class][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() >= 2
- </Original>
- <Expanded>
- 6 >= 2
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2&lt;int,2>" tags="[class][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() >= 2
- </Original>
- <Expanded>
- 2 >= 2
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array&lt;float,6>" tags="[class][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() >= 2
- </Original>
- <Expanded>
- 6 >= 2
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array&lt;int,2>" tags="[class][nttp][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture_2&lt;TestType>{}.m_a.size() >= 2
- </Original>
- <Expanded>
- 2 >= 2
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" tags="[!hide][.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 2
- </Original>
- <Expanded>
- 1.0 == 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" tags="[!hide][.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 2
- </Original>
- <Expanded>
- 1.0f == 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" tags="[!hide][.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 2
- </Original>
- <Expanded>
- 1 == 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 1
- </Original>
- <Expanded>
- 1.0 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 1
- </Original>
- <Expanded>
- 1.0f == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1" tags="[!hide][.][class][failing][nttp][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Nttp_Fixture&lt;V>::value == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3" tags="[!hide][.][class][failing][nttp][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Nttp_Fixture&lt;V>::value == 0
- </Original>
- <Expanded>
- 3 == 0
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6" tags="[!hide][.][class][failing][nttp][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Nttp_Fixture&lt;V>::value == 0
- </Original>
- <Expanded>
- 6 == 0
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1" tags="[class][nttp][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Nttp_Fixture&lt;V>::value > 0
- </Original>
- <Expanded>
- 1 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3" tags="[class][nttp][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Nttp_Fixture&lt;V>::value > 0
- </Original>
- <Expanded>
- 3 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6" tags="[class][nttp][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Nttp_Fixture&lt;V>::value > 0
- </Original>
- <Expanded>
- 6 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A TEST_CASE_METHOD based test run that fails" tags="[!hide][.][class][failing]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- m_a == 2
- </Original>
- <Expanded>
- 1 == 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A TEST_CASE_METHOD based test run that succeeds" tags="[class]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- m_a == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case - Foo&lt;float>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case - Foo&lt;int>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case - std::vector&lt;float>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case - std::vector&lt;int>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case with array signature - Bar&lt;float, 42>" tags="[nttp][product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() > 0
- </Original>
- <Expanded>
- 42 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case with array signature - Bar&lt;int, 9>" tags="[nttp][product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() > 0
- </Original>
- <Expanded>
- 9 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case with array signature - std::array&lt;float, 42>" tags="[nttp][product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() > 0
- </Original>
- <Expanded>
- 42 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A Template product test case with array signature - std::array&lt;int, 9>" tags="[nttp][product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x.size() > 0
- </Original>
- <Expanded>
- 9 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A comparison that uses literals instead of the normal constructor" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == 1.23_a
- </Original>
- <Expanded>
- 1.23 == Approx( 1.23 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d != 1.22_a
- </Original>
- <Expanded>
- 1.23 != Approx( 1.22 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- -d == -1.23_a
- </Original>
- <Expanded>
- -1.23 == Approx( -1.23 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == 1.2_a .epsilon(.1)
- </Original>
- <Expanded>
- 1.23 == Approx( 1.2 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d != 1.2_a .epsilon(.001)
- </Original>
- <Expanded>
- 1.23 != Approx( 1.2 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == 1_a .epsilon(.3)
- </Original>
- <Expanded>
- 1.23 == Approx( 1.0 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="A couple of nested sections followed by a failure" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="Outer" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="Inner" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Failure filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- to infinity and beyond
- </Failure>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="A failing expression with a non streamable type is still captured" tags="[!hide][.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- &amp;o1 == &amp;o2
- </Original>
- <Expanded>
- 0x<hex digits> == 0x<hex digits>
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- o1 == o2
- </Original>
- <Expanded>
- {?} == {?}
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Absolute margin" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 104.0 != Approx(100.0)
- </Original>
- <Expanded>
- 104.0 != Approx( 100.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 104.0 == Approx(100.0).margin(5)
- </Original>
- <Expanded>
- 104.0 == Approx( 100.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 104.0 == Approx(100.0).margin(4)
- </Original>
- <Expanded>
- 104.0 == Approx( 100.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 104.0 != Approx(100.0).margin(3)
- </Original>
- <Expanded>
- 104.0 != Approx( 100.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 100.3 != Approx(100.0)
- </Original>
- <Expanded>
- 100.3 != Approx( 100.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 100.3 == Approx(100.0).margin(0.5)
- </Original>
- <Expanded>
- 100.3 == Approx( 100.0 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="An empty test with no assertions" tags="[empty]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="An expression with side-effects should only be evaluated once" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- i++ == 7
- </Original>
- <Expanded>
- 7 == 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- i++ == 8
- </Original>
- <Expanded>
- 8 == 8
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="An unchecked exception reports the line of the last assertion" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- 1 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="false" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- {Unknown expression after the reported line}
- </Original>
- <Expanded>
- {Unknown expression after the reported line}
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- unexpected exception
- </Exception>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Anonymous test case 1" filename="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Approx setters validate their arguments" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(0).margin(0)
- </Original>
- <Expanded>
- Approx(0).margin(0)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(0).margin(1234656)
- </Original>
- <Expanded>
- Approx(0).margin(1234656)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(0).margin(-2), std::domain_error
- </Original>
- <Expanded>
- Approx(0).margin(-2), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(0).epsilon(0)
- </Original>
- <Expanded>
- Approx(0).epsilon(0)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(0).epsilon(1)
- </Original>
- <Expanded>
- Approx(0).epsilon(1)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(0).epsilon(-0.001), std::domain_error
- </Original>
- <Expanded>
- Approx(0).epsilon(-0.001), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(0).epsilon(1.0001), std::domain_error
- </Original>
- <Expanded>
- Approx(0).epsilon(1.0001), std::domain_error
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Approx with exactly-representable margin" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 0.25f == Approx(0.0f).margin(0.25f)
- </Original>
- <Expanded>
- 0.25f == Approx( 0.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 0.0f == Approx(0.25f).margin(0.25f)
- </Original>
- <Expanded>
- 0.0f == Approx( 0.25 )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 0.5f == Approx(0.25f).margin(0.25f)
- </Original>
- <Expanded>
- 0.5f == Approx( 0.25 )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 245.0f == Approx(245.25f).margin(0.25f)
- </Original>
- <Expanded>
- 245.0f == Approx( 245.25 )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 245.5f == Approx(245.25f).margin(0.25f)
- </Original>
- <Expanded>
- 245.5f == Approx( 245.25 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Approximate PI" tags="[Approx][PI]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 )
- </Original>
- <Expanded>
- 3.1428571429 == Approx( 3.141 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 )
- </Original>
- <Expanded>
- 3.1428571429 != Approx( 3.141 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Approximate comparisons with different epsilons" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d != Approx( 1.231 )
- </Original>
- <Expanded>
- 1.23 != Approx( 1.231 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == Approx( 1.231 ).epsilon( 0.1 )
- </Original>
- <Expanded>
- 1.23 == Approx( 1.231 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Approximate comparisons with floats" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 1.23f == Approx( 1.23f )
- </Original>
- <Expanded>
- 1.23f == Approx( 1.2300000191 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 0.0f == Approx( 0.0f )
- </Original>
- <Expanded>
- 0.0f == Approx( 0.0 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Approximate comparisons with ints" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 1 == Approx( 1 )
- </Original>
- <Expanded>
- 1 == Approx( 1.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 0 == Approx( 0 )
- </Original>
- <Expanded>
- 0 == Approx( 0.0 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Approximate comparisons with mixed numeric types" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 1.0f == Approx( 1 )
- </Original>
- <Expanded>
- 1.0f == Approx( 1.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 0 == Approx( dZero)
- </Original>
- <Expanded>
- 0 == Approx( 0.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 0 == Approx( dSmall ).margin( 0.001 )
- </Original>
- <Expanded>
- 0 == Approx( 0.00001 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 1.234f == Approx( dMedium )
- </Original>
- <Expanded>
- 1.234f == Approx( 1.234 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- dMedium == Approx( 1.234f )
- </Original>
- <Expanded>
- 1.234 == Approx( 1.2339999676 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Arbitrary predicate matcher" tags="[generic][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Function pointer" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1, Predicate&lt;int>(alwaysTrue, "always true")
- </Original>
- <Expanded>
- 1 matches predicate: "always true"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1, !Predicate&lt;int>(alwaysFalse, "always false")
- </Original>
- <Expanded>
- 1 not matches predicate: "always false"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Lambdas + different type" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- "Hello olleH", Predicate&lt;std::string>( [] (std::string const&amp; str) -> bool { return str.front() == str.back(); }, "First and last character should be equal")
- </Original>
- <Expanded>
- "Hello olleH" matches predicate: "First and last character should be equal"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- "This wouldn't pass", !Predicate&lt;std::string>( [] (std::string const&amp; str) -> bool { return str.front() == str.back(); } )
- </Original>
- <Expanded>
- "This wouldn't pass" not matches undescribed predicate
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Assertions then sections" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="A section" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="Another section" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="A section" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="Another other section" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="CAPTURE can deal with complex expressions" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- a := 1
- </Info>
- <Info>
- b := 2
- </Info>
- <Info>
- c := 3
- </Info>
- <Info>
- a + b := 3
- </Info>
- <Info>
- a+b := 3
- </Info>
- <Info>
- c > b := true
- </Info>
- <Info>
- a == 1 := true
- </Info>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="CAPTURE can deal with complex expressions involving commas" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- std::vector&lt;int>{1, 2, 3}[0, 1, 2] := 3
- </Info>
- <Info>
- std::vector&lt;int>{1, 2, 3}[(0, 1)] := 2
- </Info>
- <Info>
- std::vector&lt;int>{1, 2, 3}[0] := 1
- </Info>
- <Info>
- (helper_1436&lt;int, int>{12, -12}) := { 12, -12 }
- </Info>
- <Info>
- (helper_1436&lt;int, int>(-12, 12)) := { -12, 12 }
- </Info>
- <Info>
- (1, 2) := 2
- </Info>
- <Info>
- (2, 3) := 3
- </Info>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="CAPTURE parses string and character constants" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- ("comma, in string", "escaped, \", ") := "escaped, ", "
- </Info>
- <Info>
- "single quote in string,'," := "single quote in string,',"
- </Info>
- <Info>
- "some escapes, \\,\\\\" := "some escapes, \,\\"
- </Info>
- <Info>
- "some, ), unmatched, } prenheses {[&lt;" := "some, ), unmatched, } prenheses {[&lt;"
- </Info>
- <Info>
- '"' := '"'
- </Info>
- <Info>
- '\'' := '''
- </Info>
- <Info>
- ',' := ','
- </Info>
- <Info>
- '}' := '}'
- </Info>
- <Info>
- ')' := ')'
- </Info>
- <Info>
- '(' := '('
- </Info>
- <Info>
- '{' := '{'
- </Info>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Capture and info messages" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Section name="Capture should stringify like assertions" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Info>
- i := 2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Info should NOT stringify the way assertions do" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Info>
- 3
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Character pretty printing" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Section name="Specifically escaped" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- tab == '\t'
- </Original>
- <Expanded>
- '\t' == '\t'
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- newline == '\n'
- </Original>
- <Expanded>
- '\n' == '\n'
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- carr_return == '\r'
- </Original>
- <Expanded>
- '\r' == '\r'
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- form_feed == '\f'
- </Original>
- <Expanded>
- '\f' == '\f'
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="General chars" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- space == ' '
- </Original>
- <Expanded>
- ' ' == ' '
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == chars[i]
- </Original>
- <Expanded>
- 'a' == 'a'
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == chars[i]
- </Original>
- <Expanded>
- 'z' == 'z'
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == chars[i]
- </Original>
- <Expanded>
- 'A' == 'A'
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == chars[i]
- </Original>
- <Expanded>
- 'Z' == 'Z'
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Low ASCII" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- null_terminator == '\0'
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == i
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == i
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == i
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- c == i
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Commas in various macros are allowed" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;constructor_throws>{constructor_throws{}, constructor_throws{}}
- </Original>
- <Expanded>
- std::vector&lt;constructor_throws>{constructor_throws{}, constructor_throws{}}
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;constructor_throws>{constructor_throws{}, constructor_throws{}}
- </Original>
- <Expanded>
- std::vector&lt;constructor_throws>{constructor_throws{}, constructor_throws{}}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;int>{1, 2, 3} == std::vector&lt;int>{1, 2, 3}
- </Original>
- <Expanded>
- std::vector&lt;int>{1, 2, 3} == std::vector&lt;int>{1, 2, 3}
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_NOTHROW" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;int>{1, 2, 3} == std::vector&lt;int>{1, 2, 3}
- </Original>
- <Expanded>
- std::vector&lt;int>{1, 2, 3} == std::vector&lt;int>{1, 2, 3}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2}
- </Original>
- <Expanded>
- { 1, 2 } == { 1, 2 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2}
- </Original>
- <Expanded>
- { 1, 2 } == { 1, 2 }
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- !(std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2, 3})
- </Original>
- <Expanded>
- !({ 1, 2 } == { 1, 2, 3 })
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- !(std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2, 3})
- </Original>
- <Expanded>
- !({ 1, 2 } == { 1, 2, 3 })
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_NOFAIL" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2}
- </Original>
- <Expanded>
- { 1, 2 } == { 1, 2 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECKED_IF" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2}
- </Original>
- <Expanded>
- { 1, 2 } == { 1, 2 }
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECKED_ELSE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2}
- </Original>
- <Expanded>
- { 1, 2 } == { 1, 2 }
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Comparing function pointers" tags="[Tricky][function pointer]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- a
- </Original>
- <Expanded>
- 0x<hex digits>
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- a == &amp;foo
- </Original>
- <Expanded>
- 0x<hex digits> == 0x<hex digits>
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Comparison ops" tags="[rng]" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- SimplePcg32{} == SimplePcg32{}
- </Original>
- <Expanded>
- {?} == {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- SimplePcg32{ 0 } != SimplePcg32{}
- </Original>
- <Expanded>
- {?} != {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- !(SimplePcg32{ 1 } == SimplePcg32{ 2 })
- </Original>
- <Expanded>
- !({?} == {?})
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- !(SimplePcg32{ 1 } != SimplePcg32{ 1 })
- </Original>
- <Expanded>
- !({?} != {?})
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Comparison with explicitly convertible types" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- td == Approx(10.0)
- </Original>
- <Expanded>
- StrongDoubleTypedef(10) == Approx( 10.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(10.0) == td
- </Original>
- <Expanded>
- Approx( 10.0 ) == StrongDoubleTypedef(10)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- td != Approx(11.0)
- </Original>
- <Expanded>
- StrongDoubleTypedef(10) != Approx( 11.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(11.0) != td
- </Original>
- <Expanded>
- Approx( 11.0 ) != StrongDoubleTypedef(10)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- td &lt;= Approx(10.0)
- </Original>
- <Expanded>
- StrongDoubleTypedef(10) &lt;= Approx( 10.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- td &lt;= Approx(11.0)
- </Original>
- <Expanded>
- StrongDoubleTypedef(10) &lt;= Approx( 11.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(10.0) &lt;= td
- </Original>
- <Expanded>
- Approx( 10.0 ) &lt;= StrongDoubleTypedef(10)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(9.0) &lt;= td
- </Original>
- <Expanded>
- Approx( 9.0 ) &lt;= StrongDoubleTypedef(10)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- td >= Approx(9.0)
- </Original>
- <Expanded>
- StrongDoubleTypedef(10) >= Approx( 9.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- td >= Approx(td)
- </Original>
- <Expanded>
- StrongDoubleTypedef(10) >= Approx( 10.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(td) >= td
- </Original>
- <Expanded>
- Approx( 10.0 ) >= StrongDoubleTypedef(10)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx(11.0) >= td
- </Original>
- <Expanded>
- Approx( 11.0 ) >= StrongDoubleTypedef(10)
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Comparisons between ints where one side is computed" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 54 == 6*9
- </Original>
- <Expanded>
- 54 == 54
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- ( -1 > 2u )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- -1 > 2u
- </Original>
- <Expanded>
- -1 > 2
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- ( 2u &lt; -1 )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 2u &lt; -1
- </Original>
- <Expanded>
- 2 &lt; -1
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- ( minInt > 2u )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- minInt > 2u
- </Original>
- <Expanded>
- -2147483648 > 2
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Comparisons with int literals don't warn when mixing signed/ unsigned" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- i == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- ui == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- l == 3
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- ul == 4
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- c == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- uc == 6
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 1 == i
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 2 == ui
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 3 == l
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 4 == ul
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 5 == c
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 6 == uc
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- (std::numeric_limits&lt;uint32_t>::max)() > ul
- </Original>
- <Expanded>
- 4294967295 (0x<hex digits>) > 4
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Composed matchers are distinct" tags="[composed][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching2(), !composed1
- </Original>
- <Expanded>
- "some completely different text that contains one common word" not ( contains: "string" or contains: "random" )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching2(), composed2
- </Original>
- <Expanded>
- "some completely different text that contains one common word" ( contains: "string" or contains: "random" or contains: "different" )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Contains string matcher" tags="[!hide][.][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("not there", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("STRING")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" contains: "STRING"
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Copy and then generate a range" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="from var and iterators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from var and iterators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from var and iterators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from var and iterators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from var and iterators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from var and iterators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From a temporary container" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From a temporary container" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From a temporary container" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From a temporary container" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From a temporary container" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From a temporary container" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- elem % 2 == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Final validation" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- call_count == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- make_data().size() == test_count
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Custom exceptions can be translated when testing for nothrow" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="false" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- throwCustom()
- </Original>
- <Expanded>
- throwCustom()
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- custom exception - not std
- </Exception>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Custom exceptions can be translated when testing for throwing as something else" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="false" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- throwCustom(), std::exception
- </Original>
- <Expanded>
- throwCustom(), std::exception
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- custom exception - not std
- </Exception>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Custom std-exceptions can be custom translated" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- custom std exception
- </Exception>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Default scale is invisible to comparison" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 101.000001 != Approx(100).epsilon(0.01)
- </Original>
- <Expanded>
- 101.000001 != Approx( 100.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- std::pow(10, -5) != Approx(std::pow(10, -7))
- </Original>
- <Expanded>
- 0.00001 != Approx( 0.0000001 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Directly creating an EnumInfo" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- enumInfo->lookup(0) == "Value1"
- </Original>
- <Expanded>
- Value1 == "Value1"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- enumInfo->lookup(1) == "Value2"
- </Original>
- <Expanded>
- Value2 == "Value2"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- enumInfo->lookup(3) == "{** unexpected enum value **}"
- </Original>
- <Expanded>
- {** unexpected enum value **}
-==
-"{** unexpected enum value **}"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="EndsWith string matcher" tags="[!hide][.][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), EndsWith("Substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ends with: "Substring"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ends with: "this" (case insensitive)
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Enums can quickly have stringification enabled using REGISTER_ENUM" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- stringify( EnumClass3::Value1 ) == "Value1"
- </Original>
- <Expanded>
- "Value1" == "Value1"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- stringify( EnumClass3::Value2 ) == "Value2"
- </Original>
- <Expanded>
- "Value2" == "Value2"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- stringify( EnumClass3::Value3 ) == "Value3"
- </Original>
- <Expanded>
- "Value3" == "Value3"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}"
- </Original>
- <Expanded>
- "{** unexpected enum value **}"
-==
-"{** unexpected enum value **}"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- stringify( ec3 ) == "Value2"
- </Original>
- <Expanded>
- "Value2" == "Value2"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- stringify( Bikeshed::Colours::Red ) == "Red"
- </Original>
- <Expanded>
- "Red" == "Red"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- stringify( Bikeshed::Colours::Blue ) == "Blue"
- </Original>
- <Expanded>
- "Blue" == "Blue"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Epsilon only applies to Approx's value" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- 101.01 != Approx(100).epsilon(0.01)
- </Original>
- <Expanded>
- 101.01 != Approx( 100.0 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Equality checks that should fail" tags="[!hide][!mayfail][.][failing]" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven == 6
- </Original>
- <Expanded>
- 7 == 6
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven == 8
- </Original>
- <Expanded>
- 7 == 8
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven == 0
- </Original>
- <Expanded>
- 7 == 0
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one == Approx( 9.11f )
- </Original>
- <Expanded>
- 9.1f == Approx( 9.1099996567 )
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one == Approx( 9.0f )
- </Original>
- <Expanded>
- 9.1f == Approx( 9.0 )
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one == Approx( 1 )
- </Original>
- <Expanded>
- 9.1f == Approx( 1.0 )
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one == Approx( 0 )
- </Original>
- <Expanded>
- 9.1f == Approx( 0.0 )
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.double_pi == Approx( 3.1415 )
- </Original>
- <Expanded>
- 3.1415926535 == Approx( 3.1415 )
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello == "goodbye"
- </Original>
- <Expanded>
- "hello" == "goodbye"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello == "hell"
- </Original>
- <Expanded>
- "hello" == "hell"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello == "hello1"
- </Original>
- <Expanded>
- "hello" == "hello1"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello.size() == 6
- </Original>
- <Expanded>
- 5 == 6
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- x == Approx( 1.301 )
- </Original>
- <Expanded>
- 1.3 == Approx( 1.301 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Equality checks that should succeed" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven == 7
- </Original>
- <Expanded>
- 7 == 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one == Approx( 9.1f )
- </Original>
- <Expanded>
- 9.1f == Approx( 9.1000003815 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.double_pi == Approx( 3.1415926535 )
- </Original>
- <Expanded>
- 3.1415926535 == Approx( 3.1415926535 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello == "hello"
- </Original>
- <Expanded>
- "hello" == "hello"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- "hello" == data.str_hello
- </Original>
- <Expanded>
- "hello" == "hello"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- x == Approx( 1.3 )
- </Original>
- <Expanded>
- 1.3 == Approx( 1.3 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Equals" tags="[matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Equals("this string contains 'abc' as a substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Equals string matcher" tags="[!hide][.][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Equals("this string contains 'ABC' as a substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Equals("something else", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" equals: "something else" (case insensitive)
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified" tags="[exception][toString]" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method"
- </Original>
- <Expanded>
- "This exception has overridden what() method"
-==
-"This exception has overridden what() method"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(OperatorException{}) == "OperatorException"
- </Original>
- <Expanded>
- "OperatorException" == "OperatorException"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException"
- </Original>
- <Expanded>
- "StringMakerException"
-==
-"StringMakerException"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Exception matchers that fail" tags="[!hide][!throws][.][exceptions][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="No exception" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- doesNotThrow(), SpecialException, ExceptionMatcher{1}
- </Original>
- <Expanded>
- doesNotThrow(), SpecialException, ExceptionMatcher{1}
- </Expanded>
- </Expression>
- <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- doesNotThrow(), SpecialException, ExceptionMatcher{1}
- </Original>
- <Expanded>
- doesNotThrow(), SpecialException, ExceptionMatcher{1}
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="2" expectedFailures="0"/>
- </Section>
- <Section name="Type mismatch" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsAsInt(1), SpecialException, ExceptionMatcher{1}
- </Original>
- <Expanded>
- throwsAsInt(1), SpecialException, ExceptionMatcher{1}
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- Unknown exception
- </Exception>
- </Expression>
- <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsAsInt(1), SpecialException, ExceptionMatcher{1}
- </Original>
- <Expanded>
- throwsAsInt(1), SpecialException, ExceptionMatcher{1}
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- Unknown exception
- </Exception>
- </Expression>
- <OverallResults successes="0" failures="2" expectedFailures="0"/>
- </Section>
- <Section name="Contents are wrong" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsSpecialException(3), SpecialException, ExceptionMatcher{1}
- </Original>
- <Expanded>
- SpecialException::what special exception has value of 1
- </Expanded>
- </Expression>
- <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsSpecialException(4), SpecialException, ExceptionMatcher{1}
- </Original>
- <Expanded>
- SpecialException::what special exception has value of 1
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="2" expectedFailures="0"/>
- </Section>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Exception matchers that succeed" tags="[!throws][exceptions][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsSpecialException(1), SpecialException, ExceptionMatcher{1}
- </Original>
- <Expanded>
- SpecialException::what special exception has value of 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsSpecialException(2), SpecialException, ExceptionMatcher{2}
- </Original>
- <Expanded>
- SpecialException::what special exception has value of 2
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Exception messages can be tested for" tags="[!throws]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Section name="exact match" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), "expected exception"
- </Original>
- <Expanded>
- "expected exception" equals: "expected exception"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="different case" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No )
- </Original>
- <Expanded>
- "expected exception" equals: "expected exception" (case insensitive)
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="wildcarded" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), StartsWith( "expected" )
- </Original>
- <Expanded>
- "expected exception" starts with: "expected"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), EndsWith( "exception" )
- </Original>
- <Expanded>
- "expected exception" ends with: "exception"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), Contains( "except" )
- </Original>
- <Expanded>
- "expected exception" contains: "except"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), Contains( "exCept", Catch::CaseSensitive::No )
- </Original>
- <Expanded>
- "expected exception" contains: "except" (case insensitive)
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Exceptions matchers" tags="[!throws][exceptions][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsDerivedException(), DerivedException, Message("DerivedException::what")
- </Original>
- <Expanded>
- DerivedException::what exception message matches "DerivedException::what"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsDerivedException(), DerivedException, !Message("derivedexception::what")
- </Original>
- <Expanded>
- DerivedException::what not exception message matches "derivedexception::what"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsSpecialException(2), SpecialException, !Message("DerivedException::what")
- </Original>
- <Expanded>
- SpecialException::what not exception message matches "DerivedException::what"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- throwsSpecialException(2), SpecialException, Message("SpecialException::what")
- </Original>
- <Expanded>
- SpecialException::what exception message matches "SpecialException::what"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Expected exceptions that don't throw or unexpected exceptions fail the test" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="false" type="CHECK_THROWS_AS" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), std::string
- </Original>
- <Expanded>
- thisThrows(), std::string
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- expected exception
- </Exception>
- </Expression>
- <Expression success="false" type="CHECK_THROWS_AS" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisDoesntThrow(), std::domain_error
- </Original>
- <Expanded>
- thisDoesntThrow(), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_NOTHROW" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows()
- </Original>
- <Expanded>
- thisThrows()
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- expected exception
- </Exception>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="FAIL aborts the test" tags="[!hide][.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- This is a failure
- </Failure>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="FAIL does not require an argument" tags="[!hide][.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" />
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="FAIL_CHECK does not abort the test" tags="[!hide][.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- This is a failure
- </Failure>
- <Warning>
- This message appears in the output
- </Warning>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Factorials are computed" tags="[factorial]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- Factorial(0) == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- Factorial(1) == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- Factorial(2) == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- Factorial(3) == 6
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- Factorial(10) == 3628800
- </Original>
- <Expanded>
- 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Floating point matchers: double" tags="[floating-point][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Relative" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 10., WithinRel(11.1, 0.1)
- </Original>
- <Expanded>
- 10.0 and 11.1 are within 10% of each other
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 10., !WithinRel(11.2, 0.1)
- </Original>
- <Expanded>
- 10.0 not and 11.2 are within 10% of each other
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., !WithinRel(0., 0.99)
- </Original>
- <Expanded>
- 1.0 not and 0 are within 99% of each other
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -0., WithinRel(0.)
- </Original>
- <Expanded>
- -0.0 and 0 are within 2.22045e-12% of each other
- </Expanded>
- </Expression>
- <Section name="Some subnormal values" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, WithinRel(v2)
- </Original>
- <Expanded>
- 0.0 and 2.22507e-308 are within 2.22045e-12% of each other
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Margin" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., WithinAbs(1., 0)
- </Original>
- <Expanded>
- 1.0 is within 0.0 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0., WithinAbs(1., 1)
- </Original>
- <Expanded>
- 0.0 is within 1.0 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0., !WithinAbs(1., 0.99)
- </Original>
- <Expanded>
- 0.0 not is within 0.99 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0., !WithinAbs(1., 0.99)
- </Original>
- <Expanded>
- 0.0 not is within 0.99 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 11., !WithinAbs(10., 0.5)
- </Original>
- <Expanded>
- 11.0 not is within 0.5 of 10.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 10., !WithinAbs(11., 0.5)
- </Original>
- <Expanded>
- 10.0 not is within 0.5 of 11.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -10., WithinAbs(-10., 0.5)
- </Original>
- <Expanded>
- -10.0 is within 0.5 of -10.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -10., WithinAbs(-9.6, 0.5)
- </Original>
- <Expanded>
- -10.0 is within 0.5 of -9.6
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="ULPs" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., WithinULP(1., 0)
- </Original>
- <Expanded>
- 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- nextafter(1., 2.), WithinULP(1., 1)
- </Original>
- <Expanded>
- 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0., WithinULP(nextafter(0., 1.), 1)
- </Original>
- <Expanded>
- 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., WithinULP(nextafter(1., 0.), 1)
- </Original>
- <Expanded>
- 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., !WithinULP(nextafter(1., 2.), 0)
- </Original>
- <Expanded>
- 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., WithinULP(1., 0)
- </Original>
- <Expanded>
- 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -0., WithinULP(0., 0)
- </Original>
- <Expanded>
- -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00])
- </Expanded>
- </Expression>
- <OverallResults successes="7" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Composed" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., WithinAbs(1., 0.5) || WithinULP(2., 1)
- </Original>
- <Expanded>
- 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1., WithinAbs(2., 0.5) || WithinULP(1., 0)
- </Original>
- <Expanded>
- 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1)
- </Original>
- <Expanded>
- 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Constructor validation" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinAbs(1., 0.)
- </Original>
- <Expanded>
- WithinAbs(1., 0.)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinAbs(1., -1.), std::domain_error
- </Original>
- <Expanded>
- WithinAbs(1., -1.), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinULP(1., 0)
- </Original>
- <Expanded>
- WithinULP(1., 0)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinRel(1., 0.)
- </Original>
- <Expanded>
- WithinRel(1., 0.)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinRel(1., -0.2), std::domain_error
- </Original>
- <Expanded>
- WithinRel(1., -0.2), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinRel(1., 1.), std::domain_error
- </Original>
- <Expanded>
- WithinRel(1., 1.), std::domain_error
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Floating point matchers: float" tags="[floating-point][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Relative" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 10.f, WithinRel(11.1f, 0.1f)
- </Original>
- <Expanded>
- 10.0f and 11.1 are within 10% of each other
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 10.f, !WithinRel(11.2f, 0.1f)
- </Original>
- <Expanded>
- 10.0f not and 11.2 are within 10% of each other
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, !WithinRel(0.f, 0.99f)
- </Original>
- <Expanded>
- 1.0f not and 0 are within 99% of each other
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -0.f, WithinRel(0.f)
- </Original>
- <Expanded>
- -0.0f and 0 are within 0.00119209% of each other
- </Expanded>
- </Expression>
- <Section name="Some subnormal values" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, WithinRel(v2)
- </Original>
- <Expanded>
- 0.0f and 1.17549e-38 are within 0.00119209% of each other
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Margin" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, WithinAbs(1.f, 0)
- </Original>
- <Expanded>
- 1.0f is within 0.0 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0.f, WithinAbs(1.f, 1)
- </Original>
- <Expanded>
- 0.0f is within 1.0 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0.f, !WithinAbs(1.f, 0.99f)
- </Original>
- <Expanded>
- 0.0f not is within 0.9900000095 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0.f, !WithinAbs(1.f, 0.99f)
- </Original>
- <Expanded>
- 0.0f not is within 0.9900000095 of 1.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0.f, WithinAbs(-0.f, 0)
- </Original>
- <Expanded>
- 0.0f is within 0.0 of -0.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 11.f, !WithinAbs(10.f, 0.5f)
- </Original>
- <Expanded>
- 11.0f not is within 0.5 of 10.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 10.f, !WithinAbs(11.f, 0.5f)
- </Original>
- <Expanded>
- 10.0f not is within 0.5 of 11.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -10.f, WithinAbs(-10.f, 0.5f)
- </Original>
- <Expanded>
- -10.0f is within 0.5 of -10.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -10.f, WithinAbs(-9.6f, 0.5f)
- </Original>
- <Expanded>
- -10.0f is within 0.5 of -9.6000003815
- </Expanded>
- </Expression>
- <OverallResults successes="9" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="ULPs" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, WithinULP(1.f, 0)
- </Original>
- <Expanded>
- 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- nextafter(1.f, 2.f), WithinULP(1.f, 1)
- </Original>
- <Expanded>
- 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0.f, WithinULP(nextafter(0.f, 1.f), 1)
- </Original>
- <Expanded>
- 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, WithinULP(nextafter(1.f, 0.f), 1)
- </Original>
- <Expanded>
- 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, !WithinULP(nextafter(1.f, 2.f), 0)
- </Original>
- <Expanded>
- 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, WithinULP(1.f, 0)
- </Original>
- <Expanded>
- 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00])
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- -0.f, WithinULP(0.f, 0)
- </Original>
- <Expanded>
- -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00])
- </Expanded>
- </Expression>
- <OverallResults successes="7" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Composed" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1)
- </Original>
- <Expanded>
- 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0)
- </Original>
- <Expanded>
- 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- 0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f)
- </Original>
- <Expanded>
- 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Constructor validation" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinAbs(1.f, 0.f)
- </Original>
- <Expanded>
- WithinAbs(1.f, 0.f)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinAbs(1.f, -1.f), std::domain_error
- </Original>
- <Expanded>
- WithinAbs(1.f, -1.f), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinULP(1.f, 0)
- </Original>
- <Expanded>
- WithinULP(1.f, 0)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinULP(1.f, static_cast&lt;uint64_t>(-1)), std::domain_error
- </Original>
- <Expanded>
- WithinULP(1.f, static_cast&lt;uint64_t>(-1)), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinRel(1.f, 0.f)
- </Original>
- <Expanded>
- WithinRel(1.f, 0.f)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinRel(1.f, -0.2f), std::domain_error
- </Original>
- <Expanded>
- WithinRel(1.f, -0.2f), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- WithinRel(1.f, 1.f), std::domain_error
- </Original>
- <Expanded>
- WithinRel(1.f, 1.f), std::domain_error
- </Expanded>
- </Expression>
- <OverallResults successes="7" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Generators -- adapters" tags="[generators][generic]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Basic usage" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i % 2 == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Basic usage" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i % 2 == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Basic usage" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i % 2 == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Throws if there are no matching values" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- filter([] (int) {return false; }, value(1)), Catch::GeneratorException
- </Original>
- <Expanded>
- filter([] (int) {return false; }, value(1)), Catch::GeneratorException
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Shortening a range" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i &lt; 4
- </Original>
- <Expanded>
- 1 &lt; 4
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Shortening a range" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i &lt; 4
- </Original>
- <Expanded>
- 2 &lt; 4
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Shortening a range" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i &lt; 4
- </Original>
- <Expanded>
- 3 &lt; 4
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Same type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i % 2 == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Same type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i % 2 == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Same type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i % 2 == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Different type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i.size() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Different type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i.size() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Different type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i.size() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Different deduced type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i.size() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Different deduced type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i.size() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Different deduced type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- i.size() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j > 0
- </Original>
- <Expanded>
- 1 > 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j > 0
- </Original>
- <Expanded>
- 2 > 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j > 0
- </Original>
- <Expanded>
- 3 > 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j > 0
- </Original>
- <Expanded>
- 1 > 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j > 0
- </Original>
- <Expanded>
- 2 > 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j > 0
- </Original>
- <Expanded>
- 3 > 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Number of elements in source is divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.front() == chunk2.back()
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Number of elements in source is divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.front() == chunk2.back()
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Number of elements in source is divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.front() == chunk2.back()
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Number of elements in source is not divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.front() == chunk2.back()
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.front() &lt; 3
- </Original>
- <Expanded>
- 1 &lt; 3
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Number of elements in source is not divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.front() == chunk2.back()
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.front() &lt; 3
- </Original>
- <Expanded>
- 2 &lt; 3
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Chunk size of zero" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Chunk size of zero" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Chunk size of zero" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk2.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="Throws on too small generators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- chunk(2, value(1)), Catch::GeneratorException
- </Original>
- <Expanded>
- chunk(2, value(1)), Catch::GeneratorException
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Generators -- simple" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -3 &lt; 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -2 &lt; 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -1 &lt; 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 4 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 4 > 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 4 > 3
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -3 &lt; 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -2 &lt; 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -1 &lt; 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 8 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 8 > 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 8 > 3
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -3 &lt; 3
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -2 &lt; 3
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- j &lt; i
- </Original>
- <Expanded>
- -1 &lt; 3
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 12 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 12 > 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- 4u * i > str.size()
- </Original>
- <Expanded>
- 12 > 3
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Generators internals" tags="[generators][internals]" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Single value" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 123
- </Original>
- <Expanded>
- 123 == 123
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Preset values" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 3
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Generator combinator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 4
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Explicitly typed generator sequence" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get().size() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == "aa"
- </Original>
- <Expanded>
- "aa" == "aa"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == "bb"
- </Original>
- <Expanded>
- "bb" == "bb"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == "cc"
- </Original>
- <Expanded>
- "cc" == "cc"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="7" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Filter generator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 3
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- filter([] (int) { return false; }, value(1)), Catch::GeneratorException
- </Original>
- <Expanded>
- filter([] (int) { return false; }, value(1)), Catch::GeneratorException
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Take generator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Take less" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Take generator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Take more" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Map with explicit return type" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2.0
- </Original>
- <Expanded>
- 2.0 == 2.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 4.0
- </Original>
- <Expanded>
- 4.0 == 4.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 6.0
- </Original>
- <Expanded>
- 6.0 == 6.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Map with deduced return type" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2.0
- </Original>
- <Expanded>
- 2.0 == 2.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 4.0
- </Original>
- <Expanded>
- 4.0 == 4.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 6.0
- </Original>
- <Expanded>
- 6.0 == 6.0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Singular repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 3
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Actual repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 3
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 3
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="12" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="12" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Positive auto step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -2
- </Original>
- <Expanded>
- -2 == -2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Negative auto step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Exact" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -7
- </Original>
- <Expanded>
- -7 == -7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -4
- </Original>
- <Expanded>
- -4 == -4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Slightly over end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -7
- </Original>
- <Expanded>
- -7 == -7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -4
- </Original>
- <Expanded>
- -4 == -4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Slightly under end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -7
- </Original>
- <Expanded>
- -7 == -7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -4
- </Original>
- <Expanded>
- -4 == -4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Floating Point" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Exact" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Info>
- Current expected value is -1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -1.0 == Approx( -1.0 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.9
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.9 == Approx( -0.9 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.9
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.8
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.8 == Approx( -0.8 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.8
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.7 == Approx( -0.7 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.6
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.6 == Approx( -0.6 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.6
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.5 == Approx( -0.5 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.4 == Approx( -0.4 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.3
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.3 == Approx( -0.3 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.3
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.2 == Approx( -0.2 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.1 == Approx( -0.1 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -1.38778e-16
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.0 == Approx( -0.0 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -1.38778e-16
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.1 == Approx( 0.1 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.2 == Approx( 0.2 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.3
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.3 == Approx( 0.3 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.3
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.4 == Approx( 0.4 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.5 == Approx( 0.5 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.6
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.6 == Approx( 0.6 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.6
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.7 == Approx( 0.7 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.8
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.8 == Approx( 0.8 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.8
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.9
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.9 == Approx( 0.9 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.9
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx( rangeEnd )
- </Original>
- <Expanded>
- 1.0 == Approx( 1.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="42" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="42" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="42" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="42" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Floating Point" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Slightly over end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Info>
- Current expected value is -1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -1.0 == Approx( -1.0 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.7 == Approx( -0.7 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.4 == Approx( -0.4 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.1 == Approx( -0.1 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.2 == Approx( 0.2 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.5 == Approx( 0.5 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Floating Point" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Slightly under end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Info>
- Current expected value is -1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -1.0 == Approx( -1.0 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.7 == Approx( -0.7 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.4 == Approx( -0.4 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- -0.1 == Approx( -0.1 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is -0.1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.2 == Approx( 0.2 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == Approx(expected)
- </Original>
- <Expanded>
- 0.5 == Approx( 0.5 )
- </Expanded>
- </Expression>
- <Info>
- Current expected value is 0.5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="13" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Negative manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Exact" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -4
- </Original>
- <Expanded>
- -4 == -4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Negative manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Slightly over end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -4
- </Original>
- <Expanded>
- -4 == -4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Negative manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Section name="Slightly under end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -4
- </Original>
- <Expanded>
- -4 == -4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.next()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- gen.get() == -7
- </Original>
- <Expanded>
- -7 == -7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
- <Original>
- !(gen.next())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Greater-than inequalities with different epsilons" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d >= Approx( 1.22 )
- </Original>
- <Expanded>
- 1.23 >= Approx( 1.22 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d >= Approx( 1.23 )
- </Original>
- <Expanded>
- 1.23 >= Approx( 1.23 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- !(d >= Approx( 1.24 ))
- </Original>
- <Expanded>
- !(1.23 >= Approx( 1.24 ))
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d >= Approx( 1.24 ).epsilon(0.1)
- </Original>
- <Expanded>
- 1.23 >= Approx( 1.24 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="INFO and WARN do not abort tests" tags="[!hide][.][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- this is a message
- </Info>
- <Warning>
- this is a warning
- </Warning>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="INFO gets logged on failure" tags="[!hide][.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- this message should be logged
- </Info>
- <Info>
- so should this
- </Info>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- a == 1
- </Original>
- <Expanded>
- 2 == 1
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="INFO gets logged on failure, even if captured before successful assertions" tags="[!hide][.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- this message may be logged later
- </Info>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- a == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <Info>
- this message may be logged later
- </Info>
- <Info>
- this message should be logged
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- a == 1
- </Original>
- <Expanded>
- 2 == 1
- </Expanded>
- </Expression>
- <Info>
- this message may be logged later
- </Info>
- <Info>
- this message should be logged
- </Info>
- <Info>
- and this, but later
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- a == 0
- </Original>
- <Expanded>
- 2 == 0
- </Expanded>
- </Expression>
- <Info>
- this message may be logged later
- </Info>
- <Info>
- this message should be logged
- </Info>
- <Info>
- and this, but later
- </Info>
- <Info>
- but not this
- </Info>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- a == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="INFO is reset for each loop" tags="[!hide][.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- current counter 0
- </Info>
- <Info>
- i := 0
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 0 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 1
- </Info>
- <Info>
- i := 1
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 1 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 2
- </Info>
- <Info>
- i := 2
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 2 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 3
- </Info>
- <Info>
- i := 3
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 3 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 4
- </Info>
- <Info>
- i := 4
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 4 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 5
- </Info>
- <Info>
- i := 5
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 5 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 6
- </Info>
- <Info>
- i := 6
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 6 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 7
- </Info>
- <Info>
- i := 7
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 7 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 8
- </Info>
- <Info>
- i := 8
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 8 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 9
- </Info>
- <Info>
- i := 9
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 9 &lt; 10
- </Expanded>
- </Expression>
- <Info>
- current counter 10
- </Info>
- <Info>
- i := 10
- </Info>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- i &lt; 10
- </Original>
- <Expanded>
- 10 &lt; 10
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Inequality checks that should fail" tags="[!hide][!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven != 7
- </Original>
- <Expanded>
- 7 != 7
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one != Approx( 9.1f )
- </Original>
- <Expanded>
- 9.1f != Approx( 9.1000003815 )
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.double_pi != Approx( 3.1415926535 )
- </Original>
- <Expanded>
- 3.1415926535 != Approx( 3.1415926535 )
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello != "hello"
- </Original>
- <Expanded>
- "hello" != "hello"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello.size() != 5
- </Original>
- <Expanded>
- 5 != 5
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Inequality checks that should succeed" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven != 6
- </Original>
- <Expanded>
- 7 != 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven != 8
- </Original>
- <Expanded>
- 7 != 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one != Approx( 9.11f )
- </Original>
- <Expanded>
- 9.1f != Approx( 9.1099996567 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one != Approx( 9.0f )
- </Original>
- <Expanded>
- 9.1f != Approx( 9.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one != Approx( 1 )
- </Original>
- <Expanded>
- 9.1f != Approx( 1.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one != Approx( 0 )
- </Original>
- <Expanded>
- 9.1f != Approx( 0.0 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.double_pi != Approx( 3.1415 )
- </Original>
- <Expanded>
- 3.1415926535 != Approx( 3.1415 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello != "goodbye"
- </Original>
- <Expanded>
- "hello" != "goodbye"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello != "hell"
- </Original>
- <Expanded>
- "hello" != "hell"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello != "hello1"
- </Original>
- <Expanded>
- "hello" != "hello1"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello.size() != 6
- </Original>
- <Expanded>
- 5 != 6
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Less-than inequalities with different epsilons" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d &lt;= Approx( 1.24 )
- </Original>
- <Expanded>
- 1.23 &lt;= Approx( 1.24 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d &lt;= Approx( 1.23 )
- </Original>
- <Expanded>
- 1.23 &lt;= Approx( 1.23 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- !(d &lt;= Approx( 1.22 ))
- </Original>
- <Expanded>
- !(1.23 &lt;= Approx( 1.22 ))
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d &lt;= Approx( 1.22 ).epsilon(0.1)
- </Original>
- <Expanded>
- 1.23 &lt;= Approx( 1.22 )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="ManuallyRegistered" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Matchers can be (AllOf) composed with the &amp;&amp; operator" tags="[matchers][operator&amp;&amp;][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("string") &amp;&amp; Contains("abc") &amp;&amp; Contains("substring") &amp;&amp; Contains("contains")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Matchers can be (AnyOf) composed with the || operator" tags="[matchers][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("string") || Contains("different") || Contains("random")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching2(), Contains("string") || Contains("different") || Contains("random")
- </Original>
- <Expanded>
- "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Matchers can be composed with both &amp;&amp; and ||" tags="[matchers][operator&amp;&amp;][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), (Contains("string") || Contains("different")) &amp;&amp; Contains("substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Matchers can be composed with both &amp;&amp; and || - failing" tags="[!hide][.][failing][matchers][operator&amp;&amp;][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), (Contains("string") || Contains("different")) &amp;&amp; Contains("random")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Matchers can be negated (Not) with the ! operator" tags="[matchers][not][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), !Contains("different")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" not contains: "different"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Matchers can be negated (Not) with the ! operator - failing" tags="[!hide][.][failing][matchers][not][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), !Contains("substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" not contains: "substring"
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Mismatching exception messages failing the test" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), "expected exception"
- </Original>
- <Expanded>
- "expected exception" equals: "expected exception"
- </Expanded>
- </Expression>
- <Expression success="false" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), "should fail"
- </Original>
- <Expanded>
- "expected exception" equals: "should fail"
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Nested generators and captured variables" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 3 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 4 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 5 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 6 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- -5 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- -4 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 90 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 91 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 92 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 93 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 94 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 95 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 96 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 97 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 98 > -6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- values > -6
- </Original>
- <Expanded>
- 99 > -6
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Nice descriptive name" tags="[!hide][.][tag1][tag2][tag3]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Warning>
- This one ran
- </Warning>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Non-std exceptions can be translated" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- custom exception
- </Exception>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Objects that evaluated in boolean contexts can be checked" tags="[SafeBool][Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- True
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- !False
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- !(False)
- </Original>
- <Expanded>
- !{?}
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Optionally static assertions" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Ordering comparison checks that should fail" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven > 7
- </Original>
- <Expanded>
- 7 > 7
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt; 7
- </Original>
- <Expanded>
- 7 &lt; 7
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven > 8
- </Original>
- <Expanded>
- 7 > 8
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt; 6
- </Original>
- <Expanded>
- 7 &lt; 6
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt; 0
- </Original>
- <Expanded>
- 7 &lt; 0
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt; -1
- </Original>
- <Expanded>
- 7 &lt; -1
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven >= 8
- </Original>
- <Expanded>
- 7 >= 8
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt;= 6
- </Original>
- <Expanded>
- 7 &lt;= 6
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one &lt; 9
- </Original>
- <Expanded>
- 9.1f &lt; 9
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one > 10
- </Original>
- <Expanded>
- 9.1f > 10
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one > 9.2
- </Original>
- <Expanded>
- 9.1f > 9.2
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello > "hello"
- </Original>
- <Expanded>
- "hello" > "hello"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello &lt; "hello"
- </Original>
- <Expanded>
- "hello" &lt; "hello"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello > "hellp"
- </Original>
- <Expanded>
- "hello" > "hellp"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello > "z"
- </Original>
- <Expanded>
- "hello" > "z"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello &lt; "hellm"
- </Original>
- <Expanded>
- "hello" &lt; "hellm"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello &lt; "a"
- </Original>
- <Expanded>
- "hello" &lt; "a"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello >= "z"
- </Original>
- <Expanded>
- "hello" >= "z"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello &lt;= "a"
- </Original>
- <Expanded>
- "hello" &lt;= "a"
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Ordering comparison checks that should succeed" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt; 8
- </Original>
- <Expanded>
- 7 &lt; 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven > 6
- </Original>
- <Expanded>
- 7 > 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven > 0
- </Original>
- <Expanded>
- 7 > 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven > -1
- </Original>
- <Expanded>
- 7 > -1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven >= 7
- </Original>
- <Expanded>
- 7 >= 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven >= 6
- </Original>
- <Expanded>
- 7 >= 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt;= 7
- </Original>
- <Expanded>
- 7 &lt;= 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.int_seven &lt;= 8
- </Original>
- <Expanded>
- 7 &lt;= 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one > 9
- </Original>
- <Expanded>
- 9.1f > 9
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one &lt; 10
- </Original>
- <Expanded>
- 9.1f &lt; 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.float_nine_point_one &lt; 9.2
- </Original>
- <Expanded>
- 9.1f &lt; 9.2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello &lt;= "hello"
- </Original>
- <Expanded>
- "hello" &lt;= "hello"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello >= "hello"
- </Original>
- <Expanded>
- "hello" >= "hello"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello &lt; "hellp"
- </Original>
- <Expanded>
- "hello" &lt; "hellp"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello &lt; "zebra"
- </Original>
- <Expanded>
- "hello" &lt; "zebra"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello > "hellm"
- </Original>
- <Expanded>
- "hello" > "hellm"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- data.str_hello > "a"
- </Original>
- <Expanded>
- "hello" > "a"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Our PCG implementation provides expected results for known seeds" tags="[rng]" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Section name="Default seeded" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 4242248763 (0x<hex digits>)
-==
-4242248763 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 1867888929 (0x<hex digits>)
-==
-1867888929 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 1276619030 (0x<hex digits>)
-==
-1276619030 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 1911218783 (0x<hex digits>)
-==
-1911218783 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 1827115164 (0x<hex digits>)
-==
-1827115164 (0x<hex digits>)
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Specific seed" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 1472234645 (0x<hex digits>)
-==
-1472234645 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 868832940 (0x<hex digits>)
-==
-868832940 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 570883446 (0x<hex digits>)
-==
-570883446 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 889299803 (0x<hex digits>)
-==
-889299803 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 4261393167 (0x<hex digits>)
-==
-4261393167 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 1472234645 (0x<hex digits>)
-==
-1472234645 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 868832940 (0x<hex digits>)
-==
-868832940 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 570883446 (0x<hex digits>)
-==
-570883446 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 889299803 (0x<hex digits>)
-==
-889299803 (0x<hex digits>)
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" >
- <Original>
- rng() == 0x<hex digits>
- </Original>
- <Expanded>
- 4261393167 (0x<hex digits>)
-==
-4261393167 (0x<hex digits>)
- </Expanded>
- </Expression>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Output from all sections is reported" tags="[!hide][.][failing][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Section name="one" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- Message from section one
- </Failure>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- Message from section two
- </Failure>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Parse test names and tags" tags="[command-line][test-spec]" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Empty test spec should have no filters" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Test spec from empty string should have no filters" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches(tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Test spec from just a comma should have no filters" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Test spec from name should have one filter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Test spec from quoted name should have one filter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Test spec from name should have one filter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Wildcard at the start" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- parseTestSpec( "*a" ).matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Wildcard at the end" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- parseTestSpec( "a*" ).matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Wildcard at both ends" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- parseTestSpec( "*a*" ).matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Redundant wildcard at the start" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Redundant wildcard at the end" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Redundant wildcard at both ends" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Wildcard at both ends, redundant at start" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Just wildcard" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Single tag" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Single tag, two matches" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Two tags" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Two tags, spare separated" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Wildcarded name and tag" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Single tag exclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="One tag exclusion and one tag inclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="One tag exclusion and one wldcarded name inclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="One tag exclusion, using exclude:, and one wldcarded name inclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="name exclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="wildcarded name exclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="wildcarded name exclusion with tag inclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="wildcarded name exclusion, using exclude:, with tag inclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="two wildcarded names" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="empty tag" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="empty quoted name" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="quoted string followed by tag exclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.hasFilters() == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcA ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcB ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcC ) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( tcD ) == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Leading and trailing spaces in test spec" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( " aardvark " ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( " aardvark" ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( " aardvark " ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( "aardvark " ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( "aardvark" ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Leading and trailing spaces in test name" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( " aardvark " ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( " aardvark" ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( " aardvark " ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( "aardvark " ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches( fakeTestCase( "aardvark" ) )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Shortened hide tags are split apart when parsing" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches(fakeTestCase("hidden and foo", "[.][foo]"))
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !(spec.matches(fakeTestCase("only foo", "[foo]")))
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Shortened hide tags also properly handle exclusion" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !(spec.matches(fakeTestCase("hidden and foo", "[.][foo]")))
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !(spec.matches(fakeTestCase("only foo", "[foo]")))
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !(spec.matches(fakeTestCase("only hidden", "[.]")))
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- spec.matches(fakeTestCase("neither foo nor hidden", "[bar]"))
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Pointers can be compared to null" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- p == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- p == pNULL
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- p != 0
- </Original>
- <Expanded>
- 0x<hex digits> != 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- cp != 0
- </Original>
- <Expanded>
- 0x<hex digits> != 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- cpc != 0
- </Original>
- <Expanded>
- 0x<hex digits> != 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- returnsNull() == 0
- </Original>
- <Expanded>
- {null string} == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- returnsConstNull() == 0
- </Original>
- <Expanded>
- {null string} == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- 0 != p
- </Original>
- <Expanded>
- 0 != 0x<hex digits>
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Precision of floating point stringification can be set" tags="[floatingPoint][toString]" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Section name="Floats" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- str1.size() == 3 + 5
- </Original>
- <Expanded>
- 8 == 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- str2.size() == 3 + 10
- </Original>
- <Expanded>
- 13 == 13
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Double" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- str1.size() == 2 + 5
- </Original>
- <Expanded>
- 7 == 7
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- str2.size() == 2 + 15
- </Original>
- <Expanded>
- 17 == 17
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Predicate matcher can accept const char*" tags="[compilation][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- "foo", Predicate&lt;const char*>([] (const char* const&amp;) { return true; })
- </Original>
- <Expanded>
- "foo" matches undescribed predicate
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Process can be configured on command line" tags="[command-line][config]" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="empty args don't cause a crash" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.processName == ""
- </Original>
- <Expanded>
- "" == ""
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="default - no arguments" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.processName == "test"
- </Original>
- <Expanded>
- "test" == "test"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.shouldDebugBreak == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.abortAfter == -1
- </Original>
- <Expanded>
- -1 == -1
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.noThrow == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.reporterName == "console"
- </Original>
- <Expanded>
- "console" == "console"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !(cfg.hasTestFilters())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <OverallResults successes="7" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="test lists" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Specify one test case using" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.hasTestFilters()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.testSpec().matches(fakeTestCase("notIncluded")) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.testSpec().matches(fakeTestCase("test1"))
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="test lists" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Specify one test case exclusion using exclude:" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.hasTestFilters()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.testSpec().matches(fakeTestCase("test1")) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.testSpec().matches(fakeTestCase("alwaysIncluded"))
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="test lists" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Specify one test case exclusion using ~" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.hasTestFilters()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.testSpec().matches(fakeTestCase("test1")) == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cfg.testSpec().matches(fakeTestCase("alwaysIncluded"))
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="reporter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-r/console" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-r", "console"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.reporterName == "console"
- </Original>
- <Expanded>
- "console" == "console"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="reporter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-r/xml" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-r", "xml"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.reporterName == "xml"
- </Original>
- <Expanded>
- "xml" == "xml"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="reporter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="--reporter/junit" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--reporter", "junit"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.reporterName == "junit"
- </Original>
- <Expanded>
- "junit" == "junit"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="reporter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Only one reporter is accepted" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !(cli.parse({ "test", "-r", "xml", "-r", "junit" }))
- </Original>
- <Expanded>
- !{?}
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="reporter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="must match one of the available ones" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !result
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result.errorMessage(), Contains("Unrecognized reporter")
- </Original>
- <Expanded>
- "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="debugger" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-b" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-b"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.shouldDebugBreak == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="debugger" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="--break" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--break"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.shouldDebugBreak
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-a aborts after first failure" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-a"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.abortAfter == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-x 2 aborts after two failures" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-x", "2"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.abortAfter == 2
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-x must be numeric" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !result
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result.errorMessage(), Contains("convert") &amp;&amp; Contains("oops")
- </Original>
- <Expanded>
- "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" )
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="wait-for-keypress" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Accepted options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--wait-for-keypress", std::get&lt;0>(input)})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.waitForKeypress == std::get&lt;1>(input)
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="wait-for-keypress" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Accepted options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--wait-for-keypress", std::get&lt;0>(input)})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.waitForKeypress == std::get&lt;1>(input)
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="wait-for-keypress" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Accepted options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--wait-for-keypress", std::get&lt;0>(input)})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.waitForKeypress == std::get&lt;1>(input)
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="wait-for-keypress" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Accepted options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--wait-for-keypress", std::get&lt;0>(input)})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.waitForKeypress == std::get&lt;1>(input)
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="abort" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="wait-for-keypress" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="invalid options are reported" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !result
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result.errorMessage(), Contains("never") &amp;&amp; Contains("both")
- </Original>
- <Expanded>
- "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" )
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="nothrow" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-e" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-e"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.noThrow
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="nothrow" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="--nothrow" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--nothrow"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.noThrow
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="output filename" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="-o filename" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-o", "filename.ext"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.outputFilename == "filename.ext"
- </Original>
- <Expanded>
- "filename.ext" == "filename.ext"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="output filename" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="--out" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--out", "filename.ext"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.outputFilename == "filename.ext"
- </Original>
- <Expanded>
- "filename.ext" == "filename.ext"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="combinations" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="Single character flags can be combined" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "-abe"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.abortAfter == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.shouldDebugBreak
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.noThrow == true
- </Original>
- <Expanded>
- true == true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="use-colour" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="without option" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.useColour == UseColour::Auto
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="use-colour" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="auto" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--use-colour", "auto"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.useColour == UseColour::Auto
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="use-colour" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="yes" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--use-colour", "yes"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.useColour == UseColour::Yes
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="use-colour" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="no" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({"test", "--use-colour", "no"})
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.useColour == UseColour::No
- </Original>
- <Expanded>
- 2 == 2
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="use-colour" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="error" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- !result
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- result.errorMessage(), Contains( "colour mode must be one of" )
- </Original>
- <Expanded>
- "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Benchmark options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="samples" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({ "test", "--benchmark-samples=200" })
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.benchmarkSamples == 200
- </Original>
- <Expanded>
- 200 == 200
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Benchmark options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="resamples" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({ "test", "--benchmark-resamples=20000" })
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.benchmarkResamples == 20000
- </Original>
- <Expanded>
- 20000 (0x<hex digits>) == 20000 (0x<hex digits>)
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Benchmark options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="confidence-interval" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({ "test", "--benchmark-confidence-interval=0.99" })
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.benchmarkConfidenceInterval == Catch::Detail::Approx(0.99)
- </Original>
- <Expanded>
- 0.99 == Approx( 0.99 )
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Benchmark options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="no-analysis" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({ "test", "--benchmark-no-analysis" })
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.benchmarkNoAnalysis
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Benchmark options" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Section name="warmup-time" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- cli.parse({ "test", "--benchmark-warmup-time=10" })
- </Original>
- <Expanded>
- {?}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <Original>
- config.benchmarkWarmupTime == 10
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Product with differing arities - std::tuple&lt;int, double, float>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- std::tuple_size&lt;TestType>::value >= 1
- </Original>
- <Expanded>
- 3 >= 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Product with differing arities - std::tuple&lt;int, double>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- std::tuple_size&lt;TestType>::value >= 1
- </Original>
- <Expanded>
- 2 >= 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Product with differing arities - std::tuple&lt;int>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- std::tuple_size&lt;TestType>::value >= 1
- </Original>
- <Expanded>
- 1 >= 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Reconstruction should be based on stringification: #914" tags="[!hide][.][Decomposition][failing]" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
- <Original>
- truthy(false)
- </Original>
- <Expanded>
- Hey, its truthy!
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Regex string matcher" tags="[!hide][.][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Matches("this STRING contains 'abc' as a substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Matches("contains 'abc' as a substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Matches("this string contains 'abc' as a")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Regression test #1" tags="[matchers][vector]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- actual, !UnorderedEquals(expected)
- </Original>
- <Expanded>
- { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="SUCCEED counts as a test pass" tags="[messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="SUCCEED does not require an argument" tags="[!hide][.][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods" tags="[bdd][fixtures]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Given: No operations precede me" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- before == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Section name="When: We get the count" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Then: Subsequently values are higher" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- after > before
- </Original>
- <Expanded>
- 1 > 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Scenario: Do that thing with the thing" tags="[Tags]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Given: This stuff exists" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="And given: And some assumption" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="When: I do this" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Then: it should do this" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- itDoesThis()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="And: do that" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- itDoesThat()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Scenario: This is a really long scenario name to see how the list command deals with wrapping" tags="[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter][long][lots][one very long tag name that should cause line wrapping writing out using the list command][tags][verbose][very long tags]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Given: A section name that is so long that it cannot fit in a single console width" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="When: The test headers are printed as part of the normal running of the scenario" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Scenario: Vector resizing affects size and capacity" tags="[bdd][capacity][size][vector]" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Given: an empty vector" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Section name="When: it is made larger" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Then: the size and capacity go up" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.size() == 10
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <Section name="And when: it is made smaller again" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Then: the size goes down but the capacity stays the same" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Given: an empty vector" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Section name="When: we reserve more space" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Section name="Then: The capacity is increased but the size remains the same" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/BDD.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Sends stuff to stdout and stderr" tags="[!hide][.]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="false">
- <StdOut>
-A string sent directly to stdout
- </StdOut>
- <StdErr>
-A string sent directly to stderr
-A string sent to stderr via clog
- </StdErr>
- </OverallResult>
- </TestCase>
- <TestCase name="Some simple comparisons between doubles" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == Approx( 1.23 )
- </Original>
- <Expanded>
- 1.23 == Approx( 1.23 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d != Approx( 1.22 )
- </Original>
- <Expanded>
- 1.23 != Approx( 1.22 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d != Approx( 1.24 )
- </Original>
- <Expanded>
- 1.23 != Approx( 1.24 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == 1.23_a
- </Original>
- <Expanded>
- 1.23 == Approx( 1.23 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d != 1.22_a
- </Original>
- <Expanded>
- 1.23 != Approx( 1.22 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx( d ) == 1.23
- </Original>
- <Expanded>
- Approx( 1.23 ) == 1.23
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx( d ) != 1.22
- </Original>
- <Expanded>
- Approx( 1.23 ) != 1.22
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- Approx( d ) != 1.24
- </Original>
- <Expanded>
- Approx( 1.23 ) != 1.24
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Standard output from all sections is reported" tags="[!hide][.][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Section name="one" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <Section name="two" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <OverallResult success="false">
- <StdOut>
-Message from section one
-Message from section two
- </StdOut>
- </OverallResult>
- </TestCase>
- <TestCase name="StartsWith string matcher" tags="[!hide][.][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), StartsWith("This String")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" starts with: "This String"
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" starts with: "string" (case insensitive)
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Static arrays are convertible to string" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Section name="Single item" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify(singular) == "{ 1 }"
- </Original>
- <Expanded>
- "{ 1 }" == "{ 1 }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Multiple" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify(arr) == "{ 3, 2, 1 }"
- </Original>
- <Expanded>
- "{ 3, 2, 1 }" == "{ 3, 2, 1 }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Non-trivial inner items" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })"
- </Original>
- <Expanded>
- "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }"
-==
-"{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="String matchers" tags="[matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("string")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" contains: "string"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("string", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" contains: "string" (case insensitive)
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("abc")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" contains: "abc"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" contains: "abc" (case insensitive)
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), StartsWith("this")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" starts with: "this"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" starts with: "this" (case insensitive)
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), EndsWith("substring")
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ends with: "substring"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No)
- </Original>
- <Expanded>
- "this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="StringRef" tags="[StringRef][Strings]" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="Empty string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- empty.empty()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- empty.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- empty.isNullTerminated()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- std::strcmp( empty.c_str(), "" ) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From string literal" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.empty() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.isNullTerminated()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- std::strcmp( rawChars, "hello" ) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.c_str()
- </Original>
- <Expanded>
- s.c_str()
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.c_str() == rawChars
- </Original>
- <Expanded>
- "hello" == "hello"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.data() == rawChars
- </Original>
- <Expanded>
- "hello" == "hello"
- </Expanded>
- </Expression>
- <OverallResults successes="7" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="From sub-string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- original == "original"
- </Original>
- <Expanded>
- original == "original"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- !(original.isNullTerminated())
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- original.c_str()
- </Original>
- <Expanded>
- original.c_str()
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- original.data()
- </Original>
- <Expanded>
- original.data()
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="zero-based substring" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- ss.empty() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- ss.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- std::strncmp( ss.data(), "hello", 5 ) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- ss == "hello"
- </Original>
- <Expanded>
- hello == "hello"
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="non-zero-based substring" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- ss.size() == 6
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- std::strcmp( ss.c_str(), "world!" ) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="Pointer values of full refs should match" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.data() == s2.data()
- </Original>
- <Expanded>
- "hello world!" == "hello world!"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="Pointer values of substring refs should also match" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.data() == ss.data()
- </Original>
- <Expanded>
- "hello world!" == "hello world!"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="Past the end substring" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- s.substr(s.size() + 1, 123).empty()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="Substring off the end are trimmed" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- std::strcmp(ss.c_str(), "world!") == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Comparisons are deep" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- (char*)buffer1 != (char*)buffer2
- </Original>
- <Expanded>
- "Hello" != "Hello"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- left == right
- </Original>
- <Expanded>
- Hello == Hello
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- left != left.substr(0, 3)
- </Original>
- <Expanded>
- Hello != Hel
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from std::string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="implicitly constructed" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- sr == "a standard string"
- </Original>
- <Expanded>
- a standard string == "a standard string"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- sr.size() == stdStr.size()
- </Original>
- <Expanded>
- 17 == 17
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from std::string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="explicitly constructed" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- sr == "a standard string"
- </Original>
- <Expanded>
- a standard string == "a standard string"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- sr.size() == stdStr.size()
- </Original>
- <Expanded>
- 17 == 17
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="from std::string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="assigned" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- sr == "a standard string"
- </Original>
- <Expanded>
- a standard string == "a standard string"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- sr.size() == stdStr.size()
- </Original>
- <Expanded>
- 17 == 17
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="to std::string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="explicitly constructed" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- stdStr == "a stringref"
- </Original>
- <Expanded>
- "a stringref" == "a stringref"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- stdStr.size() == sr.size()
- </Original>
- <Expanded>
- 11 == 11
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="to std::string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="assigned" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- stdStr == "a stringref"
- </Original>
- <Expanded>
- "a stringref" == "a stringref"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Original>
- stdStr.size() == sr.size()
- </Original>
- <Expanded>
- 11 == 11
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="StringRef at compilation time" tags="[StringRef][Strings][constexpr]" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <Section name="Simple constructors" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="UDL construction" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Original>
- minute == seconds
- </Original>
- <Expanded>
- 1 m == 60 s
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Original>
- hour != seconds
- </Original>
- <Expanded>
- 1 h != 60 s
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Original>
- micro != milli
- </Original>
- <Expanded>
- 1 us != 1 ms
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Original>
- nano != micro
- </Original>
- <Expanded>
- 1 ns != 1 us
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Stringifying std::chrono::duration with weird ratios" tags="[chrono][toString]" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Original>
- half_minute != femto_second
- </Original>
- <Expanded>
- 1 [30/1]s != 1 fs
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Original>
- pico_second != atto_second
- </Original>
- <Expanded>
- 1 ps != 1 as
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Stringifying std::chrono::time_point&lt;system_clock>" tags="[chrono][toString]" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
- <Original>
- now != later
- </Original>
- <Expanded>
- {iso8601-timestamp}
-!=
-{iso8601-timestamp}
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Tabs and newlines show in output" tags="[!hide][.][failing][whitespace]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- s1 == s2
- </Original>
- <Expanded>
- "if ($b == 10) {
- $a = 20;
-}"
-==
-"if ($b == 10) {
- $a = 20;
-}
-"
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Tag alias can be registered against tag patterns" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Section name="The same tag alias can only be registered once" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- what, Contains( "[@zzz]" )
- </Original>
- <Expanded>
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "[@zzz]"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- what, Contains( "file" )
- </Original>
- <Expanded>
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "file"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- what, Contains( "2" )
- </Original>
- <Expanded>
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "2"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- what, Contains( "10" )
- </Original>
- <Expanded>
- "error: tag alias, '[@zzz]' already registered.
- First seen at: file:2
- Redefined at: file:10" contains: "10"
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Tag aliases must be of the form [@name]" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) )
- </Original>
- <Expanded>
- registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) )
- </Original>
- <Expanded>
- registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) )
- </Original>
- <Expanded>
- registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) )
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
- </Original>
- <Expanded>
- registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" tags="[class][list][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 1" tags="[class][list][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 2" tags="[class][list][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" >
- <Original>
- Template_Fixture&lt;TestType>::m_a == 1
- </Original>
- <Expanded>
- 1.0 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0" tags="[list][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- sizeof(TestType) > 0
- </Original>
- <Expanded>
- 1 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1" tags="[list][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- sizeof(TestType) > 0
- </Original>
- <Expanded>
- 4 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0" tags="[list][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- sizeof(TestType) > 0
- </Original>
- <Expanded>
- 1 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1" tags="[list][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- sizeof(TestType) > 0
- </Original>
- <Expanded>
- 4 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 0" tags="[list][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- sizeof(TestType) > 0
- </Original>
- <Expanded>
- 4 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 1" tags="[list][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- sizeof(TestType) > 0
- </Original>
- <Expanded>
- 1 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 2" tags="[list][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- sizeof(TestType) > 0
- </Original>
- <Expanded>
- 4 > 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTest: vectors can be sized and resized - float" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 10
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTest: vectors can be sized and resized - int" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 10
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTest: vectors can be sized and resized - std::string" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 10
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTest: vectors can be sized and resized - std::tuple&lt;int,float>" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 10
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple&lt;int, float>), 6" tags="[nttp][template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 6 >= 6
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 2 * V
- </Original>
- <Expanded>
- 12 == 12
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 12 >= 12
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 6 >= 6
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 6 >= 6
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 6 >= 6
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 12 >= 12
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 6 >= 6
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 6 >= 6
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTestSig: vectors can be sized and resized - float,4" tags="[nttp][template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 4 >= 4
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 2 * V
- </Original>
- <Expanded>
- 8 == 8
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 8 >= 8
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 4 >= 4
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 4 >= 4
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 4 >= 4
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 8 >= 8
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 4 >= 4
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 4 >= 4
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTestSig: vectors can be sized and resized - int,5" tags="[nttp][template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 2 * V
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="TemplateTestSig: vectors can be sized and resized - std::string,15" tags="[nttp][template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 15 == 15
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 15 >= 15
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 2 * V
- </Original>
- <Expanded>
- 30 == 30
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 30 >= 30
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 15 == 15
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 15 >= 15
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 15 >= 15
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 15 == 15
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 15 >= 15
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 15 == 15
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 2 * V
- </Original>
- <Expanded>
- 30 >= 30
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 15 == 15
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 15 >= 15
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == V
- </Original>
- <Expanded>
- 15 == 15
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= V
- </Original>
- <Expanded>
- 15 >= 15
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Test case with one argument" filename="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Test enum bit values" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- 0x<hex digits> == bit30and31
- </Original>
- <Expanded>
- 3221225472 (0x<hex digits>) == 3221225472
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Test with special, characters &quot;in name" tags="[cli][regression]" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Expression success="false" type="CHECK_NOFAIL" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- 1 == 2
- </Original>
- <Expanded>
- 1 == 2
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="This test 'should' fail but doesn't" tags="[!hide][!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Thrown string literals are translated" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- For some reason someone is throwing a string literal!
- </Exception>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Tracker" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="successfully close one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isSuccessfullyCompleted()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isSuccessfullyCompleted()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="fail one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isSuccessfullyCompleted() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isSuccessfullyCompleted() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Section name="re-enter after failed section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase2.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1b.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isSuccessfullyCompleted()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="5" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="fail one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isSuccessfullyCompleted() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isSuccessfullyCompleted() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Section name="re-enter after failed section and find next section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase2.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1b.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isSuccessfullyCompleted()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="11" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="successfully close one section, then find another" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Section name="Re-enter - skips S1 and enters S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase2.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1b.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2b.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Section name="Successfully close S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2b.isSuccessfullyCompleted()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase2.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase2.isSuccessfullyCompleted()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="10" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="successfully close one section, then find another" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Section name="Re-enter - skips S1 and enters S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase2.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1b.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2b.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Section name="fail S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- ctx.completedCycle()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2b.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2b.isSuccessfullyCompleted() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase2.isSuccessfullyCompleted() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase3.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1c.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2c.isOpen() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase3.isSuccessfullyCompleted()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="8" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="12" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="14" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Section name="open a nested section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2.isOpen()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s2.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- s1.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete() == false
- </Original>
- <Expanded>
- false == false
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
- <Original>
- testCase.isComplete()
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResults successes="6" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Trim strings" tags="[string-manip]" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(std::string(no_whitespace)) == no_whitespace
- </Original>
- <Expanded>
- "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(std::string(leading_whitespace)) == no_whitespace
- </Original>
- <Expanded>
- "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(std::string(trailing_whitespace)) == no_whitespace
- </Original>
- <Expanded>
- "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(std::string(whitespace_at_both_ends)) == no_whitespace
- </Original>
- <Expanded>
- "There is no extra whitespace here"
-==
-"There is no extra whitespace here"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(StringRef(no_whitespace)) == StringRef(no_whitespace)
- </Original>
- <Expanded>
- There is no extra whitespace here
-==
-There is no extra whitespace here
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(StringRef(leading_whitespace)) == StringRef(no_whitespace)
- </Original>
- <Expanded>
- There is no extra whitespace here
-==
-There is no extra whitespace here
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace)
- </Original>
- <Expanded>
- There is no extra whitespace here
-==
-There is no extra whitespace here
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace)
- </Original>
- <Expanded>
- There is no extra whitespace here
-==
-There is no extra whitespace here
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Unexpected exceptions can be translated" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- 3.14
- </Exception>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Use a custom approx" tags="[Approx][custom]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == approx( 1.23 )
- </Original>
- <Expanded>
- 1.23 == Approx( 1.23 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == approx( 1.22 )
- </Original>
- <Expanded>
- 1.23 == Approx( 1.22 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d == approx( 1.24 )
- </Original>
- <Expanded>
- 1.23 == Approx( 1.24 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- d != approx( 1.25 )
- </Original>
- <Expanded>
- 1.23 != Approx( 1.25 )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- approx( d ) == 1.23
- </Original>
- <Expanded>
- Approx( 1.23 ) == 1.23
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- approx( d ) == 1.22
- </Original>
- <Expanded>
- Approx( 1.23 ) == 1.22
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- approx( d ) == 1.24
- </Original>
- <Expanded>
- Approx( 1.23 ) == 1.24
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" >
- <Original>
- approx( d ) != 1.25
- </Original>
- <Expanded>
- Approx( 1.23 ) != 1.25
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Variadic macros" tags="[sections][variadic]" filename="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp" >
- <Section name="Section with one argument" filename="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Vector Approx matcher" tags="[approx][matchers][vector]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Empty vector is roughly equal to an empty vector" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, Approx(empty)
- </Original>
- <Expanded>
- { } is approx: { }
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Vectors with elements" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="A vector is approx equal to itself" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, Approx(v1)
- </Original>
- <Expanded>
- { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 }
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Vectors with elements" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Different length" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, !Approx(temp)
- </Original>
- <Expanded>
- { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 }
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Vectors with elements" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Same length, different elements" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, !Approx(v2)
- </Original>
- <Expanded>
- { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 }
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, Approx(v2).margin(0.5)
- </Original>
- <Expanded>
- { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, Approx(v2).epsilon(0.5)
- </Original>
- <Expanded>
- { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, Approx(v2).epsilon(0.1).scale(500)
- </Original>
- <Expanded>
- { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 }
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Vector Approx matcher -- failing" tags="[!hide][.][approx][failing][matchers][vector]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Empty and non empty vectors are not approx equal" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, Approx(t1)
- </Original>
- <Expanded>
- { } is approx: { 1.0, 2.0 }
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <Section name="Just different vectors" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v1, Approx(v2)
- </Original>
- <Expanded>
- { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Vector matchers" tags="[matchers][vector]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Contains (element)" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, VectorContains(1)
- </Original>
- <Expanded>
- { 1, 2, 3 } Contains: 1
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, VectorContains(2)
- </Original>
- <Expanded>
- { 1, 2, 3 } Contains: 2
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Contains (vector)" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Contains(v2)
- </Original>
- <Expanded>
- { 1, 2, 3 } Contains: { 1, 2 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Contains(v2)
- </Original>
- <Expanded>
- { 1, 2, 3 } Contains: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Contains(empty)
- </Original>
- <Expanded>
- { 1, 2, 3 } Contains: { }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, Contains(empty)
- </Original>
- <Expanded>
- { } Contains: { }
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Contains (element), composed" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, VectorContains(1) &amp;&amp; VectorContains(2)
- </Original>
- <Expanded>
- { 1, 2, 3 } ( Contains: 1 and Contains: 2 )
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Equals" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Equals(v)
- </Original>
- <Expanded>
- { 1, 2, 3 } Equals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, Equals(empty)
- </Original>
- <Expanded>
- { } Equals: { }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Equals(v2)
- </Original>
- <Expanded>
- { 1, 2, 3 } Equals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="UnorderedEquals" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, UnorderedEquals(v)
- </Original>
- <Expanded>
- { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, UnorderedEquals(empty)
- </Original>
- <Expanded>
- { } UnorderedEquals: { }
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- permuted, UnorderedEquals(v)
- </Original>
- <Expanded>
- { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- permuted, UnorderedEquals(v)
- </Original>
- <Expanded>
- { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <OverallResults successes="4" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="Vector matchers that fail" tags="[!hide][.][failing][matchers][vector]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Section name="Contains (element)" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, VectorContains(-1)
- </Original>
- <Expanded>
- { 1, 2, 3 } Contains: -1
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, VectorContains(1)
- </Original>
- <Expanded>
- { } Contains: 1
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="2" expectedFailures="0"/>
- </Section>
- <Section name="Contains (vector)" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, Contains(v)
- </Original>
- <Expanded>
- { } Contains: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Contains(v2)
- </Original>
- <Expanded>
- { 1, 2, 3 } Contains: { 1, 2, 4 }
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="2" expectedFailures="0"/>
- </Section>
- <Section name="Equals" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Equals(v2)
- </Original>
- <Expanded>
- { 1, 2, 3 } Equals: { 1, 2 }
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v2, Equals(v)
- </Original>
- <Expanded>
- { 1, 2 } Equals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, Equals(v)
- </Original>
- <Expanded>
- { } Equals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, Equals(empty)
- </Original>
- <Expanded>
- { 1, 2, 3 } Equals: { }
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="4" expectedFailures="0"/>
- </Section>
- <Section name="UnorderedEquals" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- v, UnorderedEquals(empty)
- </Original>
- <Expanded>
- { 1, 2, 3 } UnorderedEquals: { }
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- empty, UnorderedEquals(v)
- </Original>
- <Expanded>
- { } UnorderedEquals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- permuted, UnorderedEquals(v)
- </Original>
- <Expanded>
- { 1, 3 } UnorderedEquals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
- <Original>
- permuted, UnorderedEquals(v)
- </Original>
- <Expanded>
- { 3, 1 } UnorderedEquals: { 1, 2, 3 }
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="4" expectedFailures="0"/>
- </Section>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="When checked exceptions are thrown they can be expected or unexpected" tags="[!throws]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows(), std::domain_error
- </Original>
- <Expanded>
- thisThrows(), std::domain_error
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_NOTHROW" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisDoesntThrow()
- </Original>
- <Expanded>
- thisDoesntThrow()
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THROWS" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows()
- </Original>
- <Expanded>
- thisThrows()
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="When unchecked exceptions are thrown directly they are always failures" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- unexpected exception
- </Exception>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="When unchecked exceptions are thrown during a CHECK the test should continue" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows() == 0
- </Original>
- <Expanded>
- thisThrows() == 0
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- expected exception
- </Exception>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="When unchecked exceptions are thrown during a REQUIRE the test should abort fail" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows() == 0
- </Original>
- <Expanded>
- thisThrows() == 0
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- expected exception
- </Exception>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="When unchecked exceptions are thrown from functions they are always failures" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Original>
- thisThrows() == 0
- </Original>
- <Expanded>
- thisThrows() == 0
- </Expanded>
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- expected exception
- </Exception>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="When unchecked exceptions are thrown from sections they are always failures" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Section name="section name" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- unexpected exception
- </Exception>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" tags="[!throws]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Where the LHS is not a simple value" tags="[!hide][.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Warning>
- Uncomment the code in this test to check that it gives a sensible compiler error
- </Warning>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="Where there is more to the expression after the RHS" tags="[!hide][.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Warning>
- Uncomment the code in this test to check that it gives a sensible compiler error
- </Warning>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="X/level/0/a" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="X/level/0/b" tags="[Tricky][fizz]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="X/level/1/a" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="X/level/1/b" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="XmlEncode" tags="[XML]" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Section name="normal string" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "normal string" ) == "normal string"
- </Original>
- <Expanded>
- "normal string" == "normal string"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="empty string" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "" ) == ""
- </Original>
- <Expanded>
- "" == ""
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="string with ampersand" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "smith &amp; jones" ) == "smith &amp;amp; jones"
- </Original>
- <Expanded>
- "smith &amp;amp; jones" == "smith &amp;amp; jones"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="string with less-than" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "smith &lt; jones" ) == "smith &amp;lt; jones"
- </Original>
- <Expanded>
- "smith &amp;lt; jones" == "smith &amp;lt; jones"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="string with greater-than" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "smith > jones" ) == "smith > jones"
- </Original>
- <Expanded>
- "smith > jones" == "smith > jones"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "smith ]]&gt; jones" ) == "smith ]]&amp;gt; jones"
- </Original>
- <Expanded>
- "smith ]]&amp;gt; jones"
-==
-"smith ]]&amp;gt; jones"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="string with quotes" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( stringWithQuotes ) == stringWithQuotes
- </Original>
- <Expanded>
- "don't "quote" me on that"
-==
-"don't "quote" me on that"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &amp;quot;quote&amp;quot; me on that"
- </Original>
- <Expanded>
- "don't &amp;quot;quote&amp;quot; me on that"
-==
-"don't &amp;quot;quote&amp;quot; me on that"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="string with control char (1)" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "[\x01]" ) == "[\\x01]"
- </Original>
- <Expanded>
- "[\x01]" == "[\x01]"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="string with control char (x7F)" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/Xml.tests.cpp" >
- <Original>
- encode( "[\x7F]" ) == "[\\x7F]"
- </Original>
- <Expanded>
- "[\x7F]" == "[\x7F]"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="adding a hide tag implicitly enables all others" tags="[tags]" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- testcase.tags, VectorContains(std::string(".")) &amp;&amp; VectorContains(std::string("!hide"))
- </Original>
- <Expanded>
- { "!hide", "." } ( Contains: "." and Contains: "!hide" )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- testcase.tags, VectorContains(std::string(".")) &amp;&amp; VectorContains(std::string("!hide"))
- </Original>
- <Expanded>
- { "!hide", "." } ( Contains: "." and Contains: "!hide" )
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- testcase.tags, VectorContains(std::string(".")) &amp;&amp; VectorContains(std::string("!hide"))
- </Original>
- <Expanded>
- { "!hide", ".", "foo" } ( Contains: "." and Contains: "!hide" )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="array&lt;int, N> -> toString" tags="[array][containers][toString]" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- Catch::Detail::stringify( empty ) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- Catch::Detail::stringify( oneValue ) == "{ 42 }"
- </Original>
- <Expanded>
- "{ 42 }" == "{ 42 }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- Catch::Detail::stringify( twoValues ) == "{ 42, 250 }"
- </Original>
- <Expanded>
- "{ 42, 250 }" == "{ 42, 250 }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="atomic if" tags="[0][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- x == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="boolean member" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- obj.prop != 0
- </Original>
- <Expanded>
- 0x<hex digits> != 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="checkedElse" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECKED_ELSE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- flag
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- testCheckedElse( true )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="checkedElse, failing" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="false" type="CHECKED_ELSE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- flag
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- testCheckedElse( false )
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="checkedIf" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECKED_IF" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- flag
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- testCheckedIf( true )
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="checkedIf, failing" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="false" type="CHECKED_IF" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- flag
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- testCheckedIf( false )
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="comparisons between const int variables" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- unsigned_char_var == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- unsigned_short_var == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- unsigned_int_var == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- unsigned_long_var == 1
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="comparisons between int variables" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- long_var == unsigned_char_var
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- long_var == unsigned_short_var
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- long_var == unsigned_int_var
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" >
- <Original>
- long_var == unsigned_long_var
- </Original>
- <Expanded>
- 1 == 1
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="even more nested SECTION tests" tags="[sections]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="c" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="d (leaf)" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="c" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="e (leaf)" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="f (leaf)" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="first tag" tags="[tag1]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="has printf" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
-loose text artifact
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="just failure" tags="[!hide][.][fail][isolated info][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- Previous info should not be seen
- </Failure>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="just failure after unscoped info" tags="[!hide][.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- previous unscoped info SHOULD not be seen
- </Failure>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="just info" tags="[info][isolated info][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="just unscoped info" tags="[info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="long long" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- l == std::numeric_limits&lt;long long>::max()
- </Original>
- <Expanded>
- 9223372036854775807 (0x<hex digits>)
-==
-9223372036854775807 (0x<hex digits>)
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="looped SECTION tests" tags="[!hide][.][failing][sections]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="b is currently: 0" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 0 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 1" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 1 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 2" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 2 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 3" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 3 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 4" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 4 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 5" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 5 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 6" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 6 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 7" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 7 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 8" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 8 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="b is currently: 9" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b > a
- </Original>
- <Expanded>
- 9 > 1
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="looped tests" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Info>
- Testing if fib[0] (1) is even
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <Info>
- Testing if fib[1] (1) is even
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <Info>
- Testing if fib[2] (2) is even
- </Info>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Info>
- Testing if fib[3] (3) is even
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <Info>
- Testing if fib[4] (5) is even
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <Info>
- Testing if fib[5] (8) is even
- </Info>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Info>
- Testing if fib[6] (13) is even
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <Info>
- Testing if fib[7] (21) is even
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- ( fib[i] % 2 ) == 0
- </Original>
- <Expanded>
- 1 == 0
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="mix info, unscoped info and warning" tags="[info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- info
- </Info>
- <Info>
- unscoped info
- </Info>
- <Warning>
- and warn may mix
- </Warning>
- <Info>
- info
- </Info>
- <Info>
- unscoped info
- </Info>
- <Warning>
- they are not cleared after warnings
- </Warning>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="more nested SECTION tests" tags="[!hide][.][failing][sections]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="doesn't equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- a == b
- </Original>
- <Expanded>
- 1 == 2
- </Expanded>
- </Expression>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <OverallResults successes="0" failures="1" expectedFailures="0"/>
- </Section>
- <Section name="doesn't equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="not equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- a != b
- </Original>
- <Expanded>
- 1 != 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="doesn't equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="less than" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- a &lt; b
- </Original>
- <Expanded>
- 1 &lt; 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="nested SECTION tests" tags="[!hide][.][failing][sections]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="doesn't equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- a != b
- </Original>
- <Expanded>
- 1 != 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b != a
- </Original>
- <Expanded>
- 2 != 1
- </Expanded>
- </Expression>
- <Section name="not equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- a != b
- </Original>
- <Expanded>
- 1 != 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="non streamable - with conv. op" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- s == "7"
- </Original>
- <Expanded>
- "7" == "7"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="non-copyable objects" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- ti == typeid(int)
- </Original>
- <Expanded>
- {?} == {?}
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="not allowed" tags="[!throws]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="not prints unscoped info from previous failures" tags="[!hide][.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- this MAY be seen only for the FIRST assertion IF info is printed for passing assertions
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- this MAY be seen only for the SECOND assertion IF info is printed for passing assertions
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- this SHOULD be seen
- </Info>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- false
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="null strings" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- makeString( false ) != static_cast&lt;char*>(0)
- </Original>
- <Expanded>
- "valid string" != {null string}
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- makeString( true ) == static_cast&lt;char*>(0)
- </Original>
- <Expanded>
- {null string} == {null string}
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="null_ptr" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- ptr.get() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="pair&lt;pair&lt;int,const char *,pair&lt;std::string,int> > -> toString" tags="[pair][toString]" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }"
- </Original>
- <Expanded>
- "{ { 42, "Arthur" }, { "Ford", 24 } }"
-==
-"{ { 42, "Arthur" }, { "Ford", 24 } }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="parseEnums" tags="[Strings][enums]" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Section name="No enums" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- parseEnums( "" ), Equals( std::vector&lt;Catch::StringRef>{} )
- </Original>
- <Expanded>
- { } Equals: { }
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="One enum value" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector&lt;Catch::StringRef>{"Value1"} )
- </Original>
- <Expanded>
- { Value1 } Equals: { Value1 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- parseEnums( "Value1" ), Equals( std::vector&lt;Catch::StringRef>{"Value1"} )
- </Original>
- <Expanded>
- { Value1 } Equals: { Value1 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- parseEnums( "EnumName::Value1" ), Equals(std::vector&lt;Catch::StringRef>{"Value1"} )
- </Original>
- <Expanded>
- { Value1 } Equals: { Value1 }
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="Multiple enum values" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector&lt;Catch::StringRef>{"Value1", "Value2"} )
- </Original>
- <Expanded>
- { Value1, Value2 } Equals: { Value1, Value2 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector&lt;Catch::StringRef>{"Value1", "Value2", "Value3"} )
- </Original>
- <Expanded>
- { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
- <Original>
- parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector&lt;Catch::StringRef>{"Value1", "Value2", "Value3"} )
- </Original>
- <Expanded>
- { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
- </Expanded>
- </Expression>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="pointer to class" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- p == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="print unscoped info if passing unscoped info is printed" tags="[info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- this MAY be seen IF info is printed for passing assertions
- </Info>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="prints unscoped info on failure" tags="[!hide][.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- this SHOULD be seen
- </Info>
- <Info>
- this SHOULD also be seen
- </Info>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- false
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="prints unscoped info only for the first assertion" tags="[!hide][.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- this SHOULD be seen only ONCE
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- false
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Info>
- this MAY also be seen only ONCE IF info is printed for passing assertions
- </Info>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- true
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="random SECTION tests" tags="[!hide][.][failing][sections]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="doesn't equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- a != b
- </Original>
- <Expanded>
- 1 != 2
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- b != a
- </Original>
- <Expanded>
- 2 != 1
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="not equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- a != b
- </Original>
- <Expanded>
- 1 != 2
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="replaceInPlace" tags="[string-manip]" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Section name="replace single char" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- Catch::replaceInPlace(letters, "b", "z")
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- letters == "azcdefcg"
- </Original>
- <Expanded>
- "azcdefcg" == "azcdefcg"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="replace two chars" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- Catch::replaceInPlace(letters, "c", "z")
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- letters == "abzdefzg"
- </Original>
- <Expanded>
- "abzdefzg" == "abzdefzg"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="replace first char" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- Catch::replaceInPlace(letters, "a", "z")
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- letters == "zbcdefcg"
- </Original>
- <Expanded>
- "zbcdefcg" == "zbcdefcg"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="replace last char" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- Catch::replaceInPlace(letters, "g", "z")
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- letters == "abcdefcz"
- </Original>
- <Expanded>
- "abcdefcz" == "abcdefcz"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="replace all chars" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- Catch::replaceInPlace(letters, letters, "replaced")
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- letters == "replaced"
- </Original>
- <Expanded>
- "replaced" == "replaced"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="replace no chars" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- !(Catch::replaceInPlace(letters, "x", "z"))
- </Original>
- <Expanded>
- !false
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- letters == letters
- </Original>
- <Expanded>
- "abcdefcg" == "abcdefcg"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="escape '" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- Catch::replaceInPlace(s, "'", "|'")
- </Original>
- <Expanded>
- true
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- s == "didn|'t"
- </Original>
- <Expanded>
- "didn|'t" == "didn|'t"
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="second tag" tags="[tag2]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="send a single char to INFO" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Info>
- 3
- </Info>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- false
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="sends information to INFO" tags="[!hide][.][failing]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- hi
- </Info>
- <Info>
- i := 7
- </Info>
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- false
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="shortened hide tags are split apart" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
- <Original>
- testcase.tags, Catch::VectorContains(std::string("magic-tag")) &amp;&amp; Catch::VectorContains(std::string("."))
- </Original>
- <Expanded>
- { "!hide", ".", "magic-tag" } ( Contains: "magic-tag" and Contains: "." )
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="splitString" tags="[string-manip]" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- splitStringRef("", ','), Equals(std::vector&lt;StringRef>())
- </Original>
- <Expanded>
- { } Equals: { }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- splitStringRef("abc", ','), Equals(std::vector&lt;StringRef>{"abc"})
- </Original>
- <Expanded>
- { abc } Equals: { abc }
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" >
- <Original>
- splitStringRef("abc,def", ','), Equals(std::vector&lt;StringRef>{"abc", "def"})
- </Original>
- <Expanded>
- { abc, def } Equals: { abc, def }
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stacks unscoped info in loops" tags="[!hide][.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Info>
- Count 1 to 3...
- </Info>
- <Info>
- 1
- </Info>
- <Info>
- 2
- </Info>
- <Info>
- 3
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- false
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <Info>
- Count 4 to 6...
- </Info>
- <Info>
- 4
- </Info>
- <Info>
- 5
- </Info>
- <Info>
- 6
- </Info>
- <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
- <Original>
- false
- </Original>
- <Expanded>
- false
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="std::map is convertible string" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Section name="empty" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify( emptyMap ) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="single item" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }"
- </Original>
- <Expanded>
- "{ { "one", 1 } }" == "{ { "one", 1 } }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="several items" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }"
- </Original>
- <Expanded>
- "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }"
-==
-"{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="std::pair&lt;int,const std::string> -> toString" tags="[pair][toString]" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }"
- </Original>
- <Expanded>
- "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="std::pair&lt;int,std::string> -> toString" tags="[pair][toString]" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }"
- </Original>
- <Expanded>
- "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="std::set is convertible string" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Section name="empty" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify( emptySet ) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="single item" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify( set ) == "{ \"one\" }"
- </Original>
- <Expanded>
- "{ "one" }" == "{ "one" }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="several items" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
- <Original>
- Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }"
- </Original>
- <Expanded>
- "{ "abc", "def", "ghi" }"
-==
-"{ "abc", "def", "ghi" }"
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="std::vector&lt;std::pair&lt;std::string,int> > -> toString" tags="[pair][toString]" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringPair.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }"
- </Original>
- <Expanded>
- "{ { "green", 55 } }"
-==
-"{ { "green", 55 } }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="string literals of different sizes can be compared" tags="[!hide][.][Tricky][failing]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" >
- <Original>
- std::string( "first" ) == "second"
- </Original>
- <Expanded>
- "first" == "second"
- </Expanded>
- </Expression>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="stringify ranges" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(streamable_range{}) == "op&lt;&lt;(streamable_range)"
- </Original>
- <Expanded>
- "op&lt;&lt;(streamable_range)"
-==
-"op&lt;&lt;(streamable_range)"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)"
- </Original>
- <Expanded>
- "stringmaker(streamable_range)"
-==
-"stringmaker(streamable_range)"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }"
- </Original>
- <Expanded>
- "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }"
- </Original>
- <Expanded>
- "{ !!! }" == "{ !!! }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( has_maker )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( item ) == "StringMaker&lt;has_maker>"
- </Original>
- <Expanded>
- "StringMaker&lt;has_maker>"
-==
-"StringMaker&lt;has_maker>"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( has_maker_and_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( item ) == "StringMaker&lt;has_maker_and_operator>"
- </Original>
- <Expanded>
- "StringMaker&lt;has_maker_and_operator>"
-==
-"StringMaker&lt;has_maker_and_operator>"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( has_neither )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(item) == "{ !!! }"
- </Original>
- <Expanded>
- "{ !!! }" == "{ !!! }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( has_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( item ) == "operator&lt;&lt;( has_operator )"
- </Original>
- <Expanded>
- "operator&lt;&lt;( has_operator )"
-==
-"operator&lt;&lt;( has_operator )"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( has_template_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( item ) == "operator&lt;&lt;( has_template_operator )"
- </Original>
- <Expanded>
- "operator&lt;&lt;( has_template_operator )"
-==
-"operator&lt;&lt;( has_template_operator )"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( vectors&lt;has_maker> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( v ) == "{ StringMaker&lt;has_maker> }"
- </Original>
- <Expanded>
- "{ StringMaker&lt;has_maker> }"
-==
-"{ StringMaker&lt;has_maker> }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( vectors&lt;has_maker_and_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( v ) == "{ StringMaker&lt;has_maker_and_operator> }"
- </Original>
- <Expanded>
- "{ StringMaker&lt;has_maker_and_operator> }"
-==
-"{ StringMaker&lt;has_maker_and_operator> }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="stringify( vectors&lt;has_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify( v ) == "{ operator&lt;&lt;( has_operator ) }"
- </Original>
- <Expanded>
- "{ operator&lt;&lt;( has_operator ) }"
-==
-"{ operator&lt;&lt;( has_operator ) }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="strlen3" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- data.str.size() == data.len
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- data.str.size() == data.len
- </Original>
- <Expanded>
- 3 == 3
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- data.str.size() == data.len
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- data.str.size() == data.len
- </Original>
- <Expanded>
- 4 == 4
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="tables" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- strlen(std::get&lt;0>(data)) == static_cast&lt;size_t>(std::get&lt;1>(data))
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- strlen(std::get&lt;0>(data)) == static_cast&lt;size_t>(std::get&lt;1>(data))
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- strlen(std::get&lt;0>(data)) == static_cast&lt;size_t>(std::get&lt;1>(data))
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
- <Original>
- strlen(std::get&lt;0>(data)) == static_cast&lt;size_t>(std::get&lt;1>(data))
- </Original>
- <Expanded>
- 6 == 6
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="thrown std::strings are translated" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
- Why would you throw a std::string?
- </Exception>
- <OverallResult success="false"/>
- </TestCase>
- <TestCase name="toString on const wchar_t const pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- result == "\"wide load\""
- </Original>
- <Expanded>
- ""wide load"" == ""wide load""
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="toString on const wchar_t pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- result == "\"wide load\""
- </Original>
- <Expanded>
- ""wide load"" == ""wide load""
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="toString on wchar_t const pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- result == "\"wide load\""
- </Original>
- <Expanded>
- ""wide load"" == ""wide load""
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="toString on wchar_t returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- result == "\"wide load\""
- </Original>
- <Expanded>
- ""wide load"" == ""wide load""
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="toString(enum class w/operator&lt;&lt;)" tags="[enum][enumClass][toString]" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e0) == "E2/V0"
- </Original>
- <Expanded>
- "E2/V0" == "E2/V0"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e1) == "E2/V1"
- </Original>
- <Expanded>
- "E2/V1" == "E2/V1"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e3) == "Unknown enum value 10"
- </Original>
- <Expanded>
- "Unknown enum value 10"
-==
-"Unknown enum value 10"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="toString(enum class)" tags="[enum][enumClass][toString]" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e0) == "0"
- </Original>
- <Expanded>
- "0" == "0"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e1) == "1"
- </Original>
- <Expanded>
- "1" == "1"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="toString(enum w/operator&lt;&lt;)" tags="[enum][toString]" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e0) == "E2{0}"
- </Original>
- <Expanded>
- "E2{0}" == "E2{0}"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e1) == "E2{1}"
- </Original>
- <Expanded>
- "E2{1}" == "E2{1}"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="toString(enum)" tags="[enum][toString]" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e0) == "0"
- </Original>
- <Expanded>
- "0" == "0"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(e1) == "1"
- </Original>
- <Expanded>
- "1" == "1"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="tuple&lt;>" tags="[toString][tuple]" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "{ }" == ::Catch::Detail::stringify(type{})
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "{ }" == ::Catch::Detail::stringify(value)
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="tuple&lt;float,int>" tags="[toString][tuple]" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "1.2f" == ::Catch::Detail::stringify(float(1.2))
- </Original>
- <Expanded>
- "1.2f" == "1.2f"
- </Expanded>
- </Expression>
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0})
- </Original>
- <Expanded>
- "{ 1.2f, 0 }" == "{ 1.2f, 0 }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="tuple&lt;int>" tags="[toString][tuple]" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "{ 0 }" == ::Catch::Detail::stringify(type{0})
- </Original>
- <Expanded>
- "{ 0 }" == "{ 0 }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="tuple&lt;0,int,const char *>" tags="[toString][tuple]" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value)
- </Original>
- <Expanded>
- "{ 0, 42, "Catch me" }"
-==
-"{ 0, 42, "Catch me" }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="tuple&lt;string,string>" tags="[toString][tuple]" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"})
- </Original>
- <Expanded>
- "{ "hello", "world" }"
-==
-"{ "hello", "world" }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="tuple&lt;tuple&lt;int>,tuple&lt;>,float>" tags="[toString][tuple]" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/ToStringTuple.tests.cpp" >
- <Original>
- "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value)
- </Original>
- <Expanded>
- "{ { 42 }, { }, 1.2f }"
-==
-"{ { 42 }, { }, 1.2f }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="vec&lt;vec&lt;string,alloc>> -> toString" tags="[toString][vector,allocator]" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(v) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }"
- </Original>
- <Expanded>
- "{ { "hello" }, { "world" } }"
-==
-"{ { "hello" }, { "world" } }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="vector&lt;bool> -> toString" tags="[containers][toString][vector]" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(bools) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(bools) == "{ true }"
- </Original>
- <Expanded>
- "{ true }" == "{ true }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(bools) == "{ true, false }"
- </Original>
- <Expanded>
- "{ true, false }" == "{ true, false }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="vector&lt;int,allocator> -> toString" tags="[toString][vector,allocator]" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ 42 }"
- </Original>
- <Expanded>
- "{ 42 }" == "{ 42 }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ 42, 250 }"
- </Original>
- <Expanded>
- "{ 42, 250 }" == "{ 42, 250 }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="vector&lt;int> -> toString" tags="[toString][vector]" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ 42 }"
- </Original>
- <Expanded>
- "{ 42 }" == "{ 42 }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ 42, 250 }"
- </Original>
- <Expanded>
- "{ 42, 250 }" == "{ 42, 250 }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="vector&lt;string> -> toString" tags="[toString][vector]" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ }"
- </Original>
- <Expanded>
- "{ }" == "{ }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ \"hello\" }"
- </Original>
- <Expanded>
- "{ "hello" }" == "{ "hello" }"
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringVector.tests.cpp" >
- <Original>
- ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }"
- </Original>
- <Expanded>
- "{ "hello", "world" }"
-==
-"{ "hello", "world" }"
- </Expanded>
- </Expression>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="vectors can be sized and resized" tags="[vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 10
- </Original>
- <Expanded>
- 10 == 10
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() == 0
- </Original>
- <Expanded>
- 0 == 0
- </Expanded>
- </Expression>
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResults successes="3" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 10
- </Original>
- <Expanded>
- 10 >= 10
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.size() == 5
- </Original>
- <Expanded>
- 5 == 5
- </Expanded>
- </Expression>
- <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Original>
- v.capacity() >= 5
- </Original>
- <Expanded>
- 5 >= 5
- </Expanded>
- </Expression>
- <OverallResults successes="2" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <TestCase name="xmlentitycheck" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <Section name="embedded xml: &lt;test>it should be possible to embed xml characters, such as &lt;, &quot; or &amp;, or even whole &lt;xml>documents&lt;/xml> within an attribute&lt;/test>" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <Section name="encoded chars: these should all be encoded: &amp;&amp;&amp;&quot;&quot;&quot;&lt;&lt;&lt;&amp;&quot;&lt;&lt;&amp;&quot;" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
- <OverallResults successes="1" failures="0" expectedFailures="0"/>
- </Section>
- <OverallResult success="true"/>
- </TestCase>
- <OverallResults successes="1524" failures="149" expectedFailures="21"/>
- </Group>
- <OverallResults successes="1524" failures="148" expectedFailures="21"/>
-</Catch>
diff --git a/projects/SelfTest/CompileTimePerfTests/10.tests.cpp b/projects/SelfTest/CompileTimePerfTests/10.tests.cpp
deleted file mode 100644
index 01cd072d..00000000
--- a/projects/SelfTest/CompileTimePerfTests/10.tests.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// Include set of usage tests multiple times - for compile-time performance testing
-// (do not run)
-
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
-#include "All.tests.cpp"
diff --git a/projects/SelfTest/CompileTimePerfTests/100.tests.cpp b/projects/SelfTest/CompileTimePerfTests/100.tests.cpp
deleted file mode 100644
index e03ca838..00000000
--- a/projects/SelfTest/CompileTimePerfTests/100.tests.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// Include set of usage tests multiple times - for compile-time performance testing
-// (do not run)
-
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
-#include "10.tests.cpp"
diff --git a/projects/SelfTest/CompileTimePerfTests/All.tests.cpp b/projects/SelfTest/CompileTimePerfTests/All.tests.cpp
deleted file mode 100644
index 2b6a1029..00000000
--- a/projects/SelfTest/CompileTimePerfTests/All.tests.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// include set of usage tests into one file for compiler performance test purposes
-// This whole file can now be included multiple times in 10.tests.cpp, and *that*
-// file included multiple times (in 100.tests.cpp)
-
-// Note that the intention is only for these files to be compiled. They will
-// fail at runtime due to the re-user of test case names
-
-#include "../UsageTests/Approx.tests.cpp"
-#include "../UsageTests/BDD.tests.cpp"
-#include "../UsageTests/Class.tests.cpp"
-#include "../UsageTests/Compilation.tests.cpp"
-#include "../UsageTests/Condition.tests.cpp"
-#include "../UsageTests/Exception.tests.cpp"
-#include "../UsageTests/Matchers.tests.cpp"
-#include "../UsageTests/Misc.tests.cpp"
diff --git a/projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
deleted file mode 100644
index 6e590326..00000000
--- a/projects/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
- * Created by Phil on 13/5/2013.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-#include "internal/catch_test_spec_parser.h"
-#include "internal/catch_config.hpp"
-#include "internal/catch_commandline.h"
-
-#ifdef __clang__
-# pragma clang diagnostic ignored "-Wc++98-compat"
-#endif
-
-inline Catch::TestCase fakeTestCase(const char* name, const char* desc = "") { return Catch::makeTestCase(nullptr, "", { name, desc }, CATCH_INTERNAL_LINEINFO); }
-
-TEST_CASE( "Parse test names and tags", "[command-line][test-spec]" ) {
-
- using Catch::parseTestSpec;
- using Catch::TestSpec;
-
- Catch::TestCase tcA = fakeTestCase( "a" );
- Catch::TestCase tcB = fakeTestCase( "b", "[one][x]" );
- Catch::TestCase tcC = fakeTestCase( "longer name with spaces", "[two][three][.][x]" );
- Catch::TestCase tcD = fakeTestCase( "zlonger name with spacesz" );
-
- SECTION( "Empty test spec should have no filters" ) {
- TestSpec spec;
- CHECK( spec.hasFilters() == false );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- }
-
- SECTION( "Test spec from empty string should have no filters" ) {
- TestSpec spec = parseTestSpec( "" );
- CHECK( spec.hasFilters() == false );
- CHECK( spec.matches(tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- }
-
- SECTION( "Test spec from just a comma should have no filters" ) {
- TestSpec spec = parseTestSpec( "," );
- CHECK( spec.hasFilters() == false );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- }
-
- SECTION( "Test spec from name should have one filter" ) {
- TestSpec spec = parseTestSpec( "b" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == true );
- }
-
- SECTION( "Test spec from quoted name should have one filter" ) {
- TestSpec spec = parseTestSpec( "\"b\"" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == true );
- }
-
- SECTION( "Test spec from name should have one filter" ) {
- TestSpec spec = parseTestSpec( "b" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == false );
- }
-
- SECTION( "Wildcard at the start" ) {
- TestSpec spec = parseTestSpec( "*spaces" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == false );
- CHECK( parseTestSpec( "*a" ).matches( tcA ) == true );
- }
- SECTION( "Wildcard at the end" ) {
- TestSpec spec = parseTestSpec( "long*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == false );
- CHECK( parseTestSpec( "a*" ).matches( tcA ) == true );
- }
- SECTION( "Wildcard at both ends" ) {
- TestSpec spec = parseTestSpec( "*name*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == true );
- CHECK( parseTestSpec( "*a*" ).matches( tcA ) == true );
- }
- SECTION( "Redundant wildcard at the start" ) {
- TestSpec spec = parseTestSpec( "*a" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == false );
- }
- SECTION( "Redundant wildcard at the end" ) {
- TestSpec spec = parseTestSpec( "a*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == false );
- }
- SECTION( "Redundant wildcard at both ends" ) {
- TestSpec spec = parseTestSpec( "*a*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == false );
- }
- SECTION( "Wildcard at both ends, redundant at start" ) {
- TestSpec spec = parseTestSpec( "*longer*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == true );
- }
- SECTION( "Just wildcard" ) {
- TestSpec spec = parseTestSpec( "*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == true );
- }
-
- SECTION( "Single tag" ) {
- TestSpec spec = parseTestSpec( "[one]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == false );
- }
- SECTION( "Single tag, two matches" ) {
- TestSpec spec = parseTestSpec( "[x]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == true );
- }
- SECTION( "Two tags" ) {
- TestSpec spec = parseTestSpec( "[two][x]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- }
- SECTION( "Two tags, spare separated" ) {
- TestSpec spec = parseTestSpec( "[two] [x]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- }
- SECTION( "Wildcarded name and tag" ) {
- TestSpec spec = parseTestSpec( "*name*[x]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == false );
- }
- SECTION( "Single tag exclusion" ) {
- TestSpec spec = parseTestSpec( "~[one]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- }
- SECTION( "One tag exclusion and one tag inclusion" ) {
- TestSpec spec = parseTestSpec( "~[two][x]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == false );
- }
- SECTION( "One tag exclusion and one wldcarded name inclusion" ) {
- TestSpec spec = parseTestSpec( "~[two]*name*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == false );
- CHECK( spec.matches( tcD ) == true );
- }
- SECTION( "One tag exclusion, using exclude:, and one wldcarded name inclusion" ) {
- TestSpec spec = parseTestSpec( "exclude:[two]*name*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == false );
- CHECK( spec.matches( tcD ) == true );
- }
- SECTION( "name exclusion" ) {
- TestSpec spec = parseTestSpec( "~b" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == true );
- }
- SECTION( "wildcarded name exclusion" ) {
- TestSpec spec = parseTestSpec( "~*name*" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == false );
- CHECK( spec.matches( tcD ) == false );
- }
- SECTION( "wildcarded name exclusion with tag inclusion" ) {
- TestSpec spec = parseTestSpec( "~*name*,[three]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == false );
- }
- SECTION( "wildcarded name exclusion, using exclude:, with tag inclusion" ) {
- TestSpec spec = parseTestSpec( "exclude:*name*,[three]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == true );
- CHECK( spec.matches( tcB ) == true );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == false );
- }
- SECTION( "two wildcarded names" ) {
- TestSpec spec = parseTestSpec( "\"longer*\"\"*spaces\"" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == true );
- CHECK( spec.matches( tcD ) == false );
- }
- SECTION( "empty tag" ) {
- TestSpec spec = parseTestSpec( "[]" );
- CHECK( spec.hasFilters() == false );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == false );
- CHECK( spec.matches( tcD ) == false );
- }
- SECTION( "empty quoted name" ) {
- TestSpec spec = parseTestSpec( "\"\"" );
- CHECK( spec.hasFilters() == false );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == false );
- CHECK( spec.matches( tcD ) == false );
- }
- SECTION( "quoted string followed by tag exclusion" ) {
- TestSpec spec = parseTestSpec( "\"*name*\"~[.]" );
- CHECK( spec.hasFilters() == true );
- CHECK( spec.matches( tcA ) == false );
- CHECK( spec.matches( tcB ) == false );
- CHECK( spec.matches( tcC ) == false );
- CHECK( spec.matches( tcD ) == true );
- }
- SECTION( "Leading and trailing spaces in test spec" ) {
- TestSpec spec = parseTestSpec( "\" aardvark \"" );
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) );
- CHECK( spec.matches( fakeTestCase( " aardvark" ) ) );
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) );
- CHECK( spec.matches( fakeTestCase( "aardvark " ) ) );
- CHECK( spec.matches( fakeTestCase( "aardvark" ) ) );
- }
- SECTION( "Leading and trailing spaces in test name" ) {
- TestSpec spec = parseTestSpec( "aardvark" );
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) );
- CHECK( spec.matches( fakeTestCase( " aardvark" ) ) );
- CHECK( spec.matches( fakeTestCase( " aardvark " ) ) );
- CHECK( spec.matches( fakeTestCase( "aardvark " ) ) );
- CHECK( spec.matches( fakeTestCase( "aardvark" ) ) );
- }
- SECTION("Shortened hide tags are split apart when parsing") {
- TestSpec spec = parseTestSpec("[.foo]");
- CHECK(spec.matches(fakeTestCase("hidden and foo", "[.][foo]")));
- CHECK_FALSE(spec.matches(fakeTestCase("only foo", "[foo]")));
- }
- SECTION("Shortened hide tags also properly handle exclusion") {
- TestSpec spec = parseTestSpec("~[.foo]");
- CHECK_FALSE(spec.matches(fakeTestCase("hidden and foo", "[.][foo]")));
- CHECK_FALSE(spec.matches(fakeTestCase("only foo", "[foo]")));
- CHECK_FALSE(spec.matches(fakeTestCase("only hidden", "[.]")));
- CHECK(spec.matches(fakeTestCase("neither foo nor hidden", "[bar]")));
- }
-}
-
-TEST_CASE( "Process can be configured on command line", "[config][command-line]" ) {
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
- using namespace Catch::Matchers;
-#endif
-
- Catch::ConfigData config;
- auto cli = Catch::makeCommandLineParser(config);
-
- SECTION("empty args don't cause a crash") {
- auto result = cli.parse({""});
- CHECK(result);
- CHECK(config.processName == "");
- }
-
- SECTION("default - no arguments") {
- auto result = cli.parse({"test"});
- CHECK(result);
- CHECK(config.processName == "test");
- CHECK(config.shouldDebugBreak == false);
- CHECK(config.abortAfter == -1);
- CHECK(config.noThrow == false);
- CHECK(config.reporterName == "console");
-
- Catch::Config cfg(config);
- CHECK_FALSE(cfg.hasTestFilters());
- }
-
- SECTION("test lists") {
- SECTION("Specify one test case using") {
- auto result = cli.parse({"test", "test1"});
- CHECK(result);
-
- Catch::Config cfg(config);
- REQUIRE(cfg.hasTestFilters());
- REQUIRE(cfg.testSpec().matches(fakeTestCase("notIncluded")) == false);
- REQUIRE(cfg.testSpec().matches(fakeTestCase("test1")));
- }
- SECTION("Specify one test case exclusion using exclude:") {
- auto result = cli.parse({"test", "exclude:test1"});
- CHECK(result);
-
- Catch::Config cfg(config);
- REQUIRE(cfg.hasTestFilters());
- REQUIRE(cfg.testSpec().matches(fakeTestCase("test1")) == false);
- REQUIRE(cfg.testSpec().matches(fakeTestCase("alwaysIncluded")));
- }
-
- SECTION("Specify one test case exclusion using ~") {
- auto result = cli.parse({"test", "~test1"});
- CHECK(result);
-
- Catch::Config cfg(config);
- REQUIRE(cfg.hasTestFilters());
- REQUIRE(cfg.testSpec().matches(fakeTestCase("test1")) == false);
- REQUIRE(cfg.testSpec().matches(fakeTestCase("alwaysIncluded")));
- }
-
- }
-
- SECTION("reporter") {
- SECTION("-r/console") {
- CHECK(cli.parse({"test", "-r", "console"}));
-
- REQUIRE(config.reporterName == "console");
- }
- SECTION("-r/xml") {
- CHECK(cli.parse({"test", "-r", "xml"}));
-
- REQUIRE(config.reporterName == "xml");
- }
- SECTION("--reporter/junit") {
- CHECK(cli.parse({"test", "--reporter", "junit"}));
-
- REQUIRE(config.reporterName == "junit");
- }
- SECTION("Only one reporter is accepted") {
- REQUIRE_FALSE(cli.parse({ "test", "-r", "xml", "-r", "junit" }));
- }
- SECTION("must match one of the available ones") {
- auto result = cli.parse({"test", "--reporter", "unsupported"});
- CHECK(!result);
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
- REQUIRE_THAT(result.errorMessage(), Contains("Unrecognized reporter"));
-#endif
- }
- }
-
- SECTION("debugger") {
- SECTION("-b") {
- CHECK(cli.parse({"test", "-b"}));
-
- REQUIRE(config.shouldDebugBreak == true);
- }
- SECTION("--break") {
- CHECK(cli.parse({"test", "--break"}));
-
- REQUIRE(config.shouldDebugBreak);
- }
- }
-
-
- SECTION("abort") {
- SECTION("-a aborts after first failure") {
- CHECK(cli.parse({"test", "-a"}));
-
- REQUIRE(config.abortAfter == 1);
- }
- SECTION("-x 2 aborts after two failures") {
- CHECK(cli.parse({"test", "-x", "2"}));
-
- REQUIRE(config.abortAfter == 2);
- }
- SECTION("-x must be numeric") {
- auto result = cli.parse({"test", "-x", "oops"});
- CHECK(!result);
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
- REQUIRE_THAT(result.errorMessage(), Contains("convert") && Contains("oops"));
-#endif
- }
-
- SECTION("wait-for-keypress") {
- SECTION("Accepted options") {
- using tuple_type = std::tuple<char const*, Catch::WaitForKeypress::When>;
- auto input = GENERATE(table<char const*, Catch::WaitForKeypress::When>({
- tuple_type{"never", Catch::WaitForKeypress::Never},
- tuple_type{"start", Catch::WaitForKeypress::BeforeStart},
- tuple_type{"exit", Catch::WaitForKeypress::BeforeExit},
- tuple_type{"both", Catch::WaitForKeypress::BeforeStartAndExit},
- }));
- CHECK(cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}));
-
- REQUIRE(config.waitForKeypress == std::get<1>(input));
- }
-
- SECTION("invalid options are reported") {
- auto result = cli.parse({"test", "--wait-for-keypress", "sometimes"});
- CHECK(!result);
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
- REQUIRE_THAT(result.errorMessage(), Contains("never") && Contains("both"));
-#endif
- }
- }
- }
-
- SECTION("nothrow") {
- SECTION("-e") {
- CHECK(cli.parse({"test", "-e"}));
-
- REQUIRE(config.noThrow);
- }
- SECTION("--nothrow") {
- CHECK(cli.parse({"test", "--nothrow"}));
-
- REQUIRE(config.noThrow);
- }
- }
-
- SECTION("output filename") {
- SECTION("-o filename") {
- CHECK(cli.parse({"test", "-o", "filename.ext"}));
-
- REQUIRE(config.outputFilename == "filename.ext");
- }
- SECTION("--out") {
- CHECK(cli.parse({"test", "--out", "filename.ext"}));
-
- REQUIRE(config.outputFilename == "filename.ext");
- }
- }
-
- SECTION("combinations") {
- SECTION("Single character flags can be combined") {
- CHECK(cli.parse({"test", "-abe"}));
-
- CHECK(config.abortAfter == 1);
- CHECK(config.shouldDebugBreak);
- CHECK(config.noThrow == true);
- }
- }
-
-
- SECTION( "use-colour") {
-
- using Catch::UseColour;
-
- SECTION( "without option" ) {
- CHECK(cli.parse({"test"}));
-
- REQUIRE( config.useColour == UseColour::Auto );
- }
-
- SECTION( "auto" ) {
- CHECK(cli.parse({"test", "--use-colour", "auto"}));
-
- REQUIRE( config.useColour == UseColour::Auto );
- }
-
- SECTION( "yes" ) {
- CHECK(cli.parse({"test", "--use-colour", "yes"}));
-
- REQUIRE( config.useColour == UseColour::Yes );
- }
-
- SECTION( "no" ) {
- CHECK(cli.parse({"test", "--use-colour", "no"}));
-
- REQUIRE( config.useColour == UseColour::No );
- }
-
- SECTION( "error" ) {
- auto result = cli.parse({"test", "--use-colour", "wrong"});
- CHECK( !result );
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
- CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) );
-#endif
- }
- }
-
- SECTION("Benchmark options") {
- SECTION("samples") {
- CHECK(cli.parse({ "test", "--benchmark-samples=200" }));
-
- REQUIRE(config.benchmarkSamples == 200);
- }
-
- SECTION("resamples") {
- CHECK(cli.parse({ "test", "--benchmark-resamples=20000" }));
-
- REQUIRE(config.benchmarkResamples == 20000);
- }
-
- SECTION("confidence-interval") {
- CHECK(cli.parse({ "test", "--benchmark-confidence-interval=0.99" }));
-
- REQUIRE(config.benchmarkConfidenceInterval == Catch::Detail::Approx(0.99));
- }
-
- SECTION("no-analysis") {
- CHECK(cli.parse({ "test", "--benchmark-no-analysis" }));
-
- REQUIRE(config.benchmarkNoAnalysis);
- }
-
- SECTION("warmup-time") {
- CHECK(cli.parse({ "test", "--benchmark-warmup-time=10" }));
-
- REQUIRE(config.benchmarkWarmupTime == 10);
- }
- }
-}
-
-TEST_CASE("Test with special, characters \"in name", "[cli][regression]") {
- // This test case succeeds if we can invoke it from the CLI
- SUCCEED();
-}
diff --git a/projects/SelfTest/IntrospectiveTests/Details.tests.cpp b/projects/SelfTest/IntrospectiveTests/Details.tests.cpp
deleted file mode 100644
index 75054fb3..00000000
--- a/projects/SelfTest/IntrospectiveTests/Details.tests.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4702) // unreachable code in the macro expansions
-#endif
-
-TEST_CASE("Check that our error handling macros throw the right exceptions", "[!throws][internals][approvals]") {
- REQUIRE_THROWS_AS(CATCH_INTERNAL_ERROR(""), std::logic_error);
- REQUIRE_THROWS_AS(CATCH_ERROR(""), std::domain_error);
- REQUIRE_THROWS_AS(CATCH_RUNTIME_ERROR(""), std::runtime_error);
- REQUIRE_THROWS_AS([](){CATCH_ENFORCE(false, "");}(), std::domain_error);
- REQUIRE_NOTHROW([](){CATCH_ENFORCE(true, "");}());
-}
-
-#if defined(_MSC_VER)
-#pragma warning(pop) // unreachable code in the macro expansions
-#endif
diff --git a/projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
deleted file mode 100644
index 549f3559..00000000
--- a/projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
+++ /dev/null
@@ -1,352 +0,0 @@
-#include "catch.hpp"
-
-// Tests of generator implementation details
-TEST_CASE("Generators internals", "[generators][internals]") {
- using namespace Catch::Generators;
-
- SECTION("Single value") {
- auto gen = value(123);
- REQUIRE(gen.get() == 123);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Preset values") {
- auto gen = values({ 1, 3, 5 });
- REQUIRE(gen.get() == 1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 3);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 5);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Generator combinator") {
- auto gen = makeGenerators(1, 5, values({ 2, 4 }), 0);
- REQUIRE(gen.get() == 1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 5);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 4);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 0);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Explicitly typed generator sequence") {
- auto gen = makeGenerators(as<std::string>{}, "aa", "bb", "cc");
- // This just checks that the type is std::string:
- REQUIRE(gen.get().size() == 2);
- // Iterate over the generator
- REQUIRE(gen.get() == "aa");
- REQUIRE(gen.next());
- REQUIRE(gen.get() == "bb");
- REQUIRE(gen.next());
- REQUIRE(gen.get() == "cc");
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Filter generator") {
- // Normal usage
- auto gen = filter([] (int i) { return i != 2; }, values({ 2, 1, 2, 3, 2, 2 }));
- REQUIRE(gen.get() == 1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 3);
- REQUIRE_FALSE(gen.next());
-
- // Completely filtered-out generator should throw on construction
- REQUIRE_THROWS_AS(filter([] (int) { return false; }, value(1)), Catch::GeneratorException);
- }
- SECTION("Take generator") {
- SECTION("Take less") {
- auto gen = take(2, values({ 1, 2, 3 }));
- REQUIRE(gen.get() == 1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Take more") {
- auto gen = take(2, value(1));
- REQUIRE(gen.get() == 1);
- REQUIRE_FALSE(gen.next());
- }
- }
- SECTION("Map with explicit return type") {
- auto gen = map<double>([] (int i) {return 2.0 * i; }, values({ 1, 2, 3 }));
- REQUIRE(gen.get() == 2.0);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 4.0);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 6.0);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Map with deduced return type") {
- auto gen = map([] (int i) {return 2.0 * i; }, values({ 1, 2, 3 }));
- REQUIRE(gen.get() == 2.0);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 4.0);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 6.0);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Repeat") {
- SECTION("Singular repeat") {
- auto gen = repeat(1, value(3));
- REQUIRE(gen.get() == 3);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Actual repeat") {
- auto gen = repeat(2, values({ 1, 2, 3 }));
- REQUIRE(gen.get() == 1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 3);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 3);
- REQUIRE_FALSE(gen.next());
- }
- }
- SECTION("Range") {
- SECTION("Positive auto step") {
- SECTION("Integer") {
- auto gen = range(-2, 2);
- REQUIRE(gen.get() == -2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 0);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 1);
- REQUIRE_FALSE(gen.next());
- }
- }
- SECTION("Negative auto step") {
- SECTION("Integer") {
- auto gen = range(2, -2);
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 0);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE_FALSE(gen.next());
- }
- }
- SECTION("Positive manual step") {
- SECTION("Integer") {
- SECTION("Exact") {
- auto gen = range(-7, 5, 3);
- REQUIRE(gen.get() == -7);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -4);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Slightly over end") {
- auto gen = range(-7, 4, 3);
- REQUIRE(gen.get() == -7);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -4);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Slightly under end") {
- auto gen = range(-7, 6, 3);
- REQUIRE(gen.get() == -7);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -4);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 5);
- REQUIRE_FALSE(gen.next());
- }
- }
-
- SECTION("Floating Point") {
- SECTION("Exact") {
- const auto rangeStart = -1.;
- const auto rangeEnd = 1.;
- const auto step = .1;
-
- auto gen = range(rangeStart, rangeEnd, step);
- auto expected = rangeStart;
- while( (rangeEnd - expected) > step ) {
- INFO( "Current expected value is " << expected )
- REQUIRE(gen.get() == Approx(expected));
- REQUIRE(gen.next());
-
- expected += step;
- }
- REQUIRE(gen.get() == Approx( rangeEnd ) );
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Slightly over end") {
- const auto rangeStart = -1.;
- const auto rangeEnd = 1.;
- const auto step = .3;
-
- auto gen = range(rangeStart, rangeEnd, step);
- auto expected = rangeStart;
- while( (rangeEnd - expected) > step ) {
- INFO( "Current expected value is " << expected )
- REQUIRE(gen.get() == Approx(expected));
- REQUIRE(gen.next());
-
- expected += step;
- }
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Slightly under end") {
- const auto rangeStart = -1.;
- const auto rangeEnd = .9;
- const auto step = .3;
-
- auto gen = range(rangeStart, rangeEnd, step);
- auto expected = rangeStart;
- while( (rangeEnd - expected) > step ) {
- INFO( "Current expected value is " << expected )
- REQUIRE(gen.get() == Approx(expected));
- REQUIRE(gen.next());
-
- expected += step;
- }
- REQUIRE_FALSE(gen.next());
- }
- }
- }
- SECTION("Negative manual step") {
- SECTION("Integer") {
- SECTION("Exact") {
- auto gen = range(5, -7, -3);
- REQUIRE(gen.get() == 5);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -4);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Slightly over end") {
- auto gen = range(5, -6, -3);
- REQUIRE(gen.get() == 5);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -4);
- REQUIRE_FALSE(gen.next());
- }
- SECTION("Slightly under end") {
- auto gen = range(5, -8, -3);
- REQUIRE(gen.get() == 5);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == 2);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -1);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -4);
- REQUIRE(gen.next());
- REQUIRE(gen.get() == -7);
- REQUIRE_FALSE(gen.next());
- }
- }
- }
- }
-
-}
-
-
-// todo: uncopyable type used in a generator
-// idea: uncopyable tag type for a stupid generator
-
-namespace {
-struct non_copyable {
- non_copyable() = default;
- non_copyable(non_copyable const&) = delete;
- non_copyable& operator=(non_copyable const&) = delete;
- int value = -1;
-};
-
-// This class shows how to implement a simple generator for Catch tests
-class TestGen : public Catch::Generators::IGenerator<int> {
- int current_number;
-public:
-
- TestGen(non_copyable const& nc):
- current_number(nc.value) {}
-
- int const& get() const override;
- bool next() override {
- return false;
- }
-};
-
-// Avoids -Wweak-vtables
-int const& TestGen::get() const {
- return current_number;
-}
-
-}
-
-TEST_CASE("GENERATE capture macros", "[generators][internals][approvals]") {
- auto value = GENERATE(take(10, random(0, 10)));
-
- non_copyable nc; nc.value = value;
- // neither `GENERATE_COPY` nor plain `GENERATE` would compile here
- auto value2 = GENERATE_REF(Catch::Generators::GeneratorWrapper<int>(std::unique_ptr<Catch::Generators::IGenerator<int>>(new TestGen(nc))));
- REQUIRE(value == value2);
-}
-
-TEST_CASE("#1809 - GENERATE_COPY and SingleValueGenerator does not compile", "[generators][compilation][approvals]") {
- // Verify Issue #1809 fix, only needs to compile.
- auto a = GENERATE_COPY(1, 2);
- (void)a;
- auto b = GENERATE_COPY(as<long>{}, 1, 2);
- (void)b;
- int i = 1;
- int j = 2;
- auto c = GENERATE_COPY(i, j);
- (void)c;
- auto d = GENERATE_COPY(as<long>{}, i, j);
- (void)d;
- SUCCEED();
-}
-
-TEST_CASE("Multiple random generators in one test case output different values", "[generators][internals][approvals]") {
- SECTION("Integer") {
- auto random1 = Catch::Generators::random(0, 1000);
- auto random2 = Catch::Generators::random(0, 1000);
- size_t same = 0;
- for (size_t i = 0; i < 1000; ++i) {
- same += random1.get() == random2.get();
- random1.next(); random2.next();
- }
- // 0.5% seems like a sane bound for random identical elements within 1000 runs
- REQUIRE(same < 5);
- }
- SECTION("Float") {
- auto random1 = Catch::Generators::random(0., 1000.);
- auto random2 = Catch::Generators::random(0., 1000.);
- size_t same = 0;
- for (size_t i = 0; i < 1000; ++i) {
- same += random1.get() == random2.get();
- random1.next(); random2.next();
- }
- // 0.5% seems like a sane bound for random identical elements within 1000 runs
- REQUIRE(same < 5);
- }
-}
diff --git a/projects/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp b/projects/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp
deleted file mode 100644
index d17998d8..00000000
--- a/projects/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Created by Joachim on 16/04/2019.
- * Adapted from donated nonius code.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-namespace {
- struct manual_clock {
- public:
- using duration = std::chrono::nanoseconds;
- using time_point = std::chrono::time_point<manual_clock, duration>;
- using rep = duration::rep;
- using period = duration::period;
- enum { is_steady = true };
-
- static time_point now() {
- return time_point(duration(tick()));
- }
-
- static void advance(int ticks = 1) {
- tick() += ticks;
- }
-
- private:
- static rep& tick() {
- static rep the_tick = 0;
- return the_tick;
- }
- };
-
- struct counting_clock {
- public:
- using duration = std::chrono::nanoseconds;
- using time_point = std::chrono::time_point<counting_clock, duration>;
- using rep = duration::rep;
- using period = duration::period;
- enum { is_steady = true };
-
- static time_point now() {
- static rep ticks = 0;
- return time_point(duration(ticks += rate()));
- }
-
- static void set_rate(rep new_rate) { rate() = new_rate; }
-
- private:
- static rep& rate() {
- static rep the_rate = 1;
- return the_rate;
- }
- };
-
- struct TestChronometerModel : Catch::Benchmark::Detail::ChronometerConcept {
- int started = 0;
- int finished = 0;
-
- void start() override { ++started; }
- void finish() override { ++finished; }
- };
-} // namespace
-
-TEST_CASE("warmup", "[benchmark]") {
- auto rate = 1000;
- counting_clock::set_rate(rate);
-
- auto start = counting_clock::now();
- auto iterations = Catch::Benchmark::Detail::warmup<counting_clock>();
- auto end = counting_clock::now();
-
- REQUIRE((iterations * rate) > Catch::Benchmark::Detail::warmup_time.count());
- REQUIRE((end - start) > Catch::Benchmark::Detail::warmup_time);
-}
-
-TEST_CASE("resolution", "[benchmark]") {
- auto rate = 1000;
- counting_clock::set_rate(rate);
-
- size_t count = 10;
- auto res = Catch::Benchmark::Detail::resolution<counting_clock>(static_cast<int>(count));
-
- REQUIRE(res.size() == count);
-
- for (size_t i = 1; i < count; ++i) {
- REQUIRE(res[i] == rate);
- }
-}
-
-TEST_CASE("estimate_clock_resolution", "[benchmark]") {
- auto rate = 1000;
- counting_clock::set_rate(rate);
-
- int iters = 160000;
- auto res = Catch::Benchmark::Detail::estimate_clock_resolution<counting_clock>(iters);
-
- REQUIRE(res.mean.count() == rate);
- REQUIRE(res.outliers.total() == 0);
-}
-
-TEST_CASE("benchmark function call", "[benchmark]") {
- SECTION("without chronometer") {
- auto called = 0;
- auto model = TestChronometerModel{};
- auto meter = Catch::Benchmark::Chronometer{ model, 1 };
- auto fn = Catch::Benchmark::Detail::BenchmarkFunction{ [&] {
- CHECK(model.started == 1);
- CHECK(model.finished == 0);
- ++called;
- } };
-
- fn(meter);
-
- CHECK(model.started == 1);
- CHECK(model.finished == 1);
- CHECK(called == 1);
- }
-
- SECTION("with chronometer") {
- auto called = 0;
- auto model = TestChronometerModel{};
- auto meter = Catch::Benchmark::Chronometer{ model, 1 };
- auto fn = Catch::Benchmark::Detail::BenchmarkFunction{ [&](Catch::Benchmark::Chronometer) {
- CHECK(model.started == 0);
- CHECK(model.finished == 0);
- ++called;
- } };
-
- fn(meter);
-
- CHECK(model.started == 0);
- CHECK(model.finished == 0);
- CHECK(called == 1);
- }
-}
-
-TEST_CASE("uniform samples", "[benchmark]") {
- std::vector<double> samples(100);
- std::fill(samples.begin(), samples.end(), 23);
-
- using it = std::vector<double>::iterator;
- auto e = Catch::Benchmark::Detail::bootstrap(0.95, samples.begin(), samples.end(), samples, [](it a, it b) {
- auto sum = std::accumulate(a, b, 0.);
- return sum / (b - a);
- });
- CHECK(e.point == 23);
- CHECK(e.upper_bound == 23);
- CHECK(e.lower_bound == 23);
- CHECK(e.confidence_interval == 0.95);
-}
-
-
-TEST_CASE("normal_cdf", "[benchmark]") {
- using Catch::Benchmark::Detail::normal_cdf;
- CHECK(normal_cdf(0.000000) == Approx(0.50000000000000000));
- CHECK(normal_cdf(1.000000) == Approx(0.84134474606854293));
- CHECK(normal_cdf(-1.000000) == Approx(0.15865525393145705));
- CHECK(normal_cdf(2.809729) == Approx(0.99752083845315409));
- CHECK(normal_cdf(-1.352570) == Approx(0.08809652095066035));
-}
-
-TEST_CASE("erfc_inv", "[benchmark]") {
- using Catch::Benchmark::Detail::erfc_inv;
- CHECK(erfc_inv(1.103560) == Approx(-0.09203687623843015));
- CHECK(erfc_inv(1.067400) == Approx(-0.05980291115763361));
- CHECK(erfc_inv(0.050000) == Approx(1.38590382434967796));
-}
-
-TEST_CASE("normal_quantile", "[benchmark]") {
- using Catch::Benchmark::Detail::normal_quantile;
- CHECK(normal_quantile(0.551780) == Approx(0.13015979861484198));
- CHECK(normal_quantile(0.533700) == Approx(0.08457408802851875));
- CHECK(normal_quantile(0.025000) == Approx(-1.95996398454005449));
-}
-
-
-TEST_CASE("mean", "[benchmark]") {
- std::vector<double> x{ 10., 20., 14., 16., 30., 24. };
-
- auto m = Catch::Benchmark::Detail::mean(x.begin(), x.end());
-
- REQUIRE(m == 19.);
-}
-
-TEST_CASE("weighted_average_quantile", "[benchmark]") {
- std::vector<double> x{ 10., 20., 14., 16., 30., 24. };
-
- auto q1 = Catch::Benchmark::Detail::weighted_average_quantile(1, 4, x.begin(), x.end());
- auto med = Catch::Benchmark::Detail::weighted_average_quantile(1, 2, x.begin(), x.end());
- auto q3 = Catch::Benchmark::Detail::weighted_average_quantile(3, 4, x.begin(), x.end());
-
- REQUIRE(q1 == 14.5);
- REQUIRE(med == 18.);
- REQUIRE(q3 == 23.);
-}
-
-TEST_CASE("classify_outliers", "[benchmark]") {
- auto require_outliers = [](Catch::Benchmark::OutlierClassification o, int los, int lom, int him, int his) {
- REQUIRE(o.low_severe == los);
- REQUIRE(o.low_mild == lom);
- REQUIRE(o.high_mild == him);
- REQUIRE(o.high_severe == his);
- REQUIRE(o.total() == los + lom + him + his);
- };
-
- SECTION("none") {
- std::vector<double> x{ 10., 20., 14., 16., 30., 24. };
-
- auto o = Catch::Benchmark::Detail::classify_outliers(x.begin(), x.end());
-
- REQUIRE(o.samples_seen == static_cast<int>(x.size()));
- require_outliers(o, 0, 0, 0, 0);
- }
- SECTION("low severe") {
- std::vector<double> x{ -12., 20., 14., 16., 30., 24. };
-
- auto o = Catch::Benchmark::Detail::classify_outliers(x.begin(), x.end());
-
- REQUIRE(o.samples_seen == static_cast<int>(x.size()));
- require_outliers(o, 1, 0, 0, 0);
- }
- SECTION("low mild") {
- std::vector<double> x{ 1., 20., 14., 16., 30., 24. };
-
- auto o = Catch::Benchmark::Detail::classify_outliers(x.begin(), x.end());
-
- REQUIRE(o.samples_seen == static_cast<int>(x.size()));
- require_outliers(o, 0, 1, 0, 0);
- }
- SECTION("high mild") {
- std::vector<double> x{ 10., 20., 14., 16., 36., 24. };
-
- auto o = Catch::Benchmark::Detail::classify_outliers(x.begin(), x.end());
-
- REQUIRE(o.samples_seen == static_cast<int>(x.size()));
- require_outliers(o, 0, 0, 1, 0);
- }
- SECTION("high severe") {
- std::vector<double> x{ 10., 20., 14., 16., 49., 24. };
-
- auto o = Catch::Benchmark::Detail::classify_outliers(x.begin(), x.end());
-
- REQUIRE(o.samples_seen == static_cast<int>(x.size()));
- require_outliers(o, 0, 0, 0, 1);
- }
- SECTION("mixed") {
- std::vector<double> x{ -20., 20., 14., 16., 39., 24. };
-
- auto o = Catch::Benchmark::Detail::classify_outliers(x.begin(), x.end());
-
- REQUIRE(o.samples_seen == static_cast<int>(x.size()));
- require_outliers(o, 1, 0, 1, 0);
- }
-}
-
-TEST_CASE("analyse", "[benchmark]") {
- Catch::ConfigData data{};
- data.benchmarkConfidenceInterval = 0.95;
- data.benchmarkNoAnalysis = false;
- data.benchmarkResamples = 1000;
- data.benchmarkSamples = 99;
- Catch::Config config{data};
-
- using Duration = Catch::Benchmark::FloatDuration<Catch::Benchmark::default_clock>;
-
- Catch::Benchmark::Environment<Duration> env;
- std::vector<Duration> samples(99);
- for (size_t i = 0; i < samples.size(); ++i) {
- samples[i] = Duration(23 + (i % 3 - 1));
- }
-
- auto analysis = Catch::Benchmark::Detail::analyse(config, env, samples.begin(), samples.end());
- CHECK(analysis.mean.point.count() == 23);
- CHECK(analysis.mean.lower_bound.count() < 23);
- CHECK(analysis.mean.lower_bound.count() > 22);
- CHECK(analysis.mean.upper_bound.count() > 23);
- CHECK(analysis.mean.upper_bound.count() < 24);
-
- CHECK(analysis.standard_deviation.point.count() > 0.5);
- CHECK(analysis.standard_deviation.point.count() < 1);
- CHECK(analysis.standard_deviation.lower_bound.count() > 0.5);
- CHECK(analysis.standard_deviation.lower_bound.count() < 1);
- CHECK(analysis.standard_deviation.upper_bound.count() > 0.5);
- CHECK(analysis.standard_deviation.upper_bound.count() < 1);
-
- CHECK(analysis.outliers.total() == 0);
- CHECK(analysis.outliers.low_mild == 0);
- CHECK(analysis.outliers.low_severe == 0);
- CHECK(analysis.outliers.high_mild == 0);
- CHECK(analysis.outliers.high_severe == 0);
- CHECK(analysis.outliers.samples_seen == samples.size());
-
- CHECK(analysis.outlier_variance < 0.5);
- CHECK(analysis.outlier_variance > 0);
-}
-
-TEST_CASE("analyse no analysis", "[benchmark]") {
- Catch::ConfigData data{};
- data.benchmarkConfidenceInterval = 0.95;
- data.benchmarkNoAnalysis = true;
- data.benchmarkResamples = 1000;
- data.benchmarkSamples = 99;
- Catch::Config config{ data };
-
- using Duration = Catch::Benchmark::FloatDuration<Catch::Benchmark::default_clock>;
-
- Catch::Benchmark::Environment<Duration> env;
- std::vector<Duration> samples(99);
- for (size_t i = 0; i < samples.size(); ++i) {
- samples[i] = Duration(23 + (i % 3 - 1));
- }
-
- auto analysis = Catch::Benchmark::Detail::analyse(config, env, samples.begin(), samples.end());
- CHECK(analysis.mean.point.count() == 23);
- CHECK(analysis.mean.lower_bound.count() == 23);
- CHECK(analysis.mean.upper_bound.count() == 23);
-
- CHECK(analysis.standard_deviation.point.count() == 0);
- CHECK(analysis.standard_deviation.lower_bound.count() == 0);
- CHECK(analysis.standard_deviation.upper_bound.count() == 0);
-
- CHECK(analysis.outliers.total() == 0);
- CHECK(analysis.outliers.low_mild == 0);
- CHECK(analysis.outliers.low_severe == 0);
- CHECK(analysis.outliers.high_mild == 0);
- CHECK(analysis.outliers.high_severe == 0);
- CHECK(analysis.outliers.samples_seen == 0);
-
- CHECK(analysis.outlier_variance == 0);
-}
-
-TEST_CASE("run_for_at_least, int", "[benchmark]") {
- manual_clock::duration time(100);
-
- int old_x = 1;
- auto Timing = Catch::Benchmark::Detail::run_for_at_least<manual_clock>(time, 1, [&old_x](int x) -> int {
- CHECK(x >= old_x);
- manual_clock::advance(x);
- old_x = x;
- return x + 17;
- });
-
- REQUIRE(Timing.elapsed >= time);
- REQUIRE(Timing.result == Timing.iterations + 17);
- REQUIRE(Timing.iterations >= time.count());
-}
-
-TEST_CASE("run_for_at_least, chronometer", "[benchmark]") {
- manual_clock::duration time(100);
-
- int old_runs = 1;
- auto Timing = Catch::Benchmark::Detail::run_for_at_least<manual_clock>(time, 1, [&old_runs](Catch::Benchmark::Chronometer meter) -> int {
- CHECK(meter.runs() >= old_runs);
- manual_clock::advance(100);
- meter.measure([] {
- manual_clock::advance(1);
- });
- old_runs = meter.runs();
- return meter.runs() + 17;
- });
-
- REQUIRE(Timing.elapsed >= time);
- REQUIRE(Timing.result == Timing.iterations + 17);
- REQUIRE(Timing.iterations >= time.count());
-}
-
-
-TEST_CASE("measure", "[benchmark]") {
- auto r = Catch::Benchmark::Detail::measure<manual_clock>([](int x) -> int {
- CHECK(x == 17);
- manual_clock::advance(42);
- return 23;
- }, 17);
- auto s = Catch::Benchmark::Detail::measure<manual_clock>([](int x) -> int {
- CHECK(x == 23);
- manual_clock::advance(69);
- return 17;
- }, 23);
-
- CHECK(r.elapsed.count() == 42);
- CHECK(r.result == 23);
- CHECK(r.iterations == 1);
-
- CHECK(s.elapsed.count() == 69);
- CHECK(s.result == 17);
- CHECK(s.iterations == 1);
-}
-
-TEST_CASE("run benchmark", "[benchmark]") {
- counting_clock::set_rate(1000);
- auto start = counting_clock::now();
-
- Catch::Benchmark::Benchmark bench{ "Test Benchmark", [](Catch::Benchmark::Chronometer meter) {
- counting_clock::set_rate(100000);
- meter.measure([] { return counting_clock::now(); });
- } };
-
- bench.run<counting_clock>();
- auto end = counting_clock::now();
-
- CHECK((end - start).count() == 2867251000);
-}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
diff --git a/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp b/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp
deleted file mode 100644
index 837d3661..00000000
--- a/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Created by Phil on 1/10/2015.
- * Copyright 2015 Two Blue Cubes Ltd
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#include "internal/catch_suppress_warnings.h"
-#include "internal/catch_test_case_tracker.h"
-
-#include "catch.hpp"
-
-using namespace Catch;
-
-namespace {
-Catch::TestCaseTracking::NameAndLocation makeNAL( std::string const& name ) {
- return Catch::TestCaseTracking::NameAndLocation( name, Catch::SourceLineInfo("",0) );
-}
-}
-
-TEST_CASE( "Tracker" ) {
-
- TrackerContext ctx;
- ctx.startRun();
- ctx.startCycle();
-
-
- ITracker& testCase = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) );
- REQUIRE( testCase.isOpen() );
-
- ITracker& s1 = SectionTracker::acquire( ctx, makeNAL( "S1" ) );
- REQUIRE( s1.isOpen() );
-
- SECTION( "successfully close one section" ) {
- s1.close();
- REQUIRE( s1.isSuccessfullyCompleted() );
- REQUIRE( testCase.isComplete() == false );
-
- testCase.close();
- REQUIRE( ctx.completedCycle() );
- REQUIRE( testCase.isSuccessfullyCompleted() );
- }
-
- SECTION( "fail one section" ) {
- s1.fail();
- REQUIRE( s1.isComplete() );
- REQUIRE( s1.isSuccessfullyCompleted() == false );
- REQUIRE( testCase.isComplete() == false );
-
- testCase.close();
- REQUIRE( ctx.completedCycle() );
- REQUIRE( testCase.isSuccessfullyCompleted() == false );
-
- SECTION( "re-enter after failed section" ) {
- ctx.startCycle();
- ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) );
- REQUIRE( testCase2.isOpen() );
-
- ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) );
- REQUIRE( s1b.isOpen() == false );
-
- testCase2.close();
- REQUIRE( ctx.completedCycle() );
- REQUIRE( testCase.isComplete() );
- REQUIRE( testCase.isSuccessfullyCompleted() );
- }
- SECTION( "re-enter after failed section and find next section" ) {
- ctx.startCycle();
- ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) );
- REQUIRE( testCase2.isOpen() );
-
- ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) );
- REQUIRE( s1b.isOpen() == false );
-
- ITracker& s2 = SectionTracker::acquire( ctx, makeNAL( "S2" ) );
- REQUIRE( s2.isOpen() );
-
- s2.close();
- REQUIRE( ctx.completedCycle() );
-
- testCase2.close();
- REQUIRE( testCase.isComplete() );
- REQUIRE( testCase.isSuccessfullyCompleted() );
- }
- }
-
- SECTION( "successfully close one section, then find another" ) {
- s1.close();
-
- ITracker& s2 = SectionTracker::acquire( ctx, makeNAL( "S2" ) );
- REQUIRE( s2.isOpen() == false );
-
- testCase.close();
- REQUIRE( testCase.isComplete() == false );
-
- SECTION( "Re-enter - skips S1 and enters S2" ) {
- ctx.startCycle();
- ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) );
- REQUIRE( testCase2.isOpen() );
-
- ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) );
- REQUIRE( s1b.isOpen() == false );
-
- ITracker& s2b = SectionTracker::acquire( ctx, makeNAL( "S2" ) );
- REQUIRE( s2b.isOpen() );
-
- REQUIRE( ctx.completedCycle() == false );
-
- SECTION ("Successfully close S2") {
- s2b.close();
- REQUIRE( ctx.completedCycle() );
-
- REQUIRE( s2b.isSuccessfullyCompleted() );
- REQUIRE( testCase2.isComplete() == false );
-
- testCase2.close();
- REQUIRE( testCase2.isSuccessfullyCompleted() );
- }
- SECTION ("fail S2") {
- s2b.fail();
- REQUIRE( ctx.completedCycle() );
-
- REQUIRE( s2b.isComplete() );
- REQUIRE( s2b.isSuccessfullyCompleted() == false );
-
- testCase2.close();
- REQUIRE( testCase2.isSuccessfullyCompleted() == false );
-
- // Need a final cycle
- ctx.startCycle();
- ITracker& testCase3 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) );
- REQUIRE( testCase3.isOpen() );
-
- ITracker& s1c = SectionTracker::acquire( ctx, makeNAL( "S1" ) );
- REQUIRE( s1c.isOpen() == false );
-
- ITracker& s2c = SectionTracker::acquire( ctx, makeNAL( "S2" ) );
- REQUIRE( s2c.isOpen() == false );
-
- testCase3.close();
- REQUIRE( testCase3.isSuccessfullyCompleted() );
- }
- }
- }
-
- SECTION( "open a nested section" ) {
- ITracker& s2 = SectionTracker::acquire( ctx, makeNAL( "S2" ) );
- REQUIRE( s2.isOpen() );
-
- s2.close();
- REQUIRE( s2.isComplete() );
- REQUIRE( s1.isComplete() == false );
-
- s1.close();
- REQUIRE( s1.isComplete() );
- REQUIRE( testCase.isComplete() == false );
-
- testCase.close();
- REQUIRE( testCase.isComplete() );
- }
-}
-
-static bool previouslyRun = false;
-static bool previouslyRunNested = false;
-
-TEST_CASE( "#1394", "[.][approvals][tracker]" ) {
- // -- Don't re-run after specified section is done
- REQUIRE(previouslyRun == false);
-
- SECTION( "RunSection" ) {
- previouslyRun = true;
- }
- SECTION( "SkipSection" ) {
- // cause an error if this section is called because it shouldn't be
- REQUIRE(1 == 0);
- }
-}
-
-TEST_CASE( "#1394 nested", "[.][approvals][tracker]" ) {
- REQUIRE(previouslyRunNested == false);
-
- SECTION( "NestedRunSection" ) {
- SECTION( "s1" ) {
- previouslyRunNested = true;
- }
- }
- SECTION( "NestedSkipSection" ) {
- // cause an error if this section is called because it shouldn't be
- REQUIRE(1 == 0);
- }
-}
-
-// Selecting a "not last" section inside a test case via -c "section" would
-// previously only run the first subsection, instead of running all of them.
-// This allows us to check that `"#1670 regression check" -c A` leads to
-// 2 successful assertions.
-TEST_CASE("#1670 regression check", "[.approvals][tracker]") {
- SECTION("A") {
- SECTION("1") SUCCEED();
- SECTION("2") SUCCEED();
- }
- SECTION("B") {
- SECTION("1") SUCCEED();
- SECTION("2") SUCCEED();
- }
-}
diff --git a/projects/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp b/projects/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp
deleted file mode 100644
index f8085dbf..00000000
--- a/projects/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Created by Martin on 06/10/2019.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-#include "internal/catch_random_number_generator.h"
-
-TEST_CASE("Our PCG implementation provides expected results for known seeds", "[rng]") {
- Catch::SimplePcg32 rng;
- SECTION("Default seeded") {
- REQUIRE(rng() == 0xfcdb943b);
- REQUIRE(rng() == 0x6f55b921);
- REQUIRE(rng() == 0x4c17a916);
- REQUIRE(rng() == 0x71eae25f);
- REQUIRE(rng() == 0x6ce7909c);
- }
- SECTION("Specific seed") {
- rng.seed(0xabcd1234);
- REQUIRE(rng() == 0x57c08495);
- REQUIRE(rng() == 0x33c956ac);
- REQUIRE(rng() == 0x2206fd76);
- REQUIRE(rng() == 0x3501a35b);
- REQUIRE(rng() == 0xfdffb30f);
-
- // Also check repeated output after reseeding
- rng.seed(0xabcd1234);
- REQUIRE(rng() == 0x57c08495);
- REQUIRE(rng() == 0x33c956ac);
- REQUIRE(rng() == 0x2206fd76);
- REQUIRE(rng() == 0x3501a35b);
- REQUIRE(rng() == 0xfdffb30f);
- }
-}
-
-TEST_CASE("Comparison ops", "[rng]") {
- using Catch::SimplePcg32;
- REQUIRE(SimplePcg32{} == SimplePcg32{});
- REQUIRE(SimplePcg32{ 0 } != SimplePcg32{});
- REQUIRE_FALSE(SimplePcg32{ 1 } == SimplePcg32{ 2 });
- REQUIRE_FALSE(SimplePcg32{ 1 } != SimplePcg32{ 1 });
-}
diff --git a/projects/SelfTest/IntrospectiveTests/String.tests.cpp b/projects/SelfTest/IntrospectiveTests/String.tests.cpp
deleted file mode 100644
index 3a308657..00000000
--- a/projects/SelfTest/IntrospectiveTests/String.tests.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-#include "internal/catch_stringref.h"
-
-#include "catch.hpp"
-
-#include <cstring>
-
-TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
-
- using Catch::StringRef;
-
- SECTION( "Empty string" ) {
- StringRef empty;
- REQUIRE( empty.empty() );
- REQUIRE( empty.size() == 0 );
- REQUIRE( empty.isNullTerminated() );
- REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 );
- }
-
- SECTION( "From string literal" ) {
- StringRef s = "hello";
- REQUIRE( s.empty() == false );
- REQUIRE( s.size() == 5 );
- REQUIRE( s.isNullTerminated() );
-
- auto rawChars = s.data();
- REQUIRE( std::strcmp( rawChars, "hello" ) == 0 );
-
- REQUIRE_NOTHROW(s.c_str());
- REQUIRE(s.c_str() == rawChars);
- REQUIRE(s.data() == rawChars);
- }
- SECTION( "From sub-string" ) {
- StringRef original = StringRef( "original string" ).substr(0, 8);
- REQUIRE( original == "original" );
-
- REQUIRE_FALSE(original.isNullTerminated());
- REQUIRE_THROWS(original.c_str());
- REQUIRE_NOTHROW(original.data());
- }
-
-
- SECTION( "Substrings" ) {
- StringRef s = "hello world!";
- StringRef ss = s.substr(0, 5);
-
- SECTION( "zero-based substring" ) {
- REQUIRE( ss.empty() == false );
- REQUIRE( ss.size() == 5 );
- REQUIRE( std::strncmp( ss.data(), "hello", 5 ) == 0 );
- REQUIRE( ss == "hello" );
- }
-
- SECTION( "non-zero-based substring") {
- ss = s.substr( 6, 6 );
- REQUIRE( ss.size() == 6 );
- REQUIRE( std::strcmp( ss.c_str(), "world!" ) == 0 );
- }
-
- SECTION( "Pointer values of full refs should match" ) {
- StringRef s2 = s;
- REQUIRE( s.data() == s2.data() );
- }
-
- SECTION( "Pointer values of substring refs should also match" ) {
- REQUIRE( s.data() == ss.data() );
- }
-
- SECTION("Past the end substring") {
- REQUIRE(s.substr(s.size() + 1, 123).empty());
- }
-
- SECTION("Substring off the end are trimmed") {
- ss = s.substr(6, 123);
- REQUIRE(std::strcmp(ss.c_str(), "world!") == 0);
- }
- // TODO: substring into string + size is longer than end
- }
-
- SECTION( "Comparisons are deep" ) {
- char buffer1[] = "Hello";
- char buffer2[] = "Hello";
- CHECK((char*)buffer1 != (char*)buffer2);
-
- StringRef left(buffer1), right(buffer2);
- REQUIRE( left == right );
- REQUIRE(left != left.substr(0, 3));
- }
-
- SECTION( "from std::string" ) {
- std::string stdStr = "a standard string";
-
- SECTION( "implicitly constructed" ) {
- StringRef sr = stdStr;
- REQUIRE( sr == "a standard string" );
- REQUIRE( sr.size() == stdStr.size() );
- }
- SECTION( "explicitly constructed" ) {
- StringRef sr( stdStr );
- REQUIRE( sr == "a standard string" );
- REQUIRE( sr.size() == stdStr.size() );
- }
- SECTION( "assigned" ) {
- StringRef sr;
- sr = stdStr;
- REQUIRE( sr == "a standard string" );
- REQUIRE( sr.size() == stdStr.size() );
- }
- }
-
- SECTION( "to std::string" ) {
- StringRef sr = "a stringref";
-
- SECTION( "explicitly constructed" ) {
- std::string stdStr( sr );
- REQUIRE( stdStr == "a stringref" );
- REQUIRE( stdStr.size() == sr.size() );
- }
- SECTION( "assigned" ) {
- std::string stdStr;
- stdStr = static_cast<std::string>(sr);
- REQUIRE( stdStr == "a stringref" );
- REQUIRE( stdStr.size() == sr.size() );
- }
- }
-}
-
-TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") {
- using Catch::StringRef;
- SECTION("Simple constructors") {
- STATIC_REQUIRE(StringRef{}.size() == 0);
-
- STATIC_REQUIRE(StringRef{ "abc", 3 }.size() == 3);
- STATIC_REQUIRE(StringRef{ "abc", 3 }.isNullTerminated());
-
- STATIC_REQUIRE(StringRef{ "abc", 2 }.size() == 2);
- STATIC_REQUIRE_FALSE(StringRef{ "abc", 2 }.isNullTerminated());
- }
- SECTION("UDL construction") {
- constexpr auto sr1 = "abc"_catch_sr;
- STATIC_REQUIRE_FALSE(sr1.empty());
- STATIC_REQUIRE(sr1.size() == 3);
- STATIC_REQUIRE(sr1.isNullTerminated());
-
- using Catch::operator"" _sr;
- constexpr auto sr2 = ""_sr;
- STATIC_REQUIRE(sr2.empty());
- STATIC_REQUIRE(sr2.size() == 0);
- STATIC_REQUIRE(sr2.isNullTerminated());
- }
-}
diff --git a/projects/SelfTest/IntrospectiveTests/StringManip.tests.cpp b/projects/SelfTest/IntrospectiveTests/StringManip.tests.cpp
deleted file mode 100644
index b817f372..00000000
--- a/projects/SelfTest/IntrospectiveTests/StringManip.tests.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#include "internal/catch_string_manip.h"
-
-#include "catch.hpp"
-
-static const char * const no_whitespace = "There is no extra whitespace here";
-static const char * const leading_whitespace = " \r \t\n There is no extra whitespace here";
-static const char * const trailing_whitespace = "There is no extra whitespace here \t \n \r ";
-static const char * const whitespace_at_both_ends = " \r\n \t There is no extra whitespace here \t\t\t \n";
-
-TEST_CASE("Trim strings", "[string-manip]") {
- using Catch::trim; using Catch::StringRef;
- static_assert(std::is_same<std::string, decltype(trim(std::string{}))>::value, "Trimming std::string should return std::string");
- static_assert(std::is_same<StringRef, decltype(trim(StringRef{}))>::value, "Trimming StringRef should return StringRef");
-
- REQUIRE(trim(std::string(no_whitespace)) == no_whitespace);
- REQUIRE(trim(std::string(leading_whitespace)) == no_whitespace);
- REQUIRE(trim(std::string(trailing_whitespace)) == no_whitespace);
- REQUIRE(trim(std::string(whitespace_at_both_ends)) == no_whitespace);
-
- REQUIRE(trim(StringRef(no_whitespace)) == StringRef(no_whitespace));
- REQUIRE(trim(StringRef(leading_whitespace)) == StringRef(no_whitespace));
- REQUIRE(trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace));
- REQUIRE(trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace));
-}
-
-TEST_CASE("replaceInPlace", "[string-manip]") {
- std::string letters = "abcdefcg";
- SECTION("replace single char") {
- CHECK(Catch::replaceInPlace(letters, "b", "z"));
- CHECK(letters == "azcdefcg");
- }
- SECTION("replace two chars") {
- CHECK(Catch::replaceInPlace(letters, "c", "z"));
- CHECK(letters == "abzdefzg");
- }
- SECTION("replace first char") {
- CHECK(Catch::replaceInPlace(letters, "a", "z"));
- CHECK(letters == "zbcdefcg");
- }
- SECTION("replace last char") {
- CHECK(Catch::replaceInPlace(letters, "g", "z"));
- CHECK(letters == "abcdefcz");
- }
- SECTION("replace all chars") {
- CHECK(Catch::replaceInPlace(letters, letters, "replaced"));
- CHECK(letters == "replaced");
- }
- SECTION("replace no chars") {
- CHECK_FALSE(Catch::replaceInPlace(letters, "x", "z"));
- CHECK(letters == letters);
- }
- SECTION("escape '") {
- std::string s = "didn't";
- CHECK(Catch::replaceInPlace(s, "'", "|'"));
- CHECK(s == "didn|'t");
- }
-}
-
-TEST_CASE("splitString", "[string-manip]") {
- using namespace Catch::Matchers;
- using Catch::splitStringRef;
- using Catch::StringRef;
-
- CHECK_THAT(splitStringRef("", ','), Equals(std::vector<StringRef>()));
- CHECK_THAT(splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}));
- CHECK_THAT(splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}));
-}
diff --git a/projects/SelfTest/IntrospectiveTests/Tag.tests.cpp b/projects/SelfTest/IntrospectiveTests/Tag.tests.cpp
deleted file mode 100644
index 775c2e71..00000000
--- a/projects/SelfTest/IntrospectiveTests/Tag.tests.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Created by Phil on 27/06/2014.
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-#include "internal/catch_tag_alias_registry.h"
-
-TEST_CASE( "Tag alias can be registered against tag patterns" ) {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-
- Catch::TagAliasRegistry registry;
-
- registry.add( "[@zzz]", "[one][two]", Catch::SourceLineInfo( "file", 2 ) );
-
- SECTION( "The same tag alias can only be registered once" ) {
-
- try {
- registry.add( "[@zzz]", "[one][two]", Catch::SourceLineInfo( "file", 10 ) );
- FAIL( "expected exception" );
- }
- catch( std::exception& ex ) {
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
- std::string what = ex.what();
- using namespace Catch::Matchers;
- CHECK_THAT( what, Contains( "[@zzz]" ) );
- CHECK_THAT( what, Contains( "file" ) );
- CHECK_THAT( what, Contains( "2" ) );
- CHECK_THAT( what, Contains( "10" ) );
-#endif
- }
- }
-
- SECTION( "Tag aliases must be of the form [@name]" ) {
- CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) );
- CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) );
- CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) );
- CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) );
- }
-
-#endif
-}
-
-TEST_CASE("shortened hide tags are split apart") {
- auto testcase = Catch::makeTestCase(nullptr, "", {"fake test name", "[.magic-tag]"}, CATCH_INTERNAL_LINEINFO);
- REQUIRE_THAT(testcase.tags, Catch::VectorContains(std::string("magic-tag")) && Catch::VectorContains(std::string(".")));
-}
-
-TEST_CASE("adding a hide tag implicitly enables all others", "[tags]") {
- using Catch::VectorContains;
- auto tag = GENERATE(as<char const*>{}, "[!hide]", "[.]", "[.foo]");
- auto testcase = Catch::makeTestCase(nullptr, "", {"fake test name", tag}, CATCH_INTERNAL_LINEINFO);
- REQUIRE_THAT(testcase.tags, VectorContains(std::string(".")) && VectorContains(std::string("!hide")));
-}
diff --git a/projects/SelfTest/IntrospectiveTests/ToString.tests.cpp b/projects/SelfTest/IntrospectiveTests/ToString.tests.cpp
deleted file mode 100644
index caa924f5..00000000
--- a/projects/SelfTest/IntrospectiveTests/ToString.tests.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "catch.hpp"
-
-#include "internal/catch_enum_values_registry.h"
-
-enum class EnumClass3 { Value1, Value2, Value3, Value4 };
-
-
-TEST_CASE( "parseEnums", "[Strings][enums]" ) {
- using namespace Catch::Matchers;
- using Catch::Detail::parseEnums;
-
- SECTION( "No enums" )
- CHECK_THAT( parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) );
-
- SECTION( "One enum value" ) {
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1" ),
- Equals(std::vector<Catch::StringRef>{"Value1"} ) );
- CHECK_THAT( parseEnums( "Value1" ),
- Equals( std::vector<Catch::StringRef>{"Value1"} ) );
- CHECK_THAT( parseEnums( "EnumName::Value1" ),
- Equals(std::vector<Catch::StringRef>{"Value1"} ) );
- }
-
- SECTION( "Multiple enum values" ) {
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ),
- Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) );
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ),
- Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) );
- CHECK_THAT( parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ),
- Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) );
- }
-}
-
-TEST_CASE( "Directly creating an EnumInfo" ) {
-
- using namespace Catch::Detail;
- std::unique_ptr<EnumInfo> enumInfo = makeEnumInfo( "EnumName", "EnumName::Value1, EnumName::Value2", {0, 1} );
-
- CHECK( enumInfo->lookup(0) == "Value1" );
- CHECK( enumInfo->lookup(1) == "Value2" );
- CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" );
-}
diff --git a/projects/SelfTest/IntrospectiveTests/Xml.tests.cpp b/projects/SelfTest/IntrospectiveTests/Xml.tests.cpp
deleted file mode 100644
index bf6c8602..00000000
--- a/projects/SelfTest/IntrospectiveTests/Xml.tests.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-#include "catch.hpp"
-#include "internal/catch_xmlwriter.h"
-
-#include <sstream>
-
-inline std::string encode( std::string const& str, Catch::XmlEncode::ForWhat forWhat = Catch::XmlEncode::ForTextNodes ) {
- std::ostringstream oss;
- oss << Catch::XmlEncode( str, forWhat );
- return oss.str();
-}
-
-TEST_CASE( "XmlEncode", "[XML]" ) {
- SECTION( "normal string" ) {
- REQUIRE( encode( "normal string" ) == "normal string" );
- }
- SECTION( "empty string" ) {
- REQUIRE( encode( "" ) == "" );
- }
- SECTION( "string with ampersand" ) {
- REQUIRE( encode( "smith & jones" ) == "smith &amp; jones" );
- }
- SECTION( "string with less-than" ) {
- REQUIRE( encode( "smith < jones" ) == "smith &lt; jones" );
- }
- SECTION( "string with greater-than" ) {
- REQUIRE( encode( "smith > jones" ) == "smith > jones" );
- REQUIRE( encode( "smith ]]> jones" ) == "smith ]]&gt; jones" );
- }
- SECTION( "string with quotes" ) {
- std::string stringWithQuotes = "don't \"quote\" me on that";
- REQUIRE( encode( stringWithQuotes ) == stringWithQuotes );
- REQUIRE( encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" );
- }
- SECTION( "string with control char (1)" ) {
- REQUIRE( encode( "[\x01]" ) == "[\\x01]" );
- }
- SECTION( "string with control char (x7F)" ) {
- REQUIRE( encode( "[\x7F]" ) == "[\\x7F]" );
- }
-}
-
-// Thanks to Peter Bindels (dascandy) for some of the tests
-TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8][approvals]") {
-#define ESC(lit) (char*)(lit)
- SECTION("Valid utf-8 strings") {
- CHECK(encode(ESC(u8"Here be 👾")) == ESC(u8"Here be 👾"));
- CHECK(encode(ESC(u8"Å¡Å¡")) == ESC(u8"Å¡Å¡"));
-
- CHECK(encode("\xDF\xBF") == "\xDF\xBF"); // 0x7FF
- CHECK(encode("\xE0\xA0\x80") == "\xE0\xA0\x80"); // 0x800
- CHECK(encode("\xED\x9F\xBF") == "\xED\x9F\xBF"); // 0xD7FF
- CHECK(encode("\xEE\x80\x80") == "\xEE\x80\x80"); // 0xE000
- CHECK(encode("\xEF\xBF\xBF") == "\xEF\xBF\xBF"); // 0xFFFF
- CHECK(encode("\xF0\x90\x80\x80") == "\xF0\x90\x80\x80"); // 0x10000
- CHECK(encode("\xF4\x8F\xBF\xBF") == "\xF4\x8F\xBF\xBF"); // 0x10FFFF
- }
- SECTION("Invalid utf-8 strings") {
- SECTION("Various broken strings") {
- CHECK(encode(ESC("Here \xFF be \xF0\x9F\x91\xBE")) == ESC(u8"Here \\xFF be 👾"));
- CHECK(encode("\xFF") == "\\xFF");
- CHECK(encode("\xC5\xC5\xA0") == ESC(u8"\\xC5Å "));
- CHECK(encode("\xF4\x90\x80\x80") == ESC(u8"\\xF4\\x90\\x80\\x80")); // 0x110000 -- out of unicode range
- }
-
- SECTION("Overlong encodings") {
- CHECK(encode("\xC0\x80") == "\\xC0\\x80"); // \0
- CHECK(encode("\xF0\x80\x80\x80") == "\\xF0\\x80\\x80\\x80"); // Super-over-long \0
- CHECK(encode("\xC1\xBF") == "\\xC1\\xBF"); // ASCII char as UTF-8 (0x7F)
- CHECK(encode("\xE0\x9F\xBF") == "\\xE0\\x9F\\xBF"); // 0x7FF
- CHECK(encode("\xF0\x8F\xBF\xBF") == "\\xF0\\x8F\\xBF\\xBF"); // 0xFFFF
- }
-
- // Note that we actually don't modify surrogate pairs, as we do not do strict checking
- SECTION("Surrogate pairs") {
- CHECK(encode("\xED\xA0\x80") == "\xED\xA0\x80"); // Invalid surrogate half 0xD800
- CHECK(encode("\xED\xAF\xBF") == "\xED\xAF\xBF"); // Invalid surrogate half 0xDBFF
- CHECK(encode("\xED\xB0\x80") == "\xED\xB0\x80"); // Invalid surrogate half 0xDC00
- CHECK(encode("\xED\xBF\xBF") == "\xED\xBF\xBF"); // Invalid surrogate half 0xDFFF
- }
-
- SECTION("Invalid start byte") {
- CHECK(encode("\x80") == "\\x80");
- CHECK(encode("\x81") == "\\x81");
- CHECK(encode("\xBC") == "\\xBC");
- CHECK(encode("\xBF") == "\\xBF");
- // Out of range
- CHECK(encode("\xF5\x80\x80\x80") == "\\xF5\\x80\\x80\\x80");
- CHECK(encode("\xF6\x80\x80\x80") == "\\xF6\\x80\\x80\\x80");
- CHECK(encode("\xF7\x80\x80\x80") == "\\xF7\\x80\\x80\\x80");
- }
-
- SECTION("Missing continuation byte(s)") {
- // Missing first continuation byte
- CHECK(encode("\xDE") == "\\xDE");
- CHECK(encode("\xDF") == "\\xDF");
- CHECK(encode("\xE0") == "\\xE0");
- CHECK(encode("\xEF") == "\\xEF");
- CHECK(encode("\xF0") == "\\xF0");
- CHECK(encode("\xF4") == "\\xF4");
-
- // Missing second continuation byte
- CHECK(encode("\xE0\x80") == "\\xE0\\x80");
- CHECK(encode("\xE0\xBF") == "\\xE0\\xBF");
- CHECK(encode("\xE1\x80") == "\\xE1\\x80");
- CHECK(encode("\xF0\x80") == "\\xF0\\x80");
- CHECK(encode("\xF4\x80") == "\\xF4\\x80");
-
- // Missing third continuation byte
- CHECK(encode("\xF0\x80\x80") == "\\xF0\\x80\\x80");
- CHECK(encode("\xF4\x80\x80") == "\\xF4\\x80\\x80");
- }
- }
-#undef ESC
-}
diff --git a/projects/SelfTest/Misc/invalid-test-names.input b/projects/SelfTest/Misc/invalid-test-names.input
deleted file mode 100644
index e2bc88ec..00000000
--- a/projects/SelfTest/Misc/invalid-test-names.input
+++ /dev/null
@@ -1 +0,0 @@
-Test with special, characters in \" name
diff --git a/projects/SelfTest/Misc/plain-old-tests.input b/projects/SelfTest/Misc/plain-old-tests.input
deleted file mode 100644
index ae6d9f1b..00000000
--- a/projects/SelfTest/Misc/plain-old-tests.input
+++ /dev/null
@@ -1,2 +0,0 @@
-random SECTION tests
-nested SECTION tests
diff --git a/projects/SelfTest/Misc/special-characters-in-file.input b/projects/SelfTest/Misc/special-characters-in-file.input
deleted file mode 100644
index b68a6bfd..00000000
--- a/projects/SelfTest/Misc/special-characters-in-file.input
+++ /dev/null
@@ -1 +0,0 @@
-Test with special\, characters \"in name
diff --git a/projects/SelfTest/SurrogateCpps/catch_console_colour.cpp b/projects/SelfTest/SurrogateCpps/catch_console_colour.cpp
deleted file mode 100644
index a2377500..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_console_colour.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file is only here to verify (to the extent possible) the self sufficiency of the header
-#include "internal/catch_suppress_warnings.h"
-#include "internal/catch_console_colour.h"
diff --git a/projects/SelfTest/SurrogateCpps/catch_debugger.cpp b/projects/SelfTest/SurrogateCpps/catch_debugger.cpp
deleted file mode 100644
index 04f4e071..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_debugger.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-// This file is only here to verify (to the extent possible) the self sufficiency of the header
-#include "internal/catch_debugger.h"
diff --git a/projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp b/projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp
deleted file mode 100644
index f3c71585..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "internal/catch_suppress_warnings.h"
-#include "internal/catch_interfaces_reporter.h"
diff --git a/projects/SelfTest/SurrogateCpps/catch_option.cpp b/projects/SelfTest/SurrogateCpps/catch_option.cpp
deleted file mode 100644
index a4ca37c2..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_option.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file is only here to verify (to the extent possible) the self sufficiency of the header
-#include "internal/catch_suppress_warnings.h"
-#include "internal/catch_option.hpp"
diff --git a/projects/SelfTest/SurrogateCpps/catch_stream.cpp b/projects/SelfTest/SurrogateCpps/catch_stream.cpp
deleted file mode 100644
index a76d8413..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_stream.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file is only here to verify (to the extent possible) the self sufficiency of the header
-#include "internal/catch_suppress_warnings.h"
-#include "internal/catch_stream.h"
diff --git a/projects/SelfTest/SurrogateCpps/catch_test_case_tracker.cpp b/projects/SelfTest/SurrogateCpps/catch_test_case_tracker.cpp
deleted file mode 100644
index 0d697b0f..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_test_case_tracker.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-// This file is only here to verify (to the extent possible) the self sufficiency of the header
-#include "internal/catch_test_case_tracker.h"
diff --git a/projects/SelfTest/SurrogateCpps/catch_test_spec.cpp b/projects/SelfTest/SurrogateCpps/catch_test_spec.cpp
deleted file mode 100644
index 8be135ec..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_test_spec.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file is only here to verify (to the extent possible) the self sufficiency of the header
-#include "internal/catch_suppress_warnings.h"
-#include "internal/catch_test_spec.h"
diff --git a/projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp b/projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp
deleted file mode 100644
index 930e3825..00000000
--- a/projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file is only here to verify (to the extent possible) the self sufficiency of the header
-#include "internal/catch_suppress_warnings.h"
-#include "internal/catch_xmlwriter.h"
-#include "internal/catch_reenable_warnings.h"
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
deleted file mode 100644
index a16f0c22..00000000
--- a/projects/SelfTest/TestMain.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Created by Phil on 22/10/2010.
- * Copyright 2010 Two Blue Cubes Ltd
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-
-// These reporters are not included in the single include, so must be included separately in the main file
-#include "reporters/catch_reporter_teamcity.hpp"
-#include "reporters/catch_reporter_tap.hpp"
-#include "reporters/catch_reporter_automake.hpp"
-#include "reporters/catch_reporter_sonarqube.hpp"
-
-
-// Some example tag aliases
-CATCH_REGISTER_TAG_ALIAS( "[@nhf]", "[failing]~[.]" )
-CATCH_REGISTER_TAG_ALIAS( "[@tricky]", "[tricky]~[.]" )
-
-
-#ifdef __clang__
-# pragma clang diagnostic ignored "-Wpadded"
-# pragma clang diagnostic ignored "-Wweak-vtables"
-# pragma clang diagnostic ignored "-Wc++98-compat"
-#endif
-
-struct TestListener : Catch::TestEventListenerBase {
- using TestEventListenerBase::TestEventListenerBase; // inherit constructor
-};
-CATCH_REGISTER_LISTENER( TestListener )
-
diff --git a/projects/SelfTest/UsageTests/Approx.tests.cpp b/projects/SelfTest/UsageTests/Approx.tests.cpp
deleted file mode 100644
index 4029223a..00000000
--- a/projects/SelfTest/UsageTests/Approx.tests.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Created by Phil on 28/04/2011.
- * Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-#include <cmath>
-
-namespace { namespace ApproxTests {
-
-#ifndef APPROX_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define APPROX_TEST_HELPERS_INCLUDED
-
- inline double divide( double a, double b ) {
- return a/b;
- }
-
- class StrongDoubleTypedef {
- double d_ = 0.0;
-
- public:
- explicit StrongDoubleTypedef(double d) : d_(d) {}
- explicit operator double() const { return d_; }
- };
-
- inline std::ostream& operator<<( std::ostream& os, StrongDoubleTypedef td ) {
- return os << "StrongDoubleTypedef(" << static_cast<double>(td) << ")";
- }
-
-#endif
-
-using namespace Catch::literals;
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "A comparison that uses literals instead of the normal constructor", "[Approx]" ) {
- double d = 1.23;
-
- REQUIRE( d == 1.23_a );
- REQUIRE( d != 1.22_a );
- REQUIRE( -d == -1.23_a );
-
- REQUIRE( d == 1.2_a .epsilon(.1) );
- REQUIRE( d != 1.2_a .epsilon(.001) );
- REQUIRE( d == 1_a .epsilon(.3) );
-}
-
-TEST_CASE( "Some simple comparisons between doubles", "[Approx]" ) {
- double d = 1.23;
-
- REQUIRE( d == Approx( 1.23 ) );
- REQUIRE( d != Approx( 1.22 ) );
- REQUIRE( d != Approx( 1.24 ) );
-
- REQUIRE( d == 1.23_a );
- REQUIRE( d != 1.22_a );
-
- REQUIRE( Approx( d ) == 1.23 );
- REQUIRE( Approx( d ) != 1.22 );
- REQUIRE( Approx( d ) != 1.24 );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "Approximate comparisons with different epsilons", "[Approx]" ) {
- double d = 1.23;
-
- REQUIRE( d != Approx( 1.231 ) );
- REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "Less-than inequalities with different epsilons", "[Approx]" ) {
- double d = 1.23;
-
- REQUIRE( d <= Approx( 1.24 ) );
- REQUIRE( d <= Approx( 1.23 ) );
- REQUIRE_FALSE( d <= Approx( 1.22 ) );
- REQUIRE( d <= Approx( 1.22 ).epsilon(0.1) );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "Greater-than inequalities with different epsilons", "[Approx]" ) {
- double d = 1.23;
-
- REQUIRE( d >= Approx( 1.22 ) );
- REQUIRE( d >= Approx( 1.23 ) );
- REQUIRE_FALSE( d >= Approx( 1.24 ) );
- REQUIRE( d >= Approx( 1.24 ).epsilon(0.1) );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "Approximate comparisons with floats", "[Approx]" ) {
- REQUIRE( 1.23f == Approx( 1.23f ) );
- REQUIRE( 0.0f == Approx( 0.0f ) );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "Approximate comparisons with ints", "[Approx]" ) {
- REQUIRE( 1 == Approx( 1 ) );
- REQUIRE( 0 == Approx( 0 ) );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "Approximate comparisons with mixed numeric types", "[Approx]" ) {
- const double dZero = 0;
- const double dSmall = 0.00001;
- const double dMedium = 1.234;
-
- REQUIRE( 1.0f == Approx( 1 ) );
- REQUIRE( 0 == Approx( dZero) );
- REQUIRE( 0 == Approx( dSmall ).margin( 0.001 ) );
- REQUIRE( 1.234f == Approx( dMedium ) );
- REQUIRE( dMedium == Approx( 1.234f ) );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE( "Use a custom approx", "[Approx][custom]" ) {
- double d = 1.23;
-
- Approx approx = Approx::custom().epsilon( 0.01 );
-
- REQUIRE( d == approx( 1.23 ) );
- REQUIRE( d == approx( 1.22 ) );
- REQUIRE( d == approx( 1.24 ) );
- REQUIRE( d != approx( 1.25 ) );
-
- REQUIRE( approx( d ) == 1.23 );
- REQUIRE( approx( d ) == 1.22 );
- REQUIRE( approx( d ) == 1.24 );
- REQUIRE( approx( d ) != 1.25 );
-}
-
-TEST_CASE( "Approximate PI", "[Approx][PI]" ) {
- REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) );
- REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-TEST_CASE( "Absolute margin", "[Approx]" ) {
- REQUIRE( 104.0 != Approx(100.0) );
- REQUIRE( 104.0 == Approx(100.0).margin(5) );
- REQUIRE( 104.0 == Approx(100.0).margin(4) );
- REQUIRE( 104.0 != Approx(100.0).margin(3) );
- REQUIRE( 100.3 != Approx(100.0) );
- REQUIRE( 100.3 == Approx(100.0).margin(0.5) );
-}
-
-TEST_CASE("Approx with exactly-representable margin", "[Approx]") {
- CHECK( 0.25f == Approx(0.0f).margin(0.25f) );
-
- CHECK( 0.0f == Approx(0.25f).margin(0.25f) );
- CHECK( 0.5f == Approx(0.25f).margin(0.25f) );
-
- CHECK( 245.0f == Approx(245.25f).margin(0.25f) );
- CHECK( 245.5f == Approx(245.25f).margin(0.25f) );
-}
-
-TEST_CASE("Approx setters validate their arguments", "[Approx]") {
- REQUIRE_NOTHROW(Approx(0).margin(0));
- REQUIRE_NOTHROW(Approx(0).margin(1234656));
-
- REQUIRE_THROWS_AS(Approx(0).margin(-2), std::domain_error);
-
- REQUIRE_NOTHROW(Approx(0).epsilon(0));
- REQUIRE_NOTHROW(Approx(0).epsilon(1));
-
- REQUIRE_THROWS_AS(Approx(0).epsilon(-0.001), std::domain_error);
- REQUIRE_THROWS_AS(Approx(0).epsilon(1.0001), std::domain_error);
-}
-
-TEST_CASE("Default scale is invisible to comparison", "[Approx]") {
- REQUIRE(101.000001 != Approx(100).epsilon(0.01));
- REQUIRE(std::pow(10, -5) != Approx(std::pow(10, -7)));
-}
-
-TEST_CASE("Epsilon only applies to Approx's value", "[Approx]") {
- REQUIRE(101.01 != Approx(100).epsilon(0.01));
-}
-
-TEST_CASE("Assorted miscellaneous tests", "[Approx][approvals]") {
- REQUIRE(INFINITY == Approx(INFINITY));
- REQUIRE(-INFINITY != Approx(INFINITY));
- REQUIRE(1 != Approx(INFINITY));
- REQUIRE(INFINITY != Approx(1));
- REQUIRE(NAN != Approx(NAN));
- REQUIRE_FALSE(NAN == Approx(NAN));
-}
-
-TEST_CASE( "Comparison with explicitly convertible types", "[Approx]" )
-{
- StrongDoubleTypedef td(10.0);
-
- REQUIRE(td == Approx(10.0));
- REQUIRE(Approx(10.0) == td);
-
- REQUIRE(td != Approx(11.0));
- REQUIRE(Approx(11.0) != td);
-
- REQUIRE(td <= Approx(10.0));
- REQUIRE(td <= Approx(11.0));
- REQUIRE(Approx(10.0) <= td);
- REQUIRE(Approx(9.0) <= td);
-
- REQUIRE(td >= Approx(9.0));
- REQUIRE(td >= Approx(td));
- REQUIRE(Approx(td) >= td);
- REQUIRE(Approx(11.0) >= td);
-
-}
-
-}} // namespace ApproxTests
diff --git a/projects/SelfTest/UsageTests/BDD.tests.cpp b/projects/SelfTest/UsageTests/BDD.tests.cpp
deleted file mode 100644
index d0d3e038..00000000
--- a/projects/SelfTest/UsageTests/BDD.tests.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Created by Phil on 29/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-namespace { namespace BDDTests {
-
-#ifndef BDD_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define BDD_TEST_HELPERS_INCLUDED
-
- inline bool itDoesThis() { return true; }
-
- inline bool itDoesThat() { return true; }
-
- namespace {
-
-// a trivial fixture example to support SCENARIO_METHOD tests
- struct Fixture {
- Fixture()
- : d_counter(0) {
- }
-
- int counter() {
- return d_counter++;
- }
-
- int d_counter;
- };
-
- }
-#endif
-
- SCENARIO("Do that thing with the thing", "[Tags]") {
- GIVEN("This stuff exists") {
- // make stuff exist
- AND_GIVEN("And some assumption") {
- // Validate assumption
- WHEN("I do this") {
- // do this
- THEN("it should do this") {
- REQUIRE(itDoesThis());
- AND_THEN("do that")REQUIRE(itDoesThat());
- }
- }
- }
- }
- }
-
- SCENARIO("Vector resizing affects size and capacity", "[vector][bdd][size][capacity]") {
- GIVEN("an empty vector") {
- std::vector<int> v;
- REQUIRE(v.size() == 0);
-
- WHEN("it is made larger") {
- v.resize(10);
- THEN("the size and capacity go up") {
- REQUIRE(v.size() == 10);
- REQUIRE(v.capacity() >= 10);
-
- AND_WHEN("it is made smaller again") {
- v.resize(5);
- THEN("the size goes down but the capacity stays the same") {
- REQUIRE(v.size() == 5);
- REQUIRE(v.capacity() >= 10);
- }
- }
- }
- }
-
- WHEN("we reserve more space") {
- v.reserve(10);
- THEN("The capacity is increased but the size remains the same") {
- REQUIRE(v.capacity() >= 10);
- REQUIRE(v.size() == 0);
- }
- }
- }
- }
-
- SCENARIO("This is a really long scenario name to see how the list command deals with wrapping",
- "[very long tags][lots][long][tags][verbose]"
- "[one very long tag name that should cause line wrapping writing out using the list command]"
- "[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter]") {
- GIVEN("A section name that is so long that it cannot fit in a single console width")WHEN(
- "The test headers are printed as part of the normal running of the scenario")THEN(
- "The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent")SUCCEED(
- "boo!");
- }
-
- SCENARIO_METHOD(Fixture,
- "BDD tests requiring Fixtures to provide commonly-accessed data or methods",
- "[bdd][fixtures]") {
- const int before(counter());
- GIVEN("No operations precede me") {
- REQUIRE(before == 0);
- WHEN("We get the count") {
- const int after(counter());
- THEN("Subsequently values are higher") {
- REQUIRE(after > before);
- }
- }
- }
- }
-
-}} // namespace BDDtests
diff --git a/projects/SelfTest/UsageTests/Benchmark.tests.cpp b/projects/SelfTest/UsageTests/Benchmark.tests.cpp
deleted file mode 100644
index e795ddd1..00000000
--- a/projects/SelfTest/UsageTests/Benchmark.tests.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-#include "catch.hpp"
-
-#include <map>
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-namespace {
- std::uint64_t Fibonacci(std::uint64_t number) {
- return number < 2 ? 1 : Fibonacci(number - 1) + Fibonacci(number - 2);
- }
-}
-
-TEST_CASE("Benchmark Fibonacci", "[!benchmark]") {
- CHECK(Fibonacci(0) == 1);
- // some more asserts..
- CHECK(Fibonacci(5) == 8);
- // some more asserts..
-
- BENCHMARK("Fibonacci 20") {
- return Fibonacci(20);
- };
-
- BENCHMARK("Fibonacci 25") {
- return Fibonacci(25);
- };
-
- BENCHMARK("Fibonacci 30") {
- return Fibonacci(30);
- };
-
- BENCHMARK("Fibonacci 35") {
- return Fibonacci(35);
- };
-}
-
-TEST_CASE("Benchmark containers", "[!benchmark]") {
- static const int size = 100;
-
- std::vector<int> v;
- std::map<int, int> m;
-
- SECTION("without generator") {
- BENCHMARK("Load up a vector") {
- v = std::vector<int>();
- for (int i = 0; i < size; ++i)
- v.push_back(i);
- };
- REQUIRE(v.size() == size);
-
- // test optimizer control
- BENCHMARK("Add up a vector's content") {
- uint64_t add = 0;
- for (int i = 0; i < size; ++i)
- add += v[i];
- return add;
- };
-
- BENCHMARK("Load up a map") {
- m = std::map<int, int>();
- for (int i = 0; i < size; ++i)
- m.insert({ i, i + 1 });
- };
- REQUIRE(m.size() == size);
-
- BENCHMARK("Reserved vector") {
- v = std::vector<int>();
- v.reserve(size);
- for (int i = 0; i < size; ++i)
- v.push_back(i);
- };
- REQUIRE(v.size() == size);
-
- BENCHMARK("Resized vector") {
- v = std::vector<int>();
- v.resize(size);
- for (int i = 0; i < size; ++i)
- v[i] = i;
- };
- REQUIRE(v.size() == size);
-
- int array[size];
- BENCHMARK("A fixed size array that should require no allocations") {
- for (int i = 0; i < size; ++i)
- array[i] = i;
- };
- int sum = 0;
- for (int i = 0; i < size; ++i)
- sum += array[i];
- REQUIRE(sum > size);
-
- SECTION("XYZ") {
-
- BENCHMARK_ADVANCED("Load up vector with chronometer")(Catch::Benchmark::Chronometer meter) {
- std::vector<int> k;
- meter.measure([&](int idx) {
- k = std::vector<int>();
- for (int i = 0; i < size; ++i)
- k.push_back(idx);
- });
- REQUIRE(k.size() == size);
- };
-
- int runs = 0;
- BENCHMARK("Fill vector indexed", benchmarkIndex) {
- v = std::vector<int>();
- v.resize(size);
- for (int i = 0; i < size; ++i)
- v[i] = benchmarkIndex;
- runs = benchmarkIndex;
- };
-
- for (size_t i = 0; i < v.size(); ++i) {
- REQUIRE(v[i] == runs);
- }
- }
- }
-
- SECTION("with generator") {
- auto generated = GENERATE(range(0, 10));
- BENCHMARK("Fill vector generated") {
- v = std::vector<int>();
- v.resize(size);
- for (int i = 0; i < size; ++i)
- v[i] = generated;
- };
- for (size_t i = 0; i < v.size(); ++i) {
- REQUIRE(v[i] == generated);
- }
- }
-
- SECTION("construct and destroy example") {
- BENCHMARK_ADVANCED("construct")(Catch::Benchmark::Chronometer meter) {
- std::vector<Catch::Benchmark::storage_for<std::string>> storage(meter.runs());
- meter.measure([&](int i) { storage[i].construct("thing"); });
- };
-
- BENCHMARK_ADVANCED("destroy")(Catch::Benchmark::Chronometer meter) {
- std::vector<Catch::Benchmark::destructable_object<std::string>> storage(meter.runs());
- for(auto&& o : storage)
- o.construct("thing");
- meter.measure([&](int i) { storage[i].destruct(); });
- };
- }
-}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
diff --git a/projects/SelfTest/UsageTests/Class.tests.cpp b/projects/SelfTest/UsageTests/Class.tests.cpp
deleted file mode 100644
index f658fc19..00000000
--- a/projects/SelfTest/UsageTests/Class.tests.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-#include <array>
-
-namespace{ namespace ClassTests {
-
-#ifndef CLASS_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define CLASS_TEST_HELPERS_INCLUDED
-
-class TestClass
-{
- std::string s;
-
-public:
- TestClass()
- : s( "hello" )
- {}
-
- void succeedingCase()
- {
- REQUIRE( s == "hello" );
- }
- void failingCase()
- {
- REQUIRE( s == "world" );
- }
-};
-
-struct Fixture
-{
- Fixture() : m_a( 1 ) {}
-
- int m_a;
-};
-
-template< typename T >
-struct Template_Fixture {
- Template_Fixture(): m_a(1) {}
-
- T m_a;
-};
-
-template<typename T>
-struct Template_Fixture_2 {
- Template_Fixture_2() {}
-
- T m_a;
-};
-
-template< typename T>
-struct Template_Foo {
- size_t size() { return 0; }
-};
-
-template< typename T, size_t V>
-struct Template_Foo_2 {
- size_t size() { return V; }
-};
-
-template <int V>
-struct Nttp_Fixture{
- int value = V;
-};
-#endif
-
-
-
-METHOD_AS_TEST_CASE( TestClass::succeedingCase, "A METHOD_AS_TEST_CASE based test run that succeeds", "[class]" )
-METHOD_AS_TEST_CASE( TestClass::failingCase, "A METHOD_AS_TEST_CASE based test run that fails", "[.][class][failing]" )
-
-TEST_CASE_METHOD( Fixture, "A TEST_CASE_METHOD based test run that succeeds", "[class]" )
-{
- REQUIRE( m_a == 1 );
-}
-
-TEMPLATE_TEST_CASE_METHOD(Template_Fixture, "A TEMPLATE_TEST_CASE_METHOD based test run that succeeds", "[class][template]", int, float, double) {
- REQUIRE( Template_Fixture<TestType>::m_a == 1 );
-}
-
-TEMPLATE_TEST_CASE_METHOD_SIG(Nttp_Fixture, "A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds", "[class][template][nttp]",((int V), V), 1, 3, 6) {
- REQUIRE(Nttp_Fixture<V>::value > 0);
-}
-
-TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds","[class][template][product]",(std::vector,Template_Foo),(int,float))
-{
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 );
-}
-
-TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds", "[class][template][product][nttp]", ((typename T, size_t S), T, S),(std::array, Template_Foo_2), ((int,2), (float,6)))
-{
- REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() >= 2);
-}
-
-using MyTypes = std::tuple<int, char, double>;
-TEMPLATE_LIST_TEST_CASE_METHOD(Template_Fixture, "Template test case method with test types specified inside std::tuple", "[class][template][list]", MyTypes)
-{
- REQUIRE( Template_Fixture<TestType>::m_a == 1 );
-}
-
-// We should be able to write our tests within a different namespace
-namespace Inner
-{
- TEST_CASE_METHOD( Fixture, "A TEST_CASE_METHOD based test run that fails", "[.][class][failing]" )
- {
- REQUIRE( m_a == 2 );
- }
-
- TEMPLATE_TEST_CASE_METHOD(Template_Fixture,"A TEMPLATE_TEST_CASE_METHOD based test run that fails", "[.][class][template][failing]", int, float, double)
- {
- REQUIRE( Template_Fixture<TestType>::m_a == 2 );
- }
-
- TEMPLATE_TEST_CASE_METHOD_SIG(Nttp_Fixture, "A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails", "[.][class][template][nttp][failing]", ((int V), V), 1, 3, 6) {
- REQUIRE(Nttp_Fixture<V>::value == 0);
- }
-
- TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails","[.][class][template][product][failing]",(std::vector,Template_Foo),(int,float))
- {
- REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 );
- }
-
- TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails", "[.][class][template][product][nttp][failing]", ((typename T, size_t S), T, S), (std::array, Template_Foo_2), ((int, 2), (float, 6)))
- {
- REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2);
- }
-}
-
-
-
-}} // namespace ClassTests
diff --git a/projects/SelfTest/UsageTests/Compilation.tests.cpp b/projects/SelfTest/UsageTests/Compilation.tests.cpp
deleted file mode 100644
index 1c060145..00000000
--- a/projects/SelfTest/UsageTests/Compilation.tests.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Created by Martin on 17/02/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include <type_traits>
-
-// Setup for #1403 -- look for global overloads of operator << for classes
-// in a different namespace.
-#include <ostream>
-
-namespace foo {
- struct helper_1403 {
- bool operator==(helper_1403) const { return true; }
- };
-}
-
-namespace bar {
- template <typename... Ts>
- struct TypeList {};
-}
-
-#ifdef __GNUC__
-#pragma GCC diagnostic ignored "-Wmissing-declarations"
-#endif
-std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) {
- return out << "[1403 helper]";
-}
-///////////////////////////////
-
-#include "catch.hpp"
-
-#include <cstring>
-
-namespace { namespace CompilationTests {
-
-#ifndef COMPILATION_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define COMPILATION_TEST_HELPERS_INCLUDED
-
- // Comparison operators can return non-booleans.
- // This is unusual, but should be supported.
- struct logic_t {
- logic_t operator< (logic_t) const { return {}; }
- logic_t operator<=(logic_t) const { return {}; }
- logic_t operator> (logic_t) const { return {}; }
- logic_t operator>=(logic_t) const { return {}; }
- logic_t operator==(logic_t) const { return {}; }
- logic_t operator!=(logic_t) const { return {}; }
- explicit operator bool() const { return true; }
- };
-
-
-// This is a minimal example for an issue we have found in 1.7.0
- struct foo {
- int i;
- };
-
- template<typename T>
- bool operator==(const T &val, foo f) {
- return val == f.i;
- }
-
- struct Y {
- uint32_t v : 1;
- };
-
- void throws_int(bool b) {
- if (b) {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- throw 1;
-#else
- std::terminate();
-#endif
- }
- }
-
- template<typename T>
- bool templated_tests(T t) {
- int a = 3;
- REQUIRE(a == t);
- CHECK(a == t);
- REQUIRE_THROWS(throws_int(true));
- CHECK_THROWS_AS(throws_int(true), int);
- REQUIRE_NOTHROW(throws_int(false));
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
- REQUIRE_THAT("aaa", Catch::EndsWith("aaa"));
-#endif
- return true;
- }
-
- struct A {
- };
-
- std::ostream &operator<<(std::ostream &o, const A &) { return o << 0; }
-
- struct B : private A {
- bool operator==(int) const { return true; }
- };
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
-#endif
-#ifdef __GNUC__
-// Note that because -~GCC~-, this warning cannot be silenced temporarily, by pushing diagnostic stack...
-// Luckily it is firing in test files and thus can be silenced for the whole file, without losing much.
-#pragma GCC diagnostic ignored "-Wunused-function"
-#endif
-
- B f();
-
- std::ostream g();
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
- template <typename, typename>
- struct Fixture_1245 {};
-
-#endif
-
- TEST_CASE("#809") {
- foo f;
- f.i = 42;
- REQUIRE(42 == f);
- }
-
-
-// ------------------------------------------------------------------
-// Changes to REQUIRE_THROWS_AS made it stop working in a template in
-// an unfixable way (as long as C++03 compatibility is being kept).
-// To prevent these from happening in the future, this needs to compile
-
- TEST_CASE("#833") {
- REQUIRE(templated_tests<int>(3));
- }
-
-
-// Test containing example where original stream insertable check breaks compilation
-
-
- TEST_CASE("#872") {
- A dummy;
- CAPTURE(dummy);
- B x;
- REQUIRE (x == 4);
- }
-
-
- TEST_CASE("#1027") {
- Y y{0};
- REQUIRE(y.v == 0);
- REQUIRE(0 == y.v);
- }
-
- // Comparison operators can return non-booleans.
- // This is unusual, but should be supported.
- TEST_CASE("#1147") {
- logic_t t1, t2;
- REQUIRE(t1 == t2);
- REQUIRE(t1 != t2);
- REQUIRE(t1 < t2);
- REQUIRE(t1 > t2);
- REQUIRE(t1 <= t2);
- REQUIRE(t1 >= t2);
- }
-
- // unsigned array
- TEST_CASE("#1238") {
- unsigned char uarr[] = "123";
- CAPTURE(uarr);
- signed char sarr[] = "456";
- CAPTURE(sarr);
-
- REQUIRE(std::memcmp(uarr, "123", sizeof(uarr)) == 0);
- REQUIRE(std::memcmp(sarr, "456", sizeof(sarr)) == 0);
- }
-
- TEST_CASE_METHOD((Fixture_1245<int, int>), "#1245", "[compilation]") {
- SUCCEED();
- }
-
- TEST_CASE("#1403", "[compilation]") {
- ::foo::helper_1403 h1, h2;
- REQUIRE(h1 == h2);
- }
-
- TEST_CASE("Optionally static assertions", "[compilation]") {
- STATIC_REQUIRE( std::is_void<void>::value );
- STATIC_REQUIRE_FALSE( std::is_void<int>::value );
- }
-
- TEST_CASE("#1548", "[compilation]") {
- using namespace bar;
- REQUIRE(std::is_same<TypeList<int>, TypeList<int>>::value);
- }
-
- // #925
- using signal_t = void (*) (void*);
-
- struct TestClass {
- signal_t testMethod_uponComplete_arg = nullptr;
- };
-
- namespace utility {
- inline static void synchronizing_callback( void * ) { }
- }
-
-#if defined (_MSC_VER)
-#pragma warning(push)
-// The function pointer comparison below triggers warning because of
-// calling conventions
-#pragma warning(disable:4244)
-#endif
- TEST_CASE("#925: comparing function pointer to function address failed to compile", "[!nonportable]" ) {
- TestClass test;
- REQUIRE(utility::synchronizing_callback != test.testMethod_uponComplete_arg);
- }
-#if defined (_MSC_VER)
-#pragma warning(pop)
-#endif
-
- TEST_CASE( "#1027: Bitfields can be captured" ) {
- struct Y {
- uint32_t v : 1;
- };
- Y y{ 0 };
- REQUIRE( y.v == 0 );
- REQUIRE( 0 == y.v );
- }
-
-
-}} // namespace CompilationTests
-
diff --git a/projects/SelfTest/UsageTests/Condition.tests.cpp b/projects/SelfTest/UsageTests/Condition.tests.cpp
deleted file mode 100644
index 9aed5e2c..00000000
--- a/projects/SelfTest/UsageTests/Condition.tests.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Created by Phil on 08/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifdef __clang__
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wpadded"
-// Wdouble-promotion is not supported until 3.8
-# if (__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ > 7)
-# pragma clang diagnostic ignored "-Wdouble-promotion"
-# endif
-#endif
-
-#include "catch.hpp"
-
-#include <string>
-#include <limits>
-#include <cstdint>
-
-namespace { namespace ConditionTests {
-
-#ifndef CONDITION_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define CONDITION_TEST_HELPERS_INCLUDED
-
-struct TestData {
- int int_seven = 7;
- std::string str_hello = "hello";
- float float_nine_point_one = 9.1f;
- double double_pi = 3.1415926535;
-};
-
-struct TestDef {
- TestDef& operator + ( const std::string& ) {
- return *this;
- }
- TestDef& operator[]( const std::string& ) {
- return *this;
- }
-};
-
-inline const char* returnsConstNull(){ return nullptr; }
-inline char* returnsNull(){ return nullptr; }
-
-#endif
-
-// The "failing" tests all use the CHECK macro, which continues if the specific test fails.
-// This allows us to see all results, even if an earlier check fails
-
-// Equality tests
-TEST_CASE( "Equality checks that should succeed" )
-{
- TestDef td;
- td + "hello" + "hello";
-
- TestData data;
-
- REQUIRE( data.int_seven == 7 );
- REQUIRE( data.float_nine_point_one == Approx( 9.1f ) );
- REQUIRE( data.double_pi == Approx( 3.1415926535 ) );
- REQUIRE( data.str_hello == "hello" );
- REQUIRE( "hello" == data.str_hello );
- REQUIRE( data.str_hello.size() == 5 );
-
- double x = 1.1 + 0.1 + 0.1;
- REQUIRE( x == Approx( 1.3 ) );
-}
-
-TEST_CASE( "Equality checks that should fail", "[.][failing][!mayfail]" )
-{
- TestData data;
-
- CHECK( data.int_seven == 6 );
- CHECK( data.int_seven == 8 );
- CHECK( data.int_seven == 0 );
- CHECK( data.float_nine_point_one == Approx( 9.11f ) );
- CHECK( data.float_nine_point_one == Approx( 9.0f ) );
- CHECK( data.float_nine_point_one == Approx( 1 ) );
- CHECK( data.float_nine_point_one == Approx( 0 ) );
- CHECK( data.double_pi == Approx( 3.1415 ) );
- CHECK( data.str_hello == "goodbye" );
- CHECK( data.str_hello == "hell" );
- CHECK( data.str_hello == "hello1" );
- CHECK( data.str_hello.size() == 6 );
-
- double x = 1.1 + 0.1 + 0.1;
- CHECK( x == Approx( 1.301 ) );
-}
-
-TEST_CASE( "Inequality checks that should succeed" )
-{
- TestData data;
-
- REQUIRE( data.int_seven != 6 );
- REQUIRE( data.int_seven != 8 );
- REQUIRE( data.float_nine_point_one != Approx( 9.11f ) );
- REQUIRE( data.float_nine_point_one != Approx( 9.0f ) );
- REQUIRE( data.float_nine_point_one != Approx( 1 ) );
- REQUIRE( data.float_nine_point_one != Approx( 0 ) );
- REQUIRE( data.double_pi != Approx( 3.1415 ) );
- REQUIRE( data.str_hello != "goodbye" );
- REQUIRE( data.str_hello != "hell" );
- REQUIRE( data.str_hello != "hello1" );
- REQUIRE( data.str_hello.size() != 6 );
-}
-
-TEST_CASE( "Inequality checks that should fail", "[.][failing][!shouldfail]" )
-{
- TestData data;
-
- CHECK( data.int_seven != 7 );
- CHECK( data.float_nine_point_one != Approx( 9.1f ) );
- CHECK( data.double_pi != Approx( 3.1415926535 ) );
- CHECK( data.str_hello != "hello" );
- CHECK( data.str_hello.size() != 5 );
-}
-
-// Ordering comparison tests
-TEST_CASE( "Ordering comparison checks that should succeed" )
-{
- TestData data;
-
- REQUIRE( data.int_seven < 8 );
- REQUIRE( data.int_seven > 6 );
- REQUIRE( data.int_seven > 0 );
- REQUIRE( data.int_seven > -1 );
-
- REQUIRE( data.int_seven >= 7 );
- REQUIRE( data.int_seven >= 6 );
- REQUIRE( data.int_seven <= 7 );
- REQUIRE( data.int_seven <= 8 );
-
- REQUIRE( data.float_nine_point_one > 9 );
- REQUIRE( data.float_nine_point_one < 10 );
- REQUIRE( data.float_nine_point_one < 9.2 );
-
- REQUIRE( data.str_hello <= "hello" );
- REQUIRE( data.str_hello >= "hello" );
-
- REQUIRE( data.str_hello < "hellp" );
- REQUIRE( data.str_hello < "zebra" );
- REQUIRE( data.str_hello > "hellm" );
- REQUIRE( data.str_hello > "a" );
-}
-
-TEST_CASE( "Ordering comparison checks that should fail", "[.][failing]" )
-{
- TestData data;
-
- CHECK( data.int_seven > 7 );
- CHECK( data.int_seven < 7 );
- CHECK( data.int_seven > 8 );
- CHECK( data.int_seven < 6 );
- CHECK( data.int_seven < 0 );
- CHECK( data.int_seven < -1 );
-
- CHECK( data.int_seven >= 8 );
- CHECK( data.int_seven <= 6 );
-
- CHECK( data.float_nine_point_one < 9 );
- CHECK( data.float_nine_point_one > 10 );
- CHECK( data.float_nine_point_one > 9.2 );
-
- CHECK( data.str_hello > "hello" );
- CHECK( data.str_hello < "hello" );
- CHECK( data.str_hello > "hellp" );
- CHECK( data.str_hello > "z" );
- CHECK( data.str_hello < "hellm" );
- CHECK( data.str_hello < "a" );
-
- CHECK( data.str_hello >= "z" );
- CHECK( data.str_hello <= "a" );
-}
-
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-
-
-// Comparisons with int literals
-TEST_CASE( "Comparisons with int literals don't warn when mixing signed/ unsigned" )
-{
- int i = 1;
- unsigned int ui = 2;
- long l = 3;
- unsigned long ul = 4;
- char c = 5;
- unsigned char uc = 6;
-
- REQUIRE( i == 1 );
- REQUIRE( ui == 2 );
- REQUIRE( l == 3 );
- REQUIRE( ul == 4 );
- REQUIRE( c == 5 );
- REQUIRE( uc == 6 );
-
- REQUIRE( 1 == i );
- REQUIRE( 2 == ui );
- REQUIRE( 3 == l );
- REQUIRE( 4 == ul );
- REQUIRE( 5 == c );
- REQUIRE( 6 == uc );
-
- REQUIRE( (std::numeric_limits<uint32_t>::max)() > ul );
-}
-
-// Disable warnings about sign conversions for the next two tests
-// (as we are deliberately invoking them)
-// - Currently only disabled for GCC/ LLVM. Should add VC++ too
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
-#ifdef _MSC_VER
-#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
-#endif
-
-TEST_CASE( "comparisons between int variables" )
-{
- long long_var = 1L;
- unsigned char unsigned_char_var = 1;
- unsigned short unsigned_short_var = 1;
- unsigned int unsigned_int_var = 1;
- unsigned long unsigned_long_var = 1L;
-
- REQUIRE( long_var == unsigned_char_var );
- REQUIRE( long_var == unsigned_short_var );
- REQUIRE( long_var == unsigned_int_var );
- REQUIRE( long_var == unsigned_long_var );
-}
-
-TEST_CASE( "comparisons between const int variables" )
-{
- const unsigned char unsigned_char_var = 1;
- const unsigned short unsigned_short_var = 1;
- const unsigned int unsigned_int_var = 1;
- const unsigned long unsigned_long_var = 1L;
-
- REQUIRE( unsigned_char_var == 1 );
- REQUIRE( unsigned_short_var == 1 );
- REQUIRE( unsigned_int_var == 1 );
- REQUIRE( unsigned_long_var == 1 );
-}
-
-TEST_CASE( "Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" )
-{
- CHECK( ( -1 > 2u ) );
- CHECK( -1 > 2u );
-
- CHECK( ( 2u < -1 ) );
- CHECK( 2u < -1 );
-
- const int minInt = (std::numeric_limits<int>::min)();
- CHECK( ( minInt > 2u ) );
- CHECK( minInt > 2u );
-}
-
-TEST_CASE( "Comparisons between ints where one side is computed" )
-{
- CHECK( 54 == 6*9 );
-}
-
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-TEST_CASE( "Pointers can be compared to null" )
-{
- TestData* p = nullptr;
- TestData* pNULL = nullptr;
-
- REQUIRE( p == nullptr );
- REQUIRE( p == pNULL );
-
- TestData data;
- p = &data;
-
- REQUIRE( p != nullptr );
-
- const TestData* cp = p;
- REQUIRE( cp != nullptr );
-
- const TestData* const cpc = p;
- REQUIRE( cpc != nullptr );
-
- REQUIRE( returnsNull() == nullptr );
- REQUIRE( returnsConstNull() == nullptr );
-
- REQUIRE( nullptr != p );
-}
-
-// Not (!) tests
-// The problem with the ! operator is that it has right-to-left associativity.
-// This means we can't isolate it when we decompose. The simple REQUIRE( !false ) form, therefore,
-// cannot have the operand value extracted. The test will work correctly, and the situation
-// is detected and a warning issued.
-// An alternative form of the macros (CHECK_FALSE and REQUIRE_FALSE) can be used instead to capture
-// the operand value.
-TEST_CASE( "'Not' checks that should succeed" )
-{
- bool falseValue = false;
-
- REQUIRE( false == false );
- REQUIRE( true == true );
- REQUIRE( !false );
- REQUIRE_FALSE( false );
-
- REQUIRE( !falseValue );
- REQUIRE_FALSE( falseValue );
-
- REQUIRE( !(1 == 2) );
- REQUIRE_FALSE( 1 == 2 );
-}
-
-TEST_CASE( "'Not' checks that should fail", "[.][failing]" )
-{
- bool trueValue = true;
-
- CHECK( false != false );
- CHECK( true != true );
- CHECK( !true );
- CHECK_FALSE( true );
-
- CHECK( !trueValue );
- CHECK_FALSE( trueValue );
-
- CHECK( !(1 == 1) );
- CHECK_FALSE( 1 == 1 );
-}
-
-}} // namespace ConditionTests
diff --git a/projects/SelfTest/UsageTests/Decomposition.tests.cpp b/projects/SelfTest/UsageTests/Decomposition.tests.cpp
deleted file mode 100644
index 5bb19cd6..00000000
--- a/projects/SelfTest/UsageTests/Decomposition.tests.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Created by Martin on 27/5/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include <iostream>
-#include <cstdio>
-
-namespace {
-
-struct truthy {
- truthy(bool b):m_value(b){}
- operator bool() const {
- return false;
- }
- bool m_value;
-};
-
-std::ostream& operator<<(std::ostream& o, truthy) {
- o << "Hey, its truthy!";
- return o;
-}
-
-} // end anonymous namespace
-
-#include "catch.hpp"
-
-TEST_CASE( "Reconstruction should be based on stringification: #914" , "[Decomposition][failing][.]") {
- CHECK(truthy(false));
-}
-
-TEST_CASE("#1005: Comparing pointer to int and long (NULL can be either on various systems)", "[Decomposition]") {
- FILE* fptr = nullptr;
- REQUIRE(fptr == 0);
- REQUIRE(fptr == 0l);
-}
diff --git a/projects/SelfTest/UsageTests/EnumToString.tests.cpp b/projects/SelfTest/UsageTests/EnumToString.tests.cpp
deleted file mode 100644
index 7f27916e..00000000
--- a/projects/SelfTest/UsageTests/EnumToString.tests.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-#include "catch.hpp"
-
-
-namespace {
-// Enum without user-provided stream operator
-enum Enum1 { Enum1Value0, Enum1Value1 };
-
-// Enum with user-provided stream operator
-enum Enum2 { Enum2Value0, Enum2Value1 };
-
-std::ostream& operator<<( std::ostream& os, Enum2 v ) {
- return os << "E2{" << static_cast<int>(v) << "}";
-}
-} // end anonymous namespace
-
-TEST_CASE( "toString(enum)", "[toString][enum]" ) {
- Enum1 e0 = Enum1Value0;
- CHECK( ::Catch::Detail::stringify(e0) == "0" );
- Enum1 e1 = Enum1Value1;
- CHECK( ::Catch::Detail::stringify(e1) == "1" );
-}
-
-TEST_CASE( "toString(enum w/operator<<)", "[toString][enum]" ) {
- Enum2 e0 = Enum2Value0;
- CHECK( ::Catch::Detail::stringify(e0) == "E2{0}" );
- Enum2 e1 = Enum2Value1;
- CHECK( ::Catch::Detail::stringify(e1) == "E2{1}" );
-}
-
-// Enum class without user-provided stream operator
-namespace {
-enum class EnumClass1 { EnumClass1Value0, EnumClass1Value1 };
-
-// Enum class with user-provided stream operator
-enum class EnumClass2 { EnumClass2Value0, EnumClass2Value1 };
-
-std::ostream& operator<<( std::ostream& os, EnumClass2 e2 ) {
- switch( static_cast<int>( e2 ) ) {
- case static_cast<int>( EnumClass2::EnumClass2Value0 ):
- return os << "E2/V0";
- case static_cast<int>( EnumClass2::EnumClass2Value1 ):
- return os << "E2/V1";
- default:
- return os << "Unknown enum value " << static_cast<int>( e2 );
- }
-}
-
-} // end anonymous namespace
-
-TEST_CASE( "toString(enum class)", "[toString][enum][enumClass]" ) {
- EnumClass1 e0 = EnumClass1::EnumClass1Value0;
- CHECK( ::Catch::Detail::stringify(e0) == "0" );
- EnumClass1 e1 = EnumClass1::EnumClass1Value1;
- CHECK( ::Catch::Detail::stringify(e1) == "1" );
-}
-
-
-TEST_CASE( "toString(enum class w/operator<<)", "[toString][enum][enumClass]" ) {
- EnumClass2 e0 = EnumClass2::EnumClass2Value0;
- CHECK( ::Catch::Detail::stringify(e0) == "E2/V0" );
- EnumClass2 e1 = EnumClass2::EnumClass2Value1;
- CHECK( ::Catch::Detail::stringify(e1) == "E2/V1" );
-
- auto e3 = static_cast<EnumClass2>(10);
- CHECK( ::Catch::Detail::stringify(e3) == "Unknown enum value 10" );
-}
-
-enum class EnumClass3 { Value1, Value2, Value3, Value4 };
-
-CATCH_REGISTER_ENUM( EnumClass3, EnumClass3::Value1, EnumClass3::Value2, EnumClass3::Value3 )
-
-
-TEST_CASE( "Enums can quickly have stringification enabled using REGISTER_ENUM" ) {
- using Catch::Detail::stringify;
- REQUIRE( stringify( EnumClass3::Value1 ) == "Value1" );
- REQUIRE( stringify( EnumClass3::Value2 ) == "Value2" );
- REQUIRE( stringify( EnumClass3::Value3 ) == "Value3" );
- REQUIRE( stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}" );
-
- EnumClass3 ec3 = EnumClass3 ::Value2;
- REQUIRE( stringify( ec3 ) == "Value2" );
-}
-
-namespace Bikeshed {
- enum class Colours { Red, Green, Blue };
-}
-
-// Important!: This macro must appear at top level scope - not inside a namespace
-// You can fully qualify the names, or use a using if you prefer
-CATCH_REGISTER_ENUM( Bikeshed::Colours,
- Bikeshed::Colours::Red,
- Bikeshed::Colours::Green,
- Bikeshed::Colours::Blue )
-
-TEST_CASE( "Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" ) {
- using Catch::Detail::stringify;
- REQUIRE( stringify( Bikeshed::Colours::Red ) == "Red" );
- REQUIRE( stringify( Bikeshed::Colours::Blue ) == "Blue" );
-}
diff --git a/projects/SelfTest/UsageTests/Exception.tests.cpp b/projects/SelfTest/UsageTests/Exception.tests.cpp
deleted file mode 100644
index b13b93b0..00000000
--- a/projects/SelfTest/UsageTests/Exception.tests.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-#include <string>
-#include <stdexcept>
-
-#ifdef _MSC_VER
-#pragma warning(disable:4702) // Unreachable code -- unconditional throws and so on
-#endif
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#pragma clang diagnostic ignored "-Wmissing-noreturn"
-#pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-// Cannot use try/catch keywords with -fno-exceptions.
-// Even if an exception was to be "thrown" it would just call std::terminate instead.
-
-namespace { namespace ExceptionTests {
-
-#ifndef EXCEPTION_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define EXCEPTION_TEST_HELPERS_INCLUDED
-
-int thisThrows() {
- throw std::domain_error( "expected exception" );
- return 1;
-}
-
-int thisDoesntThrow() {
- return 0;
-}
-
-class CustomException {
-public:
- explicit CustomException( const std::string& msg )
- : m_msg( msg )
- {}
-
- std::string getMessage() const {
- return m_msg;
- }
-
-private:
- std::string m_msg;
-};
-
-class CustomStdException : public std::exception {
-public:
- explicit CustomStdException( const std::string& msg )
- : m_msg( msg )
- {}
- ~CustomStdException() noexcept override {}
-
- std::string getMessage() const {
- return m_msg;
- }
-
-private:
- std::string m_msg;
-};
-
-[[noreturn]] void throwCustom() {
- throw CustomException( "custom exception - not std" );
-}
-
-#endif
-
-TEST_CASE( "When checked exceptions are thrown they can be expected or unexpected", "[!throws]" ) {
- REQUIRE_THROWS_AS( thisThrows(), std::domain_error );
- REQUIRE_NOTHROW( thisDoesntThrow() );
- REQUIRE_THROWS( thisThrows() );
-}
-
-TEST_CASE( "Expected exceptions that don't throw or unexpected exceptions fail the test", "[.][failing][!throws]" ) {
- CHECK_THROWS_AS( thisThrows(), std::string );
- CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error );
- CHECK_NOTHROW( thisThrows() );
-}
-
-TEST_CASE( "When unchecked exceptions are thrown directly they are always failures", "[.][failing][!throws]" ) {
- throw std::domain_error( "unexpected exception" );
-}
-
-TEST_CASE( "An unchecked exception reports the line of the last assertion", "[.][failing][!throws]" ) {
- CHECK( 1 == 1 );
- throw std::domain_error( "unexpected exception" );
-}
-
-TEST_CASE( "When unchecked exceptions are thrown from sections they are always failures", "[.][failing][!throws]" ) {
- SECTION( "section name" ) {
- throw std::domain_error("unexpected exception");
- }
-}
-
-TEST_CASE( "When unchecked exceptions are thrown from functions they are always failures", "[.][failing][!throws]" ) {
- CHECK( thisThrows() == 0 );
-}
-
-TEST_CASE( "When unchecked exceptions are thrown during a REQUIRE the test should abort fail", "[.][failing][!throws]" ) {
- REQUIRE( thisThrows() == 0 );
- FAIL( "This should never happen" );
-}
-
-TEST_CASE( "When unchecked exceptions are thrown during a CHECK the test should continue", "[.][failing][!throws]" ) {
- try {
- CHECK(thisThrows() == 0);
- }
- catch(...) {
- FAIL( "This should never happen" );
- }
-}
-
-TEST_CASE( "When unchecked exceptions are thrown, but caught, they do not affect the test", "[!throws]" ) {
- try {
- throw std::domain_error( "unexpected exception" );
- }
- catch(...) {}
-}
-
-
-CATCH_TRANSLATE_EXCEPTION( CustomException& ex ) {
- return ex.getMessage();
-}
-
-CATCH_TRANSLATE_EXCEPTION( CustomStdException& ex ) {
- return ex.getMessage();
-}
-
-CATCH_TRANSLATE_EXCEPTION( double& ex ) {
- return Catch::Detail::stringify( ex );
-}
-
-TEST_CASE("Non-std exceptions can be translated", "[.][failing][!throws]" ) {
- throw CustomException( "custom exception" );
-}
-
-TEST_CASE("Custom std-exceptions can be custom translated", "[.][failing][!throws]" ) {
- throw CustomException( "custom std exception" );
-}
-
-TEST_CASE( "Custom exceptions can be translated when testing for nothrow", "[.][failing][!throws]" ) {
- REQUIRE_NOTHROW( throwCustom() );
-}
-
-TEST_CASE( "Custom exceptions can be translated when testing for throwing as something else", "[.][failing][!throws]" ) {
- REQUIRE_THROWS_AS( throwCustom(), std::exception );
-}
-
-TEST_CASE( "Unexpected exceptions can be translated", "[.][failing][!throws]" ) {
- throw double( 3.14 );
-}
-
-TEST_CASE("Thrown string literals are translated", "[.][failing][!throws]") {
- throw "For some reason someone is throwing a string literal!";
-}
-
-TEST_CASE("thrown std::strings are translated", "[.][failing][!throws]") {
- throw std::string{ "Why would you throw a std::string?" };
-}
-
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
-
-TEST_CASE( "Exception messages can be tested for", "[!throws]" ) {
- using namespace Catch::Matchers;
- SECTION( "exact match" )
- REQUIRE_THROWS_WITH( thisThrows(), "expected exception" );
- SECTION( "different case" )
- REQUIRE_THROWS_WITH( thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) );
- SECTION( "wildcarded" ) {
- REQUIRE_THROWS_WITH( thisThrows(), StartsWith( "expected" ) );
- REQUIRE_THROWS_WITH( thisThrows(), EndsWith( "exception" ) );
- REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) );
- REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) );
- }
-}
-
-#endif
-
-TEST_CASE( "Mismatching exception messages failing the test", "[.][failing][!throws]" ) {
- REQUIRE_THROWS_WITH( thisThrows(), "expected exception" );
- REQUIRE_THROWS_WITH( thisThrows(), "should fail" );
- REQUIRE_THROWS_WITH( thisThrows(), "expected exception" );
-}
-
-TEST_CASE( "#748 - captures with unexpected exceptions", "[.][failing][!throws][!shouldfail]" ) {
- int answer = 42;
- CAPTURE( answer );
- // the message should be printed on the first two sections but not on the third
- SECTION( "outside assertions" ) {
- thisThrows();
- }
- SECTION( "inside REQUIRE_NOTHROW" ) {
- REQUIRE_NOTHROW( thisThrows() );
- }
- SECTION( "inside REQUIRE_THROWS" ) {
- REQUIRE_THROWS( thisThrows() );
- }
-}
-
-}} // namespace ExceptionTests
-
-#endif // CATCH_CONFIG_USE_EXCEPTIONS
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
diff --git a/projects/SelfTest/UsageTests/Generators.tests.cpp b/projects/SelfTest/UsageTests/Generators.tests.cpp
deleted file mode 100644
index 0e39bd5c..00000000
--- a/projects/SelfTest/UsageTests/Generators.tests.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-#include "catch.hpp"
-
-#include <cstring>
-
-
-// Generators and sections can be nested freely
-TEST_CASE("Generators -- simple", "[generators]") {
- auto i = GENERATE(1, 2, 3);
- SECTION("one") {
- auto j = GENERATE(values({ -3, -2, -1 }));
- REQUIRE(j < i);
- }
-
- SECTION("two") {
- // You can also explicitly set type for generators via Catch::Generators::as
- auto str = GENERATE(as<std::string>{}, "a", "bb", "ccc");
- REQUIRE(4u * i > str.size());
- }
-}
-
-// You can create a cartesian-product of generators by creating multiple ones
-TEST_CASE("3x3x3 ints", "[generators]") {
- auto x = GENERATE(1, 2, 3);
- auto y = GENERATE(4, 5, 6);
- auto z = GENERATE(7, 8, 9);
- // These assertions will be run 27 times (3x3x3)
- CHECK(x < y);
- CHECK(y < z);
- REQUIRE(x < z);
-}
-
-// You can also create data tuples
-TEST_CASE("tables", "[generators]") {
- // Note that this will not compile with libstdc++ older than libstdc++6
- // See https://stackoverflow.com/questions/12436586/tuple-vector-and-initializer-list
- // for possible workarounds
- // auto data = GENERATE(table<char const*, int>({
- // {"first", 5},
- // {"second", 6},
- // {"third", 5},
- // {"etc...", 6}
- // }));
-
- // Workaround for the libstdc++ bug mentioned above
- using tuple_type = std::tuple<char const*, int>;
- auto data = GENERATE(table<char const*, int>({
- tuple_type{"first", 5},
- tuple_type{"second", 6},
- tuple_type{"third", 5},
- tuple_type{"etc...", 6}
- }));
-
- REQUIRE(strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)));
-}
-
-
-#ifdef __cpp_structured_bindings
-
-// Structured bindings make the table utility much nicer to use
-TEST_CASE( "strlen2", "[approvals][generators]" ) {
- auto [test_input, expected] = GENERATE( table<std::string, size_t>({
- {"one", 3},
- {"two", 3},
- {"three", 5},
- {"four", 4}
- }));
-
- REQUIRE( test_input.size() == expected );
-}
-#endif
-
-
-// An alternate way of doing data tables without structured bindings
-struct Data { std::string str; size_t len; };
-
-TEST_CASE( "strlen3", "[generators]" ) {
- auto data = GENERATE( values<Data>({
- {"one", 3},
- {"two", 3},
- {"three", 5},
- {"four", 4}
- }));
-
- REQUIRE( data.str.size() == data.len );
-}
-
-
-
-#ifdef __cpp_structured_bindings
-
-// Based on example from https://docs.cucumber.io/gherkin/reference/#scenario-outline
-// (thanks to https://github.com/catchorg/Catch2/issues/850#issuecomment-399504851)
-
-// Note that GIVEN, WHEN, and THEN now forward onto DYNAMIC_SECTION instead of SECTION.
-// DYNAMIC_SECTION takes its name as a stringstream-style expression, so can be formatted using
-// variables in scope - such as the generated variables here. This reads quite nicely in the
-// test name output (the full scenario description).
-
-static auto eatCucumbers( int start, int eat ) -> int { return start-eat; }
-
-SCENARIO("Eating cucumbers", "[generators][approvals]") {
-
- auto [start, eat, left] = GENERATE( table<int,int,int> ({
- { 12, 5, 7 },
- { 20, 5, 15 }
- }));
-
- GIVEN( "there are " << start << " cucumbers" )
- WHEN( "I eat " << eat << " cucumbers" )
- THEN( "I should have " << left << " cucumbers" ) {
- REQUIRE( eatCucumbers( start, eat ) == left );
- }
-}
-#endif
-
-// There are also some generic generator manipulators
-TEST_CASE("Generators -- adapters", "[generators][generic]") {
- // TODO: This won't work yet, introduce GENERATE_VAR?
- //auto numbers = Catch::Generators::values({ 1, 2, 3, 4, 5, 6 });
- SECTION("Filtering by predicate") {
- SECTION("Basic usage") {
- // This filters out all odd (false) numbers, giving [2, 4, 6]
- auto i = GENERATE(filter([] (int val) { return val % 2 == 0; }, values({ 1, 2, 3, 4, 5, 6 })));
- REQUIRE(i % 2 == 0);
- }
- SECTION("Throws if there are no matching values") {
- using namespace Catch::Generators;
- REQUIRE_THROWS_AS(filter([] (int) {return false; }, value(1)), Catch::GeneratorException);
- }
- }
- SECTION("Shortening a range") {
- // This takes the first 3 elements from the values, giving back [1, 2, 3]
- auto i = GENERATE(take(3, values({ 1, 2, 3, 4, 5, 6 })));
- REQUIRE(i < 4);
- }
- SECTION("Transforming elements") {
- SECTION("Same type") {
- // This doubles values [1, 2, 3] into [2, 4, 6]
- auto i = GENERATE(map([] (int val) { return val * 2; }, values({ 1, 2, 3 })));
- REQUIRE(i % 2 == 0);
- }
- SECTION("Different type") {
- // This takes a generator that returns ints and maps them into strings
- auto i = GENERATE(map<std::string>([] (int val) { return std::to_string(val); }, values({ 1, 2, 3 })));
- REQUIRE(i.size() == 1);
- }
- SECTION("Different deduced type") {
- // This takes a generator that returns ints and maps them into strings
- auto i = GENERATE(map([] (int val) { return std::to_string(val); }, values({ 1, 2, 3 })));
- REQUIRE(i.size() == 1);
- }
- }
- SECTION("Repeating a generator") {
- // This will return values [1, 2, 3, 1, 2, 3]
- auto j = GENERATE(repeat(2, values({ 1, 2, 3 })));
- REQUIRE(j > 0);
- }
- SECTION("Chunking a generator into sized pieces") {
- SECTION("Number of elements in source is divisible by chunk size") {
- auto chunk2 = GENERATE(chunk(2, values({ 1, 1, 2, 2, 3, 3 })));
- REQUIRE(chunk2.size() == 2);
- REQUIRE(chunk2.front() == chunk2.back());
- }
- SECTION("Number of elements in source is not divisible by chunk size") {
- auto chunk2 = GENERATE(chunk(2, values({ 1, 1, 2, 2, 3 })));
- REQUIRE(chunk2.size() == 2);
- REQUIRE(chunk2.front() == chunk2.back());
- REQUIRE(chunk2.front() < 3);
- }
- SECTION("Chunk size of zero") {
- auto chunk2 = GENERATE(take(3, chunk(0, value(1))));
- REQUIRE(chunk2.size() == 0);
- }
- SECTION("Throws on too small generators") {
- using namespace Catch::Generators;
- REQUIRE_THROWS_AS(chunk(2, value(1)), Catch::GeneratorException);
- }
- }
-}
-
-// Note that because of the non-reproducibility of distributions,
-// anything involving the random generators cannot be part of approvals
-TEST_CASE("Random generator", "[generators][approvals]") {
- SECTION("Infer int from integral arguments") {
- auto val = GENERATE(take(4, random(0, 1)));
- STATIC_REQUIRE(std::is_same<decltype(val), int>::value);
- REQUIRE(0 <= val);
- REQUIRE(val <= 1);
- }
- SECTION("Infer double from double arguments") {
- auto val = GENERATE(take(4, random(0., 1.)));
- STATIC_REQUIRE(std::is_same<decltype(val), double>::value);
- REQUIRE(0. <= val);
- REQUIRE(val < 1);
- }
-}
-
-
-TEST_CASE("Nested generators and captured variables", "[generators]") {
- // Workaround for old libstdc++
- using record = std::tuple<int, int>;
- // Set up 3 ranges to generate numbers from
- auto extent = GENERATE(table<int, int>({
- record{3, 7},
- record{-5, -3},
- record{90, 100}
- }));
-
- auto from = std::get<0>(extent);
- auto to = std::get<1>(extent);
-
- auto values = GENERATE_COPY(range(from, to));
- REQUIRE(values > -6);
-}
-
-namespace {
- size_t call_count = 0;
- size_t test_count = 0;
- std::vector<int> make_data() {
- return { 1, 3, 5, 7, 9, 11 };
- }
- std::vector<int> make_data_counted() {
- ++call_count;
- return make_data();
- }
-}
-
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wexit-time-destructors"
-#endif
-
-TEST_CASE("Copy and then generate a range", "[generators]") {
- SECTION("from var and iterators") {
- static auto data = make_data();
-
- // It is important to notice that a generator is only initialized
- // **once** per run. What this means is that modifying data will not
- // modify the underlying generator.
- auto elem = GENERATE_REF(from_range(data.begin(), data.end()));
- REQUIRE(elem % 2 == 1);
- }
- SECTION("From a temporary container") {
- auto elem = GENERATE(from_range(make_data_counted()));
- ++test_count;
- REQUIRE(elem % 2 == 1);
- }
- SECTION("Final validation") {
- REQUIRE(call_count == 1);
- REQUIRE(make_data().size() == test_count);
- }
-}
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
diff --git a/projects/SelfTest/UsageTests/Matchers.tests.cpp b/projects/SelfTest/UsageTests/Matchers.tests.cpp
deleted file mode 100644
index 23db7b53..00000000
--- a/projects/SelfTest/UsageTests/Matchers.tests.cpp
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * Created by Phil on 21/02/2017.
- * Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-#include <sstream>
-#include <algorithm>
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace { namespace MatchersTests {
-
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
-
-#ifndef MATCHERS_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define MATCHERS_TEST_HELPERS_INCLUDED
-
- inline const char *testStringForMatching() {
- return "this string contains 'abc' as a substring";
- }
-
- inline const char *testStringForMatching2() {
- return "some completely different text that contains one common word";
- }
-
- inline bool alwaysTrue(int) { return true; }
- inline bool alwaysFalse(int) { return false; }
-
-
-#ifdef _MSC_VER
-#pragma warning(disable:4702) // Unreachable code -- MSVC 19 (VS 2015) sees right through the indirection
-#endif
-
-#include <exception>
-
- struct SpecialException : std::exception {
- SpecialException(int i_) : i(i_) {}
-
- char const* what() const noexcept override {
- return "SpecialException::what";
- }
-
- int i;
- };
-
- struct DerivedException : std::exception {
- char const* what() const noexcept override {
- return "DerivedException::what";
- }
- };
-
- void doesNotThrow() {}
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- [[noreturn]]
- void throwsSpecialException(int i) {
- throw SpecialException{i};
- }
-
- [[noreturn]]
- void throwsAsInt(int i) {
- throw i;
- }
-
- [[noreturn]]
- void throwsDerivedException() {
- throw DerivedException{};
- }
-#endif
-
- class ExceptionMatcher : public Catch::MatcherBase<SpecialException> {
- int m_expected;
- public:
- ExceptionMatcher(int i) : m_expected(i) {}
-
- bool match(SpecialException const &se) const override {
- return se.i == m_expected;
- }
-
- std::string describe() const override {
- std::ostringstream ss;
- ss << "special exception has value of " << m_expected;
- return ss.str();
- }
- };
-
-#endif
-
- using namespace Catch::Matchers;
-
-#ifdef __DJGPP__
- float nextafter(float from, float to)
- {
- return ::nextafterf(from, to);
- }
-
- double nextafter(double from, double to)
- {
- return ::nextafter(from, to);
- }
-#else
- using std::nextafter;
-#endif
-
- TEST_CASE("String matchers", "[matchers]") {
- REQUIRE_THAT(testStringForMatching(), Contains("string"));
- REQUIRE_THAT(testStringForMatching(), Contains("string", Catch::CaseSensitive::No));
- CHECK_THAT(testStringForMatching(), Contains("abc"));
- CHECK_THAT(testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No));
-
- CHECK_THAT(testStringForMatching(), StartsWith("this"));
- CHECK_THAT(testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No));
- CHECK_THAT(testStringForMatching(), EndsWith("substring"));
- CHECK_THAT(testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No));
- }
-
- TEST_CASE("Contains string matcher", "[.][failing][matchers]") {
- CHECK_THAT(testStringForMatching(), Contains("not there", Catch::CaseSensitive::No));
- CHECK_THAT(testStringForMatching(), Contains("STRING"));
- }
-
- TEST_CASE("StartsWith string matcher", "[.][failing][matchers]") {
- CHECK_THAT(testStringForMatching(), StartsWith("This String"));
- CHECK_THAT(testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No));
- }
-
- TEST_CASE("EndsWith string matcher", "[.][failing][matchers]") {
- CHECK_THAT(testStringForMatching(), EndsWith("Substring"));
- CHECK_THAT(testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No));
- }
-
- TEST_CASE("Equals string matcher", "[.][failing][matchers]") {
- CHECK_THAT(testStringForMatching(), Equals("this string contains 'ABC' as a substring"));
- CHECK_THAT(testStringForMatching(), Equals("something else", Catch::CaseSensitive::No));
- }
-
- TEST_CASE("Equals", "[matchers]") {
- CHECK_THAT(testStringForMatching(), Equals("this string contains 'abc' as a substring"));
- CHECK_THAT(testStringForMatching(),
- Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No));
- }
-
-// <regex> does not work in libstdc++ 4.8, so we have to enable these tests only when they
-// are expected to pass and cannot have them in baselines
- TEST_CASE("Regex string matcher -- libstdc++-4.8 workaround", "[matchers][approvals]") {
-
-// This is fiiiine
-// Taken from an answer at
-// https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions
-#if (!defined(__GNUC__)) || \
- (__cplusplus >= 201103L && \
- (!defined(__GLIBCXX__) || (__cplusplus >= 201402L) || \
- (defined(_GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT) || \
- defined(_GLIBCXX_REGEX_STATE_LIMIT) || \
- (defined(_GLIBCXX_RELEASE) && \
- _GLIBCXX_RELEASE > 4))))
-
-// DJGPP meets the above condition but <regex> does not work properly anyway
-#ifndef __DJGPP__
- REQUIRE_THAT(testStringForMatching(), Matches("this string contains 'abc' as a substring"));
- REQUIRE_THAT(testStringForMatching(),
- Matches("this string CONTAINS 'abc' as a substring", Catch::CaseSensitive::No));
- REQUIRE_THAT(testStringForMatching(), Matches("^this string contains 'abc' as a substring$"));
- REQUIRE_THAT(testStringForMatching(), Matches("^.* 'abc' .*$"));
- REQUIRE_THAT(testStringForMatching(), Matches("^.* 'ABC' .*$", Catch::CaseSensitive::No));
-#endif
-
-#endif
-
- REQUIRE_THAT(testStringForMatching2(), !Matches("this string contains 'abc' as a substring"));
- }
-
- TEST_CASE("Regex string matcher", "[matchers][.failing]") {
- CHECK_THAT(testStringForMatching(), Matches("this STRING contains 'abc' as a substring"));
- CHECK_THAT(testStringForMatching(), Matches("contains 'abc' as a substring"));
- CHECK_THAT(testStringForMatching(), Matches("this string contains 'abc' as a"));
- }
-
- TEST_CASE("Matchers can be (AllOf) composed with the && operator", "[matchers][operators][operator&&]") {
- CHECK_THAT(testStringForMatching(),
- Contains("string") &&
- Contains("abc") &&
- Contains("substring") &&
- Contains("contains"));
- }
-
- TEST_CASE("Matchers can be (AnyOf) composed with the || operator", "[matchers][operators][operator||]") {
- CHECK_THAT(testStringForMatching(), Contains("string") || Contains("different") || Contains("random"));
- CHECK_THAT(testStringForMatching2(), Contains("string") || Contains("different") || Contains("random"));
- }
-
- TEST_CASE("Matchers can be composed with both && and ||", "[matchers][operators][operator||][operator&&]") {
- CHECK_THAT(testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring"));
- }
-
- TEST_CASE("Matchers can be composed with both && and || - failing",
- "[matchers][operators][operator||][operator&&][.failing]") {
- CHECK_THAT(testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random"));
- }
-
- TEST_CASE("Matchers can be negated (Not) with the ! operator", "[matchers][operators][not]") {
- CHECK_THAT(testStringForMatching(), !Contains("different"));
- }
-
- TEST_CASE("Matchers can be negated (Not) with the ! operator - failing",
- "[matchers][operators][not][.failing]") {
- CHECK_THAT(testStringForMatching(), !Contains("substring"));
- }
-
- TEST_CASE("Vector matchers", "[matchers][vector]") {
- std::vector<int> v;
- v.push_back(1);
- v.push_back(2);
- v.push_back(3);
-
- std::vector<int> v2;
- v2.push_back(1);
- v2.push_back(2);
-
- std::vector<double> v3;
- v3.push_back(1);
- v3.push_back(2);
- v3.push_back(3);
-
- std::vector<double> v4;
- v4.push_back(1 + 1e-8);
- v4.push_back(2 + 1e-8);
- v4.push_back(3 + 1e-8);
-
- std::vector<int> empty;
-
- SECTION("Contains (element)") {
- CHECK_THAT(v, VectorContains(1));
- CHECK_THAT(v, VectorContains(2));
- }
- SECTION("Contains (vector)") {
- CHECK_THAT(v, Contains(v2));
- v2.push_back(3); // now exactly matches
- CHECK_THAT(v, Contains(v2));
-
- CHECK_THAT(v, Contains(empty));
- CHECK_THAT(empty, Contains(empty));
- }
- SECTION("Contains (element), composed") {
- CHECK_THAT(v, VectorContains(1) && VectorContains(2));
- }
-
- SECTION("Equals") {
-
- // Same vector
- CHECK_THAT(v, Equals(v));
-
- CHECK_THAT(empty, Equals(empty));
-
- // Different vector with same elements
- v2.push_back(3);
- CHECK_THAT(v, Equals(v2));
- }
- SECTION("UnorderedEquals") {
- CHECK_THAT(v, UnorderedEquals(v));
- CHECK_THAT(empty, UnorderedEquals(empty));
-
- auto permuted = v;
- std::next_permutation(begin(permuted), end(permuted));
- REQUIRE_THAT(permuted, UnorderedEquals(v));
-
- std::reverse(begin(permuted), end(permuted));
- REQUIRE_THAT(permuted, UnorderedEquals(v));
- }
- }
-
- TEST_CASE("Vector matchers that fail", "[matchers][vector][.][failing]") {
- std::vector<int> v;
- v.push_back(1);
- v.push_back(2);
- v.push_back(3);
-
- std::vector<int> v2;
- v2.push_back(1);
- v2.push_back(2);
-
- std::vector<double> v3;
- v3.push_back(1);
- v3.push_back(2);
- v3.push_back(3);
-
- std::vector<double> v4;
- v4.push_back(1.1);
- v4.push_back(2.1);
- v4.push_back(3.1);
-
- std::vector<int> empty;
-
- SECTION("Contains (element)") {
- CHECK_THAT(v, VectorContains(-1));
- CHECK_THAT(empty, VectorContains(1));
- }
- SECTION("Contains (vector)") {
- CHECK_THAT(empty, Contains(v));
- v2.push_back(4);
- CHECK_THAT(v, Contains(v2));
- }
-
- SECTION("Equals") {
-
- CHECK_THAT(v, Equals(v2));
- CHECK_THAT(v2, Equals(v));
- CHECK_THAT(empty, Equals(v));
- CHECK_THAT(v, Equals(empty));
- }
- SECTION("UnorderedEquals") {
- CHECK_THAT(v, UnorderedEquals(empty));
- CHECK_THAT(empty, UnorderedEquals(v));
-
- auto permuted = v;
- std::next_permutation(begin(permuted), end(permuted));
- permuted.pop_back();
- CHECK_THAT(permuted, UnorderedEquals(v));
-
- std::reverse(begin(permuted), end(permuted));
- CHECK_THAT(permuted, UnorderedEquals(v));
- }
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- TEST_CASE("Exception matchers that succeed", "[matchers][exceptions][!throws]") {
- CHECK_THROWS_MATCHES(throwsSpecialException(1), SpecialException, ExceptionMatcher{1});
- REQUIRE_THROWS_MATCHES(throwsSpecialException(2), SpecialException, ExceptionMatcher{2});
- }
-
- TEST_CASE("Exception matchers that fail", "[matchers][exceptions][!throws][.failing]") {
- SECTION("No exception") {
- CHECK_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1});
- REQUIRE_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1});
- }
- SECTION("Type mismatch") {
- CHECK_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1});
- REQUIRE_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1});
- }
- SECTION("Contents are wrong") {
- CHECK_THROWS_MATCHES(throwsSpecialException(3), SpecialException, ExceptionMatcher{1});
- REQUIRE_THROWS_MATCHES(throwsSpecialException(4), SpecialException, ExceptionMatcher{1});
- }
- }
-#endif
-
- TEST_CASE("Floating point matchers: float", "[matchers][floating-point]") {
- SECTION("Relative") {
- REQUIRE_THAT(10.f, WithinRel(11.1f, 0.1f));
- REQUIRE_THAT(10.f, !WithinRel(11.2f, 0.1f));
- REQUIRE_THAT( 1.f, !WithinRel(0.f, 0.99f));
- REQUIRE_THAT(-0.f, WithinRel(0.f));
- SECTION("Some subnormal values") {
- auto v1 = std::numeric_limits<float>::min();
- auto v2 = v1;
- for (int i = 0; i < 5; ++i) {
- v2 = std::nextafter(v1, 0.f);
- }
- REQUIRE_THAT(v1, WithinRel(v2));
- }
- }
- SECTION("Margin") {
- REQUIRE_THAT(1.f, WithinAbs(1.f, 0));
- REQUIRE_THAT(0.f, WithinAbs(1.f, 1));
-
- REQUIRE_THAT(0.f, !WithinAbs(1.f, 0.99f));
- REQUIRE_THAT(0.f, !WithinAbs(1.f, 0.99f));
-
- REQUIRE_THAT(0.f, WithinAbs(-0.f, 0));
-
- REQUIRE_THAT(11.f, !WithinAbs(10.f, 0.5f));
- REQUIRE_THAT(10.f, !WithinAbs(11.f, 0.5f));
- REQUIRE_THAT(-10.f, WithinAbs(-10.f, 0.5f));
- REQUIRE_THAT(-10.f, WithinAbs(-9.6f, 0.5f));
- }
- SECTION("ULPs") {
- REQUIRE_THAT(1.f, WithinULP(1.f, 0));
-
- REQUIRE_THAT(nextafter(1.f, 2.f), WithinULP(1.f, 1));
- REQUIRE_THAT(0.f, WithinULP(nextafter(0.f, 1.f), 1));
- REQUIRE_THAT(1.f, WithinULP(nextafter(1.f, 0.f), 1));
- REQUIRE_THAT(1.f, !WithinULP(nextafter(1.f, 2.f), 0));
-
- REQUIRE_THAT(1.f, WithinULP(1.f, 0));
- REQUIRE_THAT(-0.f, WithinULP(0.f, 0));
- }
- SECTION("Composed") {
- REQUIRE_THAT(1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1));
- REQUIRE_THAT(1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0));
- REQUIRE_THAT(0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f));
- }
- SECTION("Constructor validation") {
- REQUIRE_NOTHROW(WithinAbs(1.f, 0.f));
- REQUIRE_THROWS_AS(WithinAbs(1.f, -1.f), std::domain_error);
-
- REQUIRE_NOTHROW(WithinULP(1.f, 0));
- REQUIRE_THROWS_AS(WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error);
-
- REQUIRE_NOTHROW(WithinRel(1.f, 0.f));
- REQUIRE_THROWS_AS(WithinRel(1.f, -0.2f), std::domain_error);
- REQUIRE_THROWS_AS(WithinRel(1.f, 1.f), std::domain_error);
- }
- }
-
- TEST_CASE("Floating point matchers: double", "[matchers][floating-point]") {
- SECTION("Relative") {
- REQUIRE_THAT(10., WithinRel(11.1, 0.1));
- REQUIRE_THAT(10., !WithinRel(11.2, 0.1));
- REQUIRE_THAT(1., !WithinRel(0., 0.99));
- REQUIRE_THAT(-0., WithinRel(0.));
- SECTION("Some subnormal values") {
- auto v1 = std::numeric_limits<double>::min();
- auto v2 = v1;
- for (int i = 0; i < 5; ++i) {
- v2 = std::nextafter(v1, 0);
- }
- REQUIRE_THAT(v1, WithinRel(v2));
- }
- }
- SECTION("Margin") {
- REQUIRE_THAT(1., WithinAbs(1., 0));
- REQUIRE_THAT(0., WithinAbs(1., 1));
-
- REQUIRE_THAT(0., !WithinAbs(1., 0.99));
- REQUIRE_THAT(0., !WithinAbs(1., 0.99));
-
- REQUIRE_THAT(11., !WithinAbs(10., 0.5));
- REQUIRE_THAT(10., !WithinAbs(11., 0.5));
- REQUIRE_THAT(-10., WithinAbs(-10., 0.5));
- REQUIRE_THAT(-10., WithinAbs(-9.6, 0.5));
- }
- SECTION("ULPs") {
- REQUIRE_THAT(1., WithinULP(1., 0));
-
- REQUIRE_THAT(nextafter(1., 2.), WithinULP(1., 1));
- REQUIRE_THAT(0., WithinULP(nextafter(0., 1.), 1));
- REQUIRE_THAT(1., WithinULP(nextafter(1., 0.), 1));
- REQUIRE_THAT(1., !WithinULP(nextafter(1., 2.), 0));
-
- REQUIRE_THAT(1., WithinULP(1., 0));
- REQUIRE_THAT(-0., WithinULP(0., 0));
- }
- SECTION("Composed") {
- REQUIRE_THAT(1., WithinAbs(1., 0.5) || WithinULP(2., 1));
- REQUIRE_THAT(1., WithinAbs(2., 0.5) || WithinULP(1., 0));
- REQUIRE_THAT(0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1));
- }
- SECTION("Constructor validation") {
- REQUIRE_NOTHROW(WithinAbs(1., 0.));
- REQUIRE_THROWS_AS(WithinAbs(1., -1.), std::domain_error);
-
- REQUIRE_NOTHROW(WithinULP(1., 0));
-
- REQUIRE_NOTHROW(WithinRel(1., 0.));
- REQUIRE_THROWS_AS(WithinRel(1., -0.2), std::domain_error);
- REQUIRE_THROWS_AS(WithinRel(1., 1.), std::domain_error);
- }
- }
-
- TEST_CASE("Floating point matchers that are problematic in approvals", "[approvals][matchers][floating-point]") {
- REQUIRE_THAT(NAN, !WithinAbs(NAN, 0));
- REQUIRE_THAT(NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123)));
- REQUIRE_THAT(NAN, !WithinULP(NAN, 123));
- REQUIRE_THAT(INFINITY, WithinRel(INFINITY));
- REQUIRE_THAT(-INFINITY, !WithinRel(INFINITY));
- REQUIRE_THAT(1., !WithinRel(INFINITY));
- REQUIRE_THAT(INFINITY, !WithinRel(1.));
- REQUIRE_THAT(NAN, !WithinRel(NAN));
- REQUIRE_THAT(1., !WithinRel(NAN));
- REQUIRE_THAT(NAN, !WithinRel(1.));
- }
-
- TEST_CASE("Arbitrary predicate matcher", "[matchers][generic]") {
- SECTION("Function pointer") {
- REQUIRE_THAT(1, Predicate<int>(alwaysTrue, "always true"));
- REQUIRE_THAT(1, !Predicate<int>(alwaysFalse, "always false"));
- }
- SECTION("Lambdas + different type") {
- REQUIRE_THAT("Hello olleH",
- Predicate<std::string>(
- [] (std::string const& str) -> bool { return str.front() == str.back(); },
- "First and last character should be equal")
- );
-
- REQUIRE_THAT("This wouldn't pass",
- !Predicate<std::string>(
- [] (std::string const& str) -> bool { return str.front() == str.back(); }
- )
- );
- }
- }
-
- TEST_CASE("Regression test #1", "[matchers][vector]") {
- // At some point, UnorderedEqualsMatcher skipped
- // mismatched prefixed before doing the comparison itself
- std::vector<char> actual = { 'a', 'b' };
- std::vector<char> expected = { 'c', 'b' };
-
- CHECK_THAT(actual, !UnorderedEquals(expected));
- }
-
- TEST_CASE("Predicate matcher can accept const char*", "[matchers][compilation]") {
- REQUIRE_THAT("foo", Predicate<const char*>([] (const char* const&) { return true; }));
- }
-
- TEST_CASE("Vector Approx matcher", "[matchers][approx][vector]") {
- using Catch::Matchers::Approx;
- SECTION("Empty vector is roughly equal to an empty vector") {
- std::vector<double> empty;
- REQUIRE_THAT(empty, Approx(empty));
- }
- SECTION("Vectors with elements") {
- std::vector<double> v1({1., 2., 3.});
- SECTION("A vector is approx equal to itself") {
- REQUIRE_THAT(v1, Approx(v1));
- }
- std::vector<double> v2({1.5, 2.5, 3.5});
- SECTION("Different length") {
- auto temp(v1);
- temp.push_back(4);
- REQUIRE_THAT(v1, !Approx(temp));
- }
- SECTION("Same length, different elements") {
- REQUIRE_THAT(v1, !Approx(v2));
- REQUIRE_THAT(v1, Approx(v2).margin(0.5));
- REQUIRE_THAT(v1, Approx(v2).epsilon(0.5));
- REQUIRE_THAT(v1, Approx(v2).epsilon(0.1).scale(500));
- }
- }
- }
-
- TEST_CASE("Vector Approx matcher -- failing", "[matchers][approx][vector][.failing]") {
- using Catch::Matchers::Approx;
- SECTION("Empty and non empty vectors are not approx equal") {
- std::vector<double> empty, t1({1, 2});
- CHECK_THAT(empty, Approx(t1));
- }
- SECTION("Just different vectors") {
- std::vector<double> v1({2., 4., 6.}), v2({1., 3., 5.});
- CHECK_THAT(v1, Approx(v2));
- }
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- TEST_CASE("Exceptions matchers", "[matchers][exceptions][!throws]") {
- REQUIRE_THROWS_MATCHES(throwsDerivedException(), DerivedException, Message("DerivedException::what"));
- REQUIRE_THROWS_MATCHES(throwsDerivedException(), DerivedException, !Message("derivedexception::what"));
- REQUIRE_THROWS_MATCHES(throwsSpecialException(2), SpecialException, !Message("DerivedException::what"));
- REQUIRE_THROWS_MATCHES(throwsSpecialException(2), SpecialException, Message("SpecialException::what"));
- }
-#endif
-
- TEST_CASE("Composed matchers are distinct", "[matchers][composed]") {
- auto m1 = Contains("string");
- auto m2 = Contains("random");
- auto composed1 = m1 || m2;
- auto m3 = Contains("different");
- auto composed2 = composed1 || m3;
- REQUIRE_THAT(testStringForMatching2(), !composed1);
- REQUIRE_THAT(testStringForMatching2(), composed2);
- }
-
-} } // namespace MatchersTests
-
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
diff --git a/projects/SelfTest/UsageTests/Message.tests.cpp b/projects/SelfTest/UsageTests/Message.tests.cpp
deleted file mode 100644
index 93347084..00000000
--- a/projects/SelfTest/UsageTests/Message.tests.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-#include <iostream>
-
-TEST_CASE( "INFO and WARN do not abort tests", "[messages][.]" ) {
- INFO( "this is a " << "message" ); // This should output the message if a failure occurs
- WARN( "this is a " << "warning" ); // This should always output the message but then continue
-}
-
-TEST_CASE( "#1455 - INFO and WARN can start with a linebreak", "[messages][.]" ) {
- // Previously these would be hidden from the console reporter output,
- // because it would fail at properly reflowing the text
- INFO( "\nThis info message starts with a linebreak" );
- WARN( "\nThis warning message starts with a linebreak" );
-}
-
-TEST_CASE( "SUCCEED counts as a test pass", "[messages]" ) {
- SUCCEED( "this is a " << "success" );
-}
-
-TEST_CASE( "INFO gets logged on failure", "[failing][messages][.]" ) {
- INFO( "this message should be logged" );
- INFO( "so should this" );
- int a = 2;
- REQUIRE( a == 1 );
-}
-
-TEST_CASE( "INFO gets logged on failure, even if captured before successful assertions", "[failing][messages][.]" ) {
- INFO( "this message may be logged later" );
- int a = 2;
- CHECK( a == 2 );
-
- INFO( "this message should be logged" );
-
- CHECK( a == 1 );
-
- INFO( "and this, but later" );
-
- CHECK( a == 0 );
-
- INFO( "but not this" );
-
- CHECK( a == 2 );
-}
-
-TEST_CASE( "FAIL aborts the test", "[failing][messages][.]" ) {
- FAIL( "This is a " << "failure" ); // This should output the message and abort
- WARN( "We should never see this");
-}
-
-TEST_CASE( "FAIL_CHECK does not abort the test", "[failing][messages][.]" ) {
- FAIL_CHECK( "This is a " << "failure" ); // This should output the message then continue
- WARN( "This message appears in the output");
-}
-
-TEST_CASE( "FAIL does not require an argument", "[failing][messages][.]" ) {
- FAIL();
-}
-
-TEST_CASE( "SUCCEED does not require an argument", "[messages][.]" ) {
- SUCCEED();
-}
-
-TEST_CASE( "Output from all sections is reported", "[failing][messages][.]" ) {
- SECTION( "one" ) {
- FAIL( "Message from section one" );
- }
-
- SECTION( "two" ) {
- FAIL( "Message from section two" );
- }
-}
-
-TEST_CASE( "Standard output from all sections is reported", "[messages][.]" ) {
- SECTION( "one" ) {
- std::cout << "Message from section one" << std::endl;
- }
-
- SECTION( "two" ) {
- std::cout << "Message from section two" << std::endl;
- }
-}
-
-TEST_CASE( "Standard error is reported and redirected", "[messages][.][approvals]" ) {
- SECTION( "std::cerr" ) {
- std::cerr << "Write to std::cerr" << std::endl;
- }
- SECTION( "std::clog" ) {
- std::clog << "Write to std::clog" << std::endl;
- }
- SECTION( "Interleaved writes to cerr and clog" ) {
- std::cerr << "Inter";
- std::clog << "leaved";
- std::cerr << ' ';
- std::clog << "writes";
- std::cerr << " to error";
- std::clog << " streams" << std::endl;
- }
-}
-
-TEST_CASE( "INFO is reset for each loop", "[messages][failing][.]" ) {
- for( int i=0; i<100; i++ )
- {
- INFO( "current counter " << i );
- CAPTURE( i );
- REQUIRE( i < 10 );
- }
-}
-
-TEST_CASE( "The NO_FAIL macro reports a failure but does not fail the test", "[messages]" ) {
- CHECK_NOFAIL( 1 == 2 );
-}
-
-TEST_CASE( "just info", "[info][isolated info][messages]" ) {
- INFO( "this should never be seen" );
-}
-TEST_CASE( "just failure", "[fail][isolated info][.][messages]" ) {
- FAIL( "Previous info should not be seen" );
-}
-
-
-TEST_CASE( "sends information to INFO", "[.][failing]" ) {
- INFO( "hi" );
- int i = 7;
- CAPTURE( i );
- REQUIRE( false );
-}
-
-TEST_CASE( "Pointers can be converted to strings", "[messages][.][approvals]" ) {
- int p;
- WARN( "actual address of p: " << &p );
- WARN( "toString(p): " << ::Catch::Detail::stringify( &p ) );
-}
-
-template <typename T>
-static void unscoped_info( T msg ) {
- UNSCOPED_INFO( msg );
-}
-
-TEST_CASE( "just unscoped info", "[unscoped][info]" ) {
- unscoped_info( "this should NOT be seen" );
- unscoped_info( "this also should NOT be seen" );
-}
-
-TEST_CASE( "just failure after unscoped info", "[failing][.][unscoped][info]" ) {
- FAIL( "previous unscoped info SHOULD not be seen" );
-}
-
-TEST_CASE( "print unscoped info if passing unscoped info is printed", "[unscoped][info]" ) {
- unscoped_info( "this MAY be seen IF info is printed for passing assertions" );
- REQUIRE( true );
-}
-
-TEST_CASE( "prints unscoped info on failure", "[failing][.][unscoped][info]" ) {
- unscoped_info( "this SHOULD be seen" );
- unscoped_info( "this SHOULD also be seen" );
- REQUIRE( false );
- unscoped_info( "but this should NOT be seen" );
-}
-
-TEST_CASE( "not prints unscoped info from previous failures", "[failing][.][unscoped][info]" ) {
- unscoped_info( "this MAY be seen only for the FIRST assertion IF info is printed for passing assertions" );
- REQUIRE( true );
- unscoped_info( "this MAY be seen only for the SECOND assertion IF info is printed for passing assertions" );
- REQUIRE( true );
- unscoped_info( "this SHOULD be seen" );
- REQUIRE( false );
-}
-
-TEST_CASE( "prints unscoped info only for the first assertion", "[failing][.][unscoped][info]" ) {
- unscoped_info( "this SHOULD be seen only ONCE" );
- CHECK( false );
- CHECK( true );
- unscoped_info( "this MAY also be seen only ONCE IF info is printed for passing assertions" );
- CHECK( true );
- CHECK( true );
-}
-
-TEST_CASE( "stacks unscoped info in loops", "[failing][.][unscoped][info]" ) {
- UNSCOPED_INFO("Count 1 to 3...");
- for (int i = 1; i <= 3; i++) {
- unscoped_info(i);
- }
- CHECK( false );
-
- UNSCOPED_INFO("Count 4 to 6...");
- for (int i = 4; i <= 6; i++) {
- unscoped_info(i);
- }
- CHECK( false );
-}
-
-TEST_CASE( "mix info, unscoped info and warning", "[unscoped][info]" ) {
- INFO("info");
- unscoped_info("unscoped info");
- WARN("and warn may mix");
- WARN("they are not cleared after warnings");
-}
-
-TEST_CASE( "CAPTURE can deal with complex expressions", "[messages][capture]" ) {
- int a = 1;
- int b = 2;
- int c = 3;
- CAPTURE( a, b, c, a + b, a+b, c > b, a == 1 );
- SUCCEED();
-}
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-value" // In (1, 2), the "1" is unused ...
-#endif
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-value" // All the comma operators are side-effect free
-#endif
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4709) // comma in indexing operator
-#endif
-
-template <typename T1, typename T2>
-struct helper_1436 {
- helper_1436(T1 t1_, T2 t2_):
- t1{ t1_ },
- t2{ t2_ }
- {}
- T1 t1;
- T2 t2;
-};
-
-template <typename T1, typename T2>
-std::ostream& operator<<(std::ostream& out, helper_1436<T1, T2> const& helper) {
- out << "{ " << helper.t1 << ", " << helper.t2 << " }";
- return out;
-}
-
-TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") {
- CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2],
- std::vector<int>{1, 2, 3}[(0, 1)],
- std::vector<int>{1, 2, 3}[0]);
- CAPTURE((helper_1436<int, int>{12, -12}),
- (helper_1436<int, int>(-12, 12)));
- CAPTURE( (1, 2), (2, 3) );
- SUCCEED();
-}
-
-TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]") {
- CAPTURE(("comma, in string", "escaped, \", "), "single quote in string,',", "some escapes, \\,\\\\");
- CAPTURE("some, ), unmatched, } prenheses {[<");
- CAPTURE('"', '\'', ',', '}', ')', '(', '{');
- SUCCEED();
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
diff --git a/projects/SelfTest/UsageTests/Misc.tests.cpp b/projects/SelfTest/UsageTests/Misc.tests.cpp
deleted file mode 100644
index 808d1d0a..00000000
--- a/projects/SelfTest/UsageTests/Misc.tests.cpp
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * Created by Phil on 29/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-#ifdef __clang__
-# pragma clang diagnostic ignored "-Wc++98-compat"
-# pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
-#endif
-
-
-#include <iostream>
-#include <cerrno>
-#include <limits>
-#include <sstream>
-#include <array>
-
-namespace { namespace MiscTests {
-
-#ifndef MISC_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU
-#define MISC_TEST_HELPERS_INCLUDED
-
-inline const char* makeString( bool makeNull ) {
- return makeNull ? nullptr : "valid string";
-}
-inline bool testCheckedIf( bool flag ) {
- CHECKED_IF( flag )
- return true;
- else
- return false;
-}
-inline bool testCheckedElse( bool flag ) {
- CHECKED_ELSE( flag )
- return false;
-
- return true;
-}
-
-inline unsigned int Factorial( unsigned int number ) {
- return number > 1 ? Factorial(number-1)*number : 1;
-}
-
-static int f() {
- return 1;
-}
-
-inline void manuallyRegisteredTestFunction() {
- SUCCEED( "was called" );
-}
-
-struct AutoTestReg {
- AutoTestReg() {
- REGISTER_TEST_CASE( manuallyRegisteredTestFunction, "ManuallyRegistered" );
- }
-};
-
-CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
-CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
-static AutoTestReg autoTestReg;
-CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-template<typename T>
-struct Foo {
- size_t size() { return 0; }
-};
-
-template<typename T, size_t S>
-struct Bar {
- size_t size() { return S; }
-};
-#endif
-
-TEST_CASE( "random SECTION tests", "[.][sections][failing]" ) {
- int a = 1;
- int b = 2;
-
- SECTION( "doesn't equal" ) {
- REQUIRE( a != b );
- REQUIRE( b != a );
- }
-
- SECTION( "not equal" ) {
- REQUIRE( a != b);
- }
-}
-
-TEST_CASE( "nested SECTION tests", "[.][sections][failing]" ) {
- int a = 1;
- int b = 2;
-
- SECTION( "doesn't equal" ) {
- REQUIRE( a != b );
- REQUIRE( b != a );
-
- SECTION( "not equal" ) {
- REQUIRE( a != b);
- }
- }
-}
-
-TEST_CASE( "more nested SECTION tests", "[sections][failing][.]" ) {
- int a = 1;
- int b = 2;
-
- SECTION( "doesn't equal" ) {
- SECTION( "equal" ) {
- REQUIRE( a == b );
- }
-
- SECTION( "not equal" ) {
- REQUIRE( a != b );
- }
- SECTION( "less than" ) {
- REQUIRE( a < b );
- }
- }
-}
-
-TEST_CASE( "even more nested SECTION tests", "[sections]" ) {
- SECTION( "c" ) {
- SECTION( "d (leaf)" ) {
- SUCCEED(); // avoid failing due to no tests
- }
-
- SECTION( "e (leaf)" ) {
- SUCCEED(); // avoid failing due to no tests
- }
- }
-
- SECTION( "f (leaf)" ) {
- SUCCEED(); // avoid failing due to no tests
- }
-}
-
-TEST_CASE( "looped SECTION tests", "[.][failing][sections]" ) {
- int a = 1;
-
- for( int b = 0; b < 10; ++b ) {
- DYNAMIC_SECTION( "b is currently: " << b ) {
- CHECK( b > a );
- }
- }
-}
-
-TEST_CASE( "looped tests", "[.][failing]" ) {
- static const int fib[] = { 1, 1, 2, 3, 5, 8, 13, 21 };
-
- for( std::size_t i=0; i < sizeof(fib)/sizeof(int); ++i ) {
- INFO( "Testing if fib[" << i << "] (" << fib[i] << ") is even" );
- CHECK( ( fib[i] % 2 ) == 0 );
- }
-}
-
-TEST_CASE( "Sends stuff to stdout and stderr", "[.]" ) {
- std::cout << "A string sent directly to stdout" << std::endl;
- std::cerr << "A string sent directly to stderr" << std::endl;
- std::clog << "A string sent to stderr via clog" << std::endl;
-}
-
-TEST_CASE( "null strings" ) {
- REQUIRE( makeString( false ) != static_cast<char*>(nullptr));
- REQUIRE( makeString( true ) == static_cast<char*>(nullptr));
-}
-
-TEST_CASE( "checkedIf" ) {
- REQUIRE( testCheckedIf( true ) );
-}
-
-TEST_CASE( "checkedIf, failing", "[failing][.]" ) {
- REQUIRE( testCheckedIf( false ) );
-}
-
-TEST_CASE( "checkedElse" ) {
- REQUIRE( testCheckedElse( true ) );
-}
-
-TEST_CASE( "checkedElse, failing", "[failing][.]" ) {
- REQUIRE( testCheckedElse( false ) );
-}
-
-TEST_CASE( "xmlentitycheck" ) {
- SECTION( "embedded xml: <test>it should be possible to embed xml characters, such as <, \" or &, or even whole <xml>documents</xml> within an attribute</test>" ) {
- SUCCEED(); // We need this here to stop it failing due to no tests
- }
- SECTION( "encoded chars: these should all be encoded: &&&\"\"\"<<<&\"<<&\"" ) {
- SUCCEED(); // We need this here to stop it failing due to no tests
- }
-}
-
-TEST_CASE( "send a single char to INFO", "[failing][.]" ) {
- INFO(3);
- REQUIRE(false);
-}
-
-TEST_CASE( "atomic if", "[failing][0]") {
- std::size_t x = 0;
-
- if( x )
- REQUIRE(x > 0);
- else
- REQUIRE(x == 0);
-}
-
-
-TEST_CASE( "Factorials are computed", "[factorial]" ) {
- REQUIRE( Factorial(0) == 1 );
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-}
-
-TEST_CASE( "An empty test with no assertions", "[empty]" ) {}
-
-TEST_CASE( "Nice descriptive name", "[tag1][tag2][tag3][.]" ) {
- WARN( "This one ran" );
-}
-TEST_CASE( "first tag", "[tag1]" ) {}
-TEST_CASE( "second tag", "[tag2]" ) {}
-
-//
-//TEST_CASE( "spawn a new process", "[.]" )
-//{
-// // !TBD Work in progress
-// char line[200];
-// FILE* output = popen("./CatchSelfTest ./failing/matchers/StartsWith", "r");
-// while ( fgets(line, 199, output) )
-// std::cout << line;
-//}
-
-TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
-
- std::vector<int> v( 5 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "resizing bigger changes size and capacity" ) {
- v.resize( 10 );
-
- REQUIRE( v.size() == 10 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "resizing smaller changes size but not capacity" ) {
- v.resize( 0 );
-
- REQUIRE( v.size() == 0 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "We can use the 'swap trick' to reset the capacity" ) {
- std::vector<int> empty;
- empty.swap( v );
-
- REQUIRE( v.capacity() == 0 );
- }
- }
- SECTION( "reserving bigger changes capacity but not size" ) {
- v.reserve( 10 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "reserving smaller does not change size or capacity" ) {
- v.reserve( 0 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
- }
-}
-
-TEMPLATE_TEST_CASE( "TemplateTest: vectors can be sized and resized", "[vector][template]", int, float, std::string, (std::tuple<int,float>) ) {
-
- std::vector<TestType> v( 5 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "resizing bigger changes size and capacity" ) {
- v.resize( 10 );
-
- REQUIRE( v.size() == 10 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "resizing smaller changes size but not capacity" ) {
- v.resize( 0 );
-
- REQUIRE( v.size() == 0 );
- REQUIRE( v.capacity() >= 5 );
-
- SECTION( "We can use the 'swap trick' to reset the capacity" ) {
- std::vector<TestType> empty;
- empty.swap( v );
-
- REQUIRE( v.capacity() == 0 );
- }
- }
- SECTION( "reserving bigger changes capacity but not size" ) {
- v.reserve( 10 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 10 );
- }
- SECTION( "reserving smaller does not change size or capacity" ) {
- v.reserve( 0 );
-
- REQUIRE( v.size() == 5 );
- REQUIRE( v.capacity() >= 5 );
- }
-}
-
-TEMPLATE_TEST_CASE_SIG("TemplateTestSig: vectors can be sized and resized", "[vector][template][nttp]", ((typename TestType, int V), TestType, V), (int,5), (float,4), (std::string,15), ((std::tuple<int, float>), 6)) {
-
- std::vector<TestType> v(V);
-
- REQUIRE(v.size() == V);
- REQUIRE(v.capacity() >= V);
-
- SECTION("resizing bigger changes size and capacity") {
- v.resize(2 * V);
-
- REQUIRE(v.size() == 2 * V);
- REQUIRE(v.capacity() >= 2 * V);
- }
- SECTION("resizing smaller changes size but not capacity") {
- v.resize(0);
-
- REQUIRE(v.size() == 0);
- REQUIRE(v.capacity() >= V);
-
- SECTION("We can use the 'swap trick' to reset the capacity") {
- std::vector<TestType> empty;
- empty.swap(v);
-
- REQUIRE(v.capacity() == 0);
- }
- }
- SECTION("reserving bigger changes capacity but not size") {
- v.reserve(2 * V);
-
- REQUIRE(v.size() == V);
- REQUIRE(v.capacity() >= 2 * V);
- }
- SECTION("reserving smaller does not change size or capacity") {
- v.reserve(0);
-
- REQUIRE(v.size() == V);
- REQUIRE(v.capacity() >= V);
- }
-}
-
-TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]", (std::vector, Foo), (int, float)) {
- TestType x;
- REQUIRE(x.size() == 0);
-}
-
-TEMPLATE_PRODUCT_TEST_CASE_SIG("A Template product test case with array signature", "[template][product][nttp]", ((typename T, size_t S), T, S), (std::array, Bar), ((int, 9), (float, 42))) {
- TestType x;
- REQUIRE(x.size() > 0);
-}
-
-TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
- REQUIRE(std::tuple_size<TestType>::value >= 1);
-}
-
-using MyTypes = std::tuple<int, char, float>;
-TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes)
-{
- REQUIRE(sizeof(TestType) > 0);
-}
-
-struct NonDefaultConstructibleType {
- NonDefaultConstructibleType() = delete;
-};
-
-using MyNonDefaultConstructibleTypes = std::tuple<NonDefaultConstructibleType, float>;
-TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-default-constructible std::tuple", "[template][list]", MyNonDefaultConstructibleTypes)
-{
- REQUIRE(sizeof(TestType) > 0);
-}
-
-struct NonCopyableAndNonMovableType {
- NonCopyableAndNonMovableType() = default;
-
- NonCopyableAndNonMovableType(NonCopyableAndNonMovableType const &) = delete;
- NonCopyableAndNonMovableType(NonCopyableAndNonMovableType &&) = delete;
- auto operator=(NonCopyableAndNonMovableType const &) -> NonCopyableAndNonMovableType & = delete;
- auto operator=(NonCopyableAndNonMovableType &&) -> NonCopyableAndNonMovableType & = delete;
-};
-
-using NonCopyableAndNonMovableTypes = std::tuple<NonCopyableAndNonMovableType, float>;
-TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-copyable and non-movable std::tuple", "[template][list]", NonCopyableAndNonMovableTypes)
-{
- REQUIRE(sizeof(TestType) > 0);
-}
-
-// https://github.com/philsquared/Catch/issues/166
-TEST_CASE("A couple of nested sections followed by a failure", "[failing][.]") {
- SECTION("Outer")
- SECTION("Inner")
- SUCCEED("that's not flying - that's failing in style");
-
- FAIL("to infinity and beyond");
-}
-
-TEST_CASE("not allowed", "[!throws]") {
- // This test case should not be included if you run with -e on the command line
- SUCCEED();
-}
-
-//TEST_CASE( "Is big endian" ) {
-// CHECK( Catch::Detail::Endianness::which() == Catch::Detail::Endianness::Little );
-//}
-
-TEST_CASE( "Tabs and newlines show in output", "[.][whitespace][failing]" ) {
-
- // Based on issue #242
- std::string s1 = "if ($b == 10) {\n\t\t$a\t= 20;\n}";
- std::string s2 = "if ($b == 10) {\n\t$a = 20;\n}\n";
- CHECK( s1 == s2 );
-}
-
-
-#ifdef CATCH_CONFIG_WCHAR
-TEST_CASE( "toString on const wchar_t const pointer returns the string contents", "[toString]" ) {
- const wchar_t * const s = L"wide load";
- std::string result = ::Catch::Detail::stringify( s );
- CHECK( result == "\"wide load\"" );
-}
-
-TEST_CASE( "toString on const wchar_t pointer returns the string contents", "[toString]" ) {
- const wchar_t * s = L"wide load";
- std::string result = ::Catch::Detail::stringify( s );
- CHECK( result == "\"wide load\"" );
-}
-
-TEST_CASE( "toString on wchar_t const pointer returns the string contents", "[toString]" ) {
- auto const s = const_cast<wchar_t*>( L"wide load" );
- std::string result = ::Catch::Detail::stringify( s );
- CHECK( result == "\"wide load\"" );
-}
-
-TEST_CASE( "toString on wchar_t returns the string contents", "[toString]" ) {
- auto s = const_cast<wchar_t*>( L"wide load" );
- std::string result = ::Catch::Detail::stringify( s );
- CHECK( result == "\"wide load\"" );
-}
-#endif
-
-TEST_CASE( "long long" ) {
- long long l = std::numeric_limits<long long>::max();
-
- REQUIRE( l == std::numeric_limits<long long>::max() );
-}
-
-TEST_CASE( "This test 'should' fail but doesn't", "[.][failing][!shouldfail]" ) {
- SUCCEED( "oops!" );
-}
-
-TEST_CASE( "# A test name that starts with a #" ) {
- SUCCEED( "yay" );
-}
-
-TEST_CASE( "#835 -- errno should not be touched by Catch", "[.][failing][!shouldfail]" ) {
- errno = 1;
- CHECK(f() == 0);
- REQUIRE(errno == 1); // Check that f() doesn't touch errno.
-}
-
-TEST_CASE( "#961 -- Dynamically created sections should all be reported", "[.]" ) {
- for (char i = '0'; i < '5'; ++i) {
- SECTION(std::string("Looped section ") + i) {
- SUCCEED( "Everything is OK" );
- }
- }
-}
-
-TEST_CASE( "#1175 - Hidden Test", "[.]" ) {
- // Just for checking that hidden test is not listed by default
- SUCCEED();
-}
-
-}} // namespace MiscTests
diff --git a/projects/SelfTest/UsageTests/ToStringByte.tests.cpp b/projects/SelfTest/UsageTests/ToStringByte.tests.cpp
deleted file mode 100644
index 0aad679f..00000000
--- a/projects/SelfTest/UsageTests/ToStringByte.tests.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "catch.hpp"
-
-#if defined(CATCH_CONFIG_CPP17_BYTE)
-
-TEST_CASE( "std::byte -> toString", "[toString][byte][approvals]" ) {
- using type = std::byte;
- REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) );
-}
-
-TEST_CASE( "std::vector<std::byte> -> toString", "[toString][byte][approvals]" ) {
- using type = std::vector<std::byte>;
- REQUIRE( "{ 0, 1, 2 }" == ::Catch::Detail::stringify( type{ std::byte{0}, std::byte{1}, std::byte{2} } ) );
-}
-
-#endif // CATCH_INTERNAL_CONFIG_CPP17_BYTE
diff --git a/projects/SelfTest/UsageTests/ToStringChrono.tests.cpp b/projects/SelfTest/UsageTests/ToStringChrono.tests.cpp
deleted file mode 100644
index c2c0829f..00000000
--- a/projects/SelfTest/UsageTests/ToStringChrono.tests.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-#include "catch.hpp"
-
-#include <chrono>
-#include <cstdint>
-
-TEST_CASE("Stringifying std::chrono::duration helpers", "[toString][chrono]") {
- // No literals because we still support c++11
- auto hour = std::chrono::hours(1);
- auto minute = std::chrono::minutes(1);
- auto seconds = std::chrono::seconds(60);
- auto micro = std::chrono::microseconds(1);
- auto milli = std::chrono::milliseconds(1);
- auto nano = std::chrono::nanoseconds(1);
- REQUIRE(minute == seconds);
- REQUIRE(hour != seconds);
- REQUIRE(micro != milli);
- REQUIRE(nano != micro);
-}
-
-TEST_CASE("Stringifying std::chrono::duration with weird ratios", "[toString][chrono]") {
- std::chrono::duration<int64_t, std::ratio<30>> half_minute(1);
- std::chrono::duration<int64_t, std::ratio<1, 1000000000000>> pico_second(1);
- std::chrono::duration<int64_t, std::ratio<1, 1000000000000000>> femto_second(1);
- std::chrono::duration<int64_t, std::ratio<1, 1000000000000000000>> atto_second(1);
- REQUIRE(half_minute != femto_second);
- REQUIRE(pico_second != atto_second);
-}
-
-TEST_CASE("Stringifying std::chrono::time_point<system_clock>", "[toString][chrono]") {
- auto now = std::chrono::system_clock::now();
- auto later = now + std::chrono::minutes(2);
- REQUIRE(now != later);
-}
-
-TEST_CASE("Stringifying std::chrono::time_point<Clock>", "[toString][chrono][!nonportable]") {
- auto now = std::chrono::high_resolution_clock::now();
- auto later = now + std::chrono::minutes(2);
- REQUIRE(now != later);
-
- auto now2 = std::chrono::steady_clock::now();
- auto later2 = now2 + std::chrono::minutes(2);
- REQUIRE(now2 != later2);
-}
diff --git a/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp
deleted file mode 100644
index 69d6320d..00000000
--- a/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Created by Martin on 17/02/2017.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-#include "catch.hpp"
-
-#include <map>
-#include <set>
-
-TEST_CASE( "Character pretty printing" ){
- SECTION("Specifically escaped"){
- char tab = '\t';
- char newline = '\n';
- char carr_return = '\r';
- char form_feed = '\f';
- CHECK(tab == '\t');
- CHECK(newline == '\n');
- CHECK(carr_return == '\r');
- CHECK(form_feed == '\f');
- }
- SECTION("General chars"){
- char space = ' ';
- CHECK(space == ' ');
- char chars[] = {'a', 'z', 'A', 'Z'};
- for (int i = 0; i < 4; ++i){
- char c = chars[i];
- REQUIRE(c == chars[i]);
- }
- }
- SECTION("Low ASCII"){
- char null_terminator = '\0';
- CHECK(null_terminator == '\0');
- for (int i = 2; i < 6; ++i){
- char c = static_cast<char>(i);
- REQUIRE(c == i);
- }
- }
-}
-
-
-TEST_CASE( "Capture and info messages" ) {
- SECTION("Capture should stringify like assertions") {
- int i = 2;
- CAPTURE(i);
- REQUIRE(true);
- }
- SECTION("Info should NOT stringify the way assertions do") {
- int i = 3;
- INFO(i);
- REQUIRE(true);
- }
-}
-
-TEST_CASE( "std::map is convertible string", "[toString]" ) {
-
- SECTION( "empty" ) {
- std::map<std::string, int> emptyMap;
-
- REQUIRE( Catch::Detail::stringify( emptyMap ) == "{ }" );
- }
-
- SECTION( "single item" ) {
- std::map<std::string, int> map = { { "one", 1 } };
-
- REQUIRE( Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" );
- }
-
- SECTION( "several items" ) {
- std::map<std::string, int> map = {
- { "abc", 1 },
- { "def", 2 },
- { "ghi", 3 }
- };
-
- REQUIRE( Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" );
- }
-}
-
-TEST_CASE( "std::set is convertible string", "[toString]" ) {
-
- SECTION( "empty" ) {
- std::set<std::string> emptySet;
-
- REQUIRE( Catch::Detail::stringify( emptySet ) == "{ }" );
- }
-
- SECTION( "single item" ) {
- std::set<std::string> set = { "one" };
-
- REQUIRE( Catch::Detail::stringify( set ) == "{ \"one\" }" );
- }
-
- SECTION( "several items" ) {
- std::set<std::string> set = { "abc", "def", "ghi" };
-
- REQUIRE( Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" );
- }
-}
-
-TEST_CASE("Static arrays are convertible to string", "[toString]") {
- SECTION("Single item") {
- int singular[1] = { 1 };
- REQUIRE(Catch::Detail::stringify(singular) == "{ 1 }");
- }
- SECTION("Multiple") {
- int arr[3] = { 3, 2, 1 };
- REQUIRE(Catch::Detail::stringify(arr) == "{ 3, 2, 1 }");
- }
- SECTION("Non-trivial inner items") {
- std::vector<std::string> arr[2] = { {"1:1", "1:2", "1:3"}, {"2:1", "2:2"} };
- REQUIRE(Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })");
- }
-}
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-
-TEST_CASE("String views are stringified like other strings", "[toString][approvals]") {
- std::string_view view{"abc"};
- CHECK(Catch::Detail::stringify(view) == R"("abc")");
-
- std::string_view arr[] { view };
- CHECK(Catch::Detail::stringify(arr) == R"({ "abc" })");
-}
-
-#endif
-
-TEST_CASE("Precision of floating point stringification can be set", "[toString][floatingPoint]") {
- SECTION("Floats") {
- using sm = Catch::StringMaker<float>;
- const auto oldPrecision = sm::precision;
-
- const float testFloat = 1.12345678901234567899f;
- auto str1 = sm::convert(testFloat);
- sm::precision = 5;
- // "1." prefix = 2 chars, f suffix is another char
- CHECK(str1.size() == 3 + 5);
-
- sm::precision = 10;
- auto str2 = sm::convert(testFloat);
- REQUIRE(str2.size() == 3 + 10);
- sm::precision = oldPrecision;
- }
- SECTION("Double") {
- using sm = Catch::StringMaker<double>;
- const auto oldPrecision = sm::precision;
-
- const double testDouble = 1.123456789012345678901234567899;
- sm::precision = 5;
- auto str1 = sm::convert(testDouble);
- // "1." prefix = 2 chars
- CHECK(str1.size() == 2 + 5);
-
- sm::precision = 15;
- auto str2 = sm::convert(testDouble);
- REQUIRE(str2.size() == 2 + 15);
-
- sm::precision = oldPrecision;
- }
-}
-
-namespace {
-
-struct WhatException : std::exception {
- char const* what() const noexcept override {
- return "This exception has overridden what() method";
- }
- ~WhatException() override;
-};
-
-struct OperatorException : std::exception {
- ~OperatorException() override;
-};
-
-std::ostream& operator<<(std::ostream& out, OperatorException const&) {
- out << "OperatorException";
- return out;
-}
-
-struct StringMakerException : std::exception {
- ~StringMakerException() override;
-};
-
-} // end anonymous namespace
-
-namespace Catch {
-template <>
-struct StringMaker<StringMakerException> {
- static std::string convert(StringMakerException const&) {
- return "StringMakerException";
- }
-};
-}
-
-// Avoid -Wweak-tables
-WhatException::~WhatException() = default;
-OperatorException::~OperatorException() = default;
-StringMakerException::~StringMakerException() = default;
-
-
-
-
-TEST_CASE("Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified", "[toString][exception]") {
- REQUIRE(::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method");
- REQUIRE(::Catch::Detail::stringify(OperatorException{}) == "OperatorException");
- REQUIRE(::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException");
-}
diff --git a/projects/SelfTest/UsageTests/ToStringOptional.tests.cpp b/projects/SelfTest/UsageTests/ToStringOptional.tests.cpp
deleted file mode 100644
index d78579d9..00000000
--- a/projects/SelfTest/UsageTests/ToStringOptional.tests.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-#include "catch.hpp"
-
-#if defined(CATCH_CONFIG_CPP17_OPTIONAL)
-
-TEST_CASE( "std::optional<int> -> toString", "[toString][optional][approvals]" ) {
- using type = std::optional<int>;
- REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );
- REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) );
-}
-
-TEST_CASE( "std::optional<std::string> -> toString", "[toString][optional][approvals]" ) {
- using type = std::optional<std::string>;
- REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );
- REQUIRE( "\"abc\"" == ::Catch::Detail::stringify( type{ "abc" } ) );
-}
-
-TEST_CASE( "std::vector<std::optional<int> > -> toString", "[toString][optional][approvals]" ) {
- using type = std::vector<std::optional<int> >;
- REQUIRE( "{ 0, { }, 2 }" == ::Catch::Detail::stringify( type{ 0, {}, 2 } ) );
-}
-
-#endif // CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
diff --git a/projects/SelfTest/UsageTests/ToStringPair.tests.cpp b/projects/SelfTest/UsageTests/ToStringPair.tests.cpp
deleted file mode 100644
index 1445c54f..00000000
--- a/projects/SelfTest/UsageTests/ToStringPair.tests.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-#include "catch.hpp"
-
-TEST_CASE( "std::pair<int,std::string> -> toString", "[toString][pair]" ) {
- std::pair<int,std::string> value( 34, "xyzzy" );
- REQUIRE( ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" );
-}
-
-TEST_CASE( "std::pair<int,const std::string> -> toString", "[toString][pair]" ) {
- std::pair<int,const std::string> value( 34, "xyzzy" );
- REQUIRE( ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" );
-}
-
-TEST_CASE( "std::vector<std::pair<std::string,int> > -> toString", "[toString][pair]" ) {
- std::vector<std::pair<std::string,int> > pr;
- pr.push_back( std::make_pair("green", 55 ) );
- REQUIRE( ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" );
-}
-
-// This is pretty contrived - I figure if this works, anything will...
-TEST_CASE( "pair<pair<int,const char *,pair<std::string,int> > -> toString", "[toString][pair]" ) {
- typedef std::pair<int,const char *> left_t;
- typedef std::pair<std::string,int> right_t;
-
- left_t left( 42, "Arthur" );
- right_t right( "Ford", 24 );
-
- std::pair<left_t,right_t> pair( left, right );
- REQUIRE( ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" );
-}
diff --git a/projects/SelfTest/UsageTests/ToStringTuple.tests.cpp b/projects/SelfTest/UsageTests/ToStringTuple.tests.cpp
deleted file mode 100644
index fe19ce01..00000000
--- a/projects/SelfTest/UsageTests/ToStringTuple.tests.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-#include "catch.hpp"
-
-#include <tuple>
-
-TEST_CASE( "tuple<>", "[toString][tuple]" )
-{
- typedef std::tuple<> type;
- CHECK( "{ }" == ::Catch::Detail::stringify(type{}) );
- type value {};
- CHECK( "{ }" == ::Catch::Detail::stringify(value) );
-}
-
-TEST_CASE( "tuple<int>", "[toString][tuple]" )
-{
- typedef std::tuple<int> type;
- CHECK( "{ 0 }" == ::Catch::Detail::stringify(type{0}) );
-}
-
-
-TEST_CASE( "tuple<float,int>", "[toString][tuple]" )
-{
- typedef std::tuple<float,int> type;
- CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) );
- CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) );
-}
-
-TEST_CASE( "tuple<string,string>", "[toString][tuple]" )
-{
- typedef std::tuple<std::string,std::string> type;
- CHECK( "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) );
-}
-
-TEST_CASE( "tuple<tuple<int>,tuple<>,float>", "[toString][tuple]" )
-{
- typedef std::tuple<std::tuple<int>,std::tuple<>,float> type;
- type value { std::tuple<int>{42}, {}, 1.2f };
- CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) );
-}
-
-TEST_CASE( "tuple<nullptr,int,const char *>", "[toString][tuple]" )
-{
- typedef std::tuple<std::nullptr_t,int,const char *> type;
- type value { nullptr, 42, "Catch me" };
- CHECK( "{ nullptr, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) );
-}
-
diff --git a/projects/SelfTest/UsageTests/ToStringVariant.tests.cpp b/projects/SelfTest/UsageTests/ToStringVariant.tests.cpp
deleted file mode 100644
index b97bb4bd..00000000
--- a/projects/SelfTest/UsageTests/ToStringVariant.tests.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-#define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-#include "catch.hpp"
-
-#if defined(CATCH_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-
-#include <string>
-#include <variant>
-
-// We need 2 types with non-trivial copies/moves
-struct MyType1 {
- MyType1() = default;
- [[noreturn]] MyType1(MyType1 const&) { throw 1; }
- MyType1& operator=(MyType1 const&) { throw 3; }
-};
-struct MyType2 {
- MyType2() = default;
- [[noreturn]] MyType2(MyType2 const&) { throw 2; }
- MyType2& operator=(MyType2 const&) { throw 4; }
-};
-
-TEST_CASE( "variant<std::monostate>", "[toString][variant][approvals]")
-{
- using type = std::variant<std::monostate>;
- CHECK( "{ }" == ::Catch::Detail::stringify(type{}) );
- type value {};
- CHECK( "{ }" == ::Catch::Detail::stringify(value) );
- CHECK( "{ }" == ::Catch::Detail::stringify(std::get<0>(value)) );
-}
-
-TEST_CASE( "variant<int>", "[toString][variant][approvals]")
-{
- using type = std::variant<int>;
- CHECK( "0" == ::Catch::Detail::stringify(type{0}) );
-}
-
-TEST_CASE( "variant<float, int>", "[toString][variant][approvals]")
-{
- using type = std::variant<float, int>;
- CHECK( "0.5f" == ::Catch::Detail::stringify(type{0.5f}) );
- CHECK( "0" == ::Catch::Detail::stringify(type{0}) );
-}
-
-TEST_CASE( "variant -- valueless-by-exception", "[toString][variant][approvals]" ) {
- using type = std::variant<MyType1, MyType2>;
-
- type value;
- REQUIRE_THROWS_AS(value.emplace<MyType2>(MyType2{}), int);
- REQUIRE(value.valueless_by_exception());
- CHECK("{valueless variant}" == ::Catch::Detail::stringify(value));
-}
-
-
-TEST_CASE( "variant<string, int>", "[toString][variant][approvals]")
-{
- using type = std::variant<std::string, int>;
- CHECK( "\"foo\"" == ::Catch::Detail::stringify(type{"foo"}) );
- CHECK( "0" == ::Catch::Detail::stringify(type{0}) );
-}
-
-TEST_CASE( "variant<variant<float, int>, string>", "[toString][variant][approvals]")
-{
- using inner = std::variant<MyType1, float, int>;
- using type = std::variant<inner, std::string>;
- CHECK( "0.5f" == ::Catch::Detail::stringify(type{0.5f}) );
- CHECK( "0" == ::Catch::Detail::stringify(type{0}) );
- CHECK( "\"foo\"" == ::Catch::Detail::stringify(type{"foo"}) );
-
- SECTION("valueless nested variant") {
- type value = inner{0.5f};
- REQUIRE( std::holds_alternative<inner>(value) );
- REQUIRE( std::holds_alternative<float>(std::get<inner>(value)) );
-
- REQUIRE_THROWS_AS( std::get<0>(value).emplace<MyType1>(MyType1{}), int );
-
- // outer variant is still valid and contains inner
- REQUIRE( std::holds_alternative<inner>(value) );
- // inner variant is valueless
- REQUIRE( std::get<inner>(value).valueless_by_exception() );
- CHECK( "{valueless variant}" == ::Catch::Detail::stringify(value) );
- }
-}
-
-TEST_CASE( "variant<nullptr,int,const char *>", "[toString][variant][approvals]" )
-{
- using type = std::variant<std::nullptr_t,int,const char *>;
- CHECK( "nullptr" == ::Catch::Detail::stringify(type{nullptr}) );
- CHECK( "42" == ::Catch::Detail::stringify(type{42}) );
- CHECK( "\"Catch me\"" == ::Catch::Detail::stringify(type{"Catch me"}) );
-}
-
-#endif // CATCH_INTERNAL_CONFIG_CPP17_VARIANT
diff --git a/projects/SelfTest/UsageTests/ToStringVector.tests.cpp b/projects/SelfTest/UsageTests/ToStringVector.tests.cpp
deleted file mode 100644
index ea4d5c86..00000000
--- a/projects/SelfTest/UsageTests/ToStringVector.tests.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-#include "catch.hpp"
-#include <vector>
-#include <array>
-
-// vector
-TEST_CASE( "vector<int> -> toString", "[toString][vector]" )
-{
- std::vector<int> vv;
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" );
- vv.push_back( 42 );
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42 }" );
- vv.push_back( 250 );
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" );
-}
-
-TEST_CASE( "vector<string> -> toString", "[toString][vector]" )
-{
- std::vector<std::string> vv;
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" );
- vv.emplace_back( "hello" );
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ \"hello\" }" );
- vv.emplace_back( "world" );
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" );
-}
-
-namespace {
- /* Minimal Allocator */
- template<typename T>
- struct minimal_allocator {
- using value_type = T;
- using size_type = std::size_t;
-
- minimal_allocator() = default;
- template <typename U>
- minimal_allocator(const minimal_allocator<U>&) {}
-
-
- T *allocate( size_type n ) {
- return static_cast<T *>( ::operator new( n * sizeof(T) ) );
- }
- void deallocate( T *p, size_type /*n*/ ) {
- ::operator delete( static_cast<void *>(p) );
- }
- template<typename U>
- bool operator==( const minimal_allocator<U>& ) const { return true; }
- template<typename U>
- bool operator!=( const minimal_allocator<U>& ) const { return false; }
- };
-}
-
-TEST_CASE( "vector<int,allocator> -> toString", "[toString][vector,allocator]" ) {
- std::vector<int,minimal_allocator<int> > vv;
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" );
- vv.push_back( 42 );
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42 }" );
- vv.push_back( 250 );
- REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" );
-}
-
-TEST_CASE( "vec<vec<string,alloc>> -> toString", "[toString][vector,allocator]" ) {
- using inner = std::vector<std::string, minimal_allocator<std::string>>;
- using vector = std::vector<inner>;
- vector v;
- REQUIRE( ::Catch::Detail::stringify(v) == "{ }" );
- v.push_back( inner { "hello" } );
- v.push_back( inner { "world" } );
- REQUIRE( ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" );
-}
-
-// Based on PR by mat-so: https://github.com/catchorg/Catch2/pull/606/files#diff-43562f40f8c6dcfe2c54557316e0f852
-TEST_CASE( "vector<bool> -> toString", "[toString][containers][vector]" ) {
- std::vector<bool> bools;
- REQUIRE( ::Catch::Detail::stringify(bools) == "{ }");
- bools.push_back(true);
- REQUIRE( ::Catch::Detail::stringify(bools) == "{ true }");
- bools.push_back(false);
- REQUIRE( ::Catch::Detail::stringify(bools) == "{ true, false }");
-}
-TEST_CASE( "array<int, N> -> toString", "[toString][containers][array]" ) {
- std::array<int, 0> empty;
- REQUIRE( Catch::Detail::stringify( empty ) == "{ }" );
- std::array<int, 1> oneValue = {{ 42 }};
- REQUIRE( Catch::Detail::stringify( oneValue ) == "{ 42 }" );
- std::array<int, 2> twoValues = {{ 42, 250 }};
- REQUIRE( Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" );
-}
diff --git a/projects/SelfTest/UsageTests/ToStringWhich.tests.cpp b/projects/SelfTest/UsageTests/ToStringWhich.tests.cpp
deleted file mode 100644
index cd4a1518..00000000
--- a/projects/SelfTest/UsageTests/ToStringWhich.tests.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Demonstrate which version of toString/StringMaker is being used
- * for various types
- */
-
-// Replace fallback stringifier for this TU
-// We should avoid ODR violations because these specific types aren't
-// present in different TUs
-#include <string>
-template <typename T>
-std::string fallbackStringifier(T const&) {
- return "{ !!! }";
-}
-
-#define CATCH_CONFIG_FALLBACK_STRINGIFIER fallbackStringifier
-#include "catch.hpp"
-
-
-
-#if defined(__GNUC__)
-// This has to be left enabled until end of the TU, because the GCC
-// frontend reports operator<<(std::ostream& os, const has_maker_and_operator&)
-// as unused anyway
-# pragma GCC diagnostic ignored "-Wunused-function"
-#endif
-
-namespace {
-
-struct has_operator { };
-struct has_maker {};
-struct has_maker_and_operator {};
-struct has_neither {};
-struct has_template_operator {};
-
-std::ostream& operator<<(std::ostream& os, const has_operator&) {
- os << "operator<<( has_operator )";
- return os;
-}
-
-std::ostream& operator<<(std::ostream& os, const has_maker_and_operator&) {
- os << "operator<<( has_maker_and_operator )";
- return os;
-}
-
-template <typename StreamT>
-StreamT& operator<<(StreamT& os, const has_template_operator&) {
- os << "operator<<( has_template_operator )";
- return os;
-}
-
-} // end anonymous namespace
-
-namespace Catch {
- template<>
- struct StringMaker<has_maker> {
- static std::string convert( const has_maker& ) {
- return "StringMaker<has_maker>";
- }
- };
- template<>
- struct StringMaker<has_maker_and_operator> {
- static std::string convert( const has_maker_and_operator& ) {
- return "StringMaker<has_maker_and_operator>";
- }
- };
-}
-
-// Call the operator
-TEST_CASE( "stringify( has_operator )", "[toString]" ) {
- has_operator item;
- REQUIRE( ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" );
-}
-
-// Call the stringmaker
-TEST_CASE( "stringify( has_maker )", "[toString]" ) {
- has_maker item;
- REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" );
-}
-
-// Call the stringmaker
-TEST_CASE( "stringify( has_maker_and_operator )", "[toString]" ) {
- has_maker_and_operator item;
- REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" );
-}
-
-TEST_CASE("stringify( has_neither )", "[toString]") {
- has_neither item;
- REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" );
-}
-
-// Call the templated operator
-TEST_CASE( "stringify( has_template_operator )", "[toString]" ) {
- has_template_operator item;
- REQUIRE( ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" );
-}
-
-
-// Vectors...
-
-TEST_CASE( "stringify( vectors<has_operator> )", "[toString]" ) {
- std::vector<has_operator> v(1);
- REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" );
-}
-
-TEST_CASE( "stringify( vectors<has_maker> )", "[toString]" ) {
- std::vector<has_maker> v(1);
- REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" );
-}
-
-TEST_CASE( "stringify( vectors<has_maker_and_operator> )", "[toString]" ) {
- std::vector<has_maker_and_operator> v(1);
- REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" );
-}
-
-namespace {
-
-// Range-based conversion should only be used if other possibilities fail
-struct int_iterator {
- using iterator_category = std::input_iterator_tag;
- using difference_type = std::ptrdiff_t;
- using value_type = int;
- using reference = int&;
- using pointer = int*;
-
- int_iterator() = default;
- int_iterator(int i) :val(i) {}
-
- value_type operator*() const { return val; }
- bool operator==(int_iterator rhs) const { return val == rhs.val; }
- bool operator!=(int_iterator rhs) const { return val != rhs.val; }
- int_iterator operator++() { ++val; return *this; }
- int_iterator operator++(int) {
- auto temp(*this);
- ++val;
- return temp;
- }
-private:
- int val = 5;
-};
-
-struct streamable_range {
- int_iterator begin() const { return int_iterator{ 1 }; }
- int_iterator end() const { return {}; }
-};
-
-std::ostream& operator<<(std::ostream& os, const streamable_range&) {
- os << "op<<(streamable_range)";
- return os;
-}
-
-struct stringmaker_range {
- int_iterator begin() const { return int_iterator{ 1 }; }
- int_iterator end() const { return {}; }
-};
-
-} // end anonymous namespace
-
-namespace Catch {
-template <>
-struct StringMaker<stringmaker_range> {
- static std::string convert(stringmaker_range const&) {
- return "stringmaker(streamable_range)";
- }
-};
-}
-
-namespace {
-
-struct just_range {
- int_iterator begin() const { return int_iterator{ 1 }; }
- int_iterator end() const { return {}; }
-};
-
-struct disabled_range {
- int_iterator begin() const { return int_iterator{ 1 }; }
- int_iterator end() const { return {}; }
-};
-
-} // end anonymous namespace
-
-namespace Catch {
-template <>
-struct is_range<disabled_range> {
- static const bool value = false;
-};
-}
-
-TEST_CASE("stringify ranges", "[toString]") {
- REQUIRE(::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)");
- REQUIRE(::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)");
- REQUIRE(::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }");
- REQUIRE(::Catch::Detail::stringify(disabled_range{}) == "{ !!! }");
-}
diff --git a/projects/SelfTest/UsageTests/Tricky.tests.cpp b/projects/SelfTest/UsageTests/Tricky.tests.cpp
deleted file mode 100644
index 8467e541..00000000
--- a/projects/SelfTest/UsageTests/Tricky.tests.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Created by Phil on 09/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-#ifdef _MSC_VER
-#pragma warning (disable : 4702) // Disable unreachable code warning for the last test
- // that is triggered when compiling as Win32|Release
-#endif
-
-#include "catch.hpp"
-
-#include <cstdio>
-#include <sstream>
-#include <iostream>
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE
-(
- "Where there is more to the expression after the RHS",
- "[Tricky][failing][.]"
-)
-{
-// int a = 1, b = 2;
-// REQUIRE( a == 2 || b == 2 );
- WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
-}
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE
-(
- "Where the LHS is not a simple value",
- "[Tricky][failing][.]"
-)
-{
- /*
- int a = 1;
- int b = 2;
-
- // This only captures part of the expression, but issues a warning about the rest
- REQUIRE( a+1 == b-1 );
- */
- WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
-}
-
-struct Opaque
-{
- int val;
- bool operator ==( const Opaque& o ) const
- {
- return val == o.val;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE
-(
- "A failing expression with a non streamable type is still captured",
- "[Tricky][failing][.]"
-)
-{
-
- Opaque o1, o2;
- o1.val = 7;
- o2.val = 8;
-
- CHECK( &o1 == &o2 );
- CHECK( o1 == o2 );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE
-(
- "string literals of different sizes can be compared",
- "[Tricky][failing][.]"
-)
-{
- REQUIRE( std::string( "first" ) == "second" );
-
-}
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE
-(
- "An expression with side-effects should only be evaluated once",
- "[Tricky]"
-)
-{
- int i = 7;
-
- REQUIRE( i++ == 7 );
- REQUIRE( i++ == 8 );
-
-}
-
-namespace A {
- struct X
- {
- X() : a(4), b(2), c(7) {}
- X(int v) : a(v), b(2), c(7) {}
- int a;
- int b;
- int c;
- };
-}
-
-namespace B {
- struct Y
- {
- Y() : a(4), b(2), c(7) {}
- Y(int v) : a(v), b(2), c(7) {}
- int a;
- int b;
- int c;
- };
-}
-
-inline bool operator==(const A::X& lhs, const B::Y& rhs)
-{
- return (lhs.a == rhs.a);
-}
-
-inline bool operator==(const B::Y& lhs, const A::X& rhs)
-{
- return (lhs.a == rhs.a);
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-/* This, currently, does not compile with LLVM
-TEST_CASE
-(
- "Operators at different namespace levels not hijacked by Koenig lookup"
- "[Tricky]"
-)
-{
- A::X x;
- B::Y y;
- REQUIRE( x == y );
-}
-*/
-
-namespace ObjectWithConversions
-{
- struct Object
- {
- operator unsigned int() const {return 0xc0000000;}
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- TEST_CASE
- (
- "Implicit conversions are supported inside assertion macros",
- "[Tricky][approvals]"
- )
- {
- Object o;
- REQUIRE(0xc0000000 == o );
- }
-}
-
-namespace EnumBitFieldTests
-{
- enum Bits : uint32_t {
- bit0 = 0x0001,
- bit1 = 0x0002,
- bit2 = 0x0004,
- bit3 = 0x0008,
- bit1and2 = bit1 | bit2,
- bit30 = 0x40000000,
- bit31 = 0x80000000,
- bit30and31 = bit30 | bit31
- };
-
- TEST_CASE( "Test enum bit values", "[Tricky]" )
- {
- REQUIRE( 0xc0000000 == bit30and31 );
- }
-}
-
-struct Obj
-{
- Obj():prop(&p){}
-
- int p;
- int* prop;
-};
-
-TEST_CASE("boolean member", "[Tricky]")
-{
- Obj obj;
- REQUIRE( obj.prop != nullptr );
-}
-
-// Tests for a problem submitted by Ralph McArdell
-//
-// The static bool value should not need to be defined outside the
-// struct it is declared in - but when evaluating it in a deduced
-// context it appears to require the extra definition.
-// The issue was fixed by adding bool overloads to bypass the
-// templates that were there to deduce it.
-template <bool B>
-struct is_true
-{
- static const bool value = B;
-};
-
-TEST_CASE( "(unimplemented) static bools can be evaluated", "[Tricky]" )
-{
- SECTION("compare to true")
- {
- REQUIRE( is_true<true>::value == true );
- REQUIRE( true == is_true<true>::value );
- }
- SECTION("compare to false")
- {
- REQUIRE( is_true<false>::value == false );
- REQUIRE( false == is_true<false>::value );
- }
-
- SECTION("negation")
- {
- REQUIRE( !is_true<false>::value );
- }
-
- SECTION("double negation")
- {
- REQUIRE( !!is_true<true>::value );
- }
-
- SECTION("direct")
- {
- REQUIRE( is_true<true>::value );
- REQUIRE_FALSE( is_true<false>::value );
- }
-}
-
-// Uncomment these tests to produce an error at test registration time
-/*
-TEST_CASE( "Tests with the same name are not allowed", "[Tricky]" )
-{
-
-}
-TEST_CASE( "Tests with the same name are not allowed", "[Tricky]" )
-{
-
-}
-*/
-
-struct Boolable
-{
- explicit Boolable( bool value ) : m_value( value ) {}
-
- explicit operator bool() const {
- return m_value;
- }
-
- bool m_value;
-};
-
-TEST_CASE( "Objects that evaluated in boolean contexts can be checked", "[Tricky][SafeBool]" )
-{
- Boolable True( true );
- Boolable False( false );
-
- CHECK( True );
- CHECK( !False );
- CHECK_FALSE( False );
-}
-
-TEST_CASE( "Assertions then sections", "[Tricky]" )
-{
- // This was causing a failure due to the way the console reporter was handling
- // the current section
-
- REQUIRE( true );
-
- SECTION( "A section" )
- {
- REQUIRE( true );
-
- SECTION( "Another section" )
- {
- REQUIRE( true );
- }
- SECTION( "Another other section" )
- {
- REQUIRE( true );
- }
- }
-}
-
-struct Awkward
-{
- operator int() const { return 7; }
-};
-
-TEST_CASE( "non streamable - with conv. op", "[Tricky]" )
-{
- Awkward awkward;
- std::string s = ::Catch::Detail::stringify( awkward );
- REQUIRE( s == "7" );
-}
-
-inline void foo() {}
-
-typedef void (*fooptr_t)();
-
-TEST_CASE( "Comparing function pointers", "[Tricky][function pointer]" )
-{
- // This was giving a warning in VS2010
- // #179
- fooptr_t a = foo;
-
- REQUIRE( a );
- REQUIRE( a == &foo );
-}
-
-struct S
-{
- void f() {}
-};
-
-
-TEST_CASE( "Comparing member function pointers", "[Tricky][member function pointer][approvals]" )
-{
- typedef void (S::*MF)();
- MF m = &S::f;
-
- CHECK( m == &S::f );
-}
-
-class ClassName {};
-
-TEST_CASE( "pointer to class", "[Tricky]" )
-{
- ClassName *p = 0;
- REQUIRE( p == 0 );
-}
-
-#include <memory>
-
-TEST_CASE( "null_ptr", "[Tricky]" )
-{
- std::unique_ptr<int> ptr;
- REQUIRE(ptr.get() == nullptr);
-}
-
-TEST_CASE( "X/level/0/a", "[Tricky]" ) { SUCCEED(""); }
-TEST_CASE( "X/level/0/b", "[Tricky][fizz]" ){ SUCCEED(""); }
-TEST_CASE( "X/level/1/a", "[Tricky]" ) { SUCCEED(""); }
-TEST_CASE( "X/level/1/b", "[Tricky]" ) { SUCCEED(""); }
-
-TEST_CASE( "has printf" ) {
-
- // This can cause problems as, currently, stdout itself is not redirected - only the cout (and cerr) buffer
- printf( "loose text artifact\n" );
-}
-
-namespace {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- struct constructor_throws {
- [[noreturn]] constructor_throws() {
- throw 1;
- }
- };
-#endif
-}
-
-TEST_CASE("Commas in various macros are allowed") {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- REQUIRE_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} );
- CHECK_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} );
-#endif
- REQUIRE_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} );
- CHECK_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} );
-
- REQUIRE(std::vector<int>{1, 2} == std::vector<int>{1, 2});
- CHECK( std::vector<int>{1, 2} == std::vector<int>{1, 2} );
- REQUIRE_FALSE(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3});
- CHECK_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} );
-
- CHECK_NOFAIL( std::vector<int>{1, 2} == std::vector<int>{1, 2} );
- CHECKED_IF( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) {
- REQUIRE(true);
- } CHECKED_ELSE( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) {
- CHECK(true);
- }
-}
-
-TEST_CASE( "non-copyable objects", "[.][failing]" ) {
-#if CHECK_CONFIG_USE_RTTI
- // Thanks to Agustin Bergé (@k-ballo on the cpplang Slack) for raising this
- std::type_info const& ti = typeid(int);
- CHECK( ti == typeid(int) );
-#endif
-}
-
-TEST_CASE("#1514: stderr/stdout is not captured in tests aborted by an exception", "[output-capture][regression][.]") {
- std::cout << "This would not be caught previously\n" << std::flush;
- std::clog << "Nor would this\n" << std::flush;
- // FAIL aborts the test by throwing a Catch exception
- FAIL("1514");
-}
diff --git a/projects/SelfTest/UsageTests/VariadicMacros.tests.cpp b/projects/SelfTest/UsageTests/VariadicMacros.tests.cpp
deleted file mode 100644
index fd651c5e..00000000
--- a/projects/SelfTest/UsageTests/VariadicMacros.tests.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Created by Phil on 15/03/2013.
- * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#include "catch.hpp"
-
-
-TEST_CASE()
-{
- SUCCEED( "anonymous test case" );
-}
-
-TEST_CASE( "Test case with one argument" )
-{
- SUCCEED( "no assertions" );
-}
-
-TEST_CASE( "Variadic macros", "[variadic][sections]" )
-{
- SECTION( "Section with one argument" )
- {
- SUCCEED( "no assertions" );
- }
-}
-
diff --git a/projects/SelfTest/WarnAboutNoTests.cmake b/projects/SelfTest/WarnAboutNoTests.cmake
deleted file mode 100644
index 4637e3f3..00000000
--- a/projects/SelfTest/WarnAboutNoTests.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-# Workaround for a peculiarity where CTest disregards the return code from a
-# test command if a PASS_REGULAR_EXPRESSION is also set
-execute_process(
- COMMAND ${CMAKE_ARGV3} -w NoTests "___nonexistent_test___"
- RESULT_VARIABLE ret
- OUTPUT_VARIABLE out
-)
-
-message("${out}")
-
-if(NOT ${ret} MATCHES "^[0-9]+$")
- message(FATAL_ERROR "${ret}")
-endif()
-
-if(${ret} EQUAL 0)
- message(FATAL_ERROR "Expected nonzero return code")
-elseif(${out} MATCHES "Helper failed with")
- message(FATAL_ERROR "Helper failed")
-endif()
diff --git a/projects/XCode/OCTest/OCTest.xcodeproj/project.pbxproj b/projects/XCode/OCTest/OCTest.xcodeproj/project.pbxproj
deleted file mode 100644
index 71532036..00000000
--- a/projects/XCode/OCTest/OCTest.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,294 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 4A5C29AA1F715603007CB94C /* catch_objc_impl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A5C29A91F715603007CB94C /* catch_objc_impl.mm */; };
- 4A63D2AC14E3C1A900F615CB /* OCTest.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4A63D2AB14E3C1A900F615CB /* OCTest.1 */; };
- 4A63D2B314E3C1E600F615CB /* Main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A63D2B214E3C1E600F615CB /* Main.mm */; };
- 4A63D2C014E4544700F615CB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A63D2BF14E4544700F615CB /* Foundation.framework */; };
- 4A63D2C614E454CC00F615CB /* CatchOCTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A63D2C214E454CC00F615CB /* CatchOCTestCase.mm */; };
- 4A63D2C714E454CC00F615CB /* OCTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A63D2C314E454CC00F615CB /* OCTest.mm */; };
- 4A63D2C814E454CC00F615CB /* TestObj.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A63D2C514E454CC00F615CB /* TestObj.m */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 4A63D2A314E3C1A900F615CB /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- 4A63D2AC14E3C1A900F615CB /* OCTest.1 in CopyFiles */,
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 4A5C29A91F715603007CB94C /* catch_objc_impl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = catch_objc_impl.mm; sourceTree = "<group>"; };
- 4A63D2A514E3C1A900F615CB /* OCTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = OCTest; sourceTree = BUILT_PRODUCTS_DIR; };
- 4A63D2AB14E3C1A900F615CB /* OCTest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = OCTest.1; sourceTree = "<group>"; };
- 4A63D2B214E3C1E600F615CB /* Main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Main.mm; sourceTree = "<group>"; };
- 4A63D2BF14E4544700F615CB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 4A63D2C114E454CC00F615CB /* CatchOCTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CatchOCTestCase.h; sourceTree = "<group>"; };
- 4A63D2C214E454CC00F615CB /* CatchOCTestCase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CatchOCTestCase.mm; sourceTree = "<group>"; };
- 4A63D2C314E454CC00F615CB /* OCTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OCTest.mm; sourceTree = "<group>"; };
- 4A63D2C414E454CC00F615CB /* TestObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObj.h; sourceTree = "<group>"; };
- 4A63D2C514E454CC00F615CB /* TestObj.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestObj.m; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 4A63D2A214E3C1A900F615CB /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 4A63D2C014E4544700F615CB /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 4A63D29A14E3C1A900F615CB = {
- isa = PBXGroup;
- children = (
- 4AA0D94F154C0A63004B4193 /* Catch */,
- 4A63D2BF14E4544700F615CB /* Foundation.framework */,
- 4A63D2A814E3C1A900F615CB /* OCTest */,
- 4A63D2A614E3C1A900F615CB /* Products */,
- );
- sourceTree = "<group>";
- };
- 4A63D2A614E3C1A900F615CB /* Products */ = {
- isa = PBXGroup;
- children = (
- 4A63D2A514E3C1A900F615CB /* OCTest */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 4A63D2A814E3C1A900F615CB /* OCTest */ = {
- isa = PBXGroup;
- children = (
- 4A63D2C114E454CC00F615CB /* CatchOCTestCase.h */,
- 4A63D2C214E454CC00F615CB /* CatchOCTestCase.mm */,
- 4A63D2C314E454CC00F615CB /* OCTest.mm */,
- 4A63D2C414E454CC00F615CB /* TestObj.h */,
- 4A63D2C514E454CC00F615CB /* TestObj.m */,
- 4A63D2B214E3C1E600F615CB /* Main.mm */,
- 4A63D2AB14E3C1A900F615CB /* OCTest.1 */,
- );
- path = OCTest;
- sourceTree = "<group>";
- };
- 4AA0D94F154C0A63004B4193 /* Catch */ = {
- isa = PBXGroup;
- children = (
- 4A5C29A91F715603007CB94C /* catch_objc_impl.mm */,
- );
- name = Catch;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 4A63D2A414E3C1A900F615CB /* OCTest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 4A63D2AF14E3C1A900F615CB /* Build configuration list for PBXNativeTarget "OCTest" */;
- buildPhases = (
- 4A63D2A114E3C1A900F615CB /* Sources */,
- 4A63D2A214E3C1A900F615CB /* Frameworks */,
- 4A63D2A314E3C1A900F615CB /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = OCTest;
- productName = OCTest;
- productReference = 4A63D2A514E3C1A900F615CB /* OCTest */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 4A63D29C14E3C1A900F615CB /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0940;
- };
- buildConfigurationList = 4A63D29F14E3C1A900F615CB /* Build configuration list for PBXProject "OCTest" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 4A63D29A14E3C1A900F615CB;
- productRefGroup = 4A63D2A614E3C1A900F615CB /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 4A63D2A414E3C1A900F615CB /* OCTest */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 4A63D2A114E3C1A900F615CB /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 4A63D2B314E3C1E600F615CB /* Main.mm in Sources */,
- 4A5C29AA1F715603007CB94C /* catch_objc_impl.mm in Sources */,
- 4A63D2C614E454CC00F615CB /* CatchOCTestCase.mm in Sources */,
- 4A63D2C714E454CC00F615CB /* OCTest.mm in Sources */,
- 4A63D2C814E454CC00F615CB /* TestObj.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 4A63D2AD14E3C1A900F615CB /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = ../../../include;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx;
- };
- name = Debug;
- };
- 4A63D2AE14E3C1A900F615CB /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = ../../../include;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- SDKROOT = macosx;
- };
- name = Release;
- };
- 4A63D2B014E3C1A900F615CB /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_OBJC_ARC = YES;
- HEADER_SEARCH_PATHS = ../../../include;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Debug;
- };
- 4A63D2B114E3C1A900F615CB /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_OBJC_ARC = YES;
- HEADER_SEARCH_PATHS = ../../../include;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 4A63D29F14E3C1A900F615CB /* Build configuration list for PBXProject "OCTest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4A63D2AD14E3C1A900F615CB /* Debug */,
- 4A63D2AE14E3C1A900F615CB /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4A63D2AF14E3C1A900F615CB /* Build configuration list for PBXNativeTarget "OCTest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4A63D2B014E3C1A900F615CB /* Debug */,
- 4A63D2B114E3C1A900F615CB /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 4A63D29C14E3C1A900F615CB /* Project object */;
-}
diff --git a/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 119e61c5..00000000
--- a/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
- version = "1.0">
- <FileRef
- location = "self:OCTest.xcodeproj">
- </FileRef>
-</Workspace>
diff --git a/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d98100..00000000
--- a/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IDEDidComputeMac32BitWarning</key>
- <true/>
-</dict>
-</plist>
diff --git a/projects/XCode/OCTest/OCTest/CatchOCTestCase.h b/projects/XCode/OCTest/OCTest/CatchOCTestCase.h
deleted file mode 100644
index bd26239a..00000000
--- a/projects/XCode/OCTest/OCTest/CatchOCTestCase.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// CatchOCTestCase.h
-// OCTest
-//
-// Created by Phil on 13/11/2010.
-// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#ifndef TWOBLUECUBES_CATCHOCTESTCASE_H_INCLUDED
-#define TWOBLUECUBES_CATCHOCTESTCASE_H_INCLUDED
-
-#include "catch.hpp"
-
-#import <Cocoa/Cocoa.h>
-#import "TestObj.h"
-
-@interface TestFixture : NSObject <OcFixture>
-{
- TestObj* obj;
-}
-
-@end
-
-#endif // TWOBLUECUBES_CATCHOCTESTCASE_H_INCLUDED
diff --git a/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm b/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm
deleted file mode 100644
index e285138b..00000000
--- a/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// CatchOCTestCase.mm
-// OCTest
-//
-// Created by Phil Nash on 13/11/2010.
-// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#import "CatchOCTestCase.h"
-
-
-@implementation TestFixture
-
-
--(void) setUp
-{
- obj = [[TestObj alloc] init];
-}
-
--(void) tearDown
-{
- arcSafeRelease( obj );
-}
-
-OC_TEST_CASE( "This is a test case", "" )
-{
- REQUIRE( obj.int_val == 0 );
-
- obj.int_val = 1;
-
- REQUIRE( obj.int_val == 1 );
-}
-
-OC_TEST_CASE( "This is another test case", "" )
-{
- REQUIRE( obj.int_val == 0 );
-
- obj.int_val = 2;
-
- REQUIRE( obj.int_val == 2 );
-}
-
-OC_TEST_CASE( "tests a boolean value", "[!shouldfail]" )
-{
- CHECK( [obj isTrue] == NO );
- CHECK( [obj isFalse] == YES );
-}
-
-OC_TEST_CASE( "throws an Objective-C exception", "[!throws][!shouldfail]" )
-{
- @throw [[NSException alloc] initWithName: NSGenericException
- reason: @"Objective-C exception"
- userInfo: nil];
-}
-OC_TEST_CASE( "throws a std c++ exception", "[!throws][!shouldfail]" )
-{
- throw std::domain_error( "std C++ exception" );
-}
-
-///////////////////////////////////////////////////////////////////////////
-template<typename T>
-void useObject( const T& object ){}
-
-template<typename T>
-void useObject( const T* object ){}
-
-OC_TEST_CASE( "Matches work with OC types (NSString so far)", "[!shouldfail]" )
-{
- using namespace Catch::Matchers;
-
- REQUIRE_THAT( @"This is a string", Equals( @"This isn't a string" ) );
- REQUIRE_THAT( @"This is a string", Contains( @"is a" ) );
- REQUIRE_THAT( @"This is a string", StartsWith( @"This" ) );
- REQUIRE_THAT( @"This is a string", EndsWith( @"string" ) );
-}
-
-OC_TEST_CASE( "nil NSString should not crash the test", "[!shouldfail]" )
-{
- using namespace Catch::Matchers;
-
- CHECK_THAT( (NSString*)nil, Equals( @"This should fail, but not crash" ) );
- CHECK_THAT( (NSString*)nil, StartsWith( @"anything" ) );
-}
-
-@end
diff --git a/projects/XCode/OCTest/OCTest/Main.mm b/projects/XCode/OCTest/OCTest/Main.mm
deleted file mode 100644
index 569dc4d9..00000000
--- a/projects/XCode/OCTest/OCTest/Main.mm
+++ /dev/null
@@ -1,2 +0,0 @@
-#define CATCH_CONFIG_MAIN
-#import "catch.hpp"
diff --git a/projects/XCode/OCTest/OCTest/OCTest.1 b/projects/XCode/OCTest/OCTest/OCTest.1
deleted file mode 100644
index 1cd333e2..00000000
--- a/projects/XCode/OCTest/OCTest/OCTest.1
+++ /dev/null
@@ -1,79 +0,0 @@
-.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
-.\"See Also:
-.\"man mdoc.samples for a complete listing of options
-.\"man mdoc for the short list of editing options
-.\"/usr/share/misc/mdoc.template
-.Dd 09/02/2012 \" DATE
-.Dt OCTest 1 \" Program name and manual section number
-.Os Darwin
-.Sh NAME \" Section Header - required - don't modify
-.Nm OCTest,
-.\" The following lines are read in generating the apropos(man -k) database. Use only key
-.\" words here as the database is built based on the words here and in the .ND line.
-.Nm Other_name_for_same_program(),
-.Nm Yet another name for the same program.
-.\" Use .Nm macro to designate other names for the documented program.
-.Nd This line parsed for whatis database.
-.Sh SYNOPSIS \" Section Header - required - don't modify
-.Nm
-.Op Fl abcd \" [-abcd]
-.Op Fl a Ar path \" [-a path]
-.Op Ar file \" [file]
-.Op Ar \" [file ...]
-.Ar arg0 \" Underlined argument - use .Ar anywhere to underline
-arg2 ... \" Arguments
-.Sh DESCRIPTION \" Section Header - required - don't modify
-Use the .Nm macro to refer to your program throughout the man page like such:
-.Nm
-Underlining is accomplished with the .Ar macro like this:
-.Ar underlined text .
-.Pp \" Inserts a space
-A list of items with descriptions:
-.Bl -tag -width -indent \" Begins a tagged list
-.It item a \" Each item preceded by .It macro
-Description of item a
-.It item b
-Description of item b
-.El \" Ends the list
-.Pp
-A list of flags and their descriptions:
-.Bl -tag -width -indent \" Differs from above in tag removed
-.It Fl a \"-a flag as a list item
-Description of -a flag
-.It Fl b
-Description of -b flag
-.El \" Ends the list
-.Pp
-.\" .Sh ENVIRONMENT \" May not be needed
-.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1
-.\" .It Ev ENV_VAR_1
-.\" Description of ENV_VAR_1
-.\" .It Ev ENV_VAR_2
-.\" Description of ENV_VAR_2
-.\" .El
-.Sh FILES \" File used or created by the topic of the man page
-.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
-.It Pa /usr/share/file_name
-FILE_1 description
-.It Pa /Users/joeuser/Library/really_long_file_name
-FILE_2 description
-.El \" Ends the list
-.\" .Sh DIAGNOSTICS \" May not be needed
-.\" .Bl -diag
-.\" .It Diagnostic Tag
-.\" Diagnostic information here.
-.\" .It Diagnostic Tag
-.\" Diagnostic information here.
-.\" .El
-.Sh SEE ALSO
-.\" List links in ascending order by section, alphabetically within a section.
-.\" Please do not reference files that do not exist without filing a bug report
-.Xr a 1 ,
-.Xr b 1 ,
-.Xr c 1 ,
-.Xr a 2 ,
-.Xr b 2 ,
-.Xr a 3 ,
-.Xr b 3
-.\" .Sh BUGS \" Document known, unremedied bugs
-.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file
diff --git a/projects/XCode/OCTest/OCTest/OCTest.mm b/projects/XCode/OCTest/OCTest/OCTest.mm
deleted file mode 100644
index fa3ffea6..00000000
--- a/projects/XCode/OCTest/OCTest/OCTest.mm
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * OCTest.mm
- * OCTest
- *
- * Created by Phil on 13/11/2010.
- * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-
-#import "catch.hpp"
-
-#import "TestObj.h"
-
-TEST_CASE( "OCTest/TestObj", "tests TestObj" )
-{
- TestObj* obj = [[TestObj alloc] init];
-
- REQUIRE( obj.int_val == 0 );
-
- obj.int_val = 1;
-
- REQUIRE( obj.int_val == 1 );
-
- arcSafeRelease( obj );
-}
diff --git a/projects/XCode/OCTest/OCTest/TestObj.h b/projects/XCode/OCTest/OCTest/TestObj.h
deleted file mode 100644
index 8443921f..00000000
--- a/projects/XCode/OCTest/OCTest/TestObj.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// TestObj.h
-// OCTest
-//
-// Created by Phil on 13/11/2010.
-// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#ifndef TWOBLUECUBES_TESTOBJ_H_INCLUDED
-#define TWOBLUECUBES_TESTOBJ_H_INCLUDED
-
-#import <Foundation/Foundation.h>
-
-
-@interface TestObj : NSObject {
-
- int int_val;
-}
-
--(BOOL) isTrue;
--(BOOL) isFalse;
-
-@property (nonatomic, assign ) int int_val;
-
-@end
-
-#endif // TWOBLUECUBES_TESTOBJ_H_INCLUDED
diff --git a/projects/XCode/OCTest/OCTest/TestObj.m b/projects/XCode/OCTest/OCTest/TestObj.m
deleted file mode 100644
index 2c7dc99b..00000000
--- a/projects/XCode/OCTest/OCTest/TestObj.m
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// TestObj.m
-// OCTest
-//
-// Created by Phil on 13/11/2010.
-// Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#import "TestObj.h"
-
-
-@implementation TestObj
-
-@synthesize int_val;
-
--(BOOL) isTrue {
- return YES;
-}
--(BOOL) isFalse {
- return NO;
-}
-
-@end
diff --git a/projects/XCode/OCTest/catch_objc_impl.mm b/projects/XCode/OCTest/catch_objc_impl.mm
deleted file mode 100644
index e439a3ab..00000000
--- a/projects/XCode/OCTest/catch_objc_impl.mm
+++ /dev/null
@@ -1,69 +0,0 @@
-// This file #includes all the .cpp files into a single .mm
-// - so they get compiled as ObjectiveC++
-
-#include "../../../include/internal/catch_tostring.cpp"
-#include "../../../include/internal/catch_approx.cpp"
-#include "../../../include/internal/catch_assertionhandler.cpp"
-#include "../../../include/internal/catch_assertionresult.cpp"
-#include "../../../include/internal/catch_benchmark.cpp"
-#include "../../../include/internal/catch_capture_matchers.cpp"
-#include "../../../include/internal/catch_commandline.cpp"
-#include "../../../include/internal/catch_common.cpp"
-#include "../../../include/internal/catch_config.cpp"
-#include "../../../include/internal/catch_console_colour.cpp"
-#include "../../../include/internal/catch_context.cpp"
-#include "../../../include/internal/catch_debug_console.cpp"
-#include "../../../include/internal/catch_debugger.cpp"
-#include "../../../include/internal/catch_decomposer.cpp"
-#include "../../../include/internal/catch_errno_guard.cpp"
-#include "../../../include/internal/catch_exception_translator_registry.cpp"
-#include "../../../include/internal/catch_fatal_condition.cpp"
-#include "../../../include/internal/catch_interfaces_capture.cpp"
-#include "../../../include/internal/catch_interfaces_config.cpp"
-#include "../../../include/internal/catch_interfaces_exception.cpp"
-#include "../../../include/internal/catch_interfaces_registry_hub.cpp"
-#include "../../../include/internal/catch_interfaces_reporter.cpp"
-#include "../../../include/internal/catch_interfaces_runner.cpp"
-#include "../../../include/internal/catch_interfaces_testcase.cpp"
-#include "../../../include/internal/catch_leak_detector.cpp"
-#include "../../../include/internal/catch_list.cpp"
-#include "../../../include/internal/catch_matchers.cpp"
-#include "../../../include/internal/catch_matchers_string.cpp"
-#include "../../../include/internal/catch_message.cpp"
-#include "../../../include/internal/catch_output_redirect.cpp"
-#include "../../../include/internal/catch_random_number_generator.cpp"
-#include "../../../include/internal/catch_registry_hub.cpp"
-#include "../../../include/internal/catch_reporter_registry.cpp"
-#include "../../../include/internal/catch_result_type.cpp"
-#include "../../../include/internal/catch_run_context.cpp"
-#include "../../../include/internal/catch_section.cpp"
-#include "../../../include/internal/catch_section_info.cpp"
-#include "../../../include/internal/catch_session.cpp"
-#include "../../../include/internal/catch_startup_exception_registry.cpp"
-#include "../../../include/internal/catch_stream.cpp"
-#include "../../../include/internal/catch_string_manip.cpp"
-#include "../../../include/internal/catch_stringref.cpp"
-#include "../../../include/internal/catch_tag_alias.cpp"
-#include "../../../include/internal/catch_tag_alias_autoregistrar.cpp"
-#include "../../../include/internal/catch_tag_alias_registry.cpp"
-#include "../../../include/internal/catch_test_case_info.cpp"
-#include "../../../include/internal/catch_test_case_registry_impl.cpp"
-#include "../../../include/internal/catch_test_case_tracker.cpp"
-#include "../../../include/internal/catch_test_registry.cpp"
-#include "../../../include/internal/catch_test_spec.cpp"
-#include "../../../include/internal/catch_test_spec_parser.cpp"
-#include "../../../include/internal/catch_timer.cpp"
-#include "../../../include/internal/catch_totals.cpp"
-#include "../../../include/internal/catch_uncaught_exceptions.cpp"
-#include "../../../include/internal/catch_version.cpp"
-#include "../../../include/internal/catch_wildcard_pattern.cpp"
-#include "../../../include/internal/catch_xmlwriter.cpp"
-
-
-// Reporters
-#include "../../../include/reporters/catch_reporter_bases.cpp"
-#include "../../../include/reporters/catch_reporter_compact.cpp"
-#include "../../../include/reporters/catch_reporter_console.cpp"
-#include "../../../include/reporters/catch_reporter_junit.cpp"
-#include "../../../include/reporters/catch_reporter_listening.cpp"
-#include "../../../include/reporters/catch_reporter_xml.cpp"
diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py
deleted file mode 100755
index 838a1a78..00000000
--- a/scripts/approvalTests.py
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-
-import io
-import os
-import sys
-import subprocess
-import re
-import difflib
-
-import scriptCommon
-from scriptCommon import catchPath
-
-if os.name == 'nt':
- # Enable console colours on windows
- os.system('')
-
-rootPath = os.path.join(catchPath, 'projects/SelfTest/Baselines')
-
-langFilenameParser = re.compile(r'(.+\.[ch]pp)')
-filelocParser = re.compile(r'''
- .*/
- (.+\.[ch]pp) # filename
- (?::|\() # : is starting separator between filename and line number on Linux, ( on Windows
- ([0-9]*) # line number
- \)? # Windows also has an ending separator, )
-''', re.VERBOSE)
-lineNumberParser = re.compile(r' line="[0-9]*"')
-hexParser = re.compile(r'\b(0[xX][0-9a-fA-F]+)\b')
-durationsParser = re.compile(r' time="[0-9]*\.[0-9]*"')
-sonarqubeDurationParser = re.compile(r' duration="[0-9]+"')
-timestampsParser = re.compile(r'\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}Z')
-versionParser = re.compile(r'Catch v[0-9]+\.[0-9]+\.[0-9]+(-develop\.[0-9]+)?')
-nullParser = re.compile(r'\b(__null|nullptr)\b')
-exeNameParser = re.compile(r'''
- \b
- (CatchSelfTest|SelfTest) # Expected executable name
- (?:.exe)? # Executable name contains .exe on Windows.
- \b
-''', re.VERBOSE)
-# This is a hack until something more reasonable is figured out
-specialCaseParser = re.compile(r'file\((\d+)\)')
-
-# errno macro expands into various names depending on platform, so we need to fix them up as well
-errnoParser = re.compile(r'''
- \(\*__errno_location\ \(\)\)
- |
- \(\*__error\(\)\)
- |
- \(\*_errno\(\)\)
-''', re.VERBOSE)
-sinceEpochParser = re.compile(r'\d+ .+ since epoch')
-infParser = re.compile(r'''
- \(\(float\)\(1e\+300\ \*\ 1e\+300\)\) # MSVC INFINITY macro
- |
- \(__builtin_inff\(\)\) # Linux (ubuntu) INFINITY macro
- |
- \(__builtin_inff\ \(\)\) # Fedora INFINITY macro
- |
- __builtin_huge_valf\(\) # OSX macro
-''', re.VERBOSE)
-nanParser = re.compile(r'''
- \(\(float\)\(\(\(float\)\(1e\+300\ \*\ 1e\+300\)\)\ \*\ 0\.0F\)\) # MSVC NAN macro
- |
- \(\(float\)\(INFINITY\ \*\ 0\.0F\)\) # Yet another MSVC NAN macro
- |
- \(__builtin_nanf\ \(""\)\) # Linux (ubuntu) NAN macro
- |
- __builtin_nanf\("0x<hex\ digits>"\) # The weird content of the brackets is there because a different parser has already ran before this one
-''', re.VERBOSE)
-
-
-if len(sys.argv) == 2:
- cmdPath = sys.argv[1]
-else:
- cmdPath = os.path.join(catchPath, scriptCommon.getBuildExecutable())
-
-overallResult = 0
-
-
-def diffFiles(fileA, fileB):
- with io.open(fileA, 'r', encoding='utf-8', errors='surrogateescape') as file:
- aLines = [line.rstrip() for line in file.readlines()]
- with io.open(fileB, 'r', encoding='utf-8', errors='surrogateescape') as file:
- bLines = [line.rstrip() for line in file.readlines()]
-
- shortenedFilenameA = fileA.rsplit(os.sep, 1)[-1]
- shortenedFilenameB = fileB.rsplit(os.sep, 1)[-1]
-
- diff = difflib.unified_diff(aLines, bLines, fromfile=shortenedFilenameA, tofile=shortenedFilenameB, n=0)
- return [line for line in diff if line[0] in ('+', '-')]
-
-
-def normalizeFilepath(line):
- if catchPath in line:
- # make paths relative to Catch root
- line = line.replace(catchPath + os.sep, '')
-
- m = langFilenameParser.match(line)
- if m:
- filepath = m.group(0)
- # go from \ in windows paths to /
- filepath = filepath.replace('\\', '/')
- # remove start of relative path
- filepath = filepath.replace('../', '')
- line = line[:m.start()] + filepath + line[m.end():]
-
- return line
-
-def filterLine(line, isCompact):
- line = normalizeFilepath(line)
-
- # strip source line numbers
- m = filelocParser.match(line)
- if m:
- # note that this also strips directories, leaving only the filename
- filename, lnum = m.groups()
- lnum = ":<line number>" if lnum else ""
- line = filename + lnum + line[m.end():]
- else:
- line = lineNumberParser.sub(" ", line)
-
- if isCompact:
- line = line.replace(': FAILED', ': failed')
- line = line.replace(': PASSED', ': passed')
-
- # strip Catch version number
- line = versionParser.sub("<version>", line)
-
- # replace *null* with 0
- line = nullParser.sub("0", line)
-
- # strip executable name
- line = exeNameParser.sub("<exe-name>", line)
-
- # strip hexadecimal numbers (presumably pointer values)
- line = hexParser.sub("0x<hex digits>", line)
-
- # strip durations and timestamps
- line = durationsParser.sub(' time="{duration}"', line)
- line = sonarqubeDurationParser.sub(' duration="{duration}"', line)
- line = timestampsParser.sub('{iso8601-timestamp}', line)
- line = specialCaseParser.sub('file:\g<1>', line)
- line = errnoParser.sub('errno', line)
- line = sinceEpochParser.sub('{since-epoch-report}', line)
- line = infParser.sub('INFINITY', line)
- line = nanParser.sub('NAN', line)
- return line
-
-
-def approve(baseName, args):
- global overallResult
- args[0:0] = [cmdPath]
- if not os.path.exists(cmdPath):
- raise Exception("Executable doesn't exist at " + cmdPath)
- baselinesPath = os.path.join(rootPath, '{0}.approved.txt'.format(baseName))
- rawResultsPath = os.path.join(rootPath, '_{0}.tmp'.format(baseName))
- filteredResultsPath = os.path.join(rootPath, '{0}.unapproved.txt'.format(baseName))
-
- f = open(rawResultsPath, 'w')
- subprocess.call(args, stdout=f, stderr=f)
- f.close()
-
- rawFile = io.open(rawResultsPath, 'r', encoding='utf-8', errors='surrogateescape')
- filteredFile = io.open(filteredResultsPath, 'w', encoding='utf-8', errors='surrogateescape')
- for line in rawFile:
- filteredFile.write(filterLine(line, 'compact' in baseName).rstrip() + "\n")
- filteredFile.close()
- rawFile.close()
-
- os.remove(rawResultsPath)
- print()
- print(baseName + ":")
- if os.path.exists(baselinesPath):
- diffResult = diffFiles(baselinesPath, filteredResultsPath)
- if diffResult:
- print('\n'.join(diffResult))
- print(" \n****************************\n \033[91mResults differed")
- if len(diffResult) > overallResult:
- overallResult = len(diffResult)
- else:
- os.remove(filteredResultsPath)
- print(" \033[92mResults matched")
- print("\033[0m")
- else:
- print(" first approval")
- if overallResult == 0:
- overallResult = 1
-
-
-print("Running approvals against executable:")
-print(" " + cmdPath)
-
-
-# ## Keep default reporters here ##
-# Standard console reporter
-approve("console.std", ["~[!nonportable]~[!benchmark]~[approvals]", "--order", "lex", "--rng-seed", "1"])
-# console reporter, include passes, warn about No Assertions
-approve("console.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "--order", "lex", "--rng-seed", "1"])
-# console reporter, include passes, warn about No Assertions, limit failures to first 4
-approve("console.swa4", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex", "--rng-seed", "1"])
-# junit reporter, include passes, warn about No Assertions
-approve("junit.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex", "--rng-seed", "1"])
-# xml reporter, include passes, warn about No Assertions
-approve("xml.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex", "--rng-seed", "1"])
-# compact reporter, include passes, warn about No Assertions
-approve('compact.sw', ['~[!nonportable]~[!benchmark]~[approvals]', '-s', '-w', 'NoAssertions', '-r', 'compact', '--order', 'lex', "--rng-seed", "1"])
-# sonarqube reporter, include passes, warn about No Assertions
-approve("sonarqube.sw", ["~[!nonportable]~[!benchmark]~[approvals]", "-s", "-w", "NoAssertions", "-r", "sonarqube", "--order", "lex", "--rng-seed", "1"])
-
-if overallResult != 0:
- print("If these differences are expected, run approve.py to approve new baselines.")
-exit(overallResult)
diff --git a/scripts/approve.py b/scripts/approve.py
deleted file mode 100755
index 1e0d5a7a..00000000
--- a/scripts/approve.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-
-import os
-import sys
-import shutil
-import glob
-from scriptCommon import catchPath
-
-rootPath = os.path.join( catchPath, 'projects/SelfTest/Baselines' )
-
-if len(sys.argv) > 1:
- files = [os.path.join( rootPath, f ) for f in sys.argv[1:]]
-else:
- files = glob.glob( os.path.join( rootPath, "*.unapproved.txt" ) )
-
-
-def approveFile( approvedFile, unapprovedFile ):
- justFilename = unapprovedFile[len(rootPath)+1:]
- if os.path.exists( unapprovedFile ):
- if os.path.exists( approvedFile ):
- os.remove( approvedFile )
- os.rename( unapprovedFile, approvedFile )
- print( "approved " + justFilename )
- else:
- print( "approval file " + justFilename + " does not exist" )
-
-if files:
- for unapprovedFile in files:
- approveFile( unapprovedFile.replace( "unapproved.txt", "approved.txt" ), unapprovedFile )
-else:
- print( "no files to approve" )
diff --git a/scripts/benchmarkCompile.py b/scripts/benchmarkCompile.py
deleted file mode 100755
index 34113b9e..00000000
--- a/scripts/benchmarkCompile.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-
-import time, subprocess, sys, os, shutil, glob, random
-import argparse
-
-def median(lst):
- lst = sorted(lst)
- mid, odd = divmod(len(lst), 2)
- if odd:
- return lst[mid]
- else:
- return (lst[mid - 1] + lst[mid]) / 2.0
-
-def mean(lst):
- return float(sum(lst)) / max(len(lst), 1)
-
-compiler_path = ''
-flags = []
-
-main_file = r'''
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-'''
-main_name = 'catch-main.cpp'
-
-dir_name = 'benchmark-dir'
-
-files = 20
-test_cases_in_file = 20
-sections_in_file = 4
-assertions_per_section = 5
-
-checks = [
- 'a != b', 'a != c', 'a != d', 'a != e', 'b != c', 'b != d', 'b != e', 'c != d', 'c != e', 'd != e', 'a + a == a',
- 'a + b == b', 'a + c == c', 'a + d == d', 'a + e == e', 'b + a == b', 'b + b == c', 'b + c == d',
- 'b + d == e', 'c + a == c', 'c + b == d', 'c + c == e', 'd + a == d', 'd + b == e', 'e + a == e',
- 'a + a + a == a', 'b + c == a + d', 'c + a + a == a + b + b + a',
- 'a < b', 'b < c', 'c < d', 'd < e', 'a >= a', 'd >= b',
-]
-
-def create_temp_dir():
- if os.path.exists(dir_name):
- shutil.rmtree(dir_name)
- os.mkdir(dir_name)
-
-def copy_catch(path_to_catch):
- shutil.copy(path_to_catch, dir_name)
-
-def create_catch_main():
- with open(main_name, 'w') as f:
- f.write(main_file)
-
-def compile_main():
- start_t = time.time()
- subprocess.check_call([compiler_path, main_name, '-c'] + flags)
- end_t = time.time()
- return end_t - start_t
-
-def compile_files():
- cpp_files = glob.glob('tests*.cpp')
- start_t = time.time()
- subprocess.check_call([compiler_path, '-c'] + flags + cpp_files)
- end_t = time.time()
- return end_t - start_t
-
-def link_files():
- obj_files = glob.glob('*.o')
- start_t = time.time()
- subprocess.check_call([compiler_path] + flags + obj_files)
- end_t = time.time()
- return end_t - start_t
-
-def benchmark(func):
- results = [func() for i in range(10)]
- return mean(results), median(results)
-
-def char_range(start, end):
- for c in range(ord(start), ord(end)):
- yield chr(c)
-
-def generate_sections(fd):
- for i in range(sections_in_file):
- fd.write(' SECTION("Section {}") {{\n'.format(i))
- fd.write('\n'.join(' CHECK({});'.format(check) for check in random.sample(checks, assertions_per_section)))
- fd.write(' }\n')
-
-
-def generate_file(file_no):
- with open('tests{}.cpp'.format(file_no), 'w') as f:
- f.write('#include "catch.hpp"\n\n')
- for i in range(test_cases_in_file):
- f.write('TEST_CASE("File {} test {}", "[.compile]"){{\n'.format(file_no, i))
- for i, c in enumerate(char_range('a', 'f')):
- f.write(' int {} = {};\n'.format(c, i))
- generate_sections(f)
- f.write('}\n\n')
-
-
-def generate_files():
- create_catch_main()
- for i in range(files):
- generate_file(i)
-
-
-options = ['all', 'main', 'files', 'link']
-
-parser = argparse.ArgumentParser(description='Benchmarks Catch\'s compile times against some synthetic tests')
-# Add first arg -- benchmark type
-parser.add_argument('benchmark_kind', nargs='?', default='all', choices=options, help='What kind of benchmark to run, default: all')
-
-# Args to allow changing header/compiler
-parser.add_argument('-I', '--catch-header', default='catch.hpp', help = 'Path to catch.hpp, default: catch.hpp')
-parser.add_argument('-c', '--compiler', default='g++', help = 'Compiler to use, default: g++')
-
-parser.add_argument('-f', '--flags', help = 'Flags to be passed to the compiler. Pass as "," separated list')
-
-# Allow creating files only, without running the whole thing
-parser.add_argument('-g', '--generate-files', action='store_true', help='Generate test files and quit')
-
-args = parser.parse_args()
-
-compiler_path = args.compiler
-catch_path = args.catch_header
-
-if args.generate_files:
- create_temp_dir()
- copy_catch(catch_path)
- os.chdir(dir_name)
- # now create the fake test files
- generate_files()
- # Early exit
- print('Finished generating files')
- exit(1)
-
-os.chdir(dir_name)
-
-if args.flags:
- flags = args.flags.split(',')
-
-print('Time needed for ...')
-if args.benchmark_kind in ('all', 'main'):
- print(' ... compiling main, mean: {:.2f}, median: {:.2f} s'.format(*benchmark(compile_main)))
-if args.benchmark_kind in ('all', 'files'):
- print(' ... compiling test files, mean: {:.2f}, median: {:.2f} s'.format(*benchmark(compile_files)))
-if args.benchmark_kind in ('all', 'link'):
- print(' ... linking everything, mean: {:.2f}, median: {:.2f} s'.format(*benchmark(link_files)))
diff --git a/scripts/benchmarkRunner.py b/scripts/benchmarkRunner.py
deleted file mode 100755
index dc753cf0..00000000
--- a/scripts/benchmarkRunner.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python3
-
-import subprocess, os, sys
-import xml.etree.ElementTree as ET
-from collections import defaultdict
-from statistics import median, stdev
-from datetime import datetime
-
-def get_commit_hash():
- res = subprocess.run('git rev-parse HEAD'.split(), check=True, stdout=subprocess.PIPE, universal_newlines=True)
- return res.stdout.strip()
-
-if len(sys.argv) < 2:
- print('Usage: {} benchmark-binary'.format(sys.argv[0]))
- exit(1)
-
-
-num_runs = 10
-data = defaultdict(list)
-
-
-def parse_file(file):
-
- def recursive_search(node):
- if node.tag == 'TestCase':
- results = node.find('OverallResult')
- time = results.get('durationInSeconds')
- data[node.get('name')].append(float(time))
- elif node.tag in ('Group', 'Catch'):
- for child in node:
- recursive_search(child)
-
- tree = ET.parse(file)
- recursive_search(tree.getroot())
-
-def run_benchmarks(binary):
- call = [binary] + '-d yes -r xml -o'.split()
- for i in range(num_runs):
- file = 'temp{}.xml'.format(i)
- print('Run number {}'.format(i))
- subprocess.run(call + [file])
- parse_file(file)
- # Remove file right after parsing, because benchmark output can be big
- os.remove(file)
-
-
-# Run benchmarks
-run_benchmarks(sys.argv[1])
-
-result_file = '{:%Y-%m-%dT%H-%M-%S}-{}.result'.format(datetime.now(), get_commit_hash())
-
-
-print('Writing results to {}'.format(result_file))
-with open(result_file, 'w') as file:
- for k in sorted(data):
- file.write('{}: median: {} (s), stddev: {} (s)\n'.format(k, median(data[k]), stdev(data[k])))
diff --git a/scripts/developBuild.py b/scripts/developBuild.py
deleted file mode 100755
index 9252c7d6..00000000
--- a/scripts/developBuild.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-import releaseCommon
-
-v = releaseCommon.Version()
-v.incrementBuildNumber()
-releaseCommon.performUpdates(v)
-
-print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/embed.py b/scripts/embed.py
deleted file mode 100644
index 66757033..00000000
--- a/scripts/embed.py
+++ /dev/null
@@ -1,63 +0,0 @@
-import re
-
-preprocessorRe = re.compile( r'\s*#.*' )
-
-fdefineRe = re.compile( r'\s*#\s*define\s*(\S*)\s*\(' ) # #defines that take arguments
-defineRe = re.compile( r'\s*#\s*define\s*(\S*)(\s+)(.*)' ) # all #defines
-undefRe = re.compile( r'\s*#\s*undef\s*(\S*)' ) # all #undefs
-
-ifdefCommonRe = re.compile( r'\s*#\s*if' ) # all #ifdefs
-ifdefRe = re.compile( r'\s*#\s*ifdef\s*(\S*)' )
-ifndefRe = re.compile( r'\s*#\s*ifndef\s*(\S*)' )
-endifRe = re.compile( r'\s*#\s*endif\s*//\s*(.*)' )
-elseRe = re.compile( r'\s*#\s*else' )
-ifRe = re.compile( r'\s*#\s*if\s+(.*)' )
-
-nsRe = re.compile( r'(.*?\s*\s*namespace\s+)(\w+)(\s*{?)(.*)' )
-nsCloseRe = re.compile( r'(.*\s*})(\s*\/\/\s*namespace\s+)(\w+)(\s*)(.*)' )
-
-
-class LineMapper:
- def __init__( self, idMap, outerNamespace ):
- self.idMap = idMap
- self.outerNamespace = outerNamespace
-
- # TBD:
- # #if, #ifdef, comments after #else
- def mapLine( self, lineNo, line ):
- for idFrom, idTo in self.idMap.items():
- r = re.compile("(.*)" + idFrom + "(.*)")
-
- m = r.match( line )
- if m:
- line = m.group(1) + idTo + m.group(2) + "\n"
-
- m = nsCloseRe.match( line )
- if m:
- originalNs = m.group(3)
- # print("[{0}] originalNs: '{1}' - closing".format(lineNo, originalNs))
- # print( " " + line )
- # print( " 1:[{0}]\n 2:[{1}]\n 3:[{2}]\n 4:[{3}]\n 5:[{4}]".format( m.group(1), m.group(2), m.group(3), m.group(4), m.group(5) ) )
- if originalNs in self.outerNamespace:
- outerNs, innerNs = self.outerNamespace[originalNs]
- return "{0}}}{1}{2}::{3}{4}{5}\n".format( m.group(1), m.group(2), outerNs, innerNs, m.group(4), m.group(5))
- m = nsRe.match( line )
- if m:
- originalNs = m.group(2)
- # print("[{0}] originalNs: '{1}'".format(lineNo, originalNs))
- # print( " " + line )
- # print( " 1:[{0}]\n 2:[{1}]\n 3:[{2}]\n 4:[{3}]".format( m.group(1), m.group(2), m.group(3), m.group(4) ) )
- if originalNs in self.outerNamespace:
- outerNs, innerNs = self.outerNamespace[originalNs]
- return "{0}{1} {{ namespace {2}{3}{4}\n".format( m.group(1), outerNs, innerNs, m.group(3), m.group(4) )
-
- return line
-
- def mapFile(self, filenameIn, filenameOut ):
- print( "Embedding:\n {0}\nas:\n {1}".format( filenameIn, filenameOut ) )
- with open( filenameIn, 'r' ) as f, open( filenameOut, 'w' ) as outf:
- lineNo = 1
- for line in f:
- outf.write( self.mapLine( lineNo, line ) )
- lineNo = lineNo + 1
- print( "Written {0} lines".format( lineNo ) ) \ No newline at end of file
diff --git a/scripts/embedClara.py b/scripts/embedClara.py
deleted file mode 100755
index d8c1520a..00000000
--- a/scripts/embedClara.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python3
-
-# Execute this script any time you import a new copy of Clara into the third_party area
-import os
-import sys
-import embed
-
-rootPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
-
-filename = os.path.join( rootPath, "third_party", "clara.hpp" )
-outfilename = os.path.join( rootPath, "include", "external", "clara.hpp" )
-
-
-# Mapping of pre-processor identifiers
-idMap = {
- "CLARA_HPP_INCLUDED": "CATCH_CLARA_HPP_INCLUDED",
- "CLARA_CONFIG_CONSOLE_WIDTH": "CATCH_CLARA_CONFIG_CONSOLE_WIDTH",
- "CLARA_TEXTFLOW_HPP_INCLUDED": "CATCH_CLARA_TEXTFLOW_HPP_INCLUDED",
- "CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH": "CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH",
- "CLARA_PLATFORM_WINDOWS": "CATCH_PLATFORM_WINDOWS"
- }
-
-# outer namespace to add
-outerNamespace = { "clara": ("Catch", "clara") }
-
-mapper = embed.LineMapper( idMap, outerNamespace )
-mapper.mapFile( filename, outfilename ) \ No newline at end of file
diff --git a/scripts/extractFeaturesFromReleaseNotes.py b/scripts/extractFeaturesFromReleaseNotes.py
deleted file mode 100644
index 11f4955c..00000000
--- a/scripts/extractFeaturesFromReleaseNotes.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env python3
-
-#
-# extractFeaturesFromReleaseNotes.py
-#
-# Read the release notes - docs/release-notes.md - and generate text
-# for pasting in to individual documentation pages, to indicate which
-# versions recent features were released in.
-#
-# Using the output of the file is easier than manually constructing
-# the text to paste in to documentation pages.
-#
-# One way to use this:
-# - run this script, saving the output to some temporary file
-# - diff this output with the actual release notes page
-# - the differences are Markdown text that can be pasted in to the
-# appropriate documentation pages in the docs/ directory.
-# - each release also has a github link to show which documentation files
-# were changed in it.
-# This can be helpful to see which documentation pages
-# to add the 'Introduced in Catch ...' snippets to the relevant pages.
-#
-
-from __future__ import print_function
-
-import re
-
-
-def create_introduced_in_text(version, bug_number = None):
- """Generate text to paste in to documentation file"""
- if bug_number:
- return '> [Introduced](https://github.com/catchorg/Catch2/issues/%s) in Catch %s.' % (bug_number, version)
- else:
- # Use this text for changes that don't have issue numbers
- return '> Introduced in Catch %s.' % version
-
-
-def link_to_changes_in_release(release, releases):
- """
- Markdown text for a hyperlink showing all edits in a release, or empty string
-
- :param release: A release version, as a string
- :param releases: A container of releases, in descending order - newest to oldest
- :return: Markdown text for a hyperlink showing the differences between the give release and the prior one,
- or empty string, if the previous release is not known
- """
-
- if release == releases[-1]:
- # This is the earliest release we know about
- return ''
- index = releases.index(release)
- previous_release = releases[index + 1]
- return '\n[Changes in %s](https://github.com/catchorg/Catch2/compare/v%s...v%s)' % (release, previous_release, release)
-
-
-def write_recent_release_notes_with_introduced_text():
- current_version = None
- release_toc_regex = r'\[(\d.\d.\d)\]\(#\d+\)<br>'
- issue_number_regex = r'#[0-9]+'
- releases = []
- with open('../docs/release-notes.md') as release_notes:
- for line in release_notes:
- line = line[:-1]
- print(line)
-
- # Extract version number from table of contents
- match = re.search(release_toc_regex, line)
- if match:
- release_name = match.group(1)
- releases.append(release_name)
-
- if line.startswith('## '):
- # It's a section with version number
- current_version = line.replace('## ', '')
-
- # We decided not to add released-date info for older versions
- if current_version == 'Older versions':
- break
-
- print(create_introduced_in_text(current_version))
- print(link_to_changes_in_release(current_version, releases))
-
- # Not yet found a version number, so to avoid picking up hyperlinks to
- # version numbers in the index, keep going
- if not current_version:
- continue
-
- for bug_link in re.findall(issue_number_regex, line):
- bug_number = bug_link.replace('#', '')
- print(create_introduced_in_text(current_version, bug_number))
-
-
-if __name__ == '__main__':
- write_recent_release_notes_with_introduced_text()
diff --git a/scripts/fixWhitespace.py b/scripts/fixWhitespace.py
deleted file mode 100755
index 4591c1c4..00000000
--- a/scripts/fixWhitespace.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-import os
-from scriptCommon import catchPath
-
-def isSourceFile( path ):
- return path.endswith( ".cpp" ) or path.endswith( ".h" ) or path.endswith( ".hpp" )
-
-def fixAllFilesInDir( dir ):
- changedFiles = 0
- for f in os.listdir( dir ):
- path = os.path.join( dir,f )
- if os.path.isfile( path ):
- if isSourceFile( path ):
- if fixFile( path ):
- changedFiles += 1
- else:
- fixAllFilesInDir( path )
- return changedFiles
-
-def fixFile( path ):
- f = open( path, 'r' )
- lines = []
- changed = 0
- for line in f:
- trimmed = line.rstrip() + "\n"
- trimmed = trimmed.replace('\t', ' ')
- if trimmed != line:
- changed = changed +1
- lines.append( trimmed )
- f.close()
- if changed > 0:
- global changedFiles
- changedFiles = changedFiles + 1
- print( path + ":" )
- print( " - fixed " + str(changed) + " line(s)" )
- altPath = path + ".backup"
- os.rename( path, altPath )
- f2 = open( path, 'w' )
- for line in lines:
- f2.write( line )
- f2.close()
- os.remove( altPath )
- return True
- return False
-
-changedFiles = fixAllFilesInDir(catchPath)
-if changedFiles > 0:
- print( "Fixed " + str(changedFiles) + " file(s)" )
-else:
- print( "No trailing whitespace found" )
diff --git a/scripts/generateSingleHeader.py b/scripts/generateSingleHeader.py
deleted file mode 100755
index ffd11780..00000000
--- a/scripts/generateSingleHeader.py
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-
-import os
-import io
-import sys
-import re
-import datetime
-from glob import glob
-
-from scriptCommon import catchPath
-
-def generate(v):
- includesParser = re.compile( r'\s*#\s*include\s*"(.*)"' )
- guardParser = re.compile( r'\s*#.*(TWOBLUECUBES_)?CATCH_.*_INCLUDED')
- defineParser = re.compile( r'\s*#define\s+(TWOBLUECUBES_)?CATCH_.*_INCLUDED')
- ifParser = re.compile( r'\s*#ifndef (TWOBLUECUBES_)?CATCH_.*_INCLUDED')
- endIfParser = re.compile( r'\s*#endif // (TWOBLUECUBES_)?CATCH_.*_INCLUDED')
- ifImplParser = re.compile( r'\s*#ifdef CATCH_CONFIG_RUNNER' )
- commentParser1 = re.compile( r'^\s*/\*')
- commentParser2 = re.compile( r'^ \*')
- blankParser = re.compile( r'^\s*$')
-
- seenHeaders = set([])
- possibleHeaders = set([])
- rootPath = os.path.join( catchPath, 'include/' )
- outputPath = os.path.join( catchPath, 'single_include/catch2/catch.hpp' )
-
- globals = {
- 'includeImpl' : True,
- 'ifdefs' : 0,
- 'implIfDefs' : -1
- }
-
- for arg in sys.argv[1:]:
- arg = arg.lower()
- if arg == "noimpl":
- globals['includeImpl'] = False
- print( "Not including impl code" )
- else:
- print( "\n** Unrecognised argument: " + arg + " **\n" )
- exit(1)
-
-
- # ensure that the output directory exists (hopefully no races)
- outDir = os.path.dirname(outputPath)
- if not os.path.exists(outDir):
- os.makedirs(outDir)
- out = io.open( outputPath, 'w', newline='\n', encoding='utf-8')
-
- def write( line ):
- if globals['includeImpl'] or globals['implIfDefs'] == -1:
- out.write( line )
-
- def getDirsToSearch( ):
- return [os.path.join( rootPath, s) for s in ['', 'internal', 'reporters', 'internal/benchmark', 'internal/benchmark/detail']]
-
- def collectPossibleHeaders():
- dirs = getDirsToSearch()
- for dir in dirs:
- hpps = glob(os.path.join(dir, '*.hpp'))
- hs = glob(os.path.join(dir, '*.h'))
- possibleHeaders.update( hpp.rpartition( os.sep )[2] for hpp in hpps )
- possibleHeaders.update( h.rpartition( os.sep )[2] for h in hs )
-
-
- def insertCpps():
- dirs = getDirsToSearch()
- cppFiles = []
- for dir in dirs:
- cppFiles += glob(os.path.join(dir, '*.cpp'))
- # To minimize random diffs, sort the files before processing them
- for fname in sorted(cppFiles):
- dir, name = fname.rsplit(os.path.sep, 1)
- dir += os.path.sep
- parseFile(dir, name)
-
- def parseFile( path, filename ):
- f = io.open( os.path.join(path, filename), 'r', encoding='utf-8' )
- blanks = 0
- write( u"// start {0}\n".format( filename ) )
- for line in f:
- if '// ~*~* CATCH_CPP_STITCH_PLACE *~*~' in line:
- insertCpps()
- continue
- elif ifParser.match( line ):
- globals['ifdefs'] += 1
- elif endIfParser.match( line ):
- globals['ifdefs'] -= 1
- if globals['ifdefs'] == globals['implIfDefs']:
- globals['implIfDefs'] = -1
- m = includesParser.match( line )
- if m:
- header = m.group(1)
- headerPath, sep, headerFile = header.rpartition( "/" )
- if headerFile not in seenHeaders:
- if headerFile != "tbc_text_format.h" and headerFile != "clara.h":
- seenHeaders.add( headerFile )
- if headerPath == "internal" and path.endswith("internal/"):
- headerPath = ""
- sep = ""
- if os.path.exists( path + headerPath + sep + headerFile ):
- parseFile( path + headerPath + sep, headerFile )
- else:
- parseFile( rootPath + headerPath + sep, headerFile )
- else:
- if ifImplParser.match(line):
- globals['implIfDefs'] = globals['ifdefs']
- if (not guardParser.match( line ) or defineParser.match( line ) ) and not commentParser1.match( line )and not commentParser2.match( line ):
- if blankParser.match( line ):
- blanks = blanks + 1
- else:
- blanks = 0
- if blanks < 2 and not defineParser.match(line):
- write( line.rstrip() + "\n" )
- write( u'// end {}\n'.format(filename) )
-
- def warnUnparsedHeaders():
- unparsedHeaders = possibleHeaders.difference( seenHeaders )
- # These headers aren't packaged into the unified header, exclude them from any warning
- whitelist = ['catch.hpp', 'catch_reporter_teamcity.hpp', 'catch_with_main.hpp', 'catch_reporter_automake.hpp', 'catch_reporter_tap.hpp', 'catch_reporter_sonarqube.hpp']
- unparsedHeaders = unparsedHeaders.difference( whitelist )
- if unparsedHeaders:
- print( "WARNING: unparsed headers detected\n{0}\n".format( unparsedHeaders ) )
-
- write( u"/*\n" )
- write( u" * Catch v{0}\n".format( v.getVersionString() ) )
- write( u" * Generated: {0}\n".format( datetime.datetime.now() ) )
- write( u" * ----------------------------------------------------------\n" )
- write( u" * This file has been merged from multiple headers. Please don't edit it directly\n" )
- write( u" * Copyright (c) {} Two Blue Cubes Ltd. All rights reserved.\n".format( datetime.date.today().year ) )
- write( u" *\n" )
- write( u" * Distributed under the Boost Software License, Version 1.0. (See accompanying\n" )
- write( u" * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n" )
- write( u" */\n" )
- write( u"#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" )
- write( u"#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n" )
-
- collectPossibleHeaders()
- parseFile( rootPath, 'catch.hpp' )
- warnUnparsedHeaders()
-
- write( u"#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED\n\n" )
- out.close()
- print( "Generated single include for Catch v{0}\n".format( v.getVersionString() ) )
-
-
-if __name__ == '__main__':
- from releaseCommon import Version
- generate(Version())
diff --git a/scripts/majorRelease.py b/scripts/majorRelease.py
deleted file mode 100755
index e9e285a8..00000000
--- a/scripts/majorRelease.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-import releaseCommon
-
-v = releaseCommon.Version()
-v.incrementMajorVersion()
-releaseCommon.performUpdates(v)
-
-print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/minorRelease.py b/scripts/minorRelease.py
deleted file mode 100755
index 2b57c2ea..00000000
--- a/scripts/minorRelease.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-import releaseCommon
-
-v = releaseCommon.Version()
-v.incrementMinorVersion()
-releaseCommon.performUpdates(v)
-
-print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/patchRelease.py b/scripts/patchRelease.py
deleted file mode 100755
index d20db714..00000000
--- a/scripts/patchRelease.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-import releaseCommon
-
-v = releaseCommon.Version()
-v.incrementPatchNumber()
-releaseCommon.performUpdates(v)
-
-print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/releaseCommon.py b/scripts/releaseCommon.py
deleted file mode 100644
index 283337d4..00000000
--- a/scripts/releaseCommon.py
+++ /dev/null
@@ -1,166 +0,0 @@
-from __future__ import print_function
-
-import os
-import sys
-import re
-import string
-import glob
-import fnmatch
-
-from scriptCommon import catchPath
-
-versionParser = re.compile( r'(\s*static\sVersion\sversion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' )
-rootPath = os.path.join( catchPath, 'include/' )
-versionPath = os.path.join( rootPath, "internal/catch_version.cpp" )
-definePath = os.path.join(rootPath, 'catch.hpp')
-readmePath = os.path.join( catchPath, "README.md" )
-cmakePath = os.path.join(catchPath, 'CMakeLists.txt')
-
-class Version:
- def __init__(self):
- f = open( versionPath, 'r' )
- for line in f:
- m = versionParser.match( line )
- if m:
- self.variableDecl = m.group(1)
- self.majorVersion = int(m.group(2))
- self.minorVersion = int(m.group(3))
- self.patchNumber = int(m.group(4))
- self.branchName = m.group(5)
- self.buildNumber = int(m.group(6))
- f.close()
-
- def nonDevelopRelease(self):
- if self.branchName != "":
- self.branchName = ""
- self.buildNumber = 0
- def developBuild(self):
- if self.branchName == "":
- self.branchName = "develop"
- self.buildNumber = 0
-
- def incrementBuildNumber(self):
- self.developBuild()
- self.buildNumber = self.buildNumber+1
-
- def incrementPatchNumber(self):
- self.nonDevelopRelease()
- self.patchNumber = self.patchNumber+1
-
- def incrementMinorVersion(self):
- self.nonDevelopRelease()
- self.patchNumber = 0
- self.minorVersion = self.minorVersion+1
-
- def incrementMajorVersion(self):
- self.nonDevelopRelease()
- self.patchNumber = 0
- self.minorVersion = 0
- self.majorVersion = self.majorVersion+1
-
- def getVersionString(self):
- versionString = '{0}.{1}.{2}'.format( self.majorVersion, self.minorVersion, self.patchNumber )
- if self.branchName != "":
- versionString = versionString + '-{0}.{1}'.format( self.branchName, self.buildNumber )
- return versionString
-
- def updateVersionFile(self):
- f = open( versionPath, 'r' )
- lines = []
- for line in f:
- m = versionParser.match( line )
- if m:
- lines.append( '{0}( {1}, {2}, {3}, "{4}", {5} );'.format( self.variableDecl, self.majorVersion, self.minorVersion, self.patchNumber, self.branchName, self.buildNumber ) )
- else:
- lines.append( line.rstrip() )
- f.close()
- f = open( versionPath, 'w' )
- for line in lines:
- f.write( line + "\n" )
-
-def updateReadmeFile(version):
- import updateWandbox
-
- downloadParser = re.compile( r'<a href=\"https://github.com/catchorg/Catch2/releases/download/v\d+\.\d+\.\d+/catch.hpp\">' )
- success, wandboxLink = updateWandbox.uploadFiles()
- if not success:
- print('Error when uploading to wandbox: {}'.format(wandboxLink))
- exit(1)
- f = open( readmePath, 'r' )
- lines = []
- for line in f:
- lines.append( line.rstrip() )
- f.close()
- f = open( readmePath, 'w' )
- for line in lines:
- line = downloadParser.sub( r'<a href="https://github.com/catchorg/Catch2/releases/download/v{0}/catch.hpp">'.format(version.getVersionString()) , line)
- if '[![Try online](https://img.shields.io/badge/try-online-blue.svg)]' in line:
- line = '[![Try online](https://img.shields.io/badge/try-online-blue.svg)]({0})'.format(wandboxLink)
- f.write( line + "\n" )
-
-
-def updateCmakeFile(version):
- with open(cmakePath, 'rb') as file:
- lines = file.readlines()
- replacementRegex = re.compile(b'project\\(Catch2 LANGUAGES CXX VERSION \\d+\\.\\d+\\.\\d+\\)')
- replacement = 'project(Catch2 LANGUAGES CXX VERSION {0})'.format(version.getVersionString()).encode('ascii')
- with open(cmakePath, 'wb') as file:
- for line in lines:
- file.write(replacementRegex.sub(replacement, line))
-
-
-def updateVersionDefine(version):
- # First member of the tuple is the compiled regex object, the second is replacement if it matches
- replacementRegexes = [(re.compile(b'#define CATCH_VERSION_MAJOR \\d+'),'#define CATCH_VERSION_MAJOR {}'.format(version.majorVersion).encode('ascii')),
- (re.compile(b'#define CATCH_VERSION_MINOR \\d+'),'#define CATCH_VERSION_MINOR {}'.format(version.minorVersion).encode('ascii')),
- (re.compile(b'#define CATCH_VERSION_PATCH \\d+'),'#define CATCH_VERSION_PATCH {}'.format(version.patchNumber).encode('ascii')),
- ]
- with open(definePath, 'rb') as file:
- lines = file.readlines()
- with open(definePath, 'wb') as file:
- for line in lines:
- for replacement in replacementRegexes:
- line = replacement[0].sub(replacement[1], line)
- file.write(line)
-
-
-def updateVersionPlaceholder(filename, version):
- with open(filename, 'rb') as file:
- lines = file.readlines()
- placeholderRegex = re.compile(b' in Catch X.Y.Z')
- replacement = ' in Catch {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii')
- with open(filename, 'wb') as file:
- for line in lines:
- file.write(placeholderRegex.sub(replacement, line))
-
-
-def updateDocumentationVersionPlaceholders(version):
- print('Updating version placeholder in documentation')
- docsPath = os.path.join(catchPath, 'docs/')
- for basePath, _, files in os.walk(docsPath):
- for file in files:
- if fnmatch.fnmatch(file, "*.md") and "contributing.md" != file:
- updateVersionPlaceholder(os.path.join(basePath, file), version)
-
-
-def performUpdates(version):
- # First update version file, so we can regenerate single header and
- # have it ready for upload to wandbox, when updating readme
- version.updateVersionFile()
- updateVersionDefine(version)
-
- import generateSingleHeader
- generateSingleHeader.generate(version)
-
- # Then copy the reporters to single include folder to keep them in sync
- # We probably should have some kind of convention to select which reporters need to be copied automagically,
- # but this works for now
- import shutil
- for rep in ('automake', 'tap', 'teamcity', 'sonarqube'):
- sourceFile = os.path.join(catchPath, 'include/reporters/catch_reporter_{}.hpp'.format(rep))
- destFile = os.path.join(catchPath, 'single_include', 'catch2', 'catch_reporter_{}.hpp'.format(rep))
- shutil.copyfile(sourceFile, destFile)
-
- updateReadmeFile(version)
- updateCmakeFile(version)
- updateDocumentationVersionPlaceholders(version)
diff --git a/scripts/releaseNotes.py b/scripts/releaseNotes.py
deleted file mode 100755
index 7f580e98..00000000
--- a/scripts/releaseNotes.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-
-import os
-import re
-import urllib2
-import json
-
-from scriptCommon import catchPath
-from scriptCommon import runAndCapture
-
-issueNumberRe = re.compile( r'(.*?)#([0-9]*)([^0-9]?.*)' )
-
-rootPath = os.path.join( catchPath, 'include/' )
-versionPath = os.path.join( rootPath, "internal/catch_version.hpp" )
-
-
-hashes = runAndCapture( ['git', 'log', '-2', '--format="%H"', versionPath] )
-lines = runAndCapture( ['git', 'log', hashes[1] + ".." + hashes[0], catchPath] )
-
-prevLine = ""
-messages = []
-dates = []
-issues = {}
-
-def getIssueTitle( issueNumber ):
- try:
- s = urllib2.urlopen("https://api.github.com/repos/philsquared/catch/issues/" + issueNumber ).read()
- except:
- return "#HTTP Error#"
-
- try:
- j = json.loads( s )
- return j["title"]
- except:
- return "#JSON Error#"
-
-for line in lines:
- if line.startswith( "commit"):
- pass
- elif line.startswith( "Author:"):
- pass
- elif line.startswith( "Date:"):
- dates.append( line[5:].lstrip() )
- elif line == "" and prevLine == "":
- pass
- else:
- prevLine = line
- match = issueNumberRe.match( line )
- line2 = ""
- while match:
- issueNumber = match.group(2)
- issue = '#{0} ("{1}")'.format( issueNumber, getIssueTitle( issueNumber ) )
- line2 = line2 + match.group(1) + issue
- match = issueNumberRe.match( match.group(3) )
- if line2 == "":
- messages.append( line )
- else:
- messages.append( line2 )
-
-print("All changes between {0} and {1}:\n".format( dates[-1], dates[0] ))
-
-for line in messages:
- print(line)
diff --git a/scripts/scriptCommon.py b/scripts/scriptCommon.py
deleted file mode 100644
index eadf9ff3..00000000
--- a/scripts/scriptCommon.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import os
-import sys
-import subprocess
-
-
-catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
-
-def getBuildExecutable():
- if os.name == 'nt':
- dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest.exe")
- return dir
- else:
- dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest")
- return dir
-
-
-def runAndCapture( args ):
- child = subprocess.Popen(" ".join( args ), shell=True, stdout=subprocess.PIPE)
- lines = []
- line = ""
- while True:
- out = child.stdout.read(1)
- if out == '' and child.poll():
- break
- if out != '':
- if out == '\n':
- lines.append( line )
- line = ""
- else:
- line = line + out
- return lines
diff --git a/scripts/updateDocumentToC.py b/scripts/updateDocumentToC.py
deleted file mode 100644
index 41b48752..00000000
--- a/scripts/updateDocumentToC.py
+++ /dev/null
@@ -1,449 +0,0 @@
-#!/usr/bin/env python3
-
-#
-# updateDocumentToC.py
-#
-# Insert table of contents at top of Catch markdown documents.
-#
-# This script is distributed under the GNU General Public License v3.0
-#
-# It is based on markdown-toclify version 1.7.1 by Sebastian Raschka,
-# https://github.com/rasbt/markdown-toclify
-#
-
-from __future__ import print_function
-
-import argparse
-import glob
-import os
-import re
-import sys
-
-from scriptCommon import catchPath
-
-# Configuration:
-
-minTocEntries = 4
-
-headingExcludeDefault = [1,3,4,5] # use level 2 headers for at default
-headingExcludeRelease = [1,3,4,5] # use level 1 headers for release-notes.md
-
-documentsDefault = os.path.join(os.path.relpath(catchPath), 'docs/*.md')
-releaseNotesName = 'release-notes.md'
-
-contentTitle = '**Contents**'
-contentLineNo = 4
-contentLineNdx = contentLineNo - 1
-
-# End configuration
-
-VALIDS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-&'
-
-def readLines(in_file):
- """Returns a list of lines from a input markdown file."""
-
- with open(in_file, 'r') as inf:
- in_contents = inf.read().split('\n')
- return in_contents
-
-def removeLines(lines, remove=('[[back to top]', '<a class="mk-toclify"')):
- """Removes existing [back to top] links and <a id> tags."""
-
- if not remove:
- return lines[:]
-
- out = []
- for l in lines:
- if l.startswith(remove):
- continue
- out.append(l)
- return out
-
-def removeToC(lines):
- """Removes existing table of contents starting at index contentLineNdx."""
- if not lines[contentLineNdx ].startswith(contentTitle):
- return lines[:]
-
- result_top = lines[:contentLineNdx]
-
- pos = contentLineNdx + 1
- while lines[pos].startswith('['):
- pos = pos + 1
-
- result_bottom = lines[pos + 1:]
-
- return result_top + result_bottom
-
-def dashifyHeadline(line):
- """
- Takes a header line from a Markdown document and
- returns a tuple of the
- '#'-stripped version of the head line,
- a string version for <a id=''></a> anchor tags,
- and the level of the headline as integer.
- E.g.,
- >>> dashifyHeadline('### some header lvl3')
- ('Some header lvl3', 'some-header-lvl3', 3)
-
- """
- stripped_right = line.rstrip('#')
- stripped_both = stripped_right.lstrip('#')
- level = len(stripped_right) - len(stripped_both)
- stripped_wspace = stripped_both.strip()
-
- # GitHub's sluggification works in an interesting way
- # 1) '+', '/', '(', ')' and so on are just removed
- # 2) spaces are converted into '-' directly
- # 3) multiple -- are not collapsed
-
- dashified = ''
- for c in stripped_wspace:
- if c in VALIDS:
- dashified += c.lower()
- elif c.isspace():
- dashified += '-'
- else:
- # Unknown symbols are just removed
- continue
-
- return [stripped_wspace, dashified, level]
-
-def tagAndCollect(lines, id_tag=True, back_links=False, exclude_h=None):
- """
- Gets headlines from the markdown document and creates anchor tags.
-
- Keyword arguments:
- lines: a list of sublists where every sublist
- represents a line from a Markdown document.
- id_tag: if true, creates inserts a the <a id> tags (not req. by GitHub)
- back_links: if true, adds "back to top" links below each headline
- exclude_h: header levels to exclude. E.g., [2, 3]
- excludes level 2 and 3 headings.
-
- Returns a tuple of 2 lists:
- 1st list:
- A modified version of the input list where
- <a id="some-header"></a> anchor tags where inserted
- above the header lines (if github is False).
-
- 2nd list:
- A list of 3-value sublists, where the first value
- represents the heading, the second value the string
- that was inserted assigned to the IDs in the anchor tags,
- and the third value is an integer that represents the headline level.
- E.g.,
- [['some header lvl3', 'some-header-lvl3', 3], ...]
-
- """
- out_contents = []
- headlines = []
- for l in lines:
- saw_headline = False
-
- orig_len = len(l)
- l_stripped = l.lstrip()
-
- if l_stripped.startswith(('# ', '## ', '### ', '#### ', '##### ', '###### ')):
-
- # comply with new markdown standards
-
- # not a headline if '#' not followed by whitespace '##no-header':
- if not l.lstrip('#').startswith(' '):
- continue
- # not a headline if more than 6 '#':
- if len(l) - len(l.lstrip('#')) > 6:
- continue
- # headers can be indented by at most 3 spaces:
- if orig_len - len(l_stripped) > 3:
- continue
-
- # ignore empty headers
- if not set(l) - {'#', ' '}:
- continue
-
- saw_headline = True
- dashified = dashifyHeadline(l)
-
- if not exclude_h or not dashified[-1] in exclude_h:
- if id_tag:
- id_tag = '<a class="mk-toclify" id="%s"></a>'\
- % (dashified[1])
- out_contents.append(id_tag)
- headlines.append(dashified)
-
- out_contents.append(l)
- if back_links and saw_headline:
- out_contents.append('[[back to top](#table-of-contents)]')
- return out_contents, headlines
-
-def positioningHeadlines(headlines):
- """
- Strips unnecessary whitespaces/tabs if first header is not left-aligned
- """
- left_just = False
- for row in headlines:
- if row[-1] == 1:
- left_just = True
- break
- if not left_just:
- for row in headlines:
- row[-1] -= 1
- return headlines
-
-def createToc(headlines, hyperlink=True, top_link=False, no_toc_header=False):
- """
- Creates the table of contents from the headline list
- that was returned by the tagAndCollect function.
-
- Keyword Arguments:
- headlines: list of lists
- e.g., ['Some header lvl3', 'some-header-lvl3', 3]
- hyperlink: Creates hyperlinks in Markdown format if True,
- e.g., '- [Some header lvl1](#some-header-lvl1)'
- top_link: if True, add a id tag for linking the table
- of contents itself (for the back-to-top-links)
- no_toc_header: suppresses TOC header if True.
-
- Returns a list of headlines for a table of contents
- in Markdown format,
- e.g., [' - [Some header lvl3](#some-header-lvl3)', ...]
-
- """
- processed = []
- if not no_toc_header:
- if top_link:
- processed.append('<a class="mk-toclify" id="table-of-contents"></a>\n')
- processed.append(contentTitle + '<br>')
-
- for line in headlines:
- if hyperlink:
- item = '[%s](#%s)' % (line[0], line[1])
- else:
- item = '%s- %s' % ((line[2]-1)*' ', line[0])
- processed.append(item + '<br>')
- processed.append('\n')
- return processed
-
-def buildMarkdown(toc_headlines, body, spacer=0, placeholder=None):
- """
- Returns a string with the Markdown output contents incl.
- the table of contents.
-
- Keyword arguments:
- toc_headlines: lines for the table of contents
- as created by the createToc function.
- body: contents of the Markdown file including
- ID-anchor tags as returned by the
- tagAndCollect function.
- spacer: Adds vertical space after the table
- of contents. Height in pixels.
- placeholder: If a placeholder string is provided, the placeholder
- will be replaced by the TOC instead of inserting the TOC at
- the top of the document
-
- """
- if spacer:
- spacer_line = ['\n<div style="height:%spx;"></div>\n' % (spacer)]
- toc_markdown = "\n".join(toc_headlines + spacer_line)
- else:
- toc_markdown = "\n".join(toc_headlines)
-
- if placeholder:
- body_markdown = "\n".join(body)
- markdown = body_markdown.replace(placeholder, toc_markdown)
- else:
- body_markdown_p1 = "\n".join(body[:contentLineNdx ]) + '\n'
- body_markdown_p2 = "\n".join(body[ contentLineNdx:])
- markdown = body_markdown_p1 + toc_markdown + body_markdown_p2
-
- return markdown
-
-def outputMarkdown(markdown_cont, output_file):
- """
- Writes to an output file if `outfile` is a valid path.
-
- """
- if output_file:
- with open(output_file, 'w') as out:
- out.write(markdown_cont)
-
-def markdownToclify(
- input_file,
- output_file=None,
- min_toc_len=2,
- github=False,
- back_to_top=False,
- nolink=False,
- no_toc_header=False,
- spacer=0,
- placeholder=None,
- exclude_h=None):
- """ Function to add table of contents to markdown files.
-
- Parameters
- -----------
- input_file: str
- Path to the markdown input file.
-
- output_file: str (default: None)
- Path to the markdown output file.
-
- min_toc_len: int (default: 2)
- Miniumum number of entries to create a table of contents for.
-
- github: bool (default: False)
- Uses GitHub TOC syntax if True.
-
- back_to_top: bool (default: False)
- Inserts back-to-top links below headings if True.
-
- nolink: bool (default: False)
- Creates the table of contents without internal links if True.
-
- no_toc_header: bool (default: False)
- Suppresses the Table of Contents header if True
-
- spacer: int (default: 0)
- Inserts horizontal space (in pixels) after the table of contents.
-
- placeholder: str (default: None)
- Inserts the TOC at the placeholder string instead
- of inserting the TOC at the top of the document.
-
- exclude_h: list (default None)
- Excludes header levels, e.g., if [2, 3], ignores header
- levels 2 and 3 in the TOC.
-
- Returns
- -----------
- changed: Boolean
- True if the file has been updated, False otherwise.
-
- """
- cleaned_contents = removeLines(
- removeToC(readLines(input_file)),
- remove=('[[back to top]', '<a class="mk-toclify"'))
-
- processed_contents, raw_headlines = tagAndCollect(
- cleaned_contents,
- id_tag=not github,
- back_links=back_to_top,
- exclude_h=exclude_h)
-
- # add table of contents?
- if len(raw_headlines) < min_toc_len:
- processed_headlines = []
- else:
- leftjustified_headlines = positioningHeadlines(raw_headlines)
-
- processed_headlines = createToc(
- leftjustified_headlines,
- hyperlink=not nolink,
- top_link=not nolink and not github,
- no_toc_header=no_toc_header)
-
- if nolink:
- processed_contents = cleaned_contents
-
- cont = buildMarkdown(
- toc_headlines=processed_headlines,
- body=processed_contents,
- spacer=spacer,
- placeholder=placeholder)
-
- if output_file:
- outputMarkdown(cont, output_file)
-
-def isReleaseNotes(f):
- return os.path.basename(f) == releaseNotesName
-
-def excludeHeadingsFor(f):
- return headingExcludeRelease if isReleaseNotes(f) else headingExcludeDefault
-
-def updateSingleDocumentToC(input_file, min_toc_len, verbose=False):
- """Add or update table of contents in specified file. Return 1 if file changed, 0 otherwise."""
- if verbose :
- print( 'file: {}'.format(input_file))
-
- output_file = input_file + '.tmp'
-
- markdownToclify(
- input_file=input_file,
- output_file=output_file,
- min_toc_len=min_toc_len,
- github=True,
- back_to_top=False,
- nolink=False,
- no_toc_header=False,
- spacer=False,
- placeholder=False,
- exclude_h=excludeHeadingsFor(input_file))
-
- # prevent race-condition (Python 3.3):
- if sys.version_info >= (3, 3):
- os.replace(output_file, input_file)
- else:
- os.remove(input_file)
- os.rename(output_file, input_file)
-
- return 1
-
-def updateDocumentToC(paths, min_toc_len, verbose):
- """Add or update table of contents to specified paths. Return number of changed files"""
- n = 0
- for g in paths:
- for f in glob.glob(g):
- if os.path.isfile(f):
- n = n + updateSingleDocumentToC(input_file=f, min_toc_len=min_toc_len, verbose=verbose)
- return n
-
-def updateDocumentToCMain():
- """Add or update table of contents to specified paths."""
-
- parser = argparse.ArgumentParser(
- description='Add or update table of contents in markdown documents.',
- epilog="""""",
- formatter_class=argparse.RawTextHelpFormatter)
-
- parser.add_argument(
- 'Input',
- metavar='file',
- type=str,
- nargs=argparse.REMAINDER,
- help='files to process, at default: docs/*.md')
-
- parser.add_argument(
- '-v', '--verbose',
- action='store_true',
- help='report the name of the file being processed')
-
- parser.add_argument(
- '--min-toc-entries',
- dest='minTocEntries',
- default=minTocEntries,
- type=int,
- metavar='N',
- help='the minimum number of entries to create a table of contents for [{default}]'.format(default=minTocEntries))
-
- parser.add_argument(
- '--remove-toc',
- action='store_const',
- dest='minTocEntries',
- const=99,
- help='remove all tables of contents')
-
- args = parser.parse_args()
-
- paths = args.Input if args.Input else [documentsDefault]
-
- changedFiles = updateDocumentToC(paths=paths, min_toc_len=args.minTocEntries, verbose=args.verbose)
-
- if changedFiles > 0:
- print( "Processed table of contents in " + str(changedFiles) + " file(s)" )
- else:
- print( "No table of contents added or updated" )
-
-if __name__ == '__main__':
- updateDocumentToCMain()
-
-# end of file
diff --git a/scripts/updateWandbox.py b/scripts/updateWandbox.py
deleted file mode 100644
index 3668da52..00000000
--- a/scripts/updateWandbox.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python3
-
-import json
-import os
-import urllib.request
-import urllib.parse
-
-
-from scriptCommon import catchPath
-
-def upload(options):
-# request_blah = urllib.request.Request('https://
-
- request = urllib.request.Request('https://melpon.org/wandbox/api/compile.json', method='POST')
- json_bytes = json.dumps(options).encode('utf-8')
- request.add_header('Content-Type', 'application/json; charset=utf-8')
- request.add_header('Content-Length', len(json_bytes))
- response = urllib.request.urlopen(request, json_bytes)
- return json.loads(response.read().decode('utf-8'))
-
-main_file = '''
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
-#include "catch.hpp"
-
-unsigned int Factorial( unsigned int number ) {
- return number <= 1 ? number : Factorial(number-1)*number;
-}
-
-TEST_CASE( "Factorials are computed", "[factorial]" ) {
- REQUIRE( Factorial(1) == 1 );
- REQUIRE( Factorial(2) == 2 );
- REQUIRE( Factorial(3) == 6 );
- REQUIRE( Factorial(10) == 3628800 );
-}
-'''
-
-def uploadFiles():
- response = upload({
- 'compiler': 'gcc-head',
- 'code': main_file,
- 'codes': [{
- 'file': 'catch.hpp',
- 'code': open(os.path.join(catchPath, 'single_include', 'catch2', 'catch.hpp')).read()
- }],
- 'options': 'c++11,cpp-no-pedantic,boost-nothing',
- 'compiler-option-raw': '-DCATCH_CONFIG_FAST_COMPILE',
- 'save': True
- })
-
- if 'url' in response and 'compiler_error' not in response:
- return True, response['url']
- else:
- return False, response
diff --git a/single_include/catch2/catch.hpp b/single_include/catch2/catch.hpp
deleted file mode 100644
index f57d7f43..00000000
--- a/single_include/catch2/catch.hpp
+++ /dev/null
@@ -1,17620 +0,0 @@
-/*
- * Catch v2.11.2
- * Generated: 2020-03-19 12:35:04.038733
- * ----------------------------------------------------------
- * This file has been merged from multiple headers. Please don't edit it directly
- * Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-// start catch.hpp
-
-
-#define CATCH_VERSION_MAJOR 2
-#define CATCH_VERSION_MINOR 11
-#define CATCH_VERSION_PATCH 2
-
-#ifdef __clang__
-# pragma clang system_header
-#elif defined __GNUC__
-# pragma GCC system_header
-#endif
-
-// start catch_suppress_warnings.h
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(push)
-# pragma warning(disable: 161 1682)
-# else // __ICC
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wpadded"
-# pragma clang diagnostic ignored "-Wswitch-enum"
-# pragma clang diagnostic ignored "-Wcovered-switch-default"
-# endif
-#elif defined __GNUC__
- // Because REQUIREs trigger GCC's -Wparentheses, and because still
- // supported version of g++ have only buggy support for _Pragmas,
- // Wparentheses have to be suppressed globally.
-# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details
-
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wunused-variable"
-# pragma GCC diagnostic ignored "-Wpadded"
-#endif
-// end catch_suppress_warnings.h
-#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
-# define CATCH_IMPL
-# define CATCH_CONFIG_ALL_PARTS
-#endif
-
-// In the impl file, we want to have access to all parts of the headers
-// Can also be used to sanely support PCHs
-#if defined(CATCH_CONFIG_ALL_PARTS)
-# define CATCH_CONFIG_EXTERNAL_INTERFACES
-# if defined(CATCH_CONFIG_DISABLE_MATCHERS)
-# undef CATCH_CONFIG_DISABLE_MATCHERS
-# endif
-# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-# endif
-#endif
-
-#if !defined(CATCH_CONFIG_IMPL_ONLY)
-// start catch_platform.h
-
-#ifdef __APPLE__
-# include <TargetConditionals.h>
-# if TARGET_OS_OSX == 1
-# define CATCH_PLATFORM_MAC
-# elif TARGET_OS_IPHONE == 1
-# define CATCH_PLATFORM_IPHONE
-# endif
-
-#elif defined(linux) || defined(__linux) || defined(__linux__)
-# define CATCH_PLATFORM_LINUX
-
-#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
-# define CATCH_PLATFORM_WINDOWS
-#endif
-
-// end catch_platform.h
-
-#ifdef CATCH_IMPL
-# ifndef CLARA_CONFIG_MAIN
-# define CLARA_CONFIG_MAIN_NOT_DEFINED
-# define CLARA_CONFIG_MAIN
-# endif
-#endif
-
-// start catch_user_interfaces.h
-
-namespace Catch {
- unsigned int rngSeed();
-}
-
-// end catch_user_interfaces.h
-// start catch_tag_alias_autoregistrar.h
-
-// start catch_common.h
-
-// start catch_compiler_capabilities.h
-
-// Detect a number of compiler features - by compiler
-// The following features are defined:
-//
-// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
-// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
-// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
-// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled?
-// ****************
-// Note to maintainers: if new toggles are added please document them
-// in configuration.md, too
-// ****************
-
-// In general each macro has a _NO_<feature name> form
-// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature.
-// Many features, at point of detection, define an _INTERNAL_ macro, so they
-// can be combined, en-mass, with the _NO_ forms later.
-
-#ifdef __cplusplus
-
-# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
-# define CATCH_CPP14_OR_GREATER
-# endif
-
-# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
-# define CATCH_CPP17_OR_GREATER
-# endif
-
-#endif
-
-#if defined(CATCH_CPP17_OR_GREATER)
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif
-
-// We have to avoid both ICC and Clang, because they try to mask themselves
-// as gcc, and we want only GCC in this block
-#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
-
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
-
-#endif
-
-#if defined(__clang__)
-
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
-
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
-
-# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
- _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
-
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
-
-#endif // __clang__
-
-////////////////////////////////////////////////////////////////////////////////
-// Assume that non-Windows platforms support posix signals by default
-#if !defined(CATCH_PLATFORM_WINDOWS)
- #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// We know some environments not to support full POSIX signals
-#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
- #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
-#endif
-
-#ifdef __OS400__
-# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
-# define CATCH_CONFIG_COLOUR_NONE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Android somehow still does not support std::to_string
-#if defined(__ANDROID__)
-# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
-# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Not all Windows environments support SEH properly
-#if defined(__MINGW32__)
-# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// PS4
-#if defined(__ORBIS__)
-# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Cygwin
-#ifdef __CYGWIN__
-
-// Required for some versions of Cygwin to declare gettimeofday
-// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
-# define _BSD_SOURCE
-// some versions of cygwin (most) do not support std::to_string. Use the libstd check.
-// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
-# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
- && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
-
-# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
-
-# endif
-#endif // __CYGWIN__
-
-////////////////////////////////////////////////////////////////////////////////
-// Visual C++
-#if defined(_MSC_VER)
-
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
-
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)sizeof(__VA_ARGS__)
-
-# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-# endif
-
-// Universal Windows platform does not support SEH
-// Or console colours (or console at all...)
-# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
-# define CATCH_CONFIG_COLOUR_NONE
-# else
-# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
-# endif
-
-// MSVC traditional preprocessor needs some workaround for __VA_ARGS__
-// _MSVC_TRADITIONAL == 0 means new conformant preprocessor
-// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
-# if !defined(__clang__) // Handle Clang masquerading for msvc
-# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
-# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-# endif // MSVC_TRADITIONAL
-# endif // __clang__
-
-#endif // _MSC_VER
-
-#if defined(_REENTRANT) || defined(_MSC_VER)
-// Enable async processing, as -pthread is specified or no additional linking is required
-# define CATCH_INTERNAL_CONFIG_USE_ASYNC
-#endif // _MSC_VER
-
-////////////////////////////////////////////////////////////////////////////////
-// Check if we are compiled with -fno-exceptions or equivalent
-#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
-# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// DJGPP
-#ifdef __DJGPP__
-# define CATCH_INTERNAL_CONFIG_NO_WCHAR
-#endif // __DJGPP__
-
-////////////////////////////////////////////////////////////////////////////////
-// Embarcadero C++Build
-#if defined(__BORLANDC__)
- #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-
-// Use of __COUNTER__ is suppressed during code analysis in
-// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly
-// handled by it.
-// Otherwise all supported compilers support COUNTER macro,
-// but user still might want to turn it off
-#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L )
- #define CATCH_INTERNAL_CONFIG_COUNTER
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-
-// RTX is a special version of Windows that is real time.
-// This means that it is detected as Windows, but does not provide
-// the same set of capabilities as real Windows does.
-#if defined(UNDER_RTSS) || defined(RTX64_BUILD)
- #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
- #define CATCH_INTERNAL_CONFIG_NO_ASYNC
- #define CATCH_CONFIG_COLOUR_NONE
-#endif
-
-#if !defined(_GLIBCXX_USE_C99_MATH_TR1)
-#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
-#endif
-
-// Various stdlib support checks that require __has_include
-#if defined(__has_include)
- // Check if string_view is available and usable
- #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
- #endif
-
- // Check if optional is available and usable
- # if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
- # endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
-
- // Check if byte is available and usable
- # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
- # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
-
- // Check if variant is available and usable
- # if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
- # if defined(__clang__) && (__clang_major__ < 8)
- // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
- // fix should be in clang 8, workaround in libstdc++ 8.2
- # include <ciso646>
- # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
- # define CATCH_CONFIG_NO_CPP17_VARIANT
- # else
- # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
- # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
- # else
- # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
- # endif // defined(__clang__) && (__clang_major__ < 8)
- # endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
-#endif // defined(__has_include)
-
-#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
-# define CATCH_CONFIG_COUNTER
-#endif
-#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)
-# define CATCH_CONFIG_WINDOWS_SEH
-#endif
-// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
-#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)
-# define CATCH_CONFIG_POSIX_SIGNALS
-#endif
-// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions.
-#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR)
-# define CATCH_CONFIG_WCHAR
-#endif
-
-#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
-# define CATCH_CONFIG_CPP11_TO_STRING
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
-# define CATCH_CONFIG_CPP17_OPTIONAL
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
-# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
-# define CATCH_CONFIG_CPP17_STRING_VIEW
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
-# define CATCH_CONFIG_CPP17_VARIANT
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
-# define CATCH_CONFIG_CPP17_BYTE
-#endif
-
-#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
-# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
-#endif
-
-#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)
-# define CATCH_CONFIG_NEW_CAPTURE
-#endif
-
-#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-# define CATCH_CONFIG_DISABLE_EXCEPTIONS
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
-# define CATCH_CONFIG_POLYFILL_ISNAN
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
-# define CATCH_CONFIG_USE_ASYNC
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE)
-# define CATCH_CONFIG_ANDROID_LOGWRITE
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
-# define CATCH_CONFIG_GLOBAL_NEXTAFTER
-#endif
-
-// Even if we do not think the compiler has that warning, we still have
-// to provide a macro that can be used by the code.
-#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
-#endif
-#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION)
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
-#endif
-
-// The goal of this macro is to avoid evaluation of the arguments, but
-// still have the compiler warn on problems inside...
-#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN)
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...)
-#endif
-
-#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
-# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#elif defined(__clang__) && (__clang_major__ < 5)
-# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#endif
-
-#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#endif
-
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-#define CATCH_TRY if ((true))
-#define CATCH_CATCH_ALL if ((false))
-#define CATCH_CATCH_ANON(type) if ((false))
-#else
-#define CATCH_TRY try
-#define CATCH_CATCH_ALL catch (...)
-#define CATCH_CATCH_ANON(type) catch (type)
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
-#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#endif
-
-// end catch_compiler_capabilities.h
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
-#ifdef CATCH_CONFIG_COUNTER
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
-#else
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
-#endif
-
-#include <iosfwd>
-#include <string>
-#include <cstdint>
-
-// We need a dummy global operator<< so we can bring it into Catch namespace later
-struct Catch_global_namespace_dummy {};
-std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
-
-namespace Catch {
-
- struct CaseSensitive { enum Choice {
- Yes,
- No
- }; };
-
- class NonCopyable {
- NonCopyable( NonCopyable const& ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable& operator = ( NonCopyable const& ) = delete;
- NonCopyable& operator = ( NonCopyable && ) = delete;
-
- protected:
- NonCopyable();
- virtual ~NonCopyable();
- };
-
- struct SourceLineInfo {
-
- SourceLineInfo() = delete;
- SourceLineInfo( char const* _file, std::size_t _line ) noexcept
- : file( _file ),
- line( _line )
- {}
-
- SourceLineInfo( SourceLineInfo const& other ) = default;
- SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
- SourceLineInfo( SourceLineInfo&& ) noexcept = default;
- SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
-
- bool empty() const noexcept { return file[0] == '\0'; }
- bool operator == ( SourceLineInfo const& other ) const noexcept;
- bool operator < ( SourceLineInfo const& other ) const noexcept;
-
- char const* file;
- std::size_t line;
- };
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
-
- // Bring in operator<< from global namespace into Catch namespace
- // This is necessary because the overload of operator<< above makes
- // lookup stop at namespace Catch
- using ::operator<<;
-
- // Use this in variadic streaming macros to allow
- // >> +StreamEndStop
- // as well as
- // >> stuff +StreamEndStop
- struct StreamEndStop {
- std::string operator+() const;
- };
- template<typename T>
- T const& operator + ( T const& value, StreamEndStop ) {
- return value;
- }
-}
-
-#define CATCH_INTERNAL_LINEINFO \
- ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
-
-// end catch_common.h
-namespace Catch {
-
- struct RegistrarForTagAliases {
- RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
- };
-
-} // end namespace Catch
-
-#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-// end catch_tag_alias_autoregistrar.h
-// start catch_test_registry.h
-
-// start catch_interfaces_testcase.h
-
-#include <vector>
-
-namespace Catch {
-
- class TestSpec;
-
- struct ITestInvoker {
- virtual void invoke () const = 0;
- virtual ~ITestInvoker();
- };
-
- class TestCase;
- struct IConfig;
-
- struct ITestCaseRegistry {
- virtual ~ITestCaseRegistry();
- virtual std::vector<TestCase> const& getAllTests() const = 0;
- virtual std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const = 0;
- };
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config );
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
-
-}
-
-// end catch_interfaces_testcase.h
-// start catch_stringref.h
-
-#include <cstddef>
-#include <string>
-#include <iosfwd>
-#include <cassert>
-
-namespace Catch {
-
- /// A non-owning string class (similar to the forthcoming std::string_view)
- /// Note that, because a StringRef may be a substring of another string,
- /// it may not be null terminated.
- class StringRef {
- public:
- using size_type = std::size_t;
- using const_iterator = const char*;
-
- private:
- static constexpr char const* const s_empty = "";
-
- char const* m_start = s_empty;
- size_type m_size = 0;
-
- public: // construction
- constexpr StringRef() noexcept = default;
-
- StringRef( char const* rawChars ) noexcept;
-
- constexpr StringRef( char const* rawChars, size_type size ) noexcept
- : m_start( rawChars ),
- m_size( size )
- {}
-
- StringRef( std::string const& stdString ) noexcept
- : m_start( stdString.c_str() ),
- m_size( stdString.size() )
- {}
-
- explicit operator std::string() const {
- return std::string(m_start, m_size);
- }
-
- public: // operators
- auto operator == ( StringRef const& other ) const noexcept -> bool;
- auto operator != (StringRef const& other) const noexcept -> bool {
- return !(*this == other);
- }
-
- auto operator[] ( size_type index ) const noexcept -> char {
- assert(index < m_size);
- return m_start[index];
- }
-
- public: // named queries
- constexpr auto empty() const noexcept -> bool {
- return m_size == 0;
- }
- constexpr auto size() const noexcept -> size_type {
- return m_size;
- }
-
- // Returns the current start pointer. If the StringRef is not
- // null-terminated, throws std::domain_exception
- auto c_str() const -> char const*;
-
- public: // substrings and searches
- // Returns a substring of [start, start + length).
- // If start + length > size(), then the substring is [start, size()).
- // If start > size(), then the substring is empty.
- auto substr( size_type start, size_type length ) const noexcept -> StringRef;
-
- // Returns the current start pointer. May not be null-terminated.
- auto data() const noexcept -> char const*;
-
- constexpr auto isNullTerminated() const noexcept -> bool {
- return m_start[m_size] == '\0';
- }
-
- public: // iterators
- constexpr const_iterator begin() const { return m_start; }
- constexpr const_iterator end() const { return m_start + m_size; }
- };
-
- auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
- auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
-
- constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
- return StringRef( rawChars, size );
- }
-} // namespace Catch
-
-constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
- return Catch::StringRef( rawChars, size );
-}
-
-// end catch_stringref.h
-// start catch_preprocessor.hpp
-
-
-#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__
-#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__)))
-
-#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__
-// MSVC needs more evaluations
-#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__)))
-#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__))
-#else
-#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__)
-#endif
-
-#define CATCH_REC_END(...)
-#define CATCH_REC_OUT
-
-#define CATCH_EMPTY()
-#define CATCH_DEFER(id) id CATCH_EMPTY()
-
-#define CATCH_REC_GET_END2() 0, CATCH_REC_END
-#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2
-#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1
-#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT
-#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0)
-#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next)
-
-#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
-
-#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__ )
-#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__ )
-#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__ )
-
-// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results,
-// and passes userdata as the first parameter to each invocation,
-// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c)
-#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
-
-#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
-
-#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param)
-#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__
-#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__
-#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
-#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__)
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__
-#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param))
-#else
-// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
-#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__)
-#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__
-#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1)
-#endif
-
-#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__
-#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name)
-
-#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__)
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>())
-#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))
-#else
-#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>()))
-#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)))
-#endif
-
-#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\
- CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__)
-
-#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0)
-#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1)
-#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2)
-#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)
-#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)
-#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)
-#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, _4, _5, _6)
-#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)
-#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)
-#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)
-#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)
-
-#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
-
-#define INTERNAL_CATCH_TYPE_GEN\
- template<typename...> struct TypeList {};\
- template<typename...Ts>\
- constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
- template<template<typename...> class...> struct TemplateTypeList{};\
- template<template<typename...> class...Cs>\
- constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
- template<typename...>\
- struct append;\
- template<typename...>\
- struct rewrap;\
- template<template<typename...> class, typename...>\
- struct create;\
- template<template<typename...> class, typename>\
- struct convert;\
- \
- template<typename T> \
- struct append<T> { using type = T; };\
- template< template<typename...> class L1, typename...E1, template<typename...> class L2, typename...E2, typename...Rest>\
- struct append<L1<E1...>, L2<E2...>, Rest...> { using type = typename append<L1<E1...,E2...>, Rest...>::type; };\
- template< template<typename...> class L1, typename...E1, typename...Rest>\
- struct append<L1<E1...>, TypeList<mpl_::na>, Rest...> { using type = L1<E1...>; };\
- \
- template< template<typename...> class Container, template<typename...> class List, typename...elems>\
- struct rewrap<TemplateTypeList<Container>, List<elems...>> { using type = TypeList<Container<elems...>>; };\
- template< template<typename...> class Container, template<typename...> class List, class...Elems, typename...Elements>\
- struct rewrap<TemplateTypeList<Container>, List<Elems...>, Elements...> { using type = typename append<TypeList<Container<Elems...>>, typename rewrap<TemplateTypeList<Container>, Elements...>::type>::type; };\
- \
- template<template <typename...> class Final, template< typename...> class...Containers, typename...Types>\
- struct create<Final, TemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<TemplateTypeList<Containers>, Types...>::type...>::type; };\
- template<template <typename...> class Final, template <typename...> class List, typename...Ts>\
- struct convert<Final, List<Ts...>> { using type = typename append<Final<>,TypeList<Ts>...>::type; };
-
-#define INTERNAL_CATCH_NTTP_1(signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> struct Nttp{};\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> { return {}; } \
- template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...> struct NttpTemplateTypeList{};\
- template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Cs>\
- constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList<Cs...> { return {}; } \
- \
- template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>> { using type = TypeList<Container<__VA_ARGS__>>; };\
- template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature), typename...Elements>\
- struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>, Elements...> { using type = typename append<TypeList<Container<__VA_ARGS__>>, typename rewrap<NttpTemplateTypeList<Container>, Elements...>::type>::type; };\
- template<template <typename...> class Final, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Containers, typename...Types>\
- struct create<Final, NttpTemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<NttpTemplateTypeList<Containers>, Types...>::type...>::type; };
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST0(TestName)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST1(TestName, signature)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_X(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-
-#define INTERNAL_CATCH_DEFINE_SIG_TEST0(TestName)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST1(TestName, signature)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_X(TestName, signature,...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-
-#define INTERNAL_CATCH_NTTP_REGISTER0(TestFunc, signature)\
- template<typename Type>\
- void reg_test(TypeList<Type>, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<Type>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER(TestFunc, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- void reg_test(Nttp<__VA_ARGS__>, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<__VA_ARGS__>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER_METHOD0(TestName, signature, ...)\
- template<typename Type>\
- void reg_test(TypeList<Type>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestName<Type>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER_METHOD(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- void reg_test(Nttp<__VA_ARGS__>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestName<__VA_ARGS__>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
- }
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0(TestName, ClassName)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1(TestName, ClassName, signature)\
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<TestType> { \
- void test();\
- }
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X(TestName, ClassName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<__VA_ARGS__> { \
- void test();\
- }
-
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0(TestName)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1(TestName, signature)\
- template<typename TestType> \
- void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<TestType>::test()
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
- void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<__VA_ARGS__>::test()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_NTTP_0
-#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)
-#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__)
-#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__)
-#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__)
-#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__)
-#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__)
-#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__)
-#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__)
-#else
-#define INTERNAL_CATCH_NTTP_0(signature)
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#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__))
-#endif
-
-// end catch_preprocessor.hpp
-// start catch_meta.hpp
-
-
-#include <type_traits>
-
-namespace Catch {
- template<typename T>
- struct always_false : std::false_type {};
-
- template <typename> struct true_given : std::true_type {};
- struct is_callable_tester {
- template <typename Fun, typename... Args>
- true_given<decltype(std::declval<Fun>()(std::declval<Args>()...))> static test(int);
- template <typename...>
- std::false_type static test(...);
- };
-
- template <typename T>
- struct is_callable;
-
- template <typename Fun, typename... Args>
- struct is_callable<Fun(Args...)> : decltype(is_callable_tester::test<Fun, Args...>(0)) {};
-
-#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
- // std::result_of is deprecated in C++17 and removed in C++20. Hence, it is
- // replaced with std::invoke_result here. Also *_t format is preferred over
- // typename *::type format.
- template <typename Func, typename U>
- using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U>>>;
-#else
- template <typename Func, typename U>
- using FunctionReturnType = typename std::remove_reference<typename std::remove_cv<typename std::result_of<Func(U)>::type>::type>::type;
-#endif
-
-} // namespace Catch
-
-namespace mpl_{
- struct na;
-}
-
-// end catch_meta.hpp
-namespace Catch {
-
-template<typename C>
-class TestInvokerAsMethod : public ITestInvoker {
- void (C::*m_testAsMethod)();
-public:
- TestInvokerAsMethod( void (C::*testAsMethod)() ) noexcept : m_testAsMethod( testAsMethod ) {}
-
- void invoke() const override {
- C obj;
- (obj.*m_testAsMethod)();
- }
-};
-
-auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker*;
-
-template<typename C>
-auto makeTestInvoker( void (C::*testAsMethod)() ) noexcept -> ITestInvoker* {
- return new(std::nothrow) TestInvokerAsMethod<C>( testAsMethod );
-}
-
-struct NameAndTags {
- NameAndTags( StringRef const& name_ = StringRef(), StringRef const& tags_ = StringRef() ) noexcept;
- StringRef name;
- StringRef tags;
-};
-
-struct AutoReg : NonCopyable {
- AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept;
- ~AutoReg();
-};
-
-} // end namespace Catch
-
-#if defined(CATCH_CONFIG_DISABLE)
- #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
- namespace{ \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
- void test(); \
- }; \
- } \
- void TestName::test()
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( TestName, TestFunc, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature))
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
- namespace{ \
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
- INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- } \
- } \
- INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
- #endif
-#endif
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
- static void TestName(); \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE( ... ) \
- INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &QualifiedMethod ), CATCH_INTERNAL_LINEINFO, "&" #QualifiedMethod, Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
- void test(); \
- }; \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
- } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- void TestName::test()
- #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
- INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, Signature, ... )\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
- INTERNAL_CATCH_TYPE_GEN\
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- INTERNAL_CATCH_NTTP_REG_GEN(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types> \
- struct TestName{\
- TestName(){\
- int index = 0; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
- using expander = int[];\
- (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
- return 0;\
- }();\
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> static void TestFuncName(); \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
- INTERNAL_CATCH_TYPE_GEN \
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
- template<typename... Types> \
- struct TestName { \
- void reg_tests() { \
- int index = 0; \
- using expander = int[]; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
- constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
- constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
- (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++, 0)... };/* NOLINT */\
- } \
- }; \
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
- 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; \
- TestInit t; \
- t.reg_tests(); \
- return 0; \
- }(); \
- } \
- } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- static void TestFuncName()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T,__VA_ARGS__)
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__)
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> static void TestFunc(); \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
- INTERNAL_CATCH_TYPE_GEN\
- template<typename... Types> \
- struct TestName { \
- void reg_tests() { \
- int index = 0; \
- using expander = int[]; \
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */\
- } \
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
- using TestInit = typename convert<TestName, TmplList>::type; \
- TestInit t; \
- t.reg_tests(); \
- return 0; \
- }(); \
- }}\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- static void TestFunc()
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList) \
- INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, TmplList )
-
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
- INTERNAL_CATCH_TYPE_GEN\
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types> \
- struct TestNameClass{\
- TestNameClass(){\
- int index = 0; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
- using expander = int[];\
- (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- TestNameClass<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
- return 0;\
- }();\
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
- void test();\
- };\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) {\
- INTERNAL_CATCH_TYPE_GEN \
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types>\
- struct TestNameClass{\
- void reg_tests(){\
- int index = 0;\
- using expander = int[];\
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
- constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
- constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
- (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++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- 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;\
- TestInit t;\
- t.reg_tests();\
- return 0;\
- }(); \
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- void TestName<TestType>::test()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, TmplList) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
- void test();\
- };\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
- INTERNAL_CATCH_TYPE_GEN\
- template<typename...Types>\
- struct TestNameClass{\
- void reg_tests(){\
- int index = 0;\
- using expander = int[];\
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- using TestInit = typename convert<TestNameClass, TmplList>::type;\
- TestInit t;\
- t.reg_tests();\
- return 0;\
- }(); \
- }}\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- void TestName<TestType>::test()
-
-#define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD(ClassName, Name, Tags, TmplList) \
- INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, TmplList )
-
-// end catch_test_registry.h
-// start catch_capture.hpp
-
-// start catch_assertionhandler.h
-
-// start catch_assertioninfo.h
-
-// start catch_result_type.h
-
-namespace Catch {
-
- // ResultWas::OfType enum
- struct ResultWas { enum OfType {
- Unknown = -1,
- Ok = 0,
- Info = 1,
- Warning = 2,
-
- FailureBit = 0x10,
-
- ExpressionFailed = FailureBit | 1,
- ExplicitFailure = FailureBit | 2,
-
- Exception = 0x100 | FailureBit,
-
- ThrewException = Exception | 1,
- DidntThrowException = Exception | 2,
-
- FatalErrorCondition = 0x200 | FailureBit
-
- }; };
-
- bool isOk( ResultWas::OfType resultType );
- bool isJustInfo( int flags );
-
- // ResultDisposition::Flags enum
- struct ResultDisposition { enum Flags {
- Normal = 0x01,
-
- ContinueOnFailure = 0x02, // Failures fail test, but execution continues
- FalseTest = 0x04, // Prefix expression with !
- SuppressFail = 0x08 // Failures are reported but do not fail the test
- }; };
-
- ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs );
-
- bool shouldContinueOnFailure( int flags );
- inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
- bool shouldSuppressFailure( int flags );
-
-} // end namespace Catch
-
-// end catch_result_type.h
-namespace Catch {
-
- struct AssertionInfo
- {
- StringRef macroName;
- SourceLineInfo lineInfo;
- StringRef capturedExpression;
- ResultDisposition::Flags resultDisposition;
-
- // We want to delete this constructor but a compiler bug in 4.8 means
- // the struct is then treated as non-aggregate
- //AssertionInfo() = delete;
- };
-
-} // end namespace Catch
-
-// end catch_assertioninfo.h
-// start catch_decomposer.h
-
-// start catch_tostring.h
-
-#include <vector>
-#include <cstddef>
-#include <type_traits>
-#include <string>
-// start catch_stream.h
-
-#include <iosfwd>
-#include <cstddef>
-#include <ostream>
-
-namespace Catch {
-
- std::ostream& cout();
- std::ostream& cerr();
- std::ostream& clog();
-
- class StringRef;
-
- struct IStream {
- virtual ~IStream();
- virtual std::ostream& stream() const = 0;
- };
-
- auto makeStream( StringRef const &filename ) -> IStream const*;
-
- class ReusableStringStream : NonCopyable {
- std::size_t m_index;
- std::ostream* m_oss;
- public:
- ReusableStringStream();
- ~ReusableStringStream();
-
- auto str() const -> std::string;
-
- template<typename T>
- auto operator << ( T const& value ) -> ReusableStringStream& {
- *m_oss << value;
- return *this;
- }
- auto get() -> std::ostream& { return *m_oss; }
- };
-}
-
-// end catch_stream.h
-// start catch_interfaces_enum_values_registry.h
-
-#include <vector>
-
-namespace Catch {
-
- namespace Detail {
- struct EnumInfo {
- StringRef m_name;
- std::vector<std::pair<int, StringRef>> m_values;
-
- ~EnumInfo();
-
- StringRef lookup( int value ) const;
- };
- } // namespace Detail
-
- struct IMutableEnumValuesRegistry {
- virtual ~IMutableEnumValuesRegistry();
-
- virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
-
- template<typename E>
- Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::initializer_list<E> values ) {
- static_assert(sizeof(int) >= sizeof(E), "Cannot serialize enum to int");
- std::vector<int> intValues;
- intValues.reserve( values.size() );
- for( auto enumValue : values )
- intValues.push_back( static_cast<int>( enumValue ) );
- return registerEnum( enumName, allEnums, intValues );
- }
- };
-
-} // Catch
-
-// end catch_interfaces_enum_values_registry.h
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-#include <string_view>
-#endif
-
-#ifdef __OBJC__
-// start catch_objc_arc.hpp
-
-#import <Foundation/Foundation.h>
-
-#ifdef __has_feature
-#define CATCH_ARC_ENABLED __has_feature(objc_arc)
-#else
-#define CATCH_ARC_ENABLED 0
-#endif
-
-void arcSafeRelease( NSObject* obj );
-id performOptionalSelector( id obj, SEL sel );
-
-#if !CATCH_ARC_ENABLED
-inline void arcSafeRelease( NSObject* obj ) {
- [obj release];
-}
-inline id performOptionalSelector( id obj, SEL sel ) {
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED
-#define CATCH_ARC_STRONG
-#else
-inline void arcSafeRelease( NSObject* ){}
-inline id performOptionalSelector( id obj, SEL sel ) {
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
-#endif
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
-#define CATCH_ARC_STRONG __strong
-#endif
-
-// end catch_objc_arc.hpp
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
-#endif
-
-namespace Catch {
- namespace Detail {
-
- extern const std::string unprintableString;
-
- std::string rawMemoryToString( const void *object, std::size_t size );
-
- template<typename T>
- std::string rawMemoryToString( const T& object ) {
- return rawMemoryToString( &object, sizeof(object) );
- }
-
- template<typename T>
- class IsStreamInsertable {
- template<typename Stream, typename U>
- static auto test(int)
- -> decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type());
-
- template<typename, typename>
- static auto test(...)->std::false_type;
-
- public:
- static const bool value = decltype(test<std::ostream, const T&>(0))::value;
- };
-
- template<typename E>
- std::string convertUnknownEnumToString( E e );
-
- template<typename T>
- typename std::enable_if<
- !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value,
- std::string>::type convertUnstreamable( T const& ) {
- return Detail::unprintableString;
- }
- template<typename T>
- typename std::enable_if<
- !std::is_enum<T>::value && std::is_base_of<std::exception, T>::value,
- std::string>::type convertUnstreamable(T const& ex) {
- return ex.what();
- }
-
- template<typename T>
- typename std::enable_if<
- std::is_enum<T>::value
- , std::string>::type convertUnstreamable( T const& value ) {
- return convertUnknownEnumToString( value );
- }
-
-#if defined(_MANAGED)
- //! Convert a CLR string to a utf8 std::string
- template<typename T>
- std::string clrReferenceToString( T^ ref ) {
- if (ref == nullptr)
- return std::string("null");
- auto bytes = System::Text::Encoding::UTF8->GetBytes(ref->ToString());
- cli::pin_ptr<System::Byte> p = &bytes[0];
- return std::string(reinterpret_cast<char const *>(p), bytes->Length);
- }
-#endif
-
- } // namespace Detail
-
- // If we decide for C++14, change these to enable_if_ts
- template <typename T, typename = void>
- struct StringMaker {
- template <typename Fake = T>
- static
- typename std::enable_if<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
- convert(const Fake& value) {
- ReusableStringStream rss;
- // NB: call using the function-like syntax to avoid ambiguity with
- // user-defined templated operator<< under clang.
- rss.operator<<(value);
- return rss.str();
- }
-
- template <typename Fake = T>
- static
- typename std::enable_if<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
- convert( const Fake& value ) {
-#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
- return Detail::convertUnstreamable(value);
-#else
- return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
-#endif
- }
- };
-
- namespace Detail {
-
- // This function dispatches all stringification requests inside of Catch.
- // Should be preferably called fully qualified, like ::Catch::Detail::stringify
- template <typename T>
- std::string stringify(const T& e) {
- return ::Catch::StringMaker<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::convert(e);
- }
-
- template<typename E>
- std::string convertUnknownEnumToString( E e ) {
- return ::Catch::Detail::stringify(static_cast<typename std::underlying_type<E>::type>(e));
- }
-
-#if defined(_MANAGED)
- template <typename T>
- std::string stringify( T^ e ) {
- return ::Catch::StringMaker<T^>::convert(e);
- }
-#endif
-
- } // namespace Detail
-
- // Some predefined specializations
-
- template<>
- struct StringMaker<std::string> {
- static std::string convert(const std::string& str);
- };
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
- template<>
- struct StringMaker<std::string_view> {
- static std::string convert(std::string_view str);
- };
-#endif
-
- template<>
- struct StringMaker<char const *> {
- static std::string convert(char const * str);
- };
- template<>
- struct StringMaker<char *> {
- static std::string convert(char * str);
- };
-
-#ifdef CATCH_CONFIG_WCHAR
- template<>
- struct StringMaker<std::wstring> {
- static std::string convert(const std::wstring& wstr);
- };
-
-# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
- template<>
- struct StringMaker<std::wstring_view> {
- static std::string convert(std::wstring_view str);
- };
-# endif
-
- template<>
- struct StringMaker<wchar_t const *> {
- static std::string convert(wchar_t const * str);
- };
- template<>
- struct StringMaker<wchar_t *> {
- static std::string convert(wchar_t * str);
- };
-#endif
-
- // TBD: Should we use `strnlen` to ensure that we don't go out of the buffer,
- // while keeping string semantics?
- template<int SZ>
- struct StringMaker<char[SZ]> {
- static std::string convert(char const* str) {
- return ::Catch::Detail::stringify(std::string{ str });
- }
- };
- template<int SZ>
- struct StringMaker<signed char[SZ]> {
- static std::string convert(signed char const* str) {
- return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) });
- }
- };
- template<int SZ>
- struct StringMaker<unsigned char[SZ]> {
- static std::string convert(unsigned char const* str) {
- return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) });
- }
- };
-
-#if defined(CATCH_CONFIG_CPP17_BYTE)
- template<>
- struct StringMaker<std::byte> {
- static std::string convert(std::byte value);
- };
-#endif // defined(CATCH_CONFIG_CPP17_BYTE)
- template<>
- struct StringMaker<int> {
- static std::string convert(int value);
- };
- template<>
- struct StringMaker<long> {
- static std::string convert(long value);
- };
- template<>
- struct StringMaker<long long> {
- static std::string convert(long long value);
- };
- template<>
- struct StringMaker<unsigned int> {
- static std::string convert(unsigned int value);
- };
- template<>
- struct StringMaker<unsigned long> {
- static std::string convert(unsigned long value);
- };
- template<>
- struct StringMaker<unsigned long long> {
- static std::string convert(unsigned long long value);
- };
-
- template<>
- struct StringMaker<bool> {
- static std::string convert(bool b);
- };
-
- template<>
- struct StringMaker<char> {
- static std::string convert(char c);
- };
- template<>
- struct StringMaker<signed char> {
- static std::string convert(signed char c);
- };
- template<>
- struct StringMaker<unsigned char> {
- static std::string convert(unsigned char c);
- };
-
- template<>
- struct StringMaker<std::nullptr_t> {
- static std::string convert(std::nullptr_t);
- };
-
- template<>
- struct StringMaker<float> {
- static std::string convert(float value);
- static int precision;
- };
-
- template<>
- struct StringMaker<double> {
- static std::string convert(double value);
- static int precision;
- };
-
- template <typename T>
- struct StringMaker<T*> {
- template <typename U>
- static std::string convert(U* p) {
- if (p) {
- return ::Catch::Detail::rawMemoryToString(p);
- } else {
- return "nullptr";
- }
- }
- };
-
- template <typename R, typename C>
- struct StringMaker<R C::*> {
- static std::string convert(R C::* p) {
- if (p) {
- return ::Catch::Detail::rawMemoryToString(p);
- } else {
- return "nullptr";
- }
- }
- };
-
-#if defined(_MANAGED)
- template <typename T>
- struct StringMaker<T^> {
- static std::string convert( T^ ref ) {
- return ::Catch::Detail::clrReferenceToString(ref);
- }
- };
-#endif
-
- namespace Detail {
- template<typename InputIterator>
- std::string rangeToString(InputIterator first, InputIterator last) {
- ReusableStringStream rss;
- rss << "{ ";
- if (first != last) {
- rss << ::Catch::Detail::stringify(*first);
- for (++first; first != last; ++first)
- rss << ", " << ::Catch::Detail::stringify(*first);
- }
- rss << " }";
- return rss.str();
- }
- }
-
-#ifdef __OBJC__
- template<>
- struct StringMaker<NSString*> {
- static std::string convert(NSString * nsstring) {
- if (!nsstring)
- return "nil";
- return std::string("@") + [nsstring UTF8String];
- }
- };
- template<>
- struct StringMaker<NSObject*> {
- static std::string convert(NSObject* nsObject) {
- return ::Catch::Detail::stringify([nsObject description]);
- }
-
- };
- namespace Detail {
- inline std::string stringify( NSString* nsstring ) {
- return StringMaker<NSString*>::convert( nsstring );
- }
-
- } // namespace Detail
-#endif // __OBJC__
-
-} // namespace Catch
-
-//////////////////////////////////////////////////////
-// Separate std-lib types stringification, so it can be selectively enabled
-// This means that we do not bring in
-
-#if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS)
-# define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-#endif
-
-// Separate std::pair specialization
-#if defined(CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER)
-#include <utility>
-namespace Catch {
- template<typename T1, typename T2>
- struct StringMaker<std::pair<T1, T2> > {
- static std::string convert(const std::pair<T1, T2>& pair) {
- ReusableStringStream rss;
- rss << "{ "
- << ::Catch::Detail::stringify(pair.first)
- << ", "
- << ::Catch::Detail::stringify(pair.second)
- << " }";
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-
-#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
-#include <optional>
-namespace Catch {
- template<typename T>
- struct StringMaker<std::optional<T> > {
- static std::string convert(const std::optional<T>& optional) {
- ReusableStringStream rss;
- if (optional.has_value()) {
- rss << ::Catch::Detail::stringify(*optional);
- } else {
- rss << "{ }";
- }
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-
-// Separate std::tuple specialization
-#if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER)
-#include <tuple>
-namespace Catch {
- namespace Detail {
- template<
- typename Tuple,
- std::size_t N = 0,
- bool = (N < std::tuple_size<Tuple>::value)
- >
- struct TupleElementPrinter {
- static void print(const Tuple& tuple, std::ostream& os) {
- os << (N ? ", " : " ")
- << ::Catch::Detail::stringify(std::get<N>(tuple));
- TupleElementPrinter<Tuple, N + 1>::print(tuple, os);
- }
- };
-
- template<
- typename Tuple,
- std::size_t N
- >
- struct TupleElementPrinter<Tuple, N, false> {
- static void print(const Tuple&, std::ostream&) {}
- };
-
- }
-
- template<typename ...Types>
- struct StringMaker<std::tuple<Types...>> {
- static std::string convert(const std::tuple<Types...>& tuple) {
- ReusableStringStream rss;
- rss << '{';
- Detail::TupleElementPrinter<std::tuple<Types...>>::print(tuple, rss.get());
- rss << " }";
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-
-#if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_VARIANT)
-#include <variant>
-namespace Catch {
- template<>
- struct StringMaker<std::monostate> {
- static std::string convert(const std::monostate&) {
- return "{ }";
- }
- };
-
- template<typename... Elements>
- struct StringMaker<std::variant<Elements...>> {
- static std::string convert(const std::variant<Elements...>& variant) {
- if (variant.valueless_by_exception()) {
- return "{valueless variant}";
- } else {
- return std::visit(
- [](const auto& value) {
- return ::Catch::Detail::stringify(value);
- },
- variant
- );
- }
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-
-namespace Catch {
- struct not_this_one {}; // Tag type for detecting which begin/ end are being selected
-
- // Import begin/ end from std here so they are considered alongside the fallback (...) overloads in this namespace
- using std::begin;
- using std::end;
-
- not_this_one begin( ... );
- not_this_one end( ... );
-
- template <typename T>
- struct is_range {
- static const bool value =
- !std::is_same<decltype(begin(std::declval<T>())), not_this_one>::value &&
- !std::is_same<decltype(end(std::declval<T>())), not_this_one>::value;
- };
-
-#if defined(_MANAGED) // Managed types are never ranges
- template <typename T>
- struct is_range<T^> {
- static const bool value = false;
- };
-#endif
-
- template<typename Range>
- std::string rangeToString( Range const& range ) {
- return ::Catch::Detail::rangeToString( begin( range ), end( range ) );
- }
-
- // Handle vector<bool> specially
- template<typename Allocator>
- std::string rangeToString( std::vector<bool, Allocator> const& v ) {
- ReusableStringStream rss;
- rss << "{ ";
- bool first = true;
- for( bool b : v ) {
- if( first )
- first = false;
- else
- rss << ", ";
- rss << ::Catch::Detail::stringify( b );
- }
- rss << " }";
- return rss.str();
- }
-
- template<typename R>
- struct StringMaker<R, typename std::enable_if<is_range<R>::value && !::Catch::Detail::IsStreamInsertable<R>::value>::type> {
- static std::string convert( R const& range ) {
- return rangeToString( range );
- }
- };
-
- template <typename T, int SZ>
- struct StringMaker<T[SZ]> {
- static std::string convert(T const(&arr)[SZ]) {
- return rangeToString(arr);
- }
- };
-
-} // namespace Catch
-
-// Separate std::chrono::duration specialization
-#if defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-#include <ctime>
-#include <ratio>
-#include <chrono>
-
-namespace Catch {
-
-template <class Ratio>
-struct ratio_string {
- static std::string symbol();
-};
-
-template <class Ratio>
-std::string ratio_string<Ratio>::symbol() {
- Catch::ReusableStringStream rss;
- rss << '[' << Ratio::num << '/'
- << Ratio::den << ']';
- return rss.str();
-}
-template <>
-struct ratio_string<std::atto> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::femto> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::pico> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::nano> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::micro> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::milli> {
- static std::string symbol();
-};
-
- ////////////
- // std::chrono::duration specializations
- template<typename Value, typename Ratio>
- struct StringMaker<std::chrono::duration<Value, Ratio>> {
- static std::string convert(std::chrono::duration<Value, Ratio> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << ' ' << ratio_string<Ratio>::symbol() << 's';
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<1>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<1>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " s";
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<60>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<60>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " m";
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<3600>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<3600>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " h";
- return rss.str();
- }
- };
-
- ////////////
- // std::chrono::time_point specialization
- // Generic time_point cannot be specialized, only std::chrono::time_point<system_clock>
- template<typename Clock, typename Duration>
- struct StringMaker<std::chrono::time_point<Clock, Duration>> {
- static std::string convert(std::chrono::time_point<Clock, Duration> const& time_point) {
- return ::Catch::Detail::stringify(time_point.time_since_epoch()) + " since epoch";
- }
- };
- // std::chrono::time_point<system_clock> specialization
- template<typename Duration>
- struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>> {
- static std::string convert(std::chrono::time_point<std::chrono::system_clock, Duration> const& time_point) {
- auto converted = std::chrono::system_clock::to_time_t(time_point);
-
-#ifdef _MSC_VER
- std::tm timeInfo = {};
- gmtime_s(&timeInfo, &converted);
-#else
- std::tm* timeInfo = std::gmtime(&converted);
-#endif
-
- auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
- char timeStamp[timeStampSize];
- const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
-
-#ifdef _MSC_VER
- std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
-#else
- std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
-#endif
- return std::string(timeStamp);
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-
-#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
-namespace Catch { \
- template<> struct StringMaker<enumName> { \
- static std::string convert( enumName value ) { \
- static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
- return static_cast<std::string>(enumInfo.lookup( static_cast<int>( value ) )); \
- } \
- }; \
-}
-
-#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-// end catch_tostring.h
-#include <iosfwd>
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
-#pragma warning(disable:4018) // more "signed/unsigned mismatch"
-#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform)
-#pragma warning(disable:4180) // qualifier applied to function type has no meaning
-#pragma warning(disable:4800) // Forcing result to true or false
-#endif
-
-namespace Catch {
-
- struct ITransientExpression {
- auto isBinaryExpression() const -> bool { return m_isBinaryExpression; }
- auto getResult() const -> bool { return m_result; }
- virtual void streamReconstructedExpression( std::ostream &os ) const = 0;
-
- ITransientExpression( bool isBinaryExpression, bool result )
- : m_isBinaryExpression( isBinaryExpression ),
- m_result( result )
- {}
-
- // We don't actually need a virtual destructor, but many static analysers
- // complain if it's not here :-(
- virtual ~ITransientExpression();
-
- bool m_isBinaryExpression;
- bool m_result;
-
- };
-
- void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );
-
- template<typename LhsT, typename RhsT>
- class BinaryExpr : public ITransientExpression {
- LhsT m_lhs;
- StringRef m_op;
- RhsT m_rhs;
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- formatReconstructedExpression
- ( os, Catch::Detail::stringify( m_lhs ), m_op, Catch::Detail::stringify( m_rhs ) );
- }
-
- public:
- BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs )
- : ITransientExpression{ true, comparisonResult },
- m_lhs( lhs ),
- m_op( op ),
- m_rhs( rhs )
- {}
-
- template<typename T>
- auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
- };
-
- template<typename LhsT>
- class UnaryExpr : public ITransientExpression {
- LhsT m_lhs;
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- os << Catch::Detail::stringify( m_lhs );
- }
-
- public:
- explicit UnaryExpr( LhsT lhs )
- : ITransientExpression{ false, static_cast<bool>(lhs) },
- m_lhs( lhs )
- {}
- };
-
- // Specialised comparison functions to handle equality comparisons between ints and pointers (NULL deduces as an int)
- template<typename LhsT, typename RhsT>
- auto compareEqual( LhsT const& lhs, RhsT const& rhs ) -> bool { return static_cast<bool>(lhs == rhs); }
- template<typename T>
- auto compareEqual( T* const& lhs, int rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareEqual( T* const& lhs, long rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
- template<typename T>
- auto compareEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
-
- template<typename LhsT, typename RhsT>
- auto compareNotEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return static_cast<bool>(lhs != rhs); }
- template<typename T>
- auto compareNotEqual( T* const& lhs, int rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareNotEqual( T* const& lhs, long rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareNotEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
- template<typename T>
- auto compareNotEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
-
- template<typename LhsT>
- class ExprLhs {
- LhsT m_lhs;
- public:
- explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {}
-
- template<typename RhsT>
- auto operator == ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { compareEqual( m_lhs, rhs ), m_lhs, "==", rhs };
- }
- auto operator == ( bool rhs ) -> BinaryExpr<LhsT, bool> const {
- return { m_lhs == rhs, m_lhs, "==", rhs };
- }
-
- template<typename RhsT>
- auto operator != ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { compareNotEqual( m_lhs, rhs ), m_lhs, "!=", rhs };
- }
- auto operator != ( bool rhs ) -> BinaryExpr<LhsT, bool> const {
- return { m_lhs != rhs, m_lhs, "!=", rhs };
- }
-
- template<typename RhsT>
- auto operator > ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs > rhs), m_lhs, ">", rhs };
- }
- template<typename RhsT>
- auto operator < ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs < rhs), m_lhs, "<", rhs };
- }
- template<typename RhsT>
- auto operator >= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs >= rhs), m_lhs, ">=", rhs };
- }
- template<typename RhsT>
- auto operator <= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs <= rhs), m_lhs, "<=", rhs };
- }
-
- template<typename RhsT>
- auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<RhsT>::value,
- "operator&& is not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename RhsT>
- auto operator || ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<RhsT>::value,
- "operator|| is not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- auto makeUnaryExpr() const -> UnaryExpr<LhsT> {
- return UnaryExpr<LhsT>{ m_lhs };
- }
- };
-
- void handleExpression( ITransientExpression const& expr );
-
- template<typename T>
- void handleExpression( ExprLhs<T> const& expr ) {
- handleExpression( expr.makeUnaryExpr() );
- }
-
- struct Decomposer {
- template<typename T>
- auto operator <= ( T const& lhs ) -> ExprLhs<T const&> {
- return ExprLhs<T const&>{ lhs };
- }
-
- auto operator <=( bool value ) -> ExprLhs<bool> {
- return ExprLhs<bool>{ value };
- }
- };
-
-} // end namespace Catch
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-// end catch_decomposer.h
-// start catch_interfaces_capture.h
-
-#include <string>
-#include <chrono>
-
-namespace Catch {
-
- class AssertionResult;
- struct AssertionInfo;
- struct SectionInfo;
- struct SectionEndInfo;
- struct MessageInfo;
- struct MessageBuilder;
- struct Counts;
- struct AssertionReaction;
- struct SourceLineInfo;
-
- struct ITransientExpression;
- struct IGeneratorTracker;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- struct BenchmarkInfo;
- template <typename Duration = std::chrono::duration<double, std::nano>>
- struct BenchmarkStats;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- struct IResultCapture {
-
- virtual ~IResultCapture();
-
- virtual bool sectionStarted( SectionInfo const& sectionInfo,
- Counts& assertions ) = 0;
- virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
- virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
-
- virtual auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- virtual void benchmarkPreparing( std::string const& name ) = 0;
- virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0;
- virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0;
- virtual void benchmarkFailed( std::string const& error ) = 0;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- virtual void pushScopedMessage( MessageInfo const& message ) = 0;
- virtual void popScopedMessage( MessageInfo const& message ) = 0;
-
- virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0;
-
- virtual void handleFatalErrorCondition( StringRef message ) = 0;
-
- virtual void handleExpr
- ( AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction ) = 0;
- virtual void handleMessage
- ( AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction ) = 0;
- virtual void handleUnexpectedExceptionNotThrown
- ( AssertionInfo const& info,
- AssertionReaction& reaction ) = 0;
- virtual void handleUnexpectedInflightException
- ( AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction ) = 0;
- virtual void handleIncomplete
- ( AssertionInfo const& info ) = 0;
- virtual void handleNonExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction ) = 0;
-
- virtual bool lastAssertionPassed() = 0;
- virtual void assertionPassed() = 0;
-
- // Deprecated, do not use:
- virtual std::string getCurrentTestName() const = 0;
- virtual const AssertionResult* getLastResult() const = 0;
- virtual void exceptionEarlyReported() = 0;
- };
-
- IResultCapture& getResultCapture();
-}
-
-// end catch_interfaces_capture.h
-namespace Catch {
-
- struct TestFailureException{};
- struct AssertionResultData;
- struct IResultCapture;
- class RunContext;
-
- class LazyExpression {
- friend class AssertionHandler;
- friend struct AssertionStats;
- friend class RunContext;
-
- ITransientExpression const* m_transientExpression = nullptr;
- bool m_isNegated;
- public:
- LazyExpression( bool isNegated );
- LazyExpression( LazyExpression const& other );
- LazyExpression& operator = ( LazyExpression const& ) = delete;
-
- explicit operator bool() const;
-
- friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&;
- };
-
- struct AssertionReaction {
- bool shouldDebugBreak = false;
- bool shouldThrow = false;
- };
-
- class AssertionHandler {
- AssertionInfo m_assertionInfo;
- AssertionReaction m_reaction;
- bool m_completed = false;
- IResultCapture& m_resultCapture;
-
- public:
- AssertionHandler
- ( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- StringRef capturedExpression,
- ResultDisposition::Flags resultDisposition );
- ~AssertionHandler() {
- if ( !m_completed ) {
- m_resultCapture.handleIncomplete( m_assertionInfo );
- }
- }
-
- template<typename T>
- void handleExpr( ExprLhs<T> const& expr ) {
- handleExpr( expr.makeUnaryExpr() );
- }
- void handleExpr( ITransientExpression const& expr );
-
- void handleMessage(ResultWas::OfType resultType, StringRef const& message);
-
- void handleExceptionThrownAsExpected();
- void handleUnexpectedExceptionNotThrown();
- void handleExceptionNotThrownAsExpected();
- void handleThrowingCallSkipped();
- void handleUnexpectedInflightException();
-
- void complete();
- void setCompleted();
-
- // query
- auto allowThrows() const -> bool;
- };
-
- void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString );
-
-} // namespace Catch
-
-// end catch_assertionhandler.h
-// start catch_message.h
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-
- struct MessageInfo {
- MessageInfo( StringRef const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type );
-
- StringRef macroName;
- std::string message;
- SourceLineInfo lineInfo;
- ResultWas::OfType type;
- unsigned int sequence;
-
- bool operator == ( MessageInfo const& other ) const;
- bool operator < ( MessageInfo const& other ) const;
- private:
- static unsigned int globalCount;
- };
-
- struct MessageStream {
-
- template<typename T>
- MessageStream& operator << ( T const& value ) {
- m_stream << value;
- return *this;
- }
-
- ReusableStringStream m_stream;
- };
-
- struct MessageBuilder : MessageStream {
- MessageBuilder( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- ResultWas::OfType type );
-
- template<typename T>
- MessageBuilder& operator << ( T const& value ) {
- m_stream << value;
- return *this;
- }
-
- MessageInfo m_info;
- };
-
- class ScopedMessage {
- public:
- explicit ScopedMessage( MessageBuilder const& builder );
- ScopedMessage( ScopedMessage& duplicate ) = delete;
- ScopedMessage( ScopedMessage&& old );
- ~ScopedMessage();
-
- MessageInfo m_info;
- bool m_moved;
- };
-
- class Capturer {
- std::vector<MessageInfo> m_messages;
- IResultCapture& m_resultCapture = getResultCapture();
- size_t m_captured = 0;
- public:
- Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names );
- ~Capturer();
-
- void captureValue( size_t index, std::string const& value );
-
- template<typename T>
- void captureValues( size_t index, T const& value ) {
- captureValue( index, Catch::Detail::stringify( value ) );
- }
-
- template<typename T, typename... Ts>
- void captureValues( size_t index, T const& value, Ts const&... values ) {
- captureValue( index, Catch::Detail::stringify(value) );
- captureValues( index+1, values... );
- }
- };
-
-} // end namespace Catch
-
-// end catch_message.h
-#if !defined(CATCH_CONFIG_DISABLE)
-
-#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
- #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__
-#else
- #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
-#endif
-
-#if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-
-///////////////////////////////////////////////////////////////////////////////
-// Another way to speed-up compilation is to omit local try-catch for REQUIRE*
-// macros.
-#define INTERNAL_CATCH_TRY
-#define INTERNAL_CATCH_CATCH( capturer )
-
-#else // CATCH_CONFIG_FAST_COMPILE
-
-#define INTERNAL_CATCH_TRY try
-#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); }
-
-#endif
-
-#define INTERNAL_CATCH_REACT( handler ) handler.complete();
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
- do { \
- CATCH_INTERNAL_IGNORE_BUT_WARN(__VA_ARGS__); \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
- INTERNAL_CATCH_TRY { \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( Catch::getResultCapture().lastAssertionPassed() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( !Catch::getResultCapture().lastAssertionPassed() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(expr); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( exceptionType const& ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
- catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
- auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \
- varName.captureValues( 0, __VA_ARGS__ )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_INFO( macroName, log ) \
- Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log );
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
- Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
-
-///////////////////////////////////////////////////////////////////////////////
-// Although this is matcher-based, it can be used with just a string
-#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-#endif // CATCH_CONFIG_DISABLE
-
-// end catch_capture.hpp
-// start catch_section.h
-
-// start catch_section_info.h
-
-// start catch_totals.h
-
-#include <cstddef>
-
-namespace Catch {
-
- struct Counts {
- Counts operator - ( Counts const& other ) const;
- Counts& operator += ( Counts const& other );
-
- std::size_t total() const;
- bool allPassed() const;
- bool allOk() const;
-
- std::size_t passed = 0;
- std::size_t failed = 0;
- std::size_t failedButOk = 0;
- };
-
- struct Totals {
-
- Totals operator - ( Totals const& other ) const;
- Totals& operator += ( Totals const& other );
-
- Totals delta( Totals const& prevTotals ) const;
-
- int error = 0;
- Counts assertions;
- Counts testCases;
- };
-}
-
-// end catch_totals.h
-#include <string>
-
-namespace Catch {
-
- struct SectionInfo {
- SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name );
-
- // Deprecated
- SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name,
- std::string const& ) : SectionInfo( _lineInfo, _name ) {}
-
- std::string name;
- std::string description; // !Deprecated: this will always be empty
- SourceLineInfo lineInfo;
- };
-
- struct SectionEndInfo {
- SectionInfo sectionInfo;
- Counts prevAssertions;
- double durationInSeconds;
- };
-
-} // end namespace Catch
-
-// end catch_section_info.h
-// start catch_timer.h
-
-#include <cstdint>
-
-namespace Catch {
-
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t;
- auto getEstimatedClockResolution() -> uint64_t;
-
- class Timer {
- uint64_t m_nanoseconds = 0;
- public:
- void start();
- auto getElapsedNanoseconds() const -> uint64_t;
- auto getElapsedMicroseconds() const -> uint64_t;
- auto getElapsedMilliseconds() const -> unsigned int;
- auto getElapsedSeconds() const -> double;
- };
-
-} // namespace Catch
-
-// end catch_timer.h
-#include <string>
-
-namespace Catch {
-
- class Section : NonCopyable {
- public:
- Section( SectionInfo const& info );
- ~Section();
-
- // This indicates whether the section should be executed or not
- explicit operator bool() const;
-
- private:
- SectionInfo m_info;
-
- std::string m_name;
- Counts m_assertions;
- bool m_sectionIncluded;
- Timer m_timer;
- };
-
-} // end namespace Catch
-
-#define INTERNAL_CATCH_SECTION( ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, (Catch::ReusableStringStream() << __VA_ARGS__).str() ) ) \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-// end catch_section.h
-// start catch_interfaces_exception.h
-
-// start catch_interfaces_registry_hub.h
-
-#include <string>
-#include <memory>
-
-namespace Catch {
-
- class TestCase;
- struct ITestCaseRegistry;
- struct IExceptionTranslatorRegistry;
- struct IExceptionTranslator;
- struct IReporterRegistry;
- struct IReporterFactory;
- struct ITagAliasRegistry;
- struct IMutableEnumValuesRegistry;
-
- class StartupExceptionRegistry;
-
- using IReporterFactoryPtr = std::shared_ptr<IReporterFactory>;
-
- struct IRegistryHub {
- virtual ~IRegistryHub();
-
- virtual IReporterRegistry const& getReporterRegistry() const = 0;
- virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
- virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0;
- virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0;
-
- virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0;
- };
-
- struct IMutableRegistryHub {
- virtual ~IMutableRegistryHub();
- virtual void registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) = 0;
- virtual void registerListener( IReporterFactoryPtr const& factory ) = 0;
- virtual void registerTest( TestCase const& testInfo ) = 0;
- virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
- virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
- virtual void registerStartupException() noexcept = 0;
- virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0;
- };
-
- IRegistryHub const& getRegistryHub();
- IMutableRegistryHub& getMutableRegistryHub();
- void cleanUp();
- std::string translateActiveException();
-
-}
-
-// end catch_interfaces_registry_hub.h
-#if defined(CATCH_CONFIG_DISABLE)
- #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( translatorName, signature) \
- static std::string translatorName( signature )
-#endif
-
-#include <exception>
-#include <string>
-#include <vector>
-
-namespace Catch {
- using exceptionTranslateFunction = std::string(*)();
-
- struct IExceptionTranslator;
- using ExceptionTranslators = std::vector<std::unique_ptr<IExceptionTranslator const>>;
-
- struct IExceptionTranslator {
- virtual ~IExceptionTranslator();
- virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
- };
-
- struct IExceptionTranslatorRegistry {
- virtual ~IExceptionTranslatorRegistry();
-
- virtual std::string translateActiveException() const = 0;
- };
-
- class ExceptionTranslatorRegistrar {
- template<typename T>
- class ExceptionTranslator : public IExceptionTranslator {
- public:
-
- ExceptionTranslator( std::string(*translateFunction)( T& ) )
- : m_translateFunction( translateFunction )
- {}
-
- std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
- try {
- if( it == itEnd )
- std::rethrow_exception(std::current_exception());
- else
- return (*it)->translate( it+1, itEnd );
- }
- catch( T& ex ) {
- return m_translateFunction( ex );
- }
- }
-
- protected:
- std::string(*m_translateFunction)( T& );
- };
-
- public:
- template<typename T>
- ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) {
- getMutableRegistryHub().registerTranslator
- ( new ExceptionTranslator<T>( translateFunction ) );
- }
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
- static std::string translatorName( signature ); \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- static std::string translatorName( signature )
-
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
-
-// end catch_interfaces_exception.h
-// start catch_approx.h
-
-#include <type_traits>
-
-namespace Catch {
-namespace Detail {
-
- class Approx {
- private:
- bool equalityComparisonImpl(double other) const;
- // Validates the new margin (margin >= 0)
- // out-of-line to avoid including stdexcept in the header
- void setMargin(double margin);
- // Validates the new epsilon (0 < epsilon < 1)
- // out-of-line to avoid including stdexcept in the header
- void setEpsilon(double epsilon);
-
- public:
- explicit Approx ( double value );
-
- static Approx custom();
-
- Approx operator-() const;
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx operator()( T const& value ) {
- Approx approx( static_cast<double>(value) );
- approx.m_epsilon = m_epsilon;
- approx.m_margin = m_margin;
- approx.m_scale = m_scale;
- return approx;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- explicit Approx( T const& value ): Approx(static_cast<double>(value))
- {}
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator == ( const T& lhs, Approx const& rhs ) {
- auto lhs_v = static_cast<double>(lhs);
- return rhs.equalityComparisonImpl(lhs_v);
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator == ( Approx const& lhs, const T& rhs ) {
- return operator==( rhs, lhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator != ( T const& lhs, Approx const& rhs ) {
- return !operator==( lhs, rhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator != ( Approx const& lhs, T const& rhs ) {
- return !operator==( rhs, lhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator <= ( T const& lhs, Approx const& rhs ) {
- return static_cast<double>(lhs) < rhs.m_value || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator <= ( Approx const& lhs, T const& rhs ) {
- return lhs.m_value < static_cast<double>(rhs) || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator >= ( T const& lhs, Approx const& rhs ) {
- return static_cast<double>(lhs) > rhs.m_value || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator >= ( Approx const& lhs, T const& rhs ) {
- return lhs.m_value > static_cast<double>(rhs) || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& epsilon( T const& newEpsilon ) {
- double epsilonAsDouble = static_cast<double>(newEpsilon);
- setEpsilon(epsilonAsDouble);
- return *this;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& margin( T const& newMargin ) {
- double marginAsDouble = static_cast<double>(newMargin);
- setMargin(marginAsDouble);
- return *this;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& scale( T const& newScale ) {
- m_scale = static_cast<double>(newScale);
- return *this;
- }
-
- std::string toString() const;
-
- private:
- double m_epsilon;
- double m_margin;
- double m_scale;
- double m_value;
- };
-} // end namespace Detail
-
-namespace literals {
- Detail::Approx operator "" _a(long double val);
- Detail::Approx operator "" _a(unsigned long long val);
-} // end namespace literals
-
-template<>
-struct StringMaker<Catch::Detail::Approx> {
- static std::string convert(Catch::Detail::Approx const& value);
-};
-
-} // end namespace Catch
-
-// end catch_approx.h
-// start catch_string_manip.h
-
-#include <string>
-#include <iosfwd>
-#include <vector>
-
-namespace Catch {
-
- bool startsWith( std::string const& s, std::string const& prefix );
- bool startsWith( std::string const& s, char prefix );
- bool endsWith( std::string const& s, std::string const& suffix );
- bool endsWith( std::string const& s, char suffix );
- bool contains( std::string const& s, std::string const& infix );
- void toLowerInPlace( std::string& s );
- std::string toLower( std::string const& s );
- //! Returns a new string without whitespace at the start/end
- std::string trim( std::string const& str );
- //! Returns a substring of the original ref without whitespace. Beware lifetimes!
- StringRef trim(StringRef ref);
-
- // !!! Be aware, returns refs into original string - make sure original string outlives them
- std::vector<StringRef> splitStringRef( StringRef str, char delimiter );
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
-
- struct pluralise {
- pluralise( std::size_t count, std::string const& label );
-
- friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
-
- std::size_t m_count;
- std::string m_label;
- };
-}
-
-// end catch_string_manip.h
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
-// start catch_capture_matchers.h
-
-// start catch_matchers.h
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-namespace Matchers {
- namespace Impl {
-
- template<typename ArgT> struct MatchAllOf;
- template<typename ArgT> struct MatchAnyOf;
- template<typename ArgT> struct MatchNotOf;
-
- class MatcherUntypedBase {
- public:
- MatcherUntypedBase() = default;
- MatcherUntypedBase ( MatcherUntypedBase const& ) = default;
- MatcherUntypedBase& operator = ( MatcherUntypedBase const& ) = delete;
- std::string toString() const;
-
- protected:
- virtual ~MatcherUntypedBase();
- virtual std::string describe() const = 0;
- mutable std::string m_cachedToString;
- };
-
-#ifdef __clang__
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wnon-virtual-dtor"
-#endif
-
- template<typename ObjectT>
- struct MatcherMethod {
- virtual bool match( ObjectT const& arg ) const = 0;
- };
-
-#if defined(__OBJC__)
- // Hack to fix Catch GH issue #1661. Could use id for generic Object support.
- // use of const for Object pointers is very uncommon and under ARC it causes some kind of signature mismatch that breaks compilation
- template<>
- struct MatcherMethod<NSString*> {
- virtual bool match( NSString* arg ) const = 0;
- };
-#endif
-
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-
- template<typename T>
- struct MatcherBase : MatcherUntypedBase, MatcherMethod<T> {
-
- MatchAllOf<T> operator && ( MatcherBase const& other ) const;
- MatchAnyOf<T> operator || ( MatcherBase const& other ) const;
- MatchNotOf<T> operator ! () const;
- };
-
- template<typename ArgT>
- struct MatchAllOf : MatcherBase<ArgT> {
- bool match( ArgT const& arg ) const override {
- for( auto matcher : m_matchers ) {
- if (!matcher->match(arg))
- return false;
- }
- return true;
- }
- std::string describe() const override {
- std::string description;
- description.reserve( 4 + m_matchers.size()*32 );
- description += "( ";
- bool first = true;
- for( auto matcher : m_matchers ) {
- if( first )
- first = false;
- else
- description += " and ";
- description += matcher->toString();
- }
- description += " )";
- return description;
- }
-
- MatchAllOf<ArgT> operator && ( MatcherBase<ArgT> const& other ) {
- auto copy(*this);
- copy.m_matchers.push_back( &other );
- return copy;
- }
-
- std::vector<MatcherBase<ArgT> const*> m_matchers;
- };
- template<typename ArgT>
- struct MatchAnyOf : MatcherBase<ArgT> {
-
- bool match( ArgT const& arg ) const override {
- for( auto matcher : m_matchers ) {
- if (matcher->match(arg))
- return true;
- }
- return false;
- }
- std::string describe() const override {
- std::string description;
- description.reserve( 4 + m_matchers.size()*32 );
- description += "( ";
- bool first = true;
- for( auto matcher : m_matchers ) {
- if( first )
- first = false;
- else
- description += " or ";
- description += matcher->toString();
- }
- description += " )";
- return description;
- }
-
- MatchAnyOf<ArgT> operator || ( MatcherBase<ArgT> const& other ) {
- auto copy(*this);
- copy.m_matchers.push_back( &other );
- return copy;
- }
-
- std::vector<MatcherBase<ArgT> const*> m_matchers;
- };
-
- template<typename ArgT>
- struct MatchNotOf : MatcherBase<ArgT> {
-
- MatchNotOf( MatcherBase<ArgT> const& underlyingMatcher ) : m_underlyingMatcher( underlyingMatcher ) {}
-
- bool match( ArgT const& arg ) const override {
- return !m_underlyingMatcher.match( arg );
- }
-
- std::string describe() const override {
- return "not " + m_underlyingMatcher.toString();
- }
- MatcherBase<ArgT> const& m_underlyingMatcher;
- };
-
- template<typename T>
- MatchAllOf<T> MatcherBase<T>::operator && ( MatcherBase const& other ) const {
- return MatchAllOf<T>() && *this && other;
- }
- template<typename T>
- MatchAnyOf<T> MatcherBase<T>::operator || ( MatcherBase const& other ) const {
- return MatchAnyOf<T>() || *this || other;
- }
- template<typename T>
- MatchNotOf<T> MatcherBase<T>::operator ! () const {
- return MatchNotOf<T>( *this );
- }
-
- } // namespace Impl
-
-} // namespace Matchers
-
-using namespace Matchers;
-using Matchers::Impl::MatcherBase;
-
-} // namespace Catch
-
-// end catch_matchers.h
-// start catch_matchers_exception.hpp
-
-namespace Catch {
-namespace Matchers {
-namespace Exception {
-
-class ExceptionMessageMatcher : public MatcherBase<std::exception> {
- std::string m_message;
-public:
-
- ExceptionMessageMatcher(std::string const& message):
- m_message(message)
- {}
-
- bool match(std::exception const& ex) const override;
-
- std::string describe() const override;
-};
-
-} // namespace Exception
-
-Exception::ExceptionMessageMatcher Message(std::string const& message);
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_exception.hpp
-// start catch_matchers_floating.h
-
-namespace Catch {
-namespace Matchers {
-
- namespace Floating {
-
- enum class FloatingPointKind : uint8_t;
-
- struct WithinAbsMatcher : MatcherBase<double> {
- WithinAbsMatcher(double target, double margin);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- double m_margin;
- };
-
- struct WithinUlpsMatcher : MatcherBase<double> {
- WithinUlpsMatcher(double target, uint64_t ulps, FloatingPointKind baseType);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- uint64_t m_ulps;
- FloatingPointKind m_type;
- };
-
- // Given IEEE-754 format for floats and doubles, we can assume
- // that float -> double promotion is lossless. Given this, we can
- // assume that if we do the standard relative comparison of
- // |lhs - rhs| <= epsilon * max(fabs(lhs), fabs(rhs)), then we get
- // the same result if we do this for floats, as if we do this for
- // doubles that were promoted from floats.
- struct WithinRelMatcher : MatcherBase<double> {
- WithinRelMatcher(double target, double epsilon);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- double m_epsilon;
- };
-
- } // namespace Floating
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
- Floating::WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff);
- Floating::WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff);
- Floating::WithinAbsMatcher WithinAbs(double target, double margin);
- Floating::WithinRelMatcher WithinRel(double target, double eps);
- // defaults epsilon to 100*numeric_limits<double>::epsilon()
- Floating::WithinRelMatcher WithinRel(double target);
- Floating::WithinRelMatcher WithinRel(float target, float eps);
- // defaults epsilon to 100*numeric_limits<float>::epsilon()
- Floating::WithinRelMatcher WithinRel(float target);
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_floating.h
-// start catch_matchers_generic.hpp
-
-#include <functional>
-#include <string>
-
-namespace Catch {
-namespace Matchers {
-namespace Generic {
-
-namespace Detail {
- std::string finalizeDescription(const std::string& desc);
-}
-
-template <typename T>
-class PredicateMatcher : public MatcherBase<T> {
- std::function<bool(T const&)> m_predicate;
- std::string m_description;
-public:
-
- PredicateMatcher(std::function<bool(T const&)> const& elem, std::string const& descr)
- :m_predicate(std::move(elem)),
- m_description(Detail::finalizeDescription(descr))
- {}
-
- bool match( T const& item ) const override {
- return m_predicate(item);
- }
-
- std::string describe() const override {
- return m_description;
- }
-};
-
-} // namespace Generic
-
- // The following functions create the actual matcher objects.
- // The user has to explicitly specify type to the function, because
- // inferring std::function<bool(T const&)> is hard (but possible) and
- // requires a lot of TMP.
- template<typename T>
- Generic::PredicateMatcher<T> Predicate(std::function<bool(T const&)> const& predicate, std::string const& description = "") {
- return Generic::PredicateMatcher<T>(predicate, description);
- }
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_generic.hpp
-// start catch_matchers_string.h
-
-#include <string>
-
-namespace Catch {
-namespace Matchers {
-
- namespace StdString {
-
- struct CasedString
- {
- CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity );
- std::string adjustString( std::string const& str ) const;
- std::string caseSensitivitySuffix() const;
-
- CaseSensitive::Choice m_caseSensitivity;
- std::string m_str;
- };
-
- struct StringMatcherBase : MatcherBase<std::string> {
- StringMatcherBase( std::string const& operation, CasedString const& comparator );
- std::string describe() const override;
-
- CasedString m_comparator;
- std::string m_operation;
- };
-
- struct EqualsMatcher : StringMatcherBase {
- EqualsMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct ContainsMatcher : StringMatcherBase {
- ContainsMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct StartsWithMatcher : StringMatcherBase {
- StartsWithMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct EndsWithMatcher : StringMatcherBase {
- EndsWithMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
-
- struct RegexMatcher : MatcherBase<std::string> {
- RegexMatcher( std::string regex, CaseSensitive::Choice caseSensitivity );
- bool match( std::string const& matchee ) const override;
- std::string describe() const override;
-
- private:
- std::string m_regex;
- CaseSensitive::Choice m_caseSensitivity;
- };
-
- } // namespace StdString
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
-
- StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::RegexMatcher Matches( std::string const& regex, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_string.h
-// start catch_matchers_vector.h
-
-#include <algorithm>
-
-namespace Catch {
-namespace Matchers {
-
- namespace Vector {
- template<typename T>
- struct ContainsElementMatcher : MatcherBase<std::vector<T>> {
-
- ContainsElementMatcher(T const &comparator) : m_comparator( comparator) {}
-
- bool match(std::vector<T> const &v) const override {
- for (auto const& el : v) {
- if (el == m_comparator) {
- return true;
- }
- }
- return false;
- }
-
- std::string describe() const override {
- return "Contains: " + ::Catch::Detail::stringify( m_comparator );
- }
-
- T const& m_comparator;
- };
-
- template<typename T>
- struct ContainsMatcher : MatcherBase<std::vector<T>> {
-
- ContainsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T> const &v) const override {
- // !TBD: see note in EqualsMatcher
- if (m_comparator.size() > v.size())
- return false;
- for (auto const& comparator : m_comparator) {
- auto present = false;
- for (const auto& el : v) {
- if (el == comparator) {
- present = true;
- break;
- }
- }
- if (!present) {
- return false;
- }
- }
- return true;
- }
- std::string describe() const override {
- return "Contains: " + ::Catch::Detail::stringify( m_comparator );
- }
-
- std::vector<T> const& m_comparator;
- };
-
- template<typename T>
- struct EqualsMatcher : MatcherBase<std::vector<T>> {
-
- EqualsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T> const &v) const override {
- // !TBD: This currently works if all elements can be compared using !=
- // - a more general approach would be via a compare template that defaults
- // to using !=. but could be specialised for, e.g. std::vector<T> etc
- // - then just call that directly
- if (m_comparator.size() != v.size())
- return false;
- for (std::size_t i = 0; i < v.size(); ++i)
- if (m_comparator[i] != v[i])
- return false;
- return true;
- }
- std::string describe() const override {
- return "Equals: " + ::Catch::Detail::stringify( m_comparator );
- }
- std::vector<T> const& m_comparator;
- };
-
- template<typename T>
- struct ApproxMatcher : MatcherBase<std::vector<T>> {
-
- ApproxMatcher(std::vector<T> const& comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T> const &v) const override {
- if (m_comparator.size() != v.size())
- return false;
- for (std::size_t i = 0; i < v.size(); ++i)
- if (m_comparator[i] != approx(v[i]))
- return false;
- return true;
- }
- std::string describe() const override {
- return "is approx: " + ::Catch::Detail::stringify( m_comparator );
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& epsilon( T const& newEpsilon ) {
- approx.epsilon(newEpsilon);
- return *this;
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& margin( T const& newMargin ) {
- approx.margin(newMargin);
- return *this;
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& scale( T const& newScale ) {
- approx.scale(newScale);
- return *this;
- }
-
- std::vector<T> const& m_comparator;
- mutable Catch::Detail::Approx approx = Catch::Detail::Approx::custom();
- };
-
- template<typename T>
- struct UnorderedEqualsMatcher : MatcherBase<std::vector<T>> {
- UnorderedEqualsMatcher(std::vector<T> const& target) : m_target(target) {}
- bool match(std::vector<T> const& vec) const override {
- // Note: This is a reimplementation of std::is_permutation,
- // because I don't want to include <algorithm> inside the common path
- if (m_target.size() != vec.size()) {
- return false;
- }
- return std::is_permutation(m_target.begin(), m_target.end(), vec.begin());
- }
-
- std::string describe() const override {
- return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target);
- }
- private:
- std::vector<T> const& m_target;
- };
-
- } // namespace Vector
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
-
- template<typename T>
- Vector::ContainsMatcher<T> Contains( std::vector<T> const& comparator ) {
- return Vector::ContainsMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::ContainsElementMatcher<T> VectorContains( T const& comparator ) {
- return Vector::ContainsElementMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::EqualsMatcher<T> Equals( std::vector<T> const& comparator ) {
- return Vector::EqualsMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::ApproxMatcher<T> Approx( std::vector<T> const& comparator ) {
- return Vector::ApproxMatcher<T>( comparator );
- }
-
- template<typename T>
- Vector::UnorderedEqualsMatcher<T> UnorderedEquals(std::vector<T> const& target) {
- return Vector::UnorderedEqualsMatcher<T>(target);
- }
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_vector.h
-namespace Catch {
-
- template<typename ArgT, typename MatcherT>
- class MatchExpr : public ITransientExpression {
- ArgT const& m_arg;
- MatcherT m_matcher;
- StringRef m_matcherString;
- public:
- MatchExpr( ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString )
- : ITransientExpression{ true, matcher.match( arg ) },
- m_arg( arg ),
- m_matcher( matcher ),
- m_matcherString( matcherString )
- {}
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- auto matcherAsString = m_matcher.toString();
- os << Catch::Detail::stringify( m_arg ) << ' ';
- if( matcherAsString == Detail::unprintableString )
- os << m_matcherString;
- else
- os << matcherAsString;
- }
- };
-
- using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
-
- void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString );
-
- template<typename ArgT, typename MatcherT>
- auto makeMatchExpr( ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString ) -> MatchExpr<ArgT, MatcherT> {
- return MatchExpr<ArgT, MatcherT>( arg, matcher, matcherString );
- }
-
-} // namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CHECK_THAT( macroName, matcher, resultDisposition, arg ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- INTERNAL_CATCH_TRY { \
- catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher, #matcher##_catch_sr ) ); \
- } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_MATCHES( macroName, exceptionType, resultDisposition, matcher, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__ ); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( exceptionType const& ex ) { \
- catchAssertionHandler.handleExpr( Catch::makeMatchExpr( ex, matcher, #matcher##_catch_sr ) ); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-// end catch_capture_matchers.h
-#endif
-// start catch_generators.hpp
-
-// start catch_interfaces_generatortracker.h
-
-
-#include <memory>
-
-namespace Catch {
-
- namespace Generators {
- class GeneratorUntypedBase {
- public:
- GeneratorUntypedBase() = default;
- virtual ~GeneratorUntypedBase();
- // Attempts to move the generator to the next element
- //
- // Returns true iff the move succeeded (and a valid element
- // can be retrieved).
- virtual bool next() = 0;
- };
- using GeneratorBasePtr = std::unique_ptr<GeneratorUntypedBase>;
-
- } // namespace Generators
-
- struct IGeneratorTracker {
- virtual ~IGeneratorTracker();
- virtual auto hasGenerator() const -> bool = 0;
- virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
- virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0;
- };
-
-} // namespace Catch
-
-// end catch_interfaces_generatortracker.h
-// start catch_enforce.h
-
-#include <exception>
-
-namespace Catch {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- template <typename Ex>
- [[noreturn]]
- void throw_exception(Ex const& e) {
- throw e;
- }
-#else // ^^ Exceptions are enabled // Exceptions are disabled vv
- [[noreturn]]
- void throw_exception(std::exception const& e);
-#endif
-
- [[noreturn]]
- void throw_logic_error(std::string const& msg);
- [[noreturn]]
- void throw_domain_error(std::string const& msg);
- [[noreturn]]
- void throw_runtime_error(std::string const& msg);
-
-} // namespace Catch;
-
-#define CATCH_MAKE_MSG(...) \
- (Catch::ReusableStringStream() << __VA_ARGS__).str()
-
-#define CATCH_INTERNAL_ERROR(...) \
- Catch::throw_logic_error(CATCH_MAKE_MSG( CATCH_INTERNAL_LINEINFO << ": Internal Catch2 error: " << __VA_ARGS__))
-
-#define CATCH_ERROR(...) \
- Catch::throw_domain_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
-
-#define CATCH_RUNTIME_ERROR(...) \
- Catch::throw_runtime_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
-
-#define CATCH_ENFORCE( condition, ... ) \
- do{ if( !(condition) ) CATCH_ERROR( __VA_ARGS__ ); } while(false)
-
-// end catch_enforce.h
-#include <memory>
-#include <vector>
-#include <cassert>
-
-#include <utility>
-#include <exception>
-
-namespace Catch {
-
-class GeneratorException : public std::exception {
- const char* const m_msg = "";
-
-public:
- GeneratorException(const char* msg):
- m_msg(msg)
- {}
-
- const char* what() const noexcept override final;
-};
-
-namespace Generators {
-
- // !TBD move this into its own location?
- namespace pf{
- template<typename T, typename... Args>
- std::unique_ptr<T> make_unique( Args&&... args ) {
- return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
- }
- }
-
- template<typename T>
- struct IGenerator : GeneratorUntypedBase {
- virtual ~IGenerator() = default;
-
- // Returns the current element of the generator
- //
- // \Precondition The generator is either freshly constructed,
- // or the last call to `next()` returned true
- virtual T const& get() const = 0;
- using type = T;
- };
-
- template<typename T>
- class SingleValueGenerator final : public IGenerator<T> {
- T m_value;
- public:
- SingleValueGenerator(T&& value) : m_value(std::move(value)) {}
-
- T const& get() const override {
- return m_value;
- }
- bool next() override {
- return false;
- }
- };
-
- template<typename T>
- class FixedValuesGenerator final : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "FixedValuesGenerator does not support bools because of std::vector<bool>"
- "specialization, use SingleValue Generator instead.");
- std::vector<T> m_values;
- size_t m_idx = 0;
- public:
- FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
-
- T const& get() const override {
- return m_values[m_idx];
- }
- bool next() override {
- ++m_idx;
- return m_idx < m_values.size();
- }
- };
-
- template <typename T>
- class GeneratorWrapper final {
- std::unique_ptr<IGenerator<T>> m_generator;
- public:
- GeneratorWrapper(std::unique_ptr<IGenerator<T>> generator):
- m_generator(std::move(generator))
- {}
- T const& get() const {
- return m_generator->get();
- }
- bool next() {
- return m_generator->next();
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> value(T&& value) {
- return GeneratorWrapper<T>(pf::make_unique<SingleValueGenerator<T>>(std::forward<T>(value)));
- }
- template <typename T>
- GeneratorWrapper<T> values(std::initializer_list<T> values) {
- return GeneratorWrapper<T>(pf::make_unique<FixedValuesGenerator<T>>(values));
- }
-
- template<typename T>
- class Generators : public IGenerator<T> {
- std::vector<GeneratorWrapper<T>> m_generators;
- size_t m_current = 0;
-
- void populate(GeneratorWrapper<T>&& generator) {
- m_generators.emplace_back(std::move(generator));
- }
- void populate(T&& val) {
- m_generators.emplace_back(value(std::forward<T>(val)));
- }
- template<typename U>
- void populate(U&& val) {
- populate(T(std::forward<U>(val)));
- }
- template<typename U, typename... Gs>
- void populate(U&& valueOrGenerator, Gs &&... moreGenerators) {
- populate(std::forward<U>(valueOrGenerator));
- populate(std::forward<Gs>(moreGenerators)...);
- }
-
- public:
- template <typename... Gs>
- Generators(Gs &&... moreGenerators) {
- m_generators.reserve(sizeof...(Gs));
- populate(std::forward<Gs>(moreGenerators)...);
- }
-
- T const& get() const override {
- return m_generators[m_current].get();
- }
-
- bool next() override {
- if (m_current >= m_generators.size()) {
- return false;
- }
- const bool current_status = m_generators[m_current].next();
- if (!current_status) {
- ++m_current;
- }
- return m_current < m_generators.size();
- }
- };
-
- template<typename... Ts>
- GeneratorWrapper<std::tuple<Ts...>> table( std::initializer_list<std::tuple<typename std::decay<Ts>::type...>> tuples ) {
- return values<std::tuple<Ts...>>( tuples );
- }
-
- // Tag type to signal that a generator sequence should convert arguments to a specific type
- template <typename T>
- struct as {};
-
- template<typename T, typename... Gs>
- auto makeGenerators( GeneratorWrapper<T>&& generator, Gs &&... moreGenerators ) -> Generators<T> {
- return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...);
- }
- template<typename T>
- auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> {
- return Generators<T>(std::move(generator));
- }
- template<typename T, typename... Gs>
- auto makeGenerators( T&& val, Gs &&... moreGenerators ) -> Generators<T> {
- return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... );
- }
- template<typename T, typename U, typename... Gs>
- auto makeGenerators( as<T>, U&& val, Gs &&... moreGenerators ) -> Generators<T> {
- return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... );
- }
-
- auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
-
- template<typename L>
- // Note: The type after -> is weird, because VS2015 cannot parse
- // the expression used in the typedef inside, when it is in
- // return type. Yeah.
- auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
- using UnderlyingType = typename decltype(generatorExpression())::type;
-
- IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
- if (!tracker.hasGenerator()) {
- tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
- }
-
- auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
- return generator.get();
- }
-
-} // namespace Generators
-} // namespace Catch
-
-#define GENERATE( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-#define GENERATE_COPY( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-#define GENERATE_REF( ... ) \
- Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-
-// end catch_generators.hpp
-// start catch_generators_generic.hpp
-
-namespace Catch {
-namespace Generators {
-
- template <typename T>
- class TakeGenerator : public IGenerator<T> {
- GeneratorWrapper<T> m_generator;
- size_t m_returned = 0;
- size_t m_target;
- public:
- TakeGenerator(size_t target, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_target(target)
- {
- assert(target != 0 && "Empty generators are not allowed");
- }
- T const& get() const override {
- return m_generator.get();
- }
- bool next() override {
- ++m_returned;
- if (m_returned >= m_target) {
- return false;
- }
-
- const auto success = m_generator.next();
- // If the underlying generator does not contain enough values
- // then we cut short as well
- if (!success) {
- m_returned = m_target;
- }
- return success;
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(pf::make_unique<TakeGenerator<T>>(target, std::move(generator)));
- }
-
- template <typename T, typename Predicate>
- class FilterGenerator : public IGenerator<T> {
- GeneratorWrapper<T> m_generator;
- Predicate m_predicate;
- public:
- template <typename P = Predicate>
- FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_predicate(std::forward<P>(pred))
- {
- if (!m_predicate(m_generator.get())) {
- // It might happen that there are no values that pass the
- // filter. In that case we throw an exception.
- auto has_initial_value = next();
- if (!has_initial_value) {
- Catch::throw_exception(GeneratorException("No valid value found in filtered generator"));
- }
- }
- }
-
- T const& get() const override {
- return m_generator.get();
- }
-
- bool next() override {
- bool success = m_generator.next();
- if (!success) {
- return false;
- }
- while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true);
- return success;
- }
- };
-
- template <typename T, typename Predicate>
- GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(std::unique_ptr<IGenerator<T>>(pf::make_unique<FilterGenerator<T, Predicate>>(std::forward<Predicate>(pred), std::move(generator))));
- }
-
- template <typename T>
- class RepeatGenerator : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "RepeatGenerator currently does not support bools"
- "because of std::vector<bool> specialization");
- GeneratorWrapper<T> m_generator;
- mutable std::vector<T> m_returned;
- size_t m_target_repeats;
- size_t m_current_repeat = 0;
- size_t m_repeat_index = 0;
- public:
- RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_target_repeats(repeats)
- {
- assert(m_target_repeats > 0 && "Repeat generator must repeat at least once");
- }
-
- T const& get() const override {
- if (m_current_repeat == 0) {
- m_returned.push_back(m_generator.get());
- return m_returned.back();
- }
- return m_returned[m_repeat_index];
- }
-
- bool next() override {
- // There are 2 basic cases:
- // 1) We are still reading the generator
- // 2) We are reading our own cache
-
- // In the first case, we need to poke the underlying generator.
- // If it happily moves, we are left in that state, otherwise it is time to start reading from our cache
- if (m_current_repeat == 0) {
- const auto success = m_generator.next();
- if (!success) {
- ++m_current_repeat;
- }
- return m_current_repeat < m_target_repeats;
- }
-
- // In the second case, we need to move indices forward and check that we haven't run up against the end
- ++m_repeat_index;
- if (m_repeat_index == m_returned.size()) {
- m_repeat_index = 0;
- ++m_current_repeat;
- }
- return m_current_repeat < m_target_repeats;
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(pf::make_unique<RepeatGenerator<T>>(repeats, std::move(generator)));
- }
-
- template <typename T, typename U, typename Func>
- class MapGenerator : public IGenerator<T> {
- // TBD: provide static assert for mapping function, for friendly error message
- GeneratorWrapper<U> m_generator;
- Func m_function;
- // To avoid returning dangling reference, we have to save the values
- T m_cache;
- public:
- template <typename F2 = Func>
- MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) :
- m_generator(std::move(generator)),
- m_function(std::forward<F2>(function)),
- m_cache(m_function(m_generator.get()))
- {}
-
- T const& get() const override {
- return m_cache;
- }
- bool next() override {
- const auto success = m_generator.next();
- if (success) {
- m_cache = m_function(m_generator.get());
- }
- return success;
- }
- };
-
- template <typename Func, typename U, typename T = FunctionReturnType<Func, U>>
- GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
- return GeneratorWrapper<T>(
- pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator))
- );
- }
-
- template <typename T, typename U, typename Func>
- GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
- return GeneratorWrapper<T>(
- pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator))
- );
- }
-
- template <typename T>
- class ChunkGenerator final : public IGenerator<std::vector<T>> {
- std::vector<T> m_chunk;
- size_t m_chunk_size;
- GeneratorWrapper<T> m_generator;
- bool m_used_up = false;
- public:
- ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
- m_chunk_size(size), m_generator(std::move(generator))
- {
- m_chunk.reserve(m_chunk_size);
- if (m_chunk_size != 0) {
- m_chunk.push_back(m_generator.get());
- for (size_t i = 1; i < m_chunk_size; ++i) {
- if (!m_generator.next()) {
- Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk"));
- }
- m_chunk.push_back(m_generator.get());
- }
- }
- }
- std::vector<T> const& get() const override {
- return m_chunk;
- }
- bool next() override {
- m_chunk.clear();
- for (size_t idx = 0; idx < m_chunk_size; ++idx) {
- if (!m_generator.next()) {
- return false;
- }
- m_chunk.push_back(m_generator.get());
- }
- return true;
- }
- };
-
- template <typename T>
- GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<std::vector<T>>(
- pf::make_unique<ChunkGenerator<T>>(size, std::move(generator))
- );
- }
-
-} // namespace Generators
-} // namespace Catch
-
-// end catch_generators_generic.hpp
-// start catch_generators_specific.hpp
-
-// start catch_context.h
-
-#include <memory>
-
-namespace Catch {
-
- struct IResultCapture;
- struct IRunner;
- struct IConfig;
- struct IMutableContext;
-
- using IConfigPtr = std::shared_ptr<IConfig const>;
-
- struct IContext
- {
- virtual ~IContext();
-
- virtual IResultCapture* getResultCapture() = 0;
- virtual IRunner* getRunner() = 0;
- virtual IConfigPtr const& getConfig() const = 0;
- };
-
- struct IMutableContext : IContext
- {
- virtual ~IMutableContext();
- virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
- virtual void setRunner( IRunner* runner ) = 0;
- virtual void setConfig( IConfigPtr const& config ) = 0;
-
- private:
- static IMutableContext *currentContext;
- friend IMutableContext& getCurrentMutableContext();
- friend void cleanUpContext();
- static void createContext();
- };
-
- inline IMutableContext& getCurrentMutableContext()
- {
- if( !IMutableContext::currentContext )
- IMutableContext::createContext();
- // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn)
- return *IMutableContext::currentContext;
- }
-
- inline IContext& getCurrentContext()
- {
- return getCurrentMutableContext();
- }
-
- void cleanUpContext();
-
- class SimplePcg32;
- SimplePcg32& rng();
-}
-
-// end catch_context.h
-// start catch_interfaces_config.h
-
-// start catch_option.hpp
-
-namespace Catch {
-
- // An optional type
- template<typename T>
- class Option {
- public:
- Option() : nullableValue( nullptr ) {}
- Option( T const& _value )
- : nullableValue( new( storage ) T( _value ) )
- {}
- Option( Option const& _other )
- : nullableValue( _other ? new( storage ) T( *_other ) : nullptr )
- {}
-
- ~Option() {
- reset();
- }
-
- Option& operator= ( Option const& _other ) {
- if( &_other != this ) {
- reset();
- if( _other )
- nullableValue = new( storage ) T( *_other );
- }
- return *this;
- }
- Option& operator = ( T const& _value ) {
- reset();
- nullableValue = new( storage ) T( _value );
- return *this;
- }
-
- void reset() {
- if( nullableValue )
- nullableValue->~T();
- nullableValue = nullptr;
- }
-
- T& operator*() { return *nullableValue; }
- T const& operator*() const { return *nullableValue; }
- T* operator->() { return nullableValue; }
- const T* operator->() const { return nullableValue; }
-
- T valueOr( T const& defaultValue ) const {
- return nullableValue ? *nullableValue : defaultValue;
- }
-
- bool some() const { return nullableValue != nullptr; }
- bool none() const { return nullableValue == nullptr; }
-
- bool operator !() const { return nullableValue == nullptr; }
- explicit operator bool() const {
- return some();
- }
-
- private:
- T *nullableValue;
- alignas(alignof(T)) char storage[sizeof(T)];
- };
-
-} // end namespace Catch
-
-// end catch_option.hpp
-#include <chrono>
-#include <iosfwd>
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- enum class Verbosity {
- Quiet = 0,
- Normal,
- High
- };
-
- struct WarnAbout { enum What {
- Nothing = 0x00,
- NoAssertions = 0x01,
- NoTests = 0x02
- }; };
-
- struct ShowDurations { enum OrNot {
- DefaultForReporter,
- Always,
- Never
- }; };
- struct RunTests { enum InWhatOrder {
- InDeclarationOrder,
- InLexicographicalOrder,
- InRandomOrder
- }; };
- struct UseColour { enum YesOrNo {
- Auto,
- Yes,
- No
- }; };
- struct WaitForKeypress { enum When {
- Never,
- BeforeStart = 1,
- BeforeExit = 2,
- BeforeStartAndExit = BeforeStart | BeforeExit
- }; };
-
- class TestSpec;
-
- struct IConfig : NonCopyable {
-
- virtual ~IConfig();
-
- virtual bool allowThrows() const = 0;
- virtual std::ostream& stream() const = 0;
- virtual std::string name() const = 0;
- virtual bool includeSuccessfulResults() const = 0;
- virtual bool shouldDebugBreak() const = 0;
- virtual bool warnAboutMissingAssertions() const = 0;
- virtual bool warnAboutNoTests() const = 0;
- virtual int abortAfter() const = 0;
- virtual bool showInvisibles() const = 0;
- virtual ShowDurations::OrNot showDurations() const = 0;
- virtual TestSpec const& testSpec() const = 0;
- virtual bool hasTestFilters() const = 0;
- virtual std::vector<std::string> const& getTestsOrTags() const = 0;
- virtual RunTests::InWhatOrder runOrder() const = 0;
- virtual unsigned int rngSeed() const = 0;
- virtual UseColour::YesOrNo useColour() const = 0;
- virtual std::vector<std::string> const& getSectionsToRun() const = 0;
- virtual Verbosity verbosity() const = 0;
-
- virtual bool benchmarkNoAnalysis() const = 0;
- virtual int benchmarkSamples() const = 0;
- virtual double benchmarkConfidenceInterval() const = 0;
- virtual unsigned int benchmarkResamples() const = 0;
- virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0;
- };
-
- using IConfigPtr = std::shared_ptr<IConfig const>;
-}
-
-// end catch_interfaces_config.h
-// start catch_random_number_generator.h
-
-#include <cstdint>
-
-namespace Catch {
-
- // This is a simple implementation of C++11 Uniform Random Number
- // Generator. It does not provide all operators, because Catch2
- // does not use it, but it should behave as expected inside stdlib's
- // distributions.
- // The implementation is based on the PCG family (http://pcg-random.org)
- class SimplePcg32 {
- using state_type = std::uint64_t;
- public:
- using result_type = std::uint32_t;
- static constexpr result_type (min)() {
- return 0;
- }
- static constexpr result_type (max)() {
- return static_cast<result_type>(-1);
- }
-
- // Provide some default initial state for the default constructor
- SimplePcg32():SimplePcg32(0xed743cc4U) {}
-
- explicit SimplePcg32(result_type seed_);
-
- void seed(result_type seed_);
- void discard(uint64_t skip);
-
- result_type operator()();
-
- private:
- friend bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
- friend bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
-
- // In theory we also need operator<< and operator>>
- // In practice we do not use them, so we will skip them for now
-
- std::uint64_t m_state;
- // This part of the state determines which "stream" of the numbers
- // is chosen -- we take it as a constant for Catch2, so we only
- // need to deal with seeding the main state.
- // Picked by reading 8 bytes from `/dev/random` :-)
- static const std::uint64_t s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL;
- };
-
-} // end namespace Catch
-
-// end catch_random_number_generator.h
-#include <random>
-
-namespace Catch {
-namespace Generators {
-
-template <typename Float>
-class RandomFloatingGenerator final : public IGenerator<Float> {
- Catch::SimplePcg32& m_rng;
- std::uniform_real_distribution<Float> m_dist;
- Float m_current_number;
-public:
-
- RandomFloatingGenerator(Float a, Float b):
- m_rng(rng()),
- m_dist(a, b) {
- static_cast<void>(next());
- }
-
- Float const& get() const override {
- return m_current_number;
- }
- bool next() override {
- m_current_number = m_dist(m_rng);
- return true;
- }
-};
-
-template <typename Integer>
-class RandomIntegerGenerator final : public IGenerator<Integer> {
- Catch::SimplePcg32& m_rng;
- std::uniform_int_distribution<Integer> m_dist;
- Integer m_current_number;
-public:
-
- RandomIntegerGenerator(Integer a, Integer b):
- m_rng(rng()),
- m_dist(a, b) {
- static_cast<void>(next());
- }
-
- Integer const& get() const override {
- return m_current_number;
- }
- bool next() override {
- m_current_number = m_dist(m_rng);
- return true;
- }
-};
-
-// TODO: Ideally this would be also constrained against the various char types,
-// but I don't expect users to run into that in practice.
-template <typename T>
-typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value,
-GeneratorWrapper<T>>::type
-random(T a, T b) {
- return GeneratorWrapper<T>(
- pf::make_unique<RandomIntegerGenerator<T>>(a, b)
- );
-}
-
-template <typename T>
-typename std::enable_if<std::is_floating_point<T>::value,
-GeneratorWrapper<T>>::type
-random(T a, T b) {
- return GeneratorWrapper<T>(
- pf::make_unique<RandomFloatingGenerator<T>>(a, b)
- );
-}
-
-template <typename T>
-class RangeGenerator final : public IGenerator<T> {
- T m_current;
- T m_end;
- T m_step;
- bool m_positive;
-
-public:
- RangeGenerator(T const& start, T const& end, T const& step):
- m_current(start),
- m_end(end),
- m_step(step),
- m_positive(m_step > T(0))
- {
- assert(m_current != m_end && "Range start and end cannot be equal");
- assert(m_step != T(0) && "Step size cannot be zero");
- assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end");
- }
-
- RangeGenerator(T const& start, T const& end):
- RangeGenerator(start, end, (start < end) ? T(1) : T(-1))
- {}
-
- T const& get() const override {
- return m_current;
- }
-
- bool next() override {
- m_current += m_step;
- return (m_positive) ? (m_current < m_end) : (m_current > m_end);
- }
-};
-
-template <typename T>
-GeneratorWrapper<T> range(T const& start, T const& end, T const& step) {
- static_assert(std::is_arithmetic<T>::value && !std::is_same<T, bool>::value, "Type must be numeric");
- return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end, step));
-}
-
-template <typename T>
-GeneratorWrapper<T> range(T const& start, T const& end) {
- static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer");
- return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end));
-}
-
-template <typename T>
-class IteratorGenerator final : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "IteratorGenerator currently does not support bools"
- "because of std::vector<bool> specialization");
-
- std::vector<T> m_elems;
- size_t m_current = 0;
-public:
- template <typename InputIterator, typename InputSentinel>
- IteratorGenerator(InputIterator first, InputSentinel last):m_elems(first, last) {
- if (m_elems.empty()) {
- Catch::throw_exception(GeneratorException("IteratorGenerator received no valid values"));
- }
- }
-
- T const& get() const override {
- return m_elems[m_current];
- }
-
- bool next() override {
- ++m_current;
- return m_current != m_elems.size();
- }
-};
-
-template <typename InputIterator,
- typename InputSentinel,
- typename ResultType = typename std::iterator_traits<InputIterator>::value_type>
-GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) {
- return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(from, to));
-}
-
-template <typename Container,
- typename ResultType = typename Container::value_type>
-GeneratorWrapper<ResultType> from_range(Container const& cnt) {
- return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(cnt.begin(), cnt.end()));
-}
-
-} // namespace Generators
-} // namespace Catch
-
-// end catch_generators_specific.hpp
-
-// These files are included here so the single_include script doesn't put them
-// in the conditionally compiled sections
-// start catch_test_case_info.h
-
-#include <string>
-#include <vector>
-#include <memory>
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
- struct ITestInvoker;
-
- struct TestCaseInfo {
- enum SpecialProperties{
- None = 0,
- IsHidden = 1 << 1,
- ShouldFail = 1 << 2,
- MayFail = 1 << 3,
- Throws = 1 << 4,
- NonPortable = 1 << 5,
- Benchmark = 1 << 6
- };
-
- TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::vector<std::string> const& _tags,
- SourceLineInfo const& _lineInfo );
-
- friend void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags );
-
- bool isHidden() const;
- bool throws() const;
- bool okToFail() const;
- bool expectedToFail() const;
-
- std::string tagsAsString() const;
-
- std::string name;
- std::string className;
- std::string description;
- std::vector<std::string> tags;
- std::vector<std::string> lcaseTags;
- SourceLineInfo lineInfo;
- SpecialProperties properties;
- };
-
- class TestCase : public TestCaseInfo {
- public:
-
- TestCase( ITestInvoker* testCase, TestCaseInfo&& info );
-
- TestCase withName( std::string const& _newName ) const;
-
- void invoke() const;
-
- TestCaseInfo const& getTestCaseInfo() const;
-
- bool operator == ( TestCase const& other ) const;
- bool operator < ( TestCase const& other ) const;
-
- private:
- std::shared_ptr<ITestInvoker> test;
- };
-
- TestCase makeTestCase( ITestInvoker* testCase,
- std::string const& className,
- NameAndTags const& nameAndTags,
- SourceLineInfo const& lineInfo );
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_test_case_info.h
-// start catch_interfaces_runner.h
-
-namespace Catch {
-
- struct IRunner {
- virtual ~IRunner();
- virtual bool aborting() const = 0;
- };
-}
-
-// end catch_interfaces_runner.h
-
-#ifdef __OBJC__
-// start catch_objc.hpp
-
-#import <objc/runtime.h>
-
-#include <string>
-
-// NB. Any general catch headers included here must be included
-// in catch.hpp first to make sure they are included by the single
-// header for non obj-usage
-
-///////////////////////////////////////////////////////////////////////////////
-// This protocol is really only here for (self) documenting purposes, since
-// all its methods are optional.
-@protocol OcFixture
-
-@optional
-
--(void) setUp;
--(void) tearDown;
-
-@end
-
-namespace Catch {
-
- class OcMethod : public ITestInvoker {
-
- public:
- OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {}
-
- virtual void invoke() const {
- id obj = [[m_cls alloc] init];
-
- performOptionalSelector( obj, @selector(setUp) );
- performOptionalSelector( obj, m_sel );
- performOptionalSelector( obj, @selector(tearDown) );
-
- arcSafeRelease( obj );
- }
- private:
- virtual ~OcMethod() {}
-
- Class m_cls;
- SEL m_sel;
- };
-
- namespace Detail{
-
- inline std::string getAnnotation( Class cls,
- std::string const& annotationName,
- std::string const& testCaseName ) {
- NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()];
- SEL sel = NSSelectorFromString( selStr );
- arcSafeRelease( selStr );
- id value = performOptionalSelector( cls, sel );
- if( value )
- return [(NSString*)value UTF8String];
- return "";
- }
- }
-
- inline std::size_t registerTestMethods() {
- std::size_t noTestMethods = 0;
- int noClasses = objc_getClassList( nullptr, 0 );
-
- Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
- objc_getClassList( classes, noClasses );
-
- for( int c = 0; c < noClasses; c++ ) {
- Class cls = classes[c];
- {
- u_int count;
- Method* methods = class_copyMethodList( cls, &count );
- for( u_int m = 0; m < count ; m++ ) {
- SEL selector = method_getName(methods[m]);
- std::string methodName = sel_getName(selector);
- if( startsWith( methodName, "Catch_TestCase_" ) ) {
- std::string testCaseName = methodName.substr( 15 );
- std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
- std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
- const char* className = class_getName( cls );
-
- getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
- noTestMethods++;
- }
- }
- free(methods);
- }
- }
- return noTestMethods;
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-
- namespace Matchers {
- namespace Impl {
- namespace NSStringMatchers {
-
- struct StringHolder : MatcherBase<NSString*>{
- StringHolder( NSString* substr ) : m_substr( [substr copy] ){}
- StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){}
- StringHolder() {
- arcSafeRelease( m_substr );
- }
-
- bool match( NSString* str ) const override {
- return false;
- }
-
- NSString* CATCH_ARC_STRONG m_substr;
- };
-
- struct Equals : StringHolder {
- Equals( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str isEqualToString:m_substr];
- }
-
- std::string describe() const override {
- return "equals string: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- struct Contains : StringHolder {
- Contains( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location != NSNotFound;
- }
-
- std::string describe() const override {
- return "contains string: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- struct StartsWith : StringHolder {
- StartsWith( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == 0;
- }
-
- std::string describe() const override {
- return "starts with: " + Catch::Detail::stringify( m_substr );
- }
- };
- struct EndsWith : StringHolder {
- EndsWith( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == [str length] - [m_substr length];
- }
-
- std::string describe() const override {
- return "ends with: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- } // namespace NSStringMatchers
- } // namespace Impl
-
- inline Impl::NSStringMatchers::Equals
- Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); }
-
- inline Impl::NSStringMatchers::Contains
- Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); }
-
- inline Impl::NSStringMatchers::StartsWith
- StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); }
-
- inline Impl::NSStringMatchers::EndsWith
- EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); }
-
- } // namespace Matchers
-
- using namespace Matchers;
-
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-} // namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define OC_MAKE_UNIQUE_NAME( root, uniqueSuffix ) root##uniqueSuffix
-#define OC_TEST_CASE2( name, desc, uniqueSuffix ) \
-+(NSString*) OC_MAKE_UNIQUE_NAME( Catch_Name_test_, uniqueSuffix ) \
-{ \
-return @ name; \
-} \
-+(NSString*) OC_MAKE_UNIQUE_NAME( Catch_Description_test_, uniqueSuffix ) \
-{ \
-return @ desc; \
-} \
--(void) OC_MAKE_UNIQUE_NAME( Catch_TestCase_test_, uniqueSuffix )
-
-#define OC_TEST_CASE( name, desc ) OC_TEST_CASE2( name, desc, __LINE__ )
-
-// end catch_objc.hpp
-#endif
-
-// Benchmarking needs the externally-facing parts of reporters to work
-#if defined(CATCH_CONFIG_EXTERNAL_INTERFACES) || defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-// start catch_external_interfaces.h
-
-// start catch_reporter_bases.hpp
-
-// start catch_interfaces_reporter.h
-
-// start catch_config.hpp
-
-// start catch_test_spec_parser.h
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-// start catch_test_spec.h
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-// start catch_wildcard_pattern.h
-
-namespace Catch
-{
- class WildcardPattern {
- enum WildcardPosition {
- NoWildcard = 0,
- WildcardAtStart = 1,
- WildcardAtEnd = 2,
- WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
- };
-
- public:
-
- WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity );
- virtual ~WildcardPattern() = default;
- virtual bool matches( std::string const& str ) const;
-
- private:
- std::string normaliseString( std::string const& str ) const;
- CaseSensitive::Choice m_caseSensitivity;
- WildcardPosition m_wildcard = NoWildcard;
- std::string m_pattern;
- };
-}
-
-// end catch_wildcard_pattern.h
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- struct IConfig;
-
- class TestSpec {
- class Pattern {
- public:
- explicit Pattern( std::string const& name );
- virtual ~Pattern();
- virtual bool matches( TestCaseInfo const& testCase ) const = 0;
- std::string const& name() const;
- private:
- std::string const m_name;
- };
- using PatternPtr = std::shared_ptr<Pattern>;
-
- class NamePattern : public Pattern {
- public:
- explicit NamePattern( std::string const& name, std::string const& filterString );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- WildcardPattern m_wildcardPattern;
- };
-
- class TagPattern : public Pattern {
- public:
- explicit TagPattern( std::string const& tag, std::string const& filterString );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- std::string m_tag;
- };
-
- class ExcludedPattern : public Pattern {
- public:
- explicit ExcludedPattern( PatternPtr const& underlyingPattern );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- PatternPtr m_underlyingPattern;
- };
-
- struct Filter {
- std::vector<PatternPtr> m_patterns;
-
- bool matches( TestCaseInfo const& testCase ) const;
- std::string name() const;
- };
-
- public:
- struct FilterMatch {
- std::string name;
- std::vector<TestCase const*> tests;
- };
- using Matches = std::vector<FilterMatch>;
- using vectorStrings = std::vector<std::string>;
-
- bool hasFilters() const;
- bool matches( TestCaseInfo const& testCase ) const;
- Matches matchesByFilter( std::vector<TestCase> const& testCases, IConfig const& config ) const;
- const vectorStrings & getInvalidArgs() const;
-
- private:
- std::vector<Filter> m_filters;
- std::vector<std::string> m_invalidArgs;
- friend class TestSpecParser;
- };
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_test_spec.h
-// start catch_interfaces_tag_alias_registry.h
-
-#include <string>
-
-namespace Catch {
-
- struct TagAlias;
-
- struct ITagAliasRegistry {
- virtual ~ITagAliasRegistry();
- // Nullptr if not present
- virtual TagAlias const* find( std::string const& alias ) const = 0;
- virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0;
-
- static ITagAliasRegistry const& get();
- };
-
-} // end namespace Catch
-
-// end catch_interfaces_tag_alias_registry.h
-namespace Catch {
-
- class TestSpecParser {
- enum Mode{ None, Name, QuotedName, Tag, EscapedName };
- Mode m_mode = None;
- Mode lastMode = None;
- bool m_exclusion = false;
- std::size_t m_pos = 0;
- std::size_t m_realPatternPos = 0;
- std::string m_arg;
- std::string m_substring;
- std::string m_patternName;
- std::vector<std::size_t> m_escapeChars;
- TestSpec::Filter m_currentFilter;
- TestSpec m_testSpec;
- ITagAliasRegistry const* m_tagAliases = nullptr;
-
- public:
- TestSpecParser( ITagAliasRegistry const& tagAliases );
-
- TestSpecParser& parse( std::string const& arg );
- TestSpec testSpec();
-
- private:
- bool visitChar( char c );
- void startNewMode( Mode mode );
- bool processNoneChar( char c );
- void processNameChar( char c );
- bool processOtherChar( char c );
- void endMode();
- void escape();
- bool isControlChar( char c ) const;
- void saveLastMode();
- void revertBackToLastMode();
- void addFilter();
- bool separate();
-
- // Handles common preprocessing of the pattern for name/tag patterns
- std::string preprocessPattern();
- // Adds the current pattern as a test name
- void addNamePattern();
- // Adds the current pattern as a tag
- void addTagPattern();
-
- inline void addCharToPattern(char c) {
- m_substring += c;
- m_patternName += c;
- m_realPatternPos++;
- }
-
- };
- TestSpec parseTestSpec( std::string const& arg );
-
-} // namespace Catch
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_test_spec_parser.h
-// Libstdc++ doesn't like incomplete classes for unique_ptr
-
-#include <memory>
-#include <vector>
-#include <string>
-
-#ifndef CATCH_CONFIG_CONSOLE_WIDTH
-#define CATCH_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-namespace Catch {
-
- struct IStream;
-
- struct ConfigData {
- bool listTests = false;
- bool listTags = false;
- bool listReporters = false;
- bool listTestNamesOnly = false;
-
- bool showSuccessfulTests = false;
- bool shouldDebugBreak = false;
- bool noThrow = false;
- bool showHelp = false;
- bool showInvisibles = false;
- bool filenamesAsTags = false;
- bool libIdentify = false;
-
- int abortAfter = -1;
- unsigned int rngSeed = 0;
-
- bool benchmarkNoAnalysis = false;
- unsigned int benchmarkSamples = 100;
- double benchmarkConfidenceInterval = 0.95;
- unsigned int benchmarkResamples = 100000;
- std::chrono::milliseconds::rep benchmarkWarmupTime = 100;
-
- Verbosity verbosity = Verbosity::Normal;
- WarnAbout::What warnings = WarnAbout::Nothing;
- ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
- RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
- UseColour::YesOrNo useColour = UseColour::Auto;
- WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
-
- std::string outputFilename;
- std::string name;
- std::string processName;
-#ifndef CATCH_CONFIG_DEFAULT_REPORTER
-#define CATCH_CONFIG_DEFAULT_REPORTER "console"
-#endif
- std::string reporterName = CATCH_CONFIG_DEFAULT_REPORTER;
-#undef CATCH_CONFIG_DEFAULT_REPORTER
-
- std::vector<std::string> testsOrTags;
- std::vector<std::string> sectionsToRun;
- };
-
- class Config : public IConfig {
- public:
-
- Config() = default;
- Config( ConfigData const& data );
- virtual ~Config() = default;
-
- std::string const& getFilename() const;
-
- bool listTests() const;
- bool listTestNamesOnly() const;
- bool listTags() const;
- bool listReporters() const;
-
- std::string getProcessName() const;
- std::string const& getReporterName() const;
-
- std::vector<std::string> const& getTestsOrTags() const override;
- std::vector<std::string> const& getSectionsToRun() const override;
-
- TestSpec const& testSpec() const override;
- bool hasTestFilters() const override;
-
- bool showHelp() const;
-
- // IConfig interface
- bool allowThrows() const override;
- std::ostream& stream() const override;
- std::string name() const override;
- bool includeSuccessfulResults() const override;
- bool warnAboutMissingAssertions() const override;
- bool warnAboutNoTests() const override;
- ShowDurations::OrNot showDurations() const override;
- RunTests::InWhatOrder runOrder() const override;
- unsigned int rngSeed() const override;
- UseColour::YesOrNo useColour() const override;
- bool shouldDebugBreak() const override;
- int abortAfter() const override;
- bool showInvisibles() const override;
- Verbosity verbosity() const override;
- bool benchmarkNoAnalysis() const override;
- int benchmarkSamples() const override;
- double benchmarkConfidenceInterval() const override;
- unsigned int benchmarkResamples() const override;
- std::chrono::milliseconds benchmarkWarmupTime() const override;
-
- private:
-
- IStream const* openStream();
- ConfigData m_data;
-
- std::unique_ptr<IStream const> m_stream;
- TestSpec m_testSpec;
- bool m_hasTestFilters = false;
- };
-
-} // end namespace Catch
-
-// end catch_config.hpp
-// start catch_assertionresult.h
-
-#include <string>
-
-namespace Catch {
-
- struct AssertionResultData
- {
- AssertionResultData() = delete;
-
- AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression );
-
- std::string message;
- mutable std::string reconstructedExpression;
- LazyExpression lazyExpression;
- ResultWas::OfType resultType;
-
- std::string reconstructExpression() const;
- };
-
- class AssertionResult {
- public:
- AssertionResult() = delete;
- AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
-
- bool isOk() const;
- bool succeeded() const;
- ResultWas::OfType getResultType() const;
- bool hasExpression() const;
- bool hasMessage() const;
- std::string getExpression() const;
- std::string getExpressionInMacro() const;
- bool hasExpandedExpression() const;
- std::string getExpandedExpression() const;
- std::string getMessage() const;
- SourceLineInfo getSourceInfo() const;
- StringRef getTestMacroName() const;
-
- //protected:
- AssertionInfo m_info;
- AssertionResultData m_resultData;
- };
-
-} // end namespace Catch
-
-// end catch_assertionresult.h
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-// start catch_estimate.hpp
-
- // Statistics estimates
-
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct Estimate {
- Duration point;
- Duration lower_bound;
- Duration upper_bound;
- double confidence_interval;
-
- template <typename Duration2>
- operator Estimate<Duration2>() const {
- return { point, lower_bound, upper_bound, confidence_interval };
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_estimate.hpp
-// start catch_outlier_classification.hpp
-
-// Outlier information
-
-namespace Catch {
- namespace Benchmark {
- struct OutlierClassification {
- int samples_seen = 0;
- int low_severe = 0; // more than 3 times IQR below Q1
- int low_mild = 0; // 1.5 to 3 times IQR below Q1
- int high_mild = 0; // 1.5 to 3 times IQR above Q3
- int high_severe = 0; // more than 3 times IQR above Q3
-
- int total() const {
- return low_severe + low_mild + high_mild + high_severe;
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_outlier_classification.hpp
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-#include <string>
-#include <iosfwd>
-#include <map>
-#include <set>
-#include <memory>
-#include <algorithm>
-
-namespace Catch {
-
- struct ReporterConfig {
- explicit ReporterConfig( IConfigPtr const& _fullConfig );
-
- ReporterConfig( IConfigPtr const& _fullConfig, std::ostream& _stream );
-
- std::ostream& stream() const;
- IConfigPtr fullConfig() const;
-
- private:
- std::ostream* m_stream;
- IConfigPtr m_fullConfig;
- };
-
- struct ReporterPreferences {
- bool shouldRedirectStdOut = false;
- bool shouldReportAllAssertions = false;
- };
-
- template<typename T>
- struct LazyStat : Option<T> {
- LazyStat& operator=( T const& _value ) {
- Option<T>::operator=( _value );
- used = false;
- return *this;
- }
- void reset() {
- Option<T>::reset();
- used = false;
- }
- bool used = false;
- };
-
- struct TestRunInfo {
- TestRunInfo( std::string const& _name );
- std::string name;
- };
- struct GroupInfo {
- GroupInfo( std::string const& _name,
- std::size_t _groupIndex,
- std::size_t _groupsCount );
-
- std::string name;
- std::size_t groupIndex;
- std::size_t groupsCounts;
- };
-
- struct AssertionStats {
- AssertionStats( AssertionResult const& _assertionResult,
- std::vector<MessageInfo> const& _infoMessages,
- Totals const& _totals );
-
- AssertionStats( AssertionStats const& ) = default;
- AssertionStats( AssertionStats && ) = default;
- AssertionStats& operator = ( AssertionStats const& ) = delete;
- AssertionStats& operator = ( AssertionStats && ) = delete;
- virtual ~AssertionStats();
-
- AssertionResult assertionResult;
- std::vector<MessageInfo> infoMessages;
- Totals totals;
- };
-
- struct SectionStats {
- SectionStats( SectionInfo const& _sectionInfo,
- Counts const& _assertions,
- double _durationInSeconds,
- bool _missingAssertions );
- SectionStats( SectionStats const& ) = default;
- SectionStats( SectionStats && ) = default;
- SectionStats& operator = ( SectionStats const& ) = default;
- SectionStats& operator = ( SectionStats && ) = default;
- virtual ~SectionStats();
-
- SectionInfo sectionInfo;
- Counts assertions;
- double durationInSeconds;
- bool missingAssertions;
- };
-
- struct TestCaseStats {
- TestCaseStats( TestCaseInfo const& _testInfo,
- Totals const& _totals,
- std::string const& _stdOut,
- std::string const& _stdErr,
- bool _aborting );
-
- TestCaseStats( TestCaseStats const& ) = default;
- TestCaseStats( TestCaseStats && ) = default;
- TestCaseStats& operator = ( TestCaseStats const& ) = default;
- TestCaseStats& operator = ( TestCaseStats && ) = default;
- virtual ~TestCaseStats();
-
- TestCaseInfo testInfo;
- Totals totals;
- std::string stdOut;
- std::string stdErr;
- bool aborting;
- };
-
- struct TestGroupStats {
- TestGroupStats( GroupInfo const& _groupInfo,
- Totals const& _totals,
- bool _aborting );
- TestGroupStats( GroupInfo const& _groupInfo );
-
- TestGroupStats( TestGroupStats const& ) = default;
- TestGroupStats( TestGroupStats && ) = default;
- TestGroupStats& operator = ( TestGroupStats const& ) = default;
- TestGroupStats& operator = ( TestGroupStats && ) = default;
- virtual ~TestGroupStats();
-
- GroupInfo groupInfo;
- Totals totals;
- bool aborting;
- };
-
- struct TestRunStats {
- TestRunStats( TestRunInfo const& _runInfo,
- Totals const& _totals,
- bool _aborting );
-
- TestRunStats( TestRunStats const& ) = default;
- TestRunStats( TestRunStats && ) = default;
- TestRunStats& operator = ( TestRunStats const& ) = default;
- TestRunStats& operator = ( TestRunStats && ) = default;
- virtual ~TestRunStats();
-
- TestRunInfo runInfo;
- Totals totals;
- bool aborting;
- };
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- struct BenchmarkInfo {
- std::string name;
- double estimatedDuration;
- int iterations;
- int samples;
- unsigned int resamples;
- double clockResolution;
- double clockCost;
- };
-
- template <class Duration>
- struct BenchmarkStats {
- BenchmarkInfo info;
-
- std::vector<Duration> samples;
- Benchmark::Estimate<Duration> mean;
- Benchmark::Estimate<Duration> standardDeviation;
- Benchmark::OutlierClassification outliers;
- double outlierVariance;
-
- template <typename Duration2>
- operator BenchmarkStats<Duration2>() const {
- std::vector<Duration2> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
- return {
- info,
- std::move(samples2),
- mean,
- standardDeviation,
- outliers,
- outlierVariance,
- };
- }
- };
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- struct IStreamingReporter {
- virtual ~IStreamingReporter() = default;
-
- // Implementing class must also provide the following static methods:
- // static std::string getDescription();
- // static std::set<Verbosity> getSupportedVerbosities()
-
- virtual ReporterPreferences getPreferences() const = 0;
-
- virtual void noMatchingTestCases( std::string const& spec ) = 0;
-
- virtual void reportInvalidArguments(std::string const&) {}
-
- virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0;
- virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0;
-
- virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0;
- virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- virtual void benchmarkPreparing( std::string const& ) {}
- virtual void benchmarkStarting( BenchmarkInfo const& ) {}
- virtual void benchmarkEnded( BenchmarkStats<> const& ) {}
- virtual void benchmarkFailed( std::string const& ) {}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
-
- // The return value indicates if the messages buffer should be cleared:
- virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
-
- virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0;
- virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;
-
- virtual void skipTest( TestCaseInfo const& testInfo ) = 0;
-
- // Default empty implementation provided
- virtual void fatalErrorEncountered( StringRef name );
-
- virtual bool isMulti() const;
- };
- using IStreamingReporterPtr = std::unique_ptr<IStreamingReporter>;
-
- struct IReporterFactory {
- virtual ~IReporterFactory();
- virtual IStreamingReporterPtr create( ReporterConfig const& config ) const = 0;
- virtual std::string getDescription() const = 0;
- };
- using IReporterFactoryPtr = std::shared_ptr<IReporterFactory>;
-
- struct IReporterRegistry {
- using FactoryMap = std::map<std::string, IReporterFactoryPtr>;
- using Listeners = std::vector<IReporterFactoryPtr>;
-
- virtual ~IReporterRegistry();
- virtual IStreamingReporterPtr create( std::string const& name, IConfigPtr const& config ) const = 0;
- virtual FactoryMap const& getFactories() const = 0;
- virtual Listeners const& getListeners() const = 0;
- };
-
-} // end namespace Catch
-
-// end catch_interfaces_reporter.h
-#include <algorithm>
-#include <cstring>
-#include <cfloat>
-#include <cstdio>
-#include <cassert>
-#include <memory>
-#include <ostream>
-
-namespace Catch {
- void prepareExpandedExpression(AssertionResult& result);
-
- // Returns double formatted as %.3f (format expected on output)
- std::string getFormattedDuration( double duration );
-
- std::string serializeFilters( std::vector<std::string> const& container );
-
- template<typename DerivedT>
- struct StreamingReporterBase : IStreamingReporter {
-
- StreamingReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
- CATCH_ERROR( "Verbosity level not supported by this reporter" );
- }
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- ~StreamingReporterBase() override = default;
-
- void noMatchingTestCases(std::string const&) override {}
-
- void reportInvalidArguments(std::string const&) override {}
-
- void testRunStarting(TestRunInfo const& _testRunInfo) override {
- currentTestRunInfo = _testRunInfo;
- }
-
- void testGroupStarting(GroupInfo const& _groupInfo) override {
- currentGroupInfo = _groupInfo;
- }
-
- void testCaseStarting(TestCaseInfo const& _testInfo) override {
- currentTestCaseInfo = _testInfo;
- }
- void sectionStarting(SectionInfo const& _sectionInfo) override {
- m_sectionStack.push_back(_sectionInfo);
- }
-
- void sectionEnded(SectionStats const& /* _sectionStats */) override {
- m_sectionStack.pop_back();
- }
- void testCaseEnded(TestCaseStats const& /* _testCaseStats */) override {
- currentTestCaseInfo.reset();
- }
- void testGroupEnded(TestGroupStats const& /* _testGroupStats */) override {
- currentGroupInfo.reset();
- }
- void testRunEnded(TestRunStats const& /* _testRunStats */) override {
- currentTestCaseInfo.reset();
- currentGroupInfo.reset();
- currentTestRunInfo.reset();
- }
-
- void skipTest(TestCaseInfo const&) override {
- // Don't do anything with this by default.
- // It can optionally be overridden in the derived class.
- }
-
- IConfigPtr m_config;
- std::ostream& stream;
-
- LazyStat<TestRunInfo> currentTestRunInfo;
- LazyStat<GroupInfo> currentGroupInfo;
- LazyStat<TestCaseInfo> currentTestCaseInfo;
-
- std::vector<SectionInfo> m_sectionStack;
- ReporterPreferences m_reporterPrefs;
- };
-
- template<typename DerivedT>
- struct CumulativeReporterBase : IStreamingReporter {
- template<typename T, typename ChildNodeT>
- struct Node {
- explicit Node( T const& _value ) : value( _value ) {}
- virtual ~Node() {}
-
- using ChildNodes = std::vector<std::shared_ptr<ChildNodeT>>;
- T value;
- ChildNodes children;
- };
- struct SectionNode {
- explicit SectionNode(SectionStats const& _stats) : stats(_stats) {}
- virtual ~SectionNode() = default;
-
- bool operator == (SectionNode const& other) const {
- return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
- }
- bool operator == (std::shared_ptr<SectionNode> const& other) const {
- return operator==(*other);
- }
-
- SectionStats stats;
- using ChildSections = std::vector<std::shared_ptr<SectionNode>>;
- using Assertions = std::vector<AssertionStats>;
- ChildSections childSections;
- Assertions assertions;
- std::string stdOut;
- std::string stdErr;
- };
-
- struct BySectionInfo {
- BySectionInfo( SectionInfo const& other ) : m_other( other ) {}
- BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {}
- bool operator() (std::shared_ptr<SectionNode> const& node) const {
- return ((node->stats.sectionInfo.name == m_other.name) &&
- (node->stats.sectionInfo.lineInfo == m_other.lineInfo));
- }
- void operator=(BySectionInfo const&) = delete;
-
- private:
- SectionInfo const& m_other;
- };
-
- using TestCaseNode = Node<TestCaseStats, SectionNode>;
- using TestGroupNode = Node<TestGroupStats, TestCaseNode>;
- using TestRunNode = Node<TestRunStats, TestGroupNode>;
-
- CumulativeReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
- CATCH_ERROR( "Verbosity level not supported by this reporter" );
- }
- ~CumulativeReporterBase() override = default;
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- void testRunStarting( TestRunInfo const& ) override {}
- void testGroupStarting( GroupInfo const& ) override {}
-
- void testCaseStarting( TestCaseInfo const& ) override {}
-
- void sectionStarting( SectionInfo const& sectionInfo ) override {
- SectionStats incompleteStats( sectionInfo, Counts(), 0, false );
- std::shared_ptr<SectionNode> node;
- if( m_sectionStack.empty() ) {
- if( !m_rootSection )
- m_rootSection = std::make_shared<SectionNode>( incompleteStats );
- node = m_rootSection;
- }
- else {
- SectionNode& parentNode = *m_sectionStack.back();
- auto it =
- std::find_if( parentNode.childSections.begin(),
- parentNode.childSections.end(),
- BySectionInfo( sectionInfo ) );
- if( it == parentNode.childSections.end() ) {
- node = std::make_shared<SectionNode>( incompleteStats );
- parentNode.childSections.push_back( node );
- }
- else
- node = *it;
- }
- m_sectionStack.push_back( node );
- m_deepestSection = std::move(node);
- }
-
- void assertionStarting(AssertionInfo const&) override {}
-
- bool assertionEnded(AssertionStats const& assertionStats) override {
- assert(!m_sectionStack.empty());
- // AssertionResult holds a pointer to a temporary DecomposedExpression,
- // which getExpandedExpression() calls to build the expression string.
- // Our section stack copy of the assertionResult will likely outlive the
- // temporary, so it must be expanded or discarded now to avoid calling
- // a destroyed object later.
- prepareExpandedExpression(const_cast<AssertionResult&>( assertionStats.assertionResult ) );
- SectionNode& sectionNode = *m_sectionStack.back();
- sectionNode.assertions.push_back(assertionStats);
- return true;
- }
- void sectionEnded(SectionStats const& sectionStats) override {
- assert(!m_sectionStack.empty());
- SectionNode& node = *m_sectionStack.back();
- node.stats = sectionStats;
- m_sectionStack.pop_back();
- }
- void testCaseEnded(TestCaseStats const& testCaseStats) override {
- auto node = std::make_shared<TestCaseNode>(testCaseStats);
- assert(m_sectionStack.size() == 0);
- node->children.push_back(m_rootSection);
- m_testCases.push_back(node);
- m_rootSection.reset();
-
- assert(m_deepestSection);
- m_deepestSection->stdOut = testCaseStats.stdOut;
- m_deepestSection->stdErr = testCaseStats.stdErr;
- }
- void testGroupEnded(TestGroupStats const& testGroupStats) override {
- auto node = std::make_shared<TestGroupNode>(testGroupStats);
- node->children.swap(m_testCases);
- m_testGroups.push_back(node);
- }
- void testRunEnded(TestRunStats const& testRunStats) override {
- auto node = std::make_shared<TestRunNode>(testRunStats);
- node->children.swap(m_testGroups);
- m_testRuns.push_back(node);
- testRunEndedCumulative();
- }
- virtual void testRunEndedCumulative() = 0;
-
- void skipTest(TestCaseInfo const&) override {}
-
- IConfigPtr m_config;
- std::ostream& stream;
- std::vector<AssertionStats> m_assertions;
- std::vector<std::vector<std::shared_ptr<SectionNode>>> m_sections;
- std::vector<std::shared_ptr<TestCaseNode>> m_testCases;
- std::vector<std::shared_ptr<TestGroupNode>> m_testGroups;
-
- std::vector<std::shared_ptr<TestRunNode>> m_testRuns;
-
- std::shared_ptr<SectionNode> m_rootSection;
- std::shared_ptr<SectionNode> m_deepestSection;
- std::vector<std::shared_ptr<SectionNode>> m_sectionStack;
- ReporterPreferences m_reporterPrefs;
- };
-
- template<char C>
- char const* getLineOfChars() {
- static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
- if( !*line ) {
- std::memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
- line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
- }
- return line;
- }
-
- struct TestEventListenerBase : StreamingReporterBase<TestEventListenerBase> {
- TestEventListenerBase( ReporterConfig const& _config );
-
- static std::set<Verbosity> getSupportedVerbosities();
-
- void assertionStarting(AssertionInfo const&) override;
- bool assertionEnded(AssertionStats const&) override;
- };
-
-} // end namespace Catch
-
-// end catch_reporter_bases.hpp
-// start catch_console_colour.h
-
-namespace Catch {
-
- struct Colour {
- enum Code {
- None = 0,
-
- White,
- Red,
- Green,
- Blue,
- Cyan,
- Yellow,
- Grey,
-
- Bright = 0x10,
-
- BrightRed = Bright | Red,
- BrightGreen = Bright | Green,
- LightGrey = Bright | Grey,
- BrightWhite = Bright | White,
- BrightYellow = Bright | Yellow,
-
- // By intention
- FileName = LightGrey,
- Warning = BrightYellow,
- ResultError = BrightRed,
- ResultSuccess = BrightGreen,
- ResultExpectedFailure = Warning,
-
- Error = BrightRed,
- Success = Green,
-
- OriginalExpression = Cyan,
- ReconstructedExpression = BrightYellow,
-
- SecondaryText = LightGrey,
- Headers = White
- };
-
- // Use constructed object for RAII guard
- Colour( Code _colourCode );
- Colour( Colour&& other ) noexcept;
- Colour& operator=( Colour&& other ) noexcept;
- ~Colour();
-
- // Use static method for one-shot changes
- static void use( Code _colourCode );
-
- private:
- bool m_moved = false;
- };
-
- std::ostream& operator << ( std::ostream& os, Colour const& );
-
-} // end namespace Catch
-
-// end catch_console_colour.h
-// start catch_reporter_registrars.hpp
-
-
-namespace Catch {
-
- template<typename T>
- class ReporterRegistrar {
-
- class ReporterFactory : public IReporterFactory {
-
- IStreamingReporterPtr create( ReporterConfig const& config ) const override {
- return std::unique_ptr<T>( new T( config ) );
- }
-
- std::string getDescription() const override {
- return T::getDescription();
- }
- };
-
- public:
-
- explicit ReporterRegistrar( std::string const& name ) {
- getMutableRegistryHub().registerReporter( name, std::make_shared<ReporterFactory>() );
- }
- };
-
- template<typename T>
- class ListenerRegistrar {
-
- class ListenerFactory : public IReporterFactory {
-
- IStreamingReporterPtr create( ReporterConfig const& config ) const override {
- return std::unique_ptr<T>( new T( config ) );
- }
- std::string getDescription() const override {
- return std::string();
- }
- };
-
- public:
-
- ListenerRegistrar() {
- getMutableRegistryHub().registerListener( std::make_shared<ListenerFactory>() );
- }
- };
-}
-
-#if !defined(CATCH_CONFIG_DISABLE)
-
-#define CATCH_REGISTER_REPORTER( name, reporterType ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#define CATCH_REGISTER_LISTENER( listenerType ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ListenerRegistrar<listenerType> catch_internal_RegistrarFor##listenerType; } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-#else // CATCH_CONFIG_DISABLE
-
-#define CATCH_REGISTER_REPORTER(name, reporterType)
-#define CATCH_REGISTER_LISTENER(listenerType)
-
-#endif // CATCH_CONFIG_DISABLE
-
-// end catch_reporter_registrars.hpp
-// Allow users to base their work off existing reporters
-// start catch_reporter_compact.h
-
-namespace Catch {
-
- struct CompactReporter : StreamingReporterBase<CompactReporter> {
-
- using StreamingReporterBase::StreamingReporterBase;
-
- ~CompactReporter() override;
-
- static std::string getDescription();
-
- ReporterPreferences getPreferences() const override;
-
- void noMatchingTestCases(std::string const& spec) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& _assertionStats) override;
-
- void sectionEnded(SectionStats const& _sectionStats) override;
-
- void testRunEnded(TestRunStats const& _testRunStats) override;
-
- };
-
-} // end namespace Catch
-
-// end catch_reporter_compact.h
-// start catch_reporter_console.h
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled
- // and default is missing) is enabled
-#endif
-
-namespace Catch {
- // Fwd decls
- struct SummaryColumn;
- class TablePrinter;
-
- struct ConsoleReporter : StreamingReporterBase<ConsoleReporter> {
- std::unique_ptr<TablePrinter> m_tablePrinter;
-
- ConsoleReporter(ReporterConfig const& config);
- ~ConsoleReporter() override;
- static std::string getDescription();
-
- void noMatchingTestCases(std::string const& spec) override;
-
- void reportInvalidArguments(std::string const&arg) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& _assertionStats) override;
-
- void sectionStarting(SectionInfo const& _sectionInfo) override;
- void sectionEnded(SectionStats const& _sectionStats) override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting(BenchmarkInfo const& info) override;
- void benchmarkEnded(BenchmarkStats<> const& stats) override;
- void benchmarkFailed(std::string const& error) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void testCaseEnded(TestCaseStats const& _testCaseStats) override;
- void testGroupEnded(TestGroupStats const& _testGroupStats) override;
- void testRunEnded(TestRunStats const& _testRunStats) override;
- void testRunStarting(TestRunInfo const& _testRunInfo) override;
- private:
-
- void lazyPrint();
-
- void lazyPrintWithoutClosingBenchmarkTable();
- void lazyPrintRunInfo();
- void lazyPrintGroupInfo();
- void printTestCaseAndSectionHeader();
-
- void printClosedHeader(std::string const& _name);
- void printOpenHeader(std::string const& _name);
-
- // if string has a : in first line will set indent to follow it on
- // subsequent lines
- void printHeaderString(std::string const& _string, std::size_t indent = 0);
-
- void printTotals(Totals const& totals);
- void printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row);
-
- void printTotalsDivider(Totals const& totals);
- void printSummaryDivider();
- void printTestFilters();
-
- private:
- bool m_headerPrinted = false;
- };
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-// end catch_reporter_console.h
-// start catch_reporter_junit.h
-
-// start catch_xmlwriter.h
-
-#include <vector>
-
-namespace Catch {
- enum class XmlFormatting {
- None = 0x00,
- Indent = 0x01,
- Newline = 0x02,
- };
-
- XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs);
- XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs);
-
- class XmlEncode {
- public:
- enum ForWhat { ForTextNodes, ForAttributes };
-
- XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes );
-
- void encodeTo( std::ostream& os ) const;
-
- friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode );
-
- private:
- std::string m_str;
- ForWhat m_forWhat;
- };
-
- class XmlWriter {
- public:
-
- class ScopedElement {
- public:
- ScopedElement( XmlWriter* writer, XmlFormatting fmt );
-
- ScopedElement( ScopedElement&& other ) noexcept;
- ScopedElement& operator=( ScopedElement&& other ) noexcept;
-
- ~ScopedElement();
-
- ScopedElement& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent );
-
- template<typename T>
- ScopedElement& writeAttribute( std::string const& name, T const& attribute ) {
- m_writer->writeAttribute( name, attribute );
- return *this;
- }
-
- private:
- mutable XmlWriter* m_writer = nullptr;
- XmlFormatting m_fmt;
- };
-
- XmlWriter( std::ostream& os = Catch::cout() );
- ~XmlWriter();
-
- XmlWriter( XmlWriter const& ) = delete;
- XmlWriter& operator=( XmlWriter const& ) = delete;
-
- XmlWriter& startElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- ScopedElement scopedElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& endElement(XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& writeAttribute( std::string const& name, std::string const& attribute );
-
- XmlWriter& writeAttribute( std::string const& name, bool attribute );
-
- template<typename T>
- XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
- ReusableStringStream rss;
- rss << attribute;
- return writeAttribute( name, rss.str() );
- }
-
- XmlWriter& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& writeComment(std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- void writeStylesheetRef( std::string const& url );
-
- XmlWriter& writeBlankLine();
-
- void ensureTagClosed();
-
- private:
-
- void applyFormatting(XmlFormatting fmt);
-
- void writeDeclaration();
-
- void newlineIfNecessary();
-
- bool m_tagIsOpen = false;
- bool m_needsNewline = false;
- std::vector<std::string> m_tags;
- std::string m_indent;
- std::ostream& m_os;
- };
-
-}
-
-// end catch_xmlwriter.h
-namespace Catch {
-
- class JunitReporter : public CumulativeReporterBase<JunitReporter> {
- public:
- JunitReporter(ReporterConfig const& _config);
-
- ~JunitReporter() override;
-
- static std::string getDescription();
-
- void noMatchingTestCases(std::string const& /*spec*/) override;
-
- void testRunStarting(TestRunInfo const& runInfo) override;
-
- void testGroupStarting(GroupInfo const& groupInfo) override;
-
- void testCaseStarting(TestCaseInfo const& testCaseInfo) override;
- bool assertionEnded(AssertionStats const& assertionStats) override;
-
- void testCaseEnded(TestCaseStats const& testCaseStats) override;
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override;
-
- void testRunEndedCumulative() override;
-
- void writeGroup(TestGroupNode const& groupNode, double suiteTime);
-
- void writeTestCase(TestCaseNode const& testCaseNode);
-
- void writeSection(std::string const& className,
- std::string const& rootName,
- SectionNode const& sectionNode);
-
- void writeAssertions(SectionNode const& sectionNode);
- void writeAssertion(AssertionStats const& stats);
-
- XmlWriter xml;
- Timer suiteTimer;
- std::string stdOutForSuite;
- std::string stdErrForSuite;
- unsigned int unexpectedExceptions = 0;
- bool m_okToFail = false;
- };
-
-} // end namespace Catch
-
-// end catch_reporter_junit.h
-// start catch_reporter_xml.h
-
-namespace Catch {
- class XmlReporter : public StreamingReporterBase<XmlReporter> {
- public:
- XmlReporter(ReporterConfig const& _config);
-
- ~XmlReporter() override;
-
- static std::string getDescription();
-
- virtual std::string getStylesheetRef() const;
-
- void writeSourceInfo(SourceLineInfo const& sourceInfo);
-
- public: // StreamingReporterBase
-
- void noMatchingTestCases(std::string const& s) override;
-
- void testRunStarting(TestRunInfo const& testInfo) override;
-
- void testGroupStarting(GroupInfo const& groupInfo) override;
-
- void testCaseStarting(TestCaseInfo const& testInfo) override;
-
- void sectionStarting(SectionInfo const& sectionInfo) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& assertionStats) override;
-
- void sectionEnded(SectionStats const& sectionStats) override;
-
- void testCaseEnded(TestCaseStats const& testCaseStats) override;
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override;
-
- void testRunEnded(TestRunStats const& testRunStats) override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting(BenchmarkInfo const&) override;
- void benchmarkEnded(BenchmarkStats<> const&) override;
- void benchmarkFailed(std::string const&) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- private:
- Timer m_testCaseTimer;
- XmlWriter m_xml;
- int m_sectionDepth = 0;
- };
-
-} // end namespace Catch
-
-// end catch_reporter_xml.h
-
-// end catch_external_interfaces.h
-#endif
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-// start catch_benchmarking_all.hpp
-
-// A proxy header that includes all of the benchmarking headers to allow
-// concise include of the benchmarking features. You should prefer the
-// individual includes in standard use.
-
-// start catch_benchmark.hpp
-
- // Benchmark
-
-// start catch_chronometer.hpp
-
-// User-facing chronometer
-
-
-// start catch_clock.hpp
-
-// Clocks
-
-
-#include <chrono>
-#include <ratio>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Clock>
- using ClockDuration = typename Clock::duration;
- template <typename Clock>
- using FloatDuration = std::chrono::duration<double, typename Clock::period>;
-
- template <typename Clock>
- using TimePoint = typename Clock::time_point;
-
- using default_clock = std::chrono::steady_clock;
-
- template <typename Clock>
- struct now {
- TimePoint<Clock> operator()() const {
- return Clock::now();
- }
- };
-
- using fp_seconds = std::chrono::duration<double, std::ratio<1>>;
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_clock.hpp
-// start catch_optimizer.hpp
-
- // Hinting the optimizer
-
-
-#if defined(_MSC_VER)
-# include <atomic> // atomic_thread_fence
-#endif
-
-namespace Catch {
- namespace Benchmark {
-#if defined(__GNUC__) || defined(__clang__)
- template <typename T>
- inline void keep_memory(T* p) {
- asm volatile("" : : "g"(p) : "memory");
- }
- inline void keep_memory() {
- asm volatile("" : : : "memory");
- }
-
- namespace Detail {
- inline void optimizer_barrier() { keep_memory(); }
- } // namespace Detail
-#elif defined(_MSC_VER)
-
-#pragma optimize("", off)
- template <typename T>
- inline void keep_memory(T* p) {
- // thanks @milleniumbug
- *reinterpret_cast<char volatile*>(p) = *reinterpret_cast<char const volatile*>(p);
- }
- // TODO equivalent keep_memory()
-#pragma optimize("", on)
-
- namespace Detail {
- inline void optimizer_barrier() {
- std::atomic_thread_fence(std::memory_order_seq_cst);
- }
- } // namespace Detail
-
-#endif
-
- template <typename T>
- inline void deoptimize_value(T&& x) {
- keep_memory(&x);
- }
-
- template <typename Fn, typename... Args>
- inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<!std::is_same<void, decltype(fn(args...))>::value>::type {
- deoptimize_value(std::forward<Fn>(fn) (std::forward<Args...>(args...)));
- }
-
- template <typename Fn, typename... Args>
- inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<std::is_same<void, decltype(fn(args...))>::value>::type {
- std::forward<Fn>(fn) (std::forward<Args...>(args...));
- }
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_optimizer.hpp
-// start catch_complete_invoke.hpp
-
-// Invoke with a special case for void
-
-
-#include <type_traits>
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T>
- struct CompleteType { using type = T; };
- template <>
- struct CompleteType<void> { struct type {}; };
-
- template <typename T>
- using CompleteType_t = typename CompleteType<T>::type;
-
- template <typename Result>
- struct CompleteInvoker {
- template <typename Fun, typename... Args>
- static Result invoke(Fun&& fun, Args&&... args) {
- return std::forward<Fun>(fun)(std::forward<Args>(args)...);
- }
- };
- template <>
- struct CompleteInvoker<void> {
- template <typename Fun, typename... Args>
- static CompleteType_t<void> invoke(Fun&& fun, Args&&... args) {
- std::forward<Fun>(fun)(std::forward<Args>(args)...);
- return {};
- }
- };
- template <typename Sig>
- using ResultOf_t = typename std::result_of<Sig>::type;
-
- // invoke and not return void :(
- template <typename Fun, typename... Args>
- CompleteType_t<ResultOf_t<Fun(Args...)>> complete_invoke(Fun&& fun, Args&&... args) {
- return CompleteInvoker<ResultOf_t<Fun(Args...)>>::invoke(std::forward<Fun>(fun), std::forward<Args>(args)...);
- }
-
- const std::string benchmarkErrorMsg = "a benchmark failed to run successfully";
- } // namespace Detail
-
- template <typename Fun>
- Detail::CompleteType_t<Detail::ResultOf_t<Fun()>> user_code(Fun&& fun) {
- CATCH_TRY{
- return Detail::complete_invoke(std::forward<Fun>(fun));
- } CATCH_CATCH_ALL{
- getResultCapture().benchmarkFailed(translateActiveException());
- CATCH_RUNTIME_ERROR(Detail::benchmarkErrorMsg);
- }
- }
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_complete_invoke.hpp
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- struct ChronometerConcept {
- virtual void start() = 0;
- virtual void finish() = 0;
- virtual ~ChronometerConcept() = default;
- };
- template <typename Clock>
- struct ChronometerModel final : public ChronometerConcept {
- void start() override { started = Clock::now(); }
- void finish() override { finished = Clock::now(); }
-
- ClockDuration<Clock> elapsed() const { return finished - started; }
-
- TimePoint<Clock> started;
- TimePoint<Clock> finished;
- };
- } // namespace Detail
-
- struct Chronometer {
- public:
- template <typename Fun>
- void measure(Fun&& fun) { measure(std::forward<Fun>(fun), is_callable<Fun(int)>()); }
-
- int runs() const { return k; }
-
- Chronometer(Detail::ChronometerConcept& meter, int k)
- : impl(&meter)
- , k(k) {}
-
- private:
- template <typename Fun>
- void measure(Fun&& fun, std::false_type) {
- measure([&fun](int) { return fun(); }, std::true_type());
- }
-
- template <typename Fun>
- void measure(Fun&& fun, std::true_type) {
- Detail::optimizer_barrier();
- impl->start();
- for (int i = 0; i < k; ++i) invoke_deoptimized(fun, i);
- impl->finish();
- Detail::optimizer_barrier();
- }
-
- Detail::ChronometerConcept* impl;
- int k;
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_chronometer.hpp
-// start catch_environment.hpp
-
-// Environment information
-
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct EnvironmentEstimate {
- Duration mean;
- OutlierClassification outliers;
-
- template <typename Duration2>
- operator EnvironmentEstimate<Duration2>() const {
- return { mean, outliers };
- }
- };
- template <typename Clock>
- struct Environment {
- using clock_type = Clock;
- EnvironmentEstimate<FloatDuration<Clock>> clock_resolution;
- EnvironmentEstimate<FloatDuration<Clock>> clock_cost;
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_environment.hpp
-// start catch_execution_plan.hpp
-
- // Execution plan
-
-
-// start catch_benchmark_function.hpp
-
- // Dumb std::function implementation for consistent call overhead
-
-
-#include <cassert>
-#include <type_traits>
-#include <utility>
-#include <memory>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T>
- using Decay = typename std::decay<T>::type;
- template <typename T, typename U>
- struct is_related
- : std::is_same<Decay<T>, Decay<U>> {};
-
- /// We need to reinvent std::function because every piece of code that might add overhead
- /// in a measurement context needs to have consistent performance characteristics so that we
- /// can account for it in the measurement.
- /// Implementations of std::function with optimizations that aren't always applicable, like
- /// small buffer optimizations, are not uncommon.
- /// This is effectively an implementation of std::function without any such optimizations;
- /// it may be slow, but it is consistently slow.
- struct BenchmarkFunction {
- private:
- struct callable {
- virtual void call(Chronometer meter) const = 0;
- virtual callable* clone() const = 0;
- virtual ~callable() = default;
- };
- template <typename Fun>
- struct model : public callable {
- model(Fun&& fun) : fun(std::move(fun)) {}
- model(Fun const& fun) : fun(fun) {}
-
- model<Fun>* clone() const override { return new model<Fun>(*this); }
-
- void call(Chronometer meter) const override {
- call(meter, is_callable<Fun(Chronometer)>());
- }
- void call(Chronometer meter, std::true_type) const {
- fun(meter);
- }
- void call(Chronometer meter, std::false_type) const {
- meter.measure(fun);
- }
-
- Fun fun;
- };
-
- struct do_nothing { void operator()() const {} };
-
- template <typename T>
- BenchmarkFunction(model<T>* c) : f(c) {}
-
- public:
- BenchmarkFunction()
- : f(new model<do_nothing>{ {} }) {}
-
- template <typename Fun,
- typename std::enable_if<!is_related<Fun, BenchmarkFunction>::value, int>::type = 0>
- BenchmarkFunction(Fun&& fun)
- : f(new model<typename std::decay<Fun>::type>(std::forward<Fun>(fun))) {}
-
- BenchmarkFunction(BenchmarkFunction&& that)
- : f(std::move(that.f)) {}
-
- BenchmarkFunction(BenchmarkFunction const& that)
- : f(that.f->clone()) {}
-
- BenchmarkFunction& operator=(BenchmarkFunction&& that) {
- f = std::move(that.f);
- return *this;
- }
-
- BenchmarkFunction& operator=(BenchmarkFunction const& that) {
- f.reset(that.f->clone());
- return *this;
- }
-
- void operator()(Chronometer meter) const { f->call(meter); }
-
- private:
- std::unique_ptr<callable> f;
- };
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_benchmark_function.hpp
-// start catch_repeat.hpp
-
-// repeat algorithm
-
-
-#include <type_traits>
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Fun>
- struct repeater {
- void operator()(int k) const {
- for (int i = 0; i < k; ++i) {
- fun();
- }
- }
- Fun fun;
- };
- template <typename Fun>
- repeater<typename std::decay<Fun>::type> repeat(Fun&& fun) {
- return { std::forward<Fun>(fun) };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_repeat.hpp
-// start catch_run_for_at_least.hpp
-
-// Run a function for a minimum amount of time
-
-
-// start catch_measure.hpp
-
-// Measure
-
-
-// start catch_timing.hpp
-
-// Timing
-
-
-#include <tuple>
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration, typename Result>
- struct Timing {
- Duration elapsed;
- Result result;
- int iterations;
- };
- template <typename Clock, typename Sig>
- using TimingOf = Timing<ClockDuration<Clock>, Detail::CompleteType_t<Detail::ResultOf_t<Sig>>>;
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_timing.hpp
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock, typename Fun, typename... Args>
- TimingOf<Clock, Fun(Args...)> measure(Fun&& fun, Args&&... args) {
- auto start = Clock::now();
- auto&& r = Detail::complete_invoke(fun, std::forward<Args>(args)...);
- auto end = Clock::now();
- auto delta = end - start;
- return { delta, std::forward<decltype(r)>(r), 1 };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_measure.hpp
-#include <utility>
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun(int)> measure_one(Fun&& fun, int iters, std::false_type) {
- return Detail::measure<Clock>(fun, iters);
- }
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun(Chronometer)> measure_one(Fun&& fun, int iters, std::true_type) {
- Detail::ChronometerModel<Clock> meter;
- auto&& result = Detail::complete_invoke(fun, Chronometer(meter, iters));
-
- return { meter.elapsed(), std::move(result), iters };
- }
-
- template <typename Clock, typename Fun>
- using run_for_at_least_argument_t = typename std::conditional<is_callable<Fun(Chronometer)>::value, Chronometer, int>::type;
-
- struct optimized_away_error : std::exception {
- const char* what() const noexcept override {
- return "could not measure benchmark, maybe it was optimized away";
- }
- };
-
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun(run_for_at_least_argument_t<Clock, Fun>)> run_for_at_least(ClockDuration<Clock> how_long, int seed, Fun&& fun) {
- auto iters = seed;
- while (iters < (1 << 30)) {
- auto&& Timing = measure_one<Clock>(fun, iters, is_callable<Fun(Chronometer)>());
-
- if (Timing.elapsed >= how_long) {
- return { Timing.elapsed, std::move(Timing.result), iters };
- }
- iters *= 2;
- }
- throw optimized_away_error{};
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_run_for_at_least.hpp
-#include <algorithm>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct ExecutionPlan {
- int iterations_per_sample;
- Duration estimated_duration;
- Detail::BenchmarkFunction benchmark;
- Duration warmup_time;
- int warmup_iterations;
-
- template <typename Duration2>
- operator ExecutionPlan<Duration2>() const {
- return { iterations_per_sample, estimated_duration, benchmark, warmup_time, warmup_iterations };
- }
-
- template <typename Clock>
- std::vector<FloatDuration<Clock>> run(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
- // warmup a bit
- Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_iterations, Detail::repeat(now<Clock>{}));
-
- std::vector<FloatDuration<Clock>> times;
- times.reserve(cfg.benchmarkSamples());
- std::generate_n(std::back_inserter(times), cfg.benchmarkSamples(), [this, env] {
- Detail::ChronometerModel<Clock> model;
- this->benchmark(Chronometer(model, iterations_per_sample));
- auto sample_time = model.elapsed() - env.clock_cost.mean;
- if (sample_time < FloatDuration<Clock>::zero()) sample_time = FloatDuration<Clock>::zero();
- return sample_time / iterations_per_sample;
- });
- return times;
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_execution_plan.hpp
-// start catch_estimate_clock.hpp
-
- // Environment measurement
-
-
-// start catch_stats.hpp
-
-// Statistical analysis tools
-
-
-#include <algorithm>
-#include <functional>
-#include <vector>
-#include <iterator>
-#include <numeric>
-#include <tuple>
-#include <cmath>
-#include <utility>
-#include <cstddef>
-#include <random>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- using sample = std::vector<double>;
-
- double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last);
-
- template <typename Iterator>
- OutlierClassification classify_outliers(Iterator first, Iterator last) {
- std::vector<double> copy(first, last);
-
- auto q1 = weighted_average_quantile(1, 4, copy.begin(), copy.end());
- auto q3 = weighted_average_quantile(3, 4, copy.begin(), copy.end());
- auto iqr = q3 - q1;
- auto los = q1 - (iqr * 3.);
- auto lom = q1 - (iqr * 1.5);
- auto him = q3 + (iqr * 1.5);
- auto his = q3 + (iqr * 3.);
-
- OutlierClassification o;
- for (; first != last; ++first) {
- auto&& t = *first;
- if (t < los) ++o.low_severe;
- else if (t < lom) ++o.low_mild;
- else if (t > his) ++o.high_severe;
- else if (t > him) ++o.high_mild;
- ++o.samples_seen;
- }
- return o;
- }
-
- template <typename Iterator>
- double mean(Iterator first, Iterator last) {
- auto count = last - first;
- double sum = std::accumulate(first, last, 0.);
- return sum / count;
- }
-
- template <typename URng, typename Iterator, typename Estimator>
- sample resample(URng& rng, int resamples, Iterator first, Iterator last, Estimator& estimator) {
- auto n = last - first;
- std::uniform_int_distribution<decltype(n)> dist(0, n - 1);
-
- sample out;
- out.reserve(resamples);
- std::generate_n(std::back_inserter(out), resamples, [n, first, &estimator, &dist, &rng] {
- std::vector<double> resampled;
- resampled.reserve(n);
- std::generate_n(std::back_inserter(resampled), n, [first, &dist, &rng] { return first[dist(rng)]; });
- return estimator(resampled.begin(), resampled.end());
- });
- std::sort(out.begin(), out.end());
- return out;
- }
-
- template <typename Estimator, typename Iterator>
- sample jackknife(Estimator&& estimator, Iterator first, Iterator last) {
- auto n = last - first;
- auto second = std::next(first);
- sample results;
- results.reserve(n);
-
- for (auto it = first; it != last; ++it) {
- std::iter_swap(it, first);
- results.push_back(estimator(second, last));
- }
-
- return results;
- }
-
- inline double normal_cdf(double x) {
- return std::erfc(-x / std::sqrt(2.0)) / 2.0;
- }
-
- double erfc_inv(double x);
-
- double normal_quantile(double p);
-
- template <typename Iterator, typename Estimator>
- Estimate<double> bootstrap(double confidence_level, Iterator first, Iterator last, sample const& resample, Estimator&& estimator) {
- auto n_samples = last - first;
-
- double point = estimator(first, last);
- // Degenerate case with a single sample
- if (n_samples == 1) return { point, point, point, confidence_level };
-
- sample jack = jackknife(estimator, first, last);
- double jack_mean = mean(jack.begin(), jack.end());
- double sum_squares, sum_cubes;
- std::tie(sum_squares, sum_cubes) = std::accumulate(jack.begin(), jack.end(), std::make_pair(0., 0.), [jack_mean](std::pair<double, double> sqcb, double x) -> std::pair<double, double> {
- auto d = jack_mean - x;
- auto d2 = d * d;
- auto d3 = d2 * d;
- return { sqcb.first + d2, sqcb.second + d3 };
- });
-
- double accel = sum_cubes / (6 * std::pow(sum_squares, 1.5));
- int n = static_cast<int>(resample.size());
- double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / (double)n;
- // degenerate case with uniform samples
- if (prob_n == 0) return { point, point, point, confidence_level };
-
- double bias = normal_quantile(prob_n);
- double z1 = normal_quantile((1. - confidence_level) / 2.);
-
- auto cumn = [n](double x) -> int {
- return std::lround(normal_cdf(x) * n); };
- auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
- double b1 = bias + z1;
- double b2 = bias - z1;
- double a1 = a(b1);
- double a2 = a(b2);
- auto lo = std::max(cumn(a1), 0);
- auto hi = std::min(cumn(a2), n - 1);
-
- return { point, resample[lo], resample[hi], confidence_level };
- }
-
- double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n);
-
- struct bootstrap_analysis {
- Estimate<double> mean;
- Estimate<double> standard_deviation;
- double outlier_variance;
- };
-
- bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last);
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_stats.hpp
-#include <algorithm>
-#include <iterator>
-#include <tuple>
-#include <vector>
-#include <cmath>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock>
- std::vector<double> resolution(int k) {
- std::vector<TimePoint<Clock>> times;
- times.reserve(k + 1);
- std::generate_n(std::back_inserter(times), k + 1, now<Clock>{});
-
- std::vector<double> deltas;
- deltas.reserve(k);
- std::transform(std::next(times.begin()), times.end(), times.begin(),
- std::back_inserter(deltas),
- [](TimePoint<Clock> a, TimePoint<Clock> b) { return static_cast<double>((a - b).count()); });
-
- return deltas;
- }
-
- const auto warmup_iterations = 10000;
- const auto warmup_time = std::chrono::milliseconds(100);
- const auto minimum_ticks = 1000;
- const auto warmup_seed = 10000;
- const auto clock_resolution_estimation_time = std::chrono::milliseconds(500);
- const auto clock_cost_estimation_time_limit = std::chrono::seconds(1);
- const auto clock_cost_estimation_tick_limit = 100000;
- const auto clock_cost_estimation_time = std::chrono::milliseconds(10);
- const auto clock_cost_estimation_iterations = 10000;
-
- template <typename Clock>
- int warmup() {
- return run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_seed, &resolution<Clock>)
- .iterations;
- }
- template <typename Clock>
- EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_resolution(int iterations) {
- auto r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_resolution_estimation_time), iterations, &resolution<Clock>)
- .result;
- return {
- FloatDuration<Clock>(mean(r.begin(), r.end())),
- classify_outliers(r.begin(), r.end()),
- };
- }
- template <typename Clock>
- EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_cost(FloatDuration<Clock> resolution) {
- auto time_limit = std::min(resolution * clock_cost_estimation_tick_limit, FloatDuration<Clock>(clock_cost_estimation_time_limit));
- auto time_clock = [](int k) {
- return Detail::measure<Clock>([k] {
- for (int i = 0; i < k; ++i) {
- volatile auto ignored = Clock::now();
- (void)ignored;
- }
- }).elapsed;
- };
- time_clock(1);
- int iters = clock_cost_estimation_iterations;
- auto&& r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_cost_estimation_time), iters, time_clock);
- std::vector<double> times;
- int nsamples = static_cast<int>(std::ceil(time_limit / r.elapsed));
- times.reserve(nsamples);
- std::generate_n(std::back_inserter(times), nsamples, [time_clock, &r] {
- return static_cast<double>((time_clock(r.iterations) / r.iterations).count());
- });
- return {
- FloatDuration<Clock>(mean(times.begin(), times.end())),
- classify_outliers(times.begin(), times.end()),
- };
- }
-
- template <typename Clock>
- Environment<FloatDuration<Clock>> measure_environment() {
- static Environment<FloatDuration<Clock>>* env = nullptr;
- if (env) {
- return *env;
- }
-
- auto iters = Detail::warmup<Clock>();
- auto resolution = Detail::estimate_clock_resolution<Clock>(iters);
- auto cost = Detail::estimate_clock_cost<Clock>(resolution.mean);
-
- env = new Environment<FloatDuration<Clock>>{ resolution, cost };
- return *env;
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_estimate_clock.hpp
-// start catch_analyse.hpp
-
- // Run and analyse one benchmark
-
-
-// start catch_sample_analysis.hpp
-
-// Benchmark results
-
-
-#include <algorithm>
-#include <vector>
-#include <string>
-#include <iterator>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct SampleAnalysis {
- std::vector<Duration> samples;
- Estimate<Duration> mean;
- Estimate<Duration> standard_deviation;
- OutlierClassification outliers;
- double outlier_variance;
-
- template <typename Duration2>
- operator SampleAnalysis<Duration2>() const {
- std::vector<Duration2> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
- return {
- std::move(samples2),
- mean,
- standard_deviation,
- outliers,
- outlier_variance,
- };
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_sample_analysis.hpp
-#include <algorithm>
-#include <iterator>
-#include <vector>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Duration, typename Iterator>
- SampleAnalysis<Duration> analyse(const IConfig &cfg, Environment<Duration>, Iterator first, Iterator last) {
- if (!cfg.benchmarkNoAnalysis()) {
- std::vector<double> samples;
- samples.reserve(last - first);
- std::transform(first, last, std::back_inserter(samples), [](Duration d) { return d.count(); });
-
- auto analysis = Catch::Benchmark::Detail::analyse_samples(cfg.benchmarkConfidenceInterval(), cfg.benchmarkResamples(), samples.begin(), samples.end());
- auto outliers = Catch::Benchmark::Detail::classify_outliers(samples.begin(), samples.end());
-
- auto wrap_estimate = [](Estimate<double> e) {
- return Estimate<Duration> {
- Duration(e.point),
- Duration(e.lower_bound),
- Duration(e.upper_bound),
- e.confidence_interval,
- };
- };
- std::vector<Duration> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](double d) { return Duration(d); });
- return {
- std::move(samples2),
- wrap_estimate(analysis.mean),
- wrap_estimate(analysis.standard_deviation),
- outliers,
- analysis.outlier_variance,
- };
- } else {
- std::vector<Duration> samples;
- samples.reserve(last - first);
-
- Duration mean = Duration(0);
- int i = 0;
- for (auto it = first; it < last; ++it, ++i) {
- samples.push_back(Duration(*it));
- mean += Duration(*it);
- }
- mean /= i;
-
- return {
- std::move(samples),
- Estimate<Duration>{mean, mean, mean, 0.0},
- Estimate<Duration>{Duration(0), Duration(0), Duration(0), 0.0},
- OutlierClassification{},
- 0.0
- };
- }
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_analyse.hpp
-#include <algorithm>
-#include <functional>
-#include <string>
-#include <vector>
-#include <cmath>
-
-namespace Catch {
- namespace Benchmark {
- struct Benchmark {
- Benchmark(std::string &&name)
- : name(std::move(name)) {}
-
- template <class FUN>
- Benchmark(std::string &&name, FUN &&func)
- : fun(std::move(func)), name(std::move(name)) {}
-
- template <typename Clock>
- ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
- auto min_time = env.clock_resolution.mean * Detail::minimum_ticks;
- auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(cfg.benchmarkWarmupTime()));
- auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(run_time), 1, fun);
- int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed));
- return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FloatDuration<Clock>>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations };
- }
-
- template <typename Clock = default_clock>
- void run() {
- IConfigPtr cfg = getCurrentContext().getConfig();
-
- auto env = Detail::measure_environment<Clock>();
-
- getResultCapture().benchmarkPreparing(name);
- CATCH_TRY{
- auto plan = user_code([&] {
- return prepare<Clock>(*cfg, env);
- });
-
- BenchmarkInfo info {
- name,
- plan.estimated_duration.count(),
- plan.iterations_per_sample,
- cfg->benchmarkSamples(),
- cfg->benchmarkResamples(),
- env.clock_resolution.mean.count(),
- env.clock_cost.mean.count()
- };
-
- getResultCapture().benchmarkStarting(info);
-
- auto samples = user_code([&] {
- return plan.template run<Clock>(*cfg, env);
- });
-
- auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end());
- BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
- getResultCapture().benchmarkEnded(stats);
-
- } CATCH_CATCH_ALL{
- if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow.
- std::rethrow_exception(std::current_exception());
- }
- }
-
- // sets lambda to be used in fun *and* executes benchmark!
- template <typename Fun,
- typename std::enable_if<!Detail::is_related<Fun, Benchmark>::value, int>::type = 0>
- Benchmark & operator=(Fun func) {
- fun = Detail::BenchmarkFunction(func);
- run();
- return *this;
- }
-
- explicit operator bool() {
- return true;
- }
-
- private:
- Detail::BenchmarkFunction fun;
- std::string name;
- };
- }
-} // namespace Catch
-
-#define INTERNAL_CATCH_GET_1_ARG(arg1, arg2, ...) arg1
-#define INTERNAL_CATCH_GET_2_ARG(arg1, arg2, ...) arg2
-
-#define INTERNAL_CATCH_BENCHMARK(BenchmarkName, name, benchmarkIndex)\
- if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
- BenchmarkName = [&](int benchmarkIndex)
-
-#define INTERNAL_CATCH_BENCHMARK_ADVANCED(BenchmarkName, name)\
- if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
- BenchmarkName = [&]
-
-// end catch_benchmark.hpp
-// start catch_constructor.hpp
-
-// Constructor and destructor helpers
-
-
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T, bool Destruct>
- struct ObjectStorage
- {
- using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type;
-
- ObjectStorage() : data() {}
-
- ObjectStorage(const ObjectStorage& other)
- {
- new(&data) T(other.stored_object());
- }
-
- ObjectStorage(ObjectStorage&& other)
- {
- new(&data) T(std::move(other.stored_object()));
- }
-
- ~ObjectStorage() { destruct_on_exit<T>(); }
-
- template <typename... Args>
- void construct(Args&&... args)
- {
- new (&data) T(std::forward<Args>(args)...);
- }
-
- template <bool AllowManualDestruction = !Destruct>
- typename std::enable_if<AllowManualDestruction>::type destruct()
- {
- stored_object().~T();
- }
-
- private:
- // If this is a constructor benchmark, destruct the underlying object
- template <typename U>
- void destruct_on_exit(typename std::enable_if<Destruct, U>::type* = 0) { destruct<true>(); }
- // Otherwise, don't
- template <typename U>
- void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { }
-
- T& stored_object() {
- return *static_cast<T*>(static_cast<void*>(&data));
- }
-
- T const& stored_object() const {
- return *static_cast<T*>(static_cast<void*>(&data));
- }
-
- TStorage data;
- };
- }
-
- template <typename T>
- using storage_for = Detail::ObjectStorage<T, true>;
-
- template <typename T>
- using destructable_object = Detail::ObjectStorage<T, false>;
- }
-}
-
-// end catch_constructor.hpp
-// end catch_benchmarking_all.hpp
-#endif
-
-#endif // ! CATCH_CONFIG_IMPL_ONLY
-
-#ifdef CATCH_IMPL
-// start catch_impl.hpp
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
-
-// Keep these here for external reporters
-// start catch_test_case_tracker.h
-
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-namespace TestCaseTracking {
-
- struct NameAndLocation {
- std::string name;
- SourceLineInfo location;
-
- NameAndLocation( std::string const& _name, SourceLineInfo const& _location );
- };
-
- struct ITracker;
-
- using ITrackerPtr = std::shared_ptr<ITracker>;
-
- struct ITracker {
- virtual ~ITracker();
-
- // static queries
- virtual NameAndLocation const& nameAndLocation() const = 0;
-
- // dynamic queries
- virtual bool isComplete() const = 0; // Successfully completed or failed
- virtual bool isSuccessfullyCompleted() const = 0;
- virtual bool isOpen() const = 0; // Started but not complete
- virtual bool hasChildren() const = 0;
-
- virtual ITracker& parent() = 0;
-
- // actions
- virtual void close() = 0; // Successfully complete
- virtual void fail() = 0;
- virtual void markAsNeedingAnotherRun() = 0;
-
- virtual void addChild( ITrackerPtr const& child ) = 0;
- virtual ITrackerPtr findChild( NameAndLocation const& nameAndLocation ) = 0;
- virtual void openChild() = 0;
-
- // Debug/ checking
- virtual bool isSectionTracker() const = 0;
- virtual bool isGeneratorTracker() const = 0;
- };
-
- class TrackerContext {
-
- enum RunState {
- NotStarted,
- Executing,
- CompletedCycle
- };
-
- ITrackerPtr m_rootTracker;
- ITracker* m_currentTracker = nullptr;
- RunState m_runState = NotStarted;
-
- public:
-
- ITracker& startRun();
- void endRun();
-
- void startCycle();
- void completeCycle();
-
- bool completedCycle() const;
- ITracker& currentTracker();
- void setCurrentTracker( ITracker* tracker );
- };
-
- class TrackerBase : public ITracker {
- protected:
- enum CycleState {
- NotStarted,
- Executing,
- ExecutingChildren,
- NeedsAnotherRun,
- CompletedSuccessfully,
- Failed
- };
-
- using Children = std::vector<ITrackerPtr>;
- NameAndLocation m_nameAndLocation;
- TrackerContext& m_ctx;
- ITracker* m_parent;
- Children m_children;
- CycleState m_runState = NotStarted;
-
- public:
- TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
-
- NameAndLocation const& nameAndLocation() const override;
- bool isComplete() const override;
- bool isSuccessfullyCompleted() const override;
- bool isOpen() const override;
- bool hasChildren() const override;
-
- void addChild( ITrackerPtr const& child ) override;
-
- ITrackerPtr findChild( NameAndLocation const& nameAndLocation ) override;
- ITracker& parent() override;
-
- void openChild() override;
-
- bool isSectionTracker() const override;
- bool isGeneratorTracker() const override;
-
- void open();
-
- void close() override;
- void fail() override;
- void markAsNeedingAnotherRun() override;
-
- private:
- void moveToParent();
- void moveToThis();
- };
-
- class SectionTracker : public TrackerBase {
- std::vector<std::string> m_filters;
- std::string m_trimmed_name;
- public:
- SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
-
- bool isSectionTracker() const override;
-
- bool isComplete() const override;
-
- static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation );
-
- void tryOpen();
-
- void addInitialFilters( std::vector<std::string> const& filters );
- void addNextFilters( std::vector<std::string> const& filters );
- };
-
-} // namespace TestCaseTracking
-
-using TestCaseTracking::ITracker;
-using TestCaseTracking::TrackerContext;
-using TestCaseTracking::SectionTracker;
-
-} // namespace Catch
-
-// end catch_test_case_tracker.h
-
-// start catch_leak_detector.h
-
-namespace Catch {
-
- struct LeakDetector {
- LeakDetector();
- ~LeakDetector();
- };
-
-}
-// end catch_leak_detector.h
-// Cpp files will be included in the single-header file here
-// start catch_stats.cpp
-
-// Statistical analysis tools
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-
-#include <cassert>
-#include <random>
-
-#if defined(CATCH_CONFIG_USE_ASYNC)
-#include <future>
-#endif
-
-namespace {
- double erf_inv(double x) {
- // Code accompanying the article "Approximating the erfinv function" in GPU Computing Gems, Volume 2
- double w, p;
-
- w = -log((1.0 - x) * (1.0 + x));
-
- if (w < 6.250000) {
- w = w - 3.125000;
- p = -3.6444120640178196996e-21;
- p = -1.685059138182016589e-19 + p * w;
- p = 1.2858480715256400167e-18 + p * w;
- p = 1.115787767802518096e-17 + p * w;
- p = -1.333171662854620906e-16 + p * w;
- p = 2.0972767875968561637e-17 + p * w;
- p = 6.6376381343583238325e-15 + p * w;
- p = -4.0545662729752068639e-14 + p * w;
- p = -8.1519341976054721522e-14 + p * w;
- p = 2.6335093153082322977e-12 + p * w;
- p = -1.2975133253453532498e-11 + p * w;
- p = -5.4154120542946279317e-11 + p * w;
- p = 1.051212273321532285e-09 + p * w;
- p = -4.1126339803469836976e-09 + p * w;
- p = -2.9070369957882005086e-08 + p * w;
- p = 4.2347877827932403518e-07 + p * w;
- p = -1.3654692000834678645e-06 + p * w;
- p = -1.3882523362786468719e-05 + p * w;
- p = 0.0001867342080340571352 + p * w;
- p = -0.00074070253416626697512 + p * w;
- p = -0.0060336708714301490533 + p * w;
- p = 0.24015818242558961693 + p * w;
- p = 1.6536545626831027356 + p * w;
- } else if (w < 16.000000) {
- w = sqrt(w) - 3.250000;
- p = 2.2137376921775787049e-09;
- p = 9.0756561938885390979e-08 + p * w;
- p = -2.7517406297064545428e-07 + p * w;
- p = 1.8239629214389227755e-08 + p * w;
- p = 1.5027403968909827627e-06 + p * w;
- p = -4.013867526981545969e-06 + p * w;
- p = 2.9234449089955446044e-06 + p * w;
- p = 1.2475304481671778723e-05 + p * w;
- p = -4.7318229009055733981e-05 + p * w;
- p = 6.8284851459573175448e-05 + p * w;
- p = 2.4031110387097893999e-05 + p * w;
- p = -0.0003550375203628474796 + p * w;
- p = 0.00095328937973738049703 + p * w;
- p = -0.0016882755560235047313 + p * w;
- p = 0.0024914420961078508066 + p * w;
- p = -0.0037512085075692412107 + p * w;
- p = 0.005370914553590063617 + p * w;
- p = 1.0052589676941592334 + p * w;
- p = 3.0838856104922207635 + p * w;
- } else {
- w = sqrt(w) - 5.000000;
- p = -2.7109920616438573243e-11;
- p = -2.5556418169965252055e-10 + p * w;
- p = 1.5076572693500548083e-09 + p * w;
- p = -3.7894654401267369937e-09 + p * w;
- p = 7.6157012080783393804e-09 + p * w;
- p = -1.4960026627149240478e-08 + p * w;
- p = 2.9147953450901080826e-08 + p * w;
- p = -6.7711997758452339498e-08 + p * w;
- p = 2.2900482228026654717e-07 + p * w;
- p = -9.9298272942317002539e-07 + p * w;
- p = 4.5260625972231537039e-06 + p * w;
- p = -1.9681778105531670567e-05 + p * w;
- p = 7.5995277030017761139e-05 + p * w;
- p = -0.00021503011930044477347 + p * w;
- p = -0.00013871931833623122026 + p * w;
- p = 1.0103004648645343977 + p * w;
- p = 4.8499064014085844221 + p * w;
- }
- return p * x;
- }
-
- double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
- auto m = Catch::Benchmark::Detail::mean(first, last);
- double variance = std::accumulate(first, last, 0., [m](double a, double b) {
- double diff = b - m;
- return a + diff * diff;
- }) / (last - first);
- return std::sqrt(variance);
- }
-
-}
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
-
- double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last) {
- auto count = last - first;
- double idx = (count - 1) * k / static_cast<double>(q);
- int j = static_cast<int>(idx);
- double g = idx - j;
- std::nth_element(first, first + j, last);
- auto xj = first[j];
- if (g == 0) return xj;
-
- auto xj1 = *std::min_element(first + (j + 1), last);
- return xj + g * (xj1 - xj);
- }
-
- double erfc_inv(double x) {
- return erf_inv(1.0 - x);
- }
-
- double normal_quantile(double p) {
- static const double ROOT_TWO = std::sqrt(2.0);
-
- double result = 0.0;
- assert(p >= 0 && p <= 1);
- if (p < 0 || p > 1) {
- return result;
- }
-
- result = -erfc_inv(2.0 * p);
- // result *= normal distribution standard deviation (1.0) * sqrt(2)
- result *= /*sd * */ ROOT_TWO;
- // result += normal disttribution mean (0)
- return result;
- }
-
- double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n) {
- double sb = stddev.point;
- double mn = mean.point / n;
- double mg_min = mn / 2.;
- double sg = std::min(mg_min / 4., sb / std::sqrt(n));
- double sg2 = sg * sg;
- double sb2 = sb * sb;
-
- auto c_max = [n, mn, sb2, sg2](double x) -> double {
- double k = mn - x;
- double d = k * k;
- double nd = n * d;
- double k0 = -n * nd;
- double k1 = sb2 - n * sg2 + nd;
- double det = k1 * k1 - 4 * sg2 * k0;
- return (int)(-2. * k0 / (k1 + std::sqrt(det)));
- };
-
- auto var_out = [n, sb2, sg2](double c) {
- double nc = n - c;
- return (nc / n) * (sb2 - nc * sg2);
- };
-
- return std::min(var_out(1), var_out(std::min(c_max(0.), c_max(mg_min)))) / sb2;
- }
-
- bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last) {
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
- static std::random_device entropy;
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- auto n = static_cast<int>(last - first); // seriously, one can't use integral types without hell in C++
-
- auto mean = &Detail::mean<std::vector<double>::iterator>;
- auto stddev = &standard_deviation;
-
-#if defined(CATCH_CONFIG_USE_ASYNC)
- auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
- auto seed = entropy();
- return std::async(std::launch::async, [=] {
- std::mt19937 rng(seed);
- auto resampled = resample(rng, n_resamples, first, last, f);
- return bootstrap(confidence_level, first, last, resampled, f);
- });
- };
-
- auto mean_future = Estimate(mean);
- auto stddev_future = Estimate(stddev);
-
- auto mean_estimate = mean_future.get();
- auto stddev_estimate = stddev_future.get();
-#else
- auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
- auto seed = entropy();
- std::mt19937 rng(seed);
- auto resampled = resample(rng, n_resamples, first, last, f);
- return bootstrap(confidence_level, first, last, resampled, f);
- };
-
- auto mean_estimate = Estimate(mean);
- auto stddev_estimate = Estimate(stddev);
-#endif // CATCH_USE_ASYNC
-
- double outlier_variance = Detail::outlier_variance(mean_estimate, stddev_estimate, n);
-
- return { mean_estimate, stddev_estimate, outlier_variance };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-// end catch_stats.cpp
-// start catch_approx.cpp
-
-#include <cmath>
-#include <limits>
-
-namespace {
-
-// Performs equivalent check of std::fabs(lhs - rhs) <= margin
-// But without the subtraction to allow for INFINITY in comparison
-bool marginComparison(double lhs, double rhs, double margin) {
- return (lhs + margin >= rhs) && (rhs + margin >= lhs);
-}
-
-}
-
-namespace Catch {
-namespace Detail {
-
- Approx::Approx ( double value )
- : m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
- m_margin( 0.0 ),
- m_scale( 0.0 ),
- m_value( value )
- {}
-
- Approx Approx::custom() {
- return Approx( 0 );
- }
-
- Approx Approx::operator-() const {
- auto temp(*this);
- temp.m_value = -temp.m_value;
- return temp;
- }
-
- std::string Approx::toString() const {
- ReusableStringStream rss;
- rss << "Approx( " << ::Catch::Detail::stringify( m_value ) << " )";
- return rss.str();
- }
-
- bool Approx::equalityComparisonImpl(const double other) const {
- // First try with fixed margin, then compute margin based on epsilon, scale and Approx's value
- // Thanks to Richard Harris for his help refining the scaled margin value
- return marginComparison(m_value, other, m_margin)
- || marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(std::isinf(m_value)? 0 : m_value)));
- }
-
- void Approx::setMargin(double newMargin) {
- CATCH_ENFORCE(newMargin >= 0,
- "Invalid Approx::margin: " << newMargin << '.'
- << " Approx::Margin has to be non-negative.");
- m_margin = newMargin;
- }
-
- void Approx::setEpsilon(double newEpsilon) {
- CATCH_ENFORCE(newEpsilon >= 0 && newEpsilon <= 1.0,
- "Invalid Approx::epsilon: " << newEpsilon << '.'
- << " Approx::epsilon has to be in [0, 1]");
- m_epsilon = newEpsilon;
- }
-
-} // end namespace Detail
-
-namespace literals {
- Detail::Approx operator "" _a(long double val) {
- return Detail::Approx(val);
- }
- Detail::Approx operator "" _a(unsigned long long val) {
- return Detail::Approx(val);
- }
-} // end namespace literals
-
-std::string StringMaker<Catch::Detail::Approx>::convert(Catch::Detail::Approx const& value) {
- return value.toString();
-}
-
-} // end namespace Catch
-// end catch_approx.cpp
-// start catch_assertionhandler.cpp
-
-// start catch_debugger.h
-
-namespace Catch {
- bool isDebuggerActive();
-}
-
-#ifdef CATCH_PLATFORM_MAC
-
- #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
-
-#elif defined(CATCH_PLATFORM_IPHONE)
-
- // use inline assembler
- #if defined(__i386__) || defined(__x86_64__)
- #define CATCH_TRAP() __asm__("int $3")
- #elif defined(__aarch64__)
- #define CATCH_TRAP() __asm__(".inst 0xd4200000")
- #elif defined(__arm__) && !defined(__thumb__)
- #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
- #elif defined(__arm__) && defined(__thumb__)
- #define CATCH_TRAP() __asm__(".inst 0xde01")
- #endif
-
-#elif defined(CATCH_PLATFORM_LINUX)
- // If we can use inline assembler, do it because this allows us to break
- // directly at the location of the failing check instead of breaking inside
- // raise() called from it, i.e. one stack frame below.
- #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64))
- #define CATCH_TRAP() asm volatile ("int $3") /* NOLINT */
- #else // Fall back to the generic way.
- #include <signal.h>
-
- #define CATCH_TRAP() raise(SIGTRAP)
- #endif
-#elif defined(_MSC_VER)
- #define CATCH_TRAP() __debugbreak()
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) void __stdcall DebugBreak();
- #define CATCH_TRAP() DebugBreak()
-#endif
-
-#ifndef CATCH_BREAK_INTO_DEBUGGER
- #ifdef CATCH_TRAP
- #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
- #else
- #define CATCH_BREAK_INTO_DEBUGGER() []{}()
- #endif
-#endif
-
-// end catch_debugger.h
-// start catch_run_context.h
-
-// start catch_fatal_condition.h
-
-// start catch_windows_h_proxy.h
-
-
-#if defined(CATCH_PLATFORM_WINDOWS)
-
-#if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX)
-# define CATCH_DEFINED_NOMINMAX
-# define NOMINMAX
-#endif
-#if !defined(WIN32_LEAN_AND_MEAN) && !defined(CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN)
-# define CATCH_DEFINED_WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-
-#ifdef __AFXDLL
-#include <AfxWin.h>
-#else
-#include <windows.h>
-#endif
-
-#ifdef CATCH_DEFINED_NOMINMAX
-# undef NOMINMAX
-#endif
-#ifdef CATCH_DEFINED_WIN32_LEAN_AND_MEAN
-# undef WIN32_LEAN_AND_MEAN
-#endif
-
-#endif // defined(CATCH_PLATFORM_WINDOWS)
-
-// end catch_windows_h_proxy.h
-#if defined( CATCH_CONFIG_WINDOWS_SEH )
-
-namespace Catch {
-
- struct FatalConditionHandler {
-
- static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo);
- FatalConditionHandler();
- static void reset();
- ~FatalConditionHandler();
-
- private:
- static bool isSet;
- static ULONG guaranteeSize;
- static PVOID exceptionHandlerHandle;
- };
-
-} // namespace Catch
-
-#elif defined ( CATCH_CONFIG_POSIX_SIGNALS )
-
-#include <signal.h>
-
-namespace Catch {
-
- struct FatalConditionHandler {
-
- static bool isSet;
- static struct sigaction oldSigActions[];
- static stack_t oldSigStack;
- static char altStackMem[];
-
- static void handleSignal( int sig );
-
- FatalConditionHandler();
- ~FatalConditionHandler();
- static void reset();
- };
-
-} // namespace Catch
-
-#else
-
-namespace Catch {
- struct FatalConditionHandler {
- void reset();
- };
-}
-
-#endif
-
-// end catch_fatal_condition.h
-#include <string>
-
-namespace Catch {
-
- struct IMutableContext;
-
- ///////////////////////////////////////////////////////////////////////////
-
- class RunContext : public IResultCapture, public IRunner {
-
- public:
- RunContext( RunContext const& ) = delete;
- RunContext& operator =( RunContext const& ) = delete;
-
- explicit RunContext( IConfigPtr const& _config, IStreamingReporterPtr&& reporter );
-
- ~RunContext() override;
-
- void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount );
- void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount );
-
- Totals runTest(TestCase const& testCase);
-
- IConfigPtr config() const;
- IStreamingReporter& reporter() const;
-
- public: // IResultCapture
-
- // Assertion handlers
- void handleExpr
- ( AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction ) override;
- void handleMessage
- ( AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction ) override;
- void handleUnexpectedExceptionNotThrown
- ( AssertionInfo const& info,
- AssertionReaction& reaction ) override;
- void handleUnexpectedInflightException
- ( AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction ) override;
- void handleIncomplete
- ( AssertionInfo const& info ) override;
- void handleNonExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction ) override;
-
- bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) override;
-
- void sectionEnded( SectionEndInfo const& endInfo ) override;
- void sectionEndedEarly( SectionEndInfo const& endInfo ) override;
-
- auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing( std::string const& name ) override;
- void benchmarkStarting( BenchmarkInfo const& info ) override;
- void benchmarkEnded( BenchmarkStats<> const& stats ) override;
- void benchmarkFailed( std::string const& error ) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void pushScopedMessage( MessageInfo const& message ) override;
- void popScopedMessage( MessageInfo const& message ) override;
-
- void emplaceUnscopedMessage( MessageBuilder const& builder ) override;
-
- std::string getCurrentTestName() const override;
-
- const AssertionResult* getLastResult() const override;
-
- void exceptionEarlyReported() override;
-
- void handleFatalErrorCondition( StringRef message ) override;
-
- bool lastAssertionPassed() override;
-
- void assertionPassed() override;
-
- public:
- // !TBD We need to do this another way!
- bool aborting() const final;
-
- private:
-
- void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr );
- void invokeActiveTestCase();
-
- void resetAssertionInfo();
- bool testForMissingAssertions( Counts& assertions );
-
- void assertionEnded( AssertionResult const& result );
- void reportExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- ITransientExpression const *expr,
- bool negated );
-
- void populateReaction( AssertionReaction& reaction );
-
- private:
-
- void handleUnfinishedSections();
-
- TestRunInfo m_runInfo;
- IMutableContext& m_context;
- TestCase const* m_activeTestCase = nullptr;
- ITracker* m_testCaseTracker = nullptr;
- Option<AssertionResult> m_lastResult;
-
- IConfigPtr m_config;
- Totals m_totals;
- IStreamingReporterPtr m_reporter;
- std::vector<MessageInfo> m_messages;
- std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */
- AssertionInfo m_lastAssertionInfo;
- std::vector<SectionEndInfo> m_unfinishedSections;
- std::vector<ITracker*> m_activeSections;
- TrackerContext m_trackerContext;
- bool m_lastAssertionPassed = false;
- bool m_shouldReportUnexpected = true;
- bool m_includeSuccessfulResults;
- };
-
- void seedRng(IConfig const& config);
- unsigned int rngSeed();
-} // end namespace Catch
-
-// end catch_run_context.h
-namespace Catch {
-
- namespace {
- auto operator <<( std::ostream& os, ITransientExpression const& expr ) -> std::ostream& {
- expr.streamReconstructedExpression( os );
- return os;
- }
- }
-
- LazyExpression::LazyExpression( bool isNegated )
- : m_isNegated( isNegated )
- {}
-
- LazyExpression::LazyExpression( LazyExpression const& other ) : m_isNegated( other.m_isNegated ) {}
-
- LazyExpression::operator bool() const {
- return m_transientExpression != nullptr;
- }
-
- auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream& {
- if( lazyExpr.m_isNegated )
- os << "!";
-
- if( lazyExpr ) {
- if( lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression() )
- os << "(" << *lazyExpr.m_transientExpression << ")";
- else
- os << *lazyExpr.m_transientExpression;
- }
- else {
- os << "{** error - unchecked empty expression requested **}";
- }
- return os;
- }
-
- AssertionHandler::AssertionHandler
- ( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- StringRef capturedExpression,
- ResultDisposition::Flags resultDisposition )
- : m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
- m_resultCapture( getResultCapture() )
- {}
-
- void AssertionHandler::handleExpr( ITransientExpression const& expr ) {
- m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction );
- }
- void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef const& message) {
- m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction );
- }
-
- auto AssertionHandler::allowThrows() const -> bool {
- return getCurrentContext().getConfig()->allowThrows();
- }
-
- void AssertionHandler::complete() {
- setCompleted();
- if( m_reaction.shouldDebugBreak ) {
-
- // If you find your debugger stopping you here then go one level up on the
- // call-stack for the code that caused it (typically a failed assertion)
-
- // (To go back to the test and change execution, jump over the throw, next)
- CATCH_BREAK_INTO_DEBUGGER();
- }
- if (m_reaction.shouldThrow) {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- throw Catch::TestFailureException();
-#else
- CATCH_ERROR( "Test failure requires aborting test!" );
-#endif
- }
- }
- void AssertionHandler::setCompleted() {
- m_completed = true;
- }
-
- void AssertionHandler::handleUnexpectedInflightException() {
- m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
- }
-
- void AssertionHandler::handleExceptionThrownAsExpected() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
- void AssertionHandler::handleExceptionNotThrownAsExpected() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
-
- void AssertionHandler::handleUnexpectedExceptionNotThrown() {
- m_resultCapture.handleUnexpectedExceptionNotThrown( m_assertionInfo, m_reaction );
- }
-
- void AssertionHandler::handleThrowingCallSkipped() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
-
- // This is the overload that takes a string and infers the Equals matcher from it
- // The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp
- void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString ) {
- handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString );
- }
-
-} // namespace Catch
-// end catch_assertionhandler.cpp
-// start catch_assertionresult.cpp
-
-namespace Catch {
- AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const & _lazyExpression):
- lazyExpression(_lazyExpression),
- resultType(_resultType) {}
-
- std::string AssertionResultData::reconstructExpression() const {
-
- if( reconstructedExpression.empty() ) {
- if( lazyExpression ) {
- ReusableStringStream rss;
- rss << lazyExpression;
- reconstructedExpression = rss.str();
- }
- }
- return reconstructedExpression;
- }
-
- AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
- : m_info( info ),
- m_resultData( data )
- {}
-
- // Result was a success
- bool AssertionResult::succeeded() const {
- return Catch::isOk( m_resultData.resultType );
- }
-
- // Result was a success, or failure is suppressed
- bool AssertionResult::isOk() const {
- return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
- }
-
- ResultWas::OfType AssertionResult::getResultType() const {
- return m_resultData.resultType;
- }
-
- bool AssertionResult::hasExpression() const {
- return !m_info.capturedExpression.empty();
- }
-
- bool AssertionResult::hasMessage() const {
- return !m_resultData.message.empty();
- }
-
- std::string AssertionResult::getExpression() const {
- // Possibly overallocating by 3 characters should be basically free
- std::string expr; expr.reserve(m_info.capturedExpression.size() + 3);
- if (isFalseTest(m_info.resultDisposition)) {
- expr += "!(";
- }
- expr += m_info.capturedExpression;
- if (isFalseTest(m_info.resultDisposition)) {
- expr += ')';
- }
- return expr;
- }
-
- std::string AssertionResult::getExpressionInMacro() const {
- std::string expr;
- if( m_info.macroName.empty() )
- expr = static_cast<std::string>(m_info.capturedExpression);
- else {
- expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
- expr += m_info.macroName;
- expr += "( ";
- expr += m_info.capturedExpression;
- expr += " )";
- }
- return expr;
- }
-
- bool AssertionResult::hasExpandedExpression() const {
- return hasExpression() && getExpandedExpression() != getExpression();
- }
-
- std::string AssertionResult::getExpandedExpression() const {
- std::string expr = m_resultData.reconstructExpression();
- return expr.empty()
- ? getExpression()
- : expr;
- }
-
- std::string AssertionResult::getMessage() const {
- return m_resultData.message;
- }
- SourceLineInfo AssertionResult::getSourceInfo() const {
- return m_info.lineInfo;
- }
-
- StringRef AssertionResult::getTestMacroName() const {
- return m_info.macroName;
- }
-
-} // end namespace Catch
-// end catch_assertionresult.cpp
-// start catch_capture_matchers.cpp
-
-namespace Catch {
-
- using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
-
- // This is the general overload that takes a any string matcher
- // There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
- // the Equals matcher (so the header does not mention matchers)
- void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ) {
- std::string exceptionMessage = Catch::translateActiveException();
- MatchExpr<std::string, StringMatcher const&> expr( exceptionMessage, matcher, matcherString );
- handler.handleExpr( expr );
- }
-
-} // namespace Catch
-// end catch_capture_matchers.cpp
-// start catch_commandline.cpp
-
-// start catch_commandline.h
-
-// start catch_clara.h
-
-// Use Catch's value for console width (store Clara's off to the side, if present)
-#ifdef CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#undef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#endif
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH-1
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#pragma clang diagnostic ignored "-Wexit-time-destructors"
-#pragma clang diagnostic ignored "-Wshadow"
-#endif
-
-// start clara.hpp
-// Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See https://github.com/philsquared/Clara for more details
-
-// Clara v1.1.5
-
-
-#ifndef CATCH_CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-#ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-#ifndef CLARA_CONFIG_OPTIONAL_TYPE
-#ifdef __has_include
-#if __has_include(<optional>) && __cplusplus >= 201703L
-#include <optional>
-#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
-#endif
-#endif
-#endif
-
-// ----------- #included from clara_textflow.hpp -----------
-
-// TextFlowCpp
-//
-// A single-header library for wrapping and laying out basic text, by Phil Nash
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// This project is hosted at https://github.com/philsquared/textflowcpp
-
-
-#include <cassert>
-#include <ostream>
-#include <sstream>
-#include <vector>
-
-#ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-namespace Catch {
-namespace clara {
-namespace TextFlow {
-
-inline auto isWhitespace(char c) -> bool {
- static std::string chars = " \t\n\r";
- return chars.find(c) != std::string::npos;
-}
-inline auto isBreakableBefore(char c) -> bool {
- static std::string chars = "[({<|";
- return chars.find(c) != std::string::npos;
-}
-inline auto isBreakableAfter(char c) -> bool {
- static std::string chars = "])}>.,:;*+-=&/\\";
- return chars.find(c) != std::string::npos;
-}
-
-class Columns;
-
-class Column {
- std::vector<std::string> m_strings;
- size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH;
- size_t m_indent = 0;
- size_t m_initialIndent = std::string::npos;
-
-public:
- class iterator {
- friend Column;
-
- Column const& m_column;
- size_t m_stringIndex = 0;
- size_t m_pos = 0;
-
- size_t m_len = 0;
- size_t m_end = 0;
- bool m_suffix = false;
-
- iterator(Column const& column, size_t stringIndex)
- : m_column(column),
- m_stringIndex(stringIndex) {}
-
- auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; }
-
- auto isBoundary(size_t at) const -> bool {
- assert(at > 0);
- assert(at <= line().size());
-
- return at == line().size() ||
- (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) ||
- isBreakableBefore(line()[at]) ||
- isBreakableAfter(line()[at - 1]);
- }
-
- void calcLength() {
- assert(m_stringIndex < m_column.m_strings.size());
-
- m_suffix = false;
- auto width = m_column.m_width - indent();
- m_end = m_pos;
- if (line()[m_pos] == '\n') {
- ++m_end;
- }
- while (m_end < line().size() && line()[m_end] != '\n')
- ++m_end;
-
- if (m_end < m_pos + width) {
- m_len = m_end - m_pos;
- } else {
- size_t len = width;
- while (len > 0 && !isBoundary(m_pos + len))
- --len;
- while (len > 0 && isWhitespace(line()[m_pos + len - 1]))
- --len;
-
- if (len > 0) {
- m_len = len;
- } else {
- m_suffix = true;
- m_len = width - 1;
- }
- }
- }
-
- auto indent() const -> size_t {
- auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos;
- return initial == std::string::npos ? m_column.m_indent : initial;
- }
-
- auto addIndentAndSuffix(std::string const &plain) const -> std::string {
- return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain);
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type * ;
- using reference = value_type & ;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator(Column const& column) : m_column(column) {
- assert(m_column.m_width > m_column.m_indent);
- assert(m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent);
- calcLength();
- if (m_len == 0)
- m_stringIndex++; // Empty string
- }
-
- auto operator *() const -> std::string {
- assert(m_stringIndex < m_column.m_strings.size());
- assert(m_pos <= m_end);
- return addIndentAndSuffix(line().substr(m_pos, m_len));
- }
-
- auto operator ++() -> iterator& {
- m_pos += m_len;
- if (m_pos < line().size() && line()[m_pos] == '\n')
- m_pos += 1;
- else
- while (m_pos < line().size() && isWhitespace(line()[m_pos]))
- ++m_pos;
-
- if (m_pos == line().size()) {
- m_pos = 0;
- ++m_stringIndex;
- }
- if (m_stringIndex < m_column.m_strings.size())
- calcLength();
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev(*this);
- operator++();
- return prev;
- }
-
- auto operator ==(iterator const& other) const -> bool {
- return
- m_pos == other.m_pos &&
- m_stringIndex == other.m_stringIndex &&
- &m_column == &other.m_column;
- }
- auto operator !=(iterator const& other) const -> bool {
- return !operator==(other);
- }
- };
- using const_iterator = iterator;
-
- explicit Column(std::string const& text) { m_strings.push_back(text); }
-
- auto width(size_t newWidth) -> Column& {
- assert(newWidth > 0);
- m_width = newWidth;
- return *this;
- }
- auto indent(size_t newIndent) -> Column& {
- m_indent = newIndent;
- return *this;
- }
- auto initialIndent(size_t newIndent) -> Column& {
- m_initialIndent = newIndent;
- return *this;
- }
-
- auto width() const -> size_t { return m_width; }
- auto begin() const -> iterator { return iterator(*this); }
- auto end() const -> iterator { return { *this, m_strings.size() }; }
-
- inline friend std::ostream& operator << (std::ostream& os, Column const& col) {
- bool first = true;
- for (auto line : col) {
- if (first)
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto operator + (Column const& other)->Columns;
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-};
-
-class Spacer : public Column {
-
-public:
- explicit Spacer(size_t spaceWidth) : Column("") {
- width(spaceWidth);
- }
-};
-
-class Columns {
- std::vector<Column> m_columns;
-
-public:
-
- class iterator {
- friend Columns;
- struct EndTag {};
-
- std::vector<Column> const& m_columns;
- std::vector<Column::iterator> m_iterators;
- size_t m_activeIterators;
-
- iterator(Columns const& columns, EndTag)
- : m_columns(columns.m_columns),
- m_activeIterators(0) {
- m_iterators.reserve(m_columns.size());
-
- for (auto const& col : m_columns)
- m_iterators.push_back(col.end());
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type * ;
- using reference = value_type & ;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator(Columns const& columns)
- : m_columns(columns.m_columns),
- m_activeIterators(m_columns.size()) {
- m_iterators.reserve(m_columns.size());
-
- for (auto const& col : m_columns)
- m_iterators.push_back(col.begin());
- }
-
- auto operator ==(iterator const& other) const -> bool {
- return m_iterators == other.m_iterators;
- }
- auto operator !=(iterator const& other) const -> bool {
- return m_iterators != other.m_iterators;
- }
- auto operator *() const -> std::string {
- std::string row, padding;
-
- for (size_t i = 0; i < m_columns.size(); ++i) {
- auto width = m_columns[i].width();
- if (m_iterators[i] != m_columns[i].end()) {
- std::string col = *m_iterators[i];
- row += padding + col;
- if (col.size() < width)
- padding = std::string(width - col.size(), ' ');
- else
- padding = "";
- } else {
- padding += std::string(width, ' ');
- }
- }
- return row;
- }
- auto operator ++() -> iterator& {
- for (size_t i = 0; i < m_columns.size(); ++i) {
- if (m_iterators[i] != m_columns[i].end())
- ++m_iterators[i];
- }
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev(*this);
- operator++();
- return prev;
- }
- };
- using const_iterator = iterator;
-
- auto begin() const -> iterator { return iterator(*this); }
- auto end() const -> iterator { return { *this, iterator::EndTag() }; }
-
- auto operator += (Column const& col) -> Columns& {
- m_columns.push_back(col);
- return *this;
- }
- auto operator + (Column const& col) -> Columns {
- Columns combined = *this;
- combined += col;
- return combined;
- }
-
- inline friend std::ostream& operator << (std::ostream& os, Columns const& cols) {
-
- bool first = true;
- for (auto line : cols) {
- if (first)
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-};
-
-inline auto Column::operator + (Column const& other) -> Columns {
- Columns cols;
- cols += *this;
- cols += other;
- return cols;
-}
-}
-
-}
-}
-
-// ----------- end of #include from clara_textflow.hpp -----------
-// ........... back in clara.hpp
-
-#include <cctype>
-#include <string>
-#include <memory>
-#include <set>
-#include <algorithm>
-
-#if !defined(CATCH_PLATFORM_WINDOWS) && ( defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) )
-#define CATCH_PLATFORM_WINDOWS
-#endif
-
-namespace Catch { namespace clara {
-namespace detail {
-
- // Traits for extracting arg and return type of lambdas (for single argument lambdas)
- template<typename L>
- struct UnaryLambdaTraits : UnaryLambdaTraits<decltype( &L::operator() )> {};
-
- template<typename ClassT, typename ReturnT, typename... Args>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( Args... ) const> {
- static const bool isValid = false;
- };
-
- template<typename ClassT, typename ReturnT, typename ArgT>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( ArgT ) const> {
- static const bool isValid = true;
- using ArgType = typename std::remove_const<typename std::remove_reference<ArgT>::type>::type;
- using ReturnType = ReturnT;
- };
-
- class TokenStream;
-
- // Transport for raw args (copied from main args, or supplied via init list for testing)
- class Args {
- friend TokenStream;
- std::string m_exeName;
- std::vector<std::string> m_args;
-
- public:
- Args( int argc, char const* const* argv )
- : m_exeName(argv[0]),
- m_args(argv + 1, argv + argc) {}
-
- Args( std::initializer_list<std::string> args )
- : m_exeName( *args.begin() ),
- m_args( args.begin()+1, args.end() )
- {}
-
- auto exeName() const -> std::string {
- return m_exeName;
- }
- };
-
- // Wraps a token coming from a token stream. These may not directly correspond to strings as a single string
- // may encode an option + its argument if the : or = form is used
- enum class TokenType {
- Option, Argument
- };
- struct Token {
- TokenType type;
- std::string token;
- };
-
- inline auto isOptPrefix( char c ) -> bool {
- return c == '-'
-#ifdef CATCH_PLATFORM_WINDOWS
- || c == '/'
-#endif
- ;
- }
-
- // Abstracts iterators into args as a stream of tokens, with option arguments uniformly handled
- class TokenStream {
- using Iterator = std::vector<std::string>::const_iterator;
- Iterator it;
- Iterator itEnd;
- std::vector<Token> m_tokenBuffer;
-
- void loadBuffer() {
- m_tokenBuffer.resize( 0 );
-
- // Skip any empty strings
- while( it != itEnd && it->empty() )
- ++it;
-
- if( it != itEnd ) {
- auto const &next = *it;
- if( isOptPrefix( next[0] ) ) {
- auto delimiterPos = next.find_first_of( " :=" );
- if( delimiterPos != std::string::npos ) {
- m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
- m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
- } else {
- if( next[1] != '-' && next.size() > 2 ) {
- std::string opt = "- ";
- for( size_t i = 1; i < next.size(); ++i ) {
- opt[1] = next[i];
- m_tokenBuffer.push_back( { TokenType::Option, opt } );
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Option, next } );
- }
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Argument, next } );
- }
- }
- }
-
- public:
- explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {}
-
- TokenStream( Iterator it, Iterator itEnd ) : it( it ), itEnd( itEnd ) {
- loadBuffer();
- }
-
- explicit operator bool() const {
- return !m_tokenBuffer.empty() || it != itEnd;
- }
-
- auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); }
-
- auto operator*() const -> Token {
- assert( !m_tokenBuffer.empty() );
- return m_tokenBuffer.front();
- }
-
- auto operator->() const -> Token const * {
- assert( !m_tokenBuffer.empty() );
- return &m_tokenBuffer.front();
- }
-
- auto operator++() -> TokenStream & {
- if( m_tokenBuffer.size() >= 2 ) {
- m_tokenBuffer.erase( m_tokenBuffer.begin() );
- } else {
- if( it != itEnd )
- ++it;
- loadBuffer();
- }
- return *this;
- }
- };
-
- class ResultBase {
- public:
- enum Type {
- Ok, LogicError, RuntimeError
- };
-
- protected:
- ResultBase( Type type ) : m_type( type ) {}
- virtual ~ResultBase() = default;
-
- virtual void enforceOk() const = 0;
-
- Type m_type;
- };
-
- template<typename T>
- class ResultValueBase : public ResultBase {
- public:
- auto value() const -> T const & {
- enforceOk();
- return m_value;
- }
-
- protected:
- ResultValueBase( Type type ) : ResultBase( type ) {}
-
- ResultValueBase( ResultValueBase const &other ) : ResultBase( other ) {
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- }
-
- ResultValueBase( Type, T const &value ) : ResultBase( Ok ) {
- new( &m_value ) T( value );
- }
-
- auto operator=( ResultValueBase const &other ) -> ResultValueBase & {
- if( m_type == ResultBase::Ok )
- m_value.~T();
- ResultBase::operator=(other);
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- return *this;
- }
-
- ~ResultValueBase() override {
- if( m_type == Ok )
- m_value.~T();
- }
-
- union {
- T m_value;
- };
- };
-
- template<>
- class ResultValueBase<void> : public ResultBase {
- protected:
- using ResultBase::ResultBase;
- };
-
- template<typename T = void>
- class BasicResult : public ResultValueBase<T> {
- public:
- template<typename U>
- explicit BasicResult( BasicResult<U> const &other )
- : ResultValueBase<T>( other.type() ),
- m_errorMessage( other.errorMessage() )
- {
- assert( type() != ResultBase::Ok );
- }
-
- template<typename U>
- static auto ok( U const &value ) -> BasicResult { return { ResultBase::Ok, value }; }
- static auto ok() -> BasicResult { return { ResultBase::Ok }; }
- static auto logicError( std::string const &message ) -> BasicResult { return { ResultBase::LogicError, message }; }
- static auto runtimeError( std::string const &message ) -> BasicResult { return { ResultBase::RuntimeError, message }; }
-
- explicit operator bool() const { return m_type == ResultBase::Ok; }
- auto type() const -> ResultBase::Type { return m_type; }
- auto errorMessage() const -> std::string { return m_errorMessage; }
-
- protected:
- void enforceOk() const override {
-
- // Errors shouldn't reach this point, but if they do
- // the actual error message will be in m_errorMessage
- assert( m_type != ResultBase::LogicError );
- assert( m_type != ResultBase::RuntimeError );
- if( m_type != ResultBase::Ok )
- std::abort();
- }
-
- std::string m_errorMessage; // Only populated if resultType is an error
-
- BasicResult( ResultBase::Type type, std::string const &message )
- : ResultValueBase<T>(type),
- m_errorMessage(message)
- {
- assert( m_type != ResultBase::Ok );
- }
-
- using ResultValueBase<T>::ResultValueBase;
- using ResultBase::m_type;
- };
-
- enum class ParseResultType {
- Matched, NoMatch, ShortCircuitAll, ShortCircuitSame
- };
-
- class ParseState {
- public:
-
- ParseState( ParseResultType type, TokenStream const &remainingTokens )
- : m_type(type),
- m_remainingTokens( remainingTokens )
- {}
-
- auto type() const -> ParseResultType { return m_type; }
- auto remainingTokens() const -> TokenStream { return m_remainingTokens; }
-
- private:
- ParseResultType m_type;
- TokenStream m_remainingTokens;
- };
-
- using Result = BasicResult<void>;
- using ParserResult = BasicResult<ParseResultType>;
- using InternalParseResult = BasicResult<ParseState>;
-
- struct HelpColumns {
- std::string left;
- std::string right;
- };
-
- template<typename T>
- inline auto convertInto( std::string const &source, T& target ) -> ParserResult {
- std::stringstream ss;
- ss << source;
- ss >> target;
- if( ss.fail() )
- return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult {
- target = source;
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, bool &target ) -> ParserResult {
- std::string srcLC = source;
- std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( std::tolower(c) ); } );
- if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on")
- target = true;
- else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off")
- target = false;
- else
- return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- }
-#ifdef CLARA_CONFIG_OPTIONAL_TYPE
- template<typename T>
- inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> ParserResult {
- T temp;
- auto result = convertInto( source, temp );
- if( result )
- target = std::move(temp);
- return result;
- }
-#endif // CLARA_CONFIG_OPTIONAL_TYPE
-
- struct NonCopyable {
- NonCopyable() = default;
- NonCopyable( NonCopyable const & ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable &operator=( NonCopyable const & ) = delete;
- NonCopyable &operator=( NonCopyable && ) = delete;
- };
-
- struct BoundRef : NonCopyable {
- virtual ~BoundRef() = default;
- virtual auto isContainer() const -> bool { return false; }
- virtual auto isFlag() const -> bool { return false; }
- };
- struct BoundValueRefBase : BoundRef {
- virtual auto setValue( std::string const &arg ) -> ParserResult = 0;
- };
- struct BoundFlagRefBase : BoundRef {
- virtual auto setFlag( bool flag ) -> ParserResult = 0;
- virtual auto isFlag() const -> bool { return true; }
- };
-
- template<typename T>
- struct BoundValueRef : BoundValueRefBase {
- T &m_ref;
-
- explicit BoundValueRef( T &ref ) : m_ref( ref ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return convertInto( arg, m_ref );
- }
- };
-
- template<typename T>
- struct BoundValueRef<std::vector<T>> : BoundValueRefBase {
- std::vector<T> &m_ref;
-
- explicit BoundValueRef( std::vector<T> &ref ) : m_ref( ref ) {}
-
- auto isContainer() const -> bool override { return true; }
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- T temp;
- auto result = convertInto( arg, temp );
- if( result )
- m_ref.push_back( temp );
- return result;
- }
- };
-
- struct BoundFlagRef : BoundFlagRefBase {
- bool &m_ref;
-
- explicit BoundFlagRef( bool &ref ) : m_ref( ref ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- m_ref = flag;
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ReturnType>
- struct LambdaInvoker {
- static_assert( std::is_same<ReturnType, ParserResult>::value, "Lambda must return void or clara::ParserResult" );
-
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- return lambda( arg );
- }
- };
-
- template<>
- struct LambdaInvoker<void> {
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- lambda( arg );
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ArgType, typename L>
- inline auto invokeLambda( L const &lambda, std::string const &arg ) -> ParserResult {
- ArgType temp{};
- auto result = convertInto( arg, temp );
- return !result
- ? result
- : LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( lambda, temp );
- }
-
- template<typename L>
- struct BoundLambda : BoundValueRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- explicit BoundLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return invokeLambda<typename UnaryLambdaTraits<L>::ArgType>( m_lambda, arg );
- }
- };
-
- template<typename L>
- struct BoundFlagLambda : BoundFlagRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- static_assert( std::is_same<typename UnaryLambdaTraits<L>::ArgType, bool>::value, "flags must be boolean" );
-
- explicit BoundFlagLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- return LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( m_lambda, flag );
- }
- };
-
- enum class Optionality { Optional, Required };
-
- struct Parser;
-
- class ParserBase {
- public:
- virtual ~ParserBase() = default;
- virtual auto validate() const -> Result { return Result::ok(); }
- virtual auto parse( std::string const& exeName, TokenStream const &tokens) const -> InternalParseResult = 0;
- virtual auto cardinality() const -> size_t { return 1; }
-
- auto parse( Args const &args ) const -> InternalParseResult {
- return parse( args.exeName(), TokenStream( args ) );
- }
- };
-
- template<typename DerivedT>
- class ComposableParserImpl : public ParserBase {
- public:
- template<typename T>
- auto operator|( T const &other ) const -> Parser;
-
- template<typename T>
- auto operator+( T const &other ) const -> Parser;
- };
-
- // Common code and state for Args and Opts
- template<typename DerivedT>
- class ParserRefImpl : public ComposableParserImpl<DerivedT> {
- protected:
- Optionality m_optionality = Optionality::Optional;
- std::shared_ptr<BoundRef> m_ref;
- std::string m_hint;
- std::string m_description;
-
- explicit ParserRefImpl( std::shared_ptr<BoundRef> const &ref ) : m_ref( ref ) {}
-
- public:
- template<typename T>
- ParserRefImpl( T &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundValueRef<T>>( ref ) ),
- m_hint( hint )
- {}
-
- template<typename LambdaT>
- ParserRefImpl( LambdaT const &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ),
- m_hint(hint)
- {}
-
- auto operator()( std::string const &description ) -> DerivedT & {
- m_description = description;
- return static_cast<DerivedT &>( *this );
- }
-
- auto optional() -> DerivedT & {
- m_optionality = Optionality::Optional;
- return static_cast<DerivedT &>( *this );
- };
-
- auto required() -> DerivedT & {
- m_optionality = Optionality::Required;
- return static_cast<DerivedT &>( *this );
- };
-
- auto isOptional() const -> bool {
- return m_optionality == Optionality::Optional;
- }
-
- auto cardinality() const -> size_t override {
- if( m_ref->isContainer() )
- return 0;
- else
- return 1;
- }
-
- auto hint() const -> std::string { return m_hint; }
- };
-
- class ExeName : public ComposableParserImpl<ExeName> {
- std::shared_ptr<std::string> m_name;
- std::shared_ptr<BoundValueRefBase> m_ref;
-
- template<typename LambdaT>
- static auto makeRef(LambdaT const &lambda) -> std::shared_ptr<BoundValueRefBase> {
- return std::make_shared<BoundLambda<LambdaT>>( lambda) ;
- }
-
- public:
- ExeName() : m_name( std::make_shared<std::string>( "<executable>" ) ) {}
-
- explicit ExeName( std::string &ref ) : ExeName() {
- m_ref = std::make_shared<BoundValueRef<std::string>>( ref );
- }
-
- template<typename LambdaT>
- explicit ExeName( LambdaT const& lambda ) : ExeName() {
- m_ref = std::make_shared<BoundLambda<LambdaT>>( lambda );
- }
-
- // The exe name is not parsed out of the normal tokens, but is handled specially
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- }
-
- auto name() const -> std::string { return *m_name; }
- auto set( std::string const& newName ) -> ParserResult {
-
- auto lastSlash = newName.find_last_of( "\\/" );
- auto filename = ( lastSlash == std::string::npos )
- ? newName
- : newName.substr( lastSlash+1 );
-
- *m_name = filename;
- if( m_ref )
- return m_ref->setValue( filename );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- class Arg : public ParserRefImpl<Arg> {
- public:
- using ParserRefImpl::ParserRefImpl;
-
- auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- auto const &token = *remainingTokens;
- if( token.type != TokenType::Argument )
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
-
- assert( !m_ref->isFlag() );
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
-
- auto result = valueRef->setValue( remainingTokens->token );
- if( !result )
- return InternalParseResult( result );
- else
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- };
-
- inline auto normaliseOpt( std::string const &optName ) -> std::string {
-#ifdef CATCH_PLATFORM_WINDOWS
- if( optName[0] == '/' )
- return "-" + optName.substr( 1 );
- else
-#endif
- return optName;
- }
-
- class Opt : public ParserRefImpl<Opt> {
- protected:
- std::vector<std::string> m_optNames;
-
- public:
- template<typename LambdaT>
- explicit Opt( LambdaT const &ref ) : ParserRefImpl( std::make_shared<BoundFlagLambda<LambdaT>>( ref ) ) {}
-
- explicit Opt( bool &ref ) : ParserRefImpl( std::make_shared<BoundFlagRef>( ref ) ) {}
-
- template<typename LambdaT>
- Opt( LambdaT const &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- template<typename T>
- Opt( T &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- auto operator[]( std::string const &optName ) -> Opt & {
- m_optNames.push_back( optName );
- return *this;
- }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::ostringstream oss;
- bool first = true;
- for( auto const &opt : m_optNames ) {
- if (first)
- first = false;
- else
- oss << ", ";
- oss << opt;
- }
- if( !m_hint.empty() )
- oss << " <" << m_hint << ">";
- return { { oss.str(), m_description } };
- }
-
- auto isMatch( std::string const &optToken ) const -> bool {
- auto normalisedToken = normaliseOpt( optToken );
- for( auto const &name : m_optNames ) {
- if( normaliseOpt( name ) == normalisedToken )
- return true;
- }
- return false;
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- if( remainingTokens && remainingTokens->type == TokenType::Option ) {
- auto const &token = *remainingTokens;
- if( isMatch(token.token ) ) {
- if( m_ref->isFlag() ) {
- auto flagRef = static_cast<detail::BoundFlagRefBase*>( m_ref.get() );
- auto result = flagRef->setFlag( true );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- } else {
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
- ++remainingTokens;
- if( !remainingTokens )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto const &argToken = *remainingTokens;
- if( argToken.type != TokenType::Argument )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto result = valueRef->setValue( argToken.token );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- }
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- }
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
- }
-
- auto validate() const -> Result override {
- if( m_optNames.empty() )
- return Result::logicError( "No options supplied to Opt" );
- for( auto const &name : m_optNames ) {
- if( name.empty() )
- return Result::logicError( "Option name cannot be empty" );
-#ifdef CATCH_PLATFORM_WINDOWS
- if( name[0] != '-' && name[0] != '/' )
- return Result::logicError( "Option name must begin with '-' or '/'" );
-#else
- if( name[0] != '-' )
- return Result::logicError( "Option name must begin with '-'" );
-#endif
- }
- return ParserRefImpl::validate();
- }
- };
-
- struct Help : Opt {
- Help( bool &showHelpFlag )
- : Opt([&]( bool flag ) {
- showHelpFlag = flag;
- return ParserResult::ok( ParseResultType::ShortCircuitAll );
- })
- {
- static_cast<Opt &>( *this )
- ("display usage information")
- ["-?"]["-h"]["--help"]
- .optional();
- }
- };
-
- struct Parser : ParserBase {
-
- mutable ExeName m_exeName;
- std::vector<Opt> m_options;
- std::vector<Arg> m_args;
-
- auto operator|=( ExeName const &exeName ) -> Parser & {
- m_exeName = exeName;
- return *this;
- }
-
- auto operator|=( Arg const &arg ) -> Parser & {
- m_args.push_back(arg);
- return *this;
- }
-
- auto operator|=( Opt const &opt ) -> Parser & {
- m_options.push_back(opt);
- return *this;
- }
-
- auto operator|=( Parser const &other ) -> Parser & {
- m_options.insert(m_options.end(), other.m_options.begin(), other.m_options.end());
- m_args.insert(m_args.end(), other.m_args.begin(), other.m_args.end());
- return *this;
- }
-
- template<typename T>
- auto operator|( T const &other ) const -> Parser {
- return Parser( *this ) |= other;
- }
-
- // Forward deprecated interface with '+' instead of '|'
- template<typename T>
- auto operator+=( T const &other ) -> Parser & { return operator|=( other ); }
- template<typename T>
- auto operator+( T const &other ) const -> Parser { return operator|( other ); }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::vector<HelpColumns> cols;
- for (auto const &o : m_options) {
- auto childCols = o.getHelpColumns();
- cols.insert( cols.end(), childCols.begin(), childCols.end() );
- }
- return cols;
- }
-
- void writeToStream( std::ostream &os ) const {
- if (!m_exeName.name().empty()) {
- os << "usage:\n" << " " << m_exeName.name() << " ";
- bool required = true, first = true;
- for( auto const &arg : m_args ) {
- if (first)
- first = false;
- else
- os << " ";
- if( arg.isOptional() && required ) {
- os << "[";
- required = false;
- }
- os << "<" << arg.hint() << ">";
- if( arg.cardinality() == 0 )
- os << " ... ";
- }
- if( !required )
- os << "]";
- if( !m_options.empty() )
- os << " options";
- os << "\n\nwhere options are:" << std::endl;
- }
-
- auto rows = getHelpColumns();
- size_t consoleWidth = CATCH_CLARA_CONFIG_CONSOLE_WIDTH;
- size_t optWidth = 0;
- for( auto const &cols : rows )
- optWidth = (std::max)(optWidth, cols.left.size() + 2);
-
- optWidth = (std::min)(optWidth, consoleWidth/2);
-
- for( auto const &cols : rows ) {
- auto row =
- TextFlow::Column( cols.left ).width( optWidth ).indent( 2 ) +
- TextFlow::Spacer(4) +
- TextFlow::Column( cols.right ).width( consoleWidth - 7 - optWidth );
- os << row << std::endl;
- }
- }
-
- friend auto operator<<( std::ostream &os, Parser const &parser ) -> std::ostream& {
- parser.writeToStream( os );
- return os;
- }
-
- auto validate() const -> Result override {
- for( auto const &opt : m_options ) {
- auto result = opt.validate();
- if( !result )
- return result;
- }
- for( auto const &arg : m_args ) {
- auto result = arg.validate();
- if( !result )
- return result;
- }
- return Result::ok();
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const& exeName, TokenStream const &tokens ) const -> InternalParseResult override {
-
- struct ParserInfo {
- ParserBase const* parser = nullptr;
- size_t count = 0;
- };
- const size_t totalParsers = m_options.size() + m_args.size();
- assert( totalParsers < 512 );
- // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
- ParserInfo parseInfos[512];
-
- {
- size_t i = 0;
- for (auto const &opt : m_options) parseInfos[i++].parser = &opt;
- for (auto const &arg : m_args) parseInfos[i++].parser = &arg;
- }
-
- m_exeName.set( exeName );
-
- auto result = InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- while( result.value().remainingTokens() ) {
- bool tokenParsed = false;
-
- for( size_t i = 0; i < totalParsers; ++i ) {
- auto& parseInfo = parseInfos[i];
- if( parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality() ) {
- result = parseInfo.parser->parse(exeName, result.value().remainingTokens());
- if (!result)
- return result;
- if (result.value().type() != ParseResultType::NoMatch) {
- tokenParsed = true;
- ++parseInfo.count;
- break;
- }
- }
- }
-
- if( result.value().type() == ParseResultType::ShortCircuitAll )
- return result;
- if( !tokenParsed )
- return InternalParseResult::runtimeError( "Unrecognised token: " + result.value().remainingTokens()->token );
- }
- // !TBD Check missing required options
- return result;
- }
- };
-
- template<typename DerivedT>
- template<typename T>
- auto ComposableParserImpl<DerivedT>::operator|( T const &other ) const -> Parser {
- return Parser() | static_cast<DerivedT const &>( *this ) | other;
- }
-} // namespace detail
-
-// A Combined parser
-using detail::Parser;
-
-// A parser for options
-using detail::Opt;
-
-// A parser for arguments
-using detail::Arg;
-
-// Wrapper for argc, argv from main()
-using detail::Args;
-
-// Specifies the name of the executable
-using detail::ExeName;
-
-// Convenience wrapper for option parser that specifies the help option
-using detail::Help;
-
-// enum of result types from a parse
-using detail::ParseResultType;
-
-// Result type for parser operation
-using detail::ParserResult;
-
-}} // namespace Catch::clara
-
-// end clara.hpp
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// Restore Clara's value for console width, if present
-#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-// end catch_clara.h
-namespace Catch {
-
- clara::Parser makeCommandLineParser( ConfigData& config );
-
-} // end namespace Catch
-
-// end catch_commandline.h
-#include <fstream>
-#include <ctime>
-
-namespace Catch {
-
- clara::Parser makeCommandLineParser( ConfigData& config ) {
-
- using namespace clara;
-
- auto const setWarning = [&]( std::string const& warning ) {
- auto warningSet = [&]() {
- if( warning == "NoAssertions" )
- return WarnAbout::NoAssertions;
-
- if ( warning == "NoTests" )
- return WarnAbout::NoTests;
-
- return WarnAbout::Nothing;
- }();
-
- if (warningSet == WarnAbout::Nothing)
- return ParserResult::runtimeError( "Unrecognised warning: '" + warning + "'" );
- config.warnings = static_cast<WarnAbout::What>( config.warnings | warningSet );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const loadTestNamesFromFile = [&]( std::string const& filename ) {
- std::ifstream f( filename.c_str() );
- if( !f.is_open() )
- return ParserResult::runtimeError( "Unable to load input file: '" + filename + "'" );
-
- std::string line;
- while( std::getline( f, line ) ) {
- line = trim(line);
- if( !line.empty() && !startsWith( line, '#' ) ) {
- if( !startsWith( line, '"' ) )
- line = '"' + line + '"';
- config.testsOrTags.push_back( line );
- config.testsOrTags.emplace_back( "," );
- }
- }
- //Remove comma in the end
- if(!config.testsOrTags.empty())
- config.testsOrTags.erase( config.testsOrTags.end()-1 );
-
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setTestOrder = [&]( std::string const& order ) {
- if( startsWith( "declared", order ) )
- config.runOrder = RunTests::InDeclarationOrder;
- else if( startsWith( "lexical", order ) )
- config.runOrder = RunTests::InLexicographicalOrder;
- else if( startsWith( "random", order ) )
- config.runOrder = RunTests::InRandomOrder;
- else
- return clara::ParserResult::runtimeError( "Unrecognised ordering: '" + order + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setRngSeed = [&]( std::string const& seed ) {
- if( seed != "time" )
- return clara::detail::convertInto( seed, config.rngSeed );
- config.rngSeed = static_cast<unsigned int>( std::time(nullptr) );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setColourUsage = [&]( std::string const& useColour ) {
- auto mode = toLower( useColour );
-
- if( mode == "yes" )
- config.useColour = UseColour::Yes;
- else if( mode == "no" )
- config.useColour = UseColour::No;
- else if( mode == "auto" )
- config.useColour = UseColour::Auto;
- else
- return ParserResult::runtimeError( "colour mode must be one of: auto, yes or no. '" + useColour + "' not recognised" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setWaitForKeypress = [&]( std::string const& keypress ) {
- auto keypressLc = toLower( keypress );
- if (keypressLc == "never")
- config.waitForKeypress = WaitForKeypress::Never;
- else if( keypressLc == "start" )
- config.waitForKeypress = WaitForKeypress::BeforeStart;
- else if( keypressLc == "exit" )
- config.waitForKeypress = WaitForKeypress::BeforeExit;
- else if( keypressLc == "both" )
- config.waitForKeypress = WaitForKeypress::BeforeStartAndExit;
- else
- return ParserResult::runtimeError( "keypress argument must be one of: never, start, exit or both. '" + keypress + "' not recognised" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setVerbosity = [&]( std::string const& verbosity ) {
- auto lcVerbosity = toLower( verbosity );
- if( lcVerbosity == "quiet" )
- config.verbosity = Verbosity::Quiet;
- else if( lcVerbosity == "normal" )
- config.verbosity = Verbosity::Normal;
- else if( lcVerbosity == "high" )
- config.verbosity = Verbosity::High;
- else
- return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setReporter = [&]( std::string const& reporter ) {
- IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
-
- auto lcReporter = toLower( reporter );
- auto result = factories.find( lcReporter );
-
- if( factories.end() != result )
- config.reporterName = lcReporter;
- else
- return ParserResult::runtimeError( "Unrecognized reporter, '" + reporter + "'. Check available with --list-reporters" );
- return ParserResult::ok( ParseResultType::Matched );
- };
-
- auto cli
- = ExeName( config.processName )
- | Help( config.showHelp )
- | Opt( config.listTests )
- ["-l"]["--list-tests"]
- ( "list all/matching test cases" )
- | Opt( config.listTags )
- ["-t"]["--list-tags"]
- ( "list all/matching tags" )
- | Opt( config.showSuccessfulTests )
- ["-s"]["--success"]
- ( "include successful tests in output" )
- | Opt( config.shouldDebugBreak )
- ["-b"]["--break"]
- ( "break into debugger on failure" )
- | Opt( config.noThrow )
- ["-e"]["--nothrow"]
- ( "skip exception tests" )
- | Opt( config.showInvisibles )
- ["-i"]["--invisibles"]
- ( "show invisibles (tabs, newlines)" )
- | Opt( config.outputFilename, "filename" )
- ["-o"]["--out"]
- ( "output filename" )
- | Opt( setReporter, "name" )
- ["-r"]["--reporter"]
- ( "reporter to use (defaults to console)" )
- | Opt( config.name, "name" )
- ["-n"]["--name"]
- ( "suite name" )
- | Opt( [&]( bool ){ config.abortAfter = 1; } )
- ["-a"]["--abort"]
- ( "abort at first failure" )
- | Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" )
- ["-x"]["--abortx"]
- ( "abort after x failures" )
- | Opt( setWarning, "warning name" )
- ["-w"]["--warn"]
- ( "enable warnings" )
- | Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
- ["-d"]["--durations"]
- ( "show test durations" )
- | Opt( loadTestNamesFromFile, "filename" )
- ["-f"]["--input-file"]
- ( "load test names to run from a file" )
- | Opt( config.filenamesAsTags )
- ["-#"]["--filenames-as-tags"]
- ( "adds a tag for the filename" )
- | Opt( config.sectionsToRun, "section name" )
- ["-c"]["--section"]
- ( "specify section to run" )
- | Opt( setVerbosity, "quiet|normal|high" )
- ["-v"]["--verbosity"]
- ( "set output verbosity" )
- | Opt( config.listTestNamesOnly )
- ["--list-test-names-only"]
- ( "list all/matching test cases names only" )
- | Opt( config.listReporters )
- ["--list-reporters"]
- ( "list all reporters" )
- | Opt( setTestOrder, "decl|lex|rand" )
- ["--order"]
- ( "test case order (defaults to decl)" )
- | Opt( setRngSeed, "'time'|number" )
- ["--rng-seed"]
- ( "set a specific seed for random numbers" )
- | Opt( setColourUsage, "yes|no" )
- ["--use-colour"]
- ( "should output be colourised" )
- | Opt( config.libIdentify )
- ["--libidentify"]
- ( "report name and version according to libidentify standard" )
- | Opt( setWaitForKeypress, "never|start|exit|both" )
- ["--wait-for-keypress"]
- ( "waits for a keypress before exiting" )
- | Opt( config.benchmarkSamples, "samples" )
- ["--benchmark-samples"]
- ( "number of samples to collect (default: 100)" )
- | Opt( config.benchmarkResamples, "resamples" )
- ["--benchmark-resamples"]
- ( "number of resamples for the bootstrap (default: 100000)" )
- | Opt( config.benchmarkConfidenceInterval, "confidence interval" )
- ["--benchmark-confidence-interval"]
- ( "confidence interval for the bootstrap (between 0 and 1, default: 0.95)" )
- | Opt( config.benchmarkNoAnalysis )
- ["--benchmark-no-analysis"]
- ( "perform only measurements; do not perform any analysis" )
- | Opt( config.benchmarkWarmupTime, "benchmarkWarmupTime" )
- ["--benchmark-warmup-time"]
- ( "amount of time in milliseconds spent on warming up each test (default: 100)" )
- | Arg( config.testsOrTags, "test name|pattern|tags" )
- ( "which test or tests to use" );
-
- return cli;
- }
-
-} // end namespace Catch
-// end catch_commandline.cpp
-// start catch_common.cpp
-
-#include <cstring>
-#include <ostream>
-
-namespace Catch {
-
- bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const noexcept {
- return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0);
- }
- bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const noexcept {
- // We can assume that the same file will usually have the same pointer.
- // Thus, if the pointers are the same, there is no point in calling the strcmp
- return line < other.line || ( line == other.line && file != other.file && (std::strcmp(file, other.file) < 0));
- }
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
-#ifndef __GNUG__
- os << info.file << '(' << info.line << ')';
-#else
- os << info.file << ':' << info.line;
-#endif
- return os;
- }
-
- std::string StreamEndStop::operator+() const {
- return std::string();
- }
-
- NonCopyable::NonCopyable() = default;
- NonCopyable::~NonCopyable() = default;
-
-}
-// end catch_common.cpp
-// start catch_config.cpp
-
-namespace Catch {
-
- Config::Config( ConfigData const& data )
- : m_data( data ),
- m_stream( openStream() )
- {
- // We need to trim filter specs to avoid trouble with superfluous
- // whitespace (esp. important for bdd macros, as those are manually
- // aligned with whitespace).
-
- for (auto& elem : m_data.testsOrTags) {
- elem = trim(elem);
- }
- for (auto& elem : m_data.sectionsToRun) {
- elem = trim(elem);
- }
-
- TestSpecParser parser(ITagAliasRegistry::get());
- if (!m_data.testsOrTags.empty()) {
- m_hasTestFilters = true;
- for (auto const& testOrTags : m_data.testsOrTags) {
- parser.parse(testOrTags);
- }
- }
- m_testSpec = parser.testSpec();
- }
-
- std::string const& Config::getFilename() const {
- return m_data.outputFilename ;
- }
-
- bool Config::listTests() const { return m_data.listTests; }
- bool Config::listTestNamesOnly() const { return m_data.listTestNamesOnly; }
- bool Config::listTags() const { return m_data.listTags; }
- bool Config::listReporters() const { return m_data.listReporters; }
-
- std::string Config::getProcessName() const { return m_data.processName; }
- std::string const& Config::getReporterName() const { return m_data.reporterName; }
-
- std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
- std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
-
- TestSpec const& Config::testSpec() const { return m_testSpec; }
- bool Config::hasTestFilters() const { return m_hasTestFilters; }
-
- bool Config::showHelp() const { return m_data.showHelp; }
-
- // IConfig interface
- bool Config::allowThrows() const { return !m_data.noThrow; }
- std::ostream& Config::stream() const { return m_stream->stream(); }
- std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
- bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
- bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
- bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
- ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
- RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
- unsigned int Config::rngSeed() const { return m_data.rngSeed; }
- UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
- bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
- int Config::abortAfter() const { return m_data.abortAfter; }
- bool Config::showInvisibles() const { return m_data.showInvisibles; }
- Verbosity Config::verbosity() const { return m_data.verbosity; }
-
- bool Config::benchmarkNoAnalysis() const { return m_data.benchmarkNoAnalysis; }
- int Config::benchmarkSamples() const { return m_data.benchmarkSamples; }
- double Config::benchmarkConfidenceInterval() const { return m_data.benchmarkConfidenceInterval; }
- unsigned int Config::benchmarkResamples() const { return m_data.benchmarkResamples; }
- std::chrono::milliseconds Config::benchmarkWarmupTime() const { return std::chrono::milliseconds(m_data.benchmarkWarmupTime); }
-
- IStream const* Config::openStream() {
- return Catch::makeStream(m_data.outputFilename);
- }
-
-} // end namespace Catch
-// end catch_config.cpp
-// start catch_console_colour.cpp
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-#endif
-
-// start catch_errno_guard.h
-
-namespace Catch {
-
- class ErrnoGuard {
- public:
- ErrnoGuard();
- ~ErrnoGuard();
- private:
- int m_oldErrno;
- };
-
-}
-
-// end catch_errno_guard.h
-#include <sstream>
-
-namespace Catch {
- namespace {
-
- struct IColourImpl {
- virtual ~IColourImpl() = default;
- virtual void use( Colour::Code _colourCode ) = 0;
- };
-
- struct NoColourImpl : IColourImpl {
- void use( Colour::Code ) override {}
-
- static IColourImpl* instance() {
- static NoColourImpl s_instance;
- return &s_instance;
- }
- };
-
- } // anon namespace
-} // namespace Catch
-
-#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI )
-# ifdef CATCH_PLATFORM_WINDOWS
-# define CATCH_CONFIG_COLOUR_WINDOWS
-# else
-# define CATCH_CONFIG_COLOUR_ANSI
-# endif
-#endif
-
-#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
-
-namespace Catch {
-namespace {
-
- class Win32ColourImpl : public IColourImpl {
- public:
- Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) )
- {
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
- GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
- originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
- originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
- }
-
- void use( Colour::Code _colourCode ) override {
- switch( _colourCode ) {
- case Colour::None: return setTextAttribute( originalForegroundAttributes );
- case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
- case Colour::Red: return setTextAttribute( FOREGROUND_RED );
- case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
- case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE );
- case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
- case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
- case Colour::Grey: return setTextAttribute( 0 );
-
- case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY );
- case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
- case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
- case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
- case Colour::BrightYellow: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN );
-
- case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
-
- default:
- CATCH_ERROR( "Unknown colour requested" );
- }
- }
-
- private:
- void setTextAttribute( WORD _textAttribute ) {
- SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes );
- }
- HANDLE stdoutHandle;
- WORD originalForegroundAttributes;
- WORD originalBackgroundAttributes;
- };
-
- IColourImpl* platformColourInstance() {
- static Win32ColourImpl s_instance;
-
- IConfigPtr config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = UseColour::Yes;
- return colourMode == UseColour::Yes
- ? &s_instance
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
-
-#include <unistd.h>
-
-namespace Catch {
-namespace {
-
- // use POSIX/ ANSI console terminal codes
- // Thanks to Adam Strzelecki for original contribution
- // (http://github.com/nanoant)
- // https://github.com/philsquared/Catch/pull/131
- class PosixColourImpl : public IColourImpl {
- public:
- void use( Colour::Code _colourCode ) override {
- switch( _colourCode ) {
- case Colour::None:
- case Colour::White: return setColour( "[0m" );
- case Colour::Red: return setColour( "[0;31m" );
- case Colour::Green: return setColour( "[0;32m" );
- case Colour::Blue: return setColour( "[0;34m" );
- case Colour::Cyan: return setColour( "[0;36m" );
- case Colour::Yellow: return setColour( "[0;33m" );
- case Colour::Grey: return setColour( "[1;30m" );
-
- case Colour::LightGrey: return setColour( "[0;37m" );
- case Colour::BrightRed: return setColour( "[1;31m" );
- case Colour::BrightGreen: return setColour( "[1;32m" );
- case Colour::BrightWhite: return setColour( "[1;37m" );
- case Colour::BrightYellow: return setColour( "[1;33m" );
-
- case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
- default: CATCH_INTERNAL_ERROR( "Unknown colour requested" );
- }
- }
- static IColourImpl* instance() {
- static PosixColourImpl s_instance;
- return &s_instance;
- }
-
- private:
- void setColour( const char* _escapeCode ) {
- getCurrentContext().getConfig()->stream()
- << '\033' << _escapeCode;
- }
- };
-
- bool useColourOnPlatform() {
- return
-#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
- !isDebuggerActive() &&
-#endif
-#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
- isatty(STDOUT_FILENO)
-#else
- false
-#endif
- ;
- }
- IColourImpl* platformColourInstance() {
- ErrnoGuard guard;
- IConfigPtr config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = useColourOnPlatform()
- ? UseColour::Yes
- : UseColour::No;
- return colourMode == UseColour::Yes
- ? PosixColourImpl::instance()
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#else // not Windows or ANSI ///////////////////////////////////////////////
-
-namespace Catch {
-
- static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); }
-
-} // end namespace Catch
-
-#endif // Windows/ ANSI/ None
-
-namespace Catch {
-
- Colour::Colour( Code _colourCode ) { use( _colourCode ); }
- Colour::Colour( Colour&& other ) noexcept {
- m_moved = other.m_moved;
- other.m_moved = true;
- }
- Colour& Colour::operator=( Colour&& other ) noexcept {
- m_moved = other.m_moved;
- other.m_moved = true;
- return *this;
- }
-
- Colour::~Colour(){ if( !m_moved ) use( None ); }
-
- void Colour::use( Code _colourCode ) {
- static IColourImpl* impl = platformColourInstance();
- // Strictly speaking, this cannot possibly happen.
- // However, under some conditions it does happen (see #1626),
- // and this change is small enough that we can let practicality
- // triumph over purity in this case.
- if (impl != nullptr) {
- impl->use( _colourCode );
- }
- }
-
- std::ostream& operator << ( std::ostream& os, Colour const& ) {
- return os;
- }
-
-} // end namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-
-// end catch_console_colour.cpp
-// start catch_context.cpp
-
-namespace Catch {
-
- class Context : public IMutableContext, NonCopyable {
-
- public: // IContext
- IResultCapture* getResultCapture() override {
- return m_resultCapture;
- }
- IRunner* getRunner() override {
- return m_runner;
- }
-
- IConfigPtr const& getConfig() const override {
- return m_config;
- }
-
- ~Context() override;
-
- public: // IMutableContext
- void setResultCapture( IResultCapture* resultCapture ) override {
- m_resultCapture = resultCapture;
- }
- void setRunner( IRunner* runner ) override {
- m_runner = runner;
- }
- void setConfig( IConfigPtr const& config ) override {
- m_config = config;
- }
-
- friend IMutableContext& getCurrentMutableContext();
-
- private:
- IConfigPtr m_config;
- IRunner* m_runner = nullptr;
- IResultCapture* m_resultCapture = nullptr;
- };
-
- IMutableContext *IMutableContext::currentContext = nullptr;
-
- void IMutableContext::createContext()
- {
- currentContext = new Context();
- }
-
- void cleanUpContext() {
- delete IMutableContext::currentContext;
- IMutableContext::currentContext = nullptr;
- }
- IContext::~IContext() = default;
- IMutableContext::~IMutableContext() = default;
- Context::~Context() = default;
-
- SimplePcg32& rng() {
- static SimplePcg32 s_rng;
- return s_rng;
- }
-
-}
-// end catch_context.cpp
-// start catch_debug_console.cpp
-
-// start catch_debug_console.h
-
-#include <string>
-
-namespace Catch {
- void writeToDebugConsole( std::string const& text );
-}
-
-// end catch_debug_console.h
-#if defined(CATCH_CONFIG_ANDROID_LOGWRITE)
-#include <android/log.h>
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- __android_log_write( ANDROID_LOG_DEBUG, "Catch", text.c_str() );
- }
- }
-
-#elif defined(CATCH_PLATFORM_WINDOWS)
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- ::OutputDebugStringA( text.c_str() );
- }
- }
-
-#else
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- // !TBD: Need a version for Mac/ XCode and other IDEs
- Catch::cout() << text;
- }
- }
-
-#endif // Platform
-// end catch_debug_console.cpp
-// start catch_debugger.cpp
-
-#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
-
-# include <assert.h>
-# include <stdbool.h>
-# include <sys/types.h>
-# include <unistd.h>
-# include <cstddef>
-# include <ostream>
-
-#ifdef __apple_build_version__
- // These headers will only compile with AppleClang (XCode)
- // For other compilers (Clang, GCC, ... ) we need to exclude them
-# include <sys/sysctl.h>
-#endif
-
- namespace Catch {
- #ifdef __apple_build_version__
- // The following function is taken directly from the following technical note:
- // https://developer.apple.com/library/archive/qa/qa1361/_index.html
-
- // Returns true if the current process is being debugged (either
- // running under the debugger or has a debugger attached post facto).
- bool isDebuggerActive(){
- int mib[4];
- struct kinfo_proc info;
- std::size_t size;
-
- // Initialize the flags so that, if sysctl fails for some bizarre
- // reason, we get a predictable result.
-
- info.kp_proc.p_flag = 0;
-
- // Initialize mib, which tells sysctl the info we want, in this case
- // we're looking for information about a specific process ID.
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_PID;
- mib[3] = getpid();
-
- // Call sysctl.
-
- size = sizeof(info);
- if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, nullptr, 0) != 0 ) {
- Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl;
- return false;
- }
-
- // We're being debugged if the P_TRACED flag is set.
-
- return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
- }
- #else
- bool isDebuggerActive() {
- // We need to find another way to determine this for non-appleclang compilers on macOS
- return false;
- }
- #endif
- } // namespace Catch
-
-#elif defined(CATCH_PLATFORM_LINUX)
- #include <fstream>
- #include <string>
-
- namespace Catch{
- // The standard POSIX way of detecting a debugger is to attempt to
- // ptrace() the process, but this needs to be done from a child and not
- // this process itself to still allow attaching to this process later
- // if wanted, so is rather heavy. Under Linux we have the PID of the
- // "debugger" (which doesn't need to be gdb, of course, it could also
- // be strace, for example) in /proc/$PID/status, so just get it from
- // there instead.
- bool isDebuggerActive(){
- // Libstdc++ has a bug, where std::ifstream sets errno to 0
- // This way our users can properly assert over errno values
- ErrnoGuard guard;
- std::ifstream in("/proc/self/status");
- for( std::string line; std::getline(in, line); ) {
- static const int PREFIX_LEN = 11;
- if( line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0 ) {
- // We're traced if the PID is not 0 and no other PID starts
- // with 0 digit, so it's enough to check for just a single
- // character.
- return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0';
- }
- }
-
- return false;
- }
- } // namespace Catch
-#elif defined(_MSC_VER)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#else
- namespace Catch {
- bool isDebuggerActive() { return false; }
- }
-#endif // Platform
-// end catch_debugger.cpp
-// start catch_decomposer.cpp
-
-namespace Catch {
-
- ITransientExpression::~ITransientExpression() = default;
-
- void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
- if( lhs.size() + rhs.size() < 40 &&
- lhs.find('\n') == std::string::npos &&
- rhs.find('\n') == std::string::npos )
- os << lhs << " " << op << " " << rhs;
- else
- os << lhs << "\n" << op << "\n" << rhs;
- }
-}
-// end catch_decomposer.cpp
-// start catch_enforce.cpp
-
-#include <stdexcept>
-
-namespace Catch {
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER)
- [[noreturn]]
- void throw_exception(std::exception const& e) {
- Catch::cerr() << "Catch will terminate because it needed to throw an exception.\n"
- << "The message was: " << e.what() << '\n';
- std::terminate();
- }
-#endif
-
- [[noreturn]]
- void throw_logic_error(std::string const& msg) {
- throw_exception(std::logic_error(msg));
- }
-
- [[noreturn]]
- void throw_domain_error(std::string const& msg) {
- throw_exception(std::domain_error(msg));
- }
-
- [[noreturn]]
- void throw_runtime_error(std::string const& msg) {
- throw_exception(std::runtime_error(msg));
- }
-
-} // namespace Catch;
-// end catch_enforce.cpp
-// start catch_enum_values_registry.cpp
-// start catch_enum_values_registry.h
-
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- namespace Detail {
-
- std::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values );
-
- class EnumValuesRegistry : public IMutableEnumValuesRegistry {
-
- std::vector<std::unique_ptr<EnumInfo>> m_enumInfos;
-
- EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values) override;
- };
-
- std::vector<StringRef> parseEnums( StringRef enums );
-
- } // Detail
-
-} // Catch
-
-// end catch_enum_values_registry.h
-
-#include <map>
-#include <cassert>
-
-namespace Catch {
-
- IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() {}
-
- namespace Detail {
-
- namespace {
- // Extracts the actual name part of an enum instance
- // In other words, it returns the Blue part of Bikeshed::Colour::Blue
- StringRef extractInstanceName(StringRef enumInstance) {
- // Find last occurence of ":"
- size_t name_start = enumInstance.size();
- while (name_start > 0 && enumInstance[name_start - 1] != ':') {
- --name_start;
- }
- return enumInstance.substr(name_start, enumInstance.size() - name_start);
- }
- }
-
- std::vector<StringRef> parseEnums( StringRef enums ) {
- auto enumValues = splitStringRef( enums, ',' );
- std::vector<StringRef> parsed;
- parsed.reserve( enumValues.size() );
- for( auto const& enumValue : enumValues ) {
- parsed.push_back(trim(extractInstanceName(enumValue)));
- }
- return parsed;
- }
-
- EnumInfo::~EnumInfo() {}
-
- StringRef EnumInfo::lookup( int value ) const {
- for( auto const& valueToName : m_values ) {
- if( valueToName.first == value )
- return valueToName.second;
- }
- return "{** unexpected enum value **}"_sr;
- }
-
- std::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
- std::unique_ptr<EnumInfo> enumInfo( new EnumInfo );
- enumInfo->m_name = enumName;
- enumInfo->m_values.reserve( values.size() );
-
- const auto valueNames = Catch::Detail::parseEnums( allValueNames );
- assert( valueNames.size() == values.size() );
- std::size_t i = 0;
- for( auto value : values )
- enumInfo->m_values.emplace_back(value, valueNames[i++]);
-
- return enumInfo;
- }
-
- EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
- m_enumInfos.push_back(makeEnumInfo(enumName, allValueNames, values));
- return *m_enumInfos.back();
- }
-
- } // Detail
-} // Catch
-
-// end catch_enum_values_registry.cpp
-// start catch_errno_guard.cpp
-
-#include <cerrno>
-
-namespace Catch {
- ErrnoGuard::ErrnoGuard():m_oldErrno(errno){}
- ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; }
-}
-// end catch_errno_guard.cpp
-// start catch_exception_translator_registry.cpp
-
-// start catch_exception_translator_registry.h
-
-#include <vector>
-#include <string>
-#include <memory>
-
-namespace Catch {
-
- class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
- public:
- ~ExceptionTranslatorRegistry();
- virtual void registerTranslator( const IExceptionTranslator* translator );
- std::string translateActiveException() const override;
- std::string tryTranslators() const;
-
- private:
- std::vector<std::unique_ptr<IExceptionTranslator const>> m_translators;
- };
-}
-
-// end catch_exception_translator_registry.h
-#ifdef __OBJC__
-#import "Foundation/Foundation.h"
-#endif
-
-namespace Catch {
-
- ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() {
- }
-
- void ExceptionTranslatorRegistry::registerTranslator( const IExceptionTranslator* translator ) {
- m_translators.push_back( std::unique_ptr<const IExceptionTranslator>( translator ) );
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- std::string ExceptionTranslatorRegistry::translateActiveException() const {
- try {
-#ifdef __OBJC__
- // In Objective-C try objective-c exceptions first
- @try {
- return tryTranslators();
- }
- @catch (NSException *exception) {
- return Catch::Detail::stringify( [exception description] );
- }
-#else
- // Compiling a mixed mode project with MSVC means that CLR
- // exceptions will be caught in (...) as well. However, these
- // do not fill-in std::current_exception and thus lead to crash
- // when attempting rethrow.
- // /EHa switch also causes structured exceptions to be caught
- // here, but they fill-in current_exception properly, so
- // at worst the output should be a little weird, instead of
- // causing a crash.
- if (std::current_exception() == nullptr) {
- return "Non C++ exception. Possibly a CLR exception.";
- }
- return tryTranslators();
-#endif
- }
- catch( TestFailureException& ) {
- std::rethrow_exception(std::current_exception());
- }
- catch( std::exception& ex ) {
- return ex.what();
- }
- catch( std::string& msg ) {
- return msg;
- }
- catch( const char* msg ) {
- return msg;
- }
- catch(...) {
- return "Unknown exception";
- }
- }
-
- std::string ExceptionTranslatorRegistry::tryTranslators() const {
- if (m_translators.empty()) {
- std::rethrow_exception(std::current_exception());
- } else {
- return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end());
- }
- }
-
-#else // ^^ Exceptions are enabled // Exceptions are disabled vv
- std::string ExceptionTranslatorRegistry::translateActiveException() const {
- CATCH_INTERNAL_ERROR("Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
- }
-
- std::string ExceptionTranslatorRegistry::tryTranslators() const {
- CATCH_INTERNAL_ERROR("Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
- }
-#endif
-
-}
-// end catch_exception_translator_registry.cpp
-// start catch_fatal_condition.cpp
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-#endif
-
-#if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS )
-
-namespace {
- // Report the error condition
- void reportFatal( char const * const message ) {
- Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message );
- }
-}
-
-#endif // signals/SEH handling
-
-#if defined( CATCH_CONFIG_WINDOWS_SEH )
-
-namespace Catch {
- struct SignalDefs { DWORD id; const char* name; };
-
- // There is no 1-1 mapping between signals and windows exceptions.
- // Windows can easily distinguish between SO and SigSegV,
- // but SigInt, SigTerm, etc are handled differently.
- static SignalDefs signalDefs[] = {
- { static_cast<DWORD>(EXCEPTION_ILLEGAL_INSTRUCTION), "SIGILL - Illegal instruction signal" },
- { static_cast<DWORD>(EXCEPTION_STACK_OVERFLOW), "SIGSEGV - Stack overflow" },
- { static_cast<DWORD>(EXCEPTION_ACCESS_VIOLATION), "SIGSEGV - Segmentation violation signal" },
- { static_cast<DWORD>(EXCEPTION_INT_DIVIDE_BY_ZERO), "Divide by zero error" },
- };
-
- LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) {
- for (auto const& def : signalDefs) {
- if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) {
- reportFatal(def.name);
- }
- }
- // If its not an exception we care about, pass it along.
- // This stops us from eating debugger breaks etc.
- return EXCEPTION_CONTINUE_SEARCH;
- }
-
- FatalConditionHandler::FatalConditionHandler() {
- isSet = true;
- // 32k seems enough for Catch to handle stack overflow,
- // but the value was found experimentally, so there is no strong guarantee
- guaranteeSize = 32 * 1024;
- exceptionHandlerHandle = nullptr;
- // Register as first handler in current chain
- exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
- // Pass in guarantee size to be filled
- SetThreadStackGuarantee(&guaranteeSize);
- }
-
- void FatalConditionHandler::reset() {
- if (isSet) {
- RemoveVectoredExceptionHandler(exceptionHandlerHandle);
- SetThreadStackGuarantee(&guaranteeSize);
- exceptionHandlerHandle = nullptr;
- isSet = false;
- }
- }
-
- FatalConditionHandler::~FatalConditionHandler() {
- reset();
- }
-
-bool FatalConditionHandler::isSet = false;
-ULONG FatalConditionHandler::guaranteeSize = 0;
-PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr;
-
-} // namespace Catch
-
-#elif defined( CATCH_CONFIG_POSIX_SIGNALS )
-
-namespace Catch {
-
- struct SignalDefs {
- int id;
- const char* name;
- };
-
- // 32kb for the alternate stack seems to be sufficient. However, this value
- // is experimentally determined, so that's not guaranteed.
- static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
-
- static SignalDefs signalDefs[] = {
- { SIGINT, "SIGINT - Terminal interrupt signal" },
- { SIGILL, "SIGILL - Illegal instruction signal" },
- { SIGFPE, "SIGFPE - Floating point error signal" },
- { SIGSEGV, "SIGSEGV - Segmentation violation signal" },
- { SIGTERM, "SIGTERM - Termination request signal" },
- { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" }
- };
-
- void FatalConditionHandler::handleSignal( int sig ) {
- char const * name = "<unknown signal>";
- for (auto const& def : signalDefs) {
- if (sig == def.id) {
- name = def.name;
- break;
- }
- }
- reset();
- reportFatal(name);
- raise( sig );
- }
-
- FatalConditionHandler::FatalConditionHandler() {
- isSet = true;
- stack_t sigStack;
- sigStack.ss_sp = altStackMem;
- sigStack.ss_size = sigStackSize;
- sigStack.ss_flags = 0;
- sigaltstack(&sigStack, &oldSigStack);
- struct sigaction sa = { };
-
- sa.sa_handler = handleSignal;
- sa.sa_flags = SA_ONSTACK;
- for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) {
- sigaction(signalDefs[i].id, &sa, &oldSigActions[i]);
- }
- }
-
- FatalConditionHandler::~FatalConditionHandler() {
- reset();
- }
-
- void FatalConditionHandler::reset() {
- if( isSet ) {
- // Set signals back to previous values -- hopefully nobody overwrote them in the meantime
- for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) {
- sigaction(signalDefs[i].id, &oldSigActions[i], nullptr);
- }
- // Return the old stack
- sigaltstack(&oldSigStack, nullptr);
- isSet = false;
- }
- }
-
- bool FatalConditionHandler::isSet = false;
- struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {};
- stack_t FatalConditionHandler::oldSigStack = {};
- char FatalConditionHandler::altStackMem[sigStackSize] = {};
-
-} // namespace Catch
-
-#else
-
-namespace Catch {
- void FatalConditionHandler::reset() {}
-}
-
-#endif // signals/SEH handling
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic pop
-#endif
-// end catch_fatal_condition.cpp
-// start catch_generators.cpp
-
-#include <limits>
-#include <set>
-
-namespace Catch {
-
-IGeneratorTracker::~IGeneratorTracker() {}
-
-const char* GeneratorException::what() const noexcept {
- return m_msg;
-}
-
-namespace Generators {
-
- GeneratorUntypedBase::~GeneratorUntypedBase() {}
-
- auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
- return getResultCapture().acquireGeneratorTracker( lineInfo );
- }
-
-} // namespace Generators
-} // namespace Catch
-// end catch_generators.cpp
-// start catch_interfaces_capture.cpp
-
-namespace Catch {
- IResultCapture::~IResultCapture() = default;
-}
-// end catch_interfaces_capture.cpp
-// start catch_interfaces_config.cpp
-
-namespace Catch {
- IConfig::~IConfig() = default;
-}
-// end catch_interfaces_config.cpp
-// start catch_interfaces_exception.cpp
-
-namespace Catch {
- IExceptionTranslator::~IExceptionTranslator() = default;
- IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default;
-}
-// end catch_interfaces_exception.cpp
-// start catch_interfaces_registry_hub.cpp
-
-namespace Catch {
- IRegistryHub::~IRegistryHub() = default;
- IMutableRegistryHub::~IMutableRegistryHub() = default;
-}
-// end catch_interfaces_registry_hub.cpp
-// start catch_interfaces_reporter.cpp
-
-// start catch_reporter_listening.h
-
-namespace Catch {
-
- class ListeningReporter : public IStreamingReporter {
- using Reporters = std::vector<IStreamingReporterPtr>;
- Reporters m_listeners;
- IStreamingReporterPtr m_reporter = nullptr;
- ReporterPreferences m_preferences;
-
- public:
- ListeningReporter();
-
- void addListener( IStreamingReporterPtr&& listener );
- void addReporter( IStreamingReporterPtr&& reporter );
-
- public: // IStreamingReporter
-
- ReporterPreferences getPreferences() const override;
-
- void noMatchingTestCases( std::string const& spec ) override;
-
- void reportInvalidArguments(std::string const&arg) override;
-
- static std::set<Verbosity> getSupportedVerbosities();
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override;
- void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override;
- void benchmarkFailed(std::string const&) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void testRunStarting( TestRunInfo const& testRunInfo ) override;
- void testGroupStarting( GroupInfo const& groupInfo ) override;
- void testCaseStarting( TestCaseInfo const& testInfo ) override;
- void sectionStarting( SectionInfo const& sectionInfo ) override;
- void assertionStarting( AssertionInfo const& assertionInfo ) override;
-
- // The return value indicates if the messages buffer should be cleared:
- bool assertionEnded( AssertionStats const& assertionStats ) override;
- void sectionEnded( SectionStats const& sectionStats ) override;
- void testCaseEnded( TestCaseStats const& testCaseStats ) override;
- void testGroupEnded( TestGroupStats const& testGroupStats ) override;
- void testRunEnded( TestRunStats const& testRunStats ) override;
-
- void skipTest( TestCaseInfo const& testInfo ) override;
- bool isMulti() const override;
-
- };
-
-} // end namespace Catch
-
-// end catch_reporter_listening.h
-namespace Catch {
-
- ReporterConfig::ReporterConfig( IConfigPtr const& _fullConfig )
- : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {}
-
- ReporterConfig::ReporterConfig( IConfigPtr const& _fullConfig, std::ostream& _stream )
- : m_stream( &_stream ), m_fullConfig( _fullConfig ) {}
-
- std::ostream& ReporterConfig::stream() const { return *m_stream; }
- IConfigPtr ReporterConfig::fullConfig() const { return m_fullConfig; }
-
- TestRunInfo::TestRunInfo( std::string const& _name ) : name( _name ) {}
-
- GroupInfo::GroupInfo( std::string const& _name,
- std::size_t _groupIndex,
- std::size_t _groupsCount )
- : name( _name ),
- groupIndex( _groupIndex ),
- groupsCounts( _groupsCount )
- {}
-
- AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
- std::vector<MessageInfo> const& _infoMessages,
- Totals const& _totals )
- : assertionResult( _assertionResult ),
- infoMessages( _infoMessages ),
- totals( _totals )
- {
- assertionResult.m_resultData.lazyExpression.m_transientExpression = _assertionResult.m_resultData.lazyExpression.m_transientExpression;
-
- if( assertionResult.hasMessage() ) {
- // Copy message into messages list.
- // !TBD This should have been done earlier, somewhere
- MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() );
- builder << assertionResult.getMessage();
- builder.m_info.message = builder.m_stream.str();
-
- infoMessages.push_back( builder.m_info );
- }
- }
-
- AssertionStats::~AssertionStats() = default;
-
- SectionStats::SectionStats( SectionInfo const& _sectionInfo,
- Counts const& _assertions,
- double _durationInSeconds,
- bool _missingAssertions )
- : sectionInfo( _sectionInfo ),
- assertions( _assertions ),
- durationInSeconds( _durationInSeconds ),
- missingAssertions( _missingAssertions )
- {}
-
- SectionStats::~SectionStats() = default;
-
- TestCaseStats::TestCaseStats( TestCaseInfo const& _testInfo,
- Totals const& _totals,
- std::string const& _stdOut,
- std::string const& _stdErr,
- bool _aborting )
- : testInfo( _testInfo ),
- totals( _totals ),
- stdOut( _stdOut ),
- stdErr( _stdErr ),
- aborting( _aborting )
- {}
-
- TestCaseStats::~TestCaseStats() = default;
-
- TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo,
- Totals const& _totals,
- bool _aborting )
- : groupInfo( _groupInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
-
- TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo )
- : groupInfo( _groupInfo ),
- aborting( false )
- {}
-
- TestGroupStats::~TestGroupStats() = default;
-
- TestRunStats::TestRunStats( TestRunInfo const& _runInfo,
- Totals const& _totals,
- bool _aborting )
- : runInfo( _runInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
-
- TestRunStats::~TestRunStats() = default;
-
- void IStreamingReporter::fatalErrorEncountered( StringRef ) {}
- bool IStreamingReporter::isMulti() const { return false; }
-
- IReporterFactory::~IReporterFactory() = default;
- IReporterRegistry::~IReporterRegistry() = default;
-
-} // end namespace Catch
-// end catch_interfaces_reporter.cpp
-// start catch_interfaces_runner.cpp
-
-namespace Catch {
- IRunner::~IRunner() = default;
-}
-// end catch_interfaces_runner.cpp
-// start catch_interfaces_testcase.cpp
-
-namespace Catch {
- ITestInvoker::~ITestInvoker() = default;
- ITestCaseRegistry::~ITestCaseRegistry() = default;
-}
-// end catch_interfaces_testcase.cpp
-// start catch_leak_detector.cpp
-
-#ifdef CATCH_CONFIG_WINDOWS_CRTDBG
-#include <crtdbg.h>
-
-namespace Catch {
-
- LeakDetector::LeakDetector() {
- int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- flag |= _CRTDBG_LEAK_CHECK_DF;
- flag |= _CRTDBG_ALLOC_MEM_DF;
- _CrtSetDbgFlag(flag);
- _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
- _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
- // Change this to leaking allocation's number to break there
- _CrtSetBreakAlloc(-1);
- }
-}
-
-#else
-
- Catch::LeakDetector::LeakDetector() {}
-
-#endif
-
-Catch::LeakDetector::~LeakDetector() {
- Catch::cleanUp();
-}
-// end catch_leak_detector.cpp
-// start catch_list.cpp
-
-// start catch_list.h
-
-#include <set>
-
-namespace Catch {
-
- std::size_t listTests( Config const& config );
-
- std::size_t listTestsNamesOnly( Config const& config );
-
- struct TagInfo {
- void add( std::string const& spelling );
- std::string all() const;
-
- std::set<std::string> spellings;
- std::size_t count = 0;
- };
-
- std::size_t listTags( Config const& config );
-
- std::size_t listReporters();
-
- Option<std::size_t> list( std::shared_ptr<Config> const& config );
-
-} // end namespace Catch
-
-// end catch_list.h
-// start catch_text.h
-
-namespace Catch {
- using namespace clara::TextFlow;
-}
-
-// end catch_text.h
-#include <limits>
-#include <algorithm>
-#include <iomanip>
-
-namespace Catch {
-
- std::size_t listTests( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- if( config.hasTestFilters() )
- Catch::cout() << "Matching test cases:\n";
- else {
- Catch::cout() << "All available test cases:\n";
- }
-
- auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCaseInfo : matchedTestCases ) {
- Colour::Code colour = testCaseInfo.isHidden()
- ? Colour::SecondaryText
- : Colour::None;
- Colour colourGuard( colour );
-
- Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
- if( config.verbosity() >= Verbosity::High ) {
- Catch::cout() << Column( Catch::Detail::stringify( testCaseInfo.lineInfo ) ).indent(4) << std::endl;
- std::string description = testCaseInfo.description;
- if( description.empty() )
- description = "(NO DESCRIPTION)";
- Catch::cout() << Column( description ).indent(4) << std::endl;
- }
- if( !testCaseInfo.tags.empty() )
- Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
- }
-
- if( !config.hasTestFilters() )
- Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
- else
- Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
- return matchedTestCases.size();
- }
-
- std::size_t listTestsNamesOnly( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- std::size_t matchedTests = 0;
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCaseInfo : matchedTestCases ) {
- matchedTests++;
- if( startsWith( testCaseInfo.name, '#' ) )
- Catch::cout() << '"' << testCaseInfo.name << '"';
- else
- Catch::cout() << testCaseInfo.name;
- if ( config.verbosity() >= Verbosity::High )
- Catch::cout() << "\t@" << testCaseInfo.lineInfo;
- Catch::cout() << std::endl;
- }
- return matchedTests;
- }
-
- void TagInfo::add( std::string const& spelling ) {
- ++count;
- spellings.insert( spelling );
- }
-
- std::string TagInfo::all() const {
- size_t size = 0;
- for (auto const& spelling : spellings) {
- // Add 2 for the brackes
- size += spelling.size() + 2;
- }
-
- std::string out; out.reserve(size);
- for (auto const& spelling : spellings) {
- out += '[';
- out += spelling;
- out += ']';
- }
- return out;
- }
-
- std::size_t listTags( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- if( config.hasTestFilters() )
- Catch::cout() << "Tags for matching test cases:\n";
- else {
- Catch::cout() << "All available tags:\n";
- }
-
- std::map<std::string, TagInfo> tagCounts;
-
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCase : matchedTestCases ) {
- for( auto const& tagName : testCase.getTestCaseInfo().tags ) {
- std::string lcaseTagName = toLower( tagName );
- auto countIt = tagCounts.find( lcaseTagName );
- if( countIt == tagCounts.end() )
- countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first;
- countIt->second.add( tagName );
- }
- }
-
- for( auto const& tagCount : tagCounts ) {
- ReusableStringStream rss;
- rss << " " << std::setw(2) << tagCount.second.count << " ";
- auto str = rss.str();
- auto wrapper = Column( tagCount.second.all() )
- .initialIndent( 0 )
- .indent( str.size() )
- .width( CATCH_CONFIG_CONSOLE_WIDTH-10 );
- Catch::cout() << str << wrapper << '\n';
- }
- Catch::cout() << pluralise( tagCounts.size(), "tag" ) << '\n' << std::endl;
- return tagCounts.size();
- }
-
- std::size_t listReporters() {
- Catch::cout() << "Available reporters:\n";
- IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
- std::size_t maxNameLen = 0;
- for( auto const& factoryKvp : factories )
- maxNameLen = (std::max)( maxNameLen, factoryKvp.first.size() );
-
- for( auto const& factoryKvp : factories ) {
- Catch::cout()
- << Column( factoryKvp.first + ":" )
- .indent(2)
- .width( 5+maxNameLen )
- + Column( factoryKvp.second->getDescription() )
- .initialIndent(0)
- .indent(2)
- .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 )
- << "\n";
- }
- Catch::cout() << std::endl;
- return factories.size();
- }
-
- Option<std::size_t> list( std::shared_ptr<Config> const& config ) {
- Option<std::size_t> listedCount;
- getCurrentMutableContext().setConfig( config );
- if( config->listTests() )
- listedCount = listedCount.valueOr(0) + listTests( *config );
- if( config->listTestNamesOnly() )
- listedCount = listedCount.valueOr(0) + listTestsNamesOnly( *config );
- if( config->listTags() )
- listedCount = listedCount.valueOr(0) + listTags( *config );
- if( config->listReporters() )
- listedCount = listedCount.valueOr(0) + listReporters();
- return listedCount;
- }
-
-} // end namespace Catch
-// end catch_list.cpp
-// start catch_matchers.cpp
-
-namespace Catch {
-namespace Matchers {
- namespace Impl {
-
- std::string MatcherUntypedBase::toString() const {
- if( m_cachedToString.empty() )
- m_cachedToString = describe();
- return m_cachedToString;
- }
-
- MatcherUntypedBase::~MatcherUntypedBase() = default;
-
- } // namespace Impl
-} // namespace Matchers
-
-using namespace Matchers;
-using Matchers::Impl::MatcherBase;
-
-} // namespace Catch
-// end catch_matchers.cpp
-// start catch_matchers_exception.cpp
-
-namespace Catch {
-namespace Matchers {
-namespace Exception {
-
-bool ExceptionMessageMatcher::match(std::exception const& ex) const {
- return ex.what() == m_message;
-}
-
-std::string ExceptionMessageMatcher::describe() const {
- return "exception message matches \"" + m_message + "\"";
-}
-
-}
-Exception::ExceptionMessageMatcher Message(std::string const& message) {
- return Exception::ExceptionMessageMatcher(message);
-}
-
-// namespace Exception
-} // namespace Matchers
-} // namespace Catch
-// end catch_matchers_exception.cpp
-// start catch_matchers_floating.cpp
-
-// start catch_polyfills.hpp
-
-namespace Catch {
- bool isnan(float f);
- bool isnan(double d);
-}
-
-// end catch_polyfills.hpp
-// start catch_to_string.hpp
-
-#include <string>
-
-namespace Catch {
- template <typename T>
- std::string to_string(T const& t) {
-#if defined(CATCH_CONFIG_CPP11_TO_STRING)
- return std::to_string(t);
-#else
- ReusableStringStream rss;
- rss << t;
- return rss.str();
-#endif
- }
-} // end namespace Catch
-
-// end catch_to_string.hpp
-#include <algorithm>
-#include <cmath>
-#include <cstdlib>
-#include <cstdint>
-#include <cstring>
-#include <sstream>
-#include <type_traits>
-#include <iomanip>
-#include <limits>
-
-namespace Catch {
-namespace {
-
- int32_t convert(float f) {
- static_assert(sizeof(float) == sizeof(int32_t), "Important ULP matcher assumption violated");
- int32_t i;
- std::memcpy(&i, &f, sizeof(f));
- return i;
- }
-
- int64_t convert(double d) {
- static_assert(sizeof(double) == sizeof(int64_t), "Important ULP matcher assumption violated");
- int64_t i;
- std::memcpy(&i, &d, sizeof(d));
- return i;
- }
-
- template <typename FP>
- bool almostEqualUlps(FP lhs, FP rhs, uint64_t maxUlpDiff) {
- // Comparison with NaN should always be false.
- // This way we can rule it out before getting into the ugly details
- if (Catch::isnan(lhs) || Catch::isnan(rhs)) {
- return false;
- }
-
- auto lc = convert(lhs);
- auto rc = convert(rhs);
-
- if ((lc < 0) != (rc < 0)) {
- // Potentially we can have +0 and -0
- return lhs == rhs;
- }
-
- auto ulpDiff = std::abs(lc - rc);
- return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff;
- }
-
-#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
-
- float nextafter(float x, float y) {
- return ::nextafterf(x, y);
- }
-
- double nextafter(double x, double y) {
- return ::nextafter(x, y);
- }
-
-#endif // ^^^ CATCH_CONFIG_GLOBAL_NEXTAFTER ^^^
-
-template <typename FP>
-FP step(FP start, FP direction, uint64_t steps) {
- for (uint64_t i = 0; i < steps; ++i) {
-#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
- start = Catch::nextafter(start, direction);
-#else
- start = std::nextafter(start, direction);
-#endif
- }
- return start;
-}
-
-// Performs equivalent check of std::fabs(lhs - rhs) <= margin
-// But without the subtraction to allow for INFINITY in comparison
-bool marginComparison(double lhs, double rhs, double margin) {
- return (lhs + margin >= rhs) && (rhs + margin >= lhs);
-}
-
-template <typename FloatingPoint>
-void write(std::ostream& out, FloatingPoint num) {
- out << std::scientific
- << std::setprecision(std::numeric_limits<FloatingPoint>::max_digits10 - 1)
- << num;
-}
-
-} // end anonymous namespace
-
-namespace Matchers {
-namespace Floating {
-
- enum class FloatingPointKind : uint8_t {
- Float,
- Double
- };
-
- WithinAbsMatcher::WithinAbsMatcher(double target, double margin)
- :m_target{ target }, m_margin{ margin } {
- CATCH_ENFORCE(margin >= 0, "Invalid margin: " << margin << '.'
- << " Margin has to be non-negative.");
- }
-
- // Performs equivalent check of std::fabs(lhs - rhs) <= margin
- // But without the subtraction to allow for INFINITY in comparison
- bool WithinAbsMatcher::match(double const& matchee) const {
- return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee);
- }
-
- std::string WithinAbsMatcher::describe() const {
- return "is within " + ::Catch::Detail::stringify(m_margin) + " of " + ::Catch::Detail::stringify(m_target);
- }
-
- WithinUlpsMatcher::WithinUlpsMatcher(double target, uint64_t ulps, FloatingPointKind baseType)
- :m_target{ target }, m_ulps{ ulps }, m_type{ baseType } {
- CATCH_ENFORCE(m_type == FloatingPointKind::Double
- || m_ulps < (std::numeric_limits<uint32_t>::max)(),
- "Provided ULP is impossibly large for a float comparison.");
- }
-
-#if defined(__clang__)
-#pragma clang diagnostic push
-// Clang <3.5 reports on the default branch in the switch below
-#pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
- bool WithinUlpsMatcher::match(double const& matchee) const {
- switch (m_type) {
- case FloatingPointKind::Float:
- return almostEqualUlps<float>(static_cast<float>(matchee), static_cast<float>(m_target), m_ulps);
- case FloatingPointKind::Double:
- return almostEqualUlps<double>(matchee, m_target, m_ulps);
- default:
- CATCH_INTERNAL_ERROR( "Unknown FloatingPointKind value" );
- }
- }
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
- std::string WithinUlpsMatcher::describe() const {
- std::stringstream ret;
-
- ret << "is within " << m_ulps << " ULPs of ";
-
- if (m_type == FloatingPointKind::Float) {
- write(ret, static_cast<float>(m_target));
- ret << 'f';
- } else {
- write(ret, m_target);
- }
-
- ret << " ([";
- if (m_type == FloatingPointKind::Double) {
- write(ret, step(m_target, static_cast<double>(-INFINITY), m_ulps));
- ret << ", ";
- write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps));
- } else {
- // We have to cast INFINITY to float because of MinGW, see #1782
- write(ret, step(static_cast<float>(m_target), static_cast<float>(-INFINITY), m_ulps));
- ret << ", ";
- write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps));
- }
- ret << "])";
-
- return ret.str();
- }
-
- WithinRelMatcher::WithinRelMatcher(double target, double epsilon):
- m_target(target),
- m_epsilon(epsilon){
- CATCH_ENFORCE(m_epsilon >= 0., "Relative comparison with epsilon < 0 does not make sense.");
- CATCH_ENFORCE(m_epsilon < 1., "Relative comparison with epsilon >= 1 does not make sense.");
- }
-
- bool WithinRelMatcher::match(double const& matchee) const {
- const auto relMargin = m_epsilon * (std::max)(std::fabs(matchee), std::fabs(m_target));
- return marginComparison(matchee, m_target,
- std::isinf(relMargin)? 0 : relMargin);
- }
-
- std::string WithinRelMatcher::describe() const {
- Catch::ReusableStringStream sstr;
- sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other";
- return sstr.str();
- }
-
-}// namespace Floating
-
-Floating::WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
- return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Double);
-}
-
-Floating::WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
- return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Float);
-}
-
-Floating::WithinAbsMatcher WithinAbs(double target, double margin) {
- return Floating::WithinAbsMatcher(target, margin);
-}
-
-Floating::WithinRelMatcher WithinRel(double target, double eps) {
- return Floating::WithinRelMatcher(target, eps);
-}
-
-Floating::WithinRelMatcher WithinRel(double target) {
- return Floating::WithinRelMatcher(target, std::numeric_limits<double>::epsilon() * 100);
-}
-
-Floating::WithinRelMatcher WithinRel(float target, float eps) {
- return Floating::WithinRelMatcher(target, eps);
-}
-
-Floating::WithinRelMatcher WithinRel(float target) {
- return Floating::WithinRelMatcher(target, std::numeric_limits<float>::epsilon() * 100);
-}
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_floating.cpp
-// start catch_matchers_generic.cpp
-
-std::string Catch::Matchers::Generic::Detail::finalizeDescription(const std::string& desc) {
- if (desc.empty()) {
- return "matches undescribed predicate";
- } else {
- return "matches predicate: \"" + desc + '"';
- }
-}
-// end catch_matchers_generic.cpp
-// start catch_matchers_string.cpp
-
-#include <regex>
-
-namespace Catch {
-namespace Matchers {
-
- namespace StdString {
-
- CasedString::CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_str( adjustString( str ) )
- {}
- std::string CasedString::adjustString( std::string const& str ) const {
- return m_caseSensitivity == CaseSensitive::No
- ? toLower( str )
- : str;
- }
- std::string CasedString::caseSensitivitySuffix() const {
- return m_caseSensitivity == CaseSensitive::No
- ? " (case insensitive)"
- : std::string();
- }
-
- StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator )
- : m_comparator( comparator ),
- m_operation( operation ) {
- }
-
- std::string StringMatcherBase::describe() const {
- std::string description;
- description.reserve(5 + m_operation.size() + m_comparator.m_str.size() +
- m_comparator.caseSensitivitySuffix().size());
- description += m_operation;
- description += ": \"";
- description += m_comparator.m_str;
- description += "\"";
- description += m_comparator.caseSensitivitySuffix();
- return description;
- }
-
- EqualsMatcher::EqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals", comparator ) {}
-
- bool EqualsMatcher::match( std::string const& source ) const {
- return m_comparator.adjustString( source ) == m_comparator.m_str;
- }
-
- ContainsMatcher::ContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains", comparator ) {}
-
- bool ContainsMatcher::match( std::string const& source ) const {
- return contains( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
- StartsWithMatcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with", comparator ) {}
-
- bool StartsWithMatcher::match( std::string const& source ) const {
- return startsWith( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
- EndsWithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with", comparator ) {}
-
- bool EndsWithMatcher::match( std::string const& source ) const {
- return endsWith( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
- RegexMatcher::RegexMatcher(std::string regex, CaseSensitive::Choice caseSensitivity): m_regex(std::move(regex)), m_caseSensitivity(caseSensitivity) {}
-
- bool RegexMatcher::match(std::string const& matchee) const {
- auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway
- if (m_caseSensitivity == CaseSensitive::Choice::No) {
- flags |= std::regex::icase;
- }
- auto reg = std::regex(m_regex, flags);
- return std::regex_match(matchee, reg);
- }
-
- std::string RegexMatcher::describe() const {
- return "matches " + ::Catch::Detail::stringify(m_regex) + ((m_caseSensitivity == CaseSensitive::Choice::Yes)? " case sensitively" : " case insensitively");
- }
-
- } // namespace StdString
-
- StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::EqualsMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::ContainsMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::EndsWithMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::StartsWithMatcher( StdString::CasedString( str, caseSensitivity) );
- }
-
- StdString::RegexMatcher Matches(std::string const& regex, CaseSensitive::Choice caseSensitivity) {
- return StdString::RegexMatcher(regex, caseSensitivity);
- }
-
-} // namespace Matchers
-} // namespace Catch
-// end catch_matchers_string.cpp
-// start catch_message.cpp
-
-// start catch_uncaught_exceptions.h
-
-namespace Catch {
- bool uncaught_exceptions();
-} // end namespace Catch
-
-// end catch_uncaught_exceptions.h
-#include <cassert>
-#include <stack>
-
-namespace Catch {
-
- MessageInfo::MessageInfo( StringRef const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type )
- : macroName( _macroName ),
- lineInfo( _lineInfo ),
- type( _type ),
- sequence( ++globalCount )
- {}
-
- bool MessageInfo::operator==( MessageInfo const& other ) const {
- return sequence == other.sequence;
- }
-
- bool MessageInfo::operator<( MessageInfo const& other ) const {
- return sequence < other.sequence;
- }
-
- // This may need protecting if threading support is added
- unsigned int MessageInfo::globalCount = 0;
-
- ////////////////////////////////////////////////////////////////////////////
-
- Catch::MessageBuilder::MessageBuilder( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- ResultWas::OfType type )
- :m_info(macroName, lineInfo, type) {}
-
- ////////////////////////////////////////////////////////////////////////////
-
- ScopedMessage::ScopedMessage( MessageBuilder const& builder )
- : m_info( builder.m_info ), m_moved()
- {
- m_info.message = builder.m_stream.str();
- getResultCapture().pushScopedMessage( m_info );
- }
-
- ScopedMessage::ScopedMessage( ScopedMessage&& old )
- : m_info( old.m_info ), m_moved()
- {
- old.m_moved = true;
- }
-
- ScopedMessage::~ScopedMessage() {
- if ( !uncaught_exceptions() && !m_moved ){
- getResultCapture().popScopedMessage(m_info);
- }
- }
-
- Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) {
- auto trimmed = [&] (size_t start, size_t end) {
- while (names[start] == ',' || isspace(names[start])) {
- ++start;
- }
- while (names[end] == ',' || isspace(names[end])) {
- --end;
- }
- return names.substr(start, end - start + 1);
- };
- auto skipq = [&] (size_t start, char quote) {
- for (auto i = start + 1; i < names.size() ; ++i) {
- if (names[i] == quote)
- return i;
- if (names[i] == '\\')
- ++i;
- }
- CATCH_INTERNAL_ERROR("CAPTURE parsing encountered unmatched quote");
- };
-
- size_t start = 0;
- std::stack<char> openings;
- for (size_t pos = 0; pos < names.size(); ++pos) {
- char c = names[pos];
- switch (c) {
- case '[':
- case '{':
- case '(':
- // It is basically impossible to disambiguate between
- // comparison and start of template args in this context
-// case '<':
- openings.push(c);
- break;
- case ']':
- case '}':
- case ')':
-// case '>':
- openings.pop();
- break;
- case '"':
- case '\'':
- pos = skipq(pos, c);
- break;
- case ',':
- if (start != pos && openings.empty()) {
- m_messages.emplace_back(macroName, lineInfo, resultType);
- m_messages.back().message = static_cast<std::string>(trimmed(start, pos));
- m_messages.back().message += " := ";
- start = pos;
- }
- }
- }
- assert(openings.empty() && "Mismatched openings");
- m_messages.emplace_back(macroName, lineInfo, resultType);
- m_messages.back().message = static_cast<std::string>(trimmed(start, names.size() - 1));
- m_messages.back().message += " := ";
- }
- Capturer::~Capturer() {
- if ( !uncaught_exceptions() ){
- assert( m_captured == m_messages.size() );
- for( size_t i = 0; i < m_captured; ++i )
- m_resultCapture.popScopedMessage( m_messages[i] );
- }
- }
-
- void Capturer::captureValue( size_t index, std::string const& value ) {
- assert( index < m_messages.size() );
- m_messages[index].message += value;
- m_resultCapture.pushScopedMessage( m_messages[index] );
- m_captured++;
- }
-
-} // end namespace Catch
-// end catch_message.cpp
-// start catch_output_redirect.cpp
-
-// start catch_output_redirect.h
-#ifndef TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-#define TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-
-#include <cstdio>
-#include <iosfwd>
-#include <string>
-
-namespace Catch {
-
- class RedirectedStream {
- std::ostream& m_originalStream;
- std::ostream& m_redirectionStream;
- std::streambuf* m_prevBuf;
-
- public:
- RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream );
- ~RedirectedStream();
- };
-
- class RedirectedStdOut {
- ReusableStringStream m_rss;
- RedirectedStream m_cout;
- public:
- RedirectedStdOut();
- auto str() const -> std::string;
- };
-
- // StdErr has two constituent streams in C++, std::cerr and std::clog
- // This means that we need to redirect 2 streams into 1 to keep proper
- // order of writes
- class RedirectedStdErr {
- ReusableStringStream m_rss;
- RedirectedStream m_cerr;
- RedirectedStream m_clog;
- public:
- RedirectedStdErr();
- auto str() const -> std::string;
- };
-
- class RedirectedStreams {
- public:
- RedirectedStreams(RedirectedStreams const&) = delete;
- RedirectedStreams& operator=(RedirectedStreams const&) = delete;
- RedirectedStreams(RedirectedStreams&&) = delete;
- RedirectedStreams& operator=(RedirectedStreams&&) = delete;
-
- RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr);
- ~RedirectedStreams();
- private:
- std::string& m_redirectedCout;
- std::string& m_redirectedCerr;
- RedirectedStdOut m_redirectedStdOut;
- RedirectedStdErr m_redirectedStdErr;
- };
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
-
- // Windows's implementation of std::tmpfile is terrible (it tries
- // to create a file inside system folder, thus requiring elevated
- // privileges for the binary), so we have to use tmpnam(_s) and
- // create the file ourselves there.
- class TempFile {
- public:
- TempFile(TempFile const&) = delete;
- TempFile& operator=(TempFile const&) = delete;
- TempFile(TempFile&&) = delete;
- TempFile& operator=(TempFile&&) = delete;
-
- TempFile();
- ~TempFile();
-
- std::FILE* getFile();
- std::string getContents();
-
- private:
- std::FILE* m_file = nullptr;
- #if defined(_MSC_VER)
- char m_buffer[L_tmpnam] = { 0 };
- #endif
- };
-
- class OutputRedirect {
- public:
- OutputRedirect(OutputRedirect const&) = delete;
- OutputRedirect& operator=(OutputRedirect const&) = delete;
- OutputRedirect(OutputRedirect&&) = delete;
- OutputRedirect& operator=(OutputRedirect&&) = delete;
-
- OutputRedirect(std::string& stdout_dest, std::string& stderr_dest);
- ~OutputRedirect();
-
- private:
- int m_originalStdout = -1;
- int m_originalStderr = -1;
- TempFile m_stdoutFile;
- TempFile m_stderrFile;
- std::string& m_stdoutDest;
- std::string& m_stderrDest;
- };
-
-#endif
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-// end catch_output_redirect.h
-#include <cstdio>
-#include <cstring>
-#include <fstream>
-#include <sstream>
-#include <stdexcept>
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
- #if defined(_MSC_VER)
- #include <io.h> //_dup and _dup2
- #define dup _dup
- #define dup2 _dup2
- #define fileno _fileno
- #else
- #include <unistd.h> // dup and dup2
- #endif
-#endif
-
-namespace Catch {
-
- RedirectedStream::RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream )
- : m_originalStream( originalStream ),
- m_redirectionStream( redirectionStream ),
- m_prevBuf( m_originalStream.rdbuf() )
- {
- m_originalStream.rdbuf( m_redirectionStream.rdbuf() );
- }
-
- RedirectedStream::~RedirectedStream() {
- m_originalStream.rdbuf( m_prevBuf );
- }
-
- RedirectedStdOut::RedirectedStdOut() : m_cout( Catch::cout(), m_rss.get() ) {}
- auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); }
-
- RedirectedStdErr::RedirectedStdErr()
- : m_cerr( Catch::cerr(), m_rss.get() ),
- m_clog( Catch::clog(), m_rss.get() )
- {}
- auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); }
-
- RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr)
- : m_redirectedCout(redirectedCout),
- m_redirectedCerr(redirectedCerr)
- {}
-
- RedirectedStreams::~RedirectedStreams() {
- m_redirectedCout += m_redirectedStdOut.str();
- m_redirectedCerr += m_redirectedStdErr.str();
- }
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
-
-#if defined(_MSC_VER)
- TempFile::TempFile() {
- if (tmpnam_s(m_buffer)) {
- CATCH_RUNTIME_ERROR("Could not get a temp filename");
- }
- if (fopen_s(&m_file, m_buffer, "w")) {
- char buffer[100];
- if (strerror_s(buffer, errno)) {
- CATCH_RUNTIME_ERROR("Could not translate errno to a string");
- }
- CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer);
- }
- }
-#else
- TempFile::TempFile() {
- m_file = std::tmpfile();
- if (!m_file) {
- CATCH_RUNTIME_ERROR("Could not create a temp file.");
- }
- }
-
-#endif
-
- TempFile::~TempFile() {
- // TBD: What to do about errors here?
- std::fclose(m_file);
- // We manually create the file on Windows only, on Linux
- // it will be autodeleted
-#if defined(_MSC_VER)
- std::remove(m_buffer);
-#endif
- }
-
- FILE* TempFile::getFile() {
- return m_file;
- }
-
- std::string TempFile::getContents() {
- std::stringstream sstr;
- char buffer[100] = {};
- std::rewind(m_file);
- while (std::fgets(buffer, sizeof(buffer), m_file)) {
- sstr << buffer;
- }
- return sstr.str();
- }
-
- OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) :
- m_originalStdout(dup(1)),
- m_originalStderr(dup(2)),
- m_stdoutDest(stdout_dest),
- m_stderrDest(stderr_dest) {
- dup2(fileno(m_stdoutFile.getFile()), 1);
- dup2(fileno(m_stderrFile.getFile()), 2);
- }
-
- OutputRedirect::~OutputRedirect() {
- Catch::cout() << std::flush;
- fflush(stdout);
- // Since we support overriding these streams, we flush cerr
- // even though std::cerr is unbuffered
- Catch::cerr() << std::flush;
- Catch::clog() << std::flush;
- fflush(stderr);
-
- dup2(m_originalStdout, 1);
- dup2(m_originalStderr, 2);
-
- m_stdoutDest += m_stdoutFile.getContents();
- m_stderrDest += m_stderrFile.getContents();
- }
-
-#endif // CATCH_CONFIG_NEW_CAPTURE
-
-} // namespace Catch
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
- #if defined(_MSC_VER)
- #undef dup
- #undef dup2
- #undef fileno
- #endif
-#endif
-// end catch_output_redirect.cpp
-// start catch_polyfills.cpp
-
-#include <cmath>
-
-namespace Catch {
-
-#if !defined(CATCH_CONFIG_POLYFILL_ISNAN)
- bool isnan(float f) {
- return std::isnan(f);
- }
- bool isnan(double d) {
- return std::isnan(d);
- }
-#else
- // For now we only use this for embarcadero
- bool isnan(float f) {
- return std::_isnan(f);
- }
- bool isnan(double d) {
- return std::_isnan(d);
- }
-#endif
-
-} // end namespace Catch
-// end catch_polyfills.cpp
-// start catch_random_number_generator.cpp
-
-namespace Catch {
-
-namespace {
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4146) // we negate uint32 during the rotate
-#endif
- // Safe rotr implementation thanks to John Regehr
- uint32_t rotate_right(uint32_t val, uint32_t count) {
- const uint32_t mask = 31;
- count &= mask;
- return (val >> count) | (val << (-count & mask));
- }
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-}
-
- SimplePcg32::SimplePcg32(result_type seed_) {
- seed(seed_);
- }
-
- void SimplePcg32::seed(result_type seed_) {
- m_state = 0;
- (*this)();
- m_state += seed_;
- (*this)();
- }
-
- void SimplePcg32::discard(uint64_t skip) {
- // We could implement this to run in O(log n) steps, but this
- // should suffice for our use case.
- for (uint64_t s = 0; s < skip; ++s) {
- static_cast<void>((*this)());
- }
- }
-
- SimplePcg32::result_type SimplePcg32::operator()() {
- // prepare the output value
- const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u);
- const auto output = rotate_right(xorshifted, m_state >> 59u);
-
- // advance state
- m_state = m_state * 6364136223846793005ULL + s_inc;
-
- return output;
- }
-
- bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
- return lhs.m_state == rhs.m_state;
- }
-
- bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
- return lhs.m_state != rhs.m_state;
- }
-}
-// end catch_random_number_generator.cpp
-// start catch_registry_hub.cpp
-
-// start catch_test_case_registry_impl.h
-
-#include <vector>
-#include <set>
-#include <algorithm>
-#include <ios>
-
-namespace Catch {
-
- class TestCase;
- struct IConfig;
-
- std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases );
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config );
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
-
- void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions );
-
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
-
- class TestRegistry : public ITestCaseRegistry {
- public:
- virtual ~TestRegistry() = default;
-
- virtual void registerTest( TestCase const& testCase );
-
- std::vector<TestCase> const& getAllTests() const override;
- std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const override;
-
- private:
- std::vector<TestCase> m_functions;
- mutable RunTests::InWhatOrder m_currentSortOrder = RunTests::InDeclarationOrder;
- mutable std::vector<TestCase> m_sortedFunctions;
- std::size_t m_unnamedCount = 0;
- std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class TestInvokerAsFunction : public ITestInvoker {
- void(*m_testAsFunction)();
- public:
- TestInvokerAsFunction( void(*testAsFunction)() ) noexcept;
-
- void invoke() const override;
- };
-
- std::string extractClassName( StringRef const& classOrQualifiedMethodName );
-
- ///////////////////////////////////////////////////////////////////////////
-
-} // end namespace Catch
-
-// end catch_test_case_registry_impl.h
-// start catch_reporter_registry.h
-
-#include <map>
-
-namespace Catch {
-
- class ReporterRegistry : public IReporterRegistry {
-
- public:
-
- ~ReporterRegistry() override;
-
- IStreamingReporterPtr create( std::string const& name, IConfigPtr const& config ) const override;
-
- void registerReporter( std::string const& name, IReporterFactoryPtr const& factory );
- void registerListener( IReporterFactoryPtr const& factory );
-
- FactoryMap const& getFactories() const override;
- Listeners const& getListeners() const override;
-
- private:
- FactoryMap m_factories;
- Listeners m_listeners;
- };
-}
-
-// end catch_reporter_registry.h
-// start catch_tag_alias_registry.h
-
-// start catch_tag_alias.h
-
-#include <string>
-
-namespace Catch {
-
- struct TagAlias {
- TagAlias(std::string const& _tag, SourceLineInfo _lineInfo);
-
- std::string tag;
- SourceLineInfo lineInfo;
- };
-
-} // end namespace Catch
-
-// end catch_tag_alias.h
-#include <map>
-
-namespace Catch {
-
- class TagAliasRegistry : public ITagAliasRegistry {
- public:
- ~TagAliasRegistry() override;
- TagAlias const* find( std::string const& alias ) const override;
- std::string expandAliases( std::string const& unexpandedTestSpec ) const override;
- void add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo );
-
- private:
- std::map<std::string, TagAlias> m_registry;
- };
-
-} // end namespace Catch
-
-// end catch_tag_alias_registry.h
-// start catch_startup_exception_registry.h
-
-#include <vector>
-#include <exception>
-
-namespace Catch {
-
- class StartupExceptionRegistry {
- public:
- void add(std::exception_ptr const& exception) noexcept;
- std::vector<std::exception_ptr> const& getExceptions() const noexcept;
- private:
- std::vector<std::exception_ptr> m_exceptions;
- };
-
-} // end namespace Catch
-
-// end catch_startup_exception_registry.h
-// start catch_singletons.hpp
-
-namespace Catch {
-
- struct ISingleton {
- virtual ~ISingleton();
- };
-
- void addSingleton( ISingleton* singleton );
- void cleanupSingletons();
-
- template<typename SingletonImplT, typename InterfaceT = SingletonImplT, typename MutableInterfaceT = InterfaceT>
- class Singleton : SingletonImplT, public ISingleton {
-
- static auto getInternal() -> Singleton* {
- static Singleton* s_instance = nullptr;
- if( !s_instance ) {
- s_instance = new Singleton;
- addSingleton( s_instance );
- }
- return s_instance;
- }
-
- public:
- static auto get() -> InterfaceT const& {
- return *getInternal();
- }
- static auto getMutable() -> MutableInterfaceT& {
- return *getInternal();
- }
- };
-
-} // namespace Catch
-
-// end catch_singletons.hpp
-namespace Catch {
-
- namespace {
-
- class RegistryHub : public IRegistryHub, public IMutableRegistryHub,
- private NonCopyable {
-
- public: // IRegistryHub
- RegistryHub() = default;
- IReporterRegistry const& getReporterRegistry() const override {
- return m_reporterRegistry;
- }
- ITestCaseRegistry const& getTestCaseRegistry() const override {
- return m_testCaseRegistry;
- }
- IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const override {
- return m_exceptionTranslatorRegistry;
- }
- ITagAliasRegistry const& getTagAliasRegistry() const override {
- return m_tagAliasRegistry;
- }
- StartupExceptionRegistry const& getStartupExceptionRegistry() const override {
- return m_exceptionRegistry;
- }
-
- public: // IMutableRegistryHub
- void registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) override {
- m_reporterRegistry.registerReporter( name, factory );
- }
- void registerListener( IReporterFactoryPtr const& factory ) override {
- m_reporterRegistry.registerListener( factory );
- }
- void registerTest( TestCase const& testInfo ) override {
- m_testCaseRegistry.registerTest( testInfo );
- }
- void registerTranslator( const IExceptionTranslator* translator ) override {
- m_exceptionTranslatorRegistry.registerTranslator( translator );
- }
- void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
- m_tagAliasRegistry.add( alias, tag, lineInfo );
- }
- void registerStartupException() noexcept override {
- m_exceptionRegistry.add(std::current_exception());
- }
- IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
- return m_enumValuesRegistry;
- }
-
- private:
- TestRegistry m_testCaseRegistry;
- ReporterRegistry m_reporterRegistry;
- ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
- TagAliasRegistry m_tagAliasRegistry;
- StartupExceptionRegistry m_exceptionRegistry;
- Detail::EnumValuesRegistry m_enumValuesRegistry;
- };
- }
-
- using RegistryHubSingleton = Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>;
-
- IRegistryHub const& getRegistryHub() {
- return RegistryHubSingleton::get();
- }
- IMutableRegistryHub& getMutableRegistryHub() {
- return RegistryHubSingleton::getMutable();
- }
- void cleanUp() {
- cleanupSingletons();
- cleanUpContext();
- }
- std::string translateActiveException() {
- return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
- }
-
-} // end namespace Catch
-// end catch_registry_hub.cpp
-// start catch_reporter_registry.cpp
-
-namespace Catch {
-
- ReporterRegistry::~ReporterRegistry() = default;
-
- IStreamingReporterPtr ReporterRegistry::create( std::string const& name, IConfigPtr const& config ) const {
- auto it = m_factories.find( name );
- if( it == m_factories.end() )
- return nullptr;
- return it->second->create( ReporterConfig( config ) );
- }
-
- void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) {
- m_factories.emplace(name, factory);
- }
- void ReporterRegistry::registerListener( IReporterFactoryPtr const& factory ) {
- m_listeners.push_back( factory );
- }
-
- IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const {
- return m_factories;
- }
- IReporterRegistry::Listeners const& ReporterRegistry::getListeners() const {
- return m_listeners;
- }
-
-}
-// end catch_reporter_registry.cpp
-// start catch_result_type.cpp
-
-namespace Catch {
-
- bool isOk( ResultWas::OfType resultType ) {
- return ( resultType & ResultWas::FailureBit ) == 0;
- }
- bool isJustInfo( int flags ) {
- return flags == ResultWas::Info;
- }
-
- ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
- return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
- }
-
- bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
- bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
-
-} // end namespace Catch
-// end catch_result_type.cpp
-// start catch_run_context.cpp
-
-#include <cassert>
-#include <algorithm>
-#include <sstream>
-
-namespace Catch {
-
- namespace Generators {
- struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker {
- GeneratorBasePtr m_generator;
-
- GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : TrackerBase( nameAndLocation, ctx, parent )
- {}
- ~GeneratorTracker();
-
- static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation ) {
- std::shared_ptr<GeneratorTracker> tracker;
-
- ITracker& currentTracker = ctx.currentTracker();
- if( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
- assert( childTracker );
- assert( childTracker->isGeneratorTracker() );
- tracker = std::static_pointer_cast<GeneratorTracker>( childTracker );
- }
- else {
- tracker = std::make_shared<GeneratorTracker>( nameAndLocation, ctx, &currentTracker );
- currentTracker.addChild( tracker );
- }
-
- if( !ctx.completedCycle() && !tracker->isComplete() ) {
- tracker->open();
- }
-
- return *tracker;
- }
-
- // TrackerBase interface
- bool isGeneratorTracker() const override { return true; }
- auto hasGenerator() const -> bool override {
- return !!m_generator;
- }
- void close() override {
- TrackerBase::close();
- // Generator interface only finds out if it has another item on atual move
- if (m_runState == CompletedSuccessfully && m_generator->next()) {
- m_children.clear();
- m_runState = Executing;
- }
- }
-
- // IGeneratorTracker interface
- auto getGenerator() const -> GeneratorBasePtr const& override {
- return m_generator;
- }
- void setGenerator( GeneratorBasePtr&& generator ) override {
- m_generator = std::move( generator );
- }
- };
- GeneratorTracker::~GeneratorTracker() {}
- }
-
- RunContext::RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter)
- : m_runInfo(_config->name()),
- m_context(getCurrentMutableContext()),
- m_config(_config),
- m_reporter(std::move(reporter)),
- m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
- m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
- {
- m_context.setRunner(this);
- m_context.setConfig(m_config);
- m_context.setResultCapture(this);
- m_reporter->testRunStarting(m_runInfo);
- }
-
- RunContext::~RunContext() {
- m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting()));
- }
-
- void RunContext::testGroupStarting(std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount) {
- m_reporter->testGroupStarting(GroupInfo(testSpec, groupIndex, groupsCount));
- }
-
- void RunContext::testGroupEnded(std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount) {
- m_reporter->testGroupEnded(TestGroupStats(GroupInfo(testSpec, groupIndex, groupsCount), totals, aborting()));
- }
-
- Totals RunContext::runTest(TestCase const& testCase) {
- Totals prevTotals = m_totals;
-
- std::string redirectedCout;
- std::string redirectedCerr;
-
- auto const& testInfo = testCase.getTestCaseInfo();
-
- m_reporter->testCaseStarting(testInfo);
-
- m_activeTestCase = &testCase;
-
- ITracker& rootTracker = m_trackerContext.startRun();
- assert(rootTracker.isSectionTracker());
- static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
- do {
- m_trackerContext.startCycle();
- m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo));
- runCurrentTest(redirectedCout, redirectedCerr);
- } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting());
-
- Totals deltaTotals = m_totals.delta(prevTotals);
- if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) {
- deltaTotals.assertions.failed++;
- deltaTotals.testCases.passed--;
- deltaTotals.testCases.failed++;
- }
- m_totals.testCases += deltaTotals.testCases;
- m_reporter->testCaseEnded(TestCaseStats(testInfo,
- deltaTotals,
- redirectedCout,
- redirectedCerr,
- aborting()));
-
- m_activeTestCase = nullptr;
- m_testCaseTracker = nullptr;
-
- return deltaTotals;
- }
-
- IConfigPtr RunContext::config() const {
- return m_config;
- }
-
- IStreamingReporter& RunContext::reporter() const {
- return *m_reporter;
- }
-
- void RunContext::assertionEnded(AssertionResult const & result) {
- if (result.getResultType() == ResultWas::Ok) {
- m_totals.assertions.passed++;
- m_lastAssertionPassed = true;
- } else if (!result.isOk()) {
- m_lastAssertionPassed = false;
- if( m_activeTestCase->getTestCaseInfo().okToFail() )
- m_totals.assertions.failedButOk++;
- else
- m_totals.assertions.failed++;
- }
- else {
- m_lastAssertionPassed = true;
- }
-
- // We have no use for the return value (whether messages should be cleared), because messages were made scoped
- // and should be let to clear themselves out.
- static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)));
-
- if (result.getResultType() != ResultWas::Warning)
- m_messageScopes.clear();
-
- // Reset working state
- resetAssertionInfo();
- m_lastResult = result;
- }
- void RunContext::resetAssertionInfo() {
- m_lastAssertionInfo.macroName = StringRef();
- m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr;
- }
-
- bool RunContext::sectionStarted(SectionInfo const & sectionInfo, Counts & assertions) {
- ITracker& sectionTracker = SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(sectionInfo.name, sectionInfo.lineInfo));
- if (!sectionTracker.isOpen())
- return false;
- m_activeSections.push_back(&sectionTracker);
-
- m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo;
-
- m_reporter->sectionStarting(sectionInfo);
-
- assertions = m_totals.assertions;
-
- return true;
- }
- auto RunContext::acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
- using namespace Generators;
- GeneratorTracker& tracker = GeneratorTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( "generator", lineInfo ) );
- assert( tracker.isOpen() );
- m_lastAssertionInfo.lineInfo = lineInfo;
- return tracker;
- }
-
- bool RunContext::testForMissingAssertions(Counts& assertions) {
- if (assertions.total() != 0)
- return false;
- if (!m_config->warnAboutMissingAssertions())
- return false;
- if (m_trackerContext.currentTracker().hasChildren())
- return false;
- m_totals.assertions.failed++;
- assertions.failed++;
- return true;
- }
-
- void RunContext::sectionEnded(SectionEndInfo const & endInfo) {
- Counts assertions = m_totals.assertions - endInfo.prevAssertions;
- bool missingAssertions = testForMissingAssertions(assertions);
-
- if (!m_activeSections.empty()) {
- m_activeSections.back()->close();
- m_activeSections.pop_back();
- }
-
- m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions));
- m_messages.clear();
- m_messageScopes.clear();
- }
-
- void RunContext::sectionEndedEarly(SectionEndInfo const & endInfo) {
- if (m_unfinishedSections.empty())
- m_activeSections.back()->fail();
- else
- m_activeSections.back()->close();
- m_activeSections.pop_back();
-
- m_unfinishedSections.push_back(endInfo);
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void RunContext::benchmarkPreparing(std::string const& name) {
- m_reporter->benchmarkPreparing(name);
- }
- void RunContext::benchmarkStarting( BenchmarkInfo const& info ) {
- m_reporter->benchmarkStarting( info );
- }
- void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) {
- m_reporter->benchmarkEnded( stats );
- }
- void RunContext::benchmarkFailed(std::string const & error) {
- m_reporter->benchmarkFailed(error);
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void RunContext::pushScopedMessage(MessageInfo const & message) {
- m_messages.push_back(message);
- }
-
- void RunContext::popScopedMessage(MessageInfo const & message) {
- m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end());
- }
-
- void RunContext::emplaceUnscopedMessage( MessageBuilder const& builder ) {
- m_messageScopes.emplace_back( builder );
- }
-
- std::string RunContext::getCurrentTestName() const {
- return m_activeTestCase
- ? m_activeTestCase->getTestCaseInfo().name
- : std::string();
- }
-
- const AssertionResult * RunContext::getLastResult() const {
- return &(*m_lastResult);
- }
-
- void RunContext::exceptionEarlyReported() {
- m_shouldReportUnexpected = false;
- }
-
- void RunContext::handleFatalErrorCondition( StringRef message ) {
- // First notify reporter that bad things happened
- m_reporter->fatalErrorEncountered(message);
-
- // Don't rebuild the result -- the stringification itself can cause more fatal errors
- // Instead, fake a result data.
- AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
- tempResult.message = static_cast<std::string>(message);
- AssertionResult result(m_lastAssertionInfo, tempResult);
-
- assertionEnded(result);
-
- handleUnfinishedSections();
-
- // Recreate section for test case (as we will lose the one that was in scope)
- auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
-
- Counts assertions;
- assertions.failed = 1;
- SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
- m_reporter->sectionEnded(testCaseSectionStats);
-
- auto const& testInfo = m_activeTestCase->getTestCaseInfo();
-
- Totals deltaTotals;
- deltaTotals.testCases.failed = 1;
- deltaTotals.assertions.failed = 1;
- m_reporter->testCaseEnded(TestCaseStats(testInfo,
- deltaTotals,
- std::string(),
- std::string(),
- false));
- m_totals.testCases.failed++;
- testGroupEnded(std::string(), m_totals, 1, 1);
- m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
- }
-
- bool RunContext::lastAssertionPassed() {
- return m_lastAssertionPassed;
- }
-
- void RunContext::assertionPassed() {
- m_lastAssertionPassed = true;
- ++m_totals.assertions.passed;
- resetAssertionInfo();
- m_messageScopes.clear();
- }
-
- bool RunContext::aborting() const {
- return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter());
- }
-
- void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) {
- auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
- m_reporter->sectionStarting(testCaseSection);
- Counts prevAssertions = m_totals.assertions;
- double duration = 0;
- m_shouldReportUnexpected = true;
- m_lastAssertionInfo = { "TEST_CASE"_sr, testCaseInfo.lineInfo, StringRef(), ResultDisposition::Normal };
-
- seedRng(*m_config);
-
- Timer timer;
- CATCH_TRY {
- if (m_reporter->getPreferences().shouldRedirectStdOut) {
-#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
- RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr);
-
- timer.start();
- invokeActiveTestCase();
-#else
- OutputRedirect r(redirectedCout, redirectedCerr);
- timer.start();
- invokeActiveTestCase();
-#endif
- } else {
- timer.start();
- invokeActiveTestCase();
- }
- duration = timer.getElapsedSeconds();
- } CATCH_CATCH_ANON (TestFailureException&) {
- // This just means the test was aborted due to failure
- } CATCH_CATCH_ALL {
- // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions
- // are reported without translation at the point of origin.
- if( m_shouldReportUnexpected ) {
- AssertionReaction dummyReaction;
- handleUnexpectedInflightException( m_lastAssertionInfo, translateActiveException(), dummyReaction );
- }
- }
- Counts assertions = m_totals.assertions - prevAssertions;
- bool missingAssertions = testForMissingAssertions(assertions);
-
- m_testCaseTracker->close();
- handleUnfinishedSections();
- m_messages.clear();
- m_messageScopes.clear();
-
- SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions);
- m_reporter->sectionEnded(testCaseSectionStats);
- }
-
- void RunContext::invokeActiveTestCase() {
- FatalConditionHandler fatalConditionHandler; // Handle signals
- m_activeTestCase->invoke();
- fatalConditionHandler.reset();
- }
-
- void RunContext::handleUnfinishedSections() {
- // If sections ended prematurely due to an exception we stored their
- // infos here so we can tear them down outside the unwind process.
- for (auto it = m_unfinishedSections.rbegin(),
- itEnd = m_unfinishedSections.rend();
- it != itEnd;
- ++it)
- sectionEnded(*it);
- m_unfinishedSections.clear();
- }
-
- void RunContext::handleExpr(
- AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction
- ) {
- m_reporter->assertionStarting( info );
-
- bool negated = isFalseTest( info.resultDisposition );
- bool result = expr.getResult() != negated;
-
- if( result ) {
- if (!m_includeSuccessfulResults) {
- assertionPassed();
- }
- else {
- reportExpr(info, ResultWas::Ok, &expr, negated);
- }
- }
- else {
- reportExpr(info, ResultWas::ExpressionFailed, &expr, negated );
- populateReaction( reaction );
- }
- }
- void RunContext::reportExpr(
- AssertionInfo const &info,
- ResultWas::OfType resultType,
- ITransientExpression const *expr,
- bool negated ) {
-
- m_lastAssertionInfo = info;
- AssertionResultData data( resultType, LazyExpression( negated ) );
-
- AssertionResult assertionResult{ info, data };
- assertionResult.m_resultData.lazyExpression.m_transientExpression = expr;
-
- assertionEnded( assertionResult );
- }
-
- void RunContext::handleMessage(
- AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction
- ) {
- m_reporter->assertionStarting( info );
-
- m_lastAssertionInfo = info;
-
- AssertionResultData data( resultType, LazyExpression( false ) );
- data.message = static_cast<std::string>(message);
- AssertionResult assertionResult{ m_lastAssertionInfo, data };
- assertionEnded( assertionResult );
- if( !assertionResult.isOk() )
- populateReaction( reaction );
- }
- void RunContext::handleUnexpectedExceptionNotThrown(
- AssertionInfo const& info,
- AssertionReaction& reaction
- ) {
- handleNonExpr(info, Catch::ResultWas::DidntThrowException, reaction);
- }
-
- void RunContext::handleUnexpectedInflightException(
- AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
- data.message = message;
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
- populateReaction( reaction );
- }
-
- void RunContext::populateReaction( AssertionReaction& reaction ) {
- reaction.shouldDebugBreak = m_config->shouldDebugBreak();
- reaction.shouldThrow = aborting() || (m_lastAssertionInfo.resultDisposition & ResultDisposition::Normal);
- }
-
- void RunContext::handleIncomplete(
- AssertionInfo const& info
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
- data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE";
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
- }
- void RunContext::handleNonExpr(
- AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( resultType, LazyExpression( false ) );
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
-
- if( !assertionResult.isOk() )
- populateReaction( reaction );
- }
-
- IResultCapture& getResultCapture() {
- if (auto* capture = getCurrentContext().getResultCapture())
- return *capture;
- else
- CATCH_INTERNAL_ERROR("No result capture instance");
- }
-
- void seedRng(IConfig const& config) {
- if (config.rngSeed() != 0) {
- std::srand(config.rngSeed());
- rng().seed(config.rngSeed());
- }
- }
-
- unsigned int rngSeed() {
- return getCurrentContext().getConfig()->rngSeed();
- }
-
-}
-// end catch_run_context.cpp
-// start catch_section.cpp
-
-namespace Catch {
-
- Section::Section( SectionInfo const& info )
- : m_info( info ),
- m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
- {
- m_timer.start();
- }
-
- Section::~Section() {
- if( m_sectionIncluded ) {
- SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() };
- if( uncaught_exceptions() )
- getResultCapture().sectionEndedEarly( endInfo );
- else
- getResultCapture().sectionEnded( endInfo );
- }
- }
-
- // This indicates whether the section should be executed or not
- Section::operator bool() const {
- return m_sectionIncluded;
- }
-
-} // end namespace Catch
-// end catch_section.cpp
-// start catch_section_info.cpp
-
-namespace Catch {
-
- SectionInfo::SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name )
- : name( _name ),
- lineInfo( _lineInfo )
- {}
-
-} // end namespace Catch
-// end catch_section_info.cpp
-// start catch_session.cpp
-
-// start catch_session.h
-
-#include <memory>
-
-namespace Catch {
-
- class Session : NonCopyable {
- public:
-
- Session();
- ~Session() override;
-
- void showHelp() const;
- void libIdentify();
-
- int applyCommandLine( int argc, char const * const * argv );
- #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
- int applyCommandLine( int argc, wchar_t const * const * argv );
- #endif
-
- void useConfigData( ConfigData const& configData );
-
- template<typename CharT>
- int run(int argc, CharT const * const argv[]) {
- if (m_startupExceptions)
- return 1;
- int returnCode = applyCommandLine(argc, argv);
- if (returnCode == 0)
- returnCode = run();
- return returnCode;
- }
-
- int run();
-
- clara::Parser const& cli() const;
- void cli( clara::Parser const& newParser );
- ConfigData& configData();
- Config& config();
- private:
- int runInternal();
-
- clara::Parser m_cli;
- ConfigData m_configData;
- std::shared_ptr<Config> m_config;
- bool m_startupExceptions = false;
- };
-
-} // end namespace Catch
-
-// end catch_session.h
-// start catch_version.h
-
-#include <iosfwd>
-
-namespace Catch {
-
- // Versioning information
- struct Version {
- Version( Version const& ) = delete;
- Version& operator=( Version const& ) = delete;
- Version( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- char const * const _branchName,
- unsigned int _buildNumber );
-
- unsigned int const majorVersion;
- unsigned int const minorVersion;
- unsigned int const patchNumber;
-
- // buildNumber is only used if branchName is not null
- char const * const branchName;
- unsigned int const buildNumber;
-
- friend std::ostream& operator << ( std::ostream& os, Version const& version );
- };
-
- Version const& libraryVersion();
-}
-
-// end catch_version.h
-#include <cstdlib>
-#include <iomanip>
-#include <set>
-#include <iterator>
-
-namespace Catch {
-
- namespace {
- const int MaxExitCode = 255;
-
- IStreamingReporterPtr createReporter(std::string const& reporterName, IConfigPtr const& config) {
- auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config);
- CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'");
-
- return reporter;
- }
-
- IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
- if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
- return createReporter(config->getReporterName(), config);
- }
-
- // On older platforms, returning std::unique_ptr<ListeningReporter>
- // when the return type is std::unique_ptr<IStreamingReporter>
- // doesn't compile without a std::move call. However, this causes
- // a warning on newer platforms. Thus, we have to work around
- // it a bit and downcast the pointer manually.
- auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter);
- auto& multi = static_cast<ListeningReporter&>(*ret);
- auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
- for (auto const& listener : listeners) {
- multi.addListener(listener->create(Catch::ReporterConfig(config)));
- }
- multi.addReporter(createReporter(config->getReporterName(), config));
- return ret;
- }
-
- class TestGroup {
- public:
- explicit TestGroup(std::shared_ptr<Config> const& config)
- : m_config{config}
- , m_context{config, makeReporter(config)}
- {
- auto const& allTestCases = getAllTestCasesSorted(*m_config);
- m_matches = m_config->testSpec().matchesByFilter(allTestCases, *m_config);
- auto const& invalidArgs = m_config->testSpec().getInvalidArgs();
-
- if (m_matches.empty() && invalidArgs.empty()) {
- for (auto const& test : allTestCases)
- if (!test.isHidden())
- m_tests.emplace(&test);
- } else {
- for (auto const& match : m_matches)
- m_tests.insert(match.tests.begin(), match.tests.end());
- }
- }
-
- Totals execute() {
- auto const& invalidArgs = m_config->testSpec().getInvalidArgs();
- Totals totals;
- m_context.testGroupStarting(m_config->name(), 1, 1);
- for (auto const& testCase : m_tests) {
- if (!m_context.aborting())
- totals += m_context.runTest(*testCase);
- else
- m_context.reporter().skipTest(*testCase);
- }
-
- for (auto const& match : m_matches) {
- if (match.tests.empty()) {
- m_context.reporter().noMatchingTestCases(match.name);
- totals.error = -1;
- }
- }
-
- if (!invalidArgs.empty()) {
- for (auto const& invalidArg: invalidArgs)
- m_context.reporter().reportInvalidArguments(invalidArg);
- }
-
- m_context.testGroupEnded(m_config->name(), totals, 1, 1);
- return totals;
- }
-
- private:
- using Tests = std::set<TestCase const*>;
-
- std::shared_ptr<Config> m_config;
- RunContext m_context;
- Tests m_tests;
- TestSpec::Matches m_matches;
- };
-
- void applyFilenamesAsTags(Catch::IConfig const& config) {
- auto& tests = const_cast<std::vector<TestCase>&>(getAllTestCasesSorted(config));
- for (auto& testCase : tests) {
- auto tags = testCase.tags;
-
- std::string filename = testCase.lineInfo.file;
- auto lastSlash = filename.find_last_of("\\/");
- if (lastSlash != std::string::npos) {
- filename.erase(0, lastSlash);
- filename[0] = '#';
- }
-
- auto lastDot = filename.find_last_of('.');
- if (lastDot != std::string::npos) {
- filename.erase(lastDot);
- }
-
- tags.push_back(std::move(filename));
- setTags(testCase, tags);
- }
- }
-
- } // anon namespace
-
- Session::Session() {
- static bool alreadyInstantiated = false;
- if( alreadyInstantiated ) {
- CATCH_TRY { CATCH_INTERNAL_ERROR( "Only one instance of Catch::Session can ever be used" ); }
- CATCH_CATCH_ALL { getMutableRegistryHub().registerStartupException(); }
- }
-
- // There cannot be exceptions at startup in no-exception mode.
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions();
- if ( !exceptions.empty() ) {
- config();
- getCurrentMutableContext().setConfig(m_config);
-
- m_startupExceptions = true;
- Colour colourGuard( Colour::Red );
- Catch::cerr() << "Errors occurred during startup!" << '\n';
- // iterate over all exceptions and notify user
- for ( const auto& ex_ptr : exceptions ) {
- try {
- std::rethrow_exception(ex_ptr);
- } catch ( std::exception const& ex ) {
- Catch::cerr() << Column( ex.what() ).indent(2) << '\n';
- }
- }
- }
-#endif
-
- alreadyInstantiated = true;
- m_cli = makeCommandLineParser( m_configData );
- }
- Session::~Session() {
- Catch::cleanUp();
- }
-
- void Session::showHelp() const {
- Catch::cout()
- << "\nCatch v" << libraryVersion() << "\n"
- << m_cli << std::endl
- << "For more detailed usage please see the project docs\n" << std::endl;
- }
- void Session::libIdentify() {
- Catch::cout()
- << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n"
- << std::left << std::setw(16) << "category: " << "testframework\n"
- << std::left << std::setw(16) << "framework: " << "Catch Test\n"
- << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl;
- }
-
- int Session::applyCommandLine( int argc, char const * const * argv ) {
- if( m_startupExceptions )
- return 1;
-
- auto result = m_cli.parse( clara::Args( argc, argv ) );
- if( !result ) {
- config();
- getCurrentMutableContext().setConfig(m_config);
- Catch::cerr()
- << Colour( Colour::Red )
- << "\nError(s) in input:\n"
- << Column( result.errorMessage() ).indent( 2 )
- << "\n\n";
- Catch::cerr() << "Run with -? for usage\n" << std::endl;
- return MaxExitCode;
- }
-
- if( m_configData.showHelp )
- showHelp();
- if( m_configData.libIdentify )
- libIdentify();
- m_config.reset();
- return 0;
- }
-
-#if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
- int Session::applyCommandLine( int argc, wchar_t const * const * argv ) {
-
- char **utf8Argv = new char *[ argc ];
-
- for ( int i = 0; i < argc; ++i ) {
- int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, nullptr, 0, nullptr, nullptr );
-
- utf8Argv[ i ] = new char[ bufSize ];
-
- WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, nullptr, nullptr );
- }
-
- int returnCode = applyCommandLine( argc, utf8Argv );
-
- for ( int i = 0; i < argc; ++i )
- delete [] utf8Argv[ i ];
-
- delete [] utf8Argv;
-
- return returnCode;
- }
-#endif
-
- void Session::useConfigData( ConfigData const& configData ) {
- m_configData = configData;
- m_config.reset();
- }
-
- int Session::run() {
- if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) {
- Catch::cout() << "...waiting for enter/ return before starting" << std::endl;
- static_cast<void>(std::getchar());
- }
- int exitCode = runInternal();
- if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) {
- Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl;
- static_cast<void>(std::getchar());
- }
- return exitCode;
- }
-
- clara::Parser const& Session::cli() const {
- return m_cli;
- }
- void Session::cli( clara::Parser const& newParser ) {
- m_cli = newParser;
- }
- ConfigData& Session::configData() {
- return m_configData;
- }
- Config& Session::config() {
- if( !m_config )
- m_config = std::make_shared<Config>( m_configData );
- return *m_config;
- }
-
- int Session::runInternal() {
- if( m_startupExceptions )
- return 1;
-
- if (m_configData.showHelp || m_configData.libIdentify) {
- return 0;
- }
-
- CATCH_TRY {
- config(); // Force config to be constructed
-
- seedRng( *m_config );
-
- if( m_configData.filenamesAsTags )
- applyFilenamesAsTags( *m_config );
-
- // Handle list request
- if( Option<std::size_t> listed = list( m_config ) )
- return static_cast<int>( *listed );
-
- TestGroup tests { m_config };
- auto const totals = tests.execute();
-
- if( m_config->warnAboutNoTests() && totals.error == -1 )
- return 2;
-
- // Note that on unices only the lower 8 bits are usually used, clamping
- // the return value to 255 prevents false negative when some multiple
- // of 256 tests has failed
- return (std::min) (MaxExitCode, (std::max) (totals.error, static_cast<int>(totals.assertions.failed)));
- }
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- catch( std::exception& ex ) {
- Catch::cerr() << ex.what() << std::endl;
- return MaxExitCode;
- }
-#endif
- }
-
-} // end namespace Catch
-// end catch_session.cpp
-// start catch_singletons.cpp
-
-#include <vector>
-
-namespace Catch {
-
- namespace {
- static auto getSingletons() -> std::vector<ISingleton*>*& {
- static std::vector<ISingleton*>* g_singletons = nullptr;
- if( !g_singletons )
- g_singletons = new std::vector<ISingleton*>();
- return g_singletons;
- }
- }
-
- ISingleton::~ISingleton() {}
-
- void addSingleton(ISingleton* singleton ) {
- getSingletons()->push_back( singleton );
- }
- void cleanupSingletons() {
- auto& singletons = getSingletons();
- for( auto singleton : *singletons )
- delete singleton;
- delete singletons;
- singletons = nullptr;
- }
-
-} // namespace Catch
-// end catch_singletons.cpp
-// start catch_startup_exception_registry.cpp
-
-namespace Catch {
-void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
- CATCH_TRY {
- m_exceptions.push_back(exception);
- } CATCH_CATCH_ALL {
- // If we run out of memory during start-up there's really not a lot more we can do about it
- std::terminate();
- }
- }
-
- std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept {
- return m_exceptions;
- }
-
-} // end namespace Catch
-// end catch_startup_exception_registry.cpp
-// start catch_stream.cpp
-
-#include <cstdio>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- Catch::IStream::~IStream() = default;
-
- namespace Detail { namespace {
- template<typename WriterF, std::size_t bufferSize=256>
- class StreamBufImpl : public std::streambuf {
- char data[bufferSize];
- WriterF m_writer;
-
- public:
- StreamBufImpl() {
- setp( data, data + sizeof(data) );
- }
-
- ~StreamBufImpl() noexcept {
- StreamBufImpl::sync();
- }
-
- private:
- int overflow( int c ) override {
- sync();
-
- if( c != EOF ) {
- if( pbase() == epptr() )
- m_writer( std::string( 1, static_cast<char>( c ) ) );
- else
- sputc( static_cast<char>( c ) );
- }
- return 0;
- }
-
- int sync() override {
- if( pbase() != pptr() ) {
- m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) );
- setp( pbase(), epptr() );
- }
- return 0;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- struct OutputDebugWriter {
-
- void operator()( std::string const&str ) {
- writeToDebugConsole( str );
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class FileStream : public IStream {
- mutable std::ofstream m_ofs;
- public:
- FileStream( StringRef filename ) {
- m_ofs.open( filename.c_str() );
- CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << "'" );
- }
- ~FileStream() override = default;
- public: // IStream
- std::ostream& stream() const override {
- return m_ofs;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class CoutStream : public IStream {
- mutable std::ostream m_os;
- public:
- // Store the streambuf from cout up-front because
- // cout may get redirected when running tests
- CoutStream() : m_os( Catch::cout().rdbuf() ) {}
- ~CoutStream() override = default;
-
- public: // IStream
- std::ostream& stream() const override { return m_os; }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class DebugOutStream : public IStream {
- std::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf;
- mutable std::ostream m_os;
- public:
- DebugOutStream()
- : m_streamBuf( new StreamBufImpl<OutputDebugWriter>() ),
- m_os( m_streamBuf.get() )
- {}
-
- ~DebugOutStream() override = default;
-
- public: // IStream
- std::ostream& stream() const override { return m_os; }
- };
-
- }} // namespace anon::detail
-
- ///////////////////////////////////////////////////////////////////////////
-
- auto makeStream( StringRef const &filename ) -> IStream const* {
- if( filename.empty() )
- return new Detail::CoutStream();
- else if( filename[0] == '%' ) {
- if( filename == "%debug" )
- return new Detail::DebugOutStream();
- else
- CATCH_ERROR( "Unrecognised stream: '" << filename << "'" );
- }
- else
- return new Detail::FileStream( filename );
- }
-
- // This class encapsulates the idea of a pool of ostringstreams that can be reused.
- struct StringStreams {
- std::vector<std::unique_ptr<std::ostringstream>> m_streams;
- std::vector<std::size_t> m_unused;
- std::ostringstream m_referenceStream; // Used for copy state/ flags from
-
- auto add() -> std::size_t {
- if( m_unused.empty() ) {
- m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) );
- return m_streams.size()-1;
- }
- else {
- auto index = m_unused.back();
- m_unused.pop_back();
- return index;
- }
- }
-
- void release( std::size_t index ) {
- m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state
- m_unused.push_back(index);
- }
- };
-
- ReusableStringStream::ReusableStringStream()
- : m_index( Singleton<StringStreams>::getMutable().add() ),
- m_oss( Singleton<StringStreams>::getMutable().m_streams[m_index].get() )
- {}
-
- ReusableStringStream::~ReusableStringStream() {
- static_cast<std::ostringstream*>( m_oss )->str("");
- m_oss->clear();
- Singleton<StringStreams>::getMutable().release( m_index );
- }
-
- auto ReusableStringStream::str() const -> std::string {
- return static_cast<std::ostringstream*>( m_oss )->str();
- }
-
- ///////////////////////////////////////////////////////////////////////////
-
-#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these functions
- std::ostream& cout() { return std::cout; }
- std::ostream& cerr() { return std::cerr; }
- std::ostream& clog() { return std::clog; }
-#endif
-}
-// end catch_stream.cpp
-// start catch_string_manip.cpp
-
-#include <algorithm>
-#include <ostream>
-#include <cstring>
-#include <cctype>
-#include <vector>
-
-namespace Catch {
-
- namespace {
- char toLowerCh(char c) {
- return static_cast<char>( std::tolower( c ) );
- }
- }
-
- bool startsWith( std::string const& s, std::string const& prefix ) {
- return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin());
- }
- bool startsWith( std::string const& s, char prefix ) {
- return !s.empty() && s[0] == prefix;
- }
- bool endsWith( std::string const& s, std::string const& suffix ) {
- return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
- }
- bool endsWith( std::string const& s, char suffix ) {
- return !s.empty() && s[s.size()-1] == suffix;
- }
- bool contains( std::string const& s, std::string const& infix ) {
- return s.find( infix ) != std::string::npos;
- }
- void toLowerInPlace( std::string& s ) {
- std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
- }
- std::string toLower( std::string const& s ) {
- std::string lc = s;
- toLowerInPlace( lc );
- return lc;
- }
- std::string trim( std::string const& str ) {
- static char const* whitespaceChars = "\n\r\t ";
- std::string::size_type start = str.find_first_not_of( whitespaceChars );
- std::string::size_type end = str.find_last_not_of( whitespaceChars );
-
- return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string();
- }
-
- StringRef trim(StringRef ref) {
- const auto is_ws = [](char c) {
- return c == ' ' || c == '\t' || c == '\n' || c == '\r';
- };
- size_t real_begin = 0;
- while (real_begin < ref.size() && is_ws(ref[real_begin])) { ++real_begin; }
- size_t real_end = ref.size();
- while (real_end > real_begin && is_ws(ref[real_end - 1])) { --real_end; }
-
- return ref.substr(real_begin, real_end - real_begin);
- }
-
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
- bool replaced = false;
- std::size_t i = str.find( replaceThis );
- while( i != std::string::npos ) {
- replaced = true;
- str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
- if( i < str.size()-withThis.size() )
- i = str.find( replaceThis, i+withThis.size() );
- else
- i = std::string::npos;
- }
- return replaced;
- }
-
- std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
- std::vector<StringRef> subStrings;
- std::size_t start = 0;
- for(std::size_t pos = 0; pos < str.size(); ++pos ) {
- if( str[pos] == delimiter ) {
- if( pos - start > 1 )
- subStrings.push_back( str.substr( start, pos-start ) );
- start = pos+1;
- }
- }
- if( start < str.size() )
- subStrings.push_back( str.substr( start, str.size()-start ) );
- return subStrings;
- }
-
- pluralise::pluralise( std::size_t count, std::string const& label )
- : m_count( count ),
- m_label( label )
- {}
-
- std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
- os << pluraliser.m_count << ' ' << pluraliser.m_label;
- if( pluraliser.m_count != 1 )
- os << 's';
- return os;
- }
-
-}
-// end catch_string_manip.cpp
-// start catch_stringref.cpp
-
-#include <algorithm>
-#include <ostream>
-#include <cstring>
-#include <cstdint>
-
-namespace Catch {
- StringRef::StringRef( char const* rawChars ) noexcept
- : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) )
- {}
-
- auto StringRef::c_str() const -> char const* {
- CATCH_ENFORCE(isNullTerminated(), "Called StringRef::c_str() on a non-null-terminated instance");
- return m_start;
- }
- auto StringRef::data() const noexcept -> char const* {
- return m_start;
- }
-
- auto StringRef::substr( size_type start, size_type size ) const noexcept -> StringRef {
- if (start < m_size) {
- return StringRef(m_start + start, (std::min)(m_size - start, size));
- } else {
- return StringRef();
- }
- }
- auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool {
- return m_size == other.m_size
- && (std::memcmp( m_start, other.m_start, m_size ) == 0);
- }
-
- auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
- return os.write(str.data(), str.size());
- }
-
- auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& {
- lhs.append(rhs.data(), rhs.size());
- return lhs;
- }
-
-} // namespace Catch
-// end catch_stringref.cpp
-// start catch_tag_alias.cpp
-
-namespace Catch {
- TagAlias::TagAlias(std::string const & _tag, SourceLineInfo _lineInfo): tag(_tag), lineInfo(_lineInfo) {}
-}
-// end catch_tag_alias.cpp
-// start catch_tag_alias_autoregistrar.cpp
-
-namespace Catch {
-
- RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) {
- CATCH_TRY {
- getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
- } CATCH_CATCH_ALL {
- // Do not throw when constructing global objects, instead register the exception to be processed later
- getMutableRegistryHub().registerStartupException();
- }
- }
-
-}
-// end catch_tag_alias_autoregistrar.cpp
-// start catch_tag_alias_registry.cpp
-
-#include <sstream>
-
-namespace Catch {
-
- TagAliasRegistry::~TagAliasRegistry() {}
-
- TagAlias const* TagAliasRegistry::find( std::string const& alias ) const {
- auto it = m_registry.find( alias );
- if( it != m_registry.end() )
- return &(it->second);
- else
- return nullptr;
- }
-
- std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const {
- std::string expandedTestSpec = unexpandedTestSpec;
- for( auto const& registryKvp : m_registry ) {
- std::size_t pos = expandedTestSpec.find( registryKvp.first );
- if( pos != std::string::npos ) {
- expandedTestSpec = expandedTestSpec.substr( 0, pos ) +
- registryKvp.second.tag +
- expandedTestSpec.substr( pos + registryKvp.first.size() );
- }
- }
- return expandedTestSpec;
- }
-
- void TagAliasRegistry::add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) {
- CATCH_ENFORCE( startsWith(alias, "[@") && endsWith(alias, ']'),
- "error: tag alias, '" << alias << "' is not of the form [@alias name].\n" << lineInfo );
-
- CATCH_ENFORCE( m_registry.insert(std::make_pair(alias, TagAlias(tag, lineInfo))).second,
- "error: tag alias, '" << alias << "' already registered.\n"
- << "\tFirst seen at: " << find(alias)->lineInfo << "\n"
- << "\tRedefined at: " << lineInfo );
- }
-
- ITagAliasRegistry::~ITagAliasRegistry() {}
-
- ITagAliasRegistry const& ITagAliasRegistry::get() {
- return getRegistryHub().getTagAliasRegistry();
- }
-
-} // end namespace Catch
-// end catch_tag_alias_registry.cpp
-// start catch_test_case_info.cpp
-
-#include <cctype>
-#include <exception>
-#include <algorithm>
-#include <sstream>
-
-namespace Catch {
-
- namespace {
- TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) {
- if( startsWith( tag, '.' ) ||
- tag == "!hide" )
- return TestCaseInfo::IsHidden;
- else if( tag == "!throws" )
- return TestCaseInfo::Throws;
- else if( tag == "!shouldfail" )
- return TestCaseInfo::ShouldFail;
- else if( tag == "!mayfail" )
- return TestCaseInfo::MayFail;
- else if( tag == "!nonportable" )
- return TestCaseInfo::NonPortable;
- else if( tag == "!benchmark" )
- return static_cast<TestCaseInfo::SpecialProperties>( TestCaseInfo::Benchmark | TestCaseInfo::IsHidden );
- else
- return TestCaseInfo::None;
- }
- bool isReservedTag( std::string const& tag ) {
- return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum( static_cast<unsigned char>(tag[0]) );
- }
- void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
- CATCH_ENFORCE( !isReservedTag(tag),
- "Tag name: [" << tag << "] is not allowed.\n"
- << "Tag names starting with non alphanumeric characters are reserved\n"
- << _lineInfo );
- }
- }
-
- TestCase makeTestCase( ITestInvoker* _testCase,
- std::string const& _className,
- NameAndTags const& nameAndTags,
- SourceLineInfo const& _lineInfo )
- {
- bool isHidden = false;
-
- // Parse out tags
- std::vector<std::string> tags;
- std::string desc, tag;
- bool inTag = false;
- for (char c : nameAndTags.tags) {
- if( !inTag ) {
- if( c == '[' )
- inTag = true;
- else
- desc += c;
- }
- else {
- if( c == ']' ) {
- TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
- if( ( prop & TestCaseInfo::IsHidden ) != 0 )
- isHidden = true;
- else if( prop == TestCaseInfo::None )
- enforceNotReservedTag( tag, _lineInfo );
-
- // Merged hide tags like `[.approvals]` should be added as
- // `[.][approvals]`. The `[.]` is added at later point, so
- // we only strip the prefix
- if (startsWith(tag, '.') && tag.size() > 1) {
- tag.erase(0, 1);
- }
- tags.push_back( tag );
- tag.clear();
- inTag = false;
- }
- else
- tag += c;
- }
- }
- if( isHidden ) {
- // Add all "hidden" tags to make them behave identically
- tags.insert( tags.end(), { ".", "!hide" } );
- }
-
- TestCaseInfo info( static_cast<std::string>(nameAndTags.name), _className, desc, tags, _lineInfo );
- return TestCase( _testCase, std::move(info) );
- }
-
- void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
- std::sort(begin(tags), end(tags));
- tags.erase(std::unique(begin(tags), end(tags)), end(tags));
- testCaseInfo.lcaseTags.clear();
-
- for( auto const& tag : tags ) {
- std::string lcaseTag = toLower( tag );
- testCaseInfo.properties = static_cast<TestCaseInfo::SpecialProperties>( testCaseInfo.properties | parseSpecialTag( lcaseTag ) );
- testCaseInfo.lcaseTags.push_back( lcaseTag );
- }
- testCaseInfo.tags = std::move(tags);
- }
-
- TestCaseInfo::TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::vector<std::string> const& _tags,
- SourceLineInfo const& _lineInfo )
- : name( _name ),
- className( _className ),
- description( _description ),
- lineInfo( _lineInfo ),
- properties( None )
- {
- setTags( *this, _tags );
- }
-
- bool TestCaseInfo::isHidden() const {
- return ( properties & IsHidden ) != 0;
- }
- bool TestCaseInfo::throws() const {
- return ( properties & Throws ) != 0;
- }
- bool TestCaseInfo::okToFail() const {
- return ( properties & (ShouldFail | MayFail ) ) != 0;
- }
- bool TestCaseInfo::expectedToFail() const {
- return ( properties & (ShouldFail ) ) != 0;
- }
-
- std::string TestCaseInfo::tagsAsString() const {
- std::string ret;
- // '[' and ']' per tag
- std::size_t full_size = 2 * tags.size();
- for (const auto& tag : tags) {
- full_size += tag.size();
- }
- ret.reserve(full_size);
- for (const auto& tag : tags) {
- ret.push_back('[');
- ret.append(tag);
- ret.push_back(']');
- }
-
- return ret;
- }
-
- TestCase::TestCase( ITestInvoker* testCase, TestCaseInfo&& info ) : TestCaseInfo( std::move(info) ), test( testCase ) {}
-
- TestCase TestCase::withName( std::string const& _newName ) const {
- TestCase other( *this );
- other.name = _newName;
- return other;
- }
-
- void TestCase::invoke() const {
- test->invoke();
- }
-
- bool TestCase::operator == ( TestCase const& other ) const {
- return test.get() == other.test.get() &&
- name == other.name &&
- className == other.className;
- }
-
- bool TestCase::operator < ( TestCase const& other ) const {
- return name < other.name;
- }
-
- TestCaseInfo const& TestCase::getTestCaseInfo() const
- {
- return *this;
- }
-
-} // end namespace Catch
-// end catch_test_case_info.cpp
-// start catch_test_case_registry_impl.cpp
-
-#include <sstream>
-
-namespace Catch {
-
- std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
-
- std::vector<TestCase> sorted = unsortedTestCases;
-
- switch( config.runOrder() ) {
- case RunTests::InLexicographicalOrder:
- std::sort( sorted.begin(), sorted.end() );
- break;
- case RunTests::InRandomOrder:
- seedRng( config );
- std::shuffle( sorted.begin(), sorted.end(), rng() );
- break;
- case RunTests::InDeclarationOrder:
- // already in declaration order
- break;
- }
- return sorted;
- }
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config ) {
- return !testCase.throws() || config.allowThrows();
- }
-
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
- return testSpec.matches( testCase ) && isThrowSafe( testCase, config );
- }
-
- void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions ) {
- std::set<TestCase> seenFunctions;
- for( auto const& function : functions ) {
- auto prev = seenFunctions.insert( function );
- CATCH_ENFORCE( prev.second,
- "error: TEST_CASE( \"" << function.name << "\" ) already defined.\n"
- << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n"
- << "\tRedefined at " << function.getTestCaseInfo().lineInfo );
- }
- }
-
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config ) {
- std::vector<TestCase> filtered;
- filtered.reserve( testCases.size() );
- for (auto const& testCase : testCases) {
- if ((!testSpec.hasFilters() && !testCase.isHidden()) ||
- (testSpec.hasFilters() && matchTest(testCase, testSpec, config))) {
- filtered.push_back(testCase);
- }
- }
- return filtered;
- }
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config ) {
- return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config );
- }
-
- void TestRegistry::registerTest( TestCase const& testCase ) {
- std::string name = testCase.getTestCaseInfo().name;
- if( name.empty() ) {
- ReusableStringStream rss;
- rss << "Anonymous test case " << ++m_unnamedCount;
- return registerTest( testCase.withName( rss.str() ) );
- }
- m_functions.push_back( testCase );
- }
-
- std::vector<TestCase> const& TestRegistry::getAllTests() const {
- return m_functions;
- }
- std::vector<TestCase> const& TestRegistry::getAllTestsSorted( IConfig const& config ) const {
- if( m_sortedFunctions.empty() )
- enforceNoDuplicateTestCases( m_functions );
-
- if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) {
- m_sortedFunctions = sortTests( config, m_functions );
- m_currentSortOrder = config.runOrder();
- }
- return m_sortedFunctions;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- TestInvokerAsFunction::TestInvokerAsFunction( void(*testAsFunction)() ) noexcept : m_testAsFunction( testAsFunction ) {}
-
- void TestInvokerAsFunction::invoke() const {
- m_testAsFunction();
- }
-
- std::string extractClassName( StringRef const& classOrQualifiedMethodName ) {
- std::string className(classOrQualifiedMethodName);
- if( startsWith( className, '&' ) )
- {
- std::size_t lastColons = className.rfind( "::" );
- std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
- if( penultimateColons == std::string::npos )
- penultimateColons = 1;
- className = className.substr( penultimateColons, lastColons-penultimateColons );
- }
- return className;
- }
-
-} // end namespace Catch
-// end catch_test_case_registry_impl.cpp
-// start catch_test_case_tracker.cpp
-
-#include <algorithm>
-#include <cassert>
-#include <stdexcept>
-#include <memory>
-#include <sstream>
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-#endif
-
-namespace Catch {
-namespace TestCaseTracking {
-
- NameAndLocation::NameAndLocation( std::string const& _name, SourceLineInfo const& _location )
- : name( _name ),
- location( _location )
- {}
-
- ITracker::~ITracker() = default;
-
- ITracker& TrackerContext::startRun() {
- m_rootTracker = std::make_shared<SectionTracker>( NameAndLocation( "{root}", CATCH_INTERNAL_LINEINFO ), *this, nullptr );
- m_currentTracker = nullptr;
- m_runState = Executing;
- return *m_rootTracker;
- }
-
- void TrackerContext::endRun() {
- m_rootTracker.reset();
- m_currentTracker = nullptr;
- m_runState = NotStarted;
- }
-
- void TrackerContext::startCycle() {
- m_currentTracker = m_rootTracker.get();
- m_runState = Executing;
- }
- void TrackerContext::completeCycle() {
- m_runState = CompletedCycle;
- }
-
- bool TrackerContext::completedCycle() const {
- return m_runState == CompletedCycle;
- }
- ITracker& TrackerContext::currentTracker() {
- return *m_currentTracker;
- }
- void TrackerContext::setCurrentTracker( ITracker* tracker ) {
- m_currentTracker = tracker;
- }
-
- TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : m_nameAndLocation( nameAndLocation ),
- m_ctx( ctx ),
- m_parent( parent )
- {}
-
- NameAndLocation const& TrackerBase::nameAndLocation() const {
- return m_nameAndLocation;
- }
- bool TrackerBase::isComplete() const {
- return m_runState == CompletedSuccessfully || m_runState == Failed;
- }
- bool TrackerBase::isSuccessfullyCompleted() const {
- return m_runState == CompletedSuccessfully;
- }
- bool TrackerBase::isOpen() const {
- return m_runState != NotStarted && !isComplete();
- }
- bool TrackerBase::hasChildren() const {
- return !m_children.empty();
- }
-
- void TrackerBase::addChild( ITrackerPtr const& child ) {
- m_children.push_back( child );
- }
-
- ITrackerPtr TrackerBase::findChild( NameAndLocation const& nameAndLocation ) {
- auto it = std::find_if( m_children.begin(), m_children.end(),
- [&nameAndLocation]( ITrackerPtr const& tracker ){
- return
- tracker->nameAndLocation().location == nameAndLocation.location &&
- tracker->nameAndLocation().name == nameAndLocation.name;
- } );
- return( it != m_children.end() )
- ? *it
- : nullptr;
- }
- ITracker& TrackerBase::parent() {
- assert( m_parent ); // Should always be non-null except for root
- return *m_parent;
- }
-
- void TrackerBase::openChild() {
- if( m_runState != ExecutingChildren ) {
- m_runState = ExecutingChildren;
- if( m_parent )
- m_parent->openChild();
- }
- }
-
- bool TrackerBase::isSectionTracker() const { return false; }
- bool TrackerBase::isGeneratorTracker() const { return false; }
-
- void TrackerBase::open() {
- m_runState = Executing;
- moveToThis();
- if( m_parent )
- m_parent->openChild();
- }
-
- void TrackerBase::close() {
-
- // Close any still open children (e.g. generators)
- while( &m_ctx.currentTracker() != this )
- m_ctx.currentTracker().close();
-
- switch( m_runState ) {
- case NeedsAnotherRun:
- break;
-
- case Executing:
- m_runState = CompletedSuccessfully;
- break;
- case ExecutingChildren:
- if( std::all_of(m_children.begin(), m_children.end(), [](ITrackerPtr const& t){ return t->isComplete(); }) )
- m_runState = CompletedSuccessfully;
- break;
-
- case NotStarted:
- case CompletedSuccessfully:
- case Failed:
- CATCH_INTERNAL_ERROR( "Illogical state: " << m_runState );
-
- default:
- CATCH_INTERNAL_ERROR( "Unknown state: " << m_runState );
- }
- moveToParent();
- m_ctx.completeCycle();
- }
- void TrackerBase::fail() {
- m_runState = Failed;
- if( m_parent )
- m_parent->markAsNeedingAnotherRun();
- moveToParent();
- m_ctx.completeCycle();
- }
- void TrackerBase::markAsNeedingAnotherRun() {
- m_runState = NeedsAnotherRun;
- }
-
- void TrackerBase::moveToParent() {
- assert( m_parent );
- m_ctx.setCurrentTracker( m_parent );
- }
- void TrackerBase::moveToThis() {
- m_ctx.setCurrentTracker( this );
- }
-
- SectionTracker::SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : TrackerBase( nameAndLocation, ctx, parent ),
- m_trimmed_name(trim(nameAndLocation.name))
- {
- if( parent ) {
- while( !parent->isSectionTracker() )
- parent = &parent->parent();
-
- SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
- addNextFilters( parentSection.m_filters );
- }
- }
-
- bool SectionTracker::isComplete() const {
- bool complete = true;
-
- if ((m_filters.empty() || m_filters[0] == "")
- || std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
- complete = TrackerBase::isComplete();
- }
- return complete;
- }
-
- bool SectionTracker::isSectionTracker() const { return true; }
-
- SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) {
- std::shared_ptr<SectionTracker> section;
-
- ITracker& currentTracker = ctx.currentTracker();
- if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
- assert( childTracker );
- assert( childTracker->isSectionTracker() );
- section = std::static_pointer_cast<SectionTracker>( childTracker );
- }
- else {
- section = std::make_shared<SectionTracker>( nameAndLocation, ctx, &currentTracker );
- currentTracker.addChild( section );
- }
- if( !ctx.completedCycle() )
- section->tryOpen();
- return *section;
- }
-
- void SectionTracker::tryOpen() {
- if( !isComplete() )
- open();
- }
-
- void SectionTracker::addInitialFilters( std::vector<std::string> const& filters ) {
- if( !filters.empty() ) {
- m_filters.reserve( m_filters.size() + filters.size() + 2 );
- m_filters.emplace_back(""); // Root - should never be consulted
- m_filters.emplace_back(""); // Test Case - not a section filter
- m_filters.insert( m_filters.end(), filters.begin(), filters.end() );
- }
- }
- void SectionTracker::addNextFilters( std::vector<std::string> const& filters ) {
- if( filters.size() > 1 )
- m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
- }
-
-} // namespace TestCaseTracking
-
-using TestCaseTracking::ITracker;
-using TestCaseTracking::TrackerContext;
-using TestCaseTracking::SectionTracker;
-
-} // namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-// end catch_test_case_tracker.cpp
-// start catch_test_registry.cpp
-
-namespace Catch {
-
- auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker* {
- return new(std::nothrow) TestInvokerAsFunction( testAsFunction );
- }
-
- NameAndTags::NameAndTags( StringRef const& name_ , StringRef const& tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
-
- AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept {
- CATCH_TRY {
- getMutableRegistryHub()
- .registerTest(
- makeTestCase(
- invoker,
- extractClassName( classOrMethod ),
- nameAndTags,
- lineInfo));
- } CATCH_CATCH_ALL {
- // Do not throw when constructing global objects, instead register the exception to be processed later
- getMutableRegistryHub().registerStartupException();
- }
- }
-
- AutoReg::~AutoReg() = default;
-}
-// end catch_test_registry.cpp
-// start catch_test_spec.cpp
-
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- TestSpec::Pattern::Pattern( std::string const& name )
- : m_name( name )
- {}
-
- TestSpec::Pattern::~Pattern() = default;
-
- std::string const& TestSpec::Pattern::name() const {
- return m_name;
- }
-
- TestSpec::NamePattern::NamePattern( std::string const& name, std::string const& filterString )
- : Pattern( filterString )
- , m_wildcardPattern( toLower( name ), CaseSensitive::No )
- {}
-
- bool TestSpec::NamePattern::matches( TestCaseInfo const& testCase ) const {
- return m_wildcardPattern.matches( testCase.name );
- }
-
- TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString )
- : Pattern( filterString )
- , m_tag( toLower( tag ) )
- {}
-
- bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const {
- return std::find(begin(testCase.lcaseTags),
- end(testCase.lcaseTags),
- m_tag) != end(testCase.lcaseTags);
- }
-
- TestSpec::ExcludedPattern::ExcludedPattern( PatternPtr const& underlyingPattern )
- : Pattern( underlyingPattern->name() )
- , m_underlyingPattern( underlyingPattern )
- {}
-
- bool TestSpec::ExcludedPattern::matches( TestCaseInfo const& testCase ) const {
- return !m_underlyingPattern->matches( testCase );
- }
-
- bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const {
- return std::all_of( m_patterns.begin(), m_patterns.end(), [&]( PatternPtr const& p ){ return p->matches( testCase ); } );
- }
-
- std::string TestSpec::Filter::name() const {
- std::string name;
- for( auto const& p : m_patterns )
- name += p->name();
- return name;
- }
-
- bool TestSpec::hasFilters() const {
- return !m_filters.empty();
- }
-
- bool TestSpec::matches( TestCaseInfo const& testCase ) const {
- return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } );
- }
-
- TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCase> const& testCases, IConfig const& config ) const
- {
- Matches matches( m_filters.size() );
- std::transform( m_filters.begin(), m_filters.end(), matches.begin(), [&]( Filter const& filter ){
- std::vector<TestCase const*> currentMatches;
- for( auto const& test : testCases )
- if( isThrowSafe( test, config ) && filter.matches( test ) )
- currentMatches.emplace_back( &test );
- return FilterMatch{ filter.name(), currentMatches };
- } );
- return matches;
- }
-
- const TestSpec::vectorStrings& TestSpec::getInvalidArgs() const{
- return (m_invalidArgs);
- }
-
-}
-// end catch_test_spec.cpp
-// start catch_test_spec_parser.cpp
-
-namespace Catch {
-
- TestSpecParser::TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {}
-
- TestSpecParser& TestSpecParser::parse( std::string const& arg ) {
- m_mode = None;
- m_exclusion = false;
- m_arg = m_tagAliases->expandAliases( arg );
- m_escapeChars.clear();
- m_substring.reserve(m_arg.size());
- m_patternName.reserve(m_arg.size());
- m_realPatternPos = 0;
-
- for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
- //if visitChar fails
- if( !visitChar( m_arg[m_pos] ) ){
- m_testSpec.m_invalidArgs.push_back(arg);
- break;
- }
- endMode();
- return *this;
- }
- TestSpec TestSpecParser::testSpec() {
- addFilter();
- return m_testSpec;
- }
- bool TestSpecParser::visitChar( char c ) {
- if( (m_mode != EscapedName) && (c == '\\') ) {
- escape();
- addCharToPattern(c);
- return true;
- }else if((m_mode != EscapedName) && (c == ',') ) {
- return separate();
- }
-
- switch( m_mode ) {
- case None:
- if( processNoneChar( c ) )
- return true;
- break;
- case Name:
- processNameChar( c );
- break;
- case EscapedName:
- endMode();
- addCharToPattern(c);
- return true;
- default:
- case Tag:
- case QuotedName:
- if( processOtherChar( c ) )
- return true;
- break;
- }
-
- m_substring += c;
- if( !isControlChar( c ) ) {
- m_patternName += c;
- m_realPatternPos++;
- }
- return true;
- }
- // Two of the processing methods return true to signal the caller to return
- // without adding the given character to the current pattern strings
- bool TestSpecParser::processNoneChar( char c ) {
- switch( c ) {
- case ' ':
- return true;
- case '~':
- m_exclusion = true;
- return false;
- case '[':
- startNewMode( Tag );
- return false;
- case '"':
- startNewMode( QuotedName );
- return false;
- default:
- startNewMode( Name );
- return false;
- }
- }
- void TestSpecParser::processNameChar( char c ) {
- if( c == '[' ) {
- if( m_substring == "exclude:" )
- m_exclusion = true;
- else
- endMode();
- startNewMode( Tag );
- }
- }
- bool TestSpecParser::processOtherChar( char c ) {
- if( !isControlChar( c ) )
- return false;
- m_substring += c;
- endMode();
- return true;
- }
- void TestSpecParser::startNewMode( Mode mode ) {
- m_mode = mode;
- }
- void TestSpecParser::endMode() {
- switch( m_mode ) {
- case Name:
- case QuotedName:
- return addNamePattern();
- case Tag:
- return addTagPattern();
- case EscapedName:
- revertBackToLastMode();
- return;
- case None:
- default:
- return startNewMode( None );
- }
- }
- void TestSpecParser::escape() {
- saveLastMode();
- m_mode = EscapedName;
- m_escapeChars.push_back(m_realPatternPos);
- }
- bool TestSpecParser::isControlChar( char c ) const {
- switch( m_mode ) {
- default:
- return false;
- case None:
- return c == '~';
- case Name:
- return c == '[';
- case EscapedName:
- return true;
- case QuotedName:
- return c == '"';
- case Tag:
- return c == '[' || c == ']';
- }
- }
-
- void TestSpecParser::addFilter() {
- if( !m_currentFilter.m_patterns.empty() ) {
- m_testSpec.m_filters.push_back( m_currentFilter );
- m_currentFilter = TestSpec::Filter();
- }
- }
-
- void TestSpecParser::saveLastMode() {
- lastMode = m_mode;
- }
-
- void TestSpecParser::revertBackToLastMode() {
- m_mode = lastMode;
- }
-
- bool TestSpecParser::separate() {
- if( (m_mode==QuotedName) || (m_mode==Tag) ){
- //invalid argument, signal failure to previous scope.
- m_mode = None;
- m_pos = m_arg.size();
- m_substring.clear();
- m_patternName.clear();
- return false;
- }
- endMode();
- addFilter();
- return true; //success
- }
-
- std::string TestSpecParser::preprocessPattern() {
- std::string token = m_patternName;
- for (std::size_t i = 0; i < m_escapeChars.size(); ++i)
- token = token.substr(0, m_escapeChars[i] - i) + token.substr(m_escapeChars[i] - i + 1);
- m_escapeChars.clear();
- if (startsWith(token, "exclude:")) {
- m_exclusion = true;
- token = token.substr(8);
- }
-
- m_patternName.clear();
-
- return token;
- }
-
- void TestSpecParser::addNamePattern() {
- auto token = preprocessPattern();
-
- if (!token.empty()) {
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::NamePattern>(token, m_substring);
- if (m_exclusion)
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- m_currentFilter.m_patterns.push_back(pattern);
- }
- m_substring.clear();
- m_exclusion = false;
- m_mode = None;
- }
-
- void TestSpecParser::addTagPattern() {
- auto token = preprocessPattern();
-
- if (!token.empty()) {
- // If the tag pattern is the "hide and tag" shorthand (e.g. [.foo])
- // we have to create a separate hide tag and shorten the real one
- if (token.size() > 1 && token[0] == '.') {
- token.erase(token.begin());
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(".", m_substring);
- if (m_exclusion) {
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- }
- m_currentFilter.m_patterns.push_back(pattern);
- }
-
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(token, m_substring);
-
- if (m_exclusion) {
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- }
- m_currentFilter.m_patterns.push_back(pattern);
- }
- m_substring.clear();
- m_exclusion = false;
- m_mode = None;
- }
-
- TestSpec parseTestSpec( std::string const& arg ) {
- return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec();
- }
-
-} // namespace Catch
-// end catch_test_spec_parser.cpp
-// start catch_timer.cpp
-
-#include <chrono>
-
-static const uint64_t nanosecondsInSecond = 1000000000;
-
-namespace Catch {
-
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
- return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
- }
-
- namespace {
- auto estimateClockResolution() -> uint64_t {
- uint64_t sum = 0;
- static const uint64_t iterations = 1000000;
-
- auto startTime = getCurrentNanosecondsSinceEpoch();
-
- for( std::size_t i = 0; i < iterations; ++i ) {
-
- uint64_t ticks;
- uint64_t baseTicks = getCurrentNanosecondsSinceEpoch();
- do {
- ticks = getCurrentNanosecondsSinceEpoch();
- } while( ticks == baseTicks );
-
- auto delta = ticks - baseTicks;
- sum += delta;
-
- // If we have been calibrating for over 3 seconds -- the clock
- // is terrible and we should move on.
- // TBD: How to signal that the measured resolution is probably wrong?
- if (ticks > startTime + 3 * nanosecondsInSecond) {
- return sum / ( i + 1u );
- }
- }
-
- // We're just taking the mean, here. To do better we could take the std. dev and exclude outliers
- // - and potentially do more iterations if there's a high variance.
- return sum/iterations;
- }
- }
- auto getEstimatedClockResolution() -> uint64_t {
- static auto s_resolution = estimateClockResolution();
- return s_resolution;
- }
-
- void Timer::start() {
- m_nanoseconds = getCurrentNanosecondsSinceEpoch();
- }
- auto Timer::getElapsedNanoseconds() const -> uint64_t {
- return getCurrentNanosecondsSinceEpoch() - m_nanoseconds;
- }
- auto Timer::getElapsedMicroseconds() const -> uint64_t {
- return getElapsedNanoseconds()/1000;
- }
- auto Timer::getElapsedMilliseconds() const -> unsigned int {
- return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
- }
- auto Timer::getElapsedSeconds() const -> double {
- return getElapsedMicroseconds()/1000000.0;
- }
-
-} // namespace Catch
-// end catch_timer.cpp
-// start catch_tostring.cpp
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-# pragma clang diagnostic ignored "-Wglobal-constructors"
-#endif
-
-// Enable specific decls locally
-#if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-#endif
-
-#include <cmath>
-#include <iomanip>
-
-namespace Catch {
-
-namespace Detail {
-
- const std::string unprintableString = "{?}";
-
- namespace {
- const int hexThreshold = 255;
-
- struct Endianness {
- enum Arch { Big, Little };
-
- static Arch which() {
- int one = 1;
- // If the lowest byte we read is non-zero, we can assume
- // that little endian format is used.
- auto value = *reinterpret_cast<char*>(&one);
- return value ? Little : Big;
- }
- };
- }
-
- std::string rawMemoryToString( const void *object, std::size_t size ) {
- // Reverse order for little endian architectures
- int i = 0, end = static_cast<int>( size ), inc = 1;
- if( Endianness::which() == Endianness::Little ) {
- i = end-1;
- end = inc = -1;
- }
-
- unsigned char const *bytes = static_cast<unsigned char const *>(object);
- ReusableStringStream rss;
- rss << "0x" << std::setfill('0') << std::hex;
- for( ; i != end; i += inc )
- rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
- return rss.str();
- }
-}
-
-template<typename T>
-std::string fpToString( T value, int precision ) {
- if (Catch::isnan(value)) {
- return "nan";
- }
-
- ReusableStringStream rss;
- rss << std::setprecision( precision )
- << std::fixed
- << value;
- std::string d = rss.str();
- std::size_t i = d.find_last_not_of( '0' );
- if( i != std::string::npos && i != d.size()-1 ) {
- if( d[i] == '.' )
- i++;
- d = d.substr( 0, i+1 );
- }
- return d;
-}
-
-//// ======================================================= ////
-//
-// Out-of-line defs for full specialization of StringMaker
-//
-//// ======================================================= ////
-
-std::string StringMaker<std::string>::convert(const std::string& str) {
- if (!getCurrentContext().getConfig()->showInvisibles()) {
- return '"' + str + '"';
- }
-
- std::string s("\"");
- for (char c : str) {
- switch (c) {
- case '\n':
- s.append("\\n");
- break;
- case '\t':
- s.append("\\t");
- break;
- default:
- s.push_back(c);
- break;
- }
- }
- s.append("\"");
- return s;
-}
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-std::string StringMaker<std::string_view>::convert(std::string_view str) {
- return ::Catch::Detail::stringify(std::string{ str });
-}
-#endif
-
-std::string StringMaker<char const*>::convert(char const* str) {
- if (str) {
- return ::Catch::Detail::stringify(std::string{ str });
- } else {
- return{ "{null string}" };
- }
-}
-std::string StringMaker<char*>::convert(char* str) {
- if (str) {
- return ::Catch::Detail::stringify(std::string{ str });
- } else {
- return{ "{null string}" };
- }
-}
-
-#ifdef CATCH_CONFIG_WCHAR
-std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
- std::string s;
- s.reserve(wstr.size());
- for (auto c : wstr) {
- s += (c <= 0xff) ? static_cast<char>(c) : '?';
- }
- return ::Catch::Detail::stringify(s);
-}
-
-# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-std::string StringMaker<std::wstring_view>::convert(std::wstring_view str) {
- return StringMaker<std::wstring>::convert(std::wstring(str));
-}
-# endif
-
-std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
- if (str) {
- return ::Catch::Detail::stringify(std::wstring{ str });
- } else {
- return{ "{null string}" };
- }
-}
-std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
- if (str) {
- return ::Catch::Detail::stringify(std::wstring{ str });
- } else {
- return{ "{null string}" };
- }
-}
-#endif
-
-#if defined(CATCH_CONFIG_CPP17_BYTE)
-#include <cstddef>
-std::string StringMaker<std::byte>::convert(std::byte value) {
- return ::Catch::Detail::stringify(std::to_integer<unsigned long long>(value));
-}
-#endif // defined(CATCH_CONFIG_CPP17_BYTE)
-
-std::string StringMaker<int>::convert(int value) {
- return ::Catch::Detail::stringify(static_cast<long long>(value));
-}
-std::string StringMaker<long>::convert(long value) {
- return ::Catch::Detail::stringify(static_cast<long long>(value));
-}
-std::string StringMaker<long long>::convert(long long value) {
- ReusableStringStream rss;
- rss << value;
- if (value > Detail::hexThreshold) {
- rss << " (0x" << std::hex << value << ')';
- }
- return rss.str();
-}
-
-std::string StringMaker<unsigned int>::convert(unsigned int value) {
- return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
-}
-std::string StringMaker<unsigned long>::convert(unsigned long value) {
- return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
-}
-std::string StringMaker<unsigned long long>::convert(unsigned long long value) {
- ReusableStringStream rss;
- rss << value;
- if (value > Detail::hexThreshold) {
- rss << " (0x" << std::hex << value << ')';
- }
- return rss.str();
-}
-
-std::string StringMaker<bool>::convert(bool b) {
- return b ? "true" : "false";
-}
-
-std::string StringMaker<signed char>::convert(signed char value) {
- if (value == '\r') {
- return "'\\r'";
- } else if (value == '\f') {
- return "'\\f'";
- } else if (value == '\n') {
- return "'\\n'";
- } else if (value == '\t') {
- return "'\\t'";
- } else if ('\0' <= value && value < ' ') {
- return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
- } else {
- char chstr[] = "' '";
- chstr[1] = value;
- return chstr;
- }
-}
-std::string StringMaker<char>::convert(char c) {
- return ::Catch::Detail::stringify(static_cast<signed char>(c));
-}
-std::string StringMaker<unsigned char>::convert(unsigned char c) {
- return ::Catch::Detail::stringify(static_cast<char>(c));
-}
-
-std::string StringMaker<std::nullptr_t>::convert(std::nullptr_t) {
- return "nullptr";
-}
-
-int StringMaker<float>::precision = 5;
-
-std::string StringMaker<float>::convert(float value) {
- return fpToString(value, precision) + 'f';
-}
-
-int StringMaker<double>::precision = 10;
-
-std::string StringMaker<double>::convert(double value) {
- return fpToString(value, precision);
-}
-
-std::string ratio_string<std::atto>::symbol() { return "a"; }
-std::string ratio_string<std::femto>::symbol() { return "f"; }
-std::string ratio_string<std::pico>::symbol() { return "p"; }
-std::string ratio_string<std::nano>::symbol() { return "n"; }
-std::string ratio_string<std::micro>::symbol() { return "u"; }
-std::string ratio_string<std::milli>::symbol() { return "m"; }
-
-} // end namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-
-// end catch_tostring.cpp
-// start catch_totals.cpp
-
-namespace Catch {
-
- Counts Counts::operator - ( Counts const& other ) const {
- Counts diff;
- diff.passed = passed - other.passed;
- diff.failed = failed - other.failed;
- diff.failedButOk = failedButOk - other.failedButOk;
- return diff;
- }
-
- Counts& Counts::operator += ( Counts const& other ) {
- passed += other.passed;
- failed += other.failed;
- failedButOk += other.failedButOk;
- return *this;
- }
-
- std::size_t Counts::total() const {
- return passed + failed + failedButOk;
- }
- bool Counts::allPassed() const {
- return failed == 0 && failedButOk == 0;
- }
- bool Counts::allOk() const {
- return failed == 0;
- }
-
- Totals Totals::operator - ( Totals const& other ) const {
- Totals diff;
- diff.assertions = assertions - other.assertions;
- diff.testCases = testCases - other.testCases;
- return diff;
- }
-
- Totals& Totals::operator += ( Totals const& other ) {
- assertions += other.assertions;
- testCases += other.testCases;
- return *this;
- }
-
- Totals Totals::delta( Totals const& prevTotals ) const {
- Totals diff = *this - prevTotals;
- if( diff.assertions.failed > 0 )
- ++diff.testCases.failed;
- else if( diff.assertions.failedButOk > 0 )
- ++diff.testCases.failedButOk;
- else
- ++diff.testCases.passed;
- return diff;
- }
-
-}
-// end catch_totals.cpp
-// start catch_uncaught_exceptions.cpp
-
-#include <exception>
-
-namespace Catch {
- bool uncaught_exceptions() {
-#if defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
- return std::uncaught_exceptions() > 0;
-#else
- return std::uncaught_exception();
-#endif
- }
-} // end namespace Catch
-// end catch_uncaught_exceptions.cpp
-// start catch_version.cpp
-
-#include <ostream>
-
-namespace Catch {
-
- Version::Version
- ( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- char const * const _branchName,
- unsigned int _buildNumber )
- : majorVersion( _majorVersion ),
- minorVersion( _minorVersion ),
- patchNumber( _patchNumber ),
- branchName( _branchName ),
- buildNumber( _buildNumber )
- {}
-
- std::ostream& operator << ( std::ostream& os, Version const& version ) {
- os << version.majorVersion << '.'
- << version.minorVersion << '.'
- << version.patchNumber;
- // branchName is never null -> 0th char is \0 if it is empty
- if (version.branchName[0]) {
- os << '-' << version.branchName
- << '.' << version.buildNumber;
- }
- return os;
- }
-
- Version const& libraryVersion() {
- static Version version( 2, 11, 2, "", 0 );
- return version;
- }
-
-}
-// end catch_version.cpp
-// start catch_wildcard_pattern.cpp
-
-namespace Catch {
-
- WildcardPattern::WildcardPattern( std::string const& pattern,
- CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_pattern( normaliseString( pattern ) )
- {
- if( startsWith( m_pattern, '*' ) ) {
- m_pattern = m_pattern.substr( 1 );
- m_wildcard = WildcardAtStart;
- }
- if( endsWith( m_pattern, '*' ) ) {
- m_pattern = m_pattern.substr( 0, m_pattern.size()-1 );
- m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
- }
- }
-
- bool WildcardPattern::matches( std::string const& str ) const {
- switch( m_wildcard ) {
- case NoWildcard:
- return m_pattern == normaliseString( str );
- case WildcardAtStart:
- return endsWith( normaliseString( str ), m_pattern );
- case WildcardAtEnd:
- return startsWith( normaliseString( str ), m_pattern );
- case WildcardAtBothEnds:
- return contains( normaliseString( str ), m_pattern );
- default:
- CATCH_INTERNAL_ERROR( "Unknown enum" );
- }
- }
-
- std::string WildcardPattern::normaliseString( std::string const& str ) const {
- return trim( m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str );
- }
-}
-// end catch_wildcard_pattern.cpp
-// start catch_xmlwriter.cpp
-
-#include <iomanip>
-#include <type_traits>
-
-namespace Catch {
-
-namespace {
-
- size_t trailingBytes(unsigned char c) {
- if ((c & 0xE0) == 0xC0) {
- return 2;
- }
- if ((c & 0xF0) == 0xE0) {
- return 3;
- }
- if ((c & 0xF8) == 0xF0) {
- return 4;
- }
- CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
- }
-
- uint32_t headerValue(unsigned char c) {
- if ((c & 0xE0) == 0xC0) {
- return c & 0x1F;
- }
- if ((c & 0xF0) == 0xE0) {
- return c & 0x0F;
- }
- if ((c & 0xF8) == 0xF0) {
- return c & 0x07;
- }
- CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
- }
-
- void hexEscapeChar(std::ostream& os, unsigned char c) {
- std::ios_base::fmtflags f(os.flags());
- os << "\\x"
- << std::uppercase << std::hex << std::setfill('0') << std::setw(2)
- << static_cast<int>(c);
- os.flags(f);
- }
-
- bool shouldNewline(XmlFormatting fmt) {
- return !!(static_cast<std::underlying_type<XmlFormatting>::type>(fmt & XmlFormatting::Newline));
- }
-
- bool shouldIndent(XmlFormatting fmt) {
- return !!(static_cast<std::underlying_type<XmlFormatting>::type>(fmt & XmlFormatting::Indent));
- }
-
-} // anonymous namespace
-
- XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) {
- return static_cast<XmlFormatting>(
- static_cast<std::underlying_type<XmlFormatting>::type>(lhs) |
- static_cast<std::underlying_type<XmlFormatting>::type>(rhs)
- );
- }
-
- XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) {
- return static_cast<XmlFormatting>(
- static_cast<std::underlying_type<XmlFormatting>::type>(lhs) &
- static_cast<std::underlying_type<XmlFormatting>::type>(rhs)
- );
- }
-
- XmlEncode::XmlEncode( std::string const& str, ForWhat forWhat )
- : m_str( str ),
- m_forWhat( forWhat )
- {}
-
- void XmlEncode::encodeTo( std::ostream& os ) const {
- // Apostrophe escaping not necessary if we always use " to write attributes
- // (see: http://www.w3.org/TR/xml/#syntax)
-
- for( std::size_t idx = 0; idx < m_str.size(); ++ idx ) {
- unsigned char c = m_str[idx];
- switch (c) {
- case '<': os << "&lt;"; break;
- case '&': os << "&amp;"; break;
-
- case '>':
- // See: http://www.w3.org/TR/xml/#syntax
- if (idx > 2 && m_str[idx - 1] == ']' && m_str[idx - 2] == ']')
- os << "&gt;";
- else
- os << c;
- break;
-
- case '\"':
- if (m_forWhat == ForAttributes)
- os << "&quot;";
- else
- os << c;
- break;
-
- default:
- // Check for control characters and invalid utf-8
-
- // Escape control characters in standard ascii
- // see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0
- if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 0x7F) {
- hexEscapeChar(os, c);
- break;
- }
-
- // Plain ASCII: Write it to stream
- if (c < 0x7F) {
- os << c;
- break;
- }
-
- // UTF-8 territory
- // Check if the encoding is valid and if it is not, hex escape bytes.
- // Important: We do not check the exact decoded values for validity, only the encoding format
- // First check that this bytes is a valid lead byte:
- // This means that it is not encoded as 1111 1XXX
- // Or as 10XX XXXX
- if (c < 0xC0 ||
- c >= 0xF8) {
- hexEscapeChar(os, c);
- break;
- }
-
- auto encBytes = trailingBytes(c);
- // Are there enough bytes left to avoid accessing out-of-bounds memory?
- if (idx + encBytes - 1 >= m_str.size()) {
- hexEscapeChar(os, c);
- break;
- }
- // The header is valid, check data
- // The next encBytes bytes must together be a valid utf-8
- // This means: bitpattern 10XX XXXX and the extracted value is sane (ish)
- bool valid = true;
- uint32_t value = headerValue(c);
- for (std::size_t n = 1; n < encBytes; ++n) {
- unsigned char nc = m_str[idx + n];
- valid &= ((nc & 0xC0) == 0x80);
- value = (value << 6) | (nc & 0x3F);
- }
-
- if (
- // Wrong bit pattern of following bytes
- (!valid) ||
- // Overlong encodings
- (value < 0x80) ||
- (0x80 <= value && value < 0x800 && encBytes > 2) ||
- (0x800 < value && value < 0x10000 && encBytes > 3) ||
- // Encoded value out of range
- (value >= 0x110000)
- ) {
- hexEscapeChar(os, c);
- break;
- }
-
- // If we got here, this is in fact a valid(ish) utf-8 sequence
- for (std::size_t n = 0; n < encBytes; ++n) {
- os << m_str[idx + n];
- }
- idx += encBytes - 1;
- break;
- }
- }
- }
-
- std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) {
- xmlEncode.encodeTo( os );
- return os;
- }
-
- XmlWriter::ScopedElement::ScopedElement( XmlWriter* writer, XmlFormatting fmt )
- : m_writer( writer ),
- m_fmt(fmt)
- {}
-
- XmlWriter::ScopedElement::ScopedElement( ScopedElement&& other ) noexcept
- : m_writer( other.m_writer ),
- m_fmt(other.m_fmt)
- {
- other.m_writer = nullptr;
- other.m_fmt = XmlFormatting::None;
- }
- XmlWriter::ScopedElement& XmlWriter::ScopedElement::operator=( ScopedElement&& other ) noexcept {
- if ( m_writer ) {
- m_writer->endElement();
- }
- m_writer = other.m_writer;
- other.m_writer = nullptr;
- m_fmt = other.m_fmt;
- other.m_fmt = XmlFormatting::None;
- return *this;
- }
-
- XmlWriter::ScopedElement::~ScopedElement() {
- if (m_writer) {
- m_writer->endElement(m_fmt);
- }
- }
-
- XmlWriter::ScopedElement& XmlWriter::ScopedElement::writeText( std::string const& text, XmlFormatting fmt ) {
- m_writer->writeText( text, fmt );
- return *this;
- }
-
- XmlWriter::XmlWriter( std::ostream& os ) : m_os( os )
- {
- writeDeclaration();
- }
-
- XmlWriter::~XmlWriter() {
- while (!m_tags.empty()) {
- endElement();
- }
- newlineIfNecessary();
- }
-
- XmlWriter& XmlWriter::startElement( std::string const& name, XmlFormatting fmt ) {
- ensureTagClosed();
- newlineIfNecessary();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- m_indent += " ";
- }
- m_os << '<' << name;
- m_tags.push_back( name );
- m_tagIsOpen = true;
- applyFormatting(fmt);
- return *this;
- }
-
- XmlWriter::ScopedElement XmlWriter::scopedElement( std::string const& name, XmlFormatting fmt ) {
- ScopedElement scoped( this, fmt );
- startElement( name, fmt );
- return scoped;
- }
-
- XmlWriter& XmlWriter::endElement(XmlFormatting fmt) {
- m_indent = m_indent.substr(0, m_indent.size() - 2);
-
- if( m_tagIsOpen ) {
- m_os << "/>";
- m_tagIsOpen = false;
- } else {
- newlineIfNecessary();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << "</" << m_tags.back() << ">";
- }
- m_os << std::flush;
- applyFormatting(fmt);
- m_tags.pop_back();
- return *this;
- }
-
- XmlWriter& XmlWriter::writeAttribute( std::string const& name, std::string const& attribute ) {
- if( !name.empty() && !attribute.empty() )
- m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"';
- return *this;
- }
-
- XmlWriter& XmlWriter::writeAttribute( std::string const& name, bool attribute ) {
- m_os << ' ' << name << "=\"" << ( attribute ? "true" : "false" ) << '"';
- return *this;
- }
-
- XmlWriter& XmlWriter::writeText( std::string const& text, XmlFormatting fmt) {
- if( !text.empty() ){
- bool tagWasOpen = m_tagIsOpen;
- ensureTagClosed();
- if (tagWasOpen && shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << XmlEncode( text );
- applyFormatting(fmt);
- }
- return *this;
- }
-
- XmlWriter& XmlWriter::writeComment( std::string const& text, XmlFormatting fmt) {
- ensureTagClosed();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << "<!--" << text << "-->";
- applyFormatting(fmt);
- return *this;
- }
-
- void XmlWriter::writeStylesheetRef( std::string const& url ) {
- m_os << "<?xml-stylesheet type=\"text/xsl\" href=\"" << url << "\"?>\n";
- }
-
- XmlWriter& XmlWriter::writeBlankLine() {
- ensureTagClosed();
- m_os << '\n';
- return *this;
- }
-
- void XmlWriter::ensureTagClosed() {
- if( m_tagIsOpen ) {
- m_os << '>' << std::flush;
- newlineIfNecessary();
- m_tagIsOpen = false;
- }
- }
-
- void XmlWriter::applyFormatting(XmlFormatting fmt) {
- m_needsNewline = shouldNewline(fmt);
- }
-
- void XmlWriter::writeDeclaration() {
- m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- }
-
- void XmlWriter::newlineIfNecessary() {
- if( m_needsNewline ) {
- m_os << std::endl;
- m_needsNewline = false;
- }
- }
-}
-// end catch_xmlwriter.cpp
-// start catch_reporter_bases.cpp
-
-#include <cstring>
-#include <cfloat>
-#include <cstdio>
-#include <cassert>
-#include <memory>
-
-namespace Catch {
- void prepareExpandedExpression(AssertionResult& result) {
- result.getExpandedExpression();
- }
-
- // Because formatting using c++ streams is stateful, drop down to C is required
- // Alternatively we could use stringstream, but its performance is... not good.
- std::string getFormattedDuration( double duration ) {
- // Max exponent + 1 is required to represent the whole part
- // + 1 for decimal point
- // + 3 for the 3 decimal places
- // + 1 for null terminator
- const std::size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1;
- char buffer[maxDoubleSize];
-
- // Save previous errno, to prevent sprintf from overwriting it
- ErrnoGuard guard;
-#ifdef _MSC_VER
- sprintf_s(buffer, "%.3f", duration);
-#else
- std::sprintf(buffer, "%.3f", duration);
-#endif
- return std::string(buffer);
- }
-
- std::string serializeFilters( std::vector<std::string> const& container ) {
- ReusableStringStream oss;
- bool first = true;
- for (auto&& filter : container)
- {
- if (!first)
- oss << ' ';
- else
- first = false;
-
- oss << filter;
- }
- return oss.str();
- }
-
- TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config)
- :StreamingReporterBase(_config) {}
-
- std::set<Verbosity> TestEventListenerBase::getSupportedVerbosities() {
- return { Verbosity::Quiet, Verbosity::Normal, Verbosity::High };
- }
-
- void TestEventListenerBase::assertionStarting(AssertionInfo const &) {}
-
- bool TestEventListenerBase::assertionEnded(AssertionStats const &) {
- return false;
- }
-
-} // end namespace Catch
-// end catch_reporter_bases.cpp
-// start catch_reporter_compact.cpp
-
-namespace {
-
-#ifdef CATCH_PLATFORM_MAC
- const char* failedString() { return "FAILED"; }
- const char* passedString() { return "PASSED"; }
-#else
- const char* failedString() { return "failed"; }
- const char* passedString() { return "passed"; }
-#endif
-
- // Colour::LightGrey
- Catch::Colour::Code dimColour() { return Catch::Colour::FileName; }
-
- std::string bothOrAll( std::size_t count ) {
- return count == 1 ? std::string() :
- count == 2 ? "both " : "all " ;
- }
-
-} // anon namespace
-
-namespace Catch {
-namespace {
-// Colour, message variants:
-// - white: No tests ran.
-// - red: Failed [both/all] N test cases, failed [both/all] M assertions.
-// - white: Passed [both/all] N test cases (no assertions).
-// - red: Failed N tests cases, failed M assertions.
-// - green: Passed [both/all] N tests cases with M assertions.
-void printTotals(std::ostream& out, const Totals& totals) {
- if (totals.testCases.total() == 0) {
- out << "No tests ran.";
- } else if (totals.testCases.failed == totals.testCases.total()) {
- Colour colour(Colour::ResultError);
- const std::string qualify_assertions_failed =
- totals.assertions.failed == totals.assertions.total() ?
- bothOrAll(totals.assertions.failed) : std::string();
- out <<
- "Failed " << bothOrAll(totals.testCases.failed)
- << pluralise(totals.testCases.failed, "test case") << ", "
- "failed " << qualify_assertions_failed <<
- pluralise(totals.assertions.failed, "assertion") << '.';
- } else if (totals.assertions.total() == 0) {
- out <<
- "Passed " << bothOrAll(totals.testCases.total())
- << pluralise(totals.testCases.total(), "test case")
- << " (no assertions).";
- } else if (totals.assertions.failed) {
- Colour colour(Colour::ResultError);
- out <<
- "Failed " << pluralise(totals.testCases.failed, "test case") << ", "
- "failed " << pluralise(totals.assertions.failed, "assertion") << '.';
- } else {
- Colour colour(Colour::ResultSuccess);
- out <<
- "Passed " << bothOrAll(totals.testCases.passed)
- << pluralise(totals.testCases.passed, "test case") <<
- " with " << pluralise(totals.assertions.passed, "assertion") << '.';
- }
-}
-
-// Implementation of CompactReporter formatting
-class AssertionPrinter {
-public:
- AssertionPrinter& operator= (AssertionPrinter const&) = delete;
- AssertionPrinter(AssertionPrinter const&) = delete;
- AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages)
- : stream(_stream)
- , result(_stats.assertionResult)
- , messages(_stats.infoMessages)
- , itMessage(_stats.infoMessages.begin())
- , printInfoMessages(_printInfoMessages) {}
-
- void print() {
- printSourceInfo();
-
- itMessage = messages.begin();
-
- switch (result.getResultType()) {
- case ResultWas::Ok:
- printResultType(Colour::ResultSuccess, passedString());
- printOriginalExpression();
- printReconstructedExpression();
- if (!result.hasExpression())
- printRemainingMessages(Colour::None);
- else
- printRemainingMessages();
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk())
- printResultType(Colour::ResultSuccess, failedString() + std::string(" - but was ok"));
- else
- printResultType(Colour::Error, failedString());
- printOriginalExpression();
- printReconstructedExpression();
- printRemainingMessages();
- break;
- case ResultWas::ThrewException:
- printResultType(Colour::Error, failedString());
- printIssue("unexpected exception with message:");
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::FatalErrorCondition:
- printResultType(Colour::Error, failedString());
- printIssue("fatal error condition with message:");
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::DidntThrowException:
- printResultType(Colour::Error, failedString());
- printIssue("expected exception, got none");
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::Info:
- printResultType(Colour::None, "info");
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::Warning:
- printResultType(Colour::None, "warning");
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::ExplicitFailure:
- printResultType(Colour::Error, failedString());
- printIssue("explicitly");
- printRemainingMessages(Colour::None);
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- printResultType(Colour::Error, "** internal error **");
- break;
- }
- }
-
-private:
- void printSourceInfo() const {
- Colour colourGuard(Colour::FileName);
- stream << result.getSourceInfo() << ':';
- }
-
- void printResultType(Colour::Code colour, std::string const& passOrFail) const {
- if (!passOrFail.empty()) {
- {
- Colour colourGuard(colour);
- stream << ' ' << passOrFail;
- }
- stream << ':';
- }
- }
-
- void printIssue(std::string const& issue) const {
- stream << ' ' << issue;
- }
-
- void printExpressionWas() {
- if (result.hasExpression()) {
- stream << ';';
- {
- Colour colour(dimColour());
- stream << " expression was:";
- }
- printOriginalExpression();
- }
- }
-
- void printOriginalExpression() const {
- if (result.hasExpression()) {
- stream << ' ' << result.getExpression();
- }
- }
-
- void printReconstructedExpression() const {
- if (result.hasExpandedExpression()) {
- {
- Colour colour(dimColour());
- stream << " for: ";
- }
- stream << result.getExpandedExpression();
- }
- }
-
- void printMessage() {
- if (itMessage != messages.end()) {
- stream << " '" << itMessage->message << '\'';
- ++itMessage;
- }
- }
-
- void printRemainingMessages(Colour::Code colour = dimColour()) {
- if (itMessage == messages.end())
- return;
-
- const auto itEnd = messages.cend();
- const auto N = static_cast<std::size_t>(std::distance(itMessage, itEnd));
-
- {
- Colour colourGuard(colour);
- stream << " with " << pluralise(N, "message") << ':';
- }
-
- while (itMessage != itEnd) {
- // If this assertion is a warning ignore any INFO messages
- if (printInfoMessages || itMessage->type != ResultWas::Info) {
- printMessage();
- if (itMessage != itEnd) {
- Colour colourGuard(dimColour());
- stream << " and";
- }
- continue;
- }
- ++itMessage;
- }
- }
-
-private:
- std::ostream& stream;
- AssertionResult const& result;
- std::vector<MessageInfo> messages;
- std::vector<MessageInfo>::const_iterator itMessage;
- bool printInfoMessages;
-};
-
-} // anon namespace
-
- std::string CompactReporter::getDescription() {
- return "Reports test results on a single line, suitable for IDEs";
- }
-
- ReporterPreferences CompactReporter::getPreferences() const {
- return m_reporterPrefs;
- }
-
- void CompactReporter::noMatchingTestCases( std::string const& spec ) {
- stream << "No test cases matched '" << spec << '\'' << std::endl;
- }
-
- void CompactReporter::assertionStarting( AssertionInfo const& ) {}
-
- bool CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool printInfoMessages = true;
-
- // Drop out if result was successful and we're not printing those
- if( !m_config->includeSuccessfulResults() && result.isOk() ) {
- if( result.getResultType() != ResultWas::Warning )
- return false;
- printInfoMessages = false;
- }
-
- AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
- printer.print();
-
- stream << std::endl;
- return true;
- }
-
- void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
- if (m_config->showDurations() == ShowDurations::Always) {
- stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
- }
- }
-
- void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) {
- printTotals( stream, _testRunStats.totals );
- stream << '\n' << std::endl;
- StreamingReporterBase::testRunEnded( _testRunStats );
- }
-
- CompactReporter::~CompactReporter() {}
-
- CATCH_REGISTER_REPORTER( "compact", CompactReporter )
-
-} // end namespace Catch
-// end catch_reporter_compact.cpp
-// start catch_reporter_console.cpp
-
-#include <cfloat>
-#include <cstdio>
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled and default is missing) is enabled
-#endif
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-// For simplicity, benchmarking-only helpers are always enabled
-# pragma clang diagnostic ignored "-Wunused-function"
-#endif
-
-namespace Catch {
-
-namespace {
-
-// Formatter impl for ConsoleReporter
-class ConsoleAssertionPrinter {
-public:
- ConsoleAssertionPrinter& operator= (ConsoleAssertionPrinter const&) = delete;
- ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete;
- ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages)
- : stream(_stream),
- stats(_stats),
- result(_stats.assertionResult),
- colour(Colour::None),
- message(result.getMessage()),
- messages(_stats.infoMessages),
- printInfoMessages(_printInfoMessages) {
- switch (result.getResultType()) {
- case ResultWas::Ok:
- colour = Colour::Success;
- passOrFail = "PASSED";
- //if( result.hasMessage() )
- if (_stats.infoMessages.size() == 1)
- messageLabel = "with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "with messages";
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk()) {
- colour = Colour::Success;
- passOrFail = "FAILED - but was ok";
- } else {
- colour = Colour::Error;
- passOrFail = "FAILED";
- }
- if (_stats.infoMessages.size() == 1)
- messageLabel = "with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "with messages";
- break;
- case ResultWas::ThrewException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to unexpected exception with ";
- if (_stats.infoMessages.size() == 1)
- messageLabel += "message";
- if (_stats.infoMessages.size() > 1)
- messageLabel += "messages";
- break;
- case ResultWas::FatalErrorCondition:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to a fatal error condition";
- break;
- case ResultWas::DidntThrowException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "because no exception was thrown where one was expected";
- break;
- case ResultWas::Info:
- messageLabel = "info";
- break;
- case ResultWas::Warning:
- messageLabel = "warning";
- break;
- case ResultWas::ExplicitFailure:
- passOrFail = "FAILED";
- colour = Colour::Error;
- if (_stats.infoMessages.size() == 1)
- messageLabel = "explicitly with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "explicitly with messages";
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- passOrFail = "** internal error **";
- colour = Colour::Error;
- break;
- }
- }
-
- void print() const {
- printSourceInfo();
- if (stats.totals.assertions.total() > 0) {
- printResultType();
- printOriginalExpression();
- printReconstructedExpression();
- } else {
- stream << '\n';
- }
- printMessage();
- }
-
-private:
- void printResultType() const {
- if (!passOrFail.empty()) {
- Colour colourGuard(colour);
- stream << passOrFail << ":\n";
- }
- }
- void printOriginalExpression() const {
- if (result.hasExpression()) {
- Colour colourGuard(Colour::OriginalExpression);
- stream << " ";
- stream << result.getExpressionInMacro();
- stream << '\n';
- }
- }
- void printReconstructedExpression() const {
- if (result.hasExpandedExpression()) {
- stream << "with expansion:\n";
- Colour colourGuard(Colour::ReconstructedExpression);
- stream << Column(result.getExpandedExpression()).indent(2) << '\n';
- }
- }
- void printMessage() const {
- if (!messageLabel.empty())
- stream << messageLabel << ':' << '\n';
- for (auto const& msg : messages) {
- // If this assertion is a warning ignore any INFO messages
- if (printInfoMessages || msg.type != ResultWas::Info)
- stream << Column(msg.message).indent(2) << '\n';
- }
- }
- void printSourceInfo() const {
- Colour colourGuard(Colour::FileName);
- stream << result.getSourceInfo() << ": ";
- }
-
- std::ostream& stream;
- AssertionStats const& stats;
- AssertionResult const& result;
- Colour::Code colour;
- std::string passOrFail;
- std::string messageLabel;
- std::string message;
- std::vector<MessageInfo> messages;
- bool printInfoMessages;
-};
-
-std::size_t makeRatio(std::size_t number, std::size_t total) {
- std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number / total : 0;
- return (ratio == 0 && number > 0) ? 1 : ratio;
-}
-
-std::size_t& findMax(std::size_t& i, std::size_t& j, std::size_t& k) {
- if (i > j && i > k)
- return i;
- else if (j > k)
- return j;
- else
- return k;
-}
-
-struct ColumnInfo {
- enum Justification { Left, Right };
- std::string name;
- int width;
- Justification justification;
-};
-struct ColumnBreak {};
-struct RowBreak {};
-
-class Duration {
- enum class Unit {
- Auto,
- Nanoseconds,
- Microseconds,
- Milliseconds,
- Seconds,
- Minutes
- };
- static const uint64_t s_nanosecondsInAMicrosecond = 1000;
- static const uint64_t s_nanosecondsInAMillisecond = 1000 * s_nanosecondsInAMicrosecond;
- static const uint64_t s_nanosecondsInASecond = 1000 * s_nanosecondsInAMillisecond;
- static const uint64_t s_nanosecondsInAMinute = 60 * s_nanosecondsInASecond;
-
- double m_inNanoseconds;
- Unit m_units;
-
-public:
- explicit Duration(double inNanoseconds, Unit units = Unit::Auto)
- : m_inNanoseconds(inNanoseconds),
- m_units(units) {
- if (m_units == Unit::Auto) {
- if (m_inNanoseconds < s_nanosecondsInAMicrosecond)
- m_units = Unit::Nanoseconds;
- else if (m_inNanoseconds < s_nanosecondsInAMillisecond)
- m_units = Unit::Microseconds;
- else if (m_inNanoseconds < s_nanosecondsInASecond)
- m_units = Unit::Milliseconds;
- else if (m_inNanoseconds < s_nanosecondsInAMinute)
- m_units = Unit::Seconds;
- else
- m_units = Unit::Minutes;
- }
-
- }
-
- auto value() const -> double {
- switch (m_units) {
- case Unit::Microseconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMicrosecond);
- case Unit::Milliseconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMillisecond);
- case Unit::Seconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInASecond);
- case Unit::Minutes:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMinute);
- default:
- return m_inNanoseconds;
- }
- }
- auto unitsAsString() const -> std::string {
- switch (m_units) {
- case Unit::Nanoseconds:
- return "ns";
- case Unit::Microseconds:
- return "us";
- case Unit::Milliseconds:
- return "ms";
- case Unit::Seconds:
- return "s";
- case Unit::Minutes:
- return "m";
- default:
- return "** internal error **";
- }
-
- }
- friend auto operator << (std::ostream& os, Duration const& duration) -> std::ostream& {
- return os << duration.value() << ' ' << duration.unitsAsString();
- }
-};
-} // end anon namespace
-
-class TablePrinter {
- std::ostream& m_os;
- std::vector<ColumnInfo> m_columnInfos;
- std::ostringstream m_oss;
- int m_currentColumn = -1;
- bool m_isOpen = false;
-
-public:
- TablePrinter( std::ostream& os, std::vector<ColumnInfo> columnInfos )
- : m_os( os ),
- m_columnInfos( std::move( columnInfos ) ) {}
-
- auto columnInfos() const -> std::vector<ColumnInfo> const& {
- return m_columnInfos;
- }
-
- void open() {
- if (!m_isOpen) {
- m_isOpen = true;
- *this << RowBreak();
-
- Columns headerCols;
- Spacer spacer(2);
- for (auto const& info : m_columnInfos) {
- headerCols += Column(info.name).width(static_cast<std::size_t>(info.width - 2));
- headerCols += spacer;
- }
- m_os << headerCols << '\n';
-
- m_os << Catch::getLineOfChars<'-'>() << '\n';
- }
- }
- void close() {
- if (m_isOpen) {
- *this << RowBreak();
- m_os << std::endl;
- m_isOpen = false;
- }
- }
-
- template<typename T>
- friend TablePrinter& operator << (TablePrinter& tp, T const& value) {
- tp.m_oss << value;
- return tp;
- }
-
- friend TablePrinter& operator << (TablePrinter& tp, ColumnBreak) {
- auto colStr = tp.m_oss.str();
- const auto strSize = colStr.size();
- tp.m_oss.str("");
- tp.open();
- if (tp.m_currentColumn == static_cast<int>(tp.m_columnInfos.size() - 1)) {
- tp.m_currentColumn = -1;
- tp.m_os << '\n';
- }
- tp.m_currentColumn++;
-
- auto colInfo = tp.m_columnInfos[tp.m_currentColumn];
- auto padding = (strSize + 1 < static_cast<std::size_t>(colInfo.width))
- ? std::string(colInfo.width - (strSize + 1), ' ')
- : std::string();
- if (colInfo.justification == ColumnInfo::Left)
- tp.m_os << colStr << padding << ' ';
- else
- tp.m_os << padding << colStr << ' ';
- return tp;
- }
-
- friend TablePrinter& operator << (TablePrinter& tp, RowBreak) {
- if (tp.m_currentColumn > 0) {
- tp.m_os << '\n';
- tp.m_currentColumn = -1;
- }
- return tp;
- }
-};
-
-ConsoleReporter::ConsoleReporter(ReporterConfig const& config)
- : StreamingReporterBase(config),
- m_tablePrinter(new TablePrinter(config.stream(),
- [&config]() -> std::vector<ColumnInfo> {
- if (config.fullConfig()->benchmarkNoAnalysis())
- {
- return{
- { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, ColumnInfo::Left },
- { " samples", 14, ColumnInfo::Right },
- { " iterations", 14, ColumnInfo::Right },
- { " mean", 14, ColumnInfo::Right }
- };
- }
- else
- {
- return{
- { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 32, ColumnInfo::Left },
- { "samples mean std dev", 14, ColumnInfo::Right },
- { "iterations low mean low std dev", 14, ColumnInfo::Right },
- { "estimated high mean high std dev", 14, ColumnInfo::Right }
- };
- }
- }())) {}
-ConsoleReporter::~ConsoleReporter() = default;
-
-std::string ConsoleReporter::getDescription() {
- return "Reports test results as plain lines of text";
-}
-
-void ConsoleReporter::noMatchingTestCases(std::string const& spec) {
- stream << "No test cases matched '" << spec << '\'' << std::endl;
-}
-
-void ConsoleReporter::reportInvalidArguments(std::string const&arg){
- stream << "Invalid Filter: " << arg << std::endl;
-}
-
-void ConsoleReporter::assertionStarting(AssertionInfo const&) {}
-
-bool ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
-
- // Drop out if result was successful but we're not printing them.
- if (!includeResults && result.getResultType() != ResultWas::Warning)
- return false;
-
- lazyPrint();
-
- ConsoleAssertionPrinter printer(stream, _assertionStats, includeResults);
- printer.print();
- stream << std::endl;
- return true;
-}
-
-void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) {
- m_tablePrinter->close();
- m_headerPrinted = false;
- StreamingReporterBase::sectionStarting(_sectionInfo);
-}
-void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
- m_tablePrinter->close();
- if (_sectionStats.missingAssertions) {
- lazyPrint();
- Colour colour(Colour::ResultError);
- if (m_sectionStack.size() > 1)
- stream << "\nNo assertions in section";
- else
- stream << "\nNo assertions in test case";
- stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
- }
- if (m_config->showDurations() == ShowDurations::Always) {
- stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
- }
- if (m_headerPrinted) {
- m_headerPrinted = false;
- }
- StreamingReporterBase::sectionEnded(_sectionStats);
-}
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-void ConsoleReporter::benchmarkPreparing(std::string const& name) {
- lazyPrintWithoutClosingBenchmarkTable();
-
- auto nameCol = Column(name).width(static_cast<std::size_t>(m_tablePrinter->columnInfos()[0].width - 2));
-
- bool firstLine = true;
- for (auto line : nameCol) {
- if (!firstLine)
- (*m_tablePrinter) << ColumnBreak() << ColumnBreak() << ColumnBreak();
- else
- firstLine = false;
-
- (*m_tablePrinter) << line << ColumnBreak();
- }
-}
-
-void ConsoleReporter::benchmarkStarting(BenchmarkInfo const& info) {
- (*m_tablePrinter) << info.samples << ColumnBreak()
- << info.iterations << ColumnBreak();
- if (!m_config->benchmarkNoAnalysis())
- (*m_tablePrinter) << Duration(info.estimatedDuration) << ColumnBreak();
-}
-void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) {
- if (m_config->benchmarkNoAnalysis())
- {
- (*m_tablePrinter) << Duration(stats.mean.point.count()) << ColumnBreak();
- }
- else
- {
- (*m_tablePrinter) << ColumnBreak()
- << Duration(stats.mean.point.count()) << ColumnBreak()
- << Duration(stats.mean.lower_bound.count()) << ColumnBreak()
- << Duration(stats.mean.upper_bound.count()) << ColumnBreak() << ColumnBreak()
- << Duration(stats.standardDeviation.point.count()) << ColumnBreak()
- << Duration(stats.standardDeviation.lower_bound.count()) << ColumnBreak()
- << Duration(stats.standardDeviation.upper_bound.count()) << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak();
- }
-}
-
-void ConsoleReporter::benchmarkFailed(std::string const& error) {
- Colour colour(Colour::Red);
- (*m_tablePrinter)
- << "Benchmark failed (" << error << ')'
- << ColumnBreak() << RowBreak();
-}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) {
- m_tablePrinter->close();
- StreamingReporterBase::testCaseEnded(_testCaseStats);
- m_headerPrinted = false;
-}
-void ConsoleReporter::testGroupEnded(TestGroupStats const& _testGroupStats) {
- if (currentGroupInfo.used) {
- printSummaryDivider();
- stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n";
- printTotals(_testGroupStats.totals);
- stream << '\n' << std::endl;
- }
- StreamingReporterBase::testGroupEnded(_testGroupStats);
-}
-void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) {
- printTotalsDivider(_testRunStats.totals);
- printTotals(_testRunStats.totals);
- stream << std::endl;
- StreamingReporterBase::testRunEnded(_testRunStats);
-}
-void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) {
- StreamingReporterBase::testRunStarting(_testInfo);
- printTestFilters();
-}
-
-void ConsoleReporter::lazyPrint() {
-
- m_tablePrinter->close();
- lazyPrintWithoutClosingBenchmarkTable();
-}
-
-void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() {
-
- if (!currentTestRunInfo.used)
- lazyPrintRunInfo();
- if (!currentGroupInfo.used)
- lazyPrintGroupInfo();
-
- if (!m_headerPrinted) {
- printTestCaseAndSectionHeader();
- m_headerPrinted = true;
- }
-}
-void ConsoleReporter::lazyPrintRunInfo() {
- stream << '\n' << getLineOfChars<'~'>() << '\n';
- Colour colour(Colour::SecondaryText);
- stream << currentTestRunInfo->name
- << " is a Catch v" << libraryVersion() << " host application.\n"
- << "Run with -? for options\n\n";
-
- if (m_config->rngSeed() != 0)
- stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n";
-
- currentTestRunInfo.used = true;
-}
-void ConsoleReporter::lazyPrintGroupInfo() {
- if (!currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1) {
- printClosedHeader("Group: " + currentGroupInfo->name);
- currentGroupInfo.used = true;
- }
-}
-void ConsoleReporter::printTestCaseAndSectionHeader() {
- assert(!m_sectionStack.empty());
- printOpenHeader(currentTestCaseInfo->name);
-
- if (m_sectionStack.size() > 1) {
- Colour colourGuard(Colour::Headers);
-
- auto
- it = m_sectionStack.begin() + 1, // Skip first section (test case)
- itEnd = m_sectionStack.end();
- for (; it != itEnd; ++it)
- printHeaderString(it->name, 2);
- }
-
- SourceLineInfo lineInfo = m_sectionStack.back().lineInfo;
-
- stream << getLineOfChars<'-'>() << '\n';
- Colour colourGuard(Colour::FileName);
- stream << lineInfo << '\n';
- stream << getLineOfChars<'.'>() << '\n' << std::endl;
-}
-
-void ConsoleReporter::printClosedHeader(std::string const& _name) {
- printOpenHeader(_name);
- stream << getLineOfChars<'.'>() << '\n';
-}
-void ConsoleReporter::printOpenHeader(std::string const& _name) {
- stream << getLineOfChars<'-'>() << '\n';
- {
- Colour colourGuard(Colour::Headers);
- printHeaderString(_name);
- }
-}
-
-// if string has a : in first line will set indent to follow it on
-// subsequent lines
-void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t indent) {
- std::size_t i = _string.find(": ");
- if (i != std::string::npos)
- i += 2;
- else
- i = 0;
- stream << Column(_string).indent(indent + i).initialIndent(indent) << '\n';
-}
-
-struct SummaryColumn {
-
- SummaryColumn( std::string _label, Colour::Code _colour )
- : label( std::move( _label ) ),
- colour( _colour ) {}
- SummaryColumn addRow( std::size_t count ) {
- ReusableStringStream rss;
- rss << count;
- std::string row = rss.str();
- for (auto& oldRow : rows) {
- while (oldRow.size() < row.size())
- oldRow = ' ' + oldRow;
- while (oldRow.size() > row.size())
- row = ' ' + row;
- }
- rows.push_back(row);
- return *this;
- }
-
- std::string label;
- Colour::Code colour;
- std::vector<std::string> rows;
-
-};
-
-void ConsoleReporter::printTotals( Totals const& totals ) {
- if (totals.testCases.total() == 0) {
- stream << Colour(Colour::Warning) << "No tests ran\n";
- } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) {
- stream << Colour(Colour::ResultSuccess) << "All tests passed";
- stream << " ("
- << pluralise(totals.assertions.passed, "assertion") << " in "
- << pluralise(totals.testCases.passed, "test case") << ')'
- << '\n';
- } else {
-
- std::vector<SummaryColumn> columns;
- columns.push_back(SummaryColumn("", Colour::None)
- .addRow(totals.testCases.total())
- .addRow(totals.assertions.total()));
- columns.push_back(SummaryColumn("passed", Colour::Success)
- .addRow(totals.testCases.passed)
- .addRow(totals.assertions.passed));
- columns.push_back(SummaryColumn("failed", Colour::ResultError)
- .addRow(totals.testCases.failed)
- .addRow(totals.assertions.failed));
- columns.push_back(SummaryColumn("failed as expected", Colour::ResultExpectedFailure)
- .addRow(totals.testCases.failedButOk)
- .addRow(totals.assertions.failedButOk));
-
- printSummaryRow("test cases", columns, 0);
- printSummaryRow("assertions", columns, 1);
- }
-}
-void ConsoleReporter::printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row) {
- for (auto col : cols) {
- std::string value = col.rows[row];
- if (col.label.empty()) {
- stream << label << ": ";
- if (value != "0")
- stream << value;
- else
- stream << Colour(Colour::Warning) << "- none -";
- } else if (value != "0") {
- stream << Colour(Colour::LightGrey) << " | ";
- stream << Colour(col.colour)
- << value << ' ' << col.label;
- }
- }
- stream << '\n';
-}
-
-void ConsoleReporter::printTotalsDivider(Totals const& totals) {
- if (totals.testCases.total() > 0) {
- std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total());
- std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total());
- std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total());
- while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1)
- findMax(failedRatio, failedButOkRatio, passedRatio)++;
- while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1)
- findMax(failedRatio, failedButOkRatio, passedRatio)--;
-
- stream << Colour(Colour::Error) << std::string(failedRatio, '=');
- stream << Colour(Colour::ResultExpectedFailure) << std::string(failedButOkRatio, '=');
- if (totals.testCases.allPassed())
- stream << Colour(Colour::ResultSuccess) << std::string(passedRatio, '=');
- else
- stream << Colour(Colour::Success) << std::string(passedRatio, '=');
- } else {
- stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '=');
- }
- stream << '\n';
-}
-void ConsoleReporter::printSummaryDivider() {
- stream << getLineOfChars<'-'>() << '\n';
-}
-
-void ConsoleReporter::printTestFilters() {
- if (m_config->testSpec().hasFilters()) {
- Colour guard(Colour::BrightYellow);
- stream << "Filters: " << serializeFilters(m_config->getTestsOrTags()) << '\n';
- }
-}
-
-CATCH_REGISTER_REPORTER("console", ConsoleReporter)
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-// end catch_reporter_console.cpp
-// start catch_reporter_junit.cpp
-
-#include <cassert>
-#include <sstream>
-#include <ctime>
-#include <algorithm>
-
-namespace Catch {
-
- namespace {
- std::string getCurrentTimestamp() {
- // Beware, this is not reentrant because of backward compatibility issues
- // Also, UTC only, again because of backward compatibility (%z is C++11)
- time_t rawtime;
- std::time(&rawtime);
- auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
-
-#ifdef _MSC_VER
- std::tm timeInfo = {};
- gmtime_s(&timeInfo, &rawtime);
-#else
- std::tm* timeInfo;
- timeInfo = std::gmtime(&rawtime);
-#endif
-
- char timeStamp[timeStampSize];
- const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
-
-#ifdef _MSC_VER
- std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
-#else
- std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
-#endif
- return std::string(timeStamp);
- }
-
- std::string fileNameTag(const std::vector<std::string> &tags) {
- auto it = std::find_if(begin(tags),
- end(tags),
- [] (std::string const& tag) {return tag.front() == '#'; });
- if (it != tags.end())
- return it->substr(1);
- return std::string();
- }
- } // anonymous namespace
-
- JunitReporter::JunitReporter( ReporterConfig const& _config )
- : CumulativeReporterBase( _config ),
- xml( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- JunitReporter::~JunitReporter() {}
-
- std::string JunitReporter::getDescription() {
- return "Reports test results in an XML format that looks like Ant's junitreport target";
- }
-
- void JunitReporter::noMatchingTestCases( std::string const& /*spec*/ ) {}
-
- void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) {
- CumulativeReporterBase::testRunStarting( runInfo );
- xml.startElement( "testsuites" );
- }
-
- void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- suiteTimer.start();
- stdOutForSuite.clear();
- stdErrForSuite.clear();
- unexpectedExceptions = 0;
- CumulativeReporterBase::testGroupStarting( groupInfo );
- }
-
- void JunitReporter::testCaseStarting( TestCaseInfo const& testCaseInfo ) {
- m_okToFail = testCaseInfo.okToFail();
- }
-
- bool JunitReporter::assertionEnded( AssertionStats const& assertionStats ) {
- if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail )
- unexpectedExceptions++;
- return CumulativeReporterBase::assertionEnded( assertionStats );
- }
-
- void JunitReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- stdOutForSuite += testCaseStats.stdOut;
- stdErrForSuite += testCaseStats.stdErr;
- CumulativeReporterBase::testCaseEnded( testCaseStats );
- }
-
- void JunitReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- double suiteTime = suiteTimer.getElapsedSeconds();
- CumulativeReporterBase::testGroupEnded( testGroupStats );
- writeGroup( *m_testGroups.back(), suiteTime );
- }
-
- void JunitReporter::testRunEndedCumulative() {
- xml.endElement();
- }
-
- void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
-
- TestGroupStats const& stats = groupNode.value;
- xml.writeAttribute( "name", stats.groupInfo.name );
- xml.writeAttribute( "errors", unexpectedExceptions );
- xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions );
- xml.writeAttribute( "tests", stats.totals.assertions.total() );
- xml.writeAttribute( "hostname", "tbd" ); // !TBD
- if( m_config->showDurations() == ShowDurations::Never )
- xml.writeAttribute( "time", "" );
- else
- xml.writeAttribute( "time", suiteTime );
- xml.writeAttribute( "timestamp", getCurrentTimestamp() );
-
- // Write properties if there are any
- if (m_config->hasTestFilters() || m_config->rngSeed() != 0) {
- auto properties = xml.scopedElement("properties");
- if (m_config->hasTestFilters()) {
- xml.scopedElement("property")
- .writeAttribute("name", "filters")
- .writeAttribute("value", serializeFilters(m_config->getTestsOrTags()));
- }
- if (m_config->rngSeed() != 0) {
- xml.scopedElement("property")
- .writeAttribute("name", "random-seed")
- .writeAttribute("value", m_config->rngSeed());
- }
- }
-
- // Write test cases
- for( auto const& child : groupNode.children )
- writeTestCase( *child );
-
- xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline );
- xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline );
- }
-
- void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) {
- TestCaseStats const& stats = testCaseNode.value;
-
- // All test cases have exactly one section - which represents the
- // test case itself. That section may have 0-n nested sections
- assert( testCaseNode.children.size() == 1 );
- SectionNode const& rootSection = *testCaseNode.children.front();
-
- std::string className = stats.testInfo.className;
-
- if( className.empty() ) {
- className = fileNameTag(stats.testInfo.tags);
- if ( className.empty() )
- className = "global";
- }
-
- if ( !m_config->name().empty() )
- className = m_config->name() + "." + className;
-
- writeSection( className, "", rootSection );
- }
-
- void JunitReporter::writeSection( std::string const& className,
- std::string const& rootName,
- SectionNode const& sectionNode ) {
- std::string name = trim( sectionNode.stats.sectionInfo.name );
- if( !rootName.empty() )
- name = rootName + '/' + name;
-
- if( !sectionNode.assertions.empty() ||
- !sectionNode.stdOut.empty() ||
- !sectionNode.stdErr.empty() ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
- if( className.empty() ) {
- xml.writeAttribute( "classname", name );
- xml.writeAttribute( "name", "root" );
- }
- else {
- xml.writeAttribute( "classname", className );
- xml.writeAttribute( "name", name );
- }
- xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) );
-
- writeAssertions( sectionNode );
-
- if( !sectionNode.stdOut.empty() )
- xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline );
- if( !sectionNode.stdErr.empty() )
- xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), XmlFormatting::Newline );
- }
- for( auto const& childNode : sectionNode.childSections )
- if( className.empty() )
- writeSection( name, "", *childNode );
- else
- writeSection( className, name, *childNode );
- }
-
- void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
- for( auto const& assertion : sectionNode.assertions )
- writeAssertion( assertion );
- }
-
- void JunitReporter::writeAssertion( AssertionStats const& stats ) {
- AssertionResult const& result = stats.assertionResult;
- if( !result.isOk() ) {
- std::string elementName;
- switch( result.getResultType() ) {
- case ResultWas::ThrewException:
- case ResultWas::FatalErrorCondition:
- elementName = "error";
- break;
- case ResultWas::ExplicitFailure:
- case ResultWas::ExpressionFailed:
- case ResultWas::DidntThrowException:
- elementName = "failure";
- break;
-
- // We should never see these here:
- case ResultWas::Info:
- case ResultWas::Warning:
- case ResultWas::Ok:
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- elementName = "internalError";
- break;
- }
-
- XmlWriter::ScopedElement e = xml.scopedElement( elementName );
-
- xml.writeAttribute( "message", result.getExpression() );
- xml.writeAttribute( "type", result.getTestMacroName() );
-
- ReusableStringStream rss;
- if (stats.totals.assertions.total() > 0) {
- rss << "FAILED" << ":\n";
- if (result.hasExpression()) {
- rss << " ";
- rss << result.getExpressionInMacro();
- rss << '\n';
- }
- if (result.hasExpandedExpression()) {
- rss << "with expansion:\n";
- rss << Column(result.getExpandedExpression()).indent(2) << '\n';
- }
- } else {
- rss << '\n';
- }
-
- if( !result.getMessage().empty() )
- rss << result.getMessage() << '\n';
- for( auto const& msg : stats.infoMessages )
- if( msg.type == ResultWas::Info )
- rss << msg.message << '\n';
-
- rss << "at " << result.getSourceInfo();
- xml.writeText( rss.str(), XmlFormatting::Newline );
- }
- }
-
- CATCH_REGISTER_REPORTER( "junit", JunitReporter )
-
-} // end namespace Catch
-// end catch_reporter_junit.cpp
-// start catch_reporter_listening.cpp
-
-#include <cassert>
-
-namespace Catch {
-
- ListeningReporter::ListeningReporter() {
- // We will assume that listeners will always want all assertions
- m_preferences.shouldReportAllAssertions = true;
- }
-
- void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) {
- m_listeners.push_back( std::move( listener ) );
- }
-
- void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) {
- assert(!m_reporter && "Listening reporter can wrap only 1 real reporter");
- m_reporter = std::move( reporter );
- m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut;
- }
-
- ReporterPreferences ListeningReporter::getPreferences() const {
- return m_preferences;
- }
-
- std::set<Verbosity> ListeningReporter::getSupportedVerbosities() {
- return std::set<Verbosity>{ };
- }
-
- void ListeningReporter::noMatchingTestCases( std::string const& spec ) {
- for ( auto const& listener : m_listeners ) {
- listener->noMatchingTestCases( spec );
- }
- m_reporter->noMatchingTestCases( spec );
- }
-
- void ListeningReporter::reportInvalidArguments(std::string const&arg){
- for ( auto const& listener : m_listeners ) {
- listener->reportInvalidArguments( arg );
- }
- m_reporter->reportInvalidArguments( arg );
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void ListeningReporter::benchmarkPreparing( std::string const& name ) {
- for (auto const& listener : m_listeners) {
- listener->benchmarkPreparing(name);
- }
- m_reporter->benchmarkPreparing(name);
- }
- void ListeningReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->benchmarkStarting( benchmarkInfo );
- }
- m_reporter->benchmarkStarting( benchmarkInfo );
- }
- void ListeningReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->benchmarkEnded( benchmarkStats );
- }
- m_reporter->benchmarkEnded( benchmarkStats );
- }
-
- void ListeningReporter::benchmarkFailed( std::string const& error ) {
- for (auto const& listener : m_listeners) {
- listener->benchmarkFailed(error);
- }
- m_reporter->benchmarkFailed(error);
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void ListeningReporter::testRunStarting( TestRunInfo const& testRunInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testRunStarting( testRunInfo );
- }
- m_reporter->testRunStarting( testRunInfo );
- }
-
- void ListeningReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testGroupStarting( groupInfo );
- }
- m_reporter->testGroupStarting( groupInfo );
- }
-
- void ListeningReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testCaseStarting( testInfo );
- }
- m_reporter->testCaseStarting( testInfo );
- }
-
- void ListeningReporter::sectionStarting( SectionInfo const& sectionInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->sectionStarting( sectionInfo );
- }
- m_reporter->sectionStarting( sectionInfo );
- }
-
- void ListeningReporter::assertionStarting( AssertionInfo const& assertionInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->assertionStarting( assertionInfo );
- }
- m_reporter->assertionStarting( assertionInfo );
- }
-
- // The return value indicates if the messages buffer should be cleared:
- bool ListeningReporter::assertionEnded( AssertionStats const& assertionStats ) {
- for( auto const& listener : m_listeners ) {
- static_cast<void>( listener->assertionEnded( assertionStats ) );
- }
- return m_reporter->assertionEnded( assertionStats );
- }
-
- void ListeningReporter::sectionEnded( SectionStats const& sectionStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->sectionEnded( sectionStats );
- }
- m_reporter->sectionEnded( sectionStats );
- }
-
- void ListeningReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testCaseEnded( testCaseStats );
- }
- m_reporter->testCaseEnded( testCaseStats );
- }
-
- void ListeningReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testGroupEnded( testGroupStats );
- }
- m_reporter->testGroupEnded( testGroupStats );
- }
-
- void ListeningReporter::testRunEnded( TestRunStats const& testRunStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testRunEnded( testRunStats );
- }
- m_reporter->testRunEnded( testRunStats );
- }
-
- void ListeningReporter::skipTest( TestCaseInfo const& testInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->skipTest( testInfo );
- }
- m_reporter->skipTest( testInfo );
- }
-
- bool ListeningReporter::isMulti() const {
- return true;
- }
-
-} // end namespace Catch
-// end catch_reporter_listening.cpp
-// start catch_reporter_xml.cpp
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled
- // and default is missing) is enabled
-#endif
-
-namespace Catch {
- XmlReporter::XmlReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config ),
- m_xml(_config.stream())
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- XmlReporter::~XmlReporter() = default;
-
- std::string XmlReporter::getDescription() {
- return "Reports test results as an XML document";
- }
-
- std::string XmlReporter::getStylesheetRef() const {
- return std::string();
- }
-
- void XmlReporter::writeSourceInfo( SourceLineInfo const& sourceInfo ) {
- m_xml
- .writeAttribute( "filename", sourceInfo.file )
- .writeAttribute( "line", sourceInfo.line );
- }
-
- void XmlReporter::noMatchingTestCases( std::string const& s ) {
- StreamingReporterBase::noMatchingTestCases( s );
- }
-
- void XmlReporter::testRunStarting( TestRunInfo const& testInfo ) {
- StreamingReporterBase::testRunStarting( testInfo );
- std::string stylesheetRef = getStylesheetRef();
- if( !stylesheetRef.empty() )
- m_xml.writeStylesheetRef( stylesheetRef );
- m_xml.startElement( "Catch" );
- if( !m_config->name().empty() )
- m_xml.writeAttribute( "name", m_config->name() );
- if (m_config->testSpec().hasFilters())
- m_xml.writeAttribute( "filters", serializeFilters( m_config->getTestsOrTags() ) );
- if( m_config->rngSeed() != 0 )
- m_xml.scopedElement( "Randomness" )
- .writeAttribute( "seed", m_config->rngSeed() );
- }
-
- void XmlReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- StreamingReporterBase::testGroupStarting( groupInfo );
- m_xml.startElement( "Group" )
- .writeAttribute( "name", groupInfo.name );
- }
-
- void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
- StreamingReporterBase::testCaseStarting(testInfo);
- m_xml.startElement( "TestCase" )
- .writeAttribute( "name", trim( testInfo.name ) )
- .writeAttribute( "description", testInfo.description )
- .writeAttribute( "tags", testInfo.tagsAsString() );
-
- writeSourceInfo( testInfo.lineInfo );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- m_testCaseTimer.start();
- m_xml.ensureTagClosed();
- }
-
- void XmlReporter::sectionStarting( SectionInfo const& sectionInfo ) {
- StreamingReporterBase::sectionStarting( sectionInfo );
- if( m_sectionDepth++ > 0 ) {
- m_xml.startElement( "Section" )
- .writeAttribute( "name", trim( sectionInfo.name ) );
- writeSourceInfo( sectionInfo.lineInfo );
- m_xml.ensureTagClosed();
- }
- }
-
- void XmlReporter::assertionStarting( AssertionInfo const& ) { }
-
- bool XmlReporter::assertionEnded( AssertionStats const& assertionStats ) {
-
- AssertionResult const& result = assertionStats.assertionResult;
-
- bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
-
- if( includeResults || result.getResultType() == ResultWas::Warning ) {
- // Print any info messages in <Info> tags.
- for( auto const& msg : assertionStats.infoMessages ) {
- if( msg.type == ResultWas::Info && includeResults ) {
- m_xml.scopedElement( "Info" )
- .writeText( msg.message );
- } else if ( msg.type == ResultWas::Warning ) {
- m_xml.scopedElement( "Warning" )
- .writeText( msg.message );
- }
- }
- }
-
- // Drop out if result was successful but we're not printing them.
- if( !includeResults && result.getResultType() != ResultWas::Warning )
- return true;
-
- // Print the expression if there is one.
- if( result.hasExpression() ) {
- m_xml.startElement( "Expression" )
- .writeAttribute( "success", result.succeeded() )
- .writeAttribute( "type", result.getTestMacroName() );
-
- writeSourceInfo( result.getSourceInfo() );
-
- m_xml.scopedElement( "Original" )
- .writeText( result.getExpression() );
- m_xml.scopedElement( "Expanded" )
- .writeText( result.getExpandedExpression() );
- }
-
- // And... Print a result applicable to each result type.
- switch( result.getResultType() ) {
- case ResultWas::ThrewException:
- m_xml.startElement( "Exception" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- case ResultWas::FatalErrorCondition:
- m_xml.startElement( "FatalErrorCondition" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- case ResultWas::Info:
- m_xml.scopedElement( "Info" )
- .writeText( result.getMessage() );
- break;
- case ResultWas::Warning:
- // Warning will already have been written
- break;
- case ResultWas::ExplicitFailure:
- m_xml.startElement( "Failure" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- default:
- break;
- }
-
- if( result.hasExpression() )
- m_xml.endElement();
-
- return true;
- }
-
- void XmlReporter::sectionEnded( SectionStats const& sectionStats ) {
- StreamingReporterBase::sectionEnded( sectionStats );
- if( --m_sectionDepth > 0 ) {
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" );
- e.writeAttribute( "successes", sectionStats.assertions.passed );
- e.writeAttribute( "failures", sectionStats.assertions.failed );
- e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds );
-
- m_xml.endElement();
- }
- }
-
- void XmlReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- StreamingReporterBase::testCaseEnded( testCaseStats );
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" );
- e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() );
-
- if( !testCaseStats.stdOut.empty() )
- m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), XmlFormatting::Newline );
- if( !testCaseStats.stdErr.empty() )
- m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), XmlFormatting::Newline );
-
- m_xml.endElement();
- }
-
- void XmlReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- StreamingReporterBase::testGroupEnded( testGroupStats );
- // TODO: Check testGroupStats.aborting and act accordingly.
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testGroupStats.totals.assertions.passed )
- .writeAttribute( "failures", testGroupStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
- m_xml.endElement();
- }
-
- void XmlReporter::testRunEnded( TestRunStats const& testRunStats ) {
- StreamingReporterBase::testRunEnded( testRunStats );
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testRunStats.totals.assertions.passed )
- .writeAttribute( "failures", testRunStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk );
- m_xml.endElement();
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void XmlReporter::benchmarkPreparing(std::string const& name) {
- m_xml.startElement("BenchmarkResults")
- .writeAttribute("name", name);
- }
-
- void XmlReporter::benchmarkStarting(BenchmarkInfo const &info) {
- m_xml.writeAttribute("samples", info.samples)
- .writeAttribute("resamples", info.resamples)
- .writeAttribute("iterations", info.iterations)
- .writeAttribute("clockResolution", info.clockResolution)
- .writeAttribute("estimatedDuration", info.estimatedDuration)
- .writeComment("All values in nano seconds");
- }
-
- void XmlReporter::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) {
- m_xml.startElement("mean")
- .writeAttribute("value", benchmarkStats.mean.point.count())
- .writeAttribute("lowerBound", benchmarkStats.mean.lower_bound.count())
- .writeAttribute("upperBound", benchmarkStats.mean.upper_bound.count())
- .writeAttribute("ci", benchmarkStats.mean.confidence_interval);
- m_xml.endElement();
- m_xml.startElement("standardDeviation")
- .writeAttribute("value", benchmarkStats.standardDeviation.point.count())
- .writeAttribute("lowerBound", benchmarkStats.standardDeviation.lower_bound.count())
- .writeAttribute("upperBound", benchmarkStats.standardDeviation.upper_bound.count())
- .writeAttribute("ci", benchmarkStats.standardDeviation.confidence_interval);
- m_xml.endElement();
- m_xml.startElement("outliers")
- .writeAttribute("variance", benchmarkStats.outlierVariance)
- .writeAttribute("lowMild", benchmarkStats.outliers.low_mild)
- .writeAttribute("lowSevere", benchmarkStats.outliers.low_severe)
- .writeAttribute("highMild", benchmarkStats.outliers.high_mild)
- .writeAttribute("highSevere", benchmarkStats.outliers.high_severe);
- m_xml.endElement();
- m_xml.endElement();
- }
-
- void XmlReporter::benchmarkFailed(std::string const &error) {
- m_xml.scopedElement("failed").
- writeAttribute("message", error);
- m_xml.endElement();
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- CATCH_REGISTER_REPORTER( "xml", XmlReporter )
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-// end catch_reporter_xml.cpp
-
-namespace Catch {
- LeakDetector leakDetector;
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_impl.hpp
-#endif
-
-#ifdef CATCH_CONFIG_MAIN
-// start catch_default_main.hpp
-
-#ifndef __OBJC__
-
-#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
-// Standard C/C++ Win32 Unicode wmain entry point
-extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
-#else
-// Standard C/C++ main entry point
-int main (int argc, char * argv[]) {
-#endif
-
- return Catch::Session().run( argc, argv );
-}
-
-#else // __OBJC__
-
-// Objective-C entry point
-int main (int argc, char * const argv[]) {
-#if !CATCH_ARC_ENABLED
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-#endif
-
- Catch::registerTestMethods();
- int result = Catch::Session().run( argc, (char**)argv );
-
-#if !CATCH_ARC_ENABLED
- [pool drain];
-#endif
-
- return result;
-}
-
-#endif // __OBJC__
-
-// end catch_default_main.hpp
-#endif
-
-#if !defined(CATCH_CONFIG_IMPL_ONLY)
-
-#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED
-# undef CLARA_CONFIG_MAIN
-#endif
-
-#if !defined(CATCH_CONFIG_DISABLE)
-//////
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-
-#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
-#endif// CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-
-#define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-#define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
-
-#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
-
-#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
-#define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
-#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE",__VA_ARGS__ )
-
-#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
-#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-#define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-#define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
-#define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
-#define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#else
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#endif
-
-#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
-#define CATCH_STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ )
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
-#else
-#define CATCH_STATIC_REQUIRE( ... ) CATCH_REQUIRE( __VA_ARGS__ )
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ )
-#endif
-
-// "BDD-style" convenience wrappers
-#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-#define CATCH_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
-#define CATCH_AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
-#define CATCH_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
-#define CATCH_AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
-#define CATCH_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
-#define CATCH_AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#define CATCH_BENCHMARK(...) \
- INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
-#define CATCH_BENCHMARK_ADVANCED(name) \
- INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-
-#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-
-#define CHECK( ... ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
-
-#define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
-
-#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
-#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
-#define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE",__VA_ARGS__ )
-
-#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
-#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-#define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-#define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
-#define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
-#define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
-#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#endif
-
-#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
-#define STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
-#define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
-#else
-#define STATIC_REQUIRE( ... ) REQUIRE( __VA_ARGS__ )
-#define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ )
-#endif
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
-
-// "BDD-style" convenience wrappers
-#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-
-#define GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
-#define AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
-#define WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
-#define AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
-#define THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
-#define AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#define BENCHMARK(...) \
- INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
-#define BENCHMARK_ADVANCED(name) \
- INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-using Catch::Detail::Approx;
-
-#else // CATCH_CONFIG_DISABLE
-
-//////
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( ... ) (void)(0)
-#define CATCH_REQUIRE_FALSE( ... ) (void)(0)
-
-#define CATCH_REQUIRE_THROWS( ... ) (void)(0)
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif// CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_REQUIRE_NOTHROW( ... ) (void)(0)
-
-#define CATCH_CHECK( ... ) (void)(0)
-#define CATCH_CHECK_FALSE( ... ) (void)(0)
-#define CATCH_CHECKED_IF( ... ) if (__VA_ARGS__)
-#define CATCH_CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
-#define CATCH_CHECK_NOFAIL( ... ) (void)(0)
-
-#define CATCH_CHECK_THROWS( ... ) (void)(0)
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_CHECK_NOTHROW( ... ) (void)(0)
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THAT( arg, matcher ) (void)(0)
-
-#define CATCH_REQUIRE_THAT( arg, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define CATCH_INFO( msg ) (void)(0)
-#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
-#define CATCH_WARN( msg ) (void)(0)
-#define CATCH_CAPTURE( msg ) (void)(0)
-
-#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_METHOD_AS_TEST_CASE( method, ... )
-#define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0)
-#define CATCH_SECTION( ... )
-#define CATCH_DYNAMIC_SECTION( ... )
-#define CATCH_FAIL( ... ) (void)(0)
-#define CATCH_FAIL_CHECK( ... ) (void)(0)
-#define CATCH_SUCCEED( ... ) (void)(0)
-
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#endif
-
-// "BDD-style" convenience wrappers
-#define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
-#define CATCH_GIVEN( desc )
-#define CATCH_AND_GIVEN( desc )
-#define CATCH_WHEN( desc )
-#define CATCH_AND_WHEN( desc )
-#define CATCH_THEN( desc )
-#define CATCH_AND_THEN( desc )
-
-#define CATCH_STATIC_REQUIRE( ... ) (void)(0)
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0)
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( ... ) (void)(0)
-#define REQUIRE_FALSE( ... ) (void)(0)
-
-#define REQUIRE_THROWS( ... ) (void)(0)
-#define REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
-#define REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define REQUIRE_NOTHROW( ... ) (void)(0)
-
-#define CHECK( ... ) (void)(0)
-#define CHECK_FALSE( ... ) (void)(0)
-#define CHECKED_IF( ... ) if (__VA_ARGS__)
-#define CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
-#define CHECK_NOFAIL( ... ) (void)(0)
-
-#define CHECK_THROWS( ... ) (void)(0)
-#define CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CHECK_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CHECK_NOTHROW( ... ) (void)(0)
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THAT( arg, matcher ) (void)(0)
-
-#define REQUIRE_THAT( arg, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define INFO( msg ) (void)(0)
-#define UNSCOPED_INFO( msg ) (void)(0)
-#define WARN( msg ) (void)(0)
-#define CAPTURE( msg ) (void)(0)
-
-#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define METHOD_AS_TEST_CASE( method, ... )
-#define REGISTER_TEST_CASE( Function, ... ) (void)(0)
-#define SECTION( ... )
-#define DYNAMIC_SECTION( ... )
-#define FAIL( ... ) (void)(0)
-#define FAIL_CHECK( ... ) (void)(0)
-#define SUCCEED( ... ) (void)(0)
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#endif
-
-#define STATIC_REQUIRE( ... ) (void)(0)
-#define STATIC_REQUIRE_FALSE( ... ) (void)(0)
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
-
-// "BDD-style" convenience wrappers
-#define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) )
-#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
-
-#define GIVEN( desc )
-#define AND_GIVEN( desc )
-#define WHEN( desc )
-#define AND_WHEN( desc )
-#define THEN( desc )
-#define AND_THEN( desc )
-
-using Catch::Detail::Approx;
-
-#endif
-
-#endif // ! CATCH_CONFIG_IMPL_ONLY
-
-// start catch_reenable_warnings.h
-
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(pop)
-# else
-# pragma clang diagnostic pop
-# endif
-#elif defined __GNUC__
-# pragma GCC diagnostic pop
-#endif
-
-// end catch_reenable_warnings.h
-// end catch.hpp
-#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-
diff --git a/single_include/catch2/catch_reporter_automake.hpp b/single_include/catch2/catch_reporter_automake.hpp
deleted file mode 100644
index dbebe975..00000000
--- a/single_include/catch2/catch_reporter_automake.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Created by Justin R. Wilson on 2/19/2017.
- * Copyright 2017 Justin R. Wilson. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-namespace Catch {
-
- struct AutomakeReporter : StreamingReporterBase<AutomakeReporter> {
- AutomakeReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config )
- {}
-
- ~AutomakeReporter() override;
-
- static std::string getDescription() {
- return "Reports test results in the format of Automake .trs files";
- }
-
- void assertionStarting( AssertionInfo const& ) override {}
-
- bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; }
-
- void testCaseEnded( TestCaseStats const& _testCaseStats ) override {
- // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR.
- stream << ":test-result: ";
- if (_testCaseStats.totals.assertions.allPassed()) {
- stream << "PASS";
- } else if (_testCaseStats.totals.assertions.allOk()) {
- stream << "XFAIL";
- } else {
- stream << "FAIL";
- }
- stream << ' ' << _testCaseStats.testInfo.name << '\n';
- StreamingReporterBase::testCaseEnded( _testCaseStats );
- }
-
- void skipTest( TestCaseInfo const& testInfo ) override {
- stream << ":test-result: SKIP " << testInfo.name << '\n';
- }
-
- };
-
-#ifdef CATCH_IMPL
- AutomakeReporter::~AutomakeReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "automake", AutomakeReporter)
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
diff --git a/single_include/catch2/catch_reporter_sonarqube.hpp b/single_include/catch2/catch_reporter_sonarqube.hpp
deleted file mode 100644
index bf7d9299..00000000
--- a/single_include/catch2/catch_reporter_sonarqube.hpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Created by Daniel Garcia on 2018-12-04.
- * Copyright Social Point SL. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
-#define CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
-
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-#include <map>
-
-namespace Catch {
-
- struct SonarQubeReporter : CumulativeReporterBase<SonarQubeReporter> {
-
- SonarQubeReporter(ReporterConfig const& config)
- : CumulativeReporterBase(config)
- , xml(config.stream()) {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- ~SonarQubeReporter() override;
-
- static std::string getDescription() {
- return "Reports test results in the Generic Test Data SonarQube XML format";
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- void noMatchingTestCases(std::string const& /*spec*/) override {}
-
- void testRunStarting(TestRunInfo const& testRunInfo) override {
- CumulativeReporterBase::testRunStarting(testRunInfo);
- xml.startElement("testExecutions");
- xml.writeAttribute("version", "1");
- }
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override {
- CumulativeReporterBase::testGroupEnded(testGroupStats);
- writeGroup(*m_testGroups.back());
- }
-
- void testRunEndedCumulative() override {
- xml.endElement();
- }
-
- void writeGroup(TestGroupNode const& groupNode) {
- std::map<std::string, TestGroupNode::ChildNodes> testsPerFile;
- for(auto const& child : groupNode.children)
- testsPerFile[child->value.testInfo.lineInfo.file].push_back(child);
-
- for(auto const& kv : testsPerFile)
- writeTestFile(kv.first.c_str(), kv.second);
- }
-
- void writeTestFile(const char* filename, TestGroupNode::ChildNodes const& testCaseNodes) {
- XmlWriter::ScopedElement e = xml.scopedElement("file");
- xml.writeAttribute("path", filename);
-
- for(auto const& child : testCaseNodes)
- writeTestCase(*child);
- }
-
- void writeTestCase(TestCaseNode const& testCaseNode) {
- // All test cases have exactly one section - which represents the
- // test case itself. That section may have 0-n nested sections
- assert(testCaseNode.children.size() == 1);
- SectionNode const& rootSection = *testCaseNode.children.front();
- writeSection("", rootSection, testCaseNode.value.testInfo.okToFail());
- }
-
- void writeSection(std::string const& rootName, SectionNode const& sectionNode, bool okToFail) {
- std::string name = trim(sectionNode.stats.sectionInfo.name);
- if(!rootName.empty())
- name = rootName + '/' + name;
-
- if(!sectionNode.assertions.empty() || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty()) {
- XmlWriter::ScopedElement e = xml.scopedElement("testCase");
- xml.writeAttribute("name", name);
- xml.writeAttribute("duration", static_cast<long>(sectionNode.stats.durationInSeconds * 1000));
-
- writeAssertions(sectionNode, okToFail);
- }
-
- for(auto const& childNode : sectionNode.childSections)
- writeSection(name, *childNode, okToFail);
- }
-
- void writeAssertions(SectionNode const& sectionNode, bool okToFail) {
- for(auto const& assertion : sectionNode.assertions)
- writeAssertion( assertion, okToFail);
- }
-
- void writeAssertion(AssertionStats const& stats, bool okToFail) {
- AssertionResult const& result = stats.assertionResult;
- if(!result.isOk()) {
- std::string elementName;
- if(okToFail) {
- elementName = "skipped";
- }
- else {
- switch(result.getResultType()) {
- case ResultWas::ThrewException:
- case ResultWas::FatalErrorCondition:
- elementName = "error";
- break;
- case ResultWas::ExplicitFailure:
- elementName = "failure";
- break;
- case ResultWas::ExpressionFailed:
- elementName = "failure";
- break;
- case ResultWas::DidntThrowException:
- elementName = "failure";
- break;
-
- // We should never see these here:
- case ResultWas::Info:
- case ResultWas::Warning:
- case ResultWas::Ok:
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- elementName = "internalError";
- break;
- }
- }
-
- XmlWriter::ScopedElement e = xml.scopedElement(elementName);
-
- ReusableStringStream messageRss;
- messageRss << result.getTestMacroName() << "(" << result.getExpression() << ")";
- xml.writeAttribute("message", messageRss.str());
-
- ReusableStringStream textRss;
- if (stats.totals.assertions.total() > 0) {
- textRss << "FAILED:\n";
- if (result.hasExpression()) {
- textRss << "\t" << result.getExpressionInMacro() << "\n";
- }
- if (result.hasExpandedExpression()) {
- textRss << "with expansion:\n\t" << result.getExpandedExpression() << "\n";
- }
- }
-
- if(!result.getMessage().empty())
- textRss << result.getMessage() << "\n";
-
- for(auto const& msg : stats.infoMessages)
- if(msg.type == ResultWas::Info)
- textRss << msg.message << "\n";
-
- textRss << "at " << result.getSourceInfo();
- xml.writeText(textRss.str(), XmlFormatting::Newline);
- }
- }
-
- private:
- XmlWriter xml;
- };
-
-#ifdef CATCH_IMPL
- SonarQubeReporter::~SonarQubeReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "sonarqube", SonarQubeReporter )
-
-} // end namespace Catch
-
-#endif // CATCH_REPORTER_SONARQUBE_HPP_INCLUDED \ No newline at end of file
diff --git a/single_include/catch2/catch_reporter_tap.hpp b/single_include/catch2/catch_reporter_tap.hpp
deleted file mode 100644
index 1bfe4f5e..00000000
--- a/single_include/catch2/catch_reporter_tap.hpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Created by Colton Wolkins on 2015-08-15.
- * Copyright 2015 Martin Moene. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
-
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-#include <algorithm>
-
-namespace Catch {
-
- struct TAPReporter : StreamingReporterBase<TAPReporter> {
-
- using StreamingReporterBase::StreamingReporterBase;
-
- ~TAPReporter() override;
-
- static std::string getDescription() {
- return "Reports test results in TAP format, suitable for test harnesses";
- }
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- void noMatchingTestCases( std::string const& spec ) override {
- stream << "# No test cases matched '" << spec << "'" << std::endl;
- }
-
- void assertionStarting( AssertionInfo const& ) override {}
-
- bool assertionEnded( AssertionStats const& _assertionStats ) override {
- ++counter;
-
- stream << "# " << currentTestCaseInfo->name << std::endl;
- AssertionPrinter printer( stream, _assertionStats, counter );
- printer.print();
-
- stream << std::endl;
- return true;
- }
-
- void testRunEnded( TestRunStats const& _testRunStats ) override {
- printTotals( _testRunStats.totals );
- stream << "\n" << std::endl;
- StreamingReporterBase::testRunEnded( _testRunStats );
- }
-
- private:
- std::size_t counter = 0;
- class AssertionPrinter {
- public:
- AssertionPrinter& operator= ( AssertionPrinter const& ) = delete;
- AssertionPrinter( AssertionPrinter const& ) = delete;
- AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, std::size_t _counter )
- : stream( _stream )
- , result( _stats.assertionResult )
- , messages( _stats.infoMessages )
- , itMessage( _stats.infoMessages.begin() )
- , printInfoMessages( true )
- , counter(_counter)
- {}
-
- void print() {
- itMessage = messages.begin();
-
- switch( result.getResultType() ) {
- case ResultWas::Ok:
- printResultType( passedString() );
- printOriginalExpression();
- printReconstructedExpression();
- if ( ! result.hasExpression() )
- printRemainingMessages( Colour::None );
- else
- printRemainingMessages();
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk()) {
- printResultType(passedString());
- } else {
- printResultType(failedString());
- }
- printOriginalExpression();
- printReconstructedExpression();
- if (result.isOk()) {
- printIssue(" # TODO");
- }
- printRemainingMessages();
- break;
- case ResultWas::ThrewException:
- printResultType( failedString() );
- printIssue( "unexpected exception with message:" );
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::FatalErrorCondition:
- printResultType( failedString() );
- printIssue( "fatal error condition with message:" );
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::DidntThrowException:
- printResultType( failedString() );
- printIssue( "expected exception, got none" );
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::Info:
- printResultType( "info" );
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::Warning:
- printResultType( "warning" );
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::ExplicitFailure:
- printResultType( failedString() );
- printIssue( "explicitly" );
- printRemainingMessages( Colour::None );
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- printResultType( "** internal error **" );
- break;
- }
- }
-
- private:
- static Colour::Code dimColour() { return Colour::FileName; }
-
- static const char* failedString() { return "not ok"; }
- static const char* passedString() { return "ok"; }
-
- void printSourceInfo() const {
- Colour colourGuard( dimColour() );
- stream << result.getSourceInfo() << ":";
- }
-
- void printResultType( std::string const& passOrFail ) const {
- if( !passOrFail.empty() ) {
- stream << passOrFail << ' ' << counter << " -";
- }
- }
-
- void printIssue( std::string const& issue ) const {
- stream << " " << issue;
- }
-
- void printExpressionWas() {
- if( result.hasExpression() ) {
- stream << ";";
- {
- Colour colour( dimColour() );
- stream << " expression was:";
- }
- printOriginalExpression();
- }
- }
-
- void printOriginalExpression() const {
- if( result.hasExpression() ) {
- stream << " " << result.getExpression();
- }
- }
-
- void printReconstructedExpression() const {
- if( result.hasExpandedExpression() ) {
- {
- Colour colour( dimColour() );
- stream << " for: ";
- }
- std::string expr = result.getExpandedExpression();
- std::replace( expr.begin(), expr.end(), '\n', ' ');
- stream << expr;
- }
- }
-
- void printMessage() {
- if ( itMessage != messages.end() ) {
- stream << " '" << itMessage->message << "'";
- ++itMessage;
- }
- }
-
- void printRemainingMessages( Colour::Code colour = dimColour() ) {
- if (itMessage == messages.end()) {
- return;
- }
-
- // using messages.end() directly (or auto) yields compilation error:
- std::vector<MessageInfo>::const_iterator itEnd = messages.end();
- const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
-
- {
- Colour colourGuard( colour );
- stream << " with " << pluralise( N, "message" ) << ":";
- }
-
- for(; itMessage != itEnd; ) {
- // If this assertion is a warning ignore any INFO messages
- if( printInfoMessages || itMessage->type != ResultWas::Info ) {
- stream << " '" << itMessage->message << "'";
- if ( ++itMessage != itEnd ) {
- Colour colourGuard( dimColour() );
- stream << " and";
- }
- }
- }
- }
-
- private:
- std::ostream& stream;
- AssertionResult const& result;
- std::vector<MessageInfo> messages;
- std::vector<MessageInfo>::const_iterator itMessage;
- bool printInfoMessages;
- std::size_t counter;
- };
-
- void printTotals( const Totals& totals ) const {
- if( totals.testCases.total() == 0 ) {
- stream << "1..0 # Skipped: No tests ran.";
- } else {
- stream << "1.." << counter;
- }
- }
- };
-
-#ifdef CATCH_IMPL
- TAPReporter::~TAPReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "tap", TAPReporter )
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
diff --git a/single_include/catch2/catch_reporter_teamcity.hpp b/single_include/catch2/catch_reporter_teamcity.hpp
deleted file mode 100644
index 47b7e4aa..00000000
--- a/single_include/catch2/catch_reporter_teamcity.hpp
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Created by Phil Nash on 19th December 2014
- * Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
-
-// Don't #include any Catch headers here - we can assume they are already
-// included before this header.
-// This is not good practice in general but is necessary in this case so this
-// file can be distributed as a single header that works with the main
-// Catch single header.
-
-#include <cstring>
-
-#ifdef __clang__
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
- struct TeamCityReporter : StreamingReporterBase<TeamCityReporter> {
- TeamCityReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config )
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- }
-
- static std::string escape( std::string const& str ) {
- std::string escaped = str;
- replaceInPlace( escaped, "|", "||" );
- replaceInPlace( escaped, "'", "|'" );
- replaceInPlace( escaped, "\n", "|n" );
- replaceInPlace( escaped, "\r", "|r" );
- replaceInPlace( escaped, "[", "|[" );
- replaceInPlace( escaped, "]", "|]" );
- return escaped;
- }
- ~TeamCityReporter() override;
-
- static std::string getDescription() {
- return "Reports test results as TeamCity service messages";
- }
-
- void skipTest( TestCaseInfo const& /* testInfo */ ) override {
- }
-
- void noMatchingTestCases( std::string const& /* spec */ ) override {}
-
- void testGroupStarting( GroupInfo const& groupInfo ) override {
- StreamingReporterBase::testGroupStarting( groupInfo );
- stream << "##teamcity[testSuiteStarted name='"
- << escape( groupInfo.name ) << "']\n";
- }
- void testGroupEnded( TestGroupStats const& testGroupStats ) override {
- StreamingReporterBase::testGroupEnded( testGroupStats );
- stream << "##teamcity[testSuiteFinished name='"
- << escape( testGroupStats.groupInfo.name ) << "']\n";
- }
-
-
- void assertionStarting( AssertionInfo const& ) override {}
-
- bool assertionEnded( AssertionStats const& assertionStats ) override {
- AssertionResult const& result = assertionStats.assertionResult;
- if( !result.isOk() ) {
-
- ReusableStringStream msg;
- if( !m_headerPrintedForThisSection )
- printSectionHeader( msg.get() );
- m_headerPrintedForThisSection = true;
-
- msg << result.getSourceInfo() << "\n";
-
- switch( result.getResultType() ) {
- case ResultWas::ExpressionFailed:
- msg << "expression failed";
- break;
- case ResultWas::ThrewException:
- msg << "unexpected exception";
- break;
- case ResultWas::FatalErrorCondition:
- msg << "fatal error condition";
- break;
- case ResultWas::DidntThrowException:
- msg << "no exception was thrown where one was expected";
- break;
- case ResultWas::ExplicitFailure:
- msg << "explicit failure";
- break;
-
- // We shouldn't get here because of the isOk() test
- case ResultWas::Ok:
- case ResultWas::Info:
- case ResultWas::Warning:
- CATCH_ERROR( "Internal error in TeamCity reporter" );
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- CATCH_ERROR( "Not implemented" );
- }
- if( assertionStats.infoMessages.size() == 1 )
- msg << " with message:";
- if( assertionStats.infoMessages.size() > 1 )
- msg << " with messages:";
- for( auto const& messageInfo : assertionStats.infoMessages )
- msg << "\n \"" << messageInfo.message << "\"";
-
-
- if( result.hasExpression() ) {
- msg <<
- "\n " << result.getExpressionInMacro() << "\n"
- "with expansion:\n" <<
- " " << result.getExpandedExpression() << "\n";
- }
-
- if( currentTestCaseInfo->okToFail() ) {
- msg << "- failure ignore as test marked as 'ok to fail'\n";
- stream << "##teamcity[testIgnored"
- << " name='" << escape( currentTestCaseInfo->name )<< "'"
- << " message='" << escape( msg.str() ) << "'"
- << "]\n";
- }
- else {
- stream << "##teamcity[testFailed"
- << " name='" << escape( currentTestCaseInfo->name )<< "'"
- << " message='" << escape( msg.str() ) << "'"
- << "]\n";
- }
- }
- stream.flush();
- return true;
- }
-
- void sectionStarting( SectionInfo const& sectionInfo ) override {
- m_headerPrintedForThisSection = false;
- StreamingReporterBase::sectionStarting( sectionInfo );
- }
-
- void testCaseStarting( TestCaseInfo const& testInfo ) override {
- m_testTimer.start();
- StreamingReporterBase::testCaseStarting( testInfo );
- stream << "##teamcity[testStarted name='"
- << escape( testInfo.name ) << "']\n";
- stream.flush();
- }
-
- void testCaseEnded( TestCaseStats const& testCaseStats ) override {
- StreamingReporterBase::testCaseEnded( testCaseStats );
- if( !testCaseStats.stdOut.empty() )
- stream << "##teamcity[testStdOut name='"
- << escape( testCaseStats.testInfo.name )
- << "' out='" << escape( testCaseStats.stdOut ) << "']\n";
- if( !testCaseStats.stdErr.empty() )
- stream << "##teamcity[testStdErr name='"
- << escape( testCaseStats.testInfo.name )
- << "' out='" << escape( testCaseStats.stdErr ) << "']\n";
- stream << "##teamcity[testFinished name='"
- << escape( testCaseStats.testInfo.name ) << "' duration='"
- << m_testTimer.getElapsedMilliseconds() << "']\n";
- stream.flush();
- }
-
- private:
- void printSectionHeader( std::ostream& os ) {
- assert( !m_sectionStack.empty() );
-
- if( m_sectionStack.size() > 1 ) {
- os << getLineOfChars<'-'>() << "\n";
-
- std::vector<SectionInfo>::const_iterator
- it = m_sectionStack.begin()+1, // Skip first section (test case)
- itEnd = m_sectionStack.end();
- for( ; it != itEnd; ++it )
- printHeaderString( os, it->name );
- os << getLineOfChars<'-'>() << "\n";
- }
-
- SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
-
- os << lineInfo << "\n";
- os << getLineOfChars<'.'>() << "\n\n";
- }
-
- // if string has a : in first line will set indent to follow it on
- // subsequent lines
- static void printHeaderString( std::ostream& os, std::string const& _string, std::size_t indent = 0 ) {
- std::size_t i = _string.find( ": " );
- if( i != std::string::npos )
- i+=2;
- else
- i = 0;
- os << Column( _string )
- .indent( indent+i)
- .initialIndent( indent ) << "\n";
- }
- private:
- bool m_headerPrintedForThisSection = false;
- Timer m_testTimer;
- };
-
-#ifdef CATCH_IMPL
- TeamCityReporter::~TeamCityReporter() {}
-#endif
-
- CATCH_REGISTER_REPORTER( "teamcity", TeamCityReporter )
-
-} // end namespace Catch
-
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
diff --git a/third_party/clara.hpp b/third_party/clara.hpp
deleted file mode 100644
index 9f4f1b2c..00000000
--- a/third_party/clara.hpp
+++ /dev/null
@@ -1,1267 +0,0 @@
-// Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See https://github.com/philsquared/Clara for more details
-
-// Clara v1.1.5
-
-#ifndef CLARA_HPP_INCLUDED
-#define CLARA_HPP_INCLUDED
-
-#ifndef CLARA_CONFIG_CONSOLE_WIDTH
-#define CLARA_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-#ifndef CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-#ifndef CLARA_CONFIG_OPTIONAL_TYPE
-#ifdef __has_include
-#if __has_include(<optional>) && __cplusplus >= 201703L
-#include <optional>
-#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
-#endif
-#endif
-#endif
-
-
-// ----------- #included from clara_textflow.hpp -----------
-
-// TextFlowCpp
-//
-// A single-header library for wrapping and laying out basic text, by Phil Nash
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// This project is hosted at https://github.com/philsquared/textflowcpp
-
-#ifndef CLARA_TEXTFLOW_HPP_INCLUDED
-#define CLARA_TEXTFLOW_HPP_INCLUDED
-
-#include <cassert>
-#include <ostream>
-#include <sstream>
-#include <vector>
-
-#ifndef CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-
-namespace clara { namespace TextFlow {
-
- inline auto isWhitespace( char c ) -> bool {
- static std::string chars = " \t\n\r";
- return chars.find( c ) != std::string::npos;
- }
- inline auto isBreakableBefore( char c ) -> bool {
- static std::string chars = "[({<|";
- return chars.find( c ) != std::string::npos;
- }
- inline auto isBreakableAfter( char c ) -> bool {
- static std::string chars = "])}>.,:;*+-=&/\\";
- return chars.find( c ) != std::string::npos;
- }
-
- class Columns;
-
- class Column {
- std::vector<std::string> m_strings;
- size_t m_width = CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH;
- size_t m_indent = 0;
- size_t m_initialIndent = std::string::npos;
-
- public:
- class iterator {
- friend Column;
-
- Column const& m_column;
- size_t m_stringIndex = 0;
- size_t m_pos = 0;
-
- size_t m_len = 0;
- size_t m_end = 0;
- bool m_suffix = false;
-
- iterator( Column const& column, size_t stringIndex )
- : m_column( column ),
- m_stringIndex( stringIndex )
- {}
-
- auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; }
-
- auto isBoundary( size_t at ) const -> bool {
- assert( at > 0 );
- assert( at <= line().size() );
-
- return at == line().size() ||
- ( isWhitespace( line()[at] ) && !isWhitespace( line()[at-1] ) ) ||
- isBreakableBefore( line()[at] ) ||
- isBreakableAfter( line()[at-1] );
- }
-
- void calcLength() {
- assert( m_stringIndex < m_column.m_strings.size() );
-
- m_suffix = false;
- auto width = m_column.m_width-indent();
- m_end = m_pos;
- if (line()[m_pos] == '\n') {
- ++m_end;
- }
- while( m_end < line().size() && line()[m_end] != '\n' )
- ++m_end;
-
- if( m_end < m_pos + width ) {
- m_len = m_end - m_pos;
- }
- else {
- size_t len = width;
- while (len > 0 && !isBoundary(m_pos + len))
- --len;
- while (len > 0 && isWhitespace( line()[m_pos + len - 1] ))
- --len;
-
- if (len > 0) {
- m_len = len;
- } else {
- m_suffix = true;
- m_len = width - 1;
- }
- }
- }
-
- auto indent() const -> size_t {
- auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos;
- return initial == std::string::npos ? m_column.m_indent : initial;
- }
-
- auto addIndentAndSuffix(std::string const &plain) const -> std::string {
- return std::string( indent(), ' ' ) + (m_suffix ? plain + "-" : plain);
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type*;
- using reference = value_type&;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator( Column const& column ) : m_column( column ) {
- assert( m_column.m_width > m_column.m_indent );
- assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent );
- calcLength();
- if( m_len == 0 )
- m_stringIndex++; // Empty string
- }
-
- auto operator *() const -> std::string {
- assert( m_stringIndex < m_column.m_strings.size() );
- assert( m_pos <= m_end );
- return addIndentAndSuffix(line().substr(m_pos, m_len));
- }
-
- auto operator ++() -> iterator& {
- m_pos += m_len;
- if( m_pos < line().size() && line()[m_pos] == '\n' )
- m_pos += 1;
- else
- while( m_pos < line().size() && isWhitespace( line()[m_pos] ) )
- ++m_pos;
-
- if( m_pos == line().size() ) {
- m_pos = 0;
- ++m_stringIndex;
- }
- if( m_stringIndex < m_column.m_strings.size() )
- calcLength();
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev( *this );
- operator++();
- return prev;
- }
-
- auto operator ==( iterator const& other ) const -> bool {
- return
- m_pos == other.m_pos &&
- m_stringIndex == other.m_stringIndex &&
- &m_column == &other.m_column;
- }
- auto operator !=( iterator const& other ) const -> bool {
- return !operator==( other );
- }
- };
- using const_iterator = iterator;
-
- explicit Column( std::string const& text ) { m_strings.push_back( text ); }
-
- auto width( size_t newWidth ) -> Column& {
- assert( newWidth > 0 );
- m_width = newWidth;
- return *this;
- }
- auto indent( size_t newIndent ) -> Column& {
- m_indent = newIndent;
- return *this;
- }
- auto initialIndent( size_t newIndent ) -> Column& {
- m_initialIndent = newIndent;
- return *this;
- }
-
- auto width() const -> size_t { return m_width; }
- auto begin() const -> iterator { return iterator( *this ); }
- auto end() const -> iterator { return { *this, m_strings.size() }; }
-
- inline friend std::ostream& operator << ( std::ostream& os, Column const& col ) {
- bool first = true;
- for( auto line : col ) {
- if( first )
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto operator + ( Column const& other ) -> Columns;
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
- };
-
- class Spacer : public Column {
-
- public:
- explicit Spacer( size_t spaceWidth ) : Column( "" ) {
- width( spaceWidth );
- }
- };
-
- class Columns {
- std::vector<Column> m_columns;
-
- public:
-
- class iterator {
- friend Columns;
- struct EndTag {};
-
- std::vector<Column> const& m_columns;
- std::vector<Column::iterator> m_iterators;
- size_t m_activeIterators;
-
- iterator( Columns const& columns, EndTag )
- : m_columns( columns.m_columns ),
- m_activeIterators( 0 )
- {
- m_iterators.reserve( m_columns.size() );
-
- for( auto const& col : m_columns )
- m_iterators.push_back( col.end() );
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type*;
- using reference = value_type&;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator( Columns const& columns )
- : m_columns( columns.m_columns ),
- m_activeIterators( m_columns.size() )
- {
- m_iterators.reserve( m_columns.size() );
-
- for( auto const& col : m_columns )
- m_iterators.push_back( col.begin() );
- }
-
- auto operator ==( iterator const& other ) const -> bool {
- return m_iterators == other.m_iterators;
- }
- auto operator !=( iterator const& other ) const -> bool {
- return m_iterators != other.m_iterators;
- }
- auto operator *() const -> std::string {
- std::string row, padding;
-
- for( size_t i = 0; i < m_columns.size(); ++i ) {
- auto width = m_columns[i].width();
- if( m_iterators[i] != m_columns[i].end() ) {
- std::string col = *m_iterators[i];
- row += padding + col;
- if( col.size() < width )
- padding = std::string( width - col.size(), ' ' );
- else
- padding = "";
- }
- else {
- padding += std::string( width, ' ' );
- }
- }
- return row;
- }
- auto operator ++() -> iterator& {
- for( size_t i = 0; i < m_columns.size(); ++i ) {
- if (m_iterators[i] != m_columns[i].end())
- ++m_iterators[i];
- }
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev( *this );
- operator++();
- return prev;
- }
- };
- using const_iterator = iterator;
-
- auto begin() const -> iterator { return iterator( *this ); }
- auto end() const -> iterator { return { *this, iterator::EndTag() }; }
-
- auto operator += ( Column const& col ) -> Columns& {
- m_columns.push_back( col );
- return *this;
- }
- auto operator + ( Column const& col ) -> Columns {
- Columns combined = *this;
- combined += col;
- return combined;
- }
-
- inline friend std::ostream& operator << ( std::ostream& os, Columns const& cols ) {
-
- bool first = true;
- for( auto line : cols ) {
- if( first )
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
- };
-
- inline auto Column::operator + ( Column const& other ) -> Columns {
- Columns cols;
- cols += *this;
- cols += other;
- return cols;
- }
-}}
-
-#endif // CLARA_TEXTFLOW_HPP_INCLUDED
-
-// ----------- end of #include from clara_textflow.hpp -----------
-// ........... back in clara.hpp
-
-
-#include <memory>
-#include <set>
-#include <algorithm>
-
-#if !defined(CLARA_PLATFORM_WINDOWS) && ( defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) )
-#define CLARA_PLATFORM_WINDOWS
-#endif
-
-namespace clara {
-namespace detail {
-
- // Traits for extracting arg and return type of lambdas (for single argument lambdas)
- template<typename L>
- struct UnaryLambdaTraits : UnaryLambdaTraits<decltype( &L::operator() )> {};
-
- template<typename ClassT, typename ReturnT, typename... Args>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( Args... ) const> {
- static const bool isValid = false;
- };
-
- template<typename ClassT, typename ReturnT, typename ArgT>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( ArgT ) const> {
- static const bool isValid = true;
- using ArgType = typename std::remove_const<typename std::remove_reference<ArgT>::type>::type;
- using ReturnType = ReturnT;
- };
-
- class TokenStream;
-
- // Transport for raw args (copied from main args, or supplied via init list for testing)
- class Args {
- friend TokenStream;
- std::string m_exeName;
- std::vector<std::string> m_args;
-
- public:
- Args( int argc, char const* const* argv )
- : m_exeName(argv[0]),
- m_args(argv + 1, argv + argc) {}
-
- Args( std::initializer_list<std::string> args )
- : m_exeName( *args.begin() ),
- m_args( args.begin()+1, args.end() )
- {}
-
- auto exeName() const -> std::string {
- return m_exeName;
- }
- };
-
- // Wraps a token coming from a token stream. These may not directly correspond to strings as a single string
- // may encode an option + its argument if the : or = form is used
- enum class TokenType {
- Option, Argument
- };
- struct Token {
- TokenType type;
- std::string token;
- };
-
- inline auto isOptPrefix( char c ) -> bool {
- return c == '-'
-#ifdef CLARA_PLATFORM_WINDOWS
- || c == '/'
-#endif
- ;
- }
-
- // Abstracts iterators into args as a stream of tokens, with option arguments uniformly handled
- class TokenStream {
- using Iterator = std::vector<std::string>::const_iterator;
- Iterator it;
- Iterator itEnd;
- std::vector<Token> m_tokenBuffer;
-
- void loadBuffer() {
- m_tokenBuffer.resize( 0 );
-
- // Skip any empty strings
- while( it != itEnd && it->empty() )
- ++it;
-
- if( it != itEnd ) {
- auto const &next = *it;
- if( isOptPrefix( next[0] ) ) {
- auto delimiterPos = next.find_first_of( " :=" );
- if( delimiterPos != std::string::npos ) {
- m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
- m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
- } else {
- if( next[1] != '-' && next.size() > 2 ) {
- std::string opt = "- ";
- for( size_t i = 1; i < next.size(); ++i ) {
- opt[1] = next[i];
- m_tokenBuffer.push_back( { TokenType::Option, opt } );
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Option, next } );
- }
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Argument, next } );
- }
- }
- }
-
- public:
- explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {}
-
- TokenStream( Iterator it, Iterator itEnd ) : it( it ), itEnd( itEnd ) {
- loadBuffer();
- }
-
- explicit operator bool() const {
- return !m_tokenBuffer.empty() || it != itEnd;
- }
-
- auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); }
-
- auto operator*() const -> Token {
- assert( !m_tokenBuffer.empty() );
- return m_tokenBuffer.front();
- }
-
- auto operator->() const -> Token const * {
- assert( !m_tokenBuffer.empty() );
- return &m_tokenBuffer.front();
- }
-
- auto operator++() -> TokenStream & {
- if( m_tokenBuffer.size() >= 2 ) {
- m_tokenBuffer.erase( m_tokenBuffer.begin() );
- } else {
- if( it != itEnd )
- ++it;
- loadBuffer();
- }
- return *this;
- }
- };
-
-
- class ResultBase {
- public:
- enum Type {
- Ok, LogicError, RuntimeError
- };
-
- protected:
- ResultBase( Type type ) : m_type( type ) {}
- virtual ~ResultBase() = default;
-
- virtual void enforceOk() const = 0;
-
- Type m_type;
- };
-
- template<typename T>
- class ResultValueBase : public ResultBase {
- public:
- auto value() const -> T const & {
- enforceOk();
- return m_value;
- }
-
- protected:
- ResultValueBase( Type type ) : ResultBase( type ) {}
-
- ResultValueBase( ResultValueBase const &other ) : ResultBase( other ) {
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- }
-
- ResultValueBase( Type, T const &value ) : ResultBase( Ok ) {
- new( &m_value ) T( value );
- }
-
- auto operator=( ResultValueBase const &other ) -> ResultValueBase & {
- if( m_type == ResultBase::Ok )
- m_value.~T();
- ResultBase::operator=(other);
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- return *this;
- }
-
- ~ResultValueBase() override {
- if( m_type == Ok )
- m_value.~T();
- }
-
- union {
- T m_value;
- };
- };
-
- template<>
- class ResultValueBase<void> : public ResultBase {
- protected:
- using ResultBase::ResultBase;
- };
-
- template<typename T = void>
- class BasicResult : public ResultValueBase<T> {
- public:
- template<typename U>
- explicit BasicResult( BasicResult<U> const &other )
- : ResultValueBase<T>( other.type() ),
- m_errorMessage( other.errorMessage() )
- {
- assert( type() != ResultBase::Ok );
- }
-
- template<typename U>
- static auto ok( U const &value ) -> BasicResult { return { ResultBase::Ok, value }; }
- static auto ok() -> BasicResult { return { ResultBase::Ok }; }
- static auto logicError( std::string const &message ) -> BasicResult { return { ResultBase::LogicError, message }; }
- static auto runtimeError( std::string const &message ) -> BasicResult { return { ResultBase::RuntimeError, message }; }
-
- explicit operator bool() const { return m_type == ResultBase::Ok; }
- auto type() const -> ResultBase::Type { return m_type; }
- auto errorMessage() const -> std::string { return m_errorMessage; }
-
- protected:
- void enforceOk() const override {
-
- // Errors shouldn't reach this point, but if they do
- // the actual error message will be in m_errorMessage
- assert( m_type != ResultBase::LogicError );
- assert( m_type != ResultBase::RuntimeError );
- if( m_type != ResultBase::Ok )
- std::abort();
- }
-
- std::string m_errorMessage; // Only populated if resultType is an error
-
- BasicResult( ResultBase::Type type, std::string const &message )
- : ResultValueBase<T>(type),
- m_errorMessage(message)
- {
- assert( m_type != ResultBase::Ok );
- }
-
- using ResultValueBase<T>::ResultValueBase;
- using ResultBase::m_type;
- };
-
- enum class ParseResultType {
- Matched, NoMatch, ShortCircuitAll, ShortCircuitSame
- };
-
- class ParseState {
- public:
-
- ParseState( ParseResultType type, TokenStream const &remainingTokens )
- : m_type(type),
- m_remainingTokens( remainingTokens )
- {}
-
- auto type() const -> ParseResultType { return m_type; }
- auto remainingTokens() const -> TokenStream { return m_remainingTokens; }
-
- private:
- ParseResultType m_type;
- TokenStream m_remainingTokens;
- };
-
- using Result = BasicResult<void>;
- using ParserResult = BasicResult<ParseResultType>;
- using InternalParseResult = BasicResult<ParseState>;
-
- struct HelpColumns {
- std::string left;
- std::string right;
- };
-
- template<typename T>
- inline auto convertInto( std::string const &source, T& target ) -> ParserResult {
- std::stringstream ss;
- ss << source;
- ss >> target;
- if( ss.fail() )
- return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult {
- target = source;
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, bool &target ) -> ParserResult {
- std::string srcLC = source;
- std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( ::tolower(c) ); } );
- if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on")
- target = true;
- else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off")
- target = false;
- else
- return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- }
-#ifdef CLARA_CONFIG_OPTIONAL_TYPE
- template<typename T>
- inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> ParserResult {
- T temp;
- auto result = convertInto( source, temp );
- if( result )
- target = std::move(temp);
- return result;
- }
-#endif // CLARA_CONFIG_OPTIONAL_TYPE
-
- struct NonCopyable {
- NonCopyable() = default;
- NonCopyable( NonCopyable const & ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable &operator=( NonCopyable const & ) = delete;
- NonCopyable &operator=( NonCopyable && ) = delete;
- };
-
- struct BoundRef : NonCopyable {
- virtual ~BoundRef() = default;
- virtual auto isContainer() const -> bool { return false; }
- virtual auto isFlag() const -> bool { return false; }
- };
- struct BoundValueRefBase : BoundRef {
- virtual auto setValue( std::string const &arg ) -> ParserResult = 0;
- };
- struct BoundFlagRefBase : BoundRef {
- virtual auto setFlag( bool flag ) -> ParserResult = 0;
- virtual auto isFlag() const -> bool { return true; }
- };
-
- template<typename T>
- struct BoundValueRef : BoundValueRefBase {
- T &m_ref;
-
- explicit BoundValueRef( T &ref ) : m_ref( ref ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return convertInto( arg, m_ref );
- }
- };
-
- template<typename T>
- struct BoundValueRef<std::vector<T>> : BoundValueRefBase {
- std::vector<T> &m_ref;
-
- explicit BoundValueRef( std::vector<T> &ref ) : m_ref( ref ) {}
-
- auto isContainer() const -> bool override { return true; }
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- T temp;
- auto result = convertInto( arg, temp );
- if( result )
- m_ref.push_back( temp );
- return result;
- }
- };
-
- struct BoundFlagRef : BoundFlagRefBase {
- bool &m_ref;
-
- explicit BoundFlagRef( bool &ref ) : m_ref( ref ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- m_ref = flag;
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ReturnType>
- struct LambdaInvoker {
- static_assert( std::is_same<ReturnType, ParserResult>::value, "Lambda must return void or clara::ParserResult" );
-
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- return lambda( arg );
- }
- };
-
- template<>
- struct LambdaInvoker<void> {
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- lambda( arg );
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ArgType, typename L>
- inline auto invokeLambda( L const &lambda, std::string const &arg ) -> ParserResult {
- ArgType temp{};
- auto result = convertInto( arg, temp );
- return !result
- ? result
- : LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( lambda, temp );
- }
-
-
- template<typename L>
- struct BoundLambda : BoundValueRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- explicit BoundLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return invokeLambda<typename UnaryLambdaTraits<L>::ArgType>( m_lambda, arg );
- }
- };
-
- template<typename L>
- struct BoundFlagLambda : BoundFlagRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- static_assert( std::is_same<typename UnaryLambdaTraits<L>::ArgType, bool>::value, "flags must be boolean" );
-
- explicit BoundFlagLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- return LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( m_lambda, flag );
- }
- };
-
- enum class Optionality { Optional, Required };
-
- struct Parser;
-
- class ParserBase {
- public:
- virtual ~ParserBase() = default;
- virtual auto validate() const -> Result { return Result::ok(); }
- virtual auto parse( std::string const& exeName, TokenStream const &tokens) const -> InternalParseResult = 0;
- virtual auto cardinality() const -> size_t { return 1; }
-
- auto parse( Args const &args ) const -> InternalParseResult {
- return parse( args.exeName(), TokenStream( args ) );
- }
- };
-
- template<typename DerivedT>
- class ComposableParserImpl : public ParserBase {
- public:
- template<typename T>
- auto operator|( T const &other ) const -> Parser;
-
- template<typename T>
- auto operator+( T const &other ) const -> Parser;
- };
-
- // Common code and state for Args and Opts
- template<typename DerivedT>
- class ParserRefImpl : public ComposableParserImpl<DerivedT> {
- protected:
- Optionality m_optionality = Optionality::Optional;
- std::shared_ptr<BoundRef> m_ref;
- std::string m_hint;
- std::string m_description;
-
- explicit ParserRefImpl( std::shared_ptr<BoundRef> const &ref ) : m_ref( ref ) {}
-
- public:
- template<typename T>
- ParserRefImpl( T &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundValueRef<T>>( ref ) ),
- m_hint( hint )
- {}
-
- template<typename LambdaT>
- ParserRefImpl( LambdaT const &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ),
- m_hint(hint)
- {}
-
- auto operator()( std::string const &description ) -> DerivedT & {
- m_description = description;
- return static_cast<DerivedT &>( *this );
- }
-
- auto optional() -> DerivedT & {
- m_optionality = Optionality::Optional;
- return static_cast<DerivedT &>( *this );
- };
-
- auto required() -> DerivedT & {
- m_optionality = Optionality::Required;
- return static_cast<DerivedT &>( *this );
- };
-
- auto isOptional() const -> bool {
- return m_optionality == Optionality::Optional;
- }
-
- auto cardinality() const -> size_t override {
- if( m_ref->isContainer() )
- return 0;
- else
- return 1;
- }
-
- auto hint() const -> std::string { return m_hint; }
- };
-
- class ExeName : public ComposableParserImpl<ExeName> {
- std::shared_ptr<std::string> m_name;
- std::shared_ptr<BoundValueRefBase> m_ref;
-
- template<typename LambdaT>
- static auto makeRef(LambdaT const &lambda) -> std::shared_ptr<BoundValueRefBase> {
- return std::make_shared<BoundLambda<LambdaT>>( lambda) ;
- }
-
- public:
- ExeName() : m_name( std::make_shared<std::string>( "<executable>" ) ) {}
-
- explicit ExeName( std::string &ref ) : ExeName() {
- m_ref = std::make_shared<BoundValueRef<std::string>>( ref );
- }
-
- template<typename LambdaT>
- explicit ExeName( LambdaT const& lambda ) : ExeName() {
- m_ref = std::make_shared<BoundLambda<LambdaT>>( lambda );
- }
-
- // The exe name is not parsed out of the normal tokens, but is handled specially
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- }
-
- auto name() const -> std::string { return *m_name; }
- auto set( std::string const& newName ) -> ParserResult {
-
- auto lastSlash = newName.find_last_of( "\\/" );
- auto filename = ( lastSlash == std::string::npos )
- ? newName
- : newName.substr( lastSlash+1 );
-
- *m_name = filename;
- if( m_ref )
- return m_ref->setValue( filename );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- class Arg : public ParserRefImpl<Arg> {
- public:
- using ParserRefImpl::ParserRefImpl;
-
- auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- auto const &token = *remainingTokens;
- if( token.type != TokenType::Argument )
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
-
- assert( !m_ref->isFlag() );
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
-
- auto result = valueRef->setValue( remainingTokens->token );
- if( !result )
- return InternalParseResult( result );
- else
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- };
-
- inline auto normaliseOpt( std::string const &optName ) -> std::string {
-#ifdef CLARA_PLATFORM_WINDOWS
- if( optName[0] == '/' )
- return "-" + optName.substr( 1 );
- else
-#endif
- return optName;
- }
-
- class Opt : public ParserRefImpl<Opt> {
- protected:
- std::vector<std::string> m_optNames;
-
- public:
- template<typename LambdaT>
- explicit Opt( LambdaT const &ref ) : ParserRefImpl( std::make_shared<BoundFlagLambda<LambdaT>>( ref ) ) {}
-
- explicit Opt( bool &ref ) : ParserRefImpl( std::make_shared<BoundFlagRef>( ref ) ) {}
-
- template<typename LambdaT>
- Opt( LambdaT const &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- template<typename T>
- Opt( T &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- auto operator[]( std::string const &optName ) -> Opt & {
- m_optNames.push_back( optName );
- return *this;
- }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::ostringstream oss;
- bool first = true;
- for( auto const &opt : m_optNames ) {
- if (first)
- first = false;
- else
- oss << ", ";
- oss << opt;
- }
- if( !m_hint.empty() )
- oss << " <" << m_hint << ">";
- return { { oss.str(), m_description } };
- }
-
- auto isMatch( std::string const &optToken ) const -> bool {
- auto normalisedToken = normaliseOpt( optToken );
- for( auto const &name : m_optNames ) {
- if( normaliseOpt( name ) == normalisedToken )
- return true;
- }
- return false;
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- if( remainingTokens && remainingTokens->type == TokenType::Option ) {
- auto const &token = *remainingTokens;
- if( isMatch(token.token ) ) {
- if( m_ref->isFlag() ) {
- auto flagRef = static_cast<detail::BoundFlagRefBase*>( m_ref.get() );
- auto result = flagRef->setFlag( true );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- } else {
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
- ++remainingTokens;
- if( !remainingTokens )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto const &argToken = *remainingTokens;
- if( argToken.type != TokenType::Argument )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto result = valueRef->setValue( argToken.token );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- }
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- }
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
- }
-
- auto validate() const -> Result override {
- if( m_optNames.empty() )
- return Result::logicError( "No options supplied to Opt" );
- for( auto const &name : m_optNames ) {
- if( name.empty() )
- return Result::logicError( "Option name cannot be empty" );
-#ifdef CLARA_PLATFORM_WINDOWS
- if( name[0] != '-' && name[0] != '/' )
- return Result::logicError( "Option name must begin with '-' or '/'" );
-#else
- if( name[0] != '-' )
- return Result::logicError( "Option name must begin with '-'" );
-#endif
- }
- return ParserRefImpl::validate();
- }
- };
-
- struct Help : Opt {
- Help( bool &showHelpFlag )
- : Opt([&]( bool flag ) {
- showHelpFlag = flag;
- return ParserResult::ok( ParseResultType::ShortCircuitAll );
- })
- {
- static_cast<Opt &>( *this )
- ("display usage information")
- ["-?"]["-h"]["--help"]
- .optional();
- }
- };
-
-
- struct Parser : ParserBase {
-
- mutable ExeName m_exeName;
- std::vector<Opt> m_options;
- std::vector<Arg> m_args;
-
- auto operator|=( ExeName const &exeName ) -> Parser & {
- m_exeName = exeName;
- return *this;
- }
-
- auto operator|=( Arg const &arg ) -> Parser & {
- m_args.push_back(arg);
- return *this;
- }
-
- auto operator|=( Opt const &opt ) -> Parser & {
- m_options.push_back(opt);
- return *this;
- }
-
- auto operator|=( Parser const &other ) -> Parser & {
- m_options.insert(m_options.end(), other.m_options.begin(), other.m_options.end());
- m_args.insert(m_args.end(), other.m_args.begin(), other.m_args.end());
- return *this;
- }
-
- template<typename T>
- auto operator|( T const &other ) const -> Parser {
- return Parser( *this ) |= other;
- }
-
- // Forward deprecated interface with '+' instead of '|'
- template<typename T>
- auto operator+=( T const &other ) -> Parser & { return operator|=( other ); }
- template<typename T>
- auto operator+( T const &other ) const -> Parser { return operator|( other ); }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::vector<HelpColumns> cols;
- for (auto const &o : m_options) {
- auto childCols = o.getHelpColumns();
- cols.insert( cols.end(), childCols.begin(), childCols.end() );
- }
- return cols;
- }
-
- void writeToStream( std::ostream &os ) const {
- if (!m_exeName.name().empty()) {
- os << "usage:\n" << " " << m_exeName.name() << " ";
- bool required = true, first = true;
- for( auto const &arg : m_args ) {
- if (first)
- first = false;
- else
- os << " ";
- if( arg.isOptional() && required ) {
- os << "[";
- required = false;
- }
- os << "<" << arg.hint() << ">";
- if( arg.cardinality() == 0 )
- os << " ... ";
- }
- if( !required )
- os << "]";
- if( !m_options.empty() )
- os << " options";
- os << "\n\nwhere options are:" << std::endl;
- }
-
- auto rows = getHelpColumns();
- size_t consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH;
- size_t optWidth = 0;
- for( auto const &cols : rows )
- optWidth = (std::max)(optWidth, cols.left.size() + 2);
-
- optWidth = (std::min)(optWidth, consoleWidth/2);
-
- for( auto const &cols : rows ) {
- auto row =
- TextFlow::Column( cols.left ).width( optWidth ).indent( 2 ) +
- TextFlow::Spacer(4) +
- TextFlow::Column( cols.right ).width( consoleWidth - 7 - optWidth );
- os << row << std::endl;
- }
- }
-
- friend auto operator<<( std::ostream &os, Parser const &parser ) -> std::ostream& {
- parser.writeToStream( os );
- return os;
- }
-
- auto validate() const -> Result override {
- for( auto const &opt : m_options ) {
- auto result = opt.validate();
- if( !result )
- return result;
- }
- for( auto const &arg : m_args ) {
- auto result = arg.validate();
- if( !result )
- return result;
- }
- return Result::ok();
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const& exeName, TokenStream const &tokens ) const -> InternalParseResult override {
-
- struct ParserInfo {
- ParserBase const* parser = nullptr;
- size_t count = 0;
- };
- const size_t totalParsers = m_options.size() + m_args.size();
- assert( totalParsers < 512 );
- // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
- ParserInfo parseInfos[512];
-
- {
- size_t i = 0;
- for (auto const &opt : m_options) parseInfos[i++].parser = &opt;
- for (auto const &arg : m_args) parseInfos[i++].parser = &arg;
- }
-
- m_exeName.set( exeName );
-
- auto result = InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- while( result.value().remainingTokens() ) {
- bool tokenParsed = false;
-
- for( size_t i = 0; i < totalParsers; ++i ) {
- auto& parseInfo = parseInfos[i];
- if( parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality() ) {
- result = parseInfo.parser->parse(exeName, result.value().remainingTokens());
- if (!result)
- return result;
- if (result.value().type() != ParseResultType::NoMatch) {
- tokenParsed = true;
- ++parseInfo.count;
- break;
- }
- }
- }
-
- if( result.value().type() == ParseResultType::ShortCircuitAll )
- return result;
- if( !tokenParsed )
- return InternalParseResult::runtimeError( "Unrecognised token: " + result.value().remainingTokens()->token );
- }
- // !TBD Check missing required options
- return result;
- }
- };
-
- template<typename DerivedT>
- template<typename T>
- auto ComposableParserImpl<DerivedT>::operator|( T const &other ) const -> Parser {
- return Parser() | static_cast<DerivedT const &>( *this ) | other;
- }
-} // namespace detail
-
-
-// A Combined parser
-using detail::Parser;
-
-// A parser for options
-using detail::Opt;
-
-// A parser for arguments
-using detail::Arg;
-
-// Wrapper for argc, argv from main()
-using detail::Args;
-
-// Specifies the name of the executable
-using detail::ExeName;
-
-// Convenience wrapper for option parser that specifies the help option
-using detail::Help;
-
-// enum of result types from a parse
-using detail::ParseResultType;
-
-// Result type for parser operation
-using detail::ParserResult;
-
-
-} // namespace clara
-
-#endif // CLARA_HPP_INCLUDED