From 8a1fd5ded4230d6e9b9bf69951058fc12a19ad4a Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Sun, 4 Sep 2022 01:18:42 +0200 Subject: [PATCH] git subrepo pull --force packages/Catch2 subrepo: subdir: "packages/Catch2" merged: "7b2e7d623" upstream: origin: "git@github.com:catchorg/Catch2.git" branch: "devel" commit: "7b2e7d623" git-subrepo: version: "0.4.3" origin: "git@github.com:ingydotnet/git-subrepo.git" commit: "2f68596" --- packages/Catch2/.bazelrc | 4 + packages/Catch2/.github/FUNDING.yml | 1 + .../.github/workflows/linux-other-builds.yml | 19 +- .../Catch2/.github/workflows/mac-builds.yml | 4 +- packages/Catch2/.gitignore | 13 +- packages/Catch2/.gitrepo | 4 +- packages/Catch2/BUILD.bazel | 86 +- .../Catch2/CMake/CatchConfigOptions.cmake | 77 + ...nctions.cmake => CatchMiscFunctions.cmake} | 73 +- packages/Catch2/CMake/catch2-with-main.pc.in | 2 +- packages/Catch2/CMakeLists.txt | 59 +- packages/Catch2/CMakePresets.json | 25 + packages/Catch2/README.md | 29 +- packages/Catch2/SECURITY.md | 19 + packages/Catch2/WORKSPACE | 14 + packages/Catch2/appveyor.yml | 3 +- packages/Catch2/conanfile.py | 9 +- packages/Catch2/docs/Readme.md | 4 +- packages/Catch2/docs/benchmarks.md | 3 +- packages/Catch2/docs/ci-and-misc.md | 31 +- packages/Catch2/docs/cmake-integration.md | 80 +- packages/Catch2/docs/command-line.md | 265 +- packages/Catch2/docs/commercial-users.md | 1 + packages/Catch2/docs/configuration.md | 42 +- packages/Catch2/docs/contributing.md | 35 +- packages/Catch2/docs/deprecations.md | 15 +- packages/Catch2/docs/event-listeners.md | 91 +- packages/Catch2/docs/faq.md | 63 + packages/Catch2/docs/generators.md | 2 +- packages/Catch2/docs/limitations.md | 62 +- packages/Catch2/docs/list-of-examples.md | 1 - packages/Catch2/docs/matchers.md | 26 +- packages/Catch2/docs/migrate-v2-to-v3.md | 25 +- packages/Catch2/docs/opensource-users.md | 12 + packages/Catch2/docs/other-macros.md | 20 +- packages/Catch2/docs/own-main.md | 99 +- packages/Catch2/docs/release-notes.md | 125 +- packages/Catch2/docs/release-process.md | 22 +- packages/Catch2/docs/reporter-events.md | 175 + packages/Catch2/docs/reporters.md | 216 +- .../Catch2/docs/test-cases-and-sections.md | 19 +- packages/Catch2/docs/test-fixtures.md | 33 +- packages/Catch2/docs/tutorial.md | 98 +- packages/Catch2/docs/usage-tips.md | 100 + packages/Catch2/examples/000-CatchMain.cpp | 13 - packages/Catch2/examples/010-TestCase.cpp | 2 +- packages/Catch2/examples/020-TestCase-1.cpp | 4 +- .../Catch2/examples/030-Asn-Require-Check.cpp | 6 +- packages/Catch2/examples/100-Fix-Section.cpp | 6 +- .../Catch2/examples/110-Fix-ClassFixture.cpp | 9 +- .../120-Bdd-ScenarioGivenWhenThen.cpp | 6 +- .../examples/210-Evt-EventListeners.cpp | 10 +- packages/Catch2/extras/Catch.cmake | 16 +- packages/Catch2/extras/CatchAddTests.cmake | 30 + packages/Catch2/extras/CatchShardTests.cmake | 66 + .../Catch2/extras/CatchShardTestsImpl.cmake | 52 + packages/Catch2/extras/catch_amalgamated.cpp | 5644 ++-- packages/Catch2/extras/catch_amalgamated.hpp | 5214 ++-- packages/Catch2/src/CMakeLists.txt | 133 +- .../src/catch2/benchmark/catch_benchmark.hpp | 7 +- .../catch2/benchmark/catch_chronometer.cpp | 17 + .../catch2/benchmark/catch_constructor.hpp | 18 +- .../catch2/benchmark/detail/catch_analyse.hpp | 4 +- .../detail/catch_benchmark_function.cpp | 17 + .../benchmark/detail/catch_estimate_clock.hpp | 6 +- .../detail/catch_run_for_at_least.cpp | 30 + .../catch2/benchmark/detail/catch_stats.cpp | 36 +- .../catch2/benchmark/detail/catch_stats.hpp | 25 +- .../internal/catch_benchmark_combined_tu.cpp | 75 - packages/Catch2/src/catch2/catch_all.hpp | 15 +- packages/Catch2/src/catch2/catch_approx.cpp | 3 +- packages/Catch2/src/catch2/catch_approx.hpp | 4 +- .../src/catch2/catch_assertion_result.cpp | 2 +- packages/Catch2/src/catch2/catch_config.cpp | 138 +- packages/Catch2/src/catch2/catch_config.hpp | 71 +- .../src/catch2/catch_get_random_seed.cpp | 18 + .../src/catch2/catch_get_random_seed.hpp | 18 + packages/Catch2/src/catch2/catch_message.hpp | 2 +- .../Catch2/src/catch2/catch_registry_hub.cpp | 2 +- .../src/catch2/catch_reporter_registrars.hpp | 83 - packages/Catch2/src/catch2/catch_session.cpp | 149 +- .../catch2/catch_tag_alias_autoregistrar.cpp | 24 + .../src/catch2/catch_test_case_info.cpp | 35 +- .../src/catch2/catch_test_case_info.hpp | 31 +- .../Catch2/src/catch2/catch_test_macros.hpp | 14 +- .../Catch2/src/catch2/catch_test_spec.cpp | 14 +- .../Catch2/src/catch2/catch_test_spec.hpp | 6 +- packages/Catch2/src/catch2/catch_timer.cpp | 42 +- packages/Catch2/src/catch2/catch_timer.hpp | 3 - packages/Catch2/src/catch2/catch_tostring.hpp | 40 +- packages/Catch2/src/catch2/catch_totals.cpp | 2 +- packages/Catch2/src/catch2/catch_totals.hpp | 11 +- .../src/catch2/catch_translate_exception.hpp | 2 +- .../src/catch2/catch_user_config.hpp.in | 198 + packages/Catch2/src/catch2/catch_version.cpp | 2 +- .../src/catch2/catch_version_macros.hpp | 2 +- .../generators/catch_generator_exception.cpp | 17 + ...s_combined_tu.cpp => catch_generators.cpp} | 30 - .../catch2/generators/catch_generators.hpp | 12 +- .../generators/catch_generators_random.cpp | 13 + .../generators/catch_generators_random.hpp | 37 +- .../interfaces/catch_interfaces_capture.cpp | 13 + .../interfaces/catch_interfaces_capture.hpp | 8 +- .../catch_interfaces_combined_tu.cpp | 88 - .../interfaces/catch_interfaces_config.cpp | 13 + .../interfaces/catch_interfaces_config.hpp | 35 +- .../catch_interfaces_enum_values_registry.hpp | 3 +- .../interfaces/catch_interfaces_exception.cpp | 14 + .../interfaces/catch_interfaces_exception.hpp | 9 +- .../catch_interfaces_generatortracker.cpp | 32 + .../catch_interfaces_generatortracker.hpp | 57 +- .../catch_interfaces_registry_hub.cpp | 14 + .../catch_interfaces_registry_hub.hpp | 25 +- .../interfaces/catch_interfaces_reporter.cpp | 32 +- .../interfaces/catch_interfaces_reporter.hpp | 77 +- .../catch_interfaces_reporter_factory.cpp | 14 + .../catch_interfaces_reporter_factory.hpp | 23 +- .../catch_interfaces_reporter_registry.cpp | 13 + .../catch_interfaces_reporter_registry.hpp | 20 +- .../catch_interfaces_tag_alias_registry.hpp | 3 +- .../interfaces/catch_interfaces_testcase.cpp | 14 + .../interfaces/catch_interfaces_testcase.hpp | 8 +- .../internal/catch_assertion_handler.hpp | 6 +- .../catch_case_insensitive_comparisons.cpp | 35 + .../catch_case_insensitive_comparisons.hpp | 30 + .../src/catch2/internal/catch_clara.cpp | 9 +- .../src/catch2/internal/catch_clara.hpp | 82 +- .../src/catch2/internal/catch_combined_tu.cpp | 237 - .../src/catch2/internal/catch_commandline.cpp | 226 +- .../internal/catch_compiler_capabilities.hpp | 32 +- .../catch_config_android_logwrite.hpp | 2 + .../catch2/internal/catch_console_colour.cpp | 282 +- .../catch2/internal/catch_console_colour.hpp | 90 +- .../catch2/internal/catch_console_width.hpp | 6 +- .../src/catch2/internal/catch_context.cpp | 2 +- .../src/catch2/internal/catch_context.hpp | 16 +- .../catch2/internal/catch_debug_console.cpp | 7 +- .../src/catch2/internal/catch_debugger.cpp | 2 +- .../src/catch2/internal/catch_debugger.hpp | 2 +- .../src/catch2/internal/catch_decomposer.cpp | 23 + .../src/catch2/internal/catch_decomposer.hpp | 8 +- .../src/catch2/internal/catch_enforce.cpp | 1 + .../src/catch2/internal/catch_enforce.hpp | 2 +- .../internal/catch_enum_values_registry.cpp | 1 - .../src/catch2/internal/catch_errno_guard.cpp | 16 + .../catch_fatal_condition_handler.cpp | 36 +- .../catch_fatal_condition_handler.hpp | 4 +- .../internal/catch_floating_point_helpers.hpp | 15 + .../{catch_stream.cpp => catch_istream.cpp} | 110 +- .../src/catch2/internal/catch_istream.hpp | 54 + .../src/catch2/internal/catch_lazy_expr.cpp | 29 + .../src/catch2/internal/catch_lazy_expr.hpp | 2 +- .../catch2/internal/catch_leak_detector.cpp | 38 + .../Catch2/src/catch2/internal/catch_list.cpp | 32 +- .../Catch2/src/catch2/internal/catch_list.hpp | 8 +- .../Catch2/src/catch2/internal/catch_main.cpp | 7 +- .../catch2/internal/catch_message_info.cpp | 25 + .../internal/catch_move_and_forward.hpp | 4 +- .../{catch_option.hpp => catch_optional.hpp} | 55 +- .../catch2/internal/catch_output_redirect.cpp | 1 + .../catch2/internal/catch_output_redirect.hpp | 3 +- .../src/catch2/internal/catch_platform.hpp | 4 + .../src/catch2/internal/catch_polyfills.cpp | 34 + .../catch2/internal/catch_preprocessor.hpp | 7 +- .../catch_preprocessor_remove_parens.hpp | 19 + .../internal/catch_random_seed_generation.cpp | 34 + .../internal/catch_random_seed_generation.hpp | 26 + .../internal/catch_reporter_registry.cpp | 27 +- .../internal/catch_reporter_registry.hpp | 4 +- .../internal/catch_reporter_spec_parser.cpp | 173 + .../internal/catch_reporter_spec_parser.hpp | 85 + .../internal/catch_reusable_string_stream.cpp | 62 + ...m.hpp => catch_reusable_string_stream.hpp} | 18 +- .../src/catch2/internal/catch_run_context.cpp | 54 +- .../src/catch2/internal/catch_run_context.hpp | 14 +- .../src/catch2/internal/catch_sharding.hpp | 41 + .../catch_startup_exception_registry.cpp | 29 + .../src/catch2/internal/catch_stdstreams.cpp | 24 + .../src/catch2/internal/catch_stdstreams.hpp | 22 + .../catch2/internal/catch_string_manip.cpp | 16 +- .../catch2/internal/catch_string_manip.hpp | 14 +- .../src/catch2/internal/catch_stringref.cpp | 33 +- .../src/catch2/internal/catch_stringref.hpp | 20 +- .../internal/catch_tag_alias_registry.hpp | 1 + .../internal/catch_template_test_registry.hpp | 28 +- .../internal/catch_test_case_info_hasher.cpp | 39 + .../internal/catch_test_case_info_hasher.hpp | 29 + .../catch_test_case_registry_impl.cpp | 34 +- .../catch_test_case_registry_impl.hpp | 2 +- .../catch2/internal/catch_test_macro_impl.hpp | 10 +- .../catch2/internal/catch_test_registry.cpp | 39 +- .../catch2/internal/catch_test_registry.hpp | 5 + .../internal/catch_test_spec_parser.cpp | 2 +- .../internal/catch_test_spec_parser.hpp | 2 +- .../src/catch2/internal/catch_textflow.cpp | 99 +- .../src/catch2/internal/catch_textflow.hpp | 60 +- .../src/catch2/internal/catch_to_string.hpp | 2 +- .../internal/catch_uncaught_exceptions.cpp | 26 + .../src/catch2/internal/catch_unique_ptr.hpp | 21 +- .../src/catch2/internal/catch_void_type.hpp | 25 + .../catch2/internal/catch_windows_h_proxy.hpp | 15 +- .../src/catch2/internal/catch_xmlwriter.cpp | 17 +- .../src/catch2/internal/catch_xmlwriter.hpp | 11 +- .../src/catch2/matchers/catch_matchers.cpp | 25 + .../src/catch2/matchers/catch_matchers.hpp | 40 +- .../catch_matchers_container_properties.cpp | 34 + .../catch_matchers_container_properties.hpp | 1 - .../matchers/catch_matchers_exception.cpp | 26 + .../catch_matchers_floating_point.cpp | 20 +- .../catch_matchers_floating_point.hpp | 15 +- .../matchers/catch_matchers_predicate.cpp | 17 + .../matchers/catch_matchers_quantifiers.cpp | 24 + .../matchers/catch_matchers_quantifiers.hpp | 59 +- .../catch2/matchers/catch_matchers_string.cpp | 14 +- .../catch2/matchers/catch_matchers_string.hpp | 37 +- .../matchers/catch_matchers_templated.cpp | 2 +- .../matchers/catch_matchers_templated.hpp | 30 +- .../catch2/matchers/catch_matchers_vector.hpp | 33 +- .../internal/catch_matchers_combined_tu.cpp | 135 - .../matchers/internal/catch_matchers_impl.cpp | 25 + .../matchers/internal/catch_matchers_impl.hpp | 2 +- .../reporters/catch_reporter_automake.cpp | 12 +- .../reporters/catch_reporter_automake.hpp | 15 +- .../reporters/catch_reporter_common_base.cpp | 49 + .../reporters/catch_reporter_common_base.hpp | 79 + .../reporters/catch_reporter_compact.cpp | 77 +- .../reporters/catch_reporter_compact.hpp | 6 +- .../reporters/catch_reporter_console.cpp | 218 +- .../reporters/catch_reporter_console.hpp | 12 +- .../catch_reporter_cumulative_base.cpp | 69 +- .../catch_reporter_cumulative_base.hpp | 86 +- .../catch_reporter_event_listener.cpp | 40 + .../catch_reporter_event_listener.hpp | 16 +- ...ined_tu.cpp => catch_reporter_helpers.cpp} | 85 +- .../reporters/catch_reporter_helpers.hpp | 11 +- .../catch2/reporters/catch_reporter_junit.cpp | 87 +- .../catch2/reporters/catch_reporter_junit.hpp | 5 +- .../reporters/catch_reporter_listening.cpp | 175 - .../catch2/reporters/catch_reporter_multi.cpp | 198 + ...listening.hpp => catch_reporter_multi.hpp} | 41 +- .../reporters/catch_reporter_registrars.cpp | 30 + .../reporters/catch_reporter_registrars.hpp | 132 + .../reporters/catch_reporter_sonarqube.cpp | 23 +- .../reporters/catch_reporter_sonarqube.hpp | 12 +- .../catch_reporter_streaming_base.cpp | 17 - .../catch_reporter_streaming_base.hpp | 47 +- .../catch2/reporters/catch_reporter_tap.cpp | 57 +- .../catch2/reporters/catch_reporter_tap.hpp | 11 +- .../reporters/catch_reporter_teamcity.cpp | 23 +- .../reporters/catch_reporter_teamcity.hpp | 8 +- .../catch2/reporters/catch_reporter_xml.cpp | 31 +- .../catch2/reporters/catch_reporter_xml.hpp | 3 +- .../catch2/reporters/catch_reporters_all.hpp | 4 +- packages/Catch2/tests/CMakeLists.txt | 272 +- .../Catch2/tests/ExtraTests/CMakeLists.txt | 239 + .../tests/ExtraTests/X01-PrefixedMacros.cpp | 22 +- .../tests/ExtraTests/X02-DisabledMacros.cpp | 34 +- .../X03-DisabledExceptions-DefaultHandler.cpp | 17 + .../X04-DisabledExceptions-CustomHandler.cpp | 14 +- .../ExtraTests/X05-DeferredStaticChecks.cpp | 21 + .../ExtraTests/X10-FallbackStringifier.cpp | 17 +- .../ExtraTests/X11-DisableStringification.cpp | 20 +- .../ExtraTests/X12-CustomDebugBreakMacro.cpp | 13 +- .../ExtraTests/X21-PartialTestCaseEvents.cpp | 2 +- .../X22-BenchmarksInCumulativeReporter.cpp | 79 + .../ExtraTests/X23-CasingInReporterNames.cpp | 41 + ...4-ListenerStdoutCaptureInMultireporter.cpp | 40 + .../X25-ListenerCanAskForCapturedStdout.cpp | 47 + ...erencesForPassingAssertionsIsRespected.cpp | 52 + .../X27-CapturedStdoutInTestCaseEvents.cpp | 82 + .../X28-ListenersGetEventsBeforeReporters.cpp | 99 + .../X29-CustomArgumentsForReporters.cpp | 59 + .../tests/ExtraTests/X30-BazelReporter.cpp | 17 + .../X35-DuplicatedReporterNames.cpp | 31 + .../ExtraTests/X90-WindowsHeaderInclusion.cpp | 18 +- .../tests/ExtraTests/X91-AmalgamatedCatch.cpp | 9 +- .../Catch2/tests/ExtraTests/X92-NoTests.cpp | 11 + .../Baselines/automake.sw.approved.txt | 40 +- .../Baselines/automake.sw.multi.approved.txt | 394 + .../Baselines/compact.sw.approved.txt | 506 +- .../Baselines/compact.sw.multi.approved.txt | 2595 ++ .../Baselines/console.std.approved.txt | 90 +- .../Baselines/console.sw.approved.txt | 2379 +- .../Baselines/console.sw.multi.approved.txt | 18447 +++++++++++++ .../Baselines/console.swa4.approved.txt | 30 +- .../Baselines/default.sw.multi.approved.txt | 8 + .../SelfTest/Baselines/junit.sw.approved.txt | 191 +- .../Baselines/junit.sw.multi.approved.txt | 1946 ++ .../Baselines/sonarqube.sw.approved.txt | 187 +- .../Baselines/sonarqube.sw.multi.approved.txt | 1971 ++ .../SelfTest/Baselines/tap.sw.approved.txt | 621 +- .../Baselines/tap.sw.multi.approved.txt | 4597 ++++ .../Baselines/teamcity.sw.approved.txt | 93 +- .../Baselines/teamcity.sw.multi.approved.txt | 950 + .../SelfTest/Baselines/xml.sw.approved.txt | 5596 ++-- .../Baselines/xml.sw.multi.approved.txt | 21706 ++++++++++++++++ .../IntrospectiveTests/Clara.tests.cpp | 57 +- .../IntrospectiveTests/CmdLine.tests.cpp | 228 +- .../CmdLineHelpers.tests.cpp | 111 + .../IntrospectiveTests/ColourImpl.tests.cpp | 64 + .../IntrospectiveTests/Details.tests.cpp | 72 +- .../FloatingPoint.tests.cpp | 8 + .../GeneratorsImpl.tests.cpp | 160 +- .../InternalBenchmark.tests.cpp | 25 +- .../IntrospectiveTests/PartTracker.tests.cpp | 11 +- .../RandomNumberGeneration.tests.cpp | 28 +- .../IntrospectiveTests/Reporters.tests.cpp | 264 +- .../IntrospectiveTests/Sharding.tests.cpp | 45 + .../IntrospectiveTests/Stream.tests.cpp | 32 + .../IntrospectiveTests/String.tests.cpp | 47 +- .../IntrospectiveTests/StringManip.tests.cpp | 16 + .../SelfTest/IntrospectiveTests/Tag.tests.cpp | 65 +- .../TestCaseInfoHasher.tests.cpp | 72 + .../TestSpecParser.tests.cpp | 55 + .../IntrospectiveTests/TextFlow.tests.cpp | 200 + .../IntrospectiveTests/ToString.tests.cpp | 8 + .../IntrospectiveTests/UniquePtr.tests.cpp | 8 + .../SelfTest/IntrospectiveTests/Xml.tests.cpp | 72 +- .../tests/SelfTest/TestRegistrations.cpp | 10 +- .../SelfTest/TimingTests/Sleep.tests.cpp | 13 +- .../SelfTest/UsageTests/Approx.tests.cpp | 14 +- .../tests/SelfTest/UsageTests/BDD.tests.cpp | 11 +- .../SelfTest/UsageTests/Benchmark.tests.cpp | 26 + .../tests/SelfTest/UsageTests/Class.tests.cpp | 31 +- .../SelfTest/UsageTests/Compilation.tests.cpp | 19 +- .../SelfTest/UsageTests/Condition.tests.cpp | 37 +- .../UsageTests/Decomposition.tests.cpp | 13 +- .../UsageTests/EnumToString.tests.cpp | 10 +- .../SelfTest/UsageTests/Exception.tests.cpp | 26 +- .../SelfTest/UsageTests/Generators.tests.cpp | 8 + .../SelfTest/UsageTests/Matchers.tests.cpp | 51 +- .../UsageTests/MatchersRanges.tests.cpp | 529 +- .../SelfTest/UsageTests/Message.tests.cpp | 29 +- .../tests/SelfTest/UsageTests/Misc.tests.cpp | 91 +- .../UsageTests/ToStringByte.tests.cpp | 8 + .../UsageTests/ToStringChrono.tests.cpp | 8 + .../UsageTests/ToStringGeneral.tests.cpp | 11 +- .../UsageTests/ToStringOptional.tests.cpp | 8 + .../UsageTests/ToStringPair.tests.cpp | 8 + .../UsageTests/ToStringTuple.tests.cpp | 11 +- .../UsageTests/ToStringVariant.tests.cpp | 8 + .../UsageTests/ToStringVector.tests.cpp | 8 + .../UsageTests/ToStringWhich.tests.cpp | 11 +- .../SelfTest/UsageTests/Tricky.tests.cpp | 62 +- .../UsageTests/VariadicMacros.tests.cpp | 11 +- .../tests/SelfTest/WarnAboutNoTests.cmake | 19 - .../tests/TestScripts/ConfigureTestsCommon.py | 75 + .../tests/TestScripts/testBazelReporter.py | 104 + .../testConfigureDefaultReporter.py | 44 + .../tests/TestScripts/testConfigureDisable.py | 48 + .../testConfigureDisableStringification.py | 44 + .../testConfigureExperimentalRedirect.py | 49 + .../TestScripts/testPartialTestCaseEvent.py | 7 + .../tests/TestScripts/testRandomOrder.py | 17 +- .../Catch2/tests/TestScripts/testSharding.py | 165 + .../misc/appveyorBuildConfigurationScript.bat | 4 +- .../tools/misc/appveyorTestRunScript.bat | 2 + .../Catch2/tools/scripts/approvalTests.py | 111 +- .../Catch2/tools/scripts/benchmarkCompile.py | 148 - .../Catch2/tools/scripts/benchmarkRunner.py | 56 - .../Catch2/tools/scripts/buildAndTest.cmd | 17 + packages/Catch2/tools/scripts/buildAndTest.sh | 2 +- packages/Catch2/tools/scripts/checkLicense.py | 57 +- packages/Catch2/tools/scripts/embed.py | 63 - packages/Catch2/tools/scripts/embedClara.py | 27 - .../tools/scripts/generateAmalgamatedFiles.py | 15 +- .../Catch2/tools/scripts/releaseCommon.py | 41 +- packages/Catch2/tools/scripts/releaseNotes.py | 65 - .../Catch2/tools/scripts/updateWandbox.py | 53 - tests/mpi_test_main.cpp | 32 +- 370 files changed, 76684 insertions(+), 10996 deletions(-) create mode 100644 packages/Catch2/.bazelrc create mode 100644 packages/Catch2/CMake/CatchConfigOptions.cmake rename packages/Catch2/CMake/{MiscFunctions.cmake => CatchMiscFunctions.cmake} (73%) create mode 100644 packages/Catch2/CMakePresets.json create mode 100644 packages/Catch2/SECURITY.md create mode 100644 packages/Catch2/docs/faq.md create mode 100644 packages/Catch2/docs/reporter-events.md create mode 100644 packages/Catch2/docs/usage-tips.md delete mode 100644 packages/Catch2/examples/000-CatchMain.cpp create mode 100644 packages/Catch2/extras/CatchShardTests.cmake create mode 100644 packages/Catch2/extras/CatchShardTestsImpl.cmake create mode 100644 packages/Catch2/src/catch2/benchmark/catch_chronometer.cpp create mode 100644 packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp create mode 100644 packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp delete mode 100644 packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp create mode 100644 packages/Catch2/src/catch2/catch_get_random_seed.cpp create mode 100644 packages/Catch2/src/catch2/catch_get_random_seed.hpp delete mode 100644 packages/Catch2/src/catch2/catch_reporter_registrars.hpp create mode 100644 packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp create mode 100644 packages/Catch2/src/catch2/catch_user_config.hpp.in create mode 100644 packages/Catch2/src/catch2/generators/catch_generator_exception.cpp rename packages/Catch2/src/catch2/generators/{internal/catch_generators_combined_tu.cpp => catch_generators.cpp} (52%) create mode 100644 packages/Catch2/src/catch2/generators/catch_generators_random.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp delete mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.cpp create mode 100644 packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.hpp delete mode 100644 packages/Catch2/src/catch2/internal/catch_combined_tu.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_decomposer.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_errno_guard.cpp rename packages/Catch2/src/catch2/internal/{catch_stream.cpp => catch_istream.cpp} (58%) create mode 100644 packages/Catch2/src/catch2/internal/catch_istream.hpp create mode 100644 packages/Catch2/src/catch2/internal/catch_lazy_expr.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_leak_detector.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_message_info.cpp rename packages/Catch2/src/catch2/internal/{catch_option.hpp => catch_optional.hpp} (54%) create mode 100644 packages/Catch2/src/catch2/internal/catch_polyfills.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_preprocessor_remove_parens.hpp create mode 100644 packages/Catch2/src/catch2/internal/catch_random_seed_generation.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_random_seed_generation.hpp create mode 100644 packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.hpp create mode 100644 packages/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp rename packages/Catch2/src/catch2/internal/{catch_stream.hpp => catch_reusable_string_stream.hpp} (77%) create mode 100644 packages/Catch2/src/catch2/internal/catch_sharding.hpp create mode 100644 packages/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_stdstreams.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_stdstreams.hpp create mode 100644 packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.hpp create mode 100644 packages/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp create mode 100644 packages/Catch2/src/catch2/internal/catch_void_type.hpp create mode 100644 packages/Catch2/src/catch2/matchers/catch_matchers.cpp create mode 100644 packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp create mode 100644 packages/Catch2/src/catch2/matchers/catch_matchers_exception.cpp create mode 100644 packages/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp create mode 100644 packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp delete mode 100644 packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp create mode 100644 packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp create mode 100644 packages/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp create mode 100644 packages/Catch2/src/catch2/reporters/catch_reporter_common_base.hpp create mode 100644 packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp rename packages/Catch2/src/catch2/reporters/{catch_reporter_combined_tu.cpp => catch_reporter_helpers.cpp} (74%) delete mode 100644 packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp create mode 100644 packages/Catch2/src/catch2/reporters/catch_reporter_multi.cpp rename packages/Catch2/src/catch2/reporters/{catch_reporter_listening.hpp => catch_reporter_multi.hpp} (62%) create mode 100644 packages/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp create mode 100644 packages/Catch2/src/catch2/reporters/catch_reporter_registrars.hpp create mode 100644 packages/Catch2/tests/ExtraTests/X05-DeferredStaticChecks.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X23-CasingInReporterNames.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X24-ListenerStdoutCaptureInMultireporter.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X25-ListenerCanAskForCapturedStdout.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X30-BazelReporter.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X35-DuplicatedReporterNames.cpp create mode 100644 packages/Catch2/tests/ExtraTests/X92-NoTests.cpp create mode 100644 packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/default.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt create mode 100644 packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLineHelpers.tests.cpp create mode 100644 packages/Catch2/tests/SelfTest/IntrospectiveTests/ColourImpl.tests.cpp create mode 100644 packages/Catch2/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp create mode 100644 packages/Catch2/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp create mode 100644 packages/Catch2/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp create mode 100644 packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpecParser.tests.cpp create mode 100644 packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp delete mode 100644 packages/Catch2/tests/SelfTest/WarnAboutNoTests.cmake create mode 100644 packages/Catch2/tests/TestScripts/ConfigureTestsCommon.py create mode 100644 packages/Catch2/tests/TestScripts/testBazelReporter.py create mode 100644 packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py create mode 100644 packages/Catch2/tests/TestScripts/testConfigureDisable.py create mode 100644 packages/Catch2/tests/TestScripts/testConfigureDisableStringification.py create mode 100644 packages/Catch2/tests/TestScripts/testConfigureExperimentalRedirect.py create mode 100755 packages/Catch2/tests/TestScripts/testSharding.py delete mode 100755 packages/Catch2/tools/scripts/benchmarkCompile.py delete mode 100755 packages/Catch2/tools/scripts/benchmarkRunner.py create mode 100644 packages/Catch2/tools/scripts/buildAndTest.cmd delete mode 100644 packages/Catch2/tools/scripts/embed.py delete mode 100755 packages/Catch2/tools/scripts/embedClara.py delete mode 100755 packages/Catch2/tools/scripts/releaseNotes.py delete mode 100644 packages/Catch2/tools/scripts/updateWandbox.py diff --git a/packages/Catch2/.bazelrc b/packages/Catch2/.bazelrc new file mode 100644 index 000000000..55f17a67d --- /dev/null +++ b/packages/Catch2/.bazelrc @@ -0,0 +1,4 @@ +build:gcc9 --cxxopt=-std=c++2a +build:clang13 --cxxopt=-std=c++17 +build:vs2019 --cxxopt=/std:c++17 +build:vs2022 --cxxopt=/std:c++17 \ No newline at end of file diff --git a/packages/Catch2/.github/FUNDING.yml b/packages/Catch2/.github/FUNDING.yml index 4d8a0e95a..9122aa8ae 100644 --- a/packages/Catch2/.github/FUNDING.yml +++ b/packages/Catch2/.github/FUNDING.yml @@ -1 +1,2 @@ +github: "horenmar" custom: "https://www.paypal.me/horenmar" diff --git a/packages/Catch2/.github/workflows/linux-other-builds.yml b/packages/Catch2/.github/workflows/linux-other-builds.yml index 61ebf3d7e..31dcb9219 100644 --- a/packages/Catch2/.github/workflows/linux-other-builds.yml +++ b/packages/Catch2/.github/workflows/linux-other-builds.yml @@ -51,6 +51,23 @@ jobs: other_pkgs: clang-10 cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON + # Configure tests with Clang-10 + - cxx: clang++-10 + build_description: CMake configuration tests + build_type: Debug + std: 14 + other_pkgs: clang-10 + cmake_configurations: -DCATCH_ENABLE_CONFIGURE_TESTS=ON + + # Valgrind test Clang-10 + - cxx: clang++-10 + build_description: Valgrind tests + build_type: Debug + std: 14 + other_pkgs: clang-10 valgrind + cmake_configurations: -DMEMORYCHECK_COMMAND=`which valgrind` -DMEMORYCHECK_COMMAND_OPTIONS="-q --track-origins=yes --leak-check=full --num-callers=50 --show-leak-kinds=definite --error-exitcode=1" + other_ctest_args: -T memcheck -LE uses-python + steps: - uses: actions/checkout@v2 @@ -83,4 +100,4 @@ jobs: CTEST_OUTPUT_ON_FAILURE: 1 working-directory: ${{runner.workspace}}/build # Hardcode 2 cores we know are there - run: ctest -C ${{matrix.build_type}} -j 2 + run: ctest -C ${{matrix.build_type}} -j 2 ${{matrix.other_ctest_args}} diff --git a/packages/Catch2/.github/workflows/mac-builds.yml b/packages/Catch2/.github/workflows/mac-builds.yml index 5bcc35414..0ad5982dc 100644 --- a/packages/Catch2/.github/workflows/mac-builds.yml +++ b/packages/Catch2/.github/workflows/mac-builds.yml @@ -4,11 +4,11 @@ on: [push, pull_request] jobs: build: - runs-on: macos-10.15 + runs-on: macos-12 strategy: matrix: cxx: - - g++-9 + - g++-11 - clang++ build_type: [Debug, Release] std: [14, 17] diff --git a/packages/Catch2/.gitignore b/packages/Catch2/.gitignore index 1b3934bf5..cafbd6b29 100644 --- a/packages/Catch2/.gitignore +++ b/packages/Catch2/.gitignore @@ -11,11 +11,6 @@ Release 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 @@ -25,9 +20,17 @@ DerivedData Build .idea .vs +.vscode cmake-build-* benchmark-dir .conan/test_package/build bazel-* build-fuzzers debug-build +.vscode +msvc-sln* +# Currently we use Doxygen for dep graphs and the full docs are only slowly +# being filled in, so we definitely do not want git to deal with the docs. +docs/doxygen +*.cache +compile_commands.json diff --git a/packages/Catch2/.gitrepo b/packages/Catch2/.gitrepo index 3bb3f7649..de961c79f 100644 --- a/packages/Catch2/.gitrepo +++ b/packages/Catch2/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = git@github.com:catchorg/Catch2.git branch = devel - commit = fb4153e05e430921574d79d868ebc44dd9528629 - parent = 57867f14916a3779d2de6004b203bd636dcfee88 + commit = 7b2e7d623b626ed2cae1d4b7f2b5480bdabbefd8 + parent = 95b3a702d689cb12fed8c321811e8afcff4485d4 method = merge cmdver = 0.4.3 diff --git a/packages/Catch2/BUILD.bazel b/packages/Catch2/BUILD.bazel index 6dc626d80..7c4435163 100644 --- a/packages/Catch2/BUILD.bazel +++ b/packages/Catch2/BUILD.bazel @@ -1,25 +1,91 @@ # Load the cc_library rule. load("@rules_cc//cc:defs.bzl", "cc_library") +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") + +expand_template( + name = "catch_user_config", + out = "catch2/catch_user_config.hpp", + substitutions = { + "#cmakedefine CATCH_CONFIG_ANDROID_LOGWRITE": "", + "#cmakedefine CATCH_CONFIG_BAZEL_SUPPORT": "#define CATCH_CONFIG_BAZEL_SUPPORT", + "#cmakedefine CATCH_CONFIG_NO_COLOUR_WIN32": "", + "#cmakedefine CATCH_CONFIG_COLOUR_WIN32": "", + "#cmakedefine CATCH_CONFIG_COUNTER": "", + "#cmakedefine CATCH_CONFIG_CPP11_TO_STRING": "", + "#cmakedefine CATCH_CONFIG_CPP17_BYTE": "", + "#cmakedefine CATCH_CONFIG_CPP17_OPTIONAL": "", + "#cmakedefine CATCH_CONFIG_CPP17_STRING_VIEW": "", + "#cmakedefine CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS": "", + "#cmakedefine CATCH_CONFIG_CPP17_VARIANT": "", + "#cmakedefine CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER": "", + "#cmakedefine CATCH_CONFIG_DISABLE_EXCEPTIONS": "", + "#cmakedefine CATCH_CONFIG_DISABLE_STRINGIFICATION": "", + "#cmakedefine CATCH_CONFIG_DISABLE": "", + "#cmakedefine CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS": "", + "#cmakedefine CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER": "", + "#cmakedefine CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER": "", + "#cmakedefine CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER": "", + "#cmakedefine CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER": "", + "#cmakedefine CATCH_CONFIG_EXPERIMENTAL_REDIRECT": "", + "#cmakedefine CATCH_CONFIG_FALLBACK_STRINGIFIER @CATCH_CONFIG_FALLBACK_STRINGIFIER@": "", + "#cmakedefine CATCH_CONFIG_FAST_COMPILE": "", + "#cmakedefine CATCH_CONFIG_GLOBAL_NEXTAFTER": "", + "#cmakedefine CATCH_CONFIG_NO_COUNTER": "", + "#cmakedefine CATCH_CONFIG_NO_CPP11_TO_STRING": "", + "#cmakedefine CATCH_CONFIG_NO_CPP17_BYTE": "", + "#cmakedefine CATCH_CONFIG_NO_CPP17_OPTIONAL": "", + "#cmakedefine CATCH_CONFIG_NO_CPP17_STRING_VIEW": "", + "#cmakedefine CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS": "", + "#cmakedefine CATCH_CONFIG_NO_CPP17_VARIANT": "", + "#cmakedefine CATCH_CONFIG_NO_GLOBAL_NEXTAFTER": "", + "#cmakedefine CATCH_CONFIG_NO_POSIX_SIGNALS": "", + "#cmakedefine CATCH_CONFIG_NO_USE_ASYNC": "", + "#cmakedefine CATCH_CONFIG_NO_WCHAR": "", + "#cmakedefine CATCH_CONFIG_NO_WINDOWS_SEH": "", + "#cmakedefine CATCH_CONFIG_NOSTDOUT": "", + "#cmakedefine CATCH_CONFIG_POSIX_SIGNALS": "", + "#cmakedefine CATCH_CONFIG_PREFIX_ALL": "", + "#cmakedefine CATCH_CONFIG_USE_ASYNC": "", + "#cmakedefine CATCH_CONFIG_WCHAR": "", + "#cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG": "", + "#cmakedefine CATCH_CONFIG_WINDOWS_SEH": "", + "#cmakedefine CATCH_CONFIG_NO_ANDROID_LOGWRITE": "", + "@CATCH_CONFIG_DEFAULT_REPORTER@": "console", + "@CATCH_CONFIG_CONSOLE_WIDTH@": "80", + }, + template = "src/catch2/catch_user_config.hpp.in", +) + +# Generated header library, modifies the include prefix to account for +# generation path so that we can include <catch2/catch_user_config.hpp> +# correctly. +cc_library( + name = "catch2_generated", + hdrs = ["catch2/catch_user_config.hpp"], + include_prefix = ".", # to manipulate -I of dependenices + visibility = ["//visibility:public"], +) # Static library, without main. cc_library( name = "catch2", + srcs = glob( + ["src/catch2/**/*.cpp"], + exclude = ["src/catch2/internal/catch_main.cpp"], + ), hdrs = glob(["src/catch2/**/*.hpp"]), - srcs = glob(["src/catch2/**/*.cpp"], - exclude=[ "src/catch2/internal/catch_main.cpp"]), - visibility = ["//visibility:public"], - copts = ["-std=c++14"], - linkstatic = True, includes = ["src/"], + linkstatic = True, + visibility = ["//visibility:public"], + deps = [":catch2_generated"], ) # Static library, with main. cc_library( name = "catch2_main", srcs = ["src/catch2/internal/catch_main.cpp"], - deps = [":catch2"], - visibility = ["//visibility:public"], - linkstatic = True, - copts = ["-std=c++14"], includes = ["src/"], -) + linkstatic = True, + visibility = ["//visibility:public"], + deps = [":catch2"], +) \ No newline at end of file diff --git a/packages/Catch2/CMake/CatchConfigOptions.cmake b/packages/Catch2/CMake/CatchConfigOptions.cmake new file mode 100644 index 000000000..a8ae93d43 --- /dev/null +++ b/packages/Catch2/CMake/CatchConfigOptions.cmake @@ -0,0 +1,77 @@ + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +## +# This file contains options that are materialized into the Catch2 +# compiled library. All of them default to OFF, as even the positive +# forms correspond to the user _forcing_ them to ON, while being OFF +# means that Catch2 can use its own autodetection. +# +# For detailed docs look into docs/configuration.md + + +macro(AddOverridableConfigOption OptionBaseName) + option(CATCH_CONFIG_${OptionBaseName} "Read docs/configuration.md for details" OFF) + option(CATCH_CONFIG_NO_${OptionBaseName} "Read docs/configuration.md for details" OFF) +endmacro() + +macro(AddConfigOption OptionBaseName) + option(CATCH_CONFIG_${OptionBaseName} "Read docs/configuration.md for details" OFF) +endmacro() + +set(_OverridableOptions + "ANDROID_LOGWRITE" + "BAZEL_SUPPORT" + "COLOUR_WIN32" + "COUNTER" + "CPP11_TO_STRING" + "CPP17_BYTE" + "CPP17_OPTIONAL" + "CPP17_STRING_VIEW" + "CPP17_UNCAUGHT_EXCEPTIONS" + "CPP17_VARIANT" + "GLOBAL_NEXTAFTER" + "POSIX_SIGNALS" + "USE_ASYNC" + "WCHAR" + "WINDOWS_SEH" +) + +foreach(OptionName ${_OverridableOptions}) + AddOverridableConfigOption(${OptionName}) +endforeach() + +set(_OtherConfigOptions + "DISABLE_EXCEPTIONS" + "DISABLE_EXCEPTIONS_CUSTOM_HANDLER" + "DISABLE" + "DISABLE_STRINGIFICATION" + "ENABLE_ALL_STRINGMAKERS" + "ENABLE_OPTIONAL_STRINGMAKER" + "ENABLE_PAIR_STRINGMAKER" + "ENABLE_TUPLE_STRINGMAKER" + "ENABLE_VARIANT_STRINGMAKER" + "EXPERIMENTAL_REDIRECT" + "FAST_COMPILE" + "NOSTDOUT" + "PREFIX_ALL" + "WINDOWS_CRTDBG" +) + + +foreach(OptionName ${_OtherConfigOptions}) + AddConfigOption(${OptionName}) +endforeach() + +set(CATCH_CONFIG_DEFAULT_REPORTER "console" CACHE STRING "Read docs/configuration.md for details. The name of the reporter should be without quotes.") +set(CATCH_CONFIG_CONSOLE_WIDTH "80" CACHE STRING "Read docs/configuration.md for details. Must form a valid integer literal.") + +# There is no good way to both turn this into a CMake cache variable, +# and keep reasonable default semantics inside the project. Thus we do +# not define it and users have to provide it as an outside variable. +#set(CATCH_CONFIG_FALLBACK_STRINGIFIER "" CACHE STRING "Read docs/configuration.md for details.") diff --git a/packages/Catch2/CMake/MiscFunctions.cmake b/packages/Catch2/CMake/CatchMiscFunctions.cmake similarity index 73% rename from packages/Catch2/CMake/MiscFunctions.cmake rename to packages/Catch2/CMake/CatchMiscFunctions.cmake index 7548f287f..73c8b4dd2 100644 --- a/packages/Catch2/CMake/MiscFunctions.cmake +++ b/packages/Catch2/CMake/CatchMiscFunctions.cmake @@ -1,3 +1,11 @@ + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + include(CheckCXXCompilerFlag) function(add_cxx_flag_if_supported_to_targets flagname targets) check_cxx_compiler_flag("${flagname}" HAVE_FLAG_${flagname}) @@ -35,35 +43,58 @@ function(add_warnings_to_targets targets) if (NOT MSVC) set(CHECKED_WARNING_FLAGS + "-Wabsolute-value" "-Wall" - "-Wextra" - "-Wpedantic" - "-Wweak-vtables" - "-Wunreachable-code" - "-Wmissing-declarations" + "-Wc++20-compat" + "-Wcall-to-pure-virtual-from-ctor-dtor" + "-Wcast-align" + "-Wcatch-value" + "-Wdangling" + "-Wdeprecated" + "-Wdeprecated-register" + "-Wexceptions" "-Wexit-time-destructors" + "-Wextra" + "-Wextra-semi" + "-Wfloat-equal" "-Wglobal-constructors" + "-Winit-self" + "-Wmisleading-indentation" + "-Wmismatched-new-delete" + "-Wmismatched-return-types" + "-Wmismatched-tags" + "-Wmissing-braces" + "-Wmissing-declarations" "-Wmissing-noreturn" + "-Wmissing-prototypes" + "-Wmissing-variable-declarations" + "-Wnull-dereference" + "-Wold-style-cast" + "-Woverloaded-virtual" "-Wparentheses" - "-Wextra-semi" - "-Wunreachable-code" - "-Wstrict-aliasing" + "-Wpedantic" + "-Wreorder" "-Wreturn-std-move" - "-Wmissing-braces" - "-Wdeprecated" - "-Wvla" + "-Wshadow" + "-Wstrict-aliasing" + "-Wsuggest-destructor-override" + "-Wsuggest-override" "-Wundef" - "-Wmisleading-indentation" - "-Wcatch-value" - "-Wabsolute-value" - "-Wreturn-std-move" - "-Wunused-parameter" + "-Wuninitialized" + "-Wunneeded-internal-declaration" + "-Wunreachable-code" + "-Wunused" "-Wunused-function" - "-Wcall-to-pure-virtual-from-ctor-dtor" - "-Wdeprecated-register" - "-Wsuggest-override" - "-Wshadow" - "-Wold-style-cast" + "-Wunused-parameter" + "-Wvla" + "-Wweak-vtables" + + # This is a useful warning, but our tests sometimes rely on + # functions being present, but not picked (e.g. various checks + # for stringification implementation ordering). + # Ergo, we should use it every now and then, but we cannot + # enable it by default. + # "-Wunused-member-function" ) foreach(warning ${CHECKED_WARNING_FLAGS}) add_cxx_flag_if_supported_to_targets(${warning} "${targets}") diff --git a/packages/Catch2/CMake/catch2-with-main.pc.in b/packages/Catch2/CMake/catch2-with-main.pc.in index 122f1f96a..69a790bbd 100644 --- a/packages/Catch2/CMake/catch2-with-main.pc.in +++ b/packages/Catch2/CMake/catch2-with-main.pc.in @@ -7,4 +7,4 @@ Description: A modern, C++-native test framework for C++14 and above (links in d Version: ${pkg_version} Requires: catch2 = ${pkg_version} Cflags: -I${includedir} -Libs: -L${libdir} -lCatch2WithMain +Libs: -L${libdir} -lCatch2Main diff --git a/packages/Catch2/CMakeLists.txt b/packages/Catch2/CMakeLists.txt index f1be3f594..ae8e86b9b 100644 --- a/packages/Catch2/CMakeLists.txt +++ b/packages/Catch2/CMakeLists.txt @@ -9,7 +9,7 @@ else() endif() option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON) -option(CATCH_INSTALL_EXTRAS "Install extras alongside library" ON) +option(CATCH_INSTALL_EXTRAS "Install extras (CMake scripts, debugger helpers) alongside library" ON) option(CATCH_DEVELOPMENT_BUILD "Build tests, enable warnings, enable Werror, etc" OFF) include(CMakeDependentOption) @@ -20,6 +20,7 @@ cmake_dependent_option(CATCH_BUILD_FUZZERS "Build fuzzers" OFF "CATCH_DEVELOPMEN cmake_dependent_option(CATCH_ENABLE_COVERAGE "Generate coverage for codecov.io" OFF "CATCH_DEVELOPMENT_BUILD" OFF) cmake_dependent_option(CATCH_ENABLE_WERROR "Enables Werror during build" ON "CATCH_DEVELOPMENT_BUILD" OFF) cmake_dependent_option(CATCH_BUILD_SURROGATES "Enable generating and building surrogate TUs for the main headers" OFF "CATCH_DEVELOPMENT_BUILD" OFF) +cmake_dependent_option(CATCH_ENABLE_CONFIGURE_TESTS "Enable CMake configuration tests. WARNING: VERY EXPENSIVE" OFF "CATCH_DEVELOPMENT_BUILD" OFF) # Catch2's build breaks if done in-tree. You probably should not build @@ -29,18 +30,37 @@ 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() -if(CMAKE_VERSION VERSION_GREATER 3.8) +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.9) # Enable IPO for CMake versions that support it cmake_policy(SET CMP0069 NEW) + project(Catch2 + VERSION 3.1.0 # CML version placeholder, don't delete + LANGUAGES CXX + # HOMEPAGE_URL is not supported until CMake version 3.12, which + # we do not target yet. + # HOMEPAGE_URL "https://github.com/catchorg/Catch2" + DESCRIPTION "A modern, C++-native, unit test framework." + ) +else() + project(Catch2 + VERSION 3.1.0 # CML version placeholder, don't delete + LANGUAGES CXX + ) endif() - -project(Catch2 LANGUAGES CXX VERSION 3.0.0) - -# Provide path for scripts +# Provide path for scripts. We first add path to the scripts we don't use, +# but projects including us might, and set the path up to parent scope. +# Then we also add path that we use to configure the project, but is of +# no use to top level projects. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/extras") +if (NOT NOT_SUBPROJECT) + set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE) +endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") + include(GNUInstallDirs) include(CMakePackageConfigHelpers) +include(CatchConfigOptions) if(CATCH_DEVELOPMENT_BUILD) include(CTest) endif() @@ -93,16 +113,6 @@ if (CATCH_DEVELOPMENT_BUILD) add_warnings_to_targets("${CATCH_WARNING_TARGETS}") endif() - -#option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF) -#option(CATCH_ENABLE_WERROR "Enable all warnings as errors" ON) -# -#set_property(GLOBAL PROPERTY USE_FOLDERS ON) -# -# -# -# -# # 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 @@ -114,27 +124,11 @@ if (NOT_SUBPROJECT) ${CATCH_CMAKE_CONFIG_DESTINATION} ) - ## TODO: Catch2 main target? - ## Install some cpp file as well? - - # 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( FILES @@ -151,6 +145,7 @@ if (NOT_SUBPROJECT) docs/ DESTINATION "${CMAKE_INSTALL_DOCDIR}" + PATTERN "doxygen" EXCLUDE ) endif() diff --git a/packages/Catch2/CMakePresets.json b/packages/Catch2/CMakePresets.json new file mode 100644 index 000000000..00f3a6d3a --- /dev/null +++ b/packages/Catch2/CMakePresets.json @@ -0,0 +1,25 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "basic-tests", + "displayName": "Basic development build", + "description": "Enables development build with basic tests that are cheap to build and run", + "cacheVariables": { + "CATCH_DEVELOPMENT_BUILD": "ON" + } + }, + { + "name": "all-tests", + "inherits": "basic-tests", + "displayName": "Full development build", + "description": "Enables development build with examples and ALL tests", + "cacheVariables": { + "CATCH_BUILD_EXAMPLES": "ON", + "CATCH_BUILD_EXTRA_TESTS": "ON", + "CATCH_BUILD_SURROGATES": "ON", + "CATCH_ENABLE_CONFIGURE_TESTS": "ON" + } + } + ] +} diff --git a/packages/Catch2/README.md b/packages/Catch2/README.md index 31be055db..83fdf7b31 100644 --- a/packages/Catch2/README.md +++ b/packages/Catch2/README.md @@ -7,10 +7,21 @@ [](https://github.com/catchorg/Catch2/actions/workflows/mac-builds.yml) [](https://ci.appveyor.com/project/catchorg/catch2) [](https://codecov.io/gh/catchorg/Catch2) -[](https://godbolt.org/z/9x9qoM) +[](https://godbolt.org/z/EdoY15q9G) [](https://discord.gg/4CWS9zD) +## What's the Catch2? + +Catch2 is mainly a unit testing framework for C++, but it also +provides basic micro-benchmarking features, and simple BDD macros. + +Catch2's main advantage is that using it is both simple and natural. +Tests autoregister themselves and do not have to be named with valid +identifiers, assertions look like normal C++ code, and sections provide +a nice way to share set-up and tear-down code in tests. + + ## Catch2 v3 is being developed! You are on the `devel` branch, where the next major version, v3, of @@ -26,17 +37,6 @@ guidelines on getting started, and collects most common migration problems. -## What's the Catch2? - -Catch2 is mainly a unit testing framework for C++, but it also -provides basic micro-benchmarking features, and simple BDD macros. - -Catch2's main advantage is that using it is both simple and natural. -Tests autoregister themselves and do not have to be named with valid -identifiers, assertions look like normal C++ code, and sections provide -a nice way to share set-up and tear-down code in tests. - - ## How to use it This documentation comprises these three parts: @@ -47,5 +47,6 @@ This documentation comprises these three parts: ## 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) +* For discussion or questions please use [our Discord](https://discord.gg/4CWS9zD) +* See who else is using Catch2 in [Open Source Software](docs/opensource-users.md#top) +or [commercially](docs/commercial-users.md#top). diff --git a/packages/Catch2/SECURITY.md b/packages/Catch2/SECURITY.md new file mode 100644 index 000000000..b66bf7316 --- /dev/null +++ b/packages/Catch2/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +* Versions 1.x (branch Catch1.x) are no longer supported. +* Versions 2.x (branch v2.x) are currently supported. +* `devel` branch serves for stable-ish development and is supported, + but branches `devel-*` are considered short lived and are not supported separately. + + +## Reporting a Vulnerability + +Due to its nature as a _unit_ test framework, Catch2 shouldn't interact +with untrusted inputs and there shouldn't be many security vulnerabilities +in it. + +However, if you find one you send email to martin <dot> horenovsky <at> +gmail <dot> com. If you want to encrypt the email, my pgp key is +`E29C 46F3 B8A7 5028 6079 3B7D ECC9 C20E 314B 2360`. diff --git a/packages/Catch2/WORKSPACE b/packages/Catch2/WORKSPACE index e69de29bb..2f265da0a 100644 --- a/packages/Catch2/WORKSPACE +++ b/packages/Catch2/WORKSPACE @@ -0,0 +1,14 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "bazel_skylib", + strip_prefix = "bazel-skylib-2a87d4a62af886fb320883aba102255aba87275e", + urls = [ + "https://github.com/bazelbuild/bazel-skylib/archive/2a87d4a62af886fb320883aba102255aba87275e.tar.gz", + ], + sha256 = "d847b08d6702d2779e9eb399b54ff8920fa7521dc45e3e53572d1d8907767de7", +) + +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") + +bazel_skylib_workspace() \ No newline at end of file diff --git a/packages/Catch2/appveyor.yml b/packages/Catch2/appveyor.yml index d84d775c9..a8f77df09 100644 --- a/packages/Catch2/appveyor.yml +++ b/packages/Catch2/appveyor.yml @@ -51,9 +51,10 @@ test_script: # build explicitly. environment: matrix: - - FLAVOR: VS 2019 x64 Debug Surrogates + - FLAVOR: VS 2019 x64 Debug Surrogates Configure Tests APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 surrogates: 1 + configure_tests: 1 platform: x64 configuration: Debug diff --git a/packages/Catch2/conanfile.py b/packages/Catch2/conanfile.py index 7c597d49a..7aa27ef59 100644 --- a/packages/Catch2/conanfile.py +++ b/packages/Catch2/conanfile.py @@ -20,7 +20,7 @@ class CatchConan(ConanFile): cmake = CMake(self) cmake.definitions["BUILD_TESTING"] = "OFF" cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF" - cmake.definitions["CATCH_INSTALL_HELPERS"] = "ON" + cmake.definitions["CATCH_INSTALL_EXTRAS"] = "ON" cmake.configure(build_folder="build") return cmake @@ -42,16 +42,19 @@ conan_basic_setup()'''.format(line_to_replace, self.install_folder.replace("\\", cmake.install() def package_info(self): + lib_suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.names["cmake_find_package"] = "Catch2" self.cpp_info.names["cmake_find_package_multi"] = "Catch2" # Catch2 self.cpp_info.components["catch2base"].names["cmake_find_package"] = "Catch2" self.cpp_info.components["catch2base"].names["cmake_find_package_multi"] = "Catch2" self.cpp_info.components["catch2base"].names["pkg_config"] = "Catch2" - self.cpp_info.components["catch2base"].libs = ["Catch2"] + self.cpp_info.components["catch2base"].libs = ["Catch2" + lib_suffix] + self.cpp_info.components["catch2base"].builddirs.append("lib/cmake/Catch2") # Catch2WithMain self.cpp_info.components["catch2main"].names["cmake_find_package"] = "Catch2WithMain" self.cpp_info.components["catch2main"].names["cmake_find_package_multi"] = "Catch2WithMain" self.cpp_info.components["catch2main"].names["pkg_config"] = "Catch2WithMain" - self.cpp_info.components["catch2main"].libs = ["Catch2Main"] + self.cpp_info.components["catch2main"].libs = ["Catch2Main" + lib_suffix] self.cpp_info.components["catch2main"].requires = ["catch2base"] diff --git a/packages/Catch2/docs/Readme.md b/packages/Catch2/docs/Readme.md index 262edb5cf..1e59cf97a 100644 --- a/packages/Catch2/docs/Readme.md +++ b/packages/Catch2/docs/Readme.md @@ -25,10 +25,10 @@ Running: * [Command line](command-line.md#top) Odds and ends: +* [Frequently Asked Questions (FAQ)](faq.md#top) +* [Best practices and other tips](usage-tips.md#top) * [CMake integration](cmake-integration.md#top) * [CI and other miscellaneous pieces](ci-and-misc.md#top) - -FAQ: * [Known limitations](limitations.md#top) Other: diff --git a/packages/Catch2/docs/benchmarks.md b/packages/Catch2/docs/benchmarks.md index 101539ddc..548913c76 100644 --- a/packages/Catch2/docs/benchmarks.md +++ b/packages/Catch2/docs/benchmarks.md @@ -11,7 +11,8 @@ 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. +- *Run*: one run is one execution of the user code. Sometimes also referred + to as an _iteration_. - *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 diff --git a/packages/Catch2/docs/ci-and-misc.md b/packages/Catch2/docs/ci-and-misc.md index 0d016618c..ef9dff24c 100644 --- a/packages/Catch2/docs/ci-and-misc.md +++ b/packages/Catch2/docs/ci-and-misc.md @@ -1,12 +1,6 @@ <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. @@ -34,19 +28,6 @@ The advantage of this format is that the JUnit Ant schema is widely understood b 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``` @@ -69,18 +50,8 @@ Because of the incremental nature of Catch's test suites and ability to run spec ```-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 +## Low-level tools ### CodeCoverage module (GCOV, LCOV...) diff --git a/packages/Catch2/docs/cmake-integration.md b/packages/Catch2/docs/cmake-integration.md index d8d08495e..dc3efc9d9 100644 --- a/packages/Catch2/docs/cmake-integration.md +++ b/packages/Catch2/docs/cmake-integration.md @@ -5,6 +5,7 @@ [CMake targets](#cmake-targets)<br> [Automatic test registration](#automatic-test-registration)<br> [CMake project options](#cmake-project-options)<br> +[`CATCH_CONFIG_*` customization options in CMake](#catch_config_-customization-options-in-cmake)<br> [Installing Catch2 from git repository](#installing-catch2-from-git-repository)<br> [Installing Catch2 from vcpkg](#installing-catch2-from-vcpkg)<br> @@ -50,7 +51,7 @@ Include(FetchContent) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.0.0-preview3 + GIT_TAG v3.0.1 # or a later release ) FetchContent_MakeAvailable(Catch2) @@ -62,17 +63,19 @@ target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) ## Automatic test registration -Catch2's repository also contains two CMake scripts that help users +Catch2's repository also contains three CMake scripts that help users with automatically registering their `TEST_CASE`s with CTest. They can be found in the `extras` folder, and are 1) `Catch.cmake` (and its dependency `CatchAddTests.cmake`) 2) `ParseAndAddCatchTests.cmake` (deprecated) +3) `CatchShardTests.cmake` (and its dependency `CatchShardTestsImpl.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. +<a id="catch_discover_tests"></a> ### `Catch.cmake` and `CatchAddTests.cmake` `Catch.cmake` provides function `catch_discover_tests` to get tests from @@ -256,6 +259,49 @@ unset(OptionalCatchTestLauncher) ParseAndAddCatchTests(bar) ``` + +### `CatchShardTests.cmake` + +> `CatchShardTests.cmake` was introduced in Catch2 3.1.0. + +`CatchShardTests.cmake` provides a function +`catch_add_sharded_tests(TEST_BINARY)` that splits tests from `TEST_BINARY` +into multiple shards. The tests in each shard and their order is randomized, +and the seed changes every invocation of CTest. + +Currently there are 3 customization points for this script: + + * SHARD_COUNT - number of shards to split target's tests into + * REPORTER - reporter spec to use for tests + * TEST_SPEC - test spec used for filtering tests + +Example usage: + +``` +include(CatchShardTests) + +catch_add_sharded_tests(foo-tests + SHARD_COUNT 4 + REPORTER "xml::out=-" + TEST_SPEC "A" +) + +catch_add_sharded_tests(tests + SHARD_COUNT 8 + REPORTER "xml::out=-" + TEST_SPEC "B" +) +``` + +This registers total of 12 CTest tests (4 + 8 shards) to run shards +from `foo-tests` test binary, filtered by a test spec. + +_Note that this script is currently a proof-of-concept for reseeding +shards per CTest run, and thus does not support (nor does it currently +aim to support) all customization points from +[`catch_discover_tests`](#catch_discover_tests)._ + + ## CMake project options Catch2's CMake project also provides some options for other projects @@ -265,8 +311,9 @@ that consume it. These are: Catch2's test binary will be built. Defaults to `ON`. * `CATCH_INSTALL_DOCS` -- When `ON`, Catch2's documentation will be included in the installation. Defaults to `ON`. -* `CATCH_INSTALL_HELPERS` -- When `ON`, Catch2's extras folder will be -included in the installation. Defaults to `ON`. +* `CATCH_INSTALL_EXTRAS` -- When `ON`, Catch2's extras folder (the CMake +scripts mentioned above, debugger helpers) will be included in the +installation. Defaults to `ON`. * `CATCH_DEVELOPMENT_BUILD` -- When `ON`, configures the build for development of Catch2. This means enabling test projects, warnings and so on. Defaults to `OFF`. @@ -292,6 +339,31 @@ compiled separately to ensure that they are self-sufficient. Defaults to `OFF`. +## `CATCH_CONFIG_*` customization options in CMake + +> CMake support for `CATCH_CONFIG_*` options was introduced in Catch2 3.0.1 + +Due to the new separate compilation model, all the options from the +[Compile-time configuration docs](configuration.md#top) can also be set +through Catch2's CMake. To set them, define the option you want as `ON`, +e.g. `-DCATCH_CONFIG_NOSTDOUT=ON`. + +Note that setting the option to `OFF` doesn't disable it. To force disable +an option, you need to set the `_NO_` form of it to `ON`, e.g. +`-DCATCH_CONFIG_NO_COLOUR_WIN32=ON`. + + +To summarize the configuration option behaviour with an example: + +| `-DCATCH_CONFIG_COLOUR_WIN32` | `-DCATCH_CONFIG_NO_COLOUR_WIN32` | Result | +|-------------------------------|----------------------------------|-------------| +| `ON` | `ON` | error | +| `ON` | `OFF` | force-on | +| `OFF` | `ON` | force-off | +| `OFF` | `OFF` | auto-detect | + + + ## Installing Catch2 from git repository If you cannot install Catch2 from a package manager (e.g. Ubuntu 16.04 diff --git a/packages/Catch2/docs/command-line.md b/packages/Catch2/docs/command-line.md index 14511db98..218e2f596 100644 --- a/packages/Catch2/docs/command-line.md +++ b/packages/Catch2/docs/command-line.md @@ -15,11 +15,11 @@ [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> +[Skip all benchmarks](#skip-all-benchmarks)<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> @@ -29,14 +29,15 @@ [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> +[Test Sharding](#test-sharding)<br> +[Allow running the binary without tests](#allow-running-the-binary-without-tests)<br> +[Output verbosity](#output-verbosity)<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 /> @@ -55,18 +56,25 @@ Click one of the following links to take you straight to that option - or scroll </br> -<a href="#list-test-names-only"> ` --list-test-names-only`</a><br /> +<a href="#listing-available-tests-tags-or-reporters"> ` --list-tests`</a><br /> +<a href="#listing-available-tests-tags-or-reporters"> ` --list-tags`</a><br /> <a href="#listing-available-tests-tags-or-reporters"> ` --list-reporters`</a><br /> +<a href="#listing-available-tests-tags-or-reporters"> ` --list-listeners`</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="#skip-benchmarks"> ` --skip-benchmarks`</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 /> +<a href="#colour-mode"> ` --colour-mode`</a><br /> +<a href="#test-sharding"> ` --shard-count`</a><br /> +<a href="#test-sharding"> ` --shard-index`</a><br /> +<a href=#no-tests-override> ` --allow-running-no-tests`</a><br /> +<a href=#output-verbosity> ` --verbosity`</a><br /> </br> @@ -118,18 +126,48 @@ Test names containing special characters, such as `,` or `[` can specify them on <a id="choosing-a-reporter-to-use"></a> ## Choosing a reporter to use -<pre>-r, --reporter <reporter></pre> +<pre>-r, --reporter <reporter[::key=value]*></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: +Reporters are how the output from Catch2 (results of assertions, tests, +benchmarks and so on) is formatted and written out. The default reporter +is called the "Console" reporter and is intended to provide relatively +verbose and human-friendly output. -<pre>-r console --r compact --r xml --r junit -</pre> +Reporters are also individually configurable. To pass configuration options +to the reporter, you append `::key=value` to the reporter specification +as many times as you want, e.g. `--reporter xml::out=someFile.xml`. + +The keys must either be prefixed by "X", in which case they are not parsed +by Catch2 and are only passed down to the reporter, or one of options +hardcoded into Catch2. Currently there are only 2, +["out"](#sending-output-to-a-file), and ["colour-mode"](#colour-mode). + +_Note that the reporter might still check the X-prefixed options for +validity, and throw an error if they are wrong._ + +> Support for passing arguments to reporters through the `-r`, `--reporter` flag was introduced in Catch2 3.0.1 + +There are multiple built-in reporters, you can see what they do by using the +[`--list-reporter`](command-line.md#listing-available-tests-tags-or-reporters) +flag. If you need a reporter providing custom format outside of the already +provided ones, look at the ["write your own reporter" part of the reporter +documentation](reporters.md#writing-your-own-reporter). + +This option may be passed multiple times to use multiple (different) +reporters at the same time. See the [reporter documentation](reporters.md#multiple-reporters) +for details on what the resulting behaviour is. Also note that at most one +reporter can be provided without the output-file part of reporter spec. +This reporter will use the "default" output destination, based on +the [`-o`, `--out`](#sending-output-to-a-file) option. + +> Support for using multiple different reporters at the same time was [introduced](https://github.com/catchorg/Catch2/pull/2183) in Catch2 3.0.1 + + +_Note: There is currently no way to escape `::` in the reporter spec, +and thus the reporter names, or configuration keys and values, cannot +contain `::`. As `::` in paths is relatively obscure (unlike ':'), we do +not consider this an issue._ -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 Jenkins. 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 @@ -159,24 +197,62 @@ Sometimes this results in a flood of failure messages and you'd rather just see <a id="listing-available-tests-tags-or-reporters"></a> ## Listing available tests, tags or reporters -<pre>-l, --list-tests --t, --list-tags +``` +--list-tests +--list-tags --list-reporters -</pre> +--list-listeners +``` + +> The `--list*` options became customizable through reporters in Catch2 3.0.1 + +> The `--list-listeners` option was added in Catch2 3.0.1 -```-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. +`--list-tests` lists all registered tests matching specified test spec. +Usually this listing also includes tags, and potentially also other +information, like source location, based on verbosity and reporter's design. -```-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-tags` lists all tags from registered tests matching specified test +spec. Usually this also includes number of tests cases they match and +similar information. -```--list-reporters``` lists the available reporters. +`--list-reporters` lists all available reporters and their descriptions. + +`--list-listeners` lists all registered listeners and their descriptions. + +The [`--verbosity` argument](#output-verbosity) modifies the level of detail provided by the default `--list*` options +as follows: + +| Option | `normal` (default) | `quiet` | `high` | +|--------------------|---------------------------------|---------------------|-----------------------------------------| +| `--list-tests` | Test names and tags | Test names only | Same as `normal`, plus source code line | +| `--list-tags` | Tags and counts | Same as `normal` | Same as `normal` | +| `--list-reporters` | Reporter names and descriptions | Reporter names only | Same as `normal` | +| `--list-listeners` | Listener names and descriptions | Same as `normal` | Same as `normal` | <a id="sending-output-to-a-file"></a> ## Sending output to a file -<pre>-o, --out <filename> +<pre>-o, --out <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). +Use this option to send all output to a file, instead of stdout. You can +use `-` as the filename to explicitly send the output to stdout (this is +useful e.g. when using multiple reporters). + +> Support for `-` as the filename was introduced in Catch2 3.0.1 + +Filenames starting with "%" (percent symbol) are reserved by Catch2 for +meta purposes, e.g. using `%debug` as the filename opens stream that +writes to platform specific debugging/logging mechanism. + +Catch2 currently recognizes 3 meta streams: + +* `%debug` - writes to platform specific debugging/logging output +* `%stdout` - writes to stdout +* `%stderr` - writes to stderr + +> Support for `%stdout` and `%stderr` was introduced in Catch2 3.0.1 + <a id="naming-a-test-run"></a> ## Naming a test run @@ -207,16 +283,24 @@ This option transforms tabs and newline characters into ```\t``` and ```\n``` re ## Warnings <pre>-w, --warn <warning name></pre> -Enables reporting of suspicious test states. There are currently two -available warnings +You can think of Catch2's warnings as the equivalent of `-Werror` (`/WX`) +flag for C++ compilers. It turns some suspicious occurences, like a section +without assertions, into errors. Because these might be intended, warnings +are not enabled by default, but user can opt in. + +You can enable multiple warnings at the same time. + +There are currently two warnings implemented: ``` - 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 + NoAssertions // Fail test case / leaf section if no assertions + // (e.g. `REQUIRE`) is encountered. + UnmatchedTestSpec // Fail test run if any of the CLI test specs did + // not match any tests. ``` +> `UnmatchedTestSpec` was introduced in Catch2 3.0.1. + <a id="reporting-timings"></a> ## Reporting timings @@ -238,15 +322,13 @@ are. ## Load test names to run from a file <pre>-f, --input-file <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. +Provide the name of a file that contains a list of test case names, +one per line. Blank lines are skipped. -<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 useful way to generate an initial instance of this file is to combine +the [`--list-tests`](#listing-available-tests-tags-or-reporters) flag with +the [`--verbosity quiet`](#output-verbosity) option. You can also +use test specs to filter this list down to what you want first. <a id="order"></a> @@ -267,23 +349,36 @@ Lexicographic order. Tests are sorted by their name, their tags are ignored. ### rand -Randomly sorted. The order is dependent on Catch2's random seed (see +Randomly ordered. The order is dependent on Catch2's random seed (see [`--rng-seed`](#rng-seed)), and is subset invariant. What this means is that as long as the random seed is fixed, running only some tests (e.g. via tag) does not change their relative order. > The subset stability was introduced in Catch2 v2.12.0 +Since the random order was made subset stable, we promise that given +the same random seed, the order of test cases will be the same across +different platforms, as long as the tests were compiled against identical +version of Catch2. We reserve the right to change the relative order +of tests cases between Catch2 versions, but it is unlikely to happen often. + <a id="rng-seed"></a> ## Specify a seed for the Random Number Generator -<pre>--rng-seed <'time'|number></pre> +<pre>--rng-seed <'time'|'random-device'|number></pre> + +Sets the seed for random number generators used by Catch2. These are used +e.g. to shuffle tests when user asks for tests to be in random order. + +Using `time` as the argument asks Catch2 generate the seed through call +to `std::time(nullptr)`. This provides very weak randomness and multiple +runs of the binary can generate the same seed if they are started close +to each other. -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. +Using `random-device` asks for `std::random_device` to be used instead. +If your implementation provides working `std::random_device`, it should +be preferred to using `time`. Catch2 uses `std::random_device` by default. -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 @@ -298,6 +393,16 @@ See [The LibIdentify repo for more information and examples](https://github.com/ 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="skip-benchmarks"></a> +## Skip all benchmarks +<pre>--skip-benchmarks</pre> + +> [Introduced](https://github.com/catchorg/Catch2/issues/2408) in Catch2 3.0.1. + +This flag tells Catch2 to skip running all benchmarks. Benchmarks in this +case mean code blocks in `BENCHMARK` and `BENCHMARK_ADVANCED` macros, not +test cases with the `[!benchmark]` tag. + <a id="benchmark-samples"></a> ## Specify the number of benchmark samples to collect <pre>--benchmark-samples <# of samples></pre> @@ -394,7 +499,7 @@ 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 +- 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). @@ -402,21 +507,77 @@ start of the first section.</br> ## 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 +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> +<a id="colour-mode"></a> ## Override output colouring -<pre>--use-colour <yes|no|auto></pre> +<pre>--colour-mode <ansi|win32|none|default></pre> + +> The `--colour-mode` option replaced the old `--colour` option in Catch2 3.0.1 + + +Catch2 support two different ways of colouring terminal output, and by +default it attempts to make a good guess on which implementation to use +(and whether to even use it, e.g. Catch2 tries to avoid writing colour +codes when writing the results into a file). + +`--colour-mode` allows the user to explicitly select what happens. + +* `--colour-mode ansi` tells Catch2 to always use ANSI colour codes, even +when writing to a file +* `--colour-mode win32` tells Catch2 to use colour implementation based + on Win32 terminal API +* `--colour-mode none` tells Catch2 to disable colours completely +* `--colour-mode default` lets Catch2 decide + +`--colour-mode default` is the default setting. + + +<a id="test-sharding"></a> +## Test Sharding +<pre>--shard-count <#number of shards>, --shard-index <#shard index to run></pre> + +> [Introduced](https://github.com/catchorg/Catch2/pull/2257) in Catch2 3.0.1. + +When `--shard-count <#number of shards>` is used, the tests to execute +will be split evenly in to the given number of sets, identified by indices +starting at 0. The tests in the set given by +`--shard-index <#shard index to run>` will be executed. The default shard +count is `1`, and the default index to run is `0`. + +_It is an error to specify a shard index greater than the number of shards._ + +Sharding is useful when you want to split test execution across multiple +processes, as is done with the [Bazel test sharding](https://docs.bazel.build/versions/main/test-encyclopedia.html#test-sharding). + + +<a id="no-tests-override"></a> +## Allow running the binary without tests +<pre>--allow-running-no-tests</pre> + +> Introduced in Catch2 3.0.1. + +By default, Catch2 test binaries return non-0 exit code if no tests were +run, e.g. if the binary was compiled with no tests, or the provided test +spec matched no tests. This flag overrides that, so a test run with no +tests still returns 0. + +## Output verbosity +``` +-v, --verbosity <quiet|normal|high> +``` + +Changing verbosity might change how much details Catch2's reporters output. +However, you should consider changing the verbosity level as a _suggestion_. +Not all reporters support all verbosity levels, e.g. because the reporter's +format cannot meaningfully change. In that case, the verbosity level is +ignored. -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. +Verbosity defaults to _normal_. -`--use-colour yes` forces coloured output, `--use-colour no` disables coloured -output. The default behaviour is `--use-colour auto`. --- diff --git a/packages/Catch2/docs/commercial-users.md b/packages/Catch2/docs/commercial-users.md index ca77b67db..bb41e741e 100644 --- a/packages/Catch2/docs/commercial-users.md +++ b/packages/Catch2/docs/commercial-users.md @@ -13,6 +13,7 @@ with you sharing this fact. - Locksley.CZ - [Makimo](https://makimo.pl/) - NASA + - [Nexus Software Systems](https://nexwebsites.com) - [UX3D](https://ux3d.io) - [King](https://king.com) diff --git a/packages/Catch2/docs/configuration.md b/packages/Catch2/docs/configuration.md index 51f71bc76..9fd7f58b6 100644 --- a/packages/Catch2/docs/configuration.md +++ b/packages/Catch2/docs/configuration.md @@ -8,17 +8,19 @@ [stdout](#stdout)<br> [Fallback stringifier](#fallback-stringifier)<br> [Default reporter](#default-reporter)<br> +[Bazel support](#bazel-support)<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. +Catch2 is designed to "just work" as much as possible, and most of the +configuration options below are changed automatically during compilation, +according to the detected environment. However, this detection can also +be overriden by users, using macros documented below, and/or CMake options +with the same name. ## Prefixing Catch macros @@ -30,19 +32,18 @@ To keep test code clean and uncluttered Catch uses short macro names (e.g. ```TE ## 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'. + CATCH_CONFIG_COLOUR_WIN32 // Force enables compiling colouring impl based on Win32 console API + CATCH_CONFIG_NO_COLOUR_WIN32 // Force disables ... -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. +Yes, Catch2 uses the british spelling of colour. -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): +Catch2 attempts to autodetect whether the Win32 console colouring API, +`SetConsoleTextAttribute`, is available, and if it is available it compiles +in a console colouring implementation that uses it. -Note that when ANSI colour codes are used "unistd.h" must be includable - along with a definition of ```isatty()``` +This option can be used to override Catch2's autodetection and force the +compilation either ON or OFF. -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 @@ -96,6 +97,14 @@ This means that defining `CATCH_CONFIG_DEFAULT_REPORTER` to `"console"` is equivalent with the out-of-the-box experience. +## Bazel support +When `CATCH_CONFIG_BAZEL_SUPPORT` is defined or when `BAZEL_TEST=1` (which is set by the Bazel inside of a test environment), +Catch2 will register a `JUnit` reporter writing to a path pointed by `XML_OUTPUT_FILE` provided by Bazel. + +> `CATCH_CONFIG_BAZEL_SUPPORT` was [introduced](https://github.com/catchorg/Catch2/pull/2399) in Catch2 3.0.1. + +> `CATCH_CONFIG_BAZEL_SUPPORT` was [deprecated](https://github.com/catchorg/Catch2/pull/2459) in Catch2 3.1.0. + ## C++11 toggles CATCH_CONFIG_CPP11_TO_STRING // Use `std::to_string` @@ -179,13 +188,6 @@ 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 diff --git a/packages/Catch2/docs/contributing.md b/packages/Catch2/docs/contributing.md index fd45cc444..addeb5c9a 100644 --- a/packages/Catch2/docs/contributing.md +++ b/packages/Catch2/docs/contributing.md @@ -62,18 +62,23 @@ test using an external check script. Catch2 integration tests are written using CTest, either as a direct command invocation + pass/fail regex, or by delegating the check to a Python script. -There are also two more kinds of tests, examples and "ExtraTests". +Catch2 is slowly gaining more and more types of tests, currently Catch2 +project also has buildable examples, "ExtraTests", and CMake config tests. Examples present a small and self-contained snippets of code that use Catch2's facilities for specific purpose. Currently they are assumed -passing if they compile. ExtraTests then are expensive tests, that we -do not want to run all the time. This can be either because they take -a long time to run, or because they take a long time to compile, e.g. -because they test compile time configuration and require separate -compilation. +passing if they compile. -Examples and ExtraTests are not compiled by default. To compile them, -add `-DCATCH_BUILD_EXAMPLES=ON` and `-DCATCH_BUILD_EXTRA_TESTS=ON` to -the invocation of CMake configuration step. +ExtraTests then are expensive tests, that we do not want to run all the +time. This can be either because they take a long time to run, or because +they take a long time to compile, e.g. because they test compile time +configuration and require separate compilation. + +Finally, CMake config tests test that you set Catch2's compile-time +configuration options through CMake, using CMake options of the same name. + +None of these tests are enabled by default. To enable them, add +`-DCATCH_BUILD_EXAMPLES=ON`, `-DCATCH_BUILD_EXTRA_TESTS=ON`, and +`-DCATCH_ENABLE_CONFIGURE_TESTS=ON` when configuration the CMake build. Bringing this all together, the steps below should configure, build, and run all tests in the `Debug` compilation. @@ -85,7 +90,7 @@ and run all tests in the `Debug` compilation. ./tools/scripts/generateAmalgamatedFiles.py # 2. Configure the full test build -cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_DEVELOPMENT_BUILD=ON +cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON # 3. Run the actual build cmake --build debug-build @@ -104,6 +109,8 @@ cd Catch2 ./tools/scripts/buildAndTest.sh ``` +A Windows version of the script is available at `tools\scripts\buildAndTest.cmd`. + If you added new tests, you will likely see `ApprovalTests` failure. After you check that the output difference is expected, you should run `tools/scripts/approve.py` to confirm them, and include these changes @@ -129,6 +136,8 @@ should use. It provides you with the top anchor mentioned to link to <a id="top"></a> # Cool feature +> [Introduced](https://github.com/catchorg/Catch2/pull/123456) in Catch2 X.Y.Z + Text that explains how to use the cool feature. @@ -289,9 +298,9 @@ Specifically, every source file should start with the licence header: ``` The include guards for header files should follow the pattern `{FILENAME}_INCLUDED`. -This means that for file `catch_matchers_foo`, the include guard should -be `CATCH_MATCHERS_FOO_INCLUDED`, for `catch_generators_bar`, the include -guard should be `CATCH_GENERATORS_BAR_INCLUDED`, and so on. +This means that for file `catch_matchers_foo.hpp`, the include guard should +be `CATCH_MATCHERS_FOO_HPP_INCLUDED`, for `catch_generators_bar.hpp`, the include +guard should be `CATCH_GENERATORS_BAR_HPP_INCLUDED`, and so on. ## CoC diff --git a/packages/Catch2/docs/deprecations.md b/packages/Catch2/docs/deprecations.md index e56b197a2..2c9bf5517 100644 --- a/packages/Catch2/docs/deprecations.md +++ b/packages/Catch2/docs/deprecations.md @@ -17,13 +17,14 @@ as it can be replaced by `Catch.cmake` that provides the function command line interface instead of parsing C++ code with regular expressions. -## Planned changes - -### 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. - +### `CATCH_CONFIG_BAZEL_SUPPORT` + +Catch2 supports writing the Bazel JUnit XML output file when it is aware +that is within a bazel testing environment. Originally there was no way +to accurately probe the environment for this information so the flag +`CATCH_CONFIG_BAZEL_SUPPORT` was added. This now deprecated. Bazel has now had a change +where it will export `BAZEL_TEST=1` for purposes like the above. Catch2 +will now instead inspect the environment instead of relying on build configuration. --- diff --git a/packages/Catch2/docs/event-listeners.md b/packages/Catch2/docs/event-listeners.md index 623110066..9b706948d 100644 --- a/packages/Catch2/docs/event-listeners.md +++ b/packages/Catch2/docs/event-listeners.md @@ -1,74 +1,43 @@ <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 +An event listener is a bit like a reporter, in that it responds to various +reporter events in Catch2, but it is not expected to write any output. +Instead, an event listener performs actions within the test process, such +as performing global initialization (e.g. of a C library), or cleaning out +in-memory logs if they are not needed (the test case passed). + +Unlike reporters, each registered event listener is always active. Event +listeners are always notified before reporter(s). + +To write your own event listener, you should derive from `Catch::TestEventListenerBase`, +as it provides empty stubs for all reporter events, allowing you to +only override events you care for. Afterwards you have to register it +with Catch2 using `CATCH_REGISTER_LISTENER` macro, so that Catch2 knows +about it and instantiates it before running tests. + +Example event listener: +```cpp +#include <catch2/reporters/catch_reporter_event_listener.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +class testRunListener : public Catch::EventListenerBase { +public: + using Catch::EventListenerBase::EventListenerBase; + + void testRunStarting(Catch::TestRunInfo const&) override { + lib_foo_init(); } }; -CATCH_REGISTER_LISTENER( MyListener ) + +CATCH_REGISTER_LISTENER(testRunListener) ``` _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 ); -``` +[You can find the list of events that the listeners can react to on its +own page](reporter-events.md#top). -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. --- diff --git a/packages/Catch2/docs/faq.md b/packages/Catch2/docs/faq.md new file mode 100644 index 000000000..81d8be680 --- /dev/null +++ b/packages/Catch2/docs/faq.md @@ -0,0 +1,63 @@ +<a id="top"></a> +# Frequently Asked Questions (FAQ) + +**Contents**<br> +[How do I run global setup/teardown only if tests will be run?](#how-do-i-run-global-setupteardown-only-if-tests-will-be-run)<br> +[How do I clean up global state between running different tests?](#how-do-i-clean-up-global-state-between-running-different-tests)<br> +[Why cannot I derive from the built-in reporters?](#why-cannot-i-derive-from-the-built-in-reporters)<br> +[What is Catch2's ABI stability policy?](#what-is-catch2s-abi-stability-policy)<br> +[What is Catch2's API stability policy?](#what-is-catch2s-api-stability-policy)<br> +[Does Catch2 support running tests in parallel?](#does-catch2-support-running-tests-in-parallel)<br> + +## How do I run global setup/teardown only if tests will be run? + +Write a custom [event listener](event-listeners.md#top) and place the +global setup/teardown code into the `testRun*` events. + + +## How do I clean up global state between running different tests? + +Write a custom [event listener](event-listeners.md#top) and place the +cleanup code into either `testCase*` or `testCasePartial*` events, +depending on how often the cleanup needs to happen. + + +## Why cannot I derive from the built-in reporters? + +They are not made to be overriden, in that we do not attempt to maintain +a consistent internal state if a member function is overriden, and by +forbidding users from using them as a base class, we can refactor them +as needed later. + + +## What is Catch2's ABI stability policy? + +Catch2 provides no ABI stability guarantees whatsoever. Catch2 provides +rich C++ interface, and trying to freeze its ABI would take a lot of +pointless work. + +Catch2 is not designed to be distributed as dynamic library, and you +should really be able to compile everything with the same compiler binary. + + +## What is Catch2's API stability policy? + +Catch2 follows [semver](https://semver.org/) to the best of our ability. +This means that we will not knowingly make backwards-incompatible changes +without incrementing the major version number. + + +## Does Catch2 support running tests in parallel? + +Not natively, no. We see running tests in parallel as the job of an +external test runner, that can also run them in separate processes, +support test execution timeouts and so on. + +However, Catch2 provides some tools that make the job of external test +runners easier. [See the relevant section in our page on best +practices](usage-tips.md#parallel-tests). + + +--- + +[Home](Readme.md#top) diff --git a/packages/Catch2/docs/generators.md b/packages/Catch2/docs/generators.md index b8164f829..7a865d436 100644 --- a/packages/Catch2/docs/generators.md +++ b/packages/Catch2/docs/generators.md @@ -114,7 +114,7 @@ a test case, * 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 + * `RangeGenerator<T>(first, last)` -- generates all values inside a `[first, last)` arithmetic range * `IteratorGenerator<T>` -- copies and returns values from an iterator range > `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch2 2.7.0. diff --git a/packages/Catch2/docs/limitations.md b/packages/Catch2/docs/limitations.md index 65483b87b..55c54738a 100644 --- a/packages/Catch2/docs/limitations.md +++ b/packages/Catch2/docs/limitations.md @@ -94,39 +94,57 @@ 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. +Catch2 keeps test execution in one process strictly serial, and there +are no plans to change this. If you find yourself with a test suite +that takes too long to run and yo uwant to make it parallel, you have +to run multiple processes side by side. + +There are 2 basic ways to do that, +* you can split your tests into multiple binaries, and run those binaries + in parallel +* you can run the same test binary multiple times, but run a different + subset of the tests in each process + +There are multiple ways to achieve the latter, the easiest way is to use +[test sharding](command-line.md#test-sharding). + ## 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: + +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 directive is applied to it). This snippet is sufficient +to trigger the compilation error: + ```cpp -#define CATCH_CONFIG_MAIN -#include "catch.hpp" +#include <catch2/catch_test_macros.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`: +Catch2 provides a workaround, by letting the user disable stringification +of the original expression by defining `CATCH_CONFIG_DISABLE_STRINGIFICATION`, +like so: ```cpp -#define CATCH_CONFIG_FAST_COMPILE #define CATCH_CONFIG_DISABLE_STRINGIFICATION -#include "catch.hpp" +#include <catch2/catch_test_macros.hpp> TEST_CASE("test") { CHECK(std::string(R"("\)") == "\"\\"); } ``` -_Do note that this changes the output somewhat_ +_Do note that this changes the output:_ ``` catchwork\test1.cpp(6): PASSED: @@ -135,26 +153,11 @@ 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> +#include <catch2/catch_test_macros.hpp> TEST_CASE("a") { CHECK_THROWS(throw 3); @@ -170,11 +173,6 @@ TEST_CASE("b") { 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 diff --git a/packages/Catch2/docs/list-of-examples.md b/packages/Catch2/docs/list-of-examples.md index 642d4d237..a919408ad 100644 --- a/packages/Catch2/docs/list-of-examples.md +++ b/packages/Catch2/docs/list-of-examples.md @@ -3,7 +3,6 @@ ## 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) diff --git a/packages/Catch2/docs/matchers.md b/packages/Catch2/docs/matchers.md index 6fdb15bfa..0060bfd17 100644 --- a/packages/Catch2/docs/matchers.md +++ b/packages/Catch2/docs/matchers.md @@ -35,10 +35,10 @@ operators, that is `&&`, `||`, and `!`, like so: ```cpp using Catch::Matchers::EndsWith; -using Catch::Matchers::Contains; +using Catch::Matchers::ContainsSubstring; REQUIRE_THAT( getSomeString(), - EndsWith("as a service") && Contains("web scale")); + EndsWith("as a service") && ContainsSubstring("web scale")); ``` The example above asserts that the string returned from `getSomeString` @@ -64,7 +64,7 @@ TEST_CASE("Bugs, bugs, bugs", "[Bug]"){ std::string str = "Bugs as a service"; auto match_expression = Catch::Matchers::EndsWith( "as a service" ) || - (Catch::Matchers::StartsWith( "Big data" ) && !Catch::Matchers::Contains( "web scale" ) ); + (Catch::Matchers::StartsWith( "Big data" ) && !Catch::Matchers::ContainsSubstring( "web scale" ) ); REQUIRE_THAT(str, match_expression); } ``` @@ -88,7 +88,7 @@ Out of the box, Catch2 provides the following matchers: Catch2 provides 5 different matchers that work with `std::string`, * `StartsWith(std::string str, CaseSensitive)`, * `EndsWith(std::string str, CaseSensitive)`, -* `Contains(std::string str, CaseSensitive)`, +* `ContainsSubstring(std::string str, CaseSensitive)`, * `Equals(std::string str, CaseSensitive)`, and * `Matches(std::string str, CaseSensitive)`. @@ -248,7 +248,7 @@ Note that `DerivedException` in the example above has to derive from ### Generic range Matchers -> Generic range matchers were introduced in Catch2 X.Y.Z +> Generic range matchers were introduced in Catch2 3.0.1 Catch2 also provides some matchers that use the new style matchers definitions to handle generic range-like types. These are: @@ -258,6 +258,12 @@ definitions to handle generic range-like types. These are: * `SizeIs(Matcher size_matcher)` * `Contains(T&& target_element, Comparator = std::equal_to<>{})` * `Contains(Matcher element_matcher)` +* `AllMatch(Matcher element_matcher)` +* `NoneMatch(Matcher element_matcher)` +* `AnyMatch(Matcher element_matcher)` +* `AllTrue()` +* `NoneTrue()` +* `AnyTrue()` `IsEmpty` should be self-explanatory. It successfully matches objects that are empty according to either `std::empty`, or ADL-found `empty` @@ -275,6 +281,14 @@ the target element. The other variant is constructed from a matcher, in which case a range is accepted if any of its elements is accepted by the provided matcher. +`AllMatch`, `NoneMatch`, and `AnyMatch` match ranges for which either +all, none, or any of the contained elements matches the given matcher, +respectively. + +`AllTrue`, `NoneTrue`, and `AnyTrue` match ranges for which either +all, none, or any of the contained elements are `true`, respectively. +It works for ranges of `bool`s and ranges of elements (explicitly) +convertible to `bool`. ## Writing custom matchers (old style) @@ -350,7 +364,7 @@ style matchers arbitrarily. ## Writing custom matchers (new style) -> New style matchers were introduced in Catch2 X.Y.Z +> New style matchers were introduced in Catch2 3.0.1 To create a new-style matcher, you have to create your own type that derives from `Catch::Matchers::MatcherGenericBase`. Your type has to diff --git a/packages/Catch2/docs/migrate-v2-to-v3.md b/packages/Catch2/docs/migrate-v2-to-v3.md index 41c4d470e..a9c2bb630 100644 --- a/packages/Catch2/docs/migrate-v2-to-v3.md +++ b/packages/Catch2/docs/migrate-v2-to-v3.md @@ -50,7 +50,8 @@ compilation times in the v3 version. The basic steps to do so are: 1. Change your CMakeLists.txt to link against `Catch2WithMain` target if you use Catch2's default main. (If you do not, keep linking against -the `Catch2` target.) +the `Catch2` target.). If you use pkg-config, change `pkg-config catch2` to +`pkg-config catch2-with-main`. 2. Delete TU with `CATCH_CONFIG_RUNNER` or `CATCH_CONFIG_MAIN` defined, as it is no longer needed. 3. Change `#include <catch2/catch.hpp>` to `#include <catch2/catch_all.hpp>` @@ -64,7 +65,9 @@ to piecemeal includes. You will likely want to start by including [other notes](#other-notes) for further ideas) ## Other notes + * The main test include is now `<catch2/catch_test_macros.hpp>` + * Big "subparts" like Matchers, or Generators, have their own folder, and also their own "big header", so if you just want to include all matchers, you can include `<catch2/matchers/catch_matchers_all.hpp>`, @@ -72,11 +75,21 @@ or `<catch2/generators/catch_generators_all.hpp>` ## Things that can break during porting -* The namespace on Matchers were cleaned up, they are no longer first declared -deep within an internal namespace and then brought up. All Matchers now live -in `Catch::Matchers`. -* The reporter interfaces changed in a breaking manner. If you wrote custom -reporter or listener, you might need to modify them a bit. + +* The namespaces of Matchers were flattened and cleaned up. + +Matchers are no longer declared deep within an internal namespace and +then brought up into `Catch` namespace. All Matchers now live in the +`Catch::Matchers` namespace. + +* The `Contains` string matcher was renamed to `ContainsSubstring`. + +* The reporter interfaces changed in a breaking manner. + +If you are using a custom reporter or listener, you will likely need to +modify them to conform to the new interfaces. Unlike before in v2, +the [interfaces](reporters.md#top) and the [events](reporter-events.md#top) +are now documented. --- diff --git a/packages/Catch2/docs/opensource-users.md b/packages/Catch2/docs/opensource-users.md index f709aa6e7..c65f71851 100644 --- a/packages/Catch2/docs/opensource-users.md +++ b/packages/Catch2/docs/opensource-users.md @@ -17,6 +17,9 @@ maintainer's explicit consent._ ## Libraries & Frameworks +### [accessorpp](https://github.com/wqking/accessorpp) +C++ library for implementing property and data binding. + ### [alpaka](https://github.com/alpaka-group/alpaka) A header-only C++14 abstraction library for accelerator development. @@ -50,6 +53,9 @@ Header-only C++11 library to encode/decode base64, base64url, base32, base32hex ### [DtCraft](https://github.com/twhuang-uiuc/DtCraft) A High-performance Cluster Computing Engine. +### [eventpp](https://github.com/wqking/eventpp) +C++ event library for callbacks, event dispatcher, and event queue. With eventpp you can easily implement signal and slot mechanism, publisher and subscriber pattern, or observer pattern. + ### [forest](https://github.com/xorz57/forest) Template Library of Tree Data Structures. @@ -77,6 +83,9 @@ 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. +### [OpenALpp](https://github.com/Laguna1989/OpenALpp) +A modern OOP C++14 audio library built on OpenAL for Windows, Linux and web (emscripten). + ### [polymorphic_value](https://github.com/jbcoe/polymorphic_value) A polymorphic value-type for C++. @@ -109,6 +118,9 @@ A high available cloud native micro-service application management platform impl ### [ArangoDB](https://github.com/arangodb/arangodb) ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. +### [Cytopia](https://github.com/CytopiaTeam/Cytopia) +Cytopia is a free, open source retro pixel-art city building game with a big focus on mods. It utilizes a custom isometric rendering engine based on SDL2. + ### [d-SEAMS](https://github.com/d-SEAMS/seams-core) Open source molecular dynamics simulation structure analysis suite of tools in modern C++. diff --git a/packages/Catch2/docs/other-macros.md b/packages/Catch2/docs/other-macros.md index 5e7f0af09..24a0fb6e6 100644 --- a/packages/Catch2/docs/other-macros.md +++ b/packages/Catch2/docs/other-macros.md @@ -15,7 +15,7 @@ stringification machinery to the _expr_ and records the result. As with evaluates to `true`. `CHECKED_ELSE( expr )` work similarly, but the block is entered only if the _expr_ evaluated to `false`. -> `CHECKED_X` macros were changed to not count as failure in Catch2 X.Y.Z. +> `CHECKED_X` macros were changed to not count as failure in Catch2 3.0.1. Example: ```cpp @@ -59,9 +59,9 @@ TEST_CASE( "SUCCEED showcase" ) { } ``` -* `STATIC_REQUIRE` +* `STATIC_REQUIRE` and `STATIC_CHECK` -> [Introduced](https://github.com/catchorg/Catch2/issues/1362) in Catch2 2.4.2. +> `STATIC_REQUIRE` was [introduced](https://github.com/catchorg/Catch2/issues/1362) in Catch2 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 @@ -77,6 +77,20 @@ TEST_CASE("STATIC_REQUIRE showcase", "[traits]") { } ``` +> `STATIC_CHECK` was [introduced](https://github.com/catchorg/Catch2/pull/2318) in Catch2 3.0.1. + +`STATIC_CHECK( expr )` is equivalent to `STATIC_REQUIRE( expr )`, with the +difference that when `CATCH_CONFIG_RUNTIME_STATIC_REQUIRE` is defined, it +becomes equivalent to `CHECK` instead of `REQUIRE`. + +Example: +```cpp +TEST_CASE("STATIC_CHECK showcase", "[traits]") { + STATIC_CHECK( std::is_void<void>::value ); + STATIC_CHECK_FALSE( std::is_void<int>::value ); +} +``` + ## Test case related macros * `METHOD_AS_TEST_CASE` diff --git a/packages/Catch2/docs/own-main.md b/packages/Catch2/docs/own-main.md index 6a9b1aadc..26dfa86da 100644 --- a/packages/Catch2/docs/own-main.md +++ b/packages/Catch2/docs/own-main.md @@ -2,63 +2,69 @@ # 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> +[Let Catch2 take full control of args and config](#let-catch2-take-full-control-of-args-and-config)<br> +[Amending the Catch2 config](#amending-the-catch2-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. +The easiest way to use Catch2 is to use its own `main` function, and let +it handle the command line arguments. This is done by linking against +Catch2Main library, e.g. through the [CMake target](cmake-integration.md#cmake-targets), +or pkg-config files. -This is achieved by writing ```#define CATCH_CONFIG_MAIN``` before the ```#include "catch.hpp"``` in *exactly one* source file. +If you want to provide your own `main`, then you should link against +the static library (target) only, without the main part. You will then +have to write your own `main` and call into Catch2 test runner manually. -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. +Below are some basic recipes on what you can do supplying your own main. -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 +## Let Catch2 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. +This is useful if you just need to have code that executes before/after +Catch2 runs tests. -```c++ -#define CATCH_CONFIG_RUNNER -#include "catch.hpp" +```cpp +#include <catch2/catch_session.hpp> int main( int argc, char* argv[] ) { - // global setup... + // your setup ... int result = Catch::Session().run( argc, argv ); - // global clean-up... + // your clean-up... return result; } ``` -## Amending the config +_Note that if you only want to run some set up before tests are run, it +might be simpler to use [event listeners](event-listeners.md#top) instead._ -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" +## Amending the Catch2 config -int main( int argc, char* argv[] ) -{ +If you want Catch2 to process command line arguments, but also want to +programmatically change the resulting configuration of Catch2 run, +you can do it in two ways: + +```c++ +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 + + // 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 @@ -66,38 +72,32 @@ int main( int argc, char* argv[] ) } ``` -Take a look at the definitions of Config and ConfigData to see what you can do with them. +If you want full control of the configuration, don't call `applyCommandLine`. -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" +You can add new command line options to Catch2, by composing the premade +CLI parser (called Clara), and add your own options. -int main( int argc, char* argv[] ) -{ +```cpp +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 + + // Build a new parser on top of Catch2's + using namespace Catch::Clara; + auto cli + = session.cli() // Get Catch2's 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 + + // Now pass the new composite back to Catch2 so it uses that + session.cli( cli ); + + // Let Catch2 (using Clara) parse the command line int returnCode = session.applyCommandLine( argc, argv ); if( returnCode != 0 ) // Indicates a command line error return returnCode; @@ -110,12 +110,13 @@ int main( int argc, char* argv[] ) } ``` -See the [Clara documentation](https://github.com/philsquared/Clara/blob/master/README.md) for more details. +See the [Clara documentation](https://github.com/catchorg/Clara/blob/master/README.md) +for more details on how to use the Clara parser. ## Version detection -Catch provides a triplet of macros providing the header's version, +Catch2 provides a triplet of macros providing the header's version, * `CATCH_VERSION_MAJOR` * `CATCH_VERSION_MINOR` diff --git a/packages/Catch2/docs/release-notes.md b/packages/Catch2/docs/release-notes.md index 7e0f5a8f9..da2c598ce 100644 --- a/packages/Catch2/docs/release-notes.md +++ b/packages/Catch2/docs/release-notes.md @@ -2,7 +2,9 @@ # Release notes **Contents**<br> +[3.1.0](#310)<br> [3.0.1](#301)<br> +[2.13.7](#2137)<br> [2.13.6](#2136)<br> [2.13.5](#2135)<br> [2.13.4](#2134)<br> @@ -48,25 +50,54 @@ [Even Older versions](#even-older-versions)<br> -## 3.0.1 (in progress) +## 3.1.0 + +### Improvements +* Improved suppression of `-Wparentheses` for older GCCs + * Turns out that even GCC 9 does not properly handle `_Pragma`s in the C++ frontend. +* Added type constraints onto `random` generator (#2433) + * These constraints copy what the standard says for the underlying `std::uniform_int_distribution` +* Suppressed -Wunused-variable from nvcc (#2306, #2427) +* Suppressed -Wunused-variable from MinGW (#2132) +* Added All/Any/NoneTrue range matchers (#2319) + * These check that all/any/none of boolean values in a range are true. +* The JUnit reporter now normalizes classnames from C++ namespaces to Java-like namespaces (#2468) + * This provides better support for other JUnit based tools. +* The Bazel support now understands `BAZEL_TEST` environment variable (#2459) + * The `CATCH_CONFIG_BAZEL_SUPPORT` configuration option is also still supported. +* Returned support for compiling Catch2 with GCC 5 (#2448) + * This required removing inherited constructors from Catch2's internals. + * I recommend updating to a newer GCC anyway. +* `catch_discover_tests` now has a new options for setting library load path(s) when running the Catch2 binary (#2467) + + +### Fixes +* Fixed crash when listing listeners without any registered listeners (#2442) +* Fixed nvcc compilation error in constructor benchmarking helper (#2477) +* Catch2's CMakeList supports pre-3.12 CMake again (#2428) + * The gain from requiring CMake 3.12 was very minor, but y'all should really update to newer CMake + + +### Miscellaneous +* Fixed SelfTest build on MinGW (#2447) +* The in-repo conan recipe exports the CMake helper (#2460) +* Added experimental CMake script to showcase using test case sharding together with CTest + * Compared to `catch_discover_tests`, it supports very limited number of options and customization +* Added documentation page on best practices when running Catch2 tests +* Catch2 can be built as a dynamic library (#2397, #2398) + * Note that Catch2 does not have visibility annotations, and you are responsible for ensuring correct visibility built into the resulting library. + + + +## 3.0.1 **Catch2 now uses statically compiled library as its distribution model. This also means that to get all of Catch2's functionality in a test file, you have to include multiple headers.** -For quick'n'dirty migration, you can replace the old `#include <catch2/catch.hpp>` -with `#include <catch2/catch_all.hpp>`. This is a (one of) convenience -header(s) that brings in _all_ of headers in Catch2. By doing this, -you should be able to migrate instantly, but at the cost of (significantly) -increased compilation times. You should prefer piecemeal including -headers that are actually required by your test code. - -The basic set of functionality (`TEST_CASE`, `SECTION`, `REQUIRE`) is in -`catch2/catch_test_macros.hpp`. Matchers are in `matchers` subfolder, -generators in `generators` subfolder, and so on. - -Note that documentation has not yet been updated to account for the -new design. +You probably want to look into the [migration docs](migrate-v2-to-v3.md#top), +which were written to help people coming from v2.x.x versions to the +v3 releases. ### FAQ @@ -131,6 +162,14 @@ new design. * With the exception of the XmlReporter, the outputs of first party reporters should remain the same * New pair of events were added * One obsolete event was removed + * The base class has been renamed + * The built-in reporter class hierarchy has been redone +* Catch2 generates a random seed if one hasn't been specified by the user +* The short flag for `--list-tests`, `-l`, has been removed. + * This is not a commonly used flag and does not need to use up valuable single-letter space. +* The short flag for `--list-tags`, `-t`, has been removed. + * This is not a commonly used flag and does not need to use up valuable single-letter space. +* The `--colour` option has been replaced with `--colour-mode` option ### Improvements @@ -161,6 +200,39 @@ new design. * `--list-*` flags write their output to file specified by the `-o` flag (#2061, #2163) * `Approx::operator()` is now properly `const` * Catch2's internal helper variables no longer use reserved identifiers (#578) +* `--rng-seed` now accepts string `"random-device"` to generate random seed using `std::random_device` +* Catch2 now supports test sharding (#2257) + * You can ask for the tests to be split into N groups and only run one of them. + * This greatly simplifies parallelization of tests in a binary through external runner. +* The embedded CLI parser now supports repeatedly callable lambdas + * A lambda-based option parser can opt into being repeatedly specifiable. +* Added `STATIC_CHECK` macro, similar to `STATIC_REQUIRE` (#2318) + * When deferred tu runtime, it behaves like `CHECK`, and not like `REQUIRE`. +* You can have multiple tests with the same name, as long as other parts of the test identity differ (#1915, #1999, #2175) + * Test identity includes test's name, test's tags and and test's class name if applicable. +* Added new warning, `UnmatchedTestSpec`, to error on test specs with no matching tests +* The `-w`, `--warn` warning flags can now be provided multiple times to enable multiple warnings +* The case-insensitive handling of tags is now more reliable and takes up less memory +* Test case and assertion counting can no longer reasonably overflow on 32 bit systems + * The count is now kept in `uint64_t` on all platforms, instead of using `size_t` type. +* The `-o`, `--out` output destination specifiers recognize `-` as stdout + * You have to provide it as `--out=-` to avoid CLI error about missing option + * The new reporter specification also recognizes `-` as stdout +* Multiple reporters can now run at the same time and write to different files (#1712, #2183) + * To support this, the `-r`, `--reporter` flag now also accepts optional output destination + * For full overview of the semantics of using multiple reporters, look into the reporter documentation + * To enable the new syntax, reporter names can no longer contain `::`. +* Console colour support has been rewritten and significantly improved + * The colour implementation based on ANSI colour codes is always available + * Colour implementations respect their associated stream + * previously e.g. Win32 impl would change console colour even if Catch2 was writing to a file + * The colour API is resilient against changing evaluation order of expressions + * The associated CLI flag and compile-time configuration options have changed + * For details see the docs for command-line and compile-time Catch2 configuration +* Added a support for Bazel integration with `XML_OUTPUT_FILE` env var (#2399) + * This has to be enabled during compilation. +* Added `--skip-benchmarks` flag to run tests without any `BENCHMARK`s (#2392, #2408) +* Added option to list all listeners in the binary via `--list-listeners` ### Fixes @@ -169,6 +241,12 @@ new design. * Various ways of failing a benchmark are now counted and reporter properly * The ULP matcher now handles comparing numbers with different signs properly (#2152) * Universal ADL-found operators should no longer break decomposition (#2121) +* Reporter selection is properly case-insensitive + * Previously it forced lower cased name, which would fail for reporters with upper case characters in name +* The cumulative reporter base stores benchmark results alongside assertion results +* Catch2's SE handling should no longer interferes with ASan on Windows (#2334) +* Fixed Windows console colour handling for tests that redirect stdout (#2345) +* Fixed issue with the `random` generators returning the same value over and over again ### Other changes @@ -182,9 +260,28 @@ new design. * Catch2's pkg-config integration also provides 2 packages * `catch2` is the statically compiled implementation by itself * `catch2-with-main` also links in the default main +* Passing invalid test specifications passed to Catch2 are now reported before tests are run, and are a hard error. +* Running 0 tests (e.g. due to empty binary, or test spec not matching anything) returns non-0 exit code + * Flag `--allow-running-no-tests` overrides this behaviour. + * `NoTests` warning has been removed because it is fully subsumed by this change. +* Catch2's compile-time configuration options (`CATCH_CONFIG_FOO`) can be set through CMake options of the same name + * They use the same semantics as C++ defines, including the `CATCH_CONFIG_NO_FOO` overrides, + * `-DCATCH_CONFIG_DEFAULT_REPORTER=compact` changes default reporter to "compact" + * `-DCATCH_CONFIG_NO_ANDROID_LOGWRITE=ON` forces android logwrite to off + * `-DCATCH_CONFIG_ANDROID_LOGWRITE=OFF` does nothing (the define will not exist) +## 2.13.7 + +### Fixes +* Added missing `<iterator>` include in benchmarking. (#2231) +* Fixed noexcept build with benchmarking enabled (#2235) +* Fixed build for compilers with C++17 support but without C++17 library support (#2195) +* JUnit only uses 3 decimal places when reporting durations (#2221) +* `!mayfail` tagged tests are now marked as `skipped` in JUnit reporter output (#2116) + + ## 2.13.6 ### Fixes diff --git a/packages/Catch2/docs/release-process.md b/packages/Catch2/docs/release-process.md index 1b39b1f26..12d23b7d4 100644 --- a/packages/Catch2/docs/release-process.md +++ b/packages/Catch2/docs/release-process.md @@ -40,14 +40,10 @@ After version number is incremented, single-include header is regenerated and re 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. +We also attach the two amalgamated files as "binaries". -Since 2.5.0, the release tag and the "binaries" (headers) should be PGP -signed. +Since 2.5.0, the release tag and the "binaries" (amalgamated files) should +be PGP signed. #### Signing a tag @@ -57,16 +53,14 @@ 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 +#### Signing the amalgamated files -This will create ASCII-armored signatures for the headers that are -uploaded to the GitHub release: +This will create ASCII-armored signatures for the two amalgamated files +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 +gpg --armor --output extras/catch_amalgamated.hpp.asc --detach-sig extras/catch_amalgamated.hpp +gpg --armor --output extras/catch_amalgamated.cpp.asc --detach-sig extras/catch_amalgamated.cpp ``` _GPG does not support signing multiple files in single invocation._ diff --git a/packages/Catch2/docs/reporter-events.md b/packages/Catch2/docs/reporter-events.md new file mode 100644 index 000000000..7adae53ca --- /dev/null +++ b/packages/Catch2/docs/reporter-events.md @@ -0,0 +1,175 @@ +<a id="top"></a> +# Reporter events + +**Contents**<br> +[Test running events](#test-running-events)<br> +[Benchmarking events](#benchmarking-events)<br> +[Listings events](#listings-events)<br> +[Miscellaneous events](#miscellaneous-events)<br> + +Reporter events are one of the customization points for user code. They +are used by [reporters](reporters.md#top) to customize Catch2's output, +and by [event listeners](event-listeners.md#top) to perform in-process +actions under some conditions. + +There are currently 21 reporter events in Catch2, split between 4 distinct +event groups: +* test running events (10 events) +* benchmarking (4 events) +* listings (3 events) +* miscellaneous (4 events) + +## Test running events + +Test running events are always paired so that for each `fooStarting` event, +there is a `fooEnded` event. This means that the 10 test running events +consist of 5 pairs of events: + +* `testRunStarting` and `testRunEnded`, +* `testCaseStarting` and `testCaseEnded`, +* `testCasePartialStarting` and `testCasePartialEnded`, +* `sectionStarting` and `sectionEnded`, +* `assertionStarting` and `assertionEnded` + +### `testRun` events + +```cpp +void testRunStarting( TestRunInfo const& testRunInfo ); +void testRunEnded( TestRunStats const& testRunStats ); +``` + +The `testRun` events bookend the entire test run. `testRunStarting` is +emitted before the first test case is executed, and `testRunEnded` is +emitted after all the test cases have been executed. + +### `testCase` events + +```cpp +void testCaseStarting( TestCaseInfo const& testInfo ); +void testCaseEnded( TestCaseStats const& testCaseStats ); +``` + +The `testCase` events bookend one _full_ run of a specific test case. +Individual runs through a test case, e.g. due to `SECTION`s or `GENERATE`s, +are handled by a different event. + + +### `testCasePartial` events + +> Introduced in Catch2 3.0.1 + +```cpp +void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ); +void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ); +``` + +`testCasePartial` events bookend one _partial_ run of a specific test case. +This means that for any given test case, these events can be emitted +multiple times, e.g. due to multiple leaf sections. + +In regards to nesting with `testCase` events, `testCasePartialStarting` +will never be emitted before the corresponding `testCaseStarting`, and +`testCasePartialEnded` will always be emitted before the corresponding +`testCaseEnded`. + + +### `section` events + +```cpp +void sectionStarting( SectionInfo const& sectionInfo ); +void sectionEnded( SectionStats const& sectionStats ); +``` + +`section` events are emitted only for active `SECTION`s, that is, sections +that are entered. Sections that are skipped in this test case run-through +do not cause events to be emitted. + +_Note that test cases always contain one implicit section. The event for +this section is emitted after the corresponding `testCasePartialStarting` +event._ + + +### `assertion` events + +```cpp +void assertionStarting( AssertionInfo const& assertionInfo ); +void assertionEnded( AssertionStats const& assertionStats ); +``` + +`assertionStarting` is called after the expression is captured, but before +the assertion expression is evaluated. This might seem like a minor +distinction, but what it means is that if you have assertion like +`REQUIRE( a + b == c + d )`, then what happens is that `a + b` and `c + d` +are evaluated before `assertionStarting` is emitted, while the `==` is +evaluated after the event. + + +## Benchmarking events + +> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch2 2.9.0. + +```cpp +void benchmarkPreparing( StringRef name ) override; +void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override; +void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override; +void benchmarkFailed( StringRef error ) override; +``` + +Due to the benchmark lifecycle being bit more complicated, the benchmarking +events have their own category, even though they could be seen as parallel +to the `assertion*` events. You should expect running a benchmark to +generate at least 2 of the events above. + +To understand the explanation below, you should read the [benchmarking +documentation](benchmarks.md#top) first. + +* `benchmarkPreparing` event is sent after the environmental probe +finishes, but before the user code is first estimated. +* `benchmarkStarting` event is sent after the user code is estimated, +but has not been benchmarked yet. +* `benchmarkEnded` event is sent after the user code has been benchmarked, +and contains the benchmarking results. +* `benchmarkFailed` event is sent if either the estimation or the +benchmarking itself fails. + + +## Listings events + +> Introduced in Catch2 3.0.1. + +Listings events are events that correspond to the test binary being +invoked with `--list-foo` flag. + +There are currently 3 listing events, one for reporters, one for tests, +and one for tags. Note that they are not exclusive to each other. + +```cpp +void listReporters( std::vector<ReporterDescription> const& descriptions ); +void listTests( std::vector<TestCaseHandle> const& tests ); +void listTags( std::vector<TagInfo> const& tagInfos ); +``` + + +## Miscellaneous events + +```cpp +void reportInvalidTestSpec( StringRef unmatchedSpec ); +void fatalErrorEncountered( StringRef error ); +void noMatchingTestCases( StringRef unmatchedSpec ); +``` + +These are one-off events that do not neatly fit into other categories. + +`reportInvalidTestSpec` is sent for each [test specification command line +argument](command-line.md#specifying-which-tests-to-run) that wasn't +parsed into a valid spec. + +`fatalErrorEncountered` is sent when Catch2's POSIX signal handling +or Windows SE handler is called into with a fatal signal/exception. + +`noMatchingTestCases` is sent for each user provided test specification +that did not match any registered tests. + +--- + +[Home](Readme.md#top) diff --git a/packages/Catch2/docs/reporters.md b/packages/Catch2/docs/reporters.md index a33e55bf1..496c61a92 100644 --- a/packages/Catch2/docs/reporters.md +++ b/packages/Catch2/docs/reporters.md @@ -1,46 +1,212 @@ <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. +Reporters are a customization point for most of Catch2's output, e.g. +formatting and writing out [assertions (whether passing or failing), +sections, test cases, benchmarks, and so on](reporter-events.md#top). + +Catch2 comes with a bunch of reporters by default (currently 8), and +you can also write your own reporter. Because multiple reporters can +be active at the same time, your own reporters do not even have to handle +all reporter event, just the ones you are interested in, e.g. benchmarks. + ## 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.: +You can see which reporters are available by running the test binary +with `--list-reporters`. You can then pick one of them with the [`-r`, +`--reporter` option](command-line.md#choosing-a-reporter-to-use), followed +by the name of the desired reporter, like so: + +``` +--reporter xml +``` + +You can also select multiple reporters to be used at the same time. +In that case you should read the [section on using multiple +reporters](#multiple-reporters) to avoid any surprises from doing so. + +<a id="multiple-reporters"></a> +## Using multiple reporters + +> Support for having multiple parallel reporters was [introduced](https://github.com/catchorg/Catch2/pull/2183) in Catch2 3.0.1 + +Catch2 supports using multiple reporters at the same time while having +them write into different destinations. The two main uses of this are + +* having both human-friendly and machine-parseable (e.g. in JUnit format) + output from one run of binary +* having "partial" reporters that are highly specialized, e.g. having one + reporter that writes out benchmark results as markdown tables and does + nothing else, while also having standard testing output separately + +Specifying multiple reporter looks like this: ``` --r xml +--reporter JUnit::out=result-junit.xml --reporter console::out=-::colour-mode=ansi ``` -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: +This tells Catch2 to use two reporters, `JUnit` reporter that writes +its machine-readable XML output to file `result-junit.xml`, and the +`console` reporter that writes its user-friendly output to stdout and +uses ANSI colour codes for colouring the output. -* `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. +Using multiple reporters (or one reporter and one-or-more [event +listeners](event-listener.md#top)) can have surprisingly complex semantics +when using customization points provided to reporters by Catch2, namely +capturing stdout/stderr from test cases. -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`. +As long as at least one reporter (or listener) asks Catch2 to capture +stdout/stderr, captured stdout and stderr will be available to all +reporters and listeners. -* `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. +Because this might be surprising to the users, if at least one active +_reporter_ is non-capturing, then Catch2 tries to roughly emulate +non-capturing behaviour by printing out the captured stdout/stderr +just before `testCasePartialEnded` event is sent out to the active +reporters and listeners. This means that stdout/stderr is no longer +printed out from tests as it is being written, but instead it is written +out in batch after each runthrough of a test case is finished. -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). +You can also write your own custom reporter and tell Catch2 to use it. +When writing your reporter, you have two options: + +* Derive from `Catch::ReporterBase`. When doing this, you will have + to provide handling for all [reporter events](reporter-events.md#top). +* Derive from one of the provided [utility reporter bases in + Catch2](#utility-reporter-bases). + +Generally we recommend doing the latter, as it is less work. + +Apart from overriding handling of the individual reporter events, reporters +have access to some extra customization points, described below. + + +### Utility reporter bases + +Catch2 currently provides two utility reporter bases: + +* `Catch::StreamingReporterBase` +* `Catch::CumulativeReporterBase` + +`StreamingReporterBase` is useful for reporters that can format and write +out the events as they come in. It provides (usually empty) implementation +for all reporter events, and if you let it handle the relevant events, +it also handles storing information about active test run and test case. + +`CumulativeReporterBase` is a base for reporters that need to see the whole +test run, before they can start writing the output, such as the JUnit +and SonarQube reporters. This post-facto approach requires the assertions +to be stringified when it is finished, so that the assertion can be written +out later. Because the stringification can be expensive, and not all +cumulative reporters need the assertions, this base provides customization +point to change whether the assertions are saved or not, separate for +passing and failing assertions. + + +_Generally we recommend that if you override a member function from either +of the bases, you call into the base's implementation first. This is not +necessarily in all cases, but it is safer and easier._ + + +Writing your own reporter then looks like this: + +```cpp +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/catch_test_case_info.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <iostream> + +class PartialReporter : public Catch::StreamingReporterBase { +public: + using StreamingReporterBase::StreamingReporterBase; + + static std::string getDescription() { + return "Reporter for testing TestCasePartialStarting/Ended events"; + } + + void testCasePartialStarting(Catch::TestCaseInfo const& testInfo, + uint64_t partNumber) override { + std::cout << "TestCaseStartingPartial: " << testInfo.name << '#' << partNumber << '\n'; + } + + void testCasePartialEnded(Catch::TestCaseStats const& testCaseStats, + uint64_t partNumber) override { + std::cout << "TestCasePartialEnded: " << testCaseStats.testInfo->name << '#' << partNumber << '\n'; + } +}; + + +CATCH_REGISTER_REPORTER("partial", PartialReporter) +``` + +This create a simple reporter that responds to `testCasePartial*` events, +and calls itself "partial" reporter, so it can be invoked with +`--reporter partial` command line flag. + + +### `ReporterPreferences` + +Each reporter instance contains instance of `ReporterPreferences`, a type +that holds flags for the behaviour of Catch2 when this reporter run. +Currently there are two customization options: + +* `shouldRedirectStdOut` - whether the reporter wants to handle + writes to stdout/stderr from user code, or not. This is useful for + reporters that output machine-parseable output, e.g. the JUnit + reporter, or the XML reporter. +* `shouldReportAllAssertions` - whether the reporter wants to handle + `assertionEnded` events for passing assertions as well as failing + assertions. Usually reporters do not report successful assertions + and don't need them for their output, but sometimes the desired output + format includes passing assertions even without the `-s` flag. + + +### Per-reporter configuration + +> Per-reporter configuration was introduced in Catch2 3.0.1 + +Catch2 supports some configuration to happen per reporter. The configuration +options fall into one of two categories: + +* Catch2-recognized options +* Reporter-specific options + +The former is a small set of universal options that Catch2 handles for +the reporters, e.g. output file or console colour mode. The latter are +options that the reporters have to handle themselves, but the keys and +values can be arbitrary strings, as long as they don't contain `::`. This +allows writing reporters that can be significantly customized at runtime. + +Reporter-specific options always have to be prefixed with "X" (large +letter X). + + +### Other expected functionality of a reporter + +When writing a custom reporter, there are few more things that you should +keep in mind. These are not important for correctness, but they are +important for the reporter to work _nicely_. + +* Catch2 provides a simple verbosity option for users. There are three + verbosity levels, "quiet", "normal", and "high", and if it makes sense + for reporter's output format, it should respond to these by changing + what, and how much, it writes out. + +* Catch2 operates with an rng-seed. Knowing what seed a test run had + is important if you want to replicate it, so your reporter should + report the rng-seed, if at all possible given the target output format. + +* Catch2 also operates with test filters, or test specs. If a filter + is present, you should also report the filter, if at all possible given + the target output format. + + --- diff --git a/packages/Catch2/docs/test-cases-and-sections.md b/packages/Catch2/docs/test-cases-and-sections.md index 7622eef36..613bbd14f 100644 --- a/packages/Catch2/docs/test-cases-and-sections.md +++ b/packages/Catch2/docs/test-cases-and-sections.md @@ -44,7 +44,15 @@ The tag expression, ```"[widget]"``` selects A, B & D. ```"[gadget]"``` selects 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. +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. However, escapes are not +supported however and `[\]]` is not a valid tag. + +The same tag can be specified multiple times for a single test case, +but only one of the instances of identical tags will be kept. Which one +is kept is functionally random. + ### Special Tags @@ -64,7 +72,8 @@ All tag names beginning with non-alphanumeric characters are reserved by Catch. * `[@<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. +* `[!benchmark]` - this test case is actually a benchmark. Currently this only serves to hide the test case by default, to avoid the execution time costs. + ## Tag aliases @@ -145,7 +154,7 @@ Scenario : vector can be sized and resized Then : The size changes ``` -See also [runnable example on godbolt](https://godbolt.org/z/e5vPPM), +See also [runnable example on godbolt](https://godbolt.org/z/eY5a64r99), with a more complicated (and failing) example. > `AND_GIVEN` was [introduced](https://github.com/catchorg/Catch2/issues/1360) in Catch2 2.4.0. @@ -253,10 +262,6 @@ TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product } ``` -_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 Catch2 2.9.0. diff --git a/packages/Catch2/docs/test-fixtures.md b/packages/Catch2/docs/test-fixtures.md index d797214fb..e4747c269 100644 --- a/packages/Catch2/docs/test-fixtures.md +++ b/packages/Catch2/docs/test-fixtures.md @@ -59,7 +59,10 @@ struct Template_Fixture { T m_a; }; -TEMPLATE_TEST_CASE_METHOD(Template_Fixture,"A TEMPLATE_TEST_CASE_METHOD based test run that succeeds", "[class][template]", int, float, double) { +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 ); } @@ -77,7 +80,11 @@ struct Foo_class { } }; -TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Template_Fixture, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test succeeds", "[class][template]", (Foo_class, std::vector), int) { +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 ); } ``` @@ -101,7 +108,12 @@ 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) { +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); } @@ -117,8 +129,13 @@ 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))) -{ +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); } ``` @@ -132,8 +149,10 @@ only difference is the source of types. This allows you to reuse the template ty 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) -{ +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 ); } ``` diff --git a/packages/Catch2/docs/tutorial.md b/packages/Catch2/docs/tutorial.md index f764321fe..55a11714c 100644 --- a/packages/Catch2/docs/tutorial.md +++ b/packages/Catch2/docs/tutorial.md @@ -5,9 +5,8 @@ [Getting Catch2](#getting-catch2)<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> +[BDD style testing](#bdd-style-testing)<br> +[Data and Type driven tests](#data-and-type-driven-tests)<br> [Next steps](#next-steps)<br> @@ -95,7 +94,7 @@ before we move on. * The test automatically self-registers with the test runner, and user does not have do anything more to ensure that it is picked up by the test framework. _Note that you can run specific test, or set of tests, - through the [command line](command-line#top)._ + through the [command line](command-line.md#top)._ * The individual test assertions are written using the `REQUIRE` macro. It accepts a boolean expression, and uses expression templates to internally decompose it, so that it can be individually stringified @@ -113,8 +112,8 @@ Like most test frameworks, Catch2 supports a class-based fixture mechanism, where individual tests are methods on class and setup/teardown can be done in constructor/destructor of the type. -However, idiomatic usage of Catch2 avoids using it in favour of free -standing test cases using _sections_ to share setup and teardown code. +However, their use in Catch2 is rare, because idiomatic Catch2 tests +instead use _sections_ to share setup and teardown code between test code. This is best explained through an example ([code](../examples/100-Fix-Section.cpp)): ```c++ @@ -189,83 +188,38 @@ unreadable. From experience, having section nest more than 3 levels is usually very hard to follow and not worth the removed duplication. -## BDD-Style +## BDD style testing -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). +Catch2 also provides some basic support for BDD-style testing. There are +macro aliases for `TEST_CASE` and `SECTIONS` that you can use so that +the resulting tests read as BDD spec. `SCENARIO` acts as a `TEST_CASE` +with "Scenario: " name prefix. Then there are `GIVEN`, `WHEN`, `THEN` +(and their variants with `AND_` prefix), which act as a `SECTION`, +similarly prefixed with the macro name. -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 -``` +For more details on the macros look at the [test cases and +sections](test-cases-and-sections.md#top) part of the reference docs, +or at the [vector example done with BDD macros](../examples/120-Bdd-ScenarioGivenWhenThen.cpp). -## Type parametrised test cases +## Data and Type driven tests -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. +Test cases in Catch2 can also be driven by types, input data, or both +at the same time. -For more details, see our documentation on [test cases and -sections](test-cases-and-sections.md#type-parametrised-test-cases). +For more details look into the Catch2 reference, either at the +[type parametrized test cases](test-cases-and-sections.md#type-parametrised-test-cases), +or [data generators](generators.md#top). ## 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. +This page is a brief introduction to get you up and running with Catch2, +and to show the basic features of Catch2. The features mentioned here +can get you quite far, but there are many more. However, you can read +about these as you go, in the ever-growing [reference section](Readme.md#top) +of the documentation. -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. --- diff --git a/packages/Catch2/docs/usage-tips.md b/packages/Catch2/docs/usage-tips.md new file mode 100644 index 000000000..8e5c3df11 --- /dev/null +++ b/packages/Catch2/docs/usage-tips.md @@ -0,0 +1,100 @@ +<a id="top"></a> +# Best practices and other tips on using Catch2 + +## Running tests + +Your tests should be run in a manner roughly equivalent with: + +``` +./tests --order rand --warn NoAssertions +``` + +Notice that all the tests are run in a large batch, their relative order +is randomized, and that you ask Catch2 to fail test whose leaf-path +does not contain an assertion. + +The reason I recommend running all your tests in the same process is that +this exposes your tests to interference from their runs. This can be both +positive interference, where the changes in global state from previous +test allow later tests to pass, but also negative interference, where +changes in global state from previous test causes later tests to fail. + +In my experience, interference, especially destructive interference, +usually comes from errors in the code under test, rather than the tests +themselves. This means that by allowing interference to happen, our tests +can find these issues. Obviously, to shake out interference coming from +different orderings of tests, the test order also need to be shuffled +between runs. + +However, running all tests in a single batch eventually becomes impractical +as they will take too long to run, and you will want to run your tests +in parallel. + + +<a id="parallel-tests"></a> +## Running tests in parallel + +There are multiple ways of running tests in parallel, with various level +of structure. If you are using CMake and CTest, then we provide a helper +function [`catch_discover_tests`](cmake-integration.md#automatic-test-registration) +that registers each Catch2 `TEST_CASE` as a single CTest test, which +is then run in a separate process. This is an easy way to set up parallel +tests if you are already using CMake & CTest to run your tests, but you +will lose the advantage of running tests in batches. + + +Catch2 also supports [splitting tests in a binary into multiple +shards](command-line.md#test-sharding). This can be used by any test +runner to run batches of tests in parallel. Do note that when selecting +on the number of shards, you should have more shards than there are cores, +to avoid issues with long running tests getting accidentally grouped in +the same shard, and causing long-tailed execution time. + +**Note that naively composing sharding and random ordering of tests will break.** + +Invoking Catch2 test executable like this + +```text +./tests --order rand --shard-index 0 --shard-count 3 +./tests --order rand --shard-index 1 --shard-count 3 +./tests --order rand --shard-index 2 --shard-count 3 +``` + +does not guarantee covering all tests inside the executable, because +each invocation will have its own random seed, thus it will have its own +random order of tests and thus the partitioning of tests into shards will +be different as well. + +To do this properly, you need the individual shards to share the random +seed, e.g. +```text +./tests --order rand --shard-index 0 --shard-count 3 --rng-seed 0xBEEF +./tests --order rand --shard-index 1 --shard-count 3 --rng-seed 0xBEEF +./tests --order rand --shard-index 2 --shard-count 3 --rng-seed 0xBEEF +``` + +Catch2 actually provides a helper to automatically register multiple shards +as CTest tests, with shared random seed that changes each CTest invocation. +For details look at the documentation of +[`CatchShardTests.cmake` CMake script](cmake-integration.md#catchshardtestscmake). + + +## Organizing tests into binaries + +Both overly large and overly small test binaries can cause issues. Overly +large test binaries have to be recompiled and relinked often, and the +link times are usually also long. Overly small test binaries in turn pay +significant overhead from linking against Catch2 more often per compiled +test case, and also make it hard/impossible to run tests in batches. + +Because there is no hard and fast rule for the right size of a test binary, +I recommend having 1:1 correspondence between libraries in project and test +binaries. (At least if it is possible, in some cases it is not.) Having +a test binary for each library in project keeps related tests together, +and makes tests easy to navigate by reflecting the project's organizational +structure. + + +--- + +[Home](Readme.md#top) diff --git a/packages/Catch2/examples/000-CatchMain.cpp b/packages/Catch2/examples/000-CatchMain.cpp deleted file mode 100644 index 5d06bd989..000000000 --- a/packages/Catch2/examples/000-CatchMain.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// 000-CatchMain.cpp - -// It is generally recommended to have a single file provide the main -// of a testing binary, and other test files to link against it. - -// Let Catch provide main(): -#include <catch2/internal/catch_default_main.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/packages/Catch2/examples/010-TestCase.cpp b/packages/Catch2/examples/010-TestCase.cpp index 70a0b4c10..7ec208d5f 100644 --- a/packages/Catch2/examples/010-TestCase.cpp +++ b/packages/Catch2/examples/010-TestCase.cpp @@ -19,7 +19,7 @@ TEST_CASE( "Factorials of 1 and higher are computed (pass)", "[single-file]" ) { } // Compile & run: -// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 010-TestCase 010-TestCase.cpp && 010-TestCase --success +// - g++ -std=c++14 -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): diff --git a/packages/Catch2/examples/020-TestCase-1.cpp b/packages/Catch2/examples/020-TestCase-1.cpp index 5d7d8de6e..cec55799a 100644 --- a/packages/Catch2/examples/020-TestCase-1.cpp +++ b/packages/Catch2/examples/020-TestCase-1.cpp @@ -10,8 +10,8 @@ TEST_CASE( "1: All test cases reside in other .cpp files (empty)", "[multi-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 +// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 020-TestCase-1.cpp +// - g++ -std=c++14 -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 diff --git a/packages/Catch2/examples/030-Asn-Require-Check.cpp b/packages/Catch2/examples/030-Asn-Require-Check.cpp index f638afae5..0d027ca93 100644 --- a/packages/Catch2/examples/030-Asn-Require-Check.cpp +++ b/packages/Catch2/examples/030-Asn-Require-Check.cpp @@ -8,7 +8,7 @@ // - REQUIRE_FALSE() stops at first failure. // - CHECK_FALSE() continues after failure. -// main() provided in 000-CatchMain.cpp +// main() provided by linkage to Catch2WithMain #include <catch2/catch_test_macros.hpp> @@ -53,8 +53,8 @@ TEST_CASE( "Assert that something is false (continue after failure)", "[check-fa } // 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 +// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 030-Asn-Require-Check 030-Asn-Require-Check.cpp && 030-Asn-Require-Check --success +// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 030-Asn-Require-Check.cpp && 030-Asn-Require-Check --success // Expected compact output (all assertions): // diff --git a/packages/Catch2/examples/100-Fix-Section.cpp b/packages/Catch2/examples/100-Fix-Section.cpp index 6ec5ee803..cfbfa79f9 100644 --- a/packages/Catch2/examples/100-Fix-Section.cpp +++ b/packages/Catch2/examples/100-Fix-Section.cpp @@ -4,7 +4,7 @@ // - Sections (this file) // - Traditional class-based fixtures -// main() provided in 000-CatchMain.cpp +// main() provided by linkage to Catch2WithMain #include <catch2/catch_test_macros.hpp> #include <vector> @@ -45,8 +45,8 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) { } // 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 +// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 100-Fix-Section 100-Fix-Section.cpp && 100-Fix-Section --success +// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 100-Fix-Section.cpp && 100-Fix-Section --success // Expected compact output (all assertions): // diff --git a/packages/Catch2/examples/110-Fix-ClassFixture.cpp b/packages/Catch2/examples/110-Fix-ClassFixture.cpp index 38617a3b9..75c10da62 100644 --- a/packages/Catch2/examples/110-Fix-ClassFixture.cpp +++ b/packages/Catch2/examples/110-Fix-ClassFixture.cpp @@ -4,7 +4,7 @@ // - Sections // - Traditional class-based fixtures (this file) -// main() provided in 000-CatchMain.cpp +// main() provided by linkage to Catch2WithMain #include <catch2/catch_test_macros.hpp> @@ -52,8 +52,11 @@ TEST_CASE_METHOD( UniqueTestsFixture, "Create Employee/Normal", "[create]" ) { } // 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 +// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 110-Fix-ClassFixture 110-Fix-ClassFixture.cpp && 110-Fix-ClassFixture --success +// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 110-Fix-ClassFixture.cpp && 110-Fix-ClassFixture --success +// +// Compile with pkg-config: +// - g++ -std=c++14 -Wall $(pkg-config catch2-with-main --cflags) -o 110-Fix-ClassFixture 110-Fix-ClassFixture.cpp $(pkg-config catch2-with-main --libs) // Expected compact output (all assertions): // diff --git a/packages/Catch2/examples/120-Bdd-ScenarioGivenWhenThen.cpp b/packages/Catch2/examples/120-Bdd-ScenarioGivenWhenThen.cpp index 97336a705..99cdf9ab9 100644 --- a/packages/Catch2/examples/120-Bdd-ScenarioGivenWhenThen.cpp +++ b/packages/Catch2/examples/120-Bdd-ScenarioGivenWhenThen.cpp @@ -1,6 +1,6 @@ // 120-Bdd-ScenarioGivenWhenThen.cpp -// main() provided in 000-CatchMain.cpp +// main() provided by linkage with Catch2WithMain #include <catch2/catch_test_macros.hpp> @@ -48,8 +48,8 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) { } // 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 +// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 120-Bdd-ScenarioGivenWhenThen 120-Bdd-ScenarioGivenWhenThen.cpp && 120-Bdd-ScenarioGivenWhenThen --success +// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 120-Bdd-ScenarioGivenWhenThen.cpp && 120-Bdd-ScenarioGivenWhenThen --success // Expected compact output (all assertions): // diff --git a/packages/Catch2/examples/210-Evt-EventListeners.cpp b/packages/Catch2/examples/210-Evt-EventListeners.cpp index a4b938c90..6cedb885c 100644 --- a/packages/Catch2/examples/210-Evt-EventListeners.cpp +++ b/packages/Catch2/examples/210-Evt-EventListeners.cpp @@ -7,7 +7,7 @@ #include <catch2/catch_test_macros.hpp> #include <catch2/reporters/catch_reporter_event_listener.hpp> -#include <catch2/catch_reporter_registrars.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> #include <catch2/catch_test_case_info.hpp> #include <iostream> @@ -22,7 +22,7 @@ std::string ws(int const level) { } std::ostream& operator<<(std::ostream& out, Catch::Tag t) { - return out << "original: " << t.original << "lower cased: " << t.lowerCased; + return out << "original: " << t.original; } template< typename T > @@ -308,7 +308,7 @@ struct MyListener : Catch::EventListenerBase { using EventListenerBase::EventListenerBase; // inherit constructor // Get rid of Wweak-tables - ~MyListener(); + ~MyListener() override; // The whole test run starting void testRunStarting( Catch::TestRunInfo const& testRunInfo ) override { @@ -420,8 +420,8 @@ TEST_CASE_METHOD( Fixture, "3: Testcase with class-based fixture", "[tag-C][tag- } // 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 +// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 210-Evt-EventListeners 210-Evt-EventListeners.cpp && 210-Evt-EventListeners --success +// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 210-Evt-EventListeners.cpp && 210-Evt-EventListeners --success // Expected compact output (all assertions): // diff --git a/packages/Catch2/extras/Catch.cmake b/packages/Catch2/extras/Catch.cmake index a38851620..bc553591b 100644 --- a/packages/Catch2/extras/Catch.cmake +++ b/packages/Catch2/extras/Catch.cmake @@ -116,6 +116,13 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``. ``--out dir/<test_name>suffix``. This can be used to add a file extension to the output e.g. ".xml". + ``DL_PATHS path...`` + Specifies paths that need to be set for the dynamic linker to find shared + libraries/DLLs when running the test executable (PATH/LD_LIBRARY_PATH respectively). + These paths will both be set when retrieving the list of test cases from the + test executable and when the tests are executed themselves. This requires + cmake/ctest >= 3.22. + #]=======================================================================] #------------------------------------------------------------------------------ @@ -124,7 +131,7 @@ function(catch_discover_tests TARGET) "" "" "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX" - "TEST_SPEC;EXTRA_ARGS;PROPERTIES" + "TEST_SPEC;EXTRA_ARGS;PROPERTIES;DL_PATHS" ${ARGN} ) @@ -135,6 +142,12 @@ function(catch_discover_tests TARGET) set(_TEST_LIST ${TARGET}_TESTS) endif() + if (_DL_PATHS) + if(${CMAKE_VERSION} VERSION_LESS "3.22.0") + message(FATAL_ERROR "The DL_PATHS option requires at least cmake 3.22") + endif() + endif() + ## Generate a unique name based on the extra arguments string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS} ${_REPORTER} ${_OUTPUT_DIR} ${_OUTPUT_PREFIX} ${_OUTPUT_SUFFIX}") string(SUBSTRING ${args_hash} 0 7 args_hash) @@ -164,6 +177,7 @@ function(catch_discover_tests TARGET) -D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}" -D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}" -D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}" + -D "TEST_DL_PATHS=${_DL_PATHS}" -D "CTEST_FILE=${ctest_tests_file}" -P "${_CATCH_DISCOVER_TESTS_SCRIPT}" VERBATIM diff --git a/packages/Catch2/extras/CatchAddTests.cmake b/packages/Catch2/extras/CatchAddTests.cmake index 9210f5a4d..beec3aede 100644 --- a/packages/Catch2/extras/CatchAddTests.cmake +++ b/packages/Catch2/extras/CatchAddTests.cmake @@ -10,10 +10,19 @@ set(reporter ${TEST_REPORTER}) set(output_dir ${TEST_OUTPUT_DIR}) set(output_prefix ${TEST_OUTPUT_PREFIX}) set(output_suffix ${TEST_OUTPUT_SUFFIX}) +set(dl_paths ${TEST_DL_PATHS}) set(script) set(suite) set(tests) +if(WIN32) + set(dl_paths_variable_name PATH) +elseif(APPLE) + set(dl_paths_variable_name DYLD_LIBRARY_PATH) +else() + set(dl_paths_variable_name LD_LIBRARY_PATH) +endif() + function(add_command NAME) set(_args "") # use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments @@ -35,6 +44,12 @@ if(NOT EXISTS "${TEST_EXECUTABLE}") "Specified test executable '${TEST_EXECUTABLE}' does not exist" ) endif() + +if(dl_paths) + cmake_path(CONVERT "${dl_paths}" TO_NATIVE_PATH_LIST paths) + set(ENV{${dl_paths_variable_name}} "${paths}") +endif() + execute_process( COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-tests --verbosity quiet OUTPUT_VARIABLE output @@ -85,6 +100,13 @@ if(output_dir AND NOT IS_ABSOLUTE ${output_dir}) endif() endif() +if(dl_paths) + foreach(path ${dl_paths}) + cmake_path(NATIVE_PATH path native_path) + list(APPEND environment_modifications "${dl_paths_variable_name}=path_list_prepend:${native_path}") + endforeach() +endif() + # Parse output foreach(line ${output}) set(test ${line}) @@ -115,6 +137,14 @@ foreach(line ${output}) WORKING_DIRECTORY "${TEST_WORKING_DIR}" ${properties} ) + + if(environment_modifications) + add_command(set_tests_properties + "${prefix}${test}${suffix}" + PROPERTIES + ENVIRONMENT_MODIFICATION "${environment_modifications}") + endif() + list(APPEND tests "${prefix}${test}${suffix}") endforeach() diff --git a/packages/Catch2/extras/CatchShardTests.cmake b/packages/Catch2/extras/CatchShardTests.cmake new file mode 100644 index 000000000..d3b5e6fcf --- /dev/null +++ b/packages/Catch2/extras/CatchShardTests.cmake @@ -0,0 +1,66 @@ + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +# Supported optional args: +# * SHARD_COUNT - number of shards to split target's tests into +# * REPORTER - reporter spec to use for tests +# * TEST_SPEC - test spec used for filtering tests +function(catch_add_sharded_tests TARGET) + if (${CMAKE_VERSION} VERSION_LESS "3.10.0") + message(FATAL_ERROR "add_sharded_catch_tests only supports CMake versions 3.10.0 and up") + endif() + + cmake_parse_arguments( + "" + "" + "SHARD_COUNT;REPORTER;TEST_SPEC" + "" + ${ARGN} + ) + + if (NOT DEFINED _SHARD_COUNT) + set(_SHARD_COUNT 2) + endif() + + # Generate a unique name based on the extra arguments + string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS} ${_REPORTER} ${_OUTPUT_DIR} ${_OUTPUT_PREFIX} ${_OUTPUT_SUFFIX} ${_SHARD_COUNT}") + string(SUBSTRING ${args_hash} 0 7 args_hash) + + set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-sharded-tests-include-${args_hash}.cmake") + set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-sharded-tests-impl-${args_hash}.cmake") + + 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" + ) + + set_property(DIRECTORY + APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}" + ) + + set(shard_impl_script_file "${CMAKE_CURRENT_LIST_DIR}/CatchShardTestsImpl.cmake") + + add_custom_command( + TARGET ${TARGET} POST_BUILD + BYPRODUCTS "${ctest_tests_file}" + COMMAND "${CMAKE_COMMAND}" + -D "TARGET_NAME=${TARGET}" + -D "TEST_BINARY=$<TARGET_FILE:${TARGET}>" + -D "CTEST_FILE=${ctest_tests_file}" + -D "SHARD_COUNT=${_SHARD_COUNT}" + -D "REPORTER_SPEC=${_REPORTER}" + -D "TEST_SPEC=${_TEST_SPEC}" + -P "${shard_impl_script_file}" + VERBATIM + ) + + +endfunction() diff --git a/packages/Catch2/extras/CatchShardTestsImpl.cmake b/packages/Catch2/extras/CatchShardTestsImpl.cmake new file mode 100644 index 000000000..d18dddef1 --- /dev/null +++ b/packages/Catch2/extras/CatchShardTestsImpl.cmake @@ -0,0 +1,52 @@ + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +# Indirection for CatchShardTests that allows us to delay the script +# file generation until build time. + +# Expected args: +# * TEST_BINARY - full path to the test binary to run sharded +# * CTEST_FILE - full path to ctest script file to write to +# * TARGET_NAME - name of the target to shard (used for test names) +# * SHARD_COUNT - number of shards to split the binary into +# Optional args: +# * REPORTER_SPEC - reporter specs to be passed down to the binary +# * TEST_SPEC - test spec to pass down to the test binary + +if(NOT EXISTS "${TEST_BINARY}") + message(FATAL_ERROR + "Specified test binary '${TEST_BINARY}' does not exist" + ) +endif() + +set(other_args "") +if (TEST_SPEC) + set(other_args "${other_args} ${TEST_SPEC}") +endif() +if (REPORTER_SPEC) + set(other_args "${other_args} --reporter ${REPORTER_SPEC}") +endif() + +# foreach RANGE in cmake is inclusive of the end, so we have to adjust it +math(EXPR adjusted_shard_count "${SHARD_COUNT} - 1") + +file(WRITE "${CTEST_FILE}" + "string(RANDOM LENGTH 8 ALPHABET \"0123456789abcdef\" rng_seed)\n" + "\n" + "foreach(shard_idx RANGE ${adjusted_shard_count})\n" + " add_test(${TARGET_NAME}-shard-" [[${shard_idx}]] "/${adjusted_shard_count}\n" + " ${TEST_BINARY}" + " --shard-index " [[${shard_idx}]] + " --shard-count ${SHARD_COUNT}" + " --rng-seed " [[0x${rng_seed}]] + " --order rand" + "${other_args}" + "\n" + " )\n" + "endforeach()\n" +) diff --git a/packages/Catch2/extras/catch_amalgamated.cpp b/packages/Catch2/extras/catch_amalgamated.cpp index b67149f08..ecda2301b 100644 --- a/packages/Catch2/extras/catch_amalgamated.cpp +++ b/packages/Catch2/extras/catch_amalgamated.cpp @@ -5,8 +5,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.0.0-preview.3 -// Generated: 2020-10-08 13:59:26.616931 +// Catch v3.1.0 +// Generated: 2022-07-17 20:14:05.885021 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -15,11 +15,57 @@ #include "catch_amalgamated.hpp" + + +namespace Catch { + namespace Benchmark { + namespace Detail { + ChronometerConcept::~ChronometerConcept() = default; + } // namespace Detail + } // namespace Benchmark +} // namespace Catch + + + + +namespace Catch { + namespace Benchmark { + namespace Detail { + BenchmarkFunction::callable::~callable() = default; + } // namespace Detail + } // namespace Benchmark +} // namespace Catch + + + +#include <exception> + +namespace Catch { + namespace Benchmark { + namespace Detail { + struct optimized_away_error : std::exception { + const char* what() const noexcept override; + }; + + const char* optimized_away_error::what() const noexcept { + return "could not measure benchmark, maybe it was optimized away"; + } + + void throw_optimized_away_error() { + Catch::throw_exception(optimized_away_error{}); + } + + } // namespace Detail + } // namespace Benchmark +} // namespace Catch + + // Adapted from donated nonius code. #include <cassert> +#include <cstddef> #include <iterator> #include <random> @@ -33,8 +79,8 @@ namespace { using Catch::Benchmark::Detail::sample; template <typename URng, typename Estimator> - sample resample(URng& rng, int resamples, std::vector<double>::iterator first, std::vector<double>::iterator last, Estimator& estimator) { - auto n = last - first; + sample resample(URng& rng, unsigned int resamples, std::vector<double>::iterator first, std::vector<double>::iterator last, Estimator& estimator) { + auto n = static_cast<size_t>(last - first); std::uniform_int_distribution<decltype(n)> dist(0, n - 1); sample out; @@ -42,7 +88,7 @@ using Catch::Benchmark::Detail::sample; 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)]; }); + std::generate_n(std::back_inserter(resampled), n, [first, &dist, &rng] { return first[static_cast<std::ptrdiff_t>(dist(rng))]; }); return estimator(resampled.begin(), resampled.end()); }); std::sort(out.begin(), out.end()); @@ -127,11 +173,15 @@ using Catch::Benchmark::Detail::sample; 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); + 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 ); } } @@ -140,6 +190,15 @@ namespace Catch { namespace Benchmark { namespace Detail { +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + bool directCompare( double lhs, double rhs ) { return lhs == rhs; } +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic pop +#endif + 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); @@ -147,7 +206,9 @@ namespace Catch { double g = idx - j; std::nth_element(first, first + j, last); auto xj = first[j]; - if (g == 0) return xj; + if ( directCompare( g, 0 ) ) { + return xj; + } auto xj1 = *std::min_element(first + (j + 1), last); return xj + g * (xj1 - xj); @@ -179,7 +240,7 @@ namespace Catch { 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 sg = (std::min)(mg_min / 4., sb / std::sqrt(n)); double sg2 = sg * sg; double sb2 = sb * sb; @@ -190,7 +251,7 @@ namespace Catch { 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))); + return static_cast<int>(-2. * k0 / (k1 + std::sqrt(det))); }; auto var_out = [n, sb2, sg2](double c) { @@ -198,11 +259,11 @@ namespace Catch { return (nc / n) * (sb2 - nc * sg2); }; - return std::min(var_out(1), var_out(std::min(c_max(0.), c_max(mg_min)))) / sb2; + 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) { + bootstrap_analysis analyse_samples(double confidence_level, unsigned 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; @@ -249,91 +310,6 @@ namespace Catch { } // namespace Catch -/** \file - * This is a special TU that combines what would otherwise be a very - * small benchmarking-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -//////////////////////////////////////////// -// vvv formerly catch_chronometer.cpp vvv // -//////////////////////////////////////////// - - -namespace Catch { - namespace Benchmark { - namespace Detail { - ChronometerConcept::~ChronometerConcept() = default; - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - -/////////////////////////////////////////////////// -// vvv formerly catch_benchmark_function.cpp vvv // -/////////////////////////////////////////////////// - - -namespace Catch { - namespace Benchmark { - namespace Detail { - BenchmarkFunction::callable::~callable() = default; - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - -//////////////////////////////////////////////// -// vvv formerly catch_complete_invoke.cpp vvv // -//////////////////////////////////////////////// - - -namespace Catch { - namespace Benchmark { - namespace Detail { - CATCH_INTERNAL_START_WARNINGS_SUPPRESSION - CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS - const std::string benchmarkErrorMsg = "a benchmark failed to run successfully"; - CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - - - -///////////////////////////////////////////////// -// vvv formerly catch_run_for_at_least.cpp vvv // -///////////////////////////////////////////////// - -#include <exception> - -namespace Catch { - namespace Benchmark { - namespace Detail { - struct optimized_away_error : std::exception { - const char* what() const noexcept override; - }; - - const char* optimized_away_error::what() const noexcept { - return "could not measure benchmark, maybe it was optimized away"; - } - - void throw_optimized_away_error() { - Catch::throw_exception(optimized_away_error{}); - } - - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - #include <cmath> #include <limits> @@ -351,7 +327,7 @@ bool marginComparison(double lhs, double rhs, double margin) { namespace Catch { Approx::Approx ( double value ) - : m_epsilon( std::numeric_limits<float>::epsilon()*100 ), + : m_epsilon( std::numeric_limits<float>::epsilon()*100. ), m_margin( 0.0 ), m_scale( 0.0 ), m_value( value ) @@ -495,7 +471,7 @@ namespace Catch { : expr; } - std::string AssertionResult::getMessage() const { + StringRef AssertionResult::getMessage() const { return m_resultData.message; } SourceLineInfo AssertionResult::getSourceInfo() const { @@ -510,13 +486,40 @@ namespace Catch { +namespace { + bool provideBazelReporterOutput() { +#ifdef CATCH_CONFIG_BAZEL_SUPPORT + return true; +#else + +# if defined( _MSC_VER ) + // On Windows getenv throws a warning as there is no input validation, + // since the switch is hardcoded, this should not be an issue. +# pragma warning( push ) +# pragma warning( disable : 4996 ) +# endif + + return std::getenv( "BAZEL_TEST" ) != nullptr; + +# if defined( _MSC_VER ) +# pragma warning( pop ) +# endif +#endif + } +} namespace Catch { - Config::Config( ConfigData const& data ) - : m_data( data ), - m_stream( openStream() ) - { + bool operator==( ProcessedReporterSpec const& lhs, + ProcessedReporterSpec const& rhs ) { + return lhs.name == rhs.name && + lhs.outputFilename == rhs.outputFilename && + lhs.colourMode == rhs.colourMode && + lhs.customOptions == rhs.customOptions; + } + + Config::Config( ConfigData const& data ): + m_data( data ) { // We need to trim filter specs to avoid trouble with superfluous // whitespace (esp. important for bdd macros, as those are manually // aligned with whitespace). @@ -528,6 +531,7 @@ namespace Catch { elem = trim(elem); } + TestSpecParser parser(ITagAliasRegistry::get()); if (!m_data.testsOrTags.empty()) { m_hasTestFilters = true; @@ -536,25 +540,86 @@ namespace Catch { } } m_testSpec = parser.testSpec(); - } - Config::~Config() = default; + // Insert the default reporter if user hasn't asked for a specfic one + if ( m_data.reporterSpecifications.empty() ) { + m_data.reporterSpecifications.push_back( { +#if defined( CATCH_CONFIG_DEFAULT_REPORTER ) + CATCH_CONFIG_DEFAULT_REPORTER, +#else + "console", +#endif + {}, {}, {} + } ); + } - std::string const& Config::getFilename() const { - return m_data.outputFilename ; + if(provideBazelReporterOutput()){ + // Register a JUnit reporter for Bazel. Bazel sets an environment + // variable with the path to XML output. If this file is written to + // during test, Bazel will not generate a default XML output. + // This allows the XML output file to contain higher level of detail + // than what is possible otherwise. +# if defined( _MSC_VER ) + // On Windows getenv throws a warning as there is no input validation, + // since the key is hardcoded, this should not be an issue. +# pragma warning( push ) +# pragma warning( disable : 4996 ) +# endif + const auto bazelOutputFilePtr = std::getenv( "XML_OUTPUT_FILE" ); +# if defined( _MSC_VER ) +# pragma warning( pop ) +# endif + if ( bazelOutputFilePtr != nullptr ) { + m_data.reporterSpecifications.push_back( + { "junit", std::string( bazelOutputFilePtr ), {}, {} } ); + } + } + + + // We now fixup the reporter specs to handle default output spec, + // default colour spec, etc + bool defaultOutputUsed = false; + for ( auto const& reporterSpec : m_data.reporterSpecifications ) { + // We do the default-output check separately, while always + // using the default output below to make the code simpler + // and avoid superfluous copies. + if ( reporterSpec.outputFile().none() ) { + CATCH_ENFORCE( !defaultOutputUsed, + "Internal error: cannot use default output for " + "multiple reporters" ); + defaultOutputUsed = true; + } + + m_processedReporterSpecs.push_back( ProcessedReporterSpec{ + reporterSpec.name(), + reporterSpec.outputFile() ? *reporterSpec.outputFile() + : data.defaultOutputFilename, + reporterSpec.colourMode().valueOr( data.defaultColourMode ), + reporterSpec.customOptions() } ); + } } + Config::~Config() = default; + + bool Config::listTests() const { return m_data.listTests; } 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; } + bool Config::listListeners() const { return m_data.listListeners; } std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; } std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; } + std::vector<ReporterSpec> const& Config::getReporterSpecs() const { + return m_data.reporterSpecifications; + } + + std::vector<ProcessedReporterSpec> const& + Config::getProcessedReporterSpecs() const { + return m_processedReporterSpecs; + } + TestSpec const& Config::testSpec() const { return m_testSpec; } bool Config::hasTestFilters() const { return m_hasTestFilters; } @@ -562,31 +627,34 @@ namespace Catch { // 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; } + StringRef 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); } + bool Config::warnAboutMissingAssertions() const { + return !!( m_data.warnings & WarnAbout::NoAssertions ); + } + bool Config::warnAboutUnmatchedTestSpecs() const { + return !!( m_data.warnings & WarnAbout::UnmatchedTestSpec ); + } + bool Config::zeroTestsCountAsSuccess() const { return m_data.allowZeroTests; } ShowDurations Config::showDurations() const { return m_data.showDurations; } double Config::minDuration() const { return m_data.minDuration; } TestRunOrder Config::runOrder() const { return m_data.runOrder; } - unsigned int Config::rngSeed() const { return m_data.rngSeed; } - UseColour Config::useColour() const { return m_data.useColour; } + uint32_t Config::rngSeed() const { return m_data.rngSeed; } + unsigned int Config::shardCount() const { return m_data.shardCount; } + unsigned int Config::shardIndex() const { return m_data.shardIndex; } + ColourMode Config::defaultColourMode() const { return m_data.defaultColourMode; } 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::skipBenchmarks() const { return m_data.skipBenchmarks; } bool Config::benchmarkNoAnalysis() const { return m_data.benchmarkNoAnalysis; } - int Config::benchmarkSamples() const { return m_data.benchmarkSamples; } + unsigned 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 @@ -598,13 +666,6 @@ namespace Catch { //////////////////////////////////////////////////////////////////////////// - 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 ) { @@ -613,7 +674,7 @@ namespace Catch { } ScopedMessage::ScopedMessage( ScopedMessage&& old ) noexcept: - m_info( std::move( old.m_info ) ) { + m_info( CATCH_MOVE( old.m_info ) ) { old.m_moved = true; } @@ -729,16 +790,16 @@ namespace Catch { public: // IMutableRegistryHub void registerReporter( std::string const& name, IReporterFactoryPtr factory ) override { - m_reporterRegistry.registerReporter( name, std::move(factory) ); + m_reporterRegistry.registerReporter( name, CATCH_MOVE(factory) ); } - void registerListener( IReporterFactoryPtr factory ) override { - m_reporterRegistry.registerListener( std::move(factory) ); + void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) override { + m_reporterRegistry.registerListener( CATCH_MOVE(factory) ); } void registerTest( Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker ) override { - m_testCaseRegistry.registerTest( std::move(testInfo), std::move(invoker) ); + m_testCaseRegistry.registerTest( CATCH_MOVE(testInfo), CATCH_MOVE(invoker) ); } - void registerTranslator( const IExceptionTranslator* translator ) override { - m_exceptionTranslatorRegistry.registerTranslator( translator ); + void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) override { + m_exceptionTranslatorRegistry.registerTranslator( CATCH_MOVE(translator) ); } void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override { m_tagAliasRegistry.add( alias, tag, lineInfo ); @@ -786,6 +847,7 @@ namespace Catch { #include <algorithm> +#include <cassert> #include <iomanip> #include <set> @@ -794,58 +856,78 @@ namespace Catch { namespace { const int MaxExitCode = 255; - IStreamingReporterPtr createReporter(std::string const& reporterName, IConfig const* config) { - auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config); - CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'"); + IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) { + auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config)); + CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << '\''); return reporter; } - IStreamingReporterPtr makeReporter(Config const* config) { - if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { - return createReporter(config->getReporterName(), config); + IEventListenerPtr prepareReporters(Config const* config) { + if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty() + && config->getProcessedReporterSpecs().size() == 1) { + auto const& spec = config->getProcessedReporterSpecs()[0]; + return createReporter( + spec.name, + ReporterConfig( config, + makeStream( spec.outputFilename ), + spec.colourMode, + spec.customOptions ) ); } - // On older platforms, returning unique_ptr<ListeningReporter> - // when the return type is 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 = Detail::unique_ptr<IStreamingReporter>(new ListeningReporter); - auto& multi = static_cast<ListeningReporter&>(*ret); + auto multi = Detail::make_unique<MultiReporter>(config); + auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); for (auto const& listener : listeners) { - multi.addListener(listener->create(Catch::ReporterConfig(config))); + multi->addListener(listener->create(config)); } - multi.addReporter(createReporter(config->getReporterName(), config)); - return ret; + + std::size_t reporterIdx = 0; + for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) { + multi->addReporter( createReporter( + reporterSpec.name, + ReporterConfig( config, + makeStream( reporterSpec.outputFilename ), + reporterSpec.colourMode, + reporterSpec.customOptions ) ) ); + reporterIdx++; + } + + return multi; } class TestGroup { public: - explicit TestGroup(IStreamingReporterPtr&& reporter, Config const* config): + explicit TestGroup(IEventListenerPtr&& reporter, Config const* config): m_reporter(reporter.get()), m_config{config}, - m_context{config, std::move(reporter)} { + m_context{config, CATCH_MOVE(reporter)} { - auto const& allTestCases = getAllTestCasesSorted(*m_config); - m_matches = m_config->testSpec().matchesByFilter(allTestCases, *m_config); - auto const& invalidArgs = m_config->testSpec().getInvalidArgs(); + assert( m_config->testSpec().getInvalidSpecs().empty() && + "Invalid test specs should be handled before running tests" ); - if (m_matches.empty() && invalidArgs.empty()) { - for (auto const& test : allTestCases) - if (!test.getTestCaseInfo().isHidden()) - m_tests.emplace(&test); + auto const& allTestCases = getAllTestCasesSorted(*m_config); + auto const& testSpec = m_config->testSpec(); + if ( !testSpec.hasFilters() ) { + for ( auto const& test : allTestCases ) { + if ( !test.getTestCaseInfo().isHidden() ) { + m_tests.emplace( &test ); + } + } } else { - for (auto const& match : m_matches) - m_tests.insert(match.tests.begin(), match.tests.end()); + m_matches = + testSpec.matchesByFilter( allTestCases, *m_config ); + for ( auto const& match : m_matches ) { + m_tests.insert( match.tests.begin(), + match.tests.end() ); + } } + + m_tests = createShard(m_tests, m_config->shardCount(), m_config->shardIndex()); } 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); @@ -855,28 +937,26 @@ namespace Catch { for (auto const& match : m_matches) { if (match.tests.empty()) { - m_reporter->noMatchingTestCases(match.name); - totals.error = -1; + m_unmatchedTestSpecs = true; + m_reporter->noMatchingTestCases( match.name ); } } - if (!invalidArgs.empty()) { - for (auto const& invalidArg: invalidArgs) - m_reporter->reportInvalidArguments(invalidArg); - } - - m_context.testGroupEnded(m_config->name(), totals, 1, 1); return totals; } - private: - using Tests = std::set<TestCaseHandle const*>; + bool hadUnmatchedTestSpecs() const { + return m_unmatchedTestSpecs; + } - IStreamingReporter* m_reporter; + + private: + IEventListener* m_reporter; Config const* m_config; RunContext m_context; - Tests m_tests; + std::set<TestCaseHandle const*> m_tests; TestSpec::Matches m_matches; + bool m_unmatchedTestSpecs = false; }; void applyFilenamesAsTags() { @@ -902,14 +982,17 @@ namespace Catch { getCurrentMutableContext().setConfig(m_config.get()); m_startupExceptions = true; - Colour colourGuard( Colour::Red ); - Catch::cerr() << "Errors occurred during startup!" << '\n'; + auto errStream = makeStream( "%stderr" ); + auto colourImpl = makeColourImpl( + ColourMode::PlatformDefault, errStream.get() ); + auto guard = colourImpl->guardColour( Colour::Red ); + errStream->stream() << "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() << TextFlow::Column( ex.what() ).indent(2) << '\n'; + errStream->stream() << TextFlow::Column( ex.what() ).indent(2) << '\n'; } } } @@ -924,16 +1007,16 @@ namespace Catch { 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; + << "\nCatch2 v" << libraryVersion() << '\n' + << m_cli << '\n' + << "For more detailed usage please see the project docs\n\n" << std::flush; } 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; + << std::left << std::setw(16) << "framework: " << "Catch2\n" + << std::left << std::setw(16) << "version: " << libraryVersion() << '\n' << std::flush; } int Session::applyCommandLine( int argc, char const * const * argv ) { @@ -941,15 +1024,19 @@ namespace Catch { return 1; auto result = m_cli.parse( Clara::Args( argc, argv ) ); + if( !result ) { config(); getCurrentMutableContext().setConfig(m_config.get()); - Catch::cerr() - << Colour( Colour::Red ) + auto errStream = makeStream( "%stderr" ); + auto colour = makeColourImpl( ColourMode::PlatformDefault, errStream.get() ); + + errStream->stream() + << colour->guardColour( Colour::Red ) << "\nError(s) in input:\n" << TextFlow::Column( result.errorMessage() ).indent( 2 ) << "\n\n"; - Catch::cerr() << "Run with -? for usage\n" << std::endl; + errStream->stream() << "Run with -? for usage\n\n" << std::flush; return MaxExitCode; } @@ -957,6 +1044,7 @@ namespace Catch { showHelp(); if( m_configData.libIdentify ) libIdentify(); + m_config.reset(); return 0; } @@ -992,12 +1080,12 @@ namespace Catch { int Session::run() { if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { - Catch::cout() << "...waiting for enter/ return before starting" << std::endl; + Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush; 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; + Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << '\n' << std::flush; static_cast<void>(std::getchar()); } return exitCode; @@ -1026,6 +1114,14 @@ namespace Catch { return 0; } + if ( m_configData.shardIndex >= m_configData.shardCount ) { + Catch::cerr() << "The shard count (" << m_configData.shardCount + << ") must be greater than the shard index (" + << m_configData.shardIndex << ")\n" + << std::flush; + return 1; + } + CATCH_TRY { config(); // Force config to be constructed @@ -1039,27 +1135,43 @@ namespace Catch { getCurrentMutableContext().setConfig(m_config.get()); // Create reporter(s) so we can route listings through them - auto reporter = makeReporter(m_config.get()); + auto reporter = prepareReporters(m_config.get()); + + auto const& invalidSpecs = m_config->testSpec().getInvalidSpecs(); + if ( !invalidSpecs.empty() ) { + for ( auto const& spec : invalidSpecs ) { + reporter->reportInvalidTestSpec( spec ); + } + return 1; + } + // Handle list request if (list(*reporter, *m_config)) { return 0; } - TestGroup tests { std::move(reporter), m_config.get() }; + TestGroup tests { CATCH_MOVE(reporter), m_config.get() }; auto const totals = tests.execute(); - if( m_config->warnAboutNoTests() && totals.error == -1 ) + if ( tests.hadUnmatchedTestSpecs() + && m_config->warnAboutUnmatchedTestSpecs() ) { + return 3; + } + + if ( totals.testCases.total() == 0 + && !m_config->zeroTestsCountAsSuccess() ) { 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))); + return (std::min) (MaxExitCode, static_cast<int>(totals.assertions.failed)); } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch( std::exception& ex ) { - Catch::cerr() << ex.what() << std::endl; + Catch::cerr() << ex.what() << '\n' << std::flush; return MaxExitCode; } #endif @@ -1069,6 +1181,22 @@ namespace Catch { + +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(); + } + } + +} + + + #include <cassert> #include <cctype> #include <algorithm> @@ -1117,7 +1245,7 @@ namespace Catch { else if( tag == "!nonportable"_sr ) return TestCaseProperties::NonPortable; else if( tag == "!benchmark"_sr ) - return static_cast<TestCaseProperties>(TestCaseProperties::Benchmark | TestCaseProperties::IsHidden ); + return TestCaseProperties::Benchmark | TestCaseProperties::IsHidden; else return TestCaseProperties::None; } @@ -1159,16 +1287,25 @@ namespace Catch { const size_t extras = 3 + 3; return extractFilenamePart(filepath).size() + extras; } + } // end unnamed namespace + + bool operator<( Tag const& lhs, Tag const& rhs ) { + Detail::CaseInsensitiveLess cmp; + return cmp( lhs.original, rhs.original ); + } + bool operator==( Tag const& lhs, Tag const& rhs ) { + Detail::CaseInsensitiveEqualTo cmp; + return cmp( lhs.original, rhs.original ); } Detail::unique_ptr<TestCaseInfo> - makeTestCaseInfo(std::string const& _className, + makeTestCaseInfo(StringRef _className, NameAndTags const& nameAndTags, SourceLineInfo const& _lineInfo ) { return Detail::make_unique<TestCaseInfo>(_className, nameAndTags, _lineInfo); } - TestCaseInfo::TestCaseInfo(std::string const& _className, + TestCaseInfo::TestCaseInfo(StringRef _className, NameAndTags const& _nameAndTags, SourceLineInfo const& _lineInfo): name( _nameAndTags.name.empty() ? makeDefaultName() : _nameAndTags.name ), @@ -1180,7 +1317,6 @@ namespace Catch { // (including optional hidden tag and filename tag) auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file); backingTags.reserve(requiredSize); - backingLCaseTags.reserve(requiredSize); // We cannot copy the tags directly, as we need to normalize // some tags, so that [.foo] is copied as [.][foo]. @@ -1204,6 +1340,7 @@ namespace Catch { // it over to backing storage and actually reference the // backing storage in the saved tags StringRef tagStr = originalTags.substr(tagStart+1, tagEnd - tagStart - 1); + CATCH_ENFORCE(!tagStr.empty(), "Empty tags are not allowed"); enforceNotReservedTag(tagStr, lineInfo); properties |= parseSpecialTag(tagStr); // When copying a tag to the backing storage, we need to @@ -1225,9 +1362,8 @@ namespace Catch { } // Sort and prepare tags - toLowerInPlace(backingLCaseTags); - std::sort(begin(tags), end(tags), [](Tag lhs, Tag rhs) { return lhs.lowerCased < rhs.lowerCased; }); - tags.erase(std::unique(begin(tags), end(tags), [](Tag lhs, Tag rhs) {return lhs.lowerCased == rhs.lowerCased; }), + std::sort(begin(tags), end(tags)); + tags.erase(std::unique(begin(tags), end(tags)), end(tags)); } @@ -1273,24 +1409,22 @@ namespace Catch { backingTags += tagStr; const auto backingEnd = backingTags.size(); backingTags += ']'; - backingLCaseTags += '['; - // We append the tag to the lower-case backing storage as-is, - // because we will perform the lower casing later, in bulk - backingLCaseTags += tagStr; - backingLCaseTags += ']'; - tags.emplace_back(StringRef(backingTags.c_str() + backingStart, backingEnd - backingStart), - StringRef(backingLCaseTags.c_str() + backingStart, backingEnd - backingStart)); - } - - - bool TestCaseHandle::operator == ( TestCaseHandle const& rhs ) const { - return m_invoker == rhs.m_invoker - && m_info->name == rhs.m_info->name - && m_info->className == rhs.m_info->className; + tags.emplace_back(StringRef(backingTags.c_str() + backingStart, backingEnd - backingStart)); } - bool TestCaseHandle::operator < ( TestCaseHandle const& rhs ) const { - return m_info->name < rhs.m_info->name; + bool operator<( TestCaseInfo const& lhs, TestCaseInfo const& rhs ) { + // We want to avoid redoing the string comparisons multiple times, + // so we store the result of a three-way comparison before using + // it in the actual comparison logic. + const auto cmpName = lhs.name.compare( rhs.name ); + if ( cmpName != 0 ) { + return cmpName < 0; + } + const auto cmpClassName = lhs.className.compare( rhs.className ); + if ( cmpClassName != 0 ) { + return cmpClassName < 0; + } + return lhs.tags < rhs.tags; } TestCaseInfo const& TestCaseHandle::getTestCaseInfo() const { @@ -1330,15 +1464,13 @@ namespace Catch { TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString ) : Pattern( filterString ) - , m_tag( toLower( tag ) ) + , m_tag( tag ) {} bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const { - return std::find_if(begin(testCase.tags), - end(testCase.tags), - [&](Tag const& tag) { - return tag.lowerCased == m_tag; - }) != end(testCase.tags); + return std::find( begin( testCase.tags ), + end( testCase.tags ), + Tag( m_tag ) ) != end( testCase.tags ); } bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const { @@ -1390,8 +1522,8 @@ namespace Catch { return matches; } - const TestSpec::vectorStrings& TestSpec::getInvalidArgs() const{ - return (m_invalidArgs); + const TestSpec::vectorStrings& TestSpec::getInvalidSpecs() const { + return m_invalidSpecs; } } @@ -1400,49 +1532,13 @@ namespace Catch { #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; + static auto getCurrentNanosecondsSinceEpoch() -> uint64_t { + return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); } - } - auto getEstimatedClockResolution() -> uint64_t { - static auto s_resolution = estimateClockResolution(); - return s_resolution; - } + } // end unnamed namespace void Timer::start() { m_nanoseconds = getCurrentNanosecondsSinceEpoch(); @@ -1464,12 +1560,6 @@ namespace Catch { } // namespace Catch -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wexit-time-destructors" -# pragma clang diagnostic ignored "-Wglobal-constructors" -#endif - #include <cmath> @@ -1479,8 +1569,6 @@ namespace Catch { namespace Detail { - const std::string unprintableString = "{?}"; - namespace { const int hexThreshold = 255; @@ -1517,6 +1605,48 @@ namespace Detail { } } // end unnamed namespace + std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string ret; + // This is enough for the "don't escape invisibles" case, and a good + // lower bound on the "escape invisibles" case. + ret.reserve(string.size() + 2); + + if (!escape_invisibles) { + ret += '"'; + ret += string; + ret += '"'; + return ret; + } + + ret += '"'; + for (char c : string) { + switch (c) { + case '\r': + ret.append("\\r"); + break; + case '\n': + ret.append("\\n"); + break; + case '\t': + ret.append("\\t"); + break; + case '\f': + ret.append("\\f"); + break; + default: + ret.push_back(c); + break; + } + } + ret += '"'; + + return ret; + } + + std::string convertIntoString(StringRef string) { + return convertIntoString(string, getCurrentContext().getConfig()->showInvisibles()); + } + 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; @@ -1543,44 +1673,25 @@ namespace Detail { //// ======================================================= //// 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; + return Detail::convertIntoString( str ); } #ifdef CATCH_CONFIG_CPP17_STRING_VIEW std::string StringMaker<std::string_view>::convert(std::string_view str) { - return ::Catch::Detail::stringify(std::string{ str }); + return Detail::convertIntoString( StringRef( str.data(), str.size() ) ); } #endif std::string StringMaker<char const*>::convert(char const* str) { if (str) { - return ::Catch::Detail::stringify(std::string{ str }); + return Detail::convertIntoString( str ); } else { return{ "{null string}" }; } } std::string StringMaker<char*>::convert(char* str) { if (str) { - return ::Catch::Detail::stringify(std::string{ str }); + return Detail::convertIntoString( str ); } else { return{ "{null string}" }; } @@ -1693,14 +1804,9 @@ std::string StringMaker<double>::convert(double value) { } // end namespace Catch -#if defined(__clang__) -# pragma clang diagnostic pop -#endif - - -namespace Catch { +namespace Catch { Counts Counts::operator - ( Counts const& other ) const { Counts diff; @@ -1717,7 +1823,7 @@ namespace Catch { return *this; } - std::size_t Counts::total() const { + std::uint64_t Counts::total() const { return passed + failed + failedButOk; } bool Counts::allPassed() const { @@ -1784,28 +1890,13 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 3, 0, 0, "preview", 3 ); + static Version version( 3, 1, 0, "", 0 ); return version; } } -/** \file - * This is a special TU that combines what would otherwise be a very - * small generator-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -//////////////////////////////////////////////////// -// vvv formerly catch_generator_exception.cpp vvv // -//////////////////////////////////////////////////// namespace Catch { @@ -1817,9 +1908,6 @@ namespace Catch { } // end namespace Catch -/////////////////////////////////////////// -// vvv formerly catch_generators.cpp vvv // -/////////////////////////////////////////// namespace Catch { @@ -1846,121 +1934,102 @@ namespace Detail { } // namespace Catch -/** \file - * This is a special TU that combines what would otherwise be a very - * small interfaces-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ -/////////////////////////////////////////////////// -// vvv formerly catch_interfaces_capture.cpp vvv // -/////////////////////////////////////////////////// -namespace Catch { - IResultCapture::~IResultCapture() = default; -} +std::uint32_t Catch::Generators::Detail::getSeed() { return sharedRng()(); } -////////////////////////////////////////////////// -// vvv formerly catch_interfaces_config.cpp vvv // -////////////////////////////////////////////////// namespace Catch { - IConfig::~IConfig() = default; + IResultCapture::~IResultCapture() = default; } -///////////////////////////////////////////////////// -// vvv formerly catch_interfaces_exception.cpp vvv // -///////////////////////////////////////////////////// namespace Catch { - IExceptionTranslator::~IExceptionTranslator() = default; - IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default; + IConfig::~IConfig() = default; } -//////////////////////////////////////////////////////// -// vvv formerly catch_interfaces_registry_hub.cpp vvv // -//////////////////////////////////////////////////////// namespace Catch { - IRegistryHub::~IRegistryHub() = default; - IMutableRegistryHub::~IMutableRegistryHub() = default; + IExceptionTranslator::~IExceptionTranslator() = default; + IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default; } -////////////////////////////////////////////////// -// vvv formerly catch_interfaces_runner.cpp vvv // -////////////////////////////////////////////////// +#include <string> namespace Catch { - IRunner::~IRunner() = default; -} - - -//////////////////////////////////////////////////// -// vvv formerly catch_interfaces_testcase.cpp vvv // -//////////////////////////////////////////////////// + namespace Generators { + bool GeneratorUntypedBase::countedNext() { + auto ret = next(); + if ( ret ) { + m_stringReprCache.clear(); + ++m_currentElementIndex; + } + return ret; + } -namespace Catch { - ITestInvoker::~ITestInvoker() = default; - ITestCaseRegistry::~ITestCaseRegistry() = default; -} + StringRef GeneratorUntypedBase::currentElementAsString() const { + if ( m_stringReprCache.empty() ) { + m_stringReprCache = stringifyImpl(); + } + return m_stringReprCache; + } + } // namespace Generators +} // namespace Catch -namespace Catch { - IReporterRegistry::~IReporterRegistry() = default; -} namespace Catch { - IReporterFactory::~IReporterFactory() = default; + IRegistryHub::~IRegistryHub() = default; + IMutableRegistryHub::~IMutableRegistryHub() = default; } #include <algorithm> +#include <cassert> #include <iomanip> namespace Catch { - ReporterConfig::ReporterConfig( IConfig const* _fullConfig ) - : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} + ReporterConfig::ReporterConfig( + IConfig const* _fullConfig, + Detail::unique_ptr<IStream> _stream, + ColourMode colourMode, + std::map<std::string, std::string> customOptions ): + m_stream( CATCH_MOVE(_stream) ), + m_fullConfig( _fullConfig ), + m_colourMode( colourMode ), + m_customOptions( CATCH_MOVE( customOptions ) ) {} - ReporterConfig::ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream ) - : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - - std::ostream& ReporterConfig::stream() const { return *m_stream; } + Detail::unique_ptr<IStream> ReporterConfig::takeStream() && { + assert( m_stream ); + return CATCH_MOVE( m_stream ); + } IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; } + ColourMode ReporterConfig::colourMode() const { return m_colourMode; } + std::map<std::string, std::string> const& + ReporterConfig::customOptions() const { + return m_customOptions; + } - 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 ) - {} + ReporterConfig::~ReporterConfig() = default; - AssertionStats::AssertionStats( AssertionResult const& _assertionResult, - std::vector<MessageInfo> const& _infoMessages, - Totals const& _totals ) + AssertionStats::AssertionStats( AssertionResult const& _assertionResult, + std::vector<MessageInfo> const& _infoMessages, + Totals const& _totals ) : assertionResult( _assertionResult ), infoMessages( _infoMessages ), totals( _totals ) @@ -2002,20 +2071,6 @@ namespace Catch { {} - 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 ) - {} - - TestRunStats::TestRunStats( TestRunInfo const& _runInfo, Totals const& _totals, bool _aborting ) @@ -2024,93 +2079,39 @@ namespace Catch { aborting( _aborting ) {} - void IStreamingReporter::fatalErrorEncountered( StringRef ) {} + IEventListener::~IEventListener() = default; - void IStreamingReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) { - Catch::cout() << "Available reporters:\n"; - const auto maxNameLen = std::max_element(descriptions.begin(), descriptions.end(), - [](ReporterDescription const& lhs, ReporterDescription const& rhs) { return lhs.name.size() < rhs.name.size(); }) - ->name.size(); +} // end namespace Catch - for (auto const& desc : descriptions) { - if (config.verbosity() == Verbosity::Quiet) { - Catch::cout() - << TextFlow::Column(desc.name) - .indent(2) - .width(5 + maxNameLen) << '\n'; - } else { - Catch::cout() - << TextFlow::Column(desc.name + ":") - .indent(2) - .width(5 + maxNameLen) - + TextFlow::Column(desc.description) - .initialIndent(0) - .indent(2) - .width(CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8) - << '\n'; - } - } - Catch::cout() << std::endl; - } - void IStreamingReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) { - if (config.hasTestFilters()) { - Catch::cout() << "Matching test cases:\n"; - } else { - Catch::cout() << "All available test cases:\n"; - } - for (auto const& test : tests) { - auto const& testCaseInfo = test.getTestCaseInfo(); - Colour::Code colour = testCaseInfo.isHidden() - ? Colour::SecondaryText - : Colour::None; - Colour colourGuard(colour); - Catch::cout() << TextFlow::Column(testCaseInfo.name).initialIndent(2).indent(4) << '\n'; - if (config.verbosity() >= Verbosity::High) { - Catch::cout() << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << std::endl; - } - if (!testCaseInfo.tags.empty() && config.verbosity() > Verbosity::Quiet) { - Catch::cout() << TextFlow::Column(testCaseInfo.tagsAsString()).indent(6) << '\n'; - } - } +namespace Catch { + IReporterFactory::~IReporterFactory() = default; + EventListenerFactory::~EventListenerFactory() = default; +} - if (!config.hasTestFilters()) { - Catch::cout() << pluralise(tests.size(), "test case") << '\n' << std::endl; - } else { - Catch::cout() << pluralise(tests.size(), "matching test case") << '\n' << std::endl; - } - } - void IStreamingReporter::listTags(std::vector<TagInfo> const& tags, IConfig const& config) { - if (config.hasTestFilters()) { - Catch::cout() << "Tags for matching test cases:\n"; - } else { - Catch::cout() << "All available tags:\n"; - } - for (auto const& tagCount : tags) { - ReusableStringStream rss; - rss << " " << std::setw(2) << tagCount.count << " "; - auto str = rss.str(); - auto wrapper = TextFlow::Column(tagCount.all()) - .initialIndent(0) - .indent(str.size()) - .width(CATCH_CONFIG_CONSOLE_WIDTH - 10); - Catch::cout() << str << wrapper << '\n'; - } - Catch::cout() << pluralise(tags.size(), "tag") << '\n' << std::endl; - } -} // end namespace Catch +namespace Catch { + IReporterRegistry::~IReporterRegistry() = default; +} + + + + +namespace Catch { + ITestInvoker::~ITestInvoker() = default; + ITestCaseRegistry::~ITestCaseRegistry() = default; +} namespace Catch { AssertionHandler::AssertionHandler - ( StringRef const& macroName, + ( StringRef macroName, SourceLineInfo const& lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition ) @@ -2121,7 +2122,7 @@ namespace Catch { void AssertionHandler::handleExpr( ITransientExpression const& expr ) { m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction ); } - void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef const& message) { + void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef message) { m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction ); } @@ -2172,14 +2173,45 @@ namespace Catch { // 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 ) { + void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) { handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString ); } } // namespace Catch + + +#include <algorithm> + +namespace Catch { + namespace Detail { + + bool CaseInsensitiveLess::operator()( StringRef lhs, + StringRef rhs ) const { + return std::lexicographical_compare( + lhs.begin(), lhs.end(), + rhs.begin(), rhs.end(), + []( char l, char r ) { return toLower( l ) < toLower( r ); } ); + } + + bool + CaseInsensitiveEqualTo::operator()( StringRef lhs, + StringRef rhs ) const { + return std::equal( + lhs.begin(), lhs.end(), + rhs.begin(), rhs.end(), + []( char l, char r ) { return toLower( l ) == toLower( r ); } ); + } + + } // namespace Detail +} // namespace Catch + + + + #include <algorithm> +#include <ostream> namespace { bool isOptPrefix( char c ) { @@ -2282,7 +2314,7 @@ namespace Catch { } else { return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + - source + "'" ); + source + '\'' ); } return ParserResult::ok( ParseResultType::Matched ); } @@ -2399,7 +2431,7 @@ namespace Catch { return Detail::InternalParseResult::runtimeError( "Expected argument following " + token.token); - auto result = valueRef->setValue(argToken.token); + const auto result = valueRef->setValue(argToken.token); if (!result) return Detail::InternalParseResult(result); if (result.value() == @@ -2614,347 +2646,217 @@ namespace Catch { } // namespace Catch -/** \file - * This is a special TU that combines what would otherwise be a very - * small top-level TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -//////////////////////////////////////////////////////// -// vvv formerly catch_tag_alias_autoregistrar.cpp vvv // -//////////////////////////////////////////////////////// +#include <fstream> +#include <string> 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(); - } - } + Clara::Parser makeCommandLineParser( ConfigData& config ) { -} + using namespace Clara; + auto const setWarning = [&]( std::string const& warning ) { + if ( warning == "NoAssertions" ) { + config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::NoAssertions); + return ParserResult::ok( ParseResultType::Matched ); + } else if ( warning == "UnmatchedTestSpec" ) { + config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::UnmatchedTestSpec); + return ParserResult::ok( ParseResultType::Matched ); + } -////////////////////////////////////////// -// vvv formerly catch_polyfills.cpp vvv // -////////////////////////////////////////// + return ParserResult ::runtimeError( + "Unrecognised warning option: '" + warning + '\'' ); + }; + 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 + '\'' ); -#include <cmath> + 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 ); -namespace Catch { + return ParserResult::ok( ParseResultType::Matched ); + }; + auto const setTestOrder = [&]( std::string const& order ) { + if( startsWith( "declared", order ) ) + config.runOrder = TestRunOrder::Declared; + else if( startsWith( "lexical", order ) ) + config.runOrder = TestRunOrder::LexicographicallySorted; + else if( startsWith( "random", order ) ) + config.runOrder = TestRunOrder::Randomized; + else + return ParserResult::runtimeError( "Unrecognised ordering: '" + order + '\'' ); + return ParserResult::ok( ParseResultType::Matched ); + }; + auto const setRngSeed = [&]( std::string const& seed ) { + if( seed == "time" ) { + config.rngSeed = generateRandomSeed(GenerateFrom::Time); + return ParserResult::ok(ParseResultType::Matched); + } else if (seed == "random-device") { + config.rngSeed = generateRandomSeed(GenerateFrom::RandomDevice); + return ParserResult::ok(ParseResultType::Matched); + } -#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 + CATCH_TRY { + std::size_t parsedTo = 0; + unsigned long parsedSeed = std::stoul(seed, &parsedTo, 0); + if (parsedTo != seed.size()) { + return ParserResult::runtimeError("Could not parse '" + seed + "' as seed"); + } -} // end namespace Catch + // TODO: Ideally we could parse unsigned int directly, + // but the stdlib doesn't provide helper for that + // type. After this is refactored to use fixed size + // type, we should check the parsed value is in range + // of the underlying type. + config.rngSeed = static_cast<unsigned int>(parsedSeed); + return ParserResult::ok(ParseResultType::Matched); + } CATCH_CATCH_ANON(std::exception const&) { + return ParserResult::runtimeError("Could not parse '" + seed + "' as seed"); + } + }; + auto const setDefaultColourMode = [&]( std::string const& colourMode ) { + Optional<ColourMode> maybeMode = Catch::Detail::stringToColourMode(toLower( colourMode )); + if ( !maybeMode ) { + return ParserResult::runtimeError( + "colour mode must be one of: default, ansi, win32, " + "or none. '" + + colourMode + "' is not recognised" ); + } + auto mode = *maybeMode; + if ( !isColourImplAvailable( mode ) ) { + return ParserResult::runtimeError( + "colour mode '" + colourMode + + "' is not supported in this binary" ); + } + config.defaultColourMode = mode; + 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& userReporterSpec ) { + if ( userReporterSpec.empty() ) { + return ParserResult::runtimeError( "Received empty reporter spec." ); + } + Optional<ReporterSpec> parsed = + parseReporterSpec( userReporterSpec ); + if ( !parsed ) { + return ParserResult::runtimeError( + "Could not parse reporter spec '" + userReporterSpec + + "'" ); + } -//////////////////////////////////////////////////// -// vvv formerly catch_uncaught_exceptions.cpp vvv // -//////////////////////////////////////////////////// + auto const& reporterSpec = *parsed; + IReporterRegistry::FactoryMap const& factories = + getRegistryHub().getReporterRegistry().getFactories(); + auto result = factories.find( reporterSpec.name() ); -#include <exception> + if ( result == factories.end() ) { + return ParserResult::runtimeError( + "Unrecognized reporter, '" + reporterSpec.name() + + "'. Check available with --list-reporters" ); + } -namespace Catch { - bool uncaught_exceptions() { -#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) - return false; -#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) - return std::uncaught_exceptions() > 0; -#else - return std::uncaught_exception(); -#endif - } -} // end namespace Catch + const bool hadOutputFile = reporterSpec.outputFile().some(); + config.reporterSpecifications.push_back( CATCH_MOVE( *parsed ) ); + // It would be enough to check this only once at the very end, but + // there is not a place where we could call this check, so do it + // every time it could fail. For valid inputs, this is still called + // at most once. + if (!hadOutputFile) { + int n_reporters_without_file = 0; + for (auto const& spec : config.reporterSpecifications) { + if (spec.outputFile().none()) { + n_reporters_without_file++; + } + } + if (n_reporters_without_file > 1) { + return ParserResult::runtimeError( "Only one reporter may have unspecified output file." ); + } + } -//////////////////////////////////////////// -// vvv formerly catch_errno_guard.cpp vvv // -//////////////////////////////////////////// + return ParserResult::ok( ParseResultType::Matched ); + }; + auto const setShardCount = [&]( std::string const& shardCount ) { + CATCH_TRY{ + std::size_t parsedTo = 0; + int64_t parsedCount = std::stoll(shardCount, &parsedTo, 0); + if (parsedTo != shardCount.size()) { + return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count"); + } + if (parsedCount <= 0) { + return ParserResult::runtimeError("Shard count must be a positive number"); + } -#include <cerrno> + config.shardCount = static_cast<unsigned int>(parsedCount); + return ParserResult::ok(ParseResultType::Matched); + } CATCH_CATCH_ANON(std::exception const&) { + return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count"); + } + }; -namespace Catch { - ErrnoGuard::ErrnoGuard():m_oldErrno(errno){} - ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; } -} + auto const setShardIndex = [&](std::string const& shardIndex) { + CATCH_TRY{ + std::size_t parsedTo = 0; + int64_t parsedIndex = std::stoll(shardIndex, &parsedTo, 0); + if (parsedTo != shardIndex.size()) { + return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index"); + } + if (parsedIndex < 0) { + return ParserResult::runtimeError("Shard index must be a non-negative number"); + } + config.shardIndex = static_cast<unsigned int>(parsedIndex); + return ParserResult::ok(ParseResultType::Matched); + } CATCH_CATCH_ANON(std::exception const&) { + return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index"); + } + }; -/////////////////////////////////////////// -// vvv formerly catch_decomposer.cpp vvv // -/////////////////////////////////////////// - -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; - } -} - - -/////////////////////////////////////////////////////////// -// vvv formerly catch_startup_exception_registry.cpp vvv // -/////////////////////////////////////////////////////////// - -namespace Catch { -#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) - 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; - } -#endif - -} // end namespace Catch - - -////////////////////////////////////////////// -// vvv formerly catch_leak_detector.cpp vvv // -////////////////////////////////////////////// - - -#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 // ^^ Windows crt debug heap enabled // Windows crt debug heap disabled vv - - Catch::LeakDetector::LeakDetector() {} - -#endif // CATCH_CONFIG_WINDOWS_CRTDBG - -Catch::LeakDetector::~LeakDetector() { - Catch::cleanUp(); -} - - -///////////////////////////////////////////// -// vvv formerly catch_message_info.cpp vvv // -///////////////////////////////////////////// - - -namespace Catch { - - MessageInfo::MessageInfo( StringRef const& _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - type( _type ), - sequence( ++globalCount ) - {} - - // This may need protecting if threading support is added - unsigned int MessageInfo::globalCount = 0; - -} // end namespace Catch - - - - -////////////////////////////////////////// -// vvv formerly catch_lazy_expr.cpp vvv // -////////////////////////////////////////// - -namespace Catch { - - 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; - } - -} // namespace Catch - - - - -#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 = TestRunOrder::Declared; - else if( startsWith( "lexical", order ) ) - config.runOrder = TestRunOrder::LexicographicallySorted; - else if( startsWith( "random", order ) ) - config.runOrder = TestRunOrder::Randomized; - else - return 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" ) @@ -2967,10 +2869,10 @@ namespace Catch { | Opt( config.showInvisibles ) ["-i"]["--invisibles"] ( "show invisibles (tabs, newlines)" ) - | Opt( config.outputFilename, "filename" ) + | Opt( config.defaultOutputFilename, "filename" ) ["-o"]["--out"] - ( "output filename" ) - | Opt( setReporter, "name" ) + ( "default output filename" ) + | Opt( accept_many, setReporter, "name[::key=value]*" ) ["-r"]["--reporter"] ( "reporter to use (defaults to console)" ) | Opt( config.name, "name" ) @@ -2982,7 +2884,7 @@ namespace Catch { | Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" ) ["-x"]["--abortx"] ( "abort after x failures" ) - | Opt( setWarning, "warning name" ) + | Opt( accept_many, setWarning, "warning name" ) ["-w"]["--warn"] ( "enable warnings" ) | Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" ) @@ -3003,24 +2905,36 @@ namespace Catch { | Opt( setVerbosity, "quiet|normal|high" ) ["-v"]["--verbosity"] ( "set output verbosity" ) + | Opt( config.listTests ) + ["--list-tests"] + ( "list all/matching test cases" ) + | Opt( config.listTags ) + ["--list-tags"] + ( "list all/matching tags" ) | Opt( config.listReporters ) ["--list-reporters"] - ( "list all reporters" ) + ( "list all available reporters" ) + | Opt( config.listListeners ) + ["--list-listeners"] + ( "list all listeners" ) | Opt( setTestOrder, "decl|lex|rand" ) ["--order"] ( "test case order (defaults to decl)" ) - | Opt( setRngSeed, "'time'|number" ) + | Opt( setRngSeed, "'time'|'random-device'|number" ) ["--rng-seed"] ( "set a specific seed for random numbers" ) - | Opt( setColourUsage, "yes|no" ) - ["--use-colour"] - ( "should output be colourised" ) + | Opt( setDefaultColourMode, "ansi|win32|none|default" ) + ["--colour-mode"] + ( "what color mode should be used as default" ) | 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.skipBenchmarks) + ["--skip-benchmarks"] + ( "disable running benchmarks") | Opt( config.benchmarkSamples, "samples" ) ["--benchmark-samples"] ( "number of samples to collect (default: 100)" ) @@ -3036,6 +2950,15 @@ namespace Catch { | Opt( config.benchmarkWarmupTime, "benchmarkWarmupTime" ) ["--benchmark-warmup-time"] ( "amount of time in milliseconds spent on warming up each test (default: 100)" ) + | Opt( setShardCount, "shard count" ) + ["--shard-count"] + ( "split the tests to execute into this many groups" ) + | Opt( setShardIndex, "shard index" ) + ["--shard-index"] + ( "index of the group of tests to execute (see --shard-count)" ) | + Opt( config.allowZeroTests ) + ["--allow-running-no-tests"] + ( "Treat 'No tests run' as a success" ) | Arg( config.testsOrTags, "test name|pattern|tags" ) ( "which test or tests to use" ); @@ -3045,87 +2968,113 @@ namespace Catch { } // end namespace Catch +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wexit-time-destructors" +#endif + + -#include <cstring> +#include <cassert> #include <ostream> +#include <utility> 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)); - } + ColourImpl::~ColourImpl() = default; - 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; + ColourImpl::ColourGuard ColourImpl::guardColour( Colour::Code colourCode ) { + return ColourGuard(colourCode, this ); } -} // end namespace Catch + void ColourImpl::ColourGuard::engageImpl( std::ostream& stream ) { + assert( &stream == &m_colourImpl->m_stream->stream() && + "Engaging colour guard for different stream than used by the " + "parent colour implementation" ); + static_cast<void>( stream ); + m_engaged = true; + m_colourImpl->use( m_code ); + } -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wexit-time-destructors" -#endif + ColourImpl::ColourGuard::ColourGuard( Colour::Code code, + ColourImpl const* colour ): + m_colourImpl( colour ), m_code( code ) { + } + ColourImpl::ColourGuard::ColourGuard( ColourGuard&& rhs ) noexcept: + m_colourImpl( rhs.m_colourImpl ), + m_code( rhs.m_code ), + m_engaged( rhs.m_engaged ) { + rhs.m_engaged = false; + } + ColourImpl::ColourGuard& + ColourImpl::ColourGuard::operator=( ColourGuard&& rhs ) noexcept { + using std::swap; + swap( m_colourImpl, rhs.m_colourImpl ); + swap( m_code, rhs.m_code ); + swap( m_engaged, rhs.m_engaged ); + return *this; + } + ColourImpl::ColourGuard::~ColourGuard() { + if ( m_engaged ) { + m_colourImpl->use( Colour::None ); + } + } + ColourImpl::ColourGuard& + ColourImpl::ColourGuard::engage( std::ostream& stream ) & { + engageImpl( stream ); + return *this; + } -#include <ostream> + ColourImpl::ColourGuard&& + ColourImpl::ColourGuard::engage( std::ostream& stream ) && { + engageImpl( stream ); + return CATCH_MOVE(*this); + } -namespace Catch { namespace { + //! A do-nothing implementation of colour, used as fallback for unknown + //! platforms, and when the user asks to deactivate all colours. + class NoColourImpl : public ColourImpl { + public: + NoColourImpl( IStream* stream ): ColourImpl( stream ) {} - struct IColourImpl { - virtual ~IColourImpl() = default; - virtual void use( Colour::Code _colourCode ) = 0; + private: + void use( Colour::Code ) const override {} }; + } // namespace - 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 ) ///////////////////////////////////////// +#if defined ( CATCH_CONFIG_COLOUR_WIN32 ) ///////////////////////////////////////// namespace Catch { namespace { - class Win32ColourImpl : public IColourImpl { + class Win32ColourImpl : public ColourImpl { public: - Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) - { + Win32ColourImpl(IStream* stream): + ColourImpl(stream) { CONSOLE_SCREEN_BUFFER_INFO csbiInfo; - GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); + GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), + &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 { + static bool useImplementationForStream(IStream const& stream) { + // Win32 text colour APIs can only be used on console streams + // We cannot check that the output hasn't been redirected, + // so we just check that the original stream is console stream. + return stream.isConsole(); + } + + private: + void use( Colour::Code _colourCode ) const override { switch( _colourCode ) { case Colour::None: return setTextAttribute( originalForegroundAttributes ); case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); @@ -3149,45 +3098,63 @@ namespace { } } - private: - void setTextAttribute( WORD _textAttribute ) { - SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes ); + void setTextAttribute( WORD _textAttribute ) const { + SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), + _textAttribute | + originalBackgroundAttributes ); } - HANDLE stdoutHandle; WORD originalForegroundAttributes; WORD originalBackgroundAttributes; }; - IColourImpl* platformColourInstance() { - static Win32ColourImpl s_instance; - - auto const* config = getCurrentContext().getConfig(); - UseColour 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 ) ////////////////////////////////////// +#endif // Windows/ ANSI/ None + -#include <unistd.h> +#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) +# define CATCH_INTERNAL_HAS_ISATTY +# include <unistd.h> +#endif 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 { + class ANSIColourImpl : public ColourImpl { public: - void use( Colour::Code _colourCode ) override { + ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {} + + static bool useImplementationForStream(IStream const& stream) { + // This is kinda messy due to trying to support a bunch of + // different platforms at once. + // The basic idea is that if we are asked to do autodetection (as + // opposed to being told to use posixy colours outright), then we + // only want to use the colours if we are writing to console. + // However, console might be redirected, so we make an attempt at + // checking for that on platforms where we know how to do that. + bool useColour = stream.isConsole(); +#if defined( CATCH_INTERNAL_HAS_ISATTY ) && \ + !( defined( __DJGPP__ ) && defined( __STRICT_ANSI__ ) ) + ErrnoGuard _; // for isatty + useColour = useColour && isatty( STDOUT_FILENO ); +# endif +# if defined( CATCH_PLATFORM_MAC ) || defined( CATCH_PLATFORM_IPHONE ) + useColour = useColour && !isDebuggerActive(); +# endif + + return useColour; + } + + private: + void use( Colour::Code _colourCode ) const override { + auto setColour = [&out = + m_stream->stream()]( char const* escapeCode ) { + // The escape sequence must be flushed to console, otherwise + // if stdin and stderr are intermixed, we'd get accidentally + // coloured output. + out << '\033' << escapeCode << std::flush; + }; switch( _colourCode ) { case Colour::None: case Colour::White: return setColour( "[0m" ); @@ -3208,89 +3175,56 @@ namespace { default: CATCH_INTERNAL_ERROR( "Unknown colour requested" ); } } - static IColourImpl* instance() { - static PosixColourImpl s_instance; - return &s_instance; - } - - private: - void setColour( const char* _escapeCode ) { - // The escape sequence must be flushed to console, otherwise if - // stdin and stderr are intermixed, we'd get accidentally coloured output. - getCurrentContext().getConfig()->stream() - << '\033' << _escapeCode << std::flush; - } }; - 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; - auto const* config = getCurrentContext().getConfig(); - UseColour 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 + Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection, + IStream* stream ) { +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) + if ( implSelection == ColourMode::Win32 ) { + return Detail::make_unique<Win32ColourImpl>( stream ); + } +#endif + if ( implSelection == ColourMode::ANSI ) { + return Detail::make_unique<ANSIColourImpl>( stream ); + } + if ( implSelection == ColourMode::None ) { + return Detail::make_unique<NoColourImpl>( stream ); + } -namespace Catch { + if ( implSelection == ColourMode::PlatformDefault) { +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) + if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { + return Detail::make_unique<Win32ColourImpl>( stream ); + } +#endif + if ( ANSIColourImpl::useImplementationForStream( *stream ) ) { + return Detail::make_unique<ANSIColourImpl>( stream ); + } + return Detail::make_unique<NoColourImpl>( stream ); + } - 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; + CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(implSelection) ); } - 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 ); + bool isColourImplAvailable( ColourMode colourSelection ) { + switch ( colourSelection ) { +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) + case ColourMode::Win32: +#endif + case ColourMode::ANSI: + case ColourMode::None: + case ColourMode::PlatformDefault: + return true; + default: + return false; } } - std::ostream& operator << ( std::ostream& os, Colour const& ) { - return os; - } } // end namespace Catch @@ -3309,9 +3243,6 @@ namespace Catch { IResultCapture* getResultCapture() override { return m_resultCapture; } - IRunner* getRunner() override { - return m_runner; - } IConfig const* getConfig() const override { return m_config; @@ -3323,9 +3254,6 @@ namespace Catch { void setResultCapture( IResultCapture* resultCapture ) override { m_resultCapture = resultCapture; } - void setRunner( IRunner* runner ) override { - m_runner = runner; - } void setConfig( IConfig const* config ) override { m_config = config; } @@ -3334,7 +3262,6 @@ namespace Catch { private: IConfig const* m_config = nullptr; - IRunner* m_runner = nullptr; IResultCapture* m_resultCapture = nullptr; }; @@ -3354,7 +3281,7 @@ namespace Catch { Context::~Context() = default; - SimplePcg32& rng() { + SimplePcg32& sharedRng() { static SimplePcg32 s_rng; return s_rng; } @@ -3363,6 +3290,10 @@ namespace Catch { + + +#include <ostream> + #if defined(CATCH_CONFIG_ANDROID_LOGWRITE) #include <android/log.h> @@ -3436,7 +3367,7 @@ namespace Catch { 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; + Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n\n" << std::flush; return false; } @@ -3500,7 +3431,24 @@ namespace Catch { namespace Catch { bool isDebuggerActive() { return false; } } -#endif // Platform +#endif // Platform + + + + +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; + } +} @@ -3542,7 +3490,7 @@ namespace Catch { namespace Catch { - IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() {} + IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() = default; namespace Detail { @@ -3550,7 +3498,7 @@ namespace Catch { // 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 ":" + // Find last occurrence of ":" size_t name_start = enumInstance.size(); while (name_start > 0 && enumInstance[name_start - 1] != ':') { --name_start; @@ -3604,38 +3552,53 @@ namespace Catch { + +#include <cerrno> + +namespace Catch { + ErrnoGuard::ErrnoGuard():m_oldErrno(errno){} + ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; } +} + + + namespace Catch { ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() { } - void ExceptionTranslatorRegistry::registerTranslator( const IExceptionTranslator* translator ) { - m_translators.push_back( Detail::unique_ptr<const IExceptionTranslator>( translator ) ); + void ExceptionTranslatorRegistry::registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) { + m_translators.push_back( CATCH_MOVE( translator ) ); } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) std::string ExceptionTranslatorRegistry::translateActiveException() const { + // Compiling a mixed mode project with MSVC means that CLR + // exceptions will be caught in (...) as well. However, these do + // 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."; + } + + // First we try user-registered translators. If none of them can + // handle the exception, it will be rethrown handled by our defaults. try { - // 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(); } + // To avoid having to handle TFE explicitly everywhere, we just + // rethrow it so that it goes back up the caller. catch( TestFailureException& ) { std::rethrow_exception(std::current_exception()); } - catch( std::exception& ex ) { + catch( std::exception const& ex ) { return ex.what(); } - catch( std::string& msg ) { + catch( std::string const& msg ) { return msg; } catch( const char* msg ) { @@ -3669,39 +3632,80 @@ namespace Catch { +/** \file + * This file provides platform specific implementations of FatalConditionHandler + * + * This means that there is a lot of conditional compilation, and platform + * specific code. Currently, Catch2 supports a dummy handler (if no + * handler is desired), and 2 platform specific handlers: + * * Windows' SEH + * * POSIX signals + * + * Consequently, various pieces of code below are compiled if either of + * the platform specific handlers is enabled, or if none of them are + * enabled. It is assumed that both cannot be enabled at the same time, + * and doing so should cause a compilation error. + * + * If another platform specific handler is added, the compile guards + * below will need to be updated taking these assumptions into account. + */ -#if defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#endif + + +#include <algorithm> + +#if !defined( CATCH_CONFIG_WINDOWS_SEH ) && !defined( CATCH_CONFIG_POSIX_SIGNALS ) + +namespace Catch { + + // If neither SEH nor signal handling is required, the handler impls + // do not have to do anything, and can be empty. + void FatalConditionHandler::engage_platform() {} + void FatalConditionHandler::disengage_platform() noexcept {} + FatalConditionHandler::FatalConditionHandler() = default; + FatalConditionHandler::~FatalConditionHandler() = default; + +} // end namespace Catch + +#endif // !CATCH_CONFIG_WINDOWS_SEH && !CATCH_CONFIG_POSIX_SIGNALS + +#if defined( CATCH_CONFIG_WINDOWS_SEH ) && defined( CATCH_CONFIG_POSIX_SIGNALS ) +#error "Inconsistent configuration: Windows' SEH handling and POSIX signals cannot be enabled at the same time" +#endif // CATCH_CONFIG_WINDOWS_SEH && CATCH_CONFIG_POSIX_SIGNALS #if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS ) namespace { - // Report the error condition + //! Signals fatal error message to the run context void reportFatal( char const * const message ) { Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message ); } -} -#endif // signals/SEH handling + //! Minimal size Catch2 needs for its own fatal error handling. + //! Picked empirically, so it might not be sufficient on all + //! platforms, and for all configurations. + constexpr std::size_t minStackSizeForErrors = 32 * 1024; +} // end unnamed namespace + +#endif // CATCH_CONFIG_WINDOWS_SEH || CATCH_CONFIG_POSIX_SIGNALS #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" }, + { EXCEPTION_ILLEGAL_INSTRUCTION, "SIGILL - Illegal instruction signal" }, + { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" }, + { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" }, + { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" }, }; - LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { + static LONG CALLBACK topLevelExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) { for (auto const& def : signalDefs) { if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) { reportFatal(def.name); @@ -3712,111 +3716,377 @@ namespace Catch { return EXCEPTION_CONTINUE_SEARCH; } + // Since we do not support multiple instantiations, we put these + // into global variables and rely on cleaning them up in outlined + // constructors/destructors + static LPTOP_LEVEL_EXCEPTION_FILTER previousTopLevelExceptionFilter = nullptr; + + + // For MSVC, we reserve part of the stack memory for handling + // memory overflow structured exception. + FatalConditionHandler::FatalConditionHandler() { + ULONG guaranteeSize = static_cast<ULONG>(minStackSizeForErrors); + if (!SetThreadStackGuarantee(&guaranteeSize)) { + // We do not want to fully error out, because needing + // the stack reserve should be rare enough anyway. + Catch::cerr() + << "Failed to reserve piece of stack." + << " Stack overflows will not be reported successfully."; + } + } + + // We do not attempt to unset the stack guarantee, because + // Windows does not support lowering the stack size guarantee. + FatalConditionHandler::~FatalConditionHandler() = default; + + + void FatalConditionHandler::engage_platform() { + // Register as a the top level exception filter. + previousTopLevelExceptionFilter = SetUnhandledExceptionFilter(topLevelExceptionFilter); + } + + void FatalConditionHandler::disengage_platform() noexcept { + if (SetUnhandledExceptionFilter(previousTopLevelExceptionFilter) != topLevelExceptionFilter) { + Catch::cerr() + << "Unexpected SEH unhandled exception filter on disengage." + << " The filter was restored, but might be rolled back unexpectedly."; + } + previousTopLevelExceptionFilter = nullptr; + } + +} // end namespace Catch + +#endif // CATCH_CONFIG_WINDOWS_SEH + +#if defined( CATCH_CONFIG_POSIX_SIGNALS ) + +#include <signal.h> + +namespace Catch { + + struct SignalDefs { + int id; + const char* name; + }; + + 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" } + }; + +// Older GCCs trigger -Wmissing-field-initializers for T foo = {} +// which is zero initialization, but not explicit. We want to avoid +// that. +#if defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + + static char* altStackMem = nullptr; + static std::size_t altStackSize = 0; + static stack_t oldSigStack{}; + static struct sigaction oldSigActions[sizeof(signalDefs) / sizeof(SignalDefs)]{}; + + static void restorePreviousSignalHandlers() noexcept { + // We set signal handlers back to the previous ones. Hopefully + // nobody overwrote them in the meantime, and doesn't expect + // their signal handlers to live past ours given that they + // installed them after ours.. + 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); + } + + static void handleSignal( int sig ) { + char const * name = "<unknown signal>"; + for (auto const& def : signalDefs) { + if (sig == def.id) { + name = def.name; + break; + } + } + // We need to restore previous signal handlers and let them do + // their thing, so that the users can have the debugger break + // when a signal is raised, and so on. + restorePreviousSignalHandlers(); + reportFatal( name ); + raise( sig ); + } + 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); + assert(!altStackMem && "Cannot initialize POSIX signal handler when one already exists"); + if (altStackSize == 0) { + altStackSize = std::max(static_cast<size_t>(SIGSTKSZ), minStackSizeForErrors); + } + altStackMem = new char[altStackSize](); + } + + FatalConditionHandler::~FatalConditionHandler() { + delete[] altStackMem; + // We signal that another instance can be constructed by zeroing + // out the pointer. + altStackMem = nullptr; + } + + void FatalConditionHandler::engage_platform() { + stack_t sigStack; + sigStack.ss_sp = altStackMem; + sigStack.ss_size = altStackSize; + 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]); + } } - void FatalConditionHandler::reset() { - if (isSet) { - RemoveVectoredExceptionHandler(exceptionHandlerHandle); - SetThreadStackGuarantee(&guaranteeSize); - exceptionHandlerHandle = nullptr; - isSet = false; +#if defined(__GNUC__) +# pragma GCC diagnostic pop +#endif + + + void FatalConditionHandler::disengage_platform() noexcept { + restorePreviousSignalHandlers(); + } + +} // end namespace Catch + +#endif // CATCH_CONFIG_POSIX_SIGNALS + + + + +#include <cstring> + +namespace Catch { + namespace Detail { + + uint32_t convertToBits(float f) { + static_assert(sizeof(float) == sizeof(uint32_t), "Important ULP matcher assumption violated"); + uint32_t i; + std::memcpy(&i, &f, sizeof(f)); + return i; + } + + uint64_t convertToBits(double d) { + static_assert(sizeof(double) == sizeof(uint64_t), "Important ULP matcher assumption violated"); + uint64_t i; + std::memcpy(&i, &d, sizeof(d)); + return i; + } + + } // end namespace Detail +} // end namespace Catch + + + + + +#include <cstdio> +#include <fstream> +#include <sstream> +#include <vector> + +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 override { + 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 ) { + if ( !str.empty() ) { + writeToDebugConsole( str ); + } + } + }; + + /////////////////////////////////////////////////////////////////////////// + + class FileStream : public IStream { + std::ofstream m_ofs; + public: + FileStream( std::string const& 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() override { + return m_ofs; + } + }; + + /////////////////////////////////////////////////////////////////////////// + + class CoutStream : public IStream { + 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() override { return m_os; } + bool isConsole() const override { return true; } + }; + + class CerrStream : public IStream { + std::ostream m_os; + + public: + // Store the streambuf from cerr up-front because + // cout may get redirected when running tests + CerrStream(): m_os( Catch::cerr().rdbuf() ) {} + ~CerrStream() override = default; + + public: // IStream + std::ostream& stream() override { return m_os; } + bool isConsole() const override { return true; } + }; + + /////////////////////////////////////////////////////////////////////////// + + class DebugOutStream : public IStream { + Detail::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf; + std::ostream m_os; + public: + DebugOutStream() + : m_streamBuf( Detail::make_unique<StreamBufImpl<OutputDebugWriter>>() ), + m_os( m_streamBuf.get() ) + {} + + ~DebugOutStream() override = default; + + public: // IStream + std::ostream& stream() override { return m_os; } + }; + + } // unnamed namespace +} // namespace Detail + + /////////////////////////////////////////////////////////////////////////// + + auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream> { + if ( filename.empty() || filename == "-" ) { + return Detail::make_unique<Detail::CoutStream>(); + } + if( filename[0] == '%' ) { + if ( filename == "%debug" ) { + return Detail::make_unique<Detail::DebugOutStream>(); + } else if ( filename == "%stderr" ) { + return Detail::make_unique<Detail::CerrStream>(); + } else if ( filename == "%stdout" ) { + return Detail::make_unique<Detail::CoutStream>(); + } else { + CATCH_ERROR( "Unrecognised stream: '" << filename << '\'' ); + } } + return Detail::make_unique<Detail::FileStream>( filename ); } -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; - }; + auto operator << (std::ostream& os, LazyExpression const& lazyExpr) -> std::ostream& { + if (lazyExpr.m_isNegated) + os << '!'; - // 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; + 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; + } - 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" } - }; +} // namespace Catch - 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]); - } - } +#ifdef CATCH_CONFIG_WINDOWS_CRTDBG +#include <crtdbg.h> - 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; - } - } +namespace Catch { - bool FatalConditionHandler::isSet = false; - struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; - stack_t FatalConditionHandler::oldSigStack = {}; - char FatalConditionHandler::altStackMem[sigStackSize] = {}; + 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 // ^^ Windows crt debug heap enabled // Windows crt debug heap disabled vv -} // namespace Catch + Catch::LeakDetector::LeakDetector() {} -#endif // signals/SEH handling +#endif // CATCH_CONFIG_WINDOWS_CRTDBG -#if defined(__GNUC__) -# pragma GCC diagnostic pop -#endif +Catch::LeakDetector::~LeakDetector() { + Catch::cleanUp(); +} @@ -3825,35 +4095,35 @@ namespace Catch { namespace Catch { namespace { - void listTests(IStreamingReporter& reporter, IConfig const& config) { + void listTests(IEventListener& reporter, IConfig const& config) { auto const& testSpec = config.testSpec(); auto matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config); - reporter.listTests(matchedTestCases, config); + reporter.listTests(matchedTestCases); } - void listTags(IStreamingReporter& reporter, IConfig const& config) { + void listTags(IEventListener& reporter, IConfig const& config) { auto const& testSpec = config.testSpec(); std::vector<TestCaseHandle> matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config); - std::map<StringRef, TagInfo> tagCounts; + std::map<StringRef, TagInfo, Detail::CaseInsensitiveLess> tagCounts; for (auto const& testCase : matchedTestCases) { for (auto const& tagName : testCase.getTestCaseInfo().tags) { - auto it = tagCounts.find(tagName.lowerCased); + auto it = tagCounts.find(tagName.original); if (it == tagCounts.end()) - it = tagCounts.insert(std::make_pair(tagName.lowerCased, TagInfo())).first; + it = tagCounts.insert(std::make_pair(tagName.original, TagInfo())).first; it->second.add(tagName.original); } } std::vector<TagInfo> infos; infos.reserve(tagCounts.size()); for (auto& tagc : tagCounts) { - infos.push_back(std::move(tagc.second)); + infos.push_back(CATCH_MOVE(tagc.second)); } - reporter.listTags(infos, config); + reporter.listTags(infos); } - void listReporters(IStreamingReporter& reporter, IConfig const& config) { + void listReporters(IEventListener& reporter) { std::vector<ReporterDescription> descriptions; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); @@ -3862,7 +4132,20 @@ namespace Catch { descriptions.push_back({ fac.first, fac.second->getDescription() }); } - reporter.listReporters(descriptions, config); + reporter.listReporters(descriptions); + } + + void listListeners(IEventListener& reporter) { + std::vector<ListenerDescription> descriptions; + + auto const& factories = + getRegistryHub().getReporterRegistry().getListeners(); + descriptions.reserve( factories.size() ); + for ( auto const& fac : factories ) { + descriptions.push_back( { fac->getName(), fac->getDescription() } ); + } + + reporter.listListeners( descriptions ); } } // end anonymous namespace @@ -3888,7 +4171,7 @@ namespace Catch { return out; } - bool list( IStreamingReporter& reporter, Config const& config ) { + bool list( IEventListener& reporter, Config const& config ) { bool listed = false; if (config.listTests()) { listed = true; @@ -3900,7 +4183,11 @@ namespace Catch { } if (config.listReporters()) { listed = true; - listReporters(reporter, config); + listReporters(reporter); + } + if ( config.listListeners() ) { + listed = true; + listListeners( reporter ); } return listed; } @@ -3912,13 +4199,16 @@ namespace Catch { namespace Catch { CATCH_INTERNAL_START_WARNINGS_SUPPRESSION CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS - LeakDetector leakDetector; + static LeakDetector leakDetector; CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION } +// Allow users of amalgamated .cpp file to remove our main and provide their own. +#if !defined(CATCH_AMALGAMATED_CUSTOM_MAIN) + #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 * []) { +extern "C" int __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) { #else // Standard C/C++ main entry point int main (int argc, char * argv[]) { @@ -3931,6 +4221,27 @@ int main (int argc, char * argv[]) { return Catch::Session().run( argc, argv ); } +#endif // !defined(CATCH_AMALGAMATED_CUSTOM_MAIN + + + + +namespace Catch { + + MessageInfo::MessageInfo( StringRef _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + type( _type ), + sequence( ++globalCount ) + {} + + // This may need protecting if threading support is added + unsigned int MessageInfo::globalCount = 0; + +} // end namespace Catch + #include <cstdio> @@ -4071,6 +4382,32 @@ namespace Catch { + +#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 + + + namespace Catch { namespace { @@ -4136,36 +4473,67 @@ namespace { + +#include <ctime> +#include <random> + +namespace Catch { + + std::uint32_t generateRandomSeed( GenerateFrom from ) { + switch ( from ) { + case GenerateFrom::Time: + return static_cast<std::uint32_t>( std::time( nullptr ) ); + + case GenerateFrom::Default: + case GenerateFrom::RandomDevice: + // In theory, a platform could have random_device that returns just + // 16 bits. That is still some randomness, so we don't care too much + return static_cast<std::uint32_t>( std::random_device{}() ); + + default: + CATCH_ERROR("Unknown generation method"); + } + } + +} // end namespace Catch + + + + namespace Catch { ReporterRegistry::ReporterRegistry() { // Because it is impossible to move out of initializer list, // we have to add the elements manually - m_factories["automake"] = Detail::make_unique<ReporterFactory<AutomakeReporter>>(); + m_factories["Automake"] = Detail::make_unique<ReporterFactory<AutomakeReporter>>(); m_factories["compact"] = Detail::make_unique<ReporterFactory<CompactReporter>>(); m_factories["console"] = Detail::make_unique<ReporterFactory<ConsoleReporter>>(); - m_factories["junit"] = Detail::make_unique<ReporterFactory<JunitReporter>>(); - m_factories["sonarqube"] = Detail::make_unique<ReporterFactory<SonarQubeReporter>>(); - m_factories["tap"] = Detail::make_unique<ReporterFactory<TAPReporter>>(); - m_factories["teamcity"] = Detail::make_unique<ReporterFactory<TeamCityReporter>>(); - m_factories["xml"] = Detail::make_unique<ReporterFactory<XmlReporter>>(); + m_factories["JUnit"] = Detail::make_unique<ReporterFactory<JunitReporter>>(); + m_factories["SonarQube"] = Detail::make_unique<ReporterFactory<SonarQubeReporter>>(); + m_factories["TAP"] = Detail::make_unique<ReporterFactory<TAPReporter>>(); + m_factories["TeamCity"] = Detail::make_unique<ReporterFactory<TeamCityReporter>>(); + m_factories["XML"] = Detail::make_unique<ReporterFactory<XmlReporter>>(); } ReporterRegistry::~ReporterRegistry() = default; - IStreamingReporterPtr ReporterRegistry::create( std::string const& name, IConfig const* config ) const { + IEventListenerPtr ReporterRegistry::create( std::string const& name, ReporterConfig&& config ) const { auto it = m_factories.find( name ); if( it == m_factories.end() ) return nullptr; - return it->second->create( ReporterConfig( config ) ); + return it->second->create( CATCH_MOVE(config) ); } void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr factory ) { - m_factories.emplace(name, std::move(factory)); + CATCH_ENFORCE( name.find( "::" ) == name.npos, + "'::' is not allowed in reporter name: '" + name + '\'' ); + auto ret = m_factories.emplace(name, CATCH_MOVE(factory)); + CATCH_ENFORCE( ret.second, "reporter using '" + name + "' as name was already registered" ); } - void ReporterRegistry::registerListener( IReporterFactoryPtr factory ) { - m_listeners.push_back( std::move(factory) ); + void ReporterRegistry::registerListener( + Detail::unique_ptr<EventListenerFactory> factory ) { + m_listeners.push_back( CATCH_MOVE(factory) ); } IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const { @@ -4179,6 +4547,171 @@ namespace Catch { + + +#include <algorithm> + +namespace Catch { + + namespace { + struct kvPair { + StringRef key, value; + }; + + kvPair splitKVPair(StringRef kvString) { + auto splitPos = static_cast<size_t>( std::distance( + kvString.begin(), + std::find( kvString.begin(), kvString.end(), '=' ) ) ); + + return { kvString.substr( 0, splitPos ), + kvString.substr( splitPos + 1, kvString.size() ) }; + } + } + + namespace Detail { + std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) { + static constexpr auto separator = "::"; + static constexpr size_t separatorSize = 2; + + size_t separatorPos = 0; + auto findNextSeparator = [&reporterSpec]( size_t startPos ) { + static_assert( + separatorSize == 2, + "The code below currently assumes 2 char separator" ); + + auto currentPos = startPos; + do { + while ( currentPos < reporterSpec.size() && + reporterSpec[currentPos] != separator[0] ) { + ++currentPos; + } + if ( currentPos + 1 < reporterSpec.size() && + reporterSpec[currentPos + 1] == separator[1] ) { + return currentPos; + } + ++currentPos; + } while ( currentPos < reporterSpec.size() ); + + return static_cast<size_t>( -1 ); + }; + + std::vector<std::string> parts; + + while ( separatorPos < reporterSpec.size() ) { + const auto nextSeparator = findNextSeparator( separatorPos ); + parts.push_back( static_cast<std::string>( reporterSpec.substr( + separatorPos, nextSeparator - separatorPos ) ) ); + + if ( nextSeparator == static_cast<size_t>( -1 ) ) { + break; + } + separatorPos = nextSeparator + separatorSize; + } + + // Handle a separator at the end. + // This is not a valid spec, but we want to do validation in a + // centralized place + if ( separatorPos == reporterSpec.size() ) { + parts.emplace_back(); + } + + return parts; + } + + Optional<ColourMode> stringToColourMode( StringRef colourMode ) { + if ( colourMode == "default" ) { + return ColourMode::PlatformDefault; + } else if ( colourMode == "ansi" ) { + return ColourMode::ANSI; + } else if ( colourMode == "win32" ) { + return ColourMode::Win32; + } else if ( colourMode == "none" ) { + return ColourMode::None; + } else { + return {}; + } + } + } // namespace Detail + + + bool operator==( ReporterSpec const& lhs, ReporterSpec const& rhs ) { + return lhs.m_name == rhs.m_name && + lhs.m_outputFileName == rhs.m_outputFileName && + lhs.m_colourMode == rhs.m_colourMode && + lhs.m_customOptions == rhs.m_customOptions; + } + + Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec ) { + auto parts = Detail::splitReporterSpec( reporterSpec ); + + assert( parts.size() > 0 && "Split should never return empty vector" ); + + std::map<std::string, std::string> kvPairs; + Optional<std::string> outputFileName; + Optional<ColourMode> colourMode; + + // First part is always reporter name, so we skip it + for ( size_t i = 1; i < parts.size(); ++i ) { + auto kv = splitKVPair( parts[i] ); + auto key = kv.key, value = kv.value; + + if ( key.empty() || value.empty() ) { + return {}; + } else if ( key[0] == 'X' ) { + // This is a reporter-specific option, we don't check these + // apart from basic sanity checks + if ( key.size() == 1 ) { + return {}; + } + + auto ret = kvPairs.emplace( std::string(kv.key), std::string(kv.value) ); + if ( !ret.second ) { + // Duplicated key. We might want to handle this differently, + // e.g. by overwriting the existing value? + return {}; + } + } else if ( key == "out" ) { + // Duplicated key + if ( outputFileName ) { + return {}; + } + outputFileName = static_cast<std::string>( value ); + } else if ( key == "colour-mode" ) { + // Duplicated key + if ( colourMode ) { + return {}; + } + colourMode = Detail::stringToColourMode( value ); + // Parsing failed + if ( !colourMode ) { + return {}; + } + } else { + // Unrecognized option + return {}; + } + } + + return ReporterSpec{ CATCH_MOVE( parts[0] ), + CATCH_MOVE( outputFileName ), + CATCH_MOVE( colourMode ), + CATCH_MOVE( kvPairs ) }; + } + +ReporterSpec::ReporterSpec( + std::string name, + Optional<std::string> outputFileName, + Optional<ColourMode> colourMode, + std::map<std::string, std::string> customOptions ): + m_name( CATCH_MOVE( name ) ), + m_outputFileName( CATCH_MOVE( outputFileName ) ), + m_colourMode( CATCH_MOVE( colourMode ) ), + m_customOptions( CATCH_MOVE( customOptions ) ) {} + +} // namespace Catch + + + namespace Catch { bool isOk( ResultWas::OfType resultType ) { @@ -4188,14 +4721,68 @@ namespace Catch { 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 ) ); + 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 + + + +#include <cstdio> +#include <sstream> +#include <vector> + +namespace Catch { + + // This class encapsulates the idea of a pool of ostringstreams that can be reused. + struct StringStreams { + std::vector<Detail::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( Detail::make_unique<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 ); + } + + std::string ReusableStringStream::str() const { + return static_cast<std::ostringstream*>( m_oss )->str(); + } + + void ReusableStringStream::str( std::string const& str ) { + static_cast<std::ostringstream*>( m_oss )->str( str ); } - bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } - bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } -} // end namespace Catch +} @@ -4212,10 +4799,10 @@ namespace Catch { GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) : TrackerBase( nameAndLocation, ctx, parent ) {} - ~GeneratorTracker(); + ~GeneratorTracker() override; static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation ) { - std::shared_ptr<GeneratorTracker> tracker; + GeneratorTracker* tracker; ITracker& currentTracker = ctx.currentTracker(); // Under specific circumstances, the generator we want @@ -4229,18 +4816,23 @@ namespace Catch { // } // // without it, the code above creates 5 nested generators. - if (currentTracker.nameAndLocation() == nameAndLocation) { - auto thisTracker = currentTracker.parent().findChild(nameAndLocation); - assert(thisTracker); - assert(thisTracker->isGeneratorTracker()); - tracker = std::static_pointer_cast<GeneratorTracker>(thisTracker); - } else if ( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { + if ( currentTracker.nameAndLocation() == nameAndLocation ) { + auto thisTracker = + currentTracker.parent()->findChild( nameAndLocation ); + assert( thisTracker ); + assert( thisTracker->isGeneratorTracker() ); + tracker = static_cast<GeneratorTracker*>( thisTracker ); + } else if ( ITracker* childTracker = + currentTracker.findChild( nameAndLocation ) ) { assert( childTracker ); assert( childTracker->isGeneratorTracker() ); - tracker = std::static_pointer_cast<GeneratorTracker>( childTracker ); + tracker = static_cast<GeneratorTracker*>( childTracker ); } else { - tracker = std::make_shared<GeneratorTracker>( nameAndLocation, ctx, ¤tTracker ); - currentTracker.addChild( tracker ); + auto newTracker = + Catch::Detail::make_unique<GeneratorTracker>( + nameAndLocation, ctx, ¤tTracker ); + tracker = newTracker.get(); + currentTracker.addChild( CATCH_MOVE(newTracker) ); } if( !tracker->isComplete() ) { @@ -4264,13 +4856,53 @@ namespace Catch { // `SECTION`s. // **The check for m_children.empty cannot be removed**. // doing so would break `GENERATE` _not_ followed by `SECTION`s. - const bool should_wait_for_child = - !m_children.empty() && - std::find_if( m_children.begin(), - m_children.end(), - []( TestCaseTracking::ITrackerPtr tracker ) { - return tracker->hasStarted(); - } ) == m_children.end(); + const bool should_wait_for_child = [&]() { + // No children -> nobody to wait for + if ( m_children.empty() ) { + return false; + } + // If at least one child started executing, don't wait + if ( std::find_if( + m_children.begin(), + m_children.end(), + []( TestCaseTracking::ITrackerPtr const& tracker ) { + return tracker->hasStarted(); + } ) != m_children.end() ) { + return false; + } + + // No children have started. We need to check if they _can_ + // start, and thus we should wait for them, or they cannot + // start (due to filters), and we shouldn't wait for them + ITracker* parent = m_parent; + // This is safe: there is always at least one section + // tracker in a test case tracking tree + while ( !parent->isSectionTracker() ) { + parent = parent->parent(); + } + assert( parent && + "Missing root (test case) level section" ); + + auto const& parentSection = + static_cast<SectionTracker const&>( *parent ); + auto const& filters = parentSection.getFilters(); + // No filters -> no restrictions on running sections + if ( filters.empty() ) { + return true; + } + + for ( auto const& child : m_children ) { + if ( child->isSectionTracker() && + std::find( + filters.begin(), + filters.end(), + static_cast<SectionTracker const&>( *child ) + .trimmedName() ) != filters.end() ) { + return true; + } + } + return false; + }(); // This check is a bit tricky, because m_generator->next() // has a side-effect, where it consumes generator's current @@ -4278,7 +4910,7 @@ namespace Catch { // this generator is still waiting for any child to start. if ( should_wait_for_child || ( m_runState == CompletedSuccessfully && - m_generator->next() ) ) { + m_generator->countedNext() ) ) { m_children.clear(); m_runState = Executing; } @@ -4289,21 +4921,20 @@ namespace Catch { return m_generator; } void setGenerator( GeneratorBasePtr&& generator ) override { - m_generator = std::move( generator ); + m_generator = CATCH_MOVE( generator ); } }; - GeneratorTracker::~GeneratorTracker() {} + GeneratorTracker::~GeneratorTracker() = default; } - RunContext::RunContext(IConfig const* _config, IStreamingReporterPtr&& reporter) + RunContext::RunContext(IConfig const* _config, IEventListenerPtr&& reporter) : m_runInfo(_config->name()), m_context(getCurrentMutableContext()), m_config(_config), - m_reporter(std::move(reporter)), + m_reporter(CATCH_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.setResultCapture(this); m_reporter->testRunStarting(m_runInfo); } @@ -4312,16 +4943,8 @@ namespace Catch { 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(TestCaseHandle const& testCase) { - Totals prevTotals = m_totals; + const Totals prevTotals = m_totals; std::string redirectedCout; std::string redirectedCerr; @@ -4336,10 +4959,58 @@ namespace Catch { ITracker& rootTracker = m_trackerContext.startRun(); assert(rootTracker.isSectionTracker()); static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); + + // We intentionally only seed the internal RNG once per test case, + // before it is first invoked. The reason for that is a complex + // interplay of generator/section implementation details and the + // Random*Generator types. + // + // The issue boils down to us needing to seed the Random*Generators + // with different seed each, so that they return different sequences + // of random numbers. We do this by giving them a number from the + // shared RNG instance as their seed. + // + // However, this runs into an issue if the reseeding happens each + // time the test case is entered (as opposed to first time only), + // because multiple generators could get the same seed, e.g. in + // ```cpp + // TEST_CASE() { + // auto i = GENERATE(take(10, random(0, 100)); + // SECTION("A") { + // auto j = GENERATE(take(10, random(0, 100)); + // } + // SECTION("B") { + // auto k = GENERATE(take(10, random(0, 100)); + // } + // } + // ``` + // `i` and `j` would properly return values from different sequences, + // but `i` and `k` would return the same sequence, because their seed + // would be the same. + // (The reason their seeds would be the same is that the generator + // for k would be initialized when the test case is entered the second + // time, after the shared RNG instance was reset to the same value + // it had when the generator for i was initialized.) + seedRng( *m_config ); + + uint64_t testRuns = 0; do { m_trackerContext.startCycle(); m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); - runCurrentTest(redirectedCout, redirectedCerr); + + m_reporter->testCasePartialStarting(testInfo, testRuns); + + const auto beforeRunTotals = m_totals; + std::string oneRunCout, oneRunCerr; + runCurrentTest(oneRunCout, oneRunCerr); + redirectedCout += oneRunCout; + redirectedCerr += oneRunCerr; + + const auto singleRunTotals = m_totals.delta(beforeRunTotals); + auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, oneRunCout, oneRunCerr, aborting()); + + m_reporter->testCasePartialEnded(statsForOneRun, testRuns); + ++testRuns; } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); Totals deltaTotals = m_totals.delta(prevTotals); @@ -4366,9 +5037,11 @@ namespace Catch { if (result.getResultType() == ResultWas::Ok) { m_totals.assertions.passed++; m_lastAssertionPassed = true; - } else if (!result.isOk()) { + } else if (!result.succeeded()) { m_lastAssertionPassed = false; - if( m_activeTestCase->getTestCaseInfo().okToFail() ) + if (result.isOk()) { + } + else if( m_activeTestCase->getTestCaseInfo().okToFail() ) m_totals.assertions.failedButOk++; else m_totals.assertions.failed++; @@ -4377,9 +5050,7 @@ namespace Catch { 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))); + m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)); if (result.getResultType() != ResultWas::Warning) m_messageScopes.clear(); @@ -4451,7 +5122,7 @@ namespace Catch { m_unfinishedSections.push_back(endInfo); } - void RunContext::benchmarkPreparing(std::string const& name) { + void RunContext::benchmarkPreparing( StringRef name ) { m_reporter->benchmarkPreparing(name); } void RunContext::benchmarkStarting( BenchmarkInfo const& info ) { @@ -4460,8 +5131,8 @@ namespace Catch { void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) { m_reporter->benchmarkEnded( stats ); } - void RunContext::benchmarkFailed(std::string const & error) { - m_reporter->benchmarkFailed(error); + void RunContext::benchmarkFailed( StringRef error ) { + m_reporter->benchmarkFailed( error ); } void RunContext::pushScopedMessage(MessageInfo const & message) { @@ -4524,7 +5195,6 @@ namespace Catch { std::string(), false)); m_totals.testCases.failed++; - testGroupEnded(std::string(), m_totals, 1, 1); m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false)); } @@ -4552,8 +5222,6 @@ namespace Catch { 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) { @@ -4595,10 +5263,15 @@ namespace Catch { } void RunContext::invokeActiveTestCase() { - // We need to register a handler for signals/structured exceptions + // We need to engage a handler for signals/structured exceptions // before running the tests themselves, or the binary can crash // without failed test being reported. - FatalConditionHandler _; + FatalConditionHandlerGuard _(&m_fatalConditionhandler); + // We keep having issue where some compilers warn about an unused + // variable, even though the type has non-trivial constructor and + // destructor. This is annoying and ugly, but it makes them stfu. + (void)_; + m_activeTestCase->invoke(); } @@ -4654,7 +5327,7 @@ namespace Catch { void RunContext::handleMessage( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef const& message, + StringRef message, AssertionReaction& reaction ) { m_reporter->assertionStarting( info ); @@ -4728,10 +5401,7 @@ namespace Catch { } void seedRng(IConfig const& config) { - if (config.rngSeed() != 0) { - std::srand(config.rngSeed()); - rng().seed(config.rngSeed()); - } + sharedRng().seed(config.rngSeed()); } unsigned int rngSeed() { @@ -4742,12 +5412,10 @@ namespace Catch { -#include <utility> - namespace Catch { Section::Section( SectionInfo&& info ): - m_info( std::move( info ) ), + m_info( CATCH_MOVE( info ) ), m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) { // Non-"included" sections will not use the timing information @@ -4790,7 +5458,7 @@ namespace Catch { } } - ISingleton::~ISingleton() {} + ISingleton::~ISingleton() = default; void addSingleton(ISingleton* singleton ) { getSingletons()->push_back( singleton ); @@ -4807,182 +5475,68 @@ namespace Catch { -#include <cstdio> -#include <iostream> -#include <fstream> -#include <sstream> -#include <vector> +#include <cstring> +#include <ostream> 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; } - }; - - /////////////////////////////////////////////////////////////////////////// + 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)); + } - class DebugOutStream : public IStream { - Detail::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf; - mutable std::ostream m_os; - public: - DebugOutStream() - : m_streamBuf( Detail::make_unique<StreamBufImpl<OutputDebugWriter>>() ), - m_os( m_streamBuf.get() ) - {} + 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; + } - ~DebugOutStream() override = default; +} // end namespace Catch - public: // IStream - std::ostream& stream() const override { return m_os; } - }; - } // unnamed namespace -} // namespace 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 << "'" ); +namespace Catch { +#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) + 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(); } - else - return new Detail::FileStream( filename ); } + std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept { + return m_exceptions; + } +#endif - // This class encapsulates the idea of a pool of ostringstreams that can be reused. - struct StringStreams { - std::vector<Detail::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( Detail::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() ) - {} +} // end namespace Catch - ReusableStringStream::~ReusableStringStream() { - static_cast<std::ostringstream*>( m_oss )->str(""); - m_oss->clear(); - Singleton<StringStreams>::getMutable().release( m_index ); - } - std::string ReusableStringStream::str() const { - return static_cast<std::ostringstream*>( m_oss )->str(); - } - void ReusableStringStream::str( std::string const& str ) { - static_cast<std::ostringstream*>( m_oss )->str( str ); - } - /////////////////////////////////////////////////////////////////////////// +#include <iostream> +namespace Catch { -#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these functions +// If you #define this you must implement these functions +#if !defined( CATCH_CONFIG_NOSTDOUT ) std::ostream& cout() { return std::cout; } std::ostream& cerr() { return std::cerr; } std::ostream& clog() { return std::clog; } #endif -} + +} // namespace Catch @@ -4994,16 +5548,10 @@ namespace Detail { namespace Catch { - namespace { - char toLowerCh(char c) { - return static_cast<char>( std::tolower( static_cast<unsigned char>(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 ) { + bool startsWith( StringRef s, char prefix ) { return !s.empty() && s[0] == prefix; } bool endsWith( std::string const& s, std::string const& suffix ) { @@ -5016,13 +5564,19 @@ namespace Catch { return s.find( infix ) != std::string::npos; } void toLowerInPlace( std::string& s ) { - std::transform( s.begin(), s.end(), s.begin(), toLowerCh ); + std::transform( s.begin(), s.end(), s.begin(), []( char c ) { + return toLower( c ); + } ); } std::string toLower( std::string const& s ) { std::string lc = s; toLowerInPlace( lc ); return lc; } + char toLower(char c) { + return static_cast<char>(std::tolower(static_cast<unsigned char>(c))); + } + 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 ); @@ -5072,11 +5626,6 @@ namespace Catch { 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 ) @@ -5095,28 +5644,44 @@ namespace Catch { namespace Catch { StringRef::StringRef( char const* rawChars ) noexcept - : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) ) + : StringRef( rawChars, 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::operator == ( StringRef const& other ) const noexcept -> bool { + auto StringRef::operator == ( StringRef other ) const noexcept -> bool { return m_size == other.m_size && (std::memcmp( m_start, other.m_start, m_size ) == 0); } - bool StringRef::operator<(StringRef const& rhs) const noexcept { + bool StringRef::operator<(StringRef rhs) const noexcept { if (m_size < rhs.m_size) { return strncmp(m_start, rhs.m_start, m_size) <= 0; } return strncmp(m_start, rhs.m_start, rhs.m_size) < 0; } - auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& { - return os.write(str.data(), str.size()); + int StringRef::compare( StringRef rhs ) const { + auto cmpResult = + strncmp( m_start, rhs.m_start, std::min( m_size, rhs.m_size ) ); + + // This means that strncmp found a difference before the strings + // ended, and we can return it directly + if ( cmpResult != 0 ) { + return cmpResult; + } + + // If strings are equal up to length, then their comparison results on + // their size + if ( m_size < rhs.m_size ) { + return -1; + } else if ( m_size > rhs.m_size ) { + return 1; + } else { + return 0; + } + } + + auto operator << ( std::ostream& os, StringRef str ) -> std::ostream& { + return os.write(str.data(), static_cast<std::streamsize>(str.size())); } std::string operator+(StringRef lhs, StringRef rhs) { @@ -5127,7 +5692,7 @@ namespace Catch { return ret; } - auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& { + auto operator+=( std::string& lhs, StringRef rhs ) -> std::string& { lhs.append(rhs.data(), rhs.size()); return lhs; } @@ -5171,7 +5736,7 @@ namespace Catch { << "\tRedefined at: " << lineInfo ); } - ITagAliasRegistry::~ITagAliasRegistry() {} + ITagAliasRegistry::~ITagAliasRegistry() = default; ITagAliasRegistry const& ITagAliasRegistry::get() { return getRegistryHub().getTagAliasRegistry(); @@ -5182,33 +5747,42 @@ namespace Catch { -#include <algorithm> -#include <set> - namespace Catch { - -namespace { - struct HashTest { - explicit HashTest(SimplePcg32& rng_inst) { - basis = rng_inst(); - basis <<= 32; - basis |= rng_inst(); - } - - uint64_t basis; - - uint64_t operator()(TestCaseInfo const& t) const { - // Modified FNV-1a hash - static constexpr uint64_t prime = 1099511628211; - uint64_t hash = basis; - for (const char c : t.name) { + TestCaseInfoHasher::TestCaseInfoHasher( hash_t seed ): m_seed( seed ) {} + + uint32_t TestCaseInfoHasher::operator()( TestCaseInfo const& t ) const { + // FNV-1a hash algorithm that is designed for uniqueness: + const hash_t prime = 1099511628211u; + hash_t hash = 14695981039346656037u; + for ( const char c : t.name ) { + hash ^= c; + hash *= prime; + } + for ( const char c : t.className ) { + hash ^= c; + hash *= prime; + } + for ( const Tag& tag : t.tags ) { + for ( const char c : tag.original ) { hash ^= c; hash *= prime; } - return hash; } - }; -} // end anonymous namespace + hash ^= m_seed; + hash *= prime; + const uint32_t low{ static_cast<uint32_t>( hash ) }; + const uint32_t high{ static_cast<uint32_t>( hash >> 32 ) }; + return low * high; + } +} // namespace Catch + + + + +#include <algorithm> +#include <set> + +namespace Catch { std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases ) { switch (config.runOrder()) { @@ -5217,20 +5791,36 @@ namespace { case TestRunOrder::LexicographicallySorted: { std::vector<TestCaseHandle> sorted = unsortedTestCases; - std::sort(sorted.begin(), sorted.end()); + std::sort( + sorted.begin(), + sorted.end(), + []( TestCaseHandle const& lhs, TestCaseHandle const& rhs ) { + return lhs.getTestCaseInfo() < rhs.getTestCaseInfo(); + } + ); return sorted; } case TestRunOrder::Randomized: { seedRng(config); - HashTest h(rng()); - std::vector<std::pair<uint64_t, TestCaseHandle>> indexed_tests; + using TestWithHash = std::pair<TestCaseInfoHasher::hash_t, TestCaseHandle>; + + TestCaseInfoHasher h{ config.rngSeed() }; + std::vector<TestWithHash> indexed_tests; indexed_tests.reserve(unsortedTestCases.size()); for (auto const& handle : unsortedTestCases) { indexed_tests.emplace_back(h(handle.getTestCaseInfo()), handle); } - std::sort(indexed_tests.begin(), indexed_tests.end()); + std::sort( indexed_tests.begin(), + indexed_tests.end(), + []( TestWithHash const& lhs, TestWithHash const& rhs ) { + if ( lhs.first == rhs.first ) { + return lhs.second.getTestCaseInfo() < + rhs.second.getTestCaseInfo(); + } + return lhs.first < rhs.first; + } ); std::vector<TestCaseHandle> randomized; randomized.reserve(indexed_tests.size()); @@ -5254,14 +5844,22 @@ namespace { return testSpec.matches( testCase.getTestCaseInfo() ) && isThrowSafe( testCase, config ); } - void enforceNoDuplicateTestCases( std::vector<TestCaseHandle> const& functions ) { - std::set<TestCaseHandle> seenFunctions; - for( auto const& function : functions ) { - auto prev = seenFunctions.insert( function ); - CATCH_ENFORCE( prev.second, - "error: TEST_CASE( \"" << function.getTestCaseInfo().name << "\" ) already defined.\n" - << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n" - << "\tRedefined at " << function.getTestCaseInfo().lineInfo ); + void + enforceNoDuplicateTestCases( std::vector<TestCaseHandle> const& tests ) { + auto testInfoCmp = []( TestCaseInfo const* lhs, + TestCaseInfo const* rhs ) { + return *lhs < *rhs; + }; + std::set<TestCaseInfo const*, decltype(testInfoCmp)> seenTests(testInfoCmp); + for ( auto const& test : tests ) { + const auto infoPtr = &test.getTestCaseInfo(); + const auto prev = seenTests.insert( infoPtr ); + CATCH_ENFORCE( + prev.second, + "error: test case \"" << infoPtr->name << "\", with tags \"" + << infoPtr->tagsAsString() << "\" already defined.\n" + << "\tFirst seen at " << ( *prev.first )->lineInfo << "\n" + << "\tRedefined at " << infoPtr->lineInfo ); } } @@ -5274,7 +5872,7 @@ namespace { filtered.push_back(testCase); } } - return filtered; + return createShard(filtered, config.shardCount(), config.shardIndex()); } std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config ) { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); @@ -5283,8 +5881,8 @@ namespace { void TestRegistry::registerTest(Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker) { m_handles.emplace_back(testInfo.get(), testInvoker.get()); m_viewed_test_infos.push_back(testInfo.get()); - m_owned_test_infos.push_back(std::move(testInfo)); - m_invokers.push_back(std::move(testInvoker)); + m_owned_test_infos.push_back(CATCH_MOVE(testInfo)); + m_invokers.push_back(CATCH_MOVE(testInvoker)); } std::vector<TestCaseInfo*> const& TestRegistry::getAllInfos() const { @@ -5312,19 +5910,6 @@ namespace { 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 @@ -5332,7 +5917,6 @@ namespace { #include <algorithm> #include <cassert> -#include <memory> #if defined(__clang__) # pragma clang diagnostic push @@ -5350,11 +5934,15 @@ namespace TestCaseTracking { ITracker::~ITracker() = default; - void ITracker::addChild( ITrackerPtr const& child ) { - m_children.push_back( child ); + void ITracker::markAsNeedingAnotherRun() { + m_runState = NeedsAnotherRun; + } + + void ITracker::addChild( ITrackerPtr&& child ) { + m_children.push_back( CATCH_MOVE(child) ); } - ITrackerPtr ITracker::findChild( NameAndLocation const& nameAndLocation ) { + ITracker* ITracker::findChild( NameAndLocation const& nameAndLocation ) { auto it = std::find_if( m_children.begin(), m_children.end(), @@ -5363,14 +5951,37 @@ namespace TestCaseTracking { nameAndLocation.location && tracker->nameAndLocation().name == nameAndLocation.name; } ); - return ( it != m_children.end() ) ? *it : nullptr; + return ( it != m_children.end() ) ? it->get() : nullptr; } + bool ITracker::isSectionTracker() const { return false; } + bool ITracker::isGeneratorTracker() const { return false; } + bool ITracker::isSuccessfullyCompleted() const { + return m_runState == CompletedSuccessfully; + } + + bool ITracker::isOpen() const { + return m_runState != NotStarted && !isComplete(); + } + + bool ITracker::hasStarted() const { return m_runState != NotStarted; } + + void ITracker::openChild() { + if (m_runState != ExecutingChildren) { + m_runState = ExecutingChildren; + if (m_parent) { + m_parent->openChild(); + } + } + } ITracker& TrackerContext::startRun() { using namespace std::string_literals; - m_rootTracker = std::make_shared<SectionTracker>( NameAndLocation( "{root}"s, CATCH_INTERNAL_LINEINFO ), *this, nullptr ); + m_rootTracker = Catch::Detail::make_unique<SectionTracker>( + NameAndLocation( "{root}"s, CATCH_INTERNAL_LINEINFO ), + *this, + nullptr ); m_currentTracker = nullptr; m_runState = Executing; return *m_rootTracker; @@ -5402,36 +6013,13 @@ namespace TestCaseTracking { TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ): - ITracker(nameAndLocation), - m_ctx( ctx ), - m_parent( parent ) + ITracker(nameAndLocation, parent), + m_ctx( ctx ) {} 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(); - } - - 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; @@ -5476,9 +6064,6 @@ namespace TestCaseTracking { moveToParent(); m_ctx.completeCycle(); } - void TrackerBase::markAsNeedingAnotherRun() { - m_runState = NeedsAnotherRun; - } void TrackerBase::moveToParent() { assert( m_parent ); @@ -5494,7 +6079,7 @@ namespace TestCaseTracking { { if( parent ) { while( !parent->isSectionTracker() ) - parent = &parent->parent(); + parent = parent->parent(); SectionTracker& parentSection = static_cast<SectionTracker&>( *parent ); addNextFilters( parentSection.m_filters ); @@ -5505,7 +6090,7 @@ namespace TestCaseTracking { bool complete = true; if (m_filters.empty() - || m_filters[0] == "" + || m_filters[0].empty() || std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) { complete = TrackerBase::isComplete(); } @@ -5515,17 +6100,19 @@ namespace TestCaseTracking { bool SectionTracker::isSectionTracker() const { return true; } SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) { - std::shared_ptr<SectionTracker> section; + SectionTracker* section; ITracker& currentTracker = ctx.currentTracker(); - if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { + if ( ITracker* childTracker = + currentTracker.findChild( nameAndLocation ) ) { assert( childTracker ); assert( childTracker->isSectionTracker() ); - section = std::static_pointer_cast<SectionTracker>( childTracker ); - } - else { - section = std::make_shared<SectionTracker>( nameAndLocation, ctx, ¤tTracker ); - currentTracker.addChild( section ); + section = static_cast<SectionTracker*>( childTracker ); + } else { + auto newSection = Catch::Detail::make_unique<SectionTracker>( + nameAndLocation, ctx, ¤tTracker ); + section = newSection.get(); + currentTracker.addChild( CATCH_MOVE( newSection ) ); } if( !ctx.completedCycle() ) section->tryOpen(); @@ -5540,21 +6127,25 @@ namespace TestCaseTracking { 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.emplace_back(StringRef{}); // Root - should never be consulted + m_filters.emplace_back(StringRef{}); // 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 ) { + void SectionTracker::addNextFilters( std::vector<StringRef> const& filters ) { if( filters.size() > 1 ) m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() ); } -} // namespace TestCaseTracking + std::vector<StringRef> const& SectionTracker::getFilters() const { + return m_filters; + } + + StringRef SectionTracker::trimmedName() const { + return m_trimmed_name; + } -using TestCaseTracking::ITracker; -using TestCaseTracking::TrackerContext; -using TestCaseTracking::SectionTracker; +} // namespace TestCaseTracking } // namespace Catch @@ -5564,13 +6155,46 @@ using TestCaseTracking::SectionTracker; +#include <algorithm> +#include <iterator> + namespace Catch { + namespace { + StringRef extractClassName( StringRef classOrMethodName ) { + if ( !startsWith( classOrMethodName, '&' ) ) { + return classOrMethodName; + } + + // Remove the leading '&' to avoid having to special case it later + const auto methodName = + classOrMethodName.substr( 1, classOrMethodName.size() ); + + auto reverseStart = std::make_reverse_iterator( methodName.end() ); + auto reverseEnd = std::make_reverse_iterator( methodName.begin() ); + + // We make a simplifying assumption that ":" is only present + // in the input as part of "::" from C++ typenames (this is + // relatively safe assumption because the input is generated + // as stringification of type through preprocessor). + auto lastColons = std::find( reverseStart, reverseEnd, ':' ) + 1; + auto secondLastColons = + std::find( lastColons + 1, reverseEnd, ':' ); + + auto const startIdx = reverseEnd - secondLastColons; + auto const classNameSize = secondLastColons - lastColons - 1; + + return methodName.substr( + static_cast<std::size_t>( startIdx ), + static_cast<std::size_t>( classNameSize ) ); + } + } // namespace + Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ) { - return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsFunction( testAsFunction )); + return Detail::make_unique<TestInvokerAsFunction>( testAsFunction ); } - AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept { + AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept { CATCH_TRY { getMutableRegistryHub() .registerTest( @@ -5578,7 +6202,7 @@ namespace Catch { extractClassName( classOrMethod ), nameAndTags, lineInfo), - std::move(invoker) + CATCH_MOVE(invoker) ); } CATCH_CATCH_ALL { // Do not throw when constructing global objects, instead register the exception to be processed later @@ -5607,7 +6231,7 @@ namespace Catch { 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); + m_testSpec.m_invalidSpecs.push_back(arg); break; } endMode(); @@ -5615,7 +6239,7 @@ namespace Catch { } TestSpec TestSpecParser::testSpec() { addFilter(); - return std::move(m_testSpec); + return CATCH_MOVE(m_testSpec); } bool TestSpecParser::visitChar( char c ) { if( (m_mode != EscapedName) && (c == '\\') ) { @@ -5731,7 +6355,7 @@ namespace Catch { void TestSpecParser::addFilter() { if( !m_currentFilter.m_required.empty() || !m_currentFilter.m_forbidden.empty() ) { - m_testSpec.m_filters.push_back( std::move(m_currentFilter) ); + m_testSpec.m_filters.push_back( CATCH_MOVE(m_currentFilter) ); m_currentFilter = TestSpec::Filter(); } } @@ -5824,6 +6448,8 @@ namespace Catch { } // namespace Catch + +#include <algorithm> #include <cstring> #include <ostream> @@ -5857,96 +6483,107 @@ namespace { namespace Catch { namespace TextFlow { - void Column::iterator::calcLength() { - m_suffix = false; - auto width = m_column.m_width - indent(); - m_end = m_pos; + void Column::const_iterator::calcLength() { + m_addHyphen = false; + m_parsedTo = m_lineStart; + std::string const& current_line = m_column.m_string; - if ( current_line[m_pos] == '\n' ) { - ++m_end; + if ( current_line[m_lineStart] == '\n' ) { + ++m_parsedTo; } - while ( m_end < current_line.size() && - current_line[m_end] != '\n' ) { - ++m_end; + + const auto maxLineLength = m_column.m_width - indentSize(); + const auto maxParseTo = std::min(current_line.size(), m_lineStart + maxLineLength); + while ( m_parsedTo < maxParseTo && + current_line[m_parsedTo] != '\n' ) { + ++m_parsedTo; } - if ( m_end < m_pos + width ) { - m_len = m_end - m_pos; + // If we encountered a newline before the column is filled, + // then we linebreak at the newline and consider this line + // finished. + if ( m_parsedTo < m_lineStart + maxLineLength ) { + m_lineLength = m_parsedTo - m_lineStart; } else { - size_t len = width; - while ( len > 0 && !isBoundary( current_line, m_pos + len ) ) { - --len; + // Look for a natural linebreak boundary in the column + // (We look from the end, so that the first found boundary is + // the right one) + size_t newLineLength = maxLineLength; + while ( newLineLength > 0 && !isBoundary( current_line, m_lineStart + newLineLength ) ) { + --newLineLength; } - while ( len > 0 && - isWhitespace( current_line[m_pos + len - 1] ) ) { - --len; + while ( newLineLength > 0 && + isWhitespace( current_line[m_lineStart + newLineLength - 1] ) ) { + --newLineLength; } - if ( len > 0 ) { - m_len = len; + // If we found one, then that is where we linebreak + if ( newLineLength > 0 ) { + m_lineLength = newLineLength; } else { - m_suffix = true; - m_len = width - 1; + // Otherwise we have to split text with a hyphen + m_addHyphen = true; + m_lineLength = maxLineLength - 1; } } } - size_t Column::iterator::indent() const { + size_t Column::const_iterator::indentSize() const { auto initial = - m_pos == 0 ? m_column.m_initialIndent : std::string::npos; + m_lineStart == 0 ? m_column.m_initialIndent : std::string::npos; return initial == std::string::npos ? m_column.m_indent : initial; } std::string - Column::iterator::addIndentAndSuffix( size_t position, + Column::const_iterator::addIndentAndSuffix( size_t position, size_t length ) const { std::string ret; - const auto desired_indent = indent(); - ret.reserve( desired_indent + length + m_suffix ); + const auto desired_indent = indentSize(); + ret.reserve( desired_indent + length + m_addHyphen ); ret.append( desired_indent, ' ' ); ret.append( m_column.m_string, position, length ); - if ( m_suffix ) { + if ( m_addHyphen ) { ret.push_back( '-' ); } return ret; } - Column::iterator::iterator( Column const& column ): m_column( column ) { + Column::const_iterator::const_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_pos = m_column.m_string.size(); + if ( m_lineLength == 0 ) { + m_lineStart = m_column.m_string.size(); } } - std::string Column::iterator::operator*() const { - assert( m_pos <= m_end ); - return addIndentAndSuffix( m_pos, m_len ); + std::string Column::const_iterator::operator*() const { + assert( m_lineStart <= m_parsedTo ); + return addIndentAndSuffix( m_lineStart, m_lineLength ); } - Column::iterator& Column::iterator::operator++() { - m_pos += m_len; + Column::const_iterator& Column::const_iterator::operator++() { + m_lineStart += m_lineLength; std::string const& current_line = m_column.m_string; - if ( m_pos < current_line.size() && current_line[m_pos] == '\n' ) { - m_pos += 1; + if ( m_lineStart < current_line.size() && current_line[m_lineStart] == '\n' ) { + m_lineStart += 1; } else { - while ( m_pos < current_line.size() && - isWhitespace( current_line[m_pos] ) ) { - ++m_pos; + while ( m_lineStart < current_line.size() && + isWhitespace( current_line[m_lineStart] ) ) { + ++m_lineStart; } } - if ( m_pos != current_line.size() ) { + if ( m_lineStart != current_line.size() ) { calcLength(); } return *this; } - Column::iterator Column::iterator::operator++( int ) { - iterator prev( *this ); + Column::const_iterator Column::const_iterator::operator++( int ) { + const_iterator prev( *this ); operator++(); return prev; } @@ -6061,6 +6698,23 @@ namespace Catch { + +#include <exception> + +namespace Catch { + bool uncaught_exceptions() { +#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) + return false; +#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) + return std::uncaught_exceptions() > 0; +#else + return std::uncaught_exception(); +#endif + } +} // end namespace Catch + + + namespace Catch { WildcardPattern::WildcardPattern( std::string const& pattern, @@ -6099,7 +6753,9 @@ namespace Catch { } - +// Note: swapping these two includes around causes MSVC to error out +// while in /permissive- mode. No, I don't know why. +// Tested on VS 2019, 18.{3, 4}.x #include <iomanip> #include <type_traits> @@ -6167,7 +6823,7 @@ namespace { } - XmlEncode::XmlEncode( std::string const& str, ForWhat forWhat ) + XmlEncode::XmlEncode( StringRef str, ForWhat forWhat ) : m_str( str ), m_forWhat( forWhat ) {} @@ -6177,7 +6833,7 @@ namespace { // (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]; + unsigned char c = static_cast<unsigned char>(m_str[idx]); switch (c) { case '<': os << "<"; break; case '&': os << "&"; break; @@ -6237,7 +6893,7 @@ namespace { bool valid = true; uint32_t value = headerValue(c); for (std::size_t n = 1; n < encBytes; ++n) { - unsigned char nc = m_str[idx + n]; + unsigned char nc = static_cast<unsigned char>(m_str[idx + n]); valid &= ((nc & 0xC0) == 0x80); value = (value << 6) | (nc & 0x3F); } @@ -6301,11 +6957,20 @@ namespace { } } - XmlWriter::ScopedElement& XmlWriter::ScopedElement::writeText( std::string const& text, XmlFormatting fmt ) { + XmlWriter::ScopedElement& + XmlWriter::ScopedElement::writeText( StringRef text, XmlFormatting fmt ) { m_writer->writeText( text, fmt ); return *this; } + XmlWriter::ScopedElement& + XmlWriter::ScopedElement::writeAttribute( StringRef name, + StringRef attribute ) { + m_writer->writeAttribute( name, attribute ); + return *this; + } + + XmlWriter::XmlWriter( std::ostream& os ) : m_os( os ) { writeDeclaration(); @@ -6349,7 +7014,7 @@ namespace { if (shouldIndent(fmt)) { m_os << m_indent; } - m_os << "</" << m_tags.back() << ">"; + m_os << "</" << m_tags.back() << '>'; } m_os << std::flush; applyFormatting(fmt); @@ -6357,48 +7022,50 @@ namespace { return *this; } - XmlWriter& XmlWriter::writeAttribute( std::string const& name, std::string const& attribute ) { + XmlWriter& XmlWriter::writeAttribute( StringRef name, + StringRef 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" ) << '"'; + XmlWriter& XmlWriter::writeAttribute( StringRef name, bool attribute ) { + writeAttribute(name, (attribute ? "true"_sr : "false"_sr)); + return *this; + } + + XmlWriter& XmlWriter::writeAttribute( StringRef name, + char const* attribute ) { + writeAttribute( name, StringRef( attribute ) ); return *this; } - XmlWriter& XmlWriter::writeText( std::string const& text, XmlFormatting fmt) { + XmlWriter& XmlWriter::writeText( StringRef text, XmlFormatting fmt ) { + CATCH_ENFORCE(!m_tags.empty(), "Cannot write text as top level element"); if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); if (tagWasOpen && shouldIndent(fmt)) { m_os << m_indent; } - m_os << XmlEncode( text ); + m_os << XmlEncode( text, XmlEncode::ForTextNodes ); applyFormatting(fmt); } return *this; } - XmlWriter& XmlWriter::writeComment( std::string const& text, XmlFormatting fmt) { + XmlWriter& XmlWriter::writeComment( StringRef text, XmlFormatting fmt ) { ensureTagClosed(); if (shouldIndent(fmt)) { m_os << m_indent; } - m_os << "<!--" << text << "-->"; + 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::writeStylesheetRef( StringRef url ) { + m_os << R"(<?xml-stylesheet type="text/xsl" href=")" << url << R"("?>)" << '\n'; } void XmlWriter::ensureTagClosed() { @@ -6414,12 +7081,12 @@ namespace { } void XmlWriter::writeDeclaration() { - m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; + m_os << R"(<?xml version="1.0" encoding="UTF-8"?>)" << '\n'; } void XmlWriter::newlineIfNecessary() { if( m_needsNewline ) { - m_os << std::endl; + m_os << '\n' << std::flush; m_needsNewline = false; } } @@ -6427,11 +7094,76 @@ namespace { + + +namespace Catch { +namespace Matchers { + + std::string MatcherUntypedBase::toString() const { + if (m_cachedToString.empty()) { + m_cachedToString = describe(); + } + return m_cachedToString; + } + + MatcherUntypedBase::~MatcherUntypedBase() = default; + +} // namespace Matchers +} // namespace Catch + + + + +namespace Catch { +namespace Matchers { + + std::string IsEmptyMatcher::describe() const { + return "is empty"; + } + + std::string HasSizeMatcher::describe() const { + ReusableStringStream sstr; + sstr << "has size == " << m_target_size; + return sstr.str(); + } + + IsEmptyMatcher IsEmpty() { + return {}; + } + + HasSizeMatcher SizeIs(std::size_t sz) { + return HasSizeMatcher{ sz }; + } + +} // end namespace Matchers +} // end namespace Catch + + + +namespace Catch { +namespace Matchers { + +bool ExceptionMessageMatcher::match(std::exception const& ex) const { + return ex.what() == m_message; +} + +std::string ExceptionMessageMatcher::describe() const { + return "exception message matches \"" + m_message + '"'; +} + +ExceptionMessageMatcher Message(std::string const& message) { + return ExceptionMessageMatcher(message); +} + +} // namespace Matchers +} // namespace Catch + + + #include <algorithm> #include <cmath> #include <cstdlib> #include <cstdint> -#include <cstring> #include <sstream> #include <iomanip> #include <limits> @@ -6440,20 +7172,6 @@ namespace { 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. @@ -6462,16 +7180,10 @@ namespace { 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; - } + // This should also handle positive and negative zeros, infinities + const auto ulpDist = ulpDistance(lhs, rhs); - auto ulpDiff = std::abs(lc - rc); - return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff; + return ulpDist <= maxUlpDiff; } #if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) @@ -6546,6 +7258,9 @@ namespace Detail { CATCH_ENFORCE(m_type == Detail::FloatingPointKind::Double || m_ulps < (std::numeric_limits<uint32_t>::max)(), "Provided ULP is impossibly large for a float comparison."); + CATCH_ENFORCE( std::numeric_limits<double>::is_iec559, + "WithinUlp matcher only supports platforms with " + "IEEE-754 compatible floating point representation" ); } #if defined(__clang__) @@ -6583,14 +7298,26 @@ namespace Detail { ret << " (["; if (m_type == Detail::FloatingPointKind::Double) { - write(ret, step(m_target, static_cast<double>(-INFINITY), m_ulps)); + write( ret, + step( m_target, + -std::numeric_limits<double>::infinity(), + m_ulps ) ); ret << ", "; - write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps)); + write( ret, + step( m_target, + std::numeric_limits<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)); + write( ret, + step( static_cast<float>( m_target ), + -std::numeric_limits<float>::infinity(), + m_ulps ) ); ret << ", "; - write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps)); + write( ret, + step( static_cast<float>( m_target ), + std::numeric_limits<float>::infinity(), + m_ulps ) ); } ret << "])"; @@ -6651,6 +7378,35 @@ WithinRelMatcher WithinRel(float target) { + +std::string Catch::Matchers::Detail::finalizeDescription(const std::string& desc) { + if (desc.empty()) { + return "matches undescribed predicate"; + } else { + return "matches predicate: \"" + desc + '"'; + } +} + + + +namespace Catch { + namespace Matchers { + std::string AllTrueMatcher::describe() const { return "contains only true"; } + + AllTrueMatcher AllTrue() { return AllTrueMatcher{}; } + + std::string NoneTrueMatcher::describe() const { return "contains no true"; } + + NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; } + + std::string AnyTrueMatcher::describe() const { return "contains at least one true"; } + + AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; } + } // namespace Matchers +} // namespace Catch + + + #include <regex> namespace Catch { @@ -6672,7 +7428,7 @@ namespace Matchers { } - StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator ) + StringMatcherBase::StringMatcherBase( StringRef operation, CasedString const& comparator ) : m_comparator( comparator ), m_operation( operation ) { } @@ -6684,33 +7440,33 @@ namespace Matchers { description += m_operation; description += ": \""; description += m_comparator.m_str; - description += "\""; + description += '"'; description += m_comparator.caseSensitivitySuffix(); return description; } - StringEqualsMatcher::StringEqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals", comparator ) {} + StringEqualsMatcher::StringEqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals"_sr, comparator ) {} bool StringEqualsMatcher::match( std::string const& source ) const { return m_comparator.adjustString( source ) == m_comparator.m_str; } - StringContainsMatcher::StringContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains", comparator ) {} + StringContainsMatcher::StringContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains"_sr, comparator ) {} bool StringContainsMatcher::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 ) {} + StartsWithMatcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with"_sr, 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 ) {} + EndsWithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with"_sr, comparator ) {} bool EndsWithMatcher::match( std::string const& source ) const { return endsWith( m_comparator.adjustString( source ), m_comparator.m_str ); @@ -6718,7 +7474,7 @@ namespace Matchers { - RegexMatcher::RegexMatcher(std::string regex, CaseSensitive caseSensitivity): m_regex(std::move(regex)), m_caseSensitivity(caseSensitivity) {} + RegexMatcher::RegexMatcher(std::string regex, CaseSensitive caseSensitivity): m_regex(CATCH_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 @@ -6737,7 +7493,7 @@ namespace Matchers { StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity ) { return StringEqualsMatcher( CasedString( str, caseSensitivity) ); } - StringContainsMatcher Contains( std::string const& str, CaseSensitive caseSensitivity ) { + StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity ) { return StringContainsMatcher( CasedString( str, caseSensitivity) ); } EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity ) { @@ -6768,7 +7524,7 @@ namespace Matchers { for ( auto desc = descriptions_begin; desc != descriptions_end; ++desc ) { combined_size += desc->size(); } - combined_size += (descriptions_end - descriptions_begin - 1) * combine.size(); + combined_size += static_cast<size_t>(descriptions_end - descriptions_begin - 1) * combine.size(); description.reserve(combined_size); @@ -6783,131 +7539,26 @@ namespace Matchers { } description += " )"; return description; - } - - } // namespace Detail -} // namespace Matchers -} // namespace Catch - - -/** \file - * This is a special TU that combines what would otherwise be a very - * small matcher-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -////////////////////////////////////////////// -// vvv formerly catch_matchers_impl.cpp vvv // -////////////////////////////////////////////// - -namespace Catch { - - // 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( std::move(exceptionMessage), matcher, matcherString ); - handler.handleExpr( expr ); - } - -} // namespace Catch - - -////////////////////////////////////////////////////////////// -// vvv formerly catch_matchers_container_properties.cpp vvv // -////////////////////////////////////////////////////////////// - -namespace Catch { -namespace Matchers { - - std::string IsEmptyMatcher::describe() const { - return "is empty"; - } - - std::string HasSizeMatcher::describe() const { - ReusableStringStream sstr; - sstr << "has size == " << m_target_size; - return sstr.str(); - } - - IsEmptyMatcher IsEmpty() { - return {}; - } - - HasSizeMatcher SizeIs(std::size_t sz) { - return HasSizeMatcher{ sz }; - } - -} // end namespace Matchers -} // end namespace Catch - - - -///////////////////////////////////////// -// vvv formerly catch_matchers.cpp vvv // -///////////////////////////////////////// - - -namespace Catch { -namespace Matchers { - - std::string MatcherUntypedBase::toString() const { - if (m_cachedToString.empty()) { - m_cachedToString = describe(); - } - return m_cachedToString; - } - - MatcherUntypedBase::~MatcherUntypedBase() = default; - -} // namespace Matchers -} // namespace Catch - - - -/////////////////////////////////////////////////// -// vvv formerly catch_matchers_predicate.cpp vvv // -/////////////////////////////////////////////////// - -std::string Catch::Matchers::Detail::finalizeDescription(const std::string& desc) { - if (desc.empty()) { - return "matches undescribed predicate"; - } else { - return "matches predicate: \"" + desc + '"'; - } -} - + } + } // namespace Detail +} // namespace Matchers +} // namespace Catch -/////////////////////////////////////////////////// -// vvv formerly catch_matchers_exception.cpp vvv // -/////////////////////////////////////////////////// namespace Catch { -namespace Matchers { - -bool ExceptionMessageMatcher::match(std::exception const& ex) const { - return ex.what() == m_message; -} - -std::string ExceptionMessageMatcher::describe() const { - return "exception message matches \"" + m_message + "\""; -} -ExceptionMessageMatcher Message(std::string const& message) { - return ExceptionMessageMatcher(message); -} + // 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 matcherString ) { + std::string exceptionMessage = Catch::translateActiveException(); + MatchExpr<std::string, StringMatcher const&> expr( CATCH_MOVE(exceptionMessage), matcher, matcherString ); + handler.handleExpr( expr ); + } -} // namespace Matchers } // namespace Catch @@ -6920,145 +7571,72 @@ namespace Catch { void AutomakeReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR. - stream << ":test-result: "; + m_stream << ":test-result: "; if (_testCaseStats.totals.assertions.allPassed()) { - stream << "PASS"; + m_stream << "PASS"; } else if (_testCaseStats.totals.assertions.allOk()) { - stream << "XFAIL"; + m_stream << "XFAIL"; } else { - stream << "FAIL"; + m_stream << "FAIL"; } - stream << ' ' << _testCaseStats.testInfo->name << '\n'; + m_stream << ' ' << _testCaseStats.testInfo->name << '\n'; StreamingReporterBase::testCaseEnded(_testCaseStats); } void AutomakeReporter::skipTest(TestCaseInfo const& testInfo) { - stream << ":test-result: SKIP " << testInfo.name << '\n'; + m_stream << ":test-result: SKIP " << testInfo.name << '\n'; } } // end namespace Catch -/** \file - * This is a special TU that combines what would otherwise be a very - * small reporter-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ -#include <cfloat> -#include <cstdio> -#include <ostream> + namespace Catch { + ReporterBase::ReporterBase( ReporterConfig&& config ): + IEventListener( config.fullConfig() ), + m_wrapped_stream( CATCH_MOVE(config).takeStream() ), + m_stream( m_wrapped_stream->stream() ), + m_colour( makeColourImpl( config.colourMode(), m_wrapped_stream.get() ) ), + m_customOptions( config.customOptions() ) + {} - // 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]; + ReporterBase::~ReporterBase() = default; - // 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 ); + void ReporterBase::listReporters( + std::vector<ReporterDescription> const& descriptions ) { + defaultListReporters(m_stream, descriptions, m_config->verbosity()); } - bool shouldShowDuration( IConfig const& config, double duration ) { - if ( config.showDurations() == ShowDurations::Always ) { - return true; - } - if ( config.showDurations() == ShowDurations::Never ) { - return false; - } - const double min = config.minDuration(); - return min >= 0 && duration >= min; + void ReporterBase::listListeners( + std::vector<ListenerDescription> const& descriptions ) { + defaultListListeners( m_stream, descriptions ); } - std::string serializeFilters( std::vector<std::string> const& filters ) { - // We add a ' ' separator between each filter - size_t serialized_size = filters.size() - 1; - for (auto const& filter : filters) { - serialized_size += filter.size(); - } - - std::string serialized; - serialized.reserve(serialized_size); - bool first = true; - - for (auto const& filter : filters) { - if (!first) { - serialized.push_back(' '); - } - first = false; - serialized.append(filter); - } - - return serialized; + void ReporterBase::listTests(std::vector<TestCaseHandle> const& tests) { + defaultListTests(m_stream, + m_colour.get(), + tests, + m_config->hasTestFilters(), + m_config->verbosity()); } - std::ostream& operator<<( std::ostream& out, lineOfChars value ) { - for ( size_t idx = 0; idx < CATCH_CONFIG_CONSOLE_WIDTH - 1; ++idx ) { - out.put( value.c ); - } - return out; + void ReporterBase::listTags(std::vector<TagInfo> const& tags) { + defaultListTags( m_stream, tags, m_config->hasTestFilters() ); } } // namespace Catch -namespace Catch { - void EventListenerBase::assertionStarting( AssertionInfo const& ) {} - - bool EventListenerBase::assertionEnded( AssertionStats const& ) { - return false; - } - void - EventListenerBase::listReporters( std::vector<ReporterDescription> const&, - IConfig const& ) {} - void EventListenerBase::listTests( std::vector<TestCaseHandle> const&, - IConfig const& ) {} - void EventListenerBase::listTags( std::vector<TagInfo> const&, - IConfig const& ) {} - void EventListenerBase::noMatchingTestCases( std::string const& ) {} - void EventListenerBase::testRunStarting( TestRunInfo const& ) {} - void EventListenerBase::testGroupStarting( GroupInfo const& ) {} - void EventListenerBase::testCaseStarting( TestCaseInfo const& ) {} - void EventListenerBase::sectionStarting( SectionInfo const& ) {} - void EventListenerBase::sectionEnded( SectionStats const& ) {} - void EventListenerBase::testCaseEnded( TestCaseStats const& ) {} - void EventListenerBase::testGroupEnded( TestGroupStats const& ) {} - void EventListenerBase::testRunEnded( TestRunStats const& ) {} - void EventListenerBase::skipTest( TestCaseInfo const& ) {} -} // namespace Catch - - - #include <ostream> namespace { - // Colour::LightGrey - Catch::Colour::Code dimColour() { return Catch::Colour::FileName; } - - Catch::StringRef bothOrAll( std::size_t count ) { + constexpr Catch::StringRef bothOrAll( std::uint64_t count ) { switch (count) { case 1: return Catch::StringRef{}; @@ -7075,6 +7653,9 @@ namespace { namespace Catch { namespace { + // Colour::LightGrey + static constexpr Colour::Code compactDimColour = Colour::FileName; + #ifdef CATCH_PLATFORM_MAC static constexpr Catch::StringRef compactFailedString = "FAILED"_sr; static constexpr Catch::StringRef compactPassedString = "PASSED"_sr; @@ -7089,35 +7670,33 @@ namespace { // - 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) { +void printTotals(std::ostream& out, const Totals& totals, ColourImpl* colourImpl) { if (totals.testCases.total() == 0) { out << "No tests ran."; } else if (totals.testCases.failed == totals.testCases.total()) { - Colour colour(Colour::ResultError); + auto guard = colourImpl->guardColour( Colour::ResultError ).engage( out ); const StringRef qualify_assertions_failed = totals.assertions.failed == totals.assertions.total() ? bothOrAll(totals.assertions.failed) : StringRef{}; out << "Failed " << bothOrAll(totals.testCases.failed) - << pluralise(totals.testCases.failed, "test case") << ", " + << pluralise(totals.testCases.failed, "test case"_sr) << ", " "failed " << qualify_assertions_failed << - pluralise(totals.assertions.failed, "assertion") << '.'; + pluralise(totals.assertions.failed, "assertion"_sr) << '.'; } else if (totals.assertions.total() == 0) { out << "Passed " << bothOrAll(totals.testCases.total()) - << pluralise(totals.testCases.total(), "test case") + << pluralise(totals.testCases.total(), "test case"_sr) << " (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") << '.'; + out << colourImpl->guardColour( Colour::ResultError ) << + "Failed " << pluralise(totals.testCases.failed, "test case"_sr) << ", " + "failed " << pluralise(totals.assertions.failed, "assertion"_sr) << '.'; } else { - Colour colour(Colour::ResultSuccess); - out << + out << colourImpl->guardColour( Colour::ResultSuccess ) << "Passed " << bothOrAll(totals.testCases.passed) - << pluralise(totals.testCases.passed, "test case") << - " with " << pluralise(totals.assertions.passed, "assertion") << '.'; + << pluralise(totals.testCases.passed, "test case"_sr) << + " with " << pluralise(totals.assertions.passed, "assertion"_sr) << '.'; } } @@ -7126,12 +7705,14 @@ class AssertionPrinter { public: AssertionPrinter& operator= (AssertionPrinter const&) = delete; AssertionPrinter(AssertionPrinter const&) = delete; - AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages) + AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages, ColourImpl* colourImpl_) : stream(_stream) , result(_stats.assertionResult) , messages(_stats.infoMessages) , itMessage(_stats.infoMessages.begin()) - , printInfoMessages(_printInfoMessages) {} + , printInfoMessages(_printInfoMessages) + , colourImpl(colourImpl_) + {} void print() { printSourceInfo(); @@ -7203,16 +7784,13 @@ public: private: void printSourceInfo() const { - Colour colourGuard(Colour::FileName); - stream << result.getSourceInfo() << ':'; + stream << colourImpl->guardColour( Colour::FileName ) + << result.getSourceInfo() << ':'; } void printResultType(Colour::Code colour, StringRef passOrFail) const { if (!passOrFail.empty()) { - { - Colour colourGuard(colour); - stream << ' ' << passOrFail; - } + stream << colourImpl->guardColour(colour) << ' ' << passOrFail; stream << ':'; } } @@ -7225,8 +7803,7 @@ private: if (result.hasExpression()) { stream << ';'; { - Colour colour(dimColour()); - stream << " expression was:"; + stream << colourImpl->guardColour(compactDimColour) << " expression was:"; } printOriginalExpression(); } @@ -7240,10 +7817,7 @@ private: void printReconstructedExpression() const { if (result.hasExpandedExpression()) { - { - Colour colour(dimColour()); - stream << " for: "; - } + stream << colourImpl->guardColour(compactDimColour) << " for: "; stream << result.getExpandedExpression(); } } @@ -7255,25 +7829,22 @@ private: } } - void printRemainingMessages(Colour::Code colour = dimColour()) { + void printRemainingMessages(Colour::Code colour = compactDimColour) { 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") << ':'; - } + stream << colourImpl->guardColour( colour ) << " with " + << pluralise( N, "message"_sr ) << ':'; 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"; + stream << colourImpl->guardColour(compactDimColour) << " and"; } continue; } @@ -7287,6 +7858,7 @@ private: std::vector<MessageInfo> messages; std::vector<MessageInfo>::const_iterator itMessage; bool printInfoMessages; + ColourImpl* colourImpl; }; } // anon namespace @@ -7295,13 +7867,21 @@ private: return "Reports test results on a single line, suitable for IDEs"; } - void CompactReporter::noMatchingTestCases( std::string const& spec ) { - stream << "No test cases matched '" << spec << '\'' << std::endl; + void CompactReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + m_stream << "No test cases matched '" << unmatchedSpec << "'\n"; } - void CompactReporter::assertionStarting( AssertionInfo const& ) {} + void CompactReporter::testRunStarting( TestRunInfo const& ) { + if ( m_config->testSpec().hasFilters() ) { + m_stream << m_colour->guardColour( Colour::BrightYellow ) + << "Filters: " + << serializeFilters( m_config->getTestsOrTags() ) + << '\n'; + } + m_stream << "RNG seed: " << m_config->rngSeed() << '\n'; + } - bool CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) { + void CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) { AssertionResult const& result = _assertionStats.assertionResult; bool printInfoMessages = true; @@ -7309,27 +7889,26 @@ private: // 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; + return; printInfoMessages = false; } - AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); + AssertionPrinter printer( m_stream, _assertionStats, printInfoMessages, m_colour.get() ); printer.print(); - stream << std::endl; - return true; + m_stream << '\n' << std::flush; } void CompactReporter::sectionEnded(SectionStats const& _sectionStats) { double dur = _sectionStats.durationInSeconds; if ( shouldShowDuration( *m_config, dur ) ) { - stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << std::endl; + m_stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; } } void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) { - printTotals( stream, _testRunStats.totals ); - stream << '\n' << std::endl; + printTotals( m_stream, _testRunStats.totals, m_colour.get() ); + m_stream << "\n\n" << std::flush; StreamingReporterBase::testRunEnded( _testRunStats ); } @@ -7340,7 +7919,6 @@ private: -#include <cfloat> #include <cstdio> #if defined(_MSC_VER) @@ -7366,18 +7944,19 @@ class ConsoleAssertionPrinter { public: ConsoleAssertionPrinter& operator= (ConsoleAssertionPrinter const&) = delete; ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete; - ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages) + ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, ColourImpl* colourImpl_, bool _printInfoMessages) : stream(_stream), stats(_stats), result(_stats.assertionResult), colour(Colour::None), message(result.getMessage()), messages(_stats.infoMessages), + colourImpl(colourImpl_), printInfoMessages(_printInfoMessages) { switch (result.getResultType()) { case ResultWas::Ok: colour = Colour::Success; - passOrFail = "PASSED"; + passOrFail = "PASSED"_sr; //if( result.hasMessage() ) if (_stats.infoMessages.size() == 1) messageLabel = "with message"; @@ -7387,10 +7966,10 @@ public: case ResultWas::ExpressionFailed: if (result.isOk()) { colour = Colour::Success; - passOrFail = "FAILED - but was ok"; + passOrFail = "FAILED - but was ok"_sr; } else { colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; } if (_stats.infoMessages.size() == 1) messageLabel = "with message"; @@ -7399,7 +7978,7 @@ public: break; case ResultWas::ThrewException: colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; messageLabel = "due to unexpected exception with "; if (_stats.infoMessages.size() == 1) messageLabel += "message"; @@ -7408,12 +7987,12 @@ public: break; case ResultWas::FatalErrorCondition: colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; messageLabel = "due to a fatal error condition"; break; case ResultWas::DidntThrowException: colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; messageLabel = "because no exception was thrown where one was expected"; break; case ResultWas::Info: @@ -7423,7 +8002,7 @@ public: messageLabel = "warning"; break; case ResultWas::ExplicitFailure: - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; colour = Colour::Error; if (_stats.infoMessages.size() == 1) messageLabel = "explicitly with message"; @@ -7434,7 +8013,7 @@ public: case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: - passOrFail = "** internal error **"; + passOrFail = "** internal error **"_sr; colour = Colour::Error; break; } @@ -7455,23 +8034,22 @@ public: private: void printResultType() const { if (!passOrFail.empty()) { - Colour colourGuard(colour); - stream << passOrFail << ":\n"; + stream << colourImpl->guardColour(colour) << passOrFail << ":\n"; } } void printOriginalExpression() const { if (result.hasExpression()) { - Colour colourGuard(Colour::OriginalExpression); - stream << " "; - stream << result.getExpressionInMacro(); - stream << '\n'; + stream << colourImpl->guardColour( Colour::OriginalExpression ) + << " " << result.getExpressionInMacro() << '\n'; } } void printReconstructedExpression() const { if (result.hasExpandedExpression()) { stream << "with expansion:\n"; - Colour colourGuard(Colour::ReconstructedExpression); - stream << TextFlow::Column(result.getExpandedExpression()).indent(2) << '\n'; + stream << colourImpl->guardColour( Colour::ReconstructedExpression ) + << TextFlow::Column( result.getExpandedExpression() ) + .indent( 2 ) + << '\n'; } } void printMessage() const { @@ -7484,27 +8062,28 @@ private: } } void printSourceInfo() const { - Colour colourGuard(Colour::FileName); - stream << result.getSourceInfo() << ": "; + stream << colourImpl->guardColour( Colour::FileName ) + << result.getSourceInfo() << ": "; } std::ostream& stream; AssertionStats const& stats; AssertionResult const& result; Colour::Code colour; - std::string passOrFail; + StringRef passOrFail; std::string messageLabel; std::string message; std::vector<MessageInfo> messages; + ColourImpl* colourImpl; 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 makeRatio( std::uint64_t number, std::uint64_t total ) { + const auto ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number / total : 0; + return (ratio == 0 && number > 0) ? 1 : static_cast<std::size_t>(ratio); } -std::size_t& findMax(std::size_t& i, std::size_t& j, std::size_t& k) { +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) @@ -7517,7 +8096,7 @@ enum class Justification { Left, Right }; struct ColumnInfo { std::string name; - int width; + std::size_t width; Justification justification; }; struct ColumnBreak {}; @@ -7606,7 +8185,7 @@ class TablePrinter { public: TablePrinter( std::ostream& os, std::vector<ColumnInfo> columnInfos ) : m_os( os ), - m_columnInfos( std::move( columnInfos ) ) {} + m_columnInfos( CATCH_MOVE( columnInfos ) ) {} auto columnInfos() const -> std::vector<ColumnInfo> const& { return m_columnInfos; @@ -7620,7 +8199,8 @@ public: TextFlow::Columns headerCols; auto spacer = TextFlow::Spacer(2); for (auto const& info : m_columnInfos) { - headerCols += TextFlow::Column(info.name).width(static_cast<std::size_t>(info.width - 2)); + assert(info.width > 2); + headerCols += TextFlow::Column(info.name).width(info.width - 2); headerCols += spacer; } m_os << headerCols << '\n'; @@ -7631,7 +8211,7 @@ public: void close() { if (m_isOpen) { *this << RowBreak(); - m_os << std::endl; + m_os << '\n' << std::flush; m_isOpen = false; } } @@ -7654,7 +8234,7 @@ public: tp.m_currentColumn++; auto colInfo = tp.m_columnInfos[tp.m_currentColumn]; - auto padding = (strSize + 1 < static_cast<std::size_t>(colInfo.width)) + auto padding = (strSize + 1 < colInfo.width) ? std::string(colInfo.width - (strSize + 1), ' ') : std::string(); if (colInfo.justification == Justification::Left) @@ -7673,9 +8253,9 @@ public: } }; -ConsoleReporter::ConsoleReporter(ReporterConfig const& config) - : StreamingReporterBase(config), - m_tablePrinter(new TablePrinter(config.stream(), +ConsoleReporter::ConsoleReporter(ReporterConfig&& config): + StreamingReporterBase( CATCH_MOVE( config ) ), + m_tablePrinter(Detail::make_unique<TablePrinter>(m_stream, [&config]() -> std::vector<ColumnInfo> { if (config.fullConfig()->benchmarkNoAnalysis()) { @@ -7702,31 +8282,30 @@ 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::noMatchingTestCases( StringRef unmatchedSpec ) { + m_stream << "No test cases matched '" << unmatchedSpec << "'\n"; } -void ConsoleReporter::reportInvalidArguments(std::string const&arg){ - stream << "Invalid Filter: " << arg << std::endl; +void ConsoleReporter::reportInvalidTestSpec( StringRef arg ) { + m_stream << "Invalid Filter: " << arg << '\n'; } void ConsoleReporter::assertionStarting(AssertionInfo const&) {} -bool ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) { +void 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; + return; lazyPrint(); - ConsoleAssertionPrinter printer(stream, _assertionStats, includeResults); + ConsoleAssertionPrinter printer(m_stream, _assertionStats, m_colour.get(), includeResults); printer.print(); - stream << std::endl; - return true; + m_stream << '\n' << std::flush; } void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) { @@ -7738,16 +8317,17 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) { m_tablePrinter->close(); if (_sectionStats.missingAssertions) { lazyPrint(); - Colour colour(Colour::ResultError); + auto guard = + m_colour->guardColour( Colour::ResultError ).engage( m_stream ); if (m_sectionStack.size() > 1) - stream << "\nNo assertions in section"; + m_stream << "\nNo assertions in section"; else - stream << "\nNo assertions in test case"; - stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; + m_stream << "\nNo assertions in test case"; + m_stream << " '" << _sectionStats.sectionInfo.name << "'\n\n" << std::flush; } double dur = _sectionStats.durationInSeconds; if (shouldShowDuration(*m_config, dur)) { - stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << std::endl; + m_stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; } if (m_headerPrinted) { m_headerPrinted = false; @@ -7755,10 +8335,11 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) { StreamingReporterBase::sectionEnded(_sectionStats); } -void ConsoleReporter::benchmarkPreparing(std::string const& name) { +void ConsoleReporter::benchmarkPreparing( StringRef name ) { lazyPrintWithoutClosingBenchmarkTable(); - auto nameCol = TextFlow::Column(name).width(static_cast<std::size_t>(m_tablePrinter->columnInfos()[0].width - 2)); + auto nameCol = TextFlow::Column( static_cast<std::string>( name ) ) + .width( m_tablePrinter->columnInfos()[0].width - 2 ); bool firstLine = true; for (auto line : nameCol) { @@ -7794,8 +8375,8 @@ void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) { } } -void ConsoleReporter::benchmarkFailed(std::string const& error) { - Colour colour(Colour::Red); +void ConsoleReporter::benchmarkFailed( StringRef error ) { + auto guard = m_colour->guardColour( Colour::Red ).engage( m_stream ); (*m_tablePrinter) << "Benchmark failed (" << error << ')' << ColumnBreak() << RowBreak(); @@ -7806,24 +8387,19 @@ void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { 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; + m_stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { StreamingReporterBase::testRunStarting(_testInfo); - printTestFilters(); + if ( m_config->testSpec().hasFilters() ) { + m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " + << serializeFilters( m_config->getTestsOrTags() ) << '\n'; + } + m_stream << "Randomness seeded to: " << m_config->rngSeed() << '\n'; } void ConsoleReporter::lazyPrint() { @@ -7834,40 +8410,30 @@ void ConsoleReporter::lazyPrint() { void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() { - if (!currentTestRunInfo.used) + if ( !m_testRunInfoPrinted ) { lazyPrintRunInfo(); - if (!currentGroupInfo.used) - lazyPrintGroupInfo(); - + } if (!m_headerPrinted) { printTestCaseAndSectionHeader(); m_headerPrinted = true; } } void ConsoleReporter::lazyPrintRunInfo() { - stream << '\n' << lineOfChars('~') << '\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; - } + m_stream << '\n' + << lineOfChars( '~' ) << '\n' + << m_colour->guardColour( Colour::SecondaryText ) + << currentTestRunInfo.name << " is a Catch2 v" << libraryVersion() + << " host application.\n" + << "Run with -? for options\n\n"; + + m_testRunInfoPrinted = true; } void ConsoleReporter::printTestCaseAndSectionHeader() { assert(!m_sectionStack.empty()); printOpenHeader(currentTestCaseInfo->name); if (m_sectionStack.size() > 1) { - Colour colourGuard(Colour::Headers); + auto guard = m_colour->guardColour( Colour::Headers ).engage( m_stream ); auto it = m_sectionStack.begin() + 1, // Skip first section (test case) @@ -7879,41 +8445,63 @@ void ConsoleReporter::printTestCaseAndSectionHeader() { SourceLineInfo lineInfo = m_sectionStack.back().lineInfo; - stream << lineOfChars('-') << '\n'; - Colour colourGuard(Colour::FileName); - stream << lineInfo << '\n'; - stream << lineOfChars('.') << '\n' << std::endl; + m_stream << lineOfChars( '-' ) << '\n' + << m_colour->guardColour( Colour::FileName ) << lineInfo << '\n' + << lineOfChars( '.' ) << "\n\n" + << std::flush; } void ConsoleReporter::printClosedHeader(std::string const& _name) { printOpenHeader(_name); - stream << lineOfChars('.') << '\n'; + m_stream << lineOfChars('.') << '\n'; } void ConsoleReporter::printOpenHeader(std::string const& _name) { - stream << lineOfChars('-') << '\n'; + m_stream << lineOfChars('-') << '\n'; { - Colour colourGuard(Colour::Headers); + auto guard = m_colour->guardColour( Colour::Headers ).engage( m_stream ); 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 << TextFlow::Column(_string).indent(indent + i).initialIndent(indent) << '\n'; + // We want to get a bit fancy with line breaking here, so that subsequent + // lines start after ":" if one is present, e.g. + // ``` + // blablabla: Fancy + // linebreaking + // ``` + // but we also want to avoid problems with overly long indentation causing + // the text to take up too many lines, e.g. + // ``` + // blablabla: F + // a + // n + // c + // y + // . + // . + // . + // ``` + // So we limit the prefix indentation check to first quarter of the possible + // width + std::size_t idx = _string.find( ": " ); + if ( idx != std::string::npos && idx < CATCH_CONFIG_CONSOLE_WIDTH / 4 ) { + idx += 2; + } else { + idx = 0; + } + m_stream << TextFlow::Column( _string ) + .indent( indent + idx ) + .initialIndent( indent ) + << '\n'; } struct SummaryColumn { SummaryColumn( std::string _label, Colour::Code _colour ) - : label( std::move( _label ) ), + : label( CATCH_MOVE( _label ) ), colour( _colour ) {} - SummaryColumn addRow( std::size_t count ) { + SummaryColumn addRow( std::uint64_t count ) { ReusableStringStream rss; rss << count; std::string row = rss.str(); @@ -7935,12 +8523,14 @@ struct SummaryColumn { void ConsoleReporter::printTotals( Totals const& totals ) { if (totals.testCases.total() == 0) { - stream << Colour(Colour::Warning) << "No tests ran\n"; + m_stream << m_colour->guardColour( 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") << ')' + m_stream << m_colour->guardColour( Colour::ResultSuccess ) + << "All tests passed"; + m_stream << " (" + << pluralise(totals.assertions.passed, "assertion"_sr) << " in " + << pluralise(totals.testCases.passed, "test case"_sr) << ')' << '\n'; } else { @@ -7958,26 +8548,28 @@ void ConsoleReporter::printTotals( Totals const& totals ) { .addRow(totals.testCases.failedButOk) .addRow(totals.assertions.failedButOk)); - printSummaryRow("test cases", columns, 0); - printSummaryRow("assertions", columns, 1); + printSummaryRow("test cases"_sr, columns, 0); + printSummaryRow("assertions"_sr, columns, 1); } } -void ConsoleReporter::printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row) { +void ConsoleReporter::printSummaryRow(StringRef label, std::vector<SummaryColumn> const& cols, std::size_t row) { for (auto col : cols) { - std::string value = col.rows[row]; + std::string const& value = col.rows[row]; if (col.label.empty()) { - stream << label << ": "; - if (value != "0") - stream << value; - else - stream << Colour(Colour::Warning) << "- none -"; + m_stream << label << ": "; + if ( value != "0" ) { + m_stream << value; + } else { + m_stream << m_colour->guardColour( Colour::Warning ) + << "- none -"; + } } else if (value != "0") { - stream << Colour(Colour::LightGrey) << " | "; - stream << Colour(col.colour) - << value << ' ' << col.label; + m_stream << m_colour->guardColour( Colour::LightGrey ) << " | " + << m_colour->guardColour( col.colour ) << value << ' ' + << col.label; } } - stream << '\n'; + m_stream << '\n'; } void ConsoleReporter::printTotalsDivider(Totals const& totals) { @@ -7990,26 +8582,25 @@ void ConsoleReporter::printTotalsDivider(Totals const& totals) { 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, '='); + m_stream << m_colour->guardColour( Colour::Error ) + << std::string( failedRatio, '=' ) + << m_colour->guardColour( Colour::ResultExpectedFailure ) + << std::string( failedButOkRatio, '=' ); + if ( totals.testCases.allPassed() ) { + m_stream << m_colour->guardColour( Colour::ResultSuccess ) + << std::string( passedRatio, '=' ); + } else { + m_stream << m_colour->guardColour( Colour::Success ) + << std::string( passedRatio, '=' ); + } } else { - stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '='); + m_stream << m_colour->guardColour( Colour::Warning ) + << std::string( CATCH_CONFIG_CONSOLE_WIDTH - 1, '=' ); } - stream << '\n'; + m_stream << '\n'; } void ConsoleReporter::printSummaryDivider() { - stream << lineOfChars('-') << '\n'; -} - -void ConsoleReporter::printTestFilters() { - if (m_config->testSpec().hasFilters()) { - Colour guard(Colour::BrightYellow); - stream << "Filters: " << serializeFilters(m_config->getTestsOrTags()) << '\n'; - } + m_stream << lineOfChars('-') << '\n'; } } // end namespace Catch @@ -8024,111 +8615,411 @@ void ConsoleReporter::printTestFilters() { + +#include <algorithm> +#include <cassert> + +namespace Catch { + namespace { + struct BySectionInfo { + BySectionInfo( SectionInfo const& other ): m_other( other ) {} + BySectionInfo( BySectionInfo const& other ): + m_other( other.m_other ) {} + bool operator()( + Detail::unique_ptr<CumulativeReporterBase::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; + }; + + } // namespace + + namespace Detail { + AssertionOrBenchmarkResult::AssertionOrBenchmarkResult( + AssertionStats const& assertion ): + m_assertion( assertion ) {} + + AssertionOrBenchmarkResult::AssertionOrBenchmarkResult( + BenchmarkStats<> const& benchmark ): + m_benchmark( benchmark ) {} + + bool AssertionOrBenchmarkResult::isAssertion() const { + return m_assertion.some(); + } + bool AssertionOrBenchmarkResult::isBenchmark() const { + return m_benchmark.some(); + } + + AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const { + assert(m_assertion.some()); + + return *m_assertion; + } + BenchmarkStats<> const& AssertionOrBenchmarkResult::asBenchmark() const { + assert(m_benchmark.some()); + + return *m_benchmark; + } + + } + + CumulativeReporterBase::~CumulativeReporterBase() = default; + + void CumulativeReporterBase::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) { + m_sectionStack.back()->assertionsAndBenchmarks.emplace_back(benchmarkStats); + } + + void + CumulativeReporterBase::sectionStarting( SectionInfo const& sectionInfo ) { + SectionStats incompleteStats( sectionInfo, Counts(), 0, false ); + SectionNode* node; + if ( m_sectionStack.empty() ) { + if ( !m_rootSection ) { + m_rootSection = + Detail::make_unique<SectionNode>( incompleteStats ); + } + node = m_rootSection.get(); + } else { + SectionNode& parentNode = *m_sectionStack.back(); + auto it = std::find_if( parentNode.childSections.begin(), + parentNode.childSections.end(), + BySectionInfo( sectionInfo ) ); + if ( it == parentNode.childSections.end() ) { + auto newNode = + Detail::make_unique<SectionNode>( incompleteStats ); + node = newNode.get(); + parentNode.childSections.push_back( CATCH_MOVE( newNode ) ); + } else { + node = it->get(); + } + } + + m_deepestSection = node; + m_sectionStack.push_back( node ); + } + + void CumulativeReporterBase::assertionEnded( + AssertionStats const& assertionStats ) { + 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. + if ( m_shouldStoreFailedAssertions && + !assertionStats.assertionResult.isOk() ) { + static_cast<void>( + assertionStats.assertionResult.getExpandedExpression() ); + } + if ( m_shouldStoreSuccesfulAssertions && + assertionStats.assertionResult.isOk() ) { + static_cast<void>( + assertionStats.assertionResult.getExpandedExpression() ); + } + SectionNode& sectionNode = *m_sectionStack.back(); + sectionNode.assertionsAndBenchmarks.emplace_back( assertionStats ); + } + + void CumulativeReporterBase::sectionEnded( SectionStats const& sectionStats ) { + assert( !m_sectionStack.empty() ); + SectionNode& node = *m_sectionStack.back(); + node.stats = sectionStats; + m_sectionStack.pop_back(); + } + + void CumulativeReporterBase::testCaseEnded( + TestCaseStats const& testCaseStats ) { + auto node = Detail::make_unique<TestCaseNode>( testCaseStats ); + assert( m_sectionStack.size() == 0 ); + node->children.push_back( CATCH_MOVE(m_rootSection) ); + m_testCases.push_back( CATCH_MOVE(node) ); + + assert( m_deepestSection ); + m_deepestSection->stdOut = testCaseStats.stdOut; + m_deepestSection->stdErr = testCaseStats.stdErr; + } + + + void CumulativeReporterBase::testRunEnded( TestRunStats const& testRunStats ) { + assert(!m_testRun && "CumulativeReporterBase assumes there can only be one test run"); + m_testRun = Detail::make_unique<TestRunNode>( testRunStats ); + m_testRun->children.swap( m_testCases ); + testRunEndedCumulative(); + } + + bool CumulativeReporterBase::SectionNode::hasAnyAssertions() const { + return std::any_of( + assertionsAndBenchmarks.begin(), + assertionsAndBenchmarks.end(), + []( Detail::AssertionOrBenchmarkResult const& res ) { + return res.isAssertion(); + } ); + } + +} // end namespace Catch + + + + +namespace Catch { + + void EventListenerBase::fatalErrorEncountered( StringRef ) {} + + void EventListenerBase::benchmarkPreparing( StringRef ) {} + void EventListenerBase::benchmarkStarting( BenchmarkInfo const& ) {} + void EventListenerBase::benchmarkEnded( BenchmarkStats<> const& ) {} + void EventListenerBase::benchmarkFailed( StringRef ) {} + + void EventListenerBase::assertionStarting( AssertionInfo const& ) {} + + void EventListenerBase::assertionEnded( AssertionStats const& ) {} + void EventListenerBase::listReporters( + std::vector<ReporterDescription> const& ) {} + void EventListenerBase::listListeners( + std::vector<ListenerDescription> const& ) {} + void EventListenerBase::listTests( std::vector<TestCaseHandle> const& ) {} + void EventListenerBase::listTags( std::vector<TagInfo> const& ) {} + void EventListenerBase::noMatchingTestCases( StringRef ) {} + void EventListenerBase::reportInvalidTestSpec( StringRef ) {} + void EventListenerBase::testRunStarting( TestRunInfo const& ) {} + void EventListenerBase::testCaseStarting( TestCaseInfo const& ) {} + void EventListenerBase::testCasePartialStarting(TestCaseInfo const&, uint64_t) {} + void EventListenerBase::sectionStarting( SectionInfo const& ) {} + void EventListenerBase::sectionEnded( SectionStats const& ) {} + void EventListenerBase::testCasePartialEnded(TestCaseStats const&, uint64_t) {} + void EventListenerBase::testCaseEnded( TestCaseStats const& ) {} + void EventListenerBase::testRunEnded( TestRunStats const& ) {} + void EventListenerBase::skipTest( TestCaseInfo const& ) {} +} // namespace Catch + + + + #include <algorithm> -#include <cassert> +#include <cfloat> +#include <cstdio> +#include <ostream> +#include <iomanip> namespace Catch { + namespace { - struct BySectionInfo { - BySectionInfo( SectionInfo const& other ): m_other( other ) {} - BySectionInfo( BySectionInfo const& other ): - m_other( other.m_other ) {} - bool operator()( - std::shared_ptr<CumulativeReporterBase::SectionNode> const& - node ) const { - return ( - ( node->stats.sectionInfo.name == m_other.name ) && - ( node->stats.sectionInfo.lineInfo == m_other.lineInfo ) ); + void listTestNamesOnly(std::ostream& out, + std::vector<TestCaseHandle> const& tests) { + for (auto const& test : tests) { + auto const& testCaseInfo = test.getTestCaseInfo(); + + if (startsWith(testCaseInfo.name, '#')) { + out << '"' << testCaseInfo.name << '"'; + } else { + out << testCaseInfo.name; + } + + out << '\n'; } - void operator=( BySectionInfo const& ) = delete; + out << std::flush; + } + } // end unnamed namespace - private: - SectionInfo const& m_other; - }; - 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 + size_t printedLength = static_cast<size_t>( + sprintf_s( buffer, "%.3f", duration ) ); +#else + size_t printedLength = static_cast<size_t>( + std::snprintf( buffer, maxDoubleSize, "%.3f", duration ) ); +#endif + return std::string( buffer, printedLength ); + } + + bool shouldShowDuration( IConfig const& config, double duration ) { + if ( config.showDurations() == ShowDurations::Always ) { + return true; } - } // namespace + if ( config.showDurations() == ShowDurations::Never ) { + return false; + } + const double min = config.minDuration(); + return min >= 0 && duration >= min; + } + std::string serializeFilters( std::vector<std::string> const& filters ) { + // We add a ' ' separator between each filter + size_t serialized_size = filters.size() - 1; + for (auto const& filter : filters) { + serialized_size += filter.size(); + } - CumulativeReporterBase::~CumulativeReporterBase() = default; + std::string serialized; + serialized.reserve(serialized_size); + bool first = true; - void - CumulativeReporterBase::sectionStarting( SectionInfo const& sectionInfo ) { - 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; + for (auto const& filter : filters) { + if (!first) { + serialized.push_back(' '); } + first = false; + serialized.append(filter); } - m_sectionStack.push_back( node ); - m_deepestSection = std::move( node ); + + return serialized; } - bool CumulativeReporterBase::assertionEnded( - AssertionStats const& assertionStats ) { - 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; + std::ostream& operator<<( std::ostream& out, lineOfChars value ) { + for ( size_t idx = 0; idx < CATCH_CONFIG_CONSOLE_WIDTH - 1; ++idx ) { + out.put( value.c ); + } + return out; } - void CumulativeReporterBase::sectionEnded( SectionStats const& sectionStats ) { - assert( !m_sectionStack.empty() ); - SectionNode& node = *m_sectionStack.back(); - node.stats = sectionStats; - m_sectionStack.pop_back(); + void + defaultListReporters( std::ostream& out, + std::vector<ReporterDescription> const& descriptions, + Verbosity verbosity ) { + out << "Available reporters:\n"; + const auto maxNameLen = + std::max_element( descriptions.begin(), + descriptions.end(), + []( ReporterDescription const& lhs, + ReporterDescription const& rhs ) { + return lhs.name.size() < rhs.name.size(); + } ) + ->name.size(); + + for ( auto const& desc : descriptions ) { + if ( verbosity == Verbosity::Quiet ) { + out << TextFlow::Column( desc.name ) + .indent( 2 ) + .width( 5 + maxNameLen ) + << '\n'; + } else { + out << TextFlow::Column( desc.name + ':' ) + .indent( 2 ) + .width( 5 + maxNameLen ) + + TextFlow::Column( desc.description ) + .initialIndent( 0 ) + .indent( 2 ) + .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8 ) + << '\n'; + } + } + out << '\n' << std::flush; } - void CumulativeReporterBase::testCaseEnded( - TestCaseStats const& testCaseStats ) { - 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(); + void defaultListListeners( std::ostream& out, + std::vector<ListenerDescription> const& descriptions ) { + out << "Registered listeners:\n"; - assert( m_deepestSection ); - m_deepestSection->stdOut = testCaseStats.stdOut; - m_deepestSection->stdErr = testCaseStats.stdErr; + if(descriptions.empty()) { + return; + } + + const auto maxNameLen = + std::max_element( descriptions.begin(), + descriptions.end(), + []( ListenerDescription const& lhs, + ListenerDescription const& rhs ) { + return lhs.name.size() < rhs.name.size(); + } ) + ->name.size(); + + for ( auto const& desc : descriptions ) { + out << TextFlow::Column( static_cast<std::string>( desc.name ) + + ':' ) + .indent( 2 ) + .width( maxNameLen + 5 ) + + TextFlow::Column( desc.description ) + .initialIndent( 0 ) + .indent( 2 ) + .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8 ) + << '\n'; + } + + out << '\n' << std::flush; } - void CumulativeReporterBase::testGroupEnded( - TestGroupStats const& testGroupStats ) { - auto node = std::make_shared<TestGroupNode>( testGroupStats ); - node->children.swap( m_testCases ); - m_testGroups.push_back( node ); + void defaultListTags( std::ostream& out, + std::vector<TagInfo> const& tags, + bool isFiltered ) { + if ( isFiltered ) { + out << "Tags for matching test cases:\n"; + } else { + out << "All available tags:\n"; + } + + for ( auto const& tagCount : tags ) { + ReusableStringStream rss; + rss << " " << std::setw( 2 ) << tagCount.count << " "; + auto str = rss.str(); + auto wrapper = TextFlow::Column( tagCount.all() ) + .initialIndent( 0 ) + .indent( str.size() ) + .width( CATCH_CONFIG_CONSOLE_WIDTH - 10 ); + out << str << wrapper << '\n'; + } + out << pluralise(tags.size(), "tag"_sr) << "\n\n" << std::flush; } - void CumulativeReporterBase::testRunEnded( TestRunStats const& testRunStats ) { - auto node = std::make_shared<TestRunNode>( testRunStats ); - node->children.swap( m_testGroups ); - m_testRuns.push_back( node ); - testRunEndedCumulative(); + void defaultListTests(std::ostream& out, ColourImpl* streamColour, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity) { + // We special case this to provide the equivalent of old + // `--list-test-names-only`, which could then be used by the + // `--input-file` option. + if (verbosity == Verbosity::Quiet) { + listTestNamesOnly(out, tests); + return; + } + + if (isFiltered) { + out << "Matching test cases:\n"; + } else { + out << "All available test cases:\n"; + } + + for (auto const& test : tests) { + auto const& testCaseInfo = test.getTestCaseInfo(); + Colour::Code colour = testCaseInfo.isHidden() + ? Colour::SecondaryText + : Colour::None; + auto colourGuard = streamColour->guardColour( colour ).engage( out ); + + out << TextFlow::Column(testCaseInfo.name).indent(2) << '\n'; + if (verbosity >= Verbosity::High) { + out << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << '\n'; + } + if (!testCaseInfo.tags.empty() && + verbosity > Verbosity::Quiet) { + out << TextFlow::Column(testCaseInfo.tagsAsString()).indent(6) << '\n'; + } + } + + if (isFiltered) { + out << pluralise(tests.size(), "matching test case"_sr); + } else { + out << pluralise(tests.size(), "test case"_sr); + } + out << "\n\n" << std::flush; } -} // end namespace Catch +} // namespace Catch @@ -8136,34 +9027,29 @@ namespace Catch { #include <cassert> #include <ctime> #include <algorithm> +#include <iomanip> 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 = {}; +#if defined (_MSC_VER) || defined (__MINGW32__) gmtime_s(&timeInfo, &rawtime); #else - std::tm* timeInfo; - timeInfo = std::gmtime(&rawtime); + gmtime_r(&rawtime, &timeInfo); #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); + + return std::string(timeStamp, timeStampSize - 1); } std::string fileNameTag(std::vector<Tag> const& tags) { @@ -8179,45 +9065,58 @@ namespace Catch { } return std::string(); } + + // Formats the duration in seconds to 3 decimal places. + // This is done because some genius defined Maven Surefire schema + // in a way that only accepts 3 decimal places, and tools like + // Jenkins use that schema for validation JUnit reporter output. + std::string formatDuration( double seconds ) { + ReusableStringStream rss; + rss << std::fixed << std::setprecision( 3 ) << seconds; + return rss.str(); + } + + static void normalizeNamespaceMarkers(std::string& str) { + std::size_t pos = str.find( "::" ); + while ( pos != str.npos ) { + str.replace( pos, 2, "." ); + pos += 1; + pos = str.find( "::", pos ); + } + } + } // anonymous namespace - JunitReporter::JunitReporter( ReporterConfig const& _config ) - : CumulativeReporterBase( _config ), - xml( _config.stream() ) + JunitReporter::JunitReporter( ReporterConfig&& _config ) + : CumulativeReporterBase( CATCH_MOVE(_config) ), + xml( m_stream ) { m_preferences.shouldRedirectStdOut = true; m_preferences.shouldReportAllAssertions = true; + m_shouldStoreSuccesfulAssertions = false; } - 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 ) { + void JunitReporter::assertionEnded( AssertionStats const& assertionStats ) { if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail ) unexpectedExceptions++; - return CumulativeReporterBase::assertionEnded( assertionStats ); + CumulativeReporterBase::assertionEnded( assertionStats ); } void JunitReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { @@ -8226,48 +9125,42 @@ namespace Catch { CumulativeReporterBase::testCaseEnded( testCaseStats ); } - void JunitReporter::testGroupEnded( TestGroupStats const& testGroupStats ) { - double suiteTime = suiteTimer.getElapsedSeconds(); - CumulativeReporterBase::testGroupEnded( testGroupStats ); - writeGroup( *m_testGroups.back(), suiteTime ); - } - void JunitReporter::testRunEndedCumulative() { + const auto suiteTime = suiteTimer.getElapsedSeconds(); + writeRun( *m_testRun, suiteTime ); xml.endElement(); } - void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) { + void JunitReporter::writeRun( TestRunNode const& testRunNode, 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 + TestRunStats const& stats = testRunNode.value; + xml.writeAttribute( "name"_sr, stats.runInfo.name ); + xml.writeAttribute( "errors"_sr, unexpectedExceptions ); + xml.writeAttribute( "failures"_sr, stats.totals.assertions.failed-unexpectedExceptions ); + xml.writeAttribute( "tests"_sr, stats.totals.assertions.total() ); + xml.writeAttribute( "hostname"_sr, "tbd"_sr ); // !TBD if( m_config->showDurations() == ShowDurations::Never ) - xml.writeAttribute( "time", "" ); + xml.writeAttribute( "time"_sr, ""_sr ); else - xml.writeAttribute( "time", suiteTime ); - xml.writeAttribute( "timestamp", getCurrentTimestamp() ); + xml.writeAttribute( "time"_sr, formatDuration( suiteTime ) ); + xml.writeAttribute( "timestamp"_sr, getCurrentTimestamp() ); - // Write properties if there are any - if (m_config->hasTestFilters() || m_config->rngSeed() != 0) { + // Write properties + { auto properties = xml.scopedElement("properties"); + xml.scopedElement("property") + .writeAttribute("name"_sr, "random-seed"_sr) + .writeAttribute("value"_sr, m_config->rngSeed()); 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()); + .writeAttribute("name"_sr, "filters"_sr) + .writeAttribute("value"_sr, serializeFilters(m_config->getTestsOrTags())); } } // Write test cases - for( auto const& child : groupNode.children ) + for( auto const& child : testRunNode.children ) writeTestCase( *child ); xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline ); @@ -8282,48 +9175,59 @@ namespace Catch { assert( testCaseNode.children.size() == 1 ); SectionNode const& rootSection = *testCaseNode.children.front(); - std::string className = stats.testInfo->className; + std::string className = + static_cast<std::string>( stats.testInfo->className ); if( className.empty() ) { className = fileNameTag(stats.testInfo->tags); - if ( className.empty() ) + if ( className.empty() ) { className = "global"; + } } if ( !m_config->name().empty() ) - className = m_config->name() + "." + className; + className = static_cast<std::string>(m_config->name()) + '.' + className; - writeSection( className, "", rootSection ); + normalizeNamespaceMarkers(className); + + writeSection( className, "", rootSection, stats.testInfo->okToFail() ); } - void JunitReporter::writeSection( std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode ) { + void JunitReporter::writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode, + bool testOkToFail) { std::string name = trim( sectionNode.stats.sectionInfo.name ); if( !rootName.empty() ) name = rootName + '/' + name; - if( !sectionNode.assertions.empty() || - !sectionNode.stdOut.empty() || - !sectionNode.stdErr.empty() ) { + if( sectionNode.hasAnyAssertions() + || !sectionNode.stdOut.empty() + || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); if( className.empty() ) { - xml.writeAttribute( "classname", name ); - xml.writeAttribute( "name", "root" ); + xml.writeAttribute( "classname"_sr, name ); + xml.writeAttribute( "name"_sr, "root"_sr ); } else { - xml.writeAttribute( "classname", className ); - xml.writeAttribute( "name", name ); + xml.writeAttribute( "classname"_sr, className ); + xml.writeAttribute( "name"_sr, name ); } - xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) ); + xml.writeAttribute( "time"_sr, formatDuration( sectionNode.stats.durationInSeconds ) ); // This is not ideal, but it should be enough to mimic gtest's // junit output. // Ideally the JUnit reporter would also handle `skipTest` // events and write those out appropriately. - xml.writeAttribute( "status", "run" ); + xml.writeAttribute( "status"_sr, "run"_sr ); + + if (sectionNode.stats.assertions.failedButOk) { + xml.scopedElement("skipped") + .writeAttribute("message", "TEST_CASE tagged with !mayfail"); + } writeAssertions( sectionNode ); + if( !sectionNode.stdOut.empty() ) xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline ); if( !sectionNode.stdErr.empty() ) @@ -8331,14 +9235,17 @@ namespace Catch { } for( auto const& childNode : sectionNode.childSections ) if( className.empty() ) - writeSection( name, "", *childNode ); + writeSection( name, "", *childNode, testOkToFail ); else - writeSection( className, name, *childNode ); + writeSection( className, name, *childNode, testOkToFail ); } void JunitReporter::writeAssertions( SectionNode const& sectionNode ) { - for( auto const& assertion : sectionNode.assertions ) - writeAssertion( assertion ); + for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) { + if (assertionOrBenchmark.isAssertion()) { + writeAssertion(assertionOrBenchmark.asAssertion()); + } + } } void JunitReporter::writeAssertion( AssertionStats const& stats ) { @@ -8369,8 +9276,8 @@ namespace Catch { XmlWriter::ScopedElement e = xml.scopedElement( elementName ); - xml.writeAttribute( "message", result.getExpression() ); - xml.writeAttribute( "type", result.getTestMacroName() ); + xml.writeAttribute( "message"_sr, result.getExpression() ); + xml.writeAttribute( "type"_sr, result.getTestMacroName() ); ReusableStringStream rss; if (stats.totals.assertions.total() > 0) { @@ -8403,164 +9310,189 @@ namespace Catch { -#include <cassert> + +#include <ostream> namespace Catch { + void MultiReporter::updatePreferences(IEventListener const& reporterish) { + m_preferences.shouldRedirectStdOut |= + reporterish.getPreferences().shouldRedirectStdOut; + m_preferences.shouldReportAllAssertions |= + reporterish.getPreferences().shouldReportAllAssertions; + } - ListeningReporter::ListeningReporter() { - // We will assume that listeners will always want all assertions - m_preferences.shouldReportAllAssertions = true; + void MultiReporter::addListener( IEventListenerPtr&& listener ) { + updatePreferences(*listener); + m_reporterLikes.insert(m_reporterLikes.begin() + m_insertedListeners, CATCH_MOVE(listener) ); + ++m_insertedListeners; } - void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) { - m_listeners.push_back( std::move( listener ) ); + void MultiReporter::addReporter( IEventListenerPtr&& reporter ) { + updatePreferences(*reporter); + + // We will need to output the captured stdout if there are reporters + // that do not want it captured. + // We do not consider listeners, because it is generally assumed that + // listeners are output-transparent, even though they can ask for stdout + // capture to do something with it. + m_haveNoncapturingReporters |= !reporter->getPreferences().shouldRedirectStdOut; + + // Reporters can always be placed to the back without breaking the + // reporting order + m_reporterLikes.push_back( CATCH_MOVE( reporter ) ); } - 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; + void MultiReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->noMatchingTestCases( unmatchedSpec ); + } } - void ListeningReporter::noMatchingTestCases( std::string const& spec ) { - for ( auto const& listener : m_listeners ) { - listener->noMatchingTestCases( spec ); + void MultiReporter::fatalErrorEncountered( StringRef error ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->fatalErrorEncountered( error ); } - m_reporter->noMatchingTestCases( spec ); } - void ListeningReporter::reportInvalidArguments(std::string const&arg){ - for ( auto const& listener : m_listeners ) { - listener->reportInvalidArguments( arg ); + void MultiReporter::reportInvalidTestSpec( StringRef arg ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->reportInvalidTestSpec( arg ); } - m_reporter->reportInvalidArguments( arg ); } - void ListeningReporter::benchmarkPreparing( std::string const& name ) { - for (auto const& listener : m_listeners) { - listener->benchmarkPreparing(name); + void MultiReporter::benchmarkPreparing( StringRef name ) { + for (auto& reporterish : m_reporterLikes) { + reporterish->benchmarkPreparing(name); } - m_reporter->benchmarkPreparing(name); } - void ListeningReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) { - for ( auto const& listener : m_listeners ) { - listener->benchmarkStarting( benchmarkInfo ); + void MultiReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->benchmarkStarting( benchmarkInfo ); } - m_reporter->benchmarkStarting( benchmarkInfo ); } - void ListeningReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) { - for ( auto const& listener : m_listeners ) { - listener->benchmarkEnded( benchmarkStats ); + void MultiReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->benchmarkEnded( benchmarkStats ); } - m_reporter->benchmarkEnded( benchmarkStats ); } - void ListeningReporter::benchmarkFailed( std::string const& error ) { - for (auto const& listener : m_listeners) { - listener->benchmarkFailed(error); + void MultiReporter::benchmarkFailed( StringRef error ) { + for (auto& reporterish : m_reporterLikes) { + reporterish->benchmarkFailed(error); } - m_reporter->benchmarkFailed(error); } - void ListeningReporter::testRunStarting( TestRunInfo const& testRunInfo ) { - for ( auto const& listener : m_listeners ) { - listener->testRunStarting( testRunInfo ); + void MultiReporter::testRunStarting( TestRunInfo const& testRunInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testRunStarting( testRunInfo ); } - m_reporter->testRunStarting( testRunInfo ); } - void ListeningReporter::testGroupStarting( GroupInfo const& groupInfo ) { - for ( auto const& listener : m_listeners ) { - listener->testGroupStarting( groupInfo ); + void MultiReporter::testCaseStarting( TestCaseInfo const& testInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCaseStarting( testInfo ); } - m_reporter->testGroupStarting( groupInfo ); } - - void ListeningReporter::testCaseStarting( TestCaseInfo const& testInfo ) { - for ( auto const& listener : m_listeners ) { - listener->testCaseStarting( testInfo ); + void + MultiReporter::testCasePartialStarting( TestCaseInfo const& testInfo, + uint64_t partNumber ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCasePartialStarting( testInfo, partNumber ); } - m_reporter->testCaseStarting( testInfo ); } - void ListeningReporter::sectionStarting( SectionInfo const& sectionInfo ) { - for ( auto const& listener : m_listeners ) { - listener->sectionStarting( sectionInfo ); + void MultiReporter::sectionStarting( SectionInfo const& sectionInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->sectionStarting( sectionInfo ); } - m_reporter->sectionStarting( sectionInfo ); } - void ListeningReporter::assertionStarting( AssertionInfo const& assertionInfo ) { - for ( auto const& listener : m_listeners ) { - listener->assertionStarting( assertionInfo ); + void MultiReporter::assertionStarting( AssertionInfo const& assertionInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->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 ) ); + void MultiReporter::assertionEnded( AssertionStats const& assertionStats ) { + const bool reportByDefault = + assertionStats.assertionResult.getResultType() != ResultWas::Ok || + m_config->includeSuccessfulResults(); + + for ( auto & reporterish : m_reporterLikes ) { + if ( reportByDefault || + reporterish->getPreferences().shouldReportAllAssertions ) { + reporterish->assertionEnded( assertionStats ); + } } - return m_reporter->assertionEnded( assertionStats ); } - void ListeningReporter::sectionEnded( SectionStats const& sectionStats ) { - for ( auto const& listener : m_listeners ) { - listener->sectionEnded( sectionStats ); + void MultiReporter::sectionEnded( SectionStats const& sectionStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->sectionEnded( sectionStats ); } - m_reporter->sectionEnded( sectionStats ); } - void ListeningReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { - for ( auto const& listener : m_listeners ) { - listener->testCaseEnded( testCaseStats ); + void MultiReporter::testCasePartialEnded( TestCaseStats const& testStats, + uint64_t partNumber ) { + if ( m_preferences.shouldRedirectStdOut && + m_haveNoncapturingReporters ) { + if ( !testStats.stdOut.empty() ) { + Catch::cout() << testStats.stdOut << std::flush; + } + if ( !testStats.stdErr.empty() ) { + Catch::cerr() << testStats.stdErr << std::flush; + } + } + + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCasePartialEnded( testStats, partNumber ); } - m_reporter->testCaseEnded( testCaseStats ); } - void ListeningReporter::testGroupEnded( TestGroupStats const& testGroupStats ) { - for ( auto const& listener : m_listeners ) { - listener->testGroupEnded( testGroupStats ); + void MultiReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCaseEnded( testCaseStats ); } - m_reporter->testGroupEnded( testGroupStats ); } - void ListeningReporter::testRunEnded( TestRunStats const& testRunStats ) { - for ( auto const& listener : m_listeners ) { - listener->testRunEnded( testRunStats ); + void MultiReporter::testRunEnded( TestRunStats const& testRunStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testRunEnded( testRunStats ); } - m_reporter->testRunEnded( testRunStats ); } - void ListeningReporter::skipTest( TestCaseInfo const& testInfo ) { - for ( auto const& listener : m_listeners ) { - listener->skipTest( testInfo ); + void MultiReporter::skipTest( TestCaseInfo const& testInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->skipTest( testInfo ); + } + } + + void MultiReporter::listReporters(std::vector<ReporterDescription> const& descriptions) { + for (auto& reporterish : m_reporterLikes) { + reporterish->listReporters(descriptions); } - m_reporter->skipTest( testInfo ); } - void ListeningReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) { - for (auto const& listener : m_listeners) { - listener->listReporters(descriptions, config); + void MultiReporter::listListeners( + std::vector<ListenerDescription> const& descriptions ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->listListeners( descriptions ); } - m_reporter->listReporters(descriptions, config); } - void ListeningReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) { - for (auto const& listener : m_listeners) { - listener->listTests(tests, config); + void MultiReporter::listTests(std::vector<TestCaseHandle> const& tests) { + for (auto& reporterish : m_reporterLikes) { + reporterish->listTests(tests); } - m_reporter->listTests(tests, config); } - void ListeningReporter::listTags(std::vector<TagInfo> const& tags, IConfig const& config) { - for (auto const& listener : m_listeners) { - listener->listTags(tags, config); + void MultiReporter::listTags(std::vector<TagInfo> const& tags) { + for (auto& reporterish : m_reporterLikes) { + reporterish->listTags(tags); } - m_reporter->listTags(tags, config); } } // end namespace Catch @@ -8568,35 +9500,65 @@ namespace Catch { + +namespace Catch { + namespace Detail { + + void registerReporterImpl( std::string const& name, + IReporterFactoryPtr reporterPtr ) { + CATCH_TRY { + getMutableRegistryHub().registerReporter( + name, CATCH_MOVE( reporterPtr ) ); + } + CATCH_CATCH_ALL { + // Do not throw when constructing global objects, instead + // register the exception to be processed later + getMutableRegistryHub().registerStartupException(); + } + } + + } // namespace Detail +} // namespace Catch + + + + #include <map> namespace Catch { - SonarQubeReporter::~SonarQubeReporter() {} + namespace { + std::string createRngSeedString(uint32_t seed) { + ReusableStringStream sstr; + sstr << "rng-seed=" << seed; + return sstr.str(); + } + } void SonarQubeReporter::testRunStarting(TestRunInfo const& testRunInfo) { CumulativeReporterBase::testRunStarting(testRunInfo); + + xml.writeComment( createRngSeedString( m_config->rngSeed() ) ); xml.startElement("testExecutions"); - xml.writeAttribute("version", '1'); + xml.writeAttribute("version"_sr, '1'); } - void SonarQubeReporter::testGroupEnded(TestGroupStats const& testGroupStats) { - CumulativeReporterBase::testGroupEnded(testGroupStats); - writeGroup(*m_testGroups.back()); - } + void SonarQubeReporter::writeRun( TestRunNode const& runNode ) { + std::map<std::string, std::vector<TestCaseNode const*>> testsPerFile; - void SonarQubeReporter::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& child : runNode.children ) { + testsPerFile[child->value.testInfo->lineInfo.file].push_back( + child.get() ); + } - for (auto const& kv : testsPerFile) - writeTestFile(kv.first, kv.second); + for ( auto const& kv : testsPerFile ) { + writeTestFile( kv.first, kv.second ); + } } - void SonarQubeReporter::writeTestFile(std::string const& filename, TestGroupNode::ChildNodes const& testCaseNodes) { + void SonarQubeReporter::writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes) { XmlWriter::ScopedElement e = xml.scopedElement("file"); - xml.writeAttribute("path", filename); + xml.writeAttribute("path"_sr, filename); for (auto const& child : testCaseNodes) writeTestCase(*child); @@ -8615,10 +9577,12 @@ namespace Catch { if (!rootName.empty()) name = rootName + '/' + name; - if (!sectionNode.assertions.empty() || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty()) { + if ( sectionNode.hasAnyAssertions() + || !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)); + xml.writeAttribute("name"_sr, name); + xml.writeAttribute("duration"_sr, static_cast<long>(sectionNode.stats.durationInSeconds * 1000)); writeAssertions(sectionNode, okToFail); } @@ -8628,8 +9592,11 @@ namespace Catch { } void SonarQubeReporter::writeAssertions(SectionNode const& sectionNode, bool okToFail) { - for (auto const& assertion : sectionNode.assertions) - writeAssertion(assertion, okToFail); + for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) { + if (assertionOrBenchmark.isAssertion()) { + writeAssertion(assertionOrBenchmark.asAssertion(), okToFail); + } + } } void SonarQubeReporter::writeAssertion(AssertionStats const& stats, bool okToFail) { @@ -8669,26 +9636,26 @@ namespace Catch { XmlWriter::ScopedElement e = xml.scopedElement(elementName); ReusableStringStream messageRss; - messageRss << result.getTestMacroName() << "(" << result.getExpression() << ")"; - xml.writeAttribute("message", messageRss.str()); + messageRss << result.getTestMacroName() << '(' << result.getExpression() << ')'; + xml.writeAttribute("message"_sr, messageRss.str()); ReusableStringStream textRss; if (stats.totals.assertions.total() > 0) { textRss << "FAILED:\n"; if (result.hasExpression()) { - textRss << "\t" << result.getExpressionInMacro() << "\n"; + textRss << '\t' << result.getExpressionInMacro() << '\n'; } if (result.hasExpandedExpression()) { - textRss << "with expansion:\n\t" << result.getExpandedExpression() << "\n"; + textRss << "with expansion:\n\t" << result.getExpandedExpression() << '\n'; } } if (!result.getMessage().empty()) - textRss << result.getMessage() << "\n"; + textRss << result.getMessage() << '\n'; for (auto const& msg : stats.infoMessages) if (msg.type == ResultWas::Info) - textRss << msg.message << "\n"; + textRss << msg.message << '\n'; textRss << "at " << result.getSourceInfo(); xml.writeText(textRss.str(), XmlFormatting::Newline); @@ -8708,19 +9675,8 @@ namespace Catch { currentTestRunInfo = _testRunInfo; } - void - StreamingReporterBase::testGroupStarting( GroupInfo const& _groupInfo ) { - currentGroupInfo = _groupInfo; - } - - void StreamingReporterBase::testGroupEnded( TestGroupStats const& ) { - currentGroupInfo.reset(); - } - void StreamingReporterBase::testRunEnded( TestRunStats const& ) { currentTestCaseInfo = nullptr; - currentGroupInfo.reset(); - currentTestRunInfo.reset(); } } // end namespace Catch @@ -8728,6 +9684,7 @@ namespace Catch { #include <algorithm> +#include <iterator> #include <ostream> namespace Catch { @@ -8737,18 +9694,20 @@ namespace Catch { // Making older compiler happy is hard. static constexpr StringRef tapFailedString = "not ok"_sr; static constexpr StringRef tapPassedString = "ok"_sr; + static constexpr Colour::Code tapDimColour = Colour::FileName; class TapAssertionPrinter { public: TapAssertionPrinter& operator= (TapAssertionPrinter const&) = delete; TapAssertionPrinter(TapAssertionPrinter const&) = delete; - TapAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, std::size_t _counter) + TapAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, std::size_t _counter, ColourImpl* colour_) : stream(_stream) , result(_stats.assertionResult) , messages(_stats.infoMessages) , itMessage(_stats.infoMessages.begin()) , printInfoMessages(true) - , counter(_counter) {} + , counter(_counter) + , colourImpl( colour_ ) {} void print() { itMessage = messages.begin(); @@ -8821,13 +9780,6 @@ namespace Catch { } private: - static Colour::Code dimColour() { return Colour::FileName; } - - void printSourceInfo() const { - Colour colourGuard(dimColour()); - stream << result.getSourceInfo() << ':'; - } - void printResultType(StringRef passOrFail) const { if (!passOrFail.empty()) { stream << passOrFail << ' ' << counter << " -"; @@ -8841,10 +9793,8 @@ namespace Catch { void printExpressionWas() { if (result.hasExpression()) { stream << ';'; - { - Colour colour(dimColour()); - stream << " expression was:"; - } + stream << colourImpl->guardColour( tapDimColour ) + << " expression was:"; printOriginalExpression(); } } @@ -8857,10 +9807,8 @@ namespace Catch { void printReconstructedExpression() const { if (result.hasExpandedExpression()) { - { - Colour colour(dimColour()); - stream << " for: "; - } + stream << colourImpl->guardColour( tapDimColour ) << " for: "; + std::string expr = result.getExpandedExpression(); std::replace(expr.begin(), expr.end(), '\n', ' '); stream << expr; @@ -8874,7 +9822,7 @@ namespace Catch { } } - void printRemainingMessages(Colour::Code colour = dimColour()) { + void printRemainingMessages(Colour::Code colour = tapDimColour) { if (itMessage == messages.end()) { return; } @@ -8883,18 +9831,15 @@ namespace Catch { 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") << ':'; - } + stream << colourImpl->guardColour( colour ) << " with " + << pluralise( N, "message"_sr ) << ':'; 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"; + stream << colourImpl->guardColour(tapDimColour) << " and"; } } } @@ -8907,33 +9852,35 @@ namespace Catch { std::vector<MessageInfo>::const_iterator itMessage; bool printInfoMessages; std::size_t counter; + ColourImpl* colourImpl; }; } // End anonymous namespace - TAPReporter::~TAPReporter() {} + void TAPReporter::testRunStarting( TestRunInfo const& ) { + m_stream << "# rng-seed: " << m_config->rngSeed() << '\n'; + } - void TAPReporter::noMatchingTestCases(std::string const& spec) { - stream << "# No test cases matched '" << spec << "'\n"; + void TAPReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + m_stream << "# No test cases matched '" << unmatchedSpec << "'\n"; } - bool TAPReporter::assertionEnded(AssertionStats const& _assertionStats) { + void TAPReporter::assertionEnded(AssertionStats const& _assertionStats) { ++counter; - stream << "# " << currentTestCaseInfo->name << '\n'; - TapAssertionPrinter printer(stream, _assertionStats, counter); + m_stream << "# " << currentTestCaseInfo->name << '\n'; + TapAssertionPrinter printer(m_stream, _assertionStats, counter, m_colour.get()); printer.print(); - stream << '\n' << std::flush; - return true; + m_stream << '\n' << std::flush; } void TAPReporter::testRunEnded(TestRunStats const& _testRunStats) { - stream << "1.." << _testRunStats.totals.assertions.total(); + m_stream << "1.." << _testRunStats.totals.assertions.total(); if (_testRunStats.totals.testCases.total() == 0) { - stream << " # Skipped: No tests ran."; + m_stream << " # Skipped: No tests ran."; } - stream << "\n\n" << std::flush; + m_stream << "\n\n" << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } @@ -8946,6 +9893,7 @@ namespace Catch { #include <cassert> +#include <ostream> namespace Catch { @@ -8963,8 +9911,8 @@ namespace Catch { .initialIndent(indent) << '\n'; } - std::string escape(std::string const& str) { - std::string escaped = str; + std::string escape(StringRef str) { + std::string escaped = static_cast<std::string>(str); replaceInPlace(escaped, "|", "||"); replaceInPlace(escaped, "'", "|'"); replaceInPlace(escaped, "\n", "|n"); @@ -8978,19 +9926,17 @@ namespace Catch { TeamCityReporter::~TeamCityReporter() {} - void TeamCityReporter::testGroupStarting(GroupInfo const& groupInfo) { - StreamingReporterBase::testGroupStarting(groupInfo); - stream << "##teamcity[testSuiteStarted name='" - << escape(groupInfo.name) << "']\n"; + void TeamCityReporter::testRunStarting( TestRunInfo const& runInfo ) { + m_stream << "##teamcity[testSuiteStarted name='" << escape( runInfo.name ) + << "']\n"; } - void TeamCityReporter::testGroupEnded(TestGroupStats const& testGroupStats) { - StreamingReporterBase::testGroupEnded(testGroupStats); - stream << "##teamcity[testSuiteFinished name='" - << escape(testGroupStats.groupInfo.name) << "']\n"; + void TeamCityReporter::testRunEnded( TestRunStats const& runStats ) { + m_stream << "##teamcity[testSuiteFinished name='" + << escape( runStats.runInfo.name ) << "']\n"; } - bool TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) { + void TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) { AssertionResult const& result = assertionStats.assertionResult; if (!result.isOk()) { @@ -9046,44 +9992,43 @@ namespace Catch { if (currentTestCaseInfo->okToFail()) { msg << "- failure ignore as test marked as 'ok to fail'\n"; - stream << "##teamcity[testIgnored" + m_stream << "##teamcity[testIgnored" << " name='" << escape(currentTestCaseInfo->name) << '\'' << " message='" << escape(msg.str()) << '\'' << "]\n"; } else { - stream << "##teamcity[testFailed" + m_stream << "##teamcity[testFailed" << " name='" << escape(currentTestCaseInfo->name) << '\'' << " message='" << escape(msg.str()) << '\'' << "]\n"; } } - stream.flush(); - return true; + m_stream.flush(); } void TeamCityReporter::testCaseStarting(TestCaseInfo const& testInfo) { m_testTimer.start(); StreamingReporterBase::testCaseStarting(testInfo); - stream << "##teamcity[testStarted name='" + m_stream << "##teamcity[testStarted name='" << escape(testInfo.name) << "']\n"; - stream.flush(); + m_stream.flush(); } void TeamCityReporter::testCaseEnded(TestCaseStats const& testCaseStats) { StreamingReporterBase::testCaseEnded(testCaseStats); auto const& testCaseInfo = *testCaseStats.testInfo; if (!testCaseStats.stdOut.empty()) - stream << "##teamcity[testStdOut name='" + m_stream << "##teamcity[testStdOut name='" << escape(testCaseInfo.name) << "' out='" << escape(testCaseStats.stdOut) << "']\n"; if (!testCaseStats.stdErr.empty()) - stream << "##teamcity[testStdErr name='" + m_stream << "##teamcity[testStdErr name='" << escape(testCaseInfo.name) << "' out='" << escape(testCaseStats.stdErr) << "']\n"; - stream << "##teamcity[testFinished name='" + m_stream << "##teamcity[testFinished name='" << escape(testCaseInfo.name) << "' duration='" << m_testTimer.getElapsedMilliseconds() << "']\n"; - stream.flush(); + m_stream.flush(); } void TeamCityReporter::printSectionHeader(std::ostream& os) { @@ -9119,9 +10064,9 @@ namespace Catch { #endif namespace Catch { - XmlReporter::XmlReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ), - m_xml(_config.stream()) + XmlReporter::XmlReporter( ReporterConfig&& _config ) + : StreamingReporterBase( CATCH_MOVE(_config) ), + m_xml(m_stream) { m_preferences.shouldRedirectStdOut = true; m_preferences.shouldReportAllAssertions = true; @@ -9139,12 +10084,8 @@ namespace Catch { 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 ); + .writeAttribute( "filename"_sr, sourceInfo.file ) + .writeAttribute( "line"_sr, sourceInfo.line ); } void XmlReporter::testRunStarting( TestRunInfo const& testInfo ) { @@ -9152,27 +10093,19 @@ namespace Catch { 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() ); + m_xml.startElement("Catch2TestRun") + .writeAttribute("name"_sr, m_config->name()) + .writeAttribute("rng-seed"_sr, m_config->rngSeed()) + .writeAttribute("catch2-version"_sr, libraryVersion()); 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 ); + m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) ); } void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) { StreamingReporterBase::testCaseStarting(testInfo); m_xml.startElement( "TestCase" ) - .writeAttribute( "name", trim( testInfo.name ) ) - .writeAttribute( "tags", testInfo.tagsAsString() ); + .writeAttribute( "name"_sr, trim( testInfo.name ) ) + .writeAttribute( "tags"_sr, testInfo.tagsAsString() ); writeSourceInfo( testInfo.lineInfo ); @@ -9185,7 +10118,7 @@ namespace Catch { StreamingReporterBase::sectionStarting( sectionInfo ); if( m_sectionDepth++ > 0 ) { m_xml.startElement( "Section" ) - .writeAttribute( "name", trim( sectionInfo.name ) ); + .writeAttribute( "name"_sr, trim( sectionInfo.name ) ); writeSourceInfo( sectionInfo.lineInfo ); m_xml.ensureTagClosed(); } @@ -9193,7 +10126,7 @@ namespace Catch { void XmlReporter::assertionStarting( AssertionInfo const& ) { } - bool XmlReporter::assertionEnded( AssertionStats const& assertionStats ) { + void XmlReporter::assertionEnded( AssertionStats const& assertionStats ) { AssertionResult const& result = assertionStats.assertionResult; @@ -9214,14 +10147,14 @@ namespace Catch { // Drop out if result was successful but we're not printing them. if( !includeResults && result.getResultType() != ResultWas::Warning ) - return true; + return; // Print the expression if there is one. if( result.hasExpression() ) { m_xml.startElement( "Expression" ) - .writeAttribute( "success", result.succeeded() ) - .writeAttribute( "type", result.getTestMacroName() ); + .writeAttribute( "success"_sr, result.succeeded() ) + .writeAttribute( "type"_sr, result.getTestMacroName() ); writeSourceInfo( result.getSourceInfo() ); @@ -9247,7 +10180,7 @@ namespace Catch { break; case ResultWas::Info: m_xml.scopedElement( "Info" ) - .writeText( result.getMessage() ); + .writeText( result.getMessage() ); break; case ResultWas::Warning: // Warning will already have been written @@ -9264,20 +10197,18 @@ namespace Catch { 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 ); + e.writeAttribute( "successes"_sr, sectionStats.assertions.passed ); + e.writeAttribute( "failures"_sr, sectionStats.assertions.failed ); + e.writeAttribute( "expectedFailures"_sr, sectionStats.assertions.failedButOk ); if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds ); + e.writeAttribute( "durationInSeconds"_sr, sectionStats.durationInSeconds ); m_xml.endElement(); } @@ -9286,10 +10217,10 @@ namespace Catch { void XmlReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { StreamingReporterBase::testCaseEnded( testCaseStats ); XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" ); - e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() ); + e.writeAttribute( "success"_sr, testCaseStats.totals.assertions.allOk() ); if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() ); + e.writeAttribute( "durationInSeconds"_sr, m_testCaseTimer.getElapsedSeconds() ); if( !testCaseStats.stdOut.empty() ) m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), XmlFormatting::Newline ); @@ -9299,77 +10230,63 @@ namespace Catch { 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.scopedElement( "OverallResultsCases") - .writeAttribute( "successes", testGroupStats.totals.testCases.passed ) - .writeAttribute( "failures", testGroupStats.totals.testCases.failed ) - .writeAttribute( "expectedFailures", testGroupStats.totals.testCases.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 ); + .writeAttribute( "successes"_sr, testRunStats.totals.assertions.passed ) + .writeAttribute( "failures"_sr, testRunStats.totals.assertions.failed ) + .writeAttribute( "expectedFailures"_sr, testRunStats.totals.assertions.failedButOk ); m_xml.scopedElement( "OverallResultsCases") - .writeAttribute( "successes", testRunStats.totals.testCases.passed ) - .writeAttribute( "failures", testRunStats.totals.testCases.failed ) - .writeAttribute( "expectedFailures", testRunStats.totals.testCases.failedButOk ); + .writeAttribute( "successes"_sr, testRunStats.totals.testCases.passed ) + .writeAttribute( "failures"_sr, testRunStats.totals.testCases.failed ) + .writeAttribute( "expectedFailures"_sr, testRunStats.totals.testCases.failedButOk ); m_xml.endElement(); } - void XmlReporter::benchmarkPreparing(std::string const& name) { + void XmlReporter::benchmarkPreparing( StringRef name ) { m_xml.startElement("BenchmarkResults") - .writeAttribute("name", name); + .writeAttribute("name"_sr, 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"); + m_xml.writeAttribute("samples"_sr, info.samples) + .writeAttribute("resamples"_sr, info.resamples) + .writeAttribute("iterations"_sr, info.iterations) + .writeAttribute("clockResolution"_sr, info.clockResolution) + .writeAttribute("estimatedDuration"_sr, info.estimatedDuration) + .writeComment("All values in nano seconds"_sr); } 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); + .writeAttribute("value"_sr, benchmarkStats.mean.point.count()) + .writeAttribute("lowerBound"_sr, benchmarkStats.mean.lower_bound.count()) + .writeAttribute("upperBound"_sr, benchmarkStats.mean.upper_bound.count()) + .writeAttribute("ci"_sr, 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); + .writeAttribute("value"_sr, benchmarkStats.standardDeviation.point.count()) + .writeAttribute("lowerBound"_sr, benchmarkStats.standardDeviation.lower_bound.count()) + .writeAttribute("upperBound"_sr, benchmarkStats.standardDeviation.upper_bound.count()) + .writeAttribute("ci"_sr, 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); + .writeAttribute("variance"_sr, benchmarkStats.outlierVariance) + .writeAttribute("lowMild"_sr, benchmarkStats.outliers.low_mild) + .writeAttribute("lowSevere"_sr, benchmarkStats.outliers.low_severe) + .writeAttribute("highMild"_sr, benchmarkStats.outliers.high_mild) + .writeAttribute("highSevere"_sr, benchmarkStats.outliers.high_severe); m_xml.endElement(); m_xml.endElement(); } - void XmlReporter::benchmarkFailed(std::string const &error) { + void XmlReporter::benchmarkFailed(StringRef error) { m_xml.scopedElement("failed"). - writeAttribute("message", error); + writeAttribute("message"_sr, error); m_xml.endElement(); } - void XmlReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const&) { + void XmlReporter::listReporters(std::vector<ReporterDescription> const& descriptions) { auto outerTag = m_xml.scopedElement("AvailableReporters"); for (auto const& reporter : descriptions) { auto inner = m_xml.scopedElement("Reporter"); @@ -9382,7 +10299,20 @@ namespace Catch { } } - void XmlReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const&) { + void XmlReporter::listListeners(std::vector<ListenerDescription> const& descriptions) { + auto outerTag = m_xml.scopedElement( "RegisteredListeners" ); + for ( auto const& listener : descriptions ) { + auto inner = m_xml.scopedElement( "Listener" ); + m_xml.startElement( "Name", XmlFormatting::Indent ) + .writeText( listener.name, XmlFormatting::None ) + .endElement( XmlFormatting::Newline ); + m_xml.startElement( "Description", XmlFormatting::Indent ) + .writeText( listener.description, XmlFormatting::None ) + .endElement( XmlFormatting::Newline ); + } + } + + void XmlReporter::listTests(std::vector<TestCaseHandle> const& tests) { auto outerTag = m_xml.scopedElement("MatchingTests"); for (auto const& test : tests) { auto innerTag = m_xml.scopedElement("TestCase"); @@ -9407,7 +10337,7 @@ namespace Catch { } } - void XmlReporter::listTags(std::vector<TagInfo> const& tags, IConfig const&) { + void XmlReporter::listTags(std::vector<TagInfo> const& tags) { auto outerTag = m_xml.scopedElement("TagsFromMatchingTests"); for (auto const& tag : tags) { auto innerTag = m_xml.scopedElement("Tag"); @@ -9417,7 +10347,7 @@ namespace Catch { auto aliasTag = m_xml.scopedElement("Aliases"); for (auto const& alias : tag.spellings) { m_xml.startElement("Alias", XmlFormatting::Indent) - .writeText(static_cast<std::string>(alias), XmlFormatting::None) + .writeText(alias, XmlFormatting::None) .endElement(XmlFormatting::Newline); } } diff --git a/packages/Catch2/extras/catch_amalgamated.hpp b/packages/Catch2/extras/catch_amalgamated.hpp index dd77291a9..757e10c5a 100644 --- a/packages/Catch2/extras/catch_amalgamated.hpp +++ b/packages/Catch2/extras/catch_amalgamated.hpp @@ -5,8 +5,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.0.0-preview.3 -// Generated: 2020-10-08 13:59:26.309308 +// Catch v3.1.0 +// Generated: 2022-07-17 20:14:04.055157 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -86,6 +86,117 @@ namespace Catch { #endif // CATCH_NONCOPYABLE_HPP_INCLUDED + +#ifndef CATCH_STRINGREF_HPP_INCLUDED +#define CATCH_STRINGREF_HPP_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 other ) const noexcept -> bool; + auto operator != (StringRef other) const noexcept -> bool { + return !(*this == other); + } + + constexpr auto operator[] ( size_type index ) const noexcept -> char { + assert(index < m_size); + return m_start[index]; + } + + bool operator<(StringRef rhs) const noexcept; + + public: // named queries + constexpr auto empty() const noexcept -> bool { + return m_size == 0; + } + constexpr auto size() const noexcept -> size_type { + return m_size; + } + + // Returns a substring of [start, start + length). + // If start + length > size(), then the substring is [start, start + size()). + // If start > size(), then the substring is empty. + constexpr StringRef substr(size_type start, size_type length) const noexcept { + if (start < m_size) { + const auto shortened_size = m_size - start; + return StringRef(m_start + start, (shortened_size < length) ? shortened_size : length); + } else { + return StringRef(); + } + } + + // Returns the current start pointer. May not be null-terminated. + constexpr char const* data() const noexcept { + return m_start; + } + + constexpr const_iterator begin() const { return m_start; } + constexpr const_iterator end() const { return m_start + m_size; } + + + friend std::string& operator += (std::string& lhs, StringRef sr); + friend std::ostream& operator << (std::ostream& os, StringRef sr); + friend std::string operator+(StringRef lhs, StringRef rhs); + + /** + * Provides a three-way comparison with rhs + * + * Returns negative number if lhs < rhs, 0 if lhs == rhs, and a positive + * number if lhs > rhs + */ + int compare( StringRef rhs ) const; + }; + + + 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_HPP_INCLUDED + #include <chrono> #include <iosfwd> #include <string> @@ -101,8 +212,10 @@ namespace Catch { struct WarnAbout { enum What { Nothing = 0x00, + //! A test case or leaf section did not run any assertions NoAssertions = 0x01, - NoTests = 0x02 + //! A command line test spec matched no test cases + UnmatchedTestSpec = 0x02, }; }; enum class ShowDurations { @@ -115,10 +228,15 @@ namespace Catch { LexicographicallySorted, Randomized }; - enum class UseColour { - Auto, - Yes, - No + enum class ColourMode : std::uint8_t { + //! Let Catch2 pick implementation based on platform detection + PlatformDefault, + //! Use ANSI colour code escapes + ANSI, + //! Use Win32 console colour API + Win32, + //! Don't use any colour + None }; struct WaitForKeypress { enum When { Never, @@ -128,18 +246,19 @@ namespace Catch { }; }; class TestSpec; + class IStream; - struct IConfig : Detail::NonCopyable { - + class IConfig : public Detail::NonCopyable { + public: virtual ~IConfig(); virtual bool allowThrows() const = 0; - virtual std::ostream& stream() const = 0; - virtual std::string name() const = 0; + virtual StringRef name() const = 0; virtual bool includeSuccessfulResults() const = 0; virtual bool shouldDebugBreak() const = 0; virtual bool warnAboutMissingAssertions() const = 0; - virtual bool warnAboutNoTests() const = 0; + virtual bool warnAboutUnmatchedTestSpecs() const = 0; + virtual bool zeroTestsCountAsSuccess() const = 0; virtual int abortAfter() const = 0; virtual bool showInvisibles() const = 0; virtual ShowDurations showDurations() const = 0; @@ -148,13 +267,16 @@ namespace Catch { virtual bool hasTestFilters() const = 0; virtual std::vector<std::string> const& getTestsOrTags() const = 0; virtual TestRunOrder runOrder() const = 0; - virtual unsigned int rngSeed() const = 0; - virtual UseColour useColour() const = 0; + virtual uint32_t rngSeed() const = 0; + virtual unsigned int shardCount() const = 0; + virtual unsigned int shardIndex() const = 0; + virtual ColourMode defaultColourMode() const = 0; virtual std::vector<std::string> const& getSectionsToRun() const = 0; virtual Verbosity verbosity() const = 0; + virtual bool skipBenchmarks() const = 0; virtual bool benchmarkNoAnalysis() const = 0; - virtual int benchmarkSamples() const = 0; + virtual unsigned int benchmarkSamples() const = 0; virtual double benchmarkConfidenceInterval() const = 0; virtual unsigned int benchmarkResamples() const = 0; virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0; @@ -164,82 +286,12 @@ namespace Catch { #endif // CATCH_INTERFACES_CONFIG_HPP_INCLUDED -#ifndef CATCH_CONTEXT_HPP_INCLUDED -#define CATCH_CONTEXT_HPP_INCLUDED - -namespace Catch { - - struct IResultCapture; - struct IRunner; - struct IConfig; - - struct IContext - { - virtual ~IContext(); - - virtual IResultCapture* getResultCapture() = 0; - virtual IRunner* getRunner() = 0; - virtual IConfig const* getConfig() const = 0; - }; - - struct IMutableContext : IContext - { - virtual ~IMutableContext(); - virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( IConfig 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 // CATCH_CONTEXT_HPP_INCLUDED - - -#ifndef CATCH_INTERFACES_REPORTER_HPP_INCLUDED -#define CATCH_INTERFACES_REPORTER_HPP_INCLUDED - - - -#ifndef CATCH_SECTION_INFO_HPP_INCLUDED -#define CATCH_SECTION_INFO_HPP_INCLUDED - - - -#ifndef CATCH_COMMON_HPP_INCLUDED -#define CATCH_COMMON_HPP_INCLUDED - - - #ifndef CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED #define 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? @@ -258,13 +310,16 @@ namespace Catch { #ifndef CATCH_PLATFORM_HPP_INCLUDED #define CATCH_PLATFORM_HPP_INCLUDED +// See e.g.: +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ -# include <TargetConditionals.h> -# if TARGET_OS_OSX == 1 -# define CATCH_PLATFORM_MAC -# elif TARGET_OS_IPHONE == 1 -# define CATCH_PLATFORM_IPHONE -# endif +# include <TargetConditionals.h> +# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ + (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) +# define CATCH_PLATFORM_MAC +# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) +# define CATCH_PLATFORM_IPHONE +# endif #elif defined(linux) || defined(__linux) || defined(__linux__) # define CATCH_PLATFORM_LINUX @@ -287,9 +342,9 @@ namespace Catch { #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) && !defined(__CUDACC__) +// Only GCC compiler should be used in this block, so other compilers trying to +// mask themselves as GCC should be ignored. +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) @@ -305,11 +360,23 @@ namespace Catch { #endif -#if defined(__clang__) +#if defined(__CUDACC__) && !defined(__clang__) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic pop" ) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" ) +#endif + +// clang-cl defines _MSC_VER as well as __clang__, which could cause the +// start/stop internal suppression macros to be double defined. +#if defined(__clang__) && !defined(_MSC_VER) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) +#endif // __clang__ && !_MSC_VER + +#if defined(__clang__) + // As of this writing, IBM XL's implementation of __builtin_constant_p has a bug // which results in calls to destructors being emitted for each temporary, // without a matching initialization. In practice, this can result in something @@ -320,8 +387,13 @@ namespace Catch { // REQUIRE(std::string("12") + "34" == "1234") // ``` // +// Similarly, NVHPC's implementation of `__builtin_constant_p` has a bug which +// results in calls to the immediately evaluated lambda expressions to be +// reported as unevaluated lambdas. +// https://developer.nvidia.com/nvidia_bug/3321845. +// // Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. -# if !defined(__ibmxl__) && !defined(__CUDACC__) +# if !defined(__ibmxl__) && !defined(__CUDACC__) && !defined( __NVCOMPILER ) # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ # endif @@ -359,14 +431,12 @@ namespace Catch { #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 //////////////////////////////////////////////////////////////////////////////// @@ -408,7 +478,7 @@ namespace Catch { // 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 +# define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 # else # define CATCH_INTERNAL_CONFIG_WINDOWS_SEH # endif @@ -435,11 +505,6 @@ namespace Catch { # define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED #endif -//////////////////////////////////////////////////////////////////////////////// -// DJGPP -#ifdef __DJGPP__ -# define CATCH_INTERNAL_CONFIG_NO_WCHAR -#endif // __DJGPP__ //////////////////////////////////////////////////////////////////////////////// // Embarcadero C++Build @@ -447,18 +512,6 @@ namespace Catch { #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. @@ -467,7 +520,7 @@ namespace Catch { #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 + #define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 #endif #if !defined(_GLIBCXX_USE_C99_MATH_TR1) @@ -489,7 +542,7 @@ namespace Catch { // Check if byte is available and usable # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # include <cstddef> - # if __cpp_lib_byte > 0 + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) # define CATCH_INTERNAL_CONFIG_CPP17_BYTE # endif # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) @@ -512,9 +565,6 @@ namespace Catch { #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 @@ -522,10 +572,6 @@ namespace Catch { #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 @@ -556,7 +602,9 @@ namespace Catch { # define CATCH_CONFIG_NEW_CAPTURE #endif -#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +#if !defined( CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED ) && \ + !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS ) && \ + !defined( CATCH_CONFIG_NO_DISABLE_EXCEPTIONS ) # define CATCH_CONFIG_DISABLE_EXCEPTIONS #endif @@ -568,10 +616,6 @@ namespace Catch { # 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 @@ -628,135 +672,98 @@ namespace Catch { #define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #endif -#endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED +#if defined( CATCH_PLATFORM_WINDOWS ) && \ + !defined( CATCH_CONFIG_COLOUR_WIN32 ) && \ + !defined( CATCH_CONFIG_NO_COLOUR_WIN32 ) && \ + !defined( CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 ) +# define CATCH_CONFIG_COLOUR_WIN32 +#endif -#ifndef CATCH_STRINGREF_HPP_INCLUDED -#define CATCH_STRINGREF_HPP_INCLUDED +#endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED -#include <cstddef> -#include <string> -#include <iosfwd> -#include <cassert> + +#ifndef CATCH_CONTEXT_HPP_INCLUDED +#define CATCH_CONTEXT_HPP_INCLUDED 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 { + class IResultCapture; + class IConfig; + + class IContext { public: - using size_type = std::size_t; - using const_iterator = const char*; + virtual ~IContext(); // = default + + virtual IResultCapture* getResultCapture() = 0; + virtual IConfig const* getConfig() const = 0; + }; + + class IMutableContext : public IContext { + public: + ~IMutableContext() override; // = default + virtual void setResultCapture( IResultCapture* resultCapture ) = 0; + virtual void setConfig( IConfig const* config ) = 0; private: - static constexpr char const* const s_empty = ""; + static IMutableContext *currentContext; + friend IMutableContext& getCurrentMutableContext(); + friend void cleanUpContext(); + static void createContext(); + }; - char const* m_start = s_empty; - size_type m_size = 0; + inline IMutableContext& getCurrentMutableContext() + { + if( !IMutableContext::currentContext ) + IMutableContext::createContext(); + // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn) + return *IMutableContext::currentContext; + } - public: // construction - constexpr StringRef() noexcept = default; + inline IContext& getCurrentContext() + { + return getCurrentMutableContext(); + } - StringRef( char const* rawChars ) noexcept; + void cleanUpContext(); - constexpr StringRef( char const* rawChars, size_type size ) noexcept - : m_start( rawChars ), - m_size( size ) - {} + class SimplePcg32; + SimplePcg32& sharedRng(); +} - StringRef( std::string const& stdString ) noexcept - : m_start( stdString.c_str() ), - m_size( stdString.size() ) - {} +#endif // CATCH_CONTEXT_HPP_INCLUDED - 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); - } +#ifndef CATCH_INTERFACES_REPORTER_HPP_INCLUDED +#define CATCH_INTERFACES_REPORTER_HPP_INCLUDED - constexpr auto operator[] ( size_type index ) const noexcept -> char { - assert(index < m_size); - return m_start[index]; - } - bool operator<(StringRef const& rhs) const noexcept; - 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, start + size()). - // If start > size(), then the substring is empty. - constexpr StringRef substr(size_type start, size_type length) const noexcept { - if (start < m_size) { - const auto shortened_size = m_size - start; - return StringRef(m_start + start, (shortened_size < length) ? shortened_size : length); - } else { - return StringRef(); - } - } - - // Returns the current start pointer. May not be null-terminated. - constexpr char const* data() const noexcept { - return m_start; - } +#ifndef CATCH_SECTION_INFO_HPP_INCLUDED +#define CATCH_SECTION_INFO_HPP_INCLUDED - 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; } +#ifndef CATCH_MOVE_AND_FORWARD_HPP_INCLUDED +#define CATCH_MOVE_AND_FORWARD_HPP_INCLUDED - friend std::string& operator += (std::string& lhs, StringRef const& sr); - friend std::ostream& operator << (std::ostream& os, StringRef const& sr); - friend std::string operator+(StringRef lhs, StringRef rhs); - }; +#include <type_traits> +//! Replacement for std::move with better compile time performance +#define CATCH_MOVE(...) static_cast<std::remove_reference_t<decltype(__VA_ARGS__)>&&>(__VA_ARGS__) - constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { - return StringRef( rawChars, size ); - } -} // namespace Catch +//! Replacement for std::forward with better compile time performance +#define CATCH_FORWARD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__) -constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { - return Catch::StringRef( rawChars, size ); -} +#endif // CATCH_MOVE_AND_FORWARD_HPP_INCLUDED -#endif // CATCH_STRINGREF_HPP_INCLUDED -#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 +#ifndef CATCH_SOURCE_LINE_INFO_HPP_INCLUDED +#define CATCH_SOURCE_LINE_INFO_HPP_INCLUDED +#include <cstddef> #include <iosfwd> -// 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 SourceLineInfo { @@ -775,39 +782,18 @@ namespace Catch { friend 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 { - StringRef operator+() const { - return StringRef(); - } - - template<typename T> - friend T const& operator + ( T const& value, StreamEndStop ) { - return value; - } - }; } #define CATCH_INTERNAL_LINEINFO \ ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) ) -#endif // CATCH_COMMON_HPP_INCLUDED +#endif // CATCH_SOURCE_LINE_INFO_HPP_INCLUDED #ifndef CATCH_TOTALS_HPP_INCLUDED #define CATCH_TOTALS_HPP_INCLUDED -#include <cstddef> +#include <cstdint> namespace Catch { @@ -815,13 +801,13 @@ namespace Catch { Counts operator - ( Counts const& other ) const; Counts& operator += ( Counts const& other ); - std::size_t total() const; + std::uint64_t total() const; bool allPassed() const; bool allOk() const; - std::size_t passed = 0; - std::size_t failed = 0; - std::size_t failedButOk = 0; + std::uint64_t passed = 0; + std::uint64_t failed = 0; + std::uint64_t failedButOk = 0; }; struct Totals { @@ -831,7 +817,6 @@ namespace Catch { Totals delta( Totals const& prevTotals ) const; - int error = 0; Counts assertions; Counts testCases; }; @@ -849,7 +834,7 @@ namespace Catch { // still use the `-c` flag comfortably. SectionInfo( SourceLineInfo const& _lineInfo, std::string _name, const char* const = nullptr ): - name(std::move(_name)), + name(CATCH_MOVE(_name)), lineInfo(_lineInfo) {} @@ -871,7 +856,6 @@ namespace Catch { #ifndef CATCH_ASSERTION_RESULT_HPP_INCLUDED #define CATCH_ASSERTION_RESULT_HPP_INCLUDED -#include <string> #ifndef CATCH_ASSERTION_INFO_HPP_INCLUDED @@ -951,7 +935,7 @@ namespace Catch { namespace Catch { - struct ITransientExpression; + class ITransientExpression; class LazyExpression { friend class AssertionHandler; @@ -978,6 +962,8 @@ namespace Catch { #endif // CATCH_LAZY_EXPR_HPP_INCLUDED +#include <string> + namespace Catch { struct AssertionResultData @@ -1008,7 +994,7 @@ namespace Catch { std::string getExpressionInMacro() const; bool hasExpandedExpression() const; std::string getExpandedExpression() const; - std::string getMessage() const; + StringRef getMessage() const; SourceLineInfo getSourceInfo() const; StringRef getTestMacroName() const; @@ -1046,15 +1032,15 @@ namespace Catch { struct AssertionReaction; struct SourceLineInfo; - struct ITransientExpression; - struct IGeneratorTracker; + class ITransientExpression; + class IGeneratorTracker; struct BenchmarkInfo; template <typename Duration = std::chrono::duration<double, std::nano>> struct BenchmarkStats; - struct IResultCapture { - + class IResultCapture { + public: virtual ~IResultCapture(); virtual bool sectionStarted( SectionInfo const& sectionInfo, @@ -1064,10 +1050,10 @@ namespace Catch { virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0; - virtual void benchmarkPreparing( std::string const& name ) = 0; + virtual void benchmarkPreparing( StringRef name ) = 0; virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0; virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0; - virtual void benchmarkFailed( std::string const& error ) = 0; + virtual void benchmarkFailed( StringRef error ) = 0; virtual void pushScopedMessage( MessageInfo const& message ) = 0; virtual void popScopedMessage( MessageInfo const& message ) = 0; @@ -1083,7 +1069,7 @@ namespace Catch { virtual void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef const& message, + StringRef message, AssertionReaction& reaction ) = 0; virtual void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, @@ -1120,7 +1106,7 @@ namespace Catch { namespace Catch { struct MessageInfo { - MessageInfo( StringRef const& _macroName, + MessageInfo( StringRef _macroName, SourceLineInfo const& _lineInfo, ResultWas::OfType _type ); @@ -1151,11 +1137,14 @@ namespace Catch { #include <cassert> #include <type_traits> + namespace Catch { namespace Detail { - // reimplementation of unique_ptr for improved compilation times - // Does not support custom deleters (and thus does not require EBO) - // Does not support arrays + /** + * A reimplementation of `std::unique_ptr` for improved compilation performance + * + * Does not support arrays nor custom deleters. + */ template <typename T> class unique_ptr { T* m_ptr; @@ -1204,7 +1193,11 @@ namespace Detail { assert(m_ptr); return *m_ptr; } - T* operator->() const noexcept { + T* operator->() noexcept { + assert(m_ptr); + return m_ptr; + } + T const* operator->() const noexcept { assert(m_ptr); return m_ptr; } @@ -1234,20 +1227,13 @@ namespace Detail { } }; - // Purposefully doesn't exist - // We could also rely on compiler warning + werror for calling plain delete - // on a T[], but this seems better. - // Maybe add definition and a static assert? + //! Specialization to cause compile-time error for arrays template <typename T> class unique_ptr<T[]>; template <typename T, typename... Args> unique_ptr<T> make_unique(Args&&... args) { - // static_cast<Args&&> does the same thing as std::forward in - // this case, but does not require including big header (<utility>) - // and compiles faster thanks to not requiring template instantiation - // and overload resolution - return unique_ptr<T>(new T(static_cast<Args&&>(args)...)); + return unique_ptr<T>(new T(CATCH_FORWARD(args)...)); } @@ -1257,7 +1243,6 @@ namespace Detail { #endif // CATCH_UNIQUE_PTR_HPP_INCLUDED - // Adapted from donated nonius code. #ifndef CATCH_ESTIMATE_HPP_INCLUDED @@ -1307,6 +1292,7 @@ namespace Catch { #endif // CATCH_OUTLIERS_CLASSIFICATION_HPP_INCLUDED +#include <map> #include <string> #include <vector> #include <iosfwd> @@ -1314,36 +1300,39 @@ namespace Catch { namespace Catch { struct ReporterDescription; + struct ListenerDescription; struct TagInfo; struct TestCaseInfo; class TestCaseHandle; - struct IConfig; + class IConfig; + class IStream; + enum class ColourMode : std::uint8_t; struct ReporterConfig { - explicit ReporterConfig( IConfig const* _fullConfig ); + ReporterConfig( IConfig const* _fullConfig, + Detail::unique_ptr<IStream> _stream, + ColourMode colourMode, + std::map<std::string, std::string> customOptions ); - ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream ); + ReporterConfig( ReporterConfig&& ) = default; + ReporterConfig& operator=( ReporterConfig&& ) = default; + ~ReporterConfig(); // = default - std::ostream& stream() const; + Detail::unique_ptr<IStream> takeStream() &&; IConfig const* fullConfig() const; + ColourMode colourMode() const; + std::map<std::string, std::string> const& customOptions() const; private: - std::ostream* m_stream; + Detail::unique_ptr<IStream> m_stream; IConfig const* m_fullConfig; + ColourMode m_colourMode; + std::map<std::string, std::string> m_customOptions; }; 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; + constexpr TestRunInfo(StringRef _name) : name(_name) {} + StringRef name; }; struct AssertionStats { @@ -1387,17 +1376,6 @@ namespace Catch { bool aborting; }; - struct TestGroupStats { - TestGroupStats( GroupInfo const& _groupInfo, - Totals const& _totals, - bool _aborting ); - TestGroupStats( GroupInfo const& _groupInfo ); - - GroupInfo groupInfo; - Totals totals; - bool aborting; - }; - struct TestRunStats { TestRunStats( TestRunInfo const& _runInfo, Totals const& _totals, @@ -1413,7 +1391,7 @@ namespace Catch { std::string name; double estimatedDuration; int iterations; - int samples; + unsigned int samples; unsigned int resamples; double clockResolution; double clockCost; @@ -1430,7 +1408,7 @@ namespace Catch { double outlierVariance; template <typename Duration2> - explicit operator BenchmarkStats<Duration2>() const { + operator BenchmarkStats<Duration2>() const { std::vector<Duration2> samples2; samples2.reserve(samples.size()); for (auto const& sample : samples) { @@ -1438,7 +1416,7 @@ namespace Catch { } return { info, - std::move(samples2), + CATCH_MOVE(samples2), mean, standardDeviation, outliers, @@ -1459,13 +1437,29 @@ namespace Catch { bool shouldReportAllAssertions = false; }; - - struct IStreamingReporter { + /** + * The common base for all reporters and event listeners + * + * Implementing classes must also implement: + * + * //! User-friendly description of the reporter/listener type + * static std::string getDescription() + * + * Generally shouldn't be derived from by users of Catch2 directly, + * instead they should derive from one of the utility bases that + * derive from this class. + */ + class IEventListener { protected: //! Derived classes can set up their preferences here ReporterPreferences m_preferences; + //! The test run's config as filled in from CLI and defaults + IConfig const* m_config; + public: - virtual ~IStreamingReporter() = default; + IEventListener( IConfig const* config ): m_config( config ) {} + + virtual ~IEventListener(); // = default; // Implementing class must also provide the following static methods: // static std::string getDescription(); @@ -1474,51 +1468,115 @@ namespace Catch { return m_preferences; } - virtual void noMatchingTestCases( std::string const& spec ) = 0; - - virtual void reportInvalidArguments(std::string const&) {} + //! Called when no test cases match provided test spec + virtual void noMatchingTestCases( StringRef unmatchedSpec ) = 0; + //! Called for all invalid test specs from the cli + virtual void reportInvalidTestSpec( StringRef invalidArgument ) = 0; + /** + * Called once in a testing run before tests are started + * + * Not called if tests won't be run (e.g. only listing will happen) + */ virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; - virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; + //! Called _once_ for each TEST_CASE, no matter how many times it is entered virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + virtual void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ) = 0; + //! Called when a `SECTION` is being entered. Not called for skipped sections virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; - virtual void benchmarkPreparing( std::string const& ) {} - virtual void benchmarkStarting( BenchmarkInfo const& ) {} - virtual void benchmarkEnded( BenchmarkStats<> const& ) {} - virtual void benchmarkFailed( std::string const& ) {} + //! Called when user-code is being probed before the actual benchmark runs + virtual void benchmarkPreparing( StringRef benchmarkName ) = 0; + //! Called after probe but before the user-code is being benchmarked + virtual void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) = 0; + //! Called with the benchmark results if benchmark successfully finishes + virtual void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) = 0; + //! Called if running the benchmarks fails for any reason + virtual void benchmarkFailed( StringRef benchmarkName ) = 0; + //! Called before assertion success/failure is evaluated 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; + //! Called after assertion was fully evaluated + virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; + //! Called after a `SECTION` has finished running virtual void sectionEnded( SectionStats const& sectionStats ) = 0; + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + virtual void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ) = 0; + //! Called _once_ for each TEST_CASE, no matter how many times it is entered virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; + /** + * Called once after all tests in a testing run are finished + * + * Not called if tests weren't run (e.g. only listings happened) + */ virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; + //! Called with test cases that are skipped due to the test run aborting virtual void skipTest( TestCaseInfo const& testInfo ) = 0; - // Default empty implementation provided - virtual void fatalErrorEncountered( StringRef name ); + //! Called if a fatal error (signal/structured exception) occured + virtual void fatalErrorEncountered( StringRef error ) = 0; //! Writes out information about provided reporters using reporter-specific format - virtual void listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config); + virtual void listReporters(std::vector<ReporterDescription> const& descriptions) = 0; + //! Writes out the provided listeners descriptions using reporter-specific format + virtual void listListeners(std::vector<ListenerDescription> const& descriptions) = 0; //! Writes out information about provided tests using reporter-specific format - virtual void listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config); + virtual void listTests(std::vector<TestCaseHandle> const& tests) = 0; //! Writes out information about the provided tags using reporter-specific format - virtual void listTags(std::vector<TagInfo> const& tags, IConfig const& config); - + virtual void listTags(std::vector<TagInfo> const& tags) = 0; }; - using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; } // end namespace Catch #endif // CATCH_INTERFACES_REPORTER_HPP_INCLUDED +#ifndef CATCH_UNIQUE_NAME_HPP_INCLUDED +#define CATCH_UNIQUE_NAME_HPP_INCLUDED + + + + +/** \file + * Wrapper for the CONFIG configuration option + * + * When generating internal unique names, there are two options. Either + * we mix in the current line number, or mix in an incrementing number. + * We prefer the latter, using `__COUNTER__`, but users might want to + * use the former. + */ + +#ifndef CATCH_CONFIG_COUNTER_HPP_INCLUDED +#define CATCH_CONFIG_COUNTER_HPP_INCLUDED + +#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) + #define CATCH_INTERNAL_CONFIG_COUNTER +#endif + +#if defined( CATCH_INTERNAL_CONFIG_COUNTER ) && \ + !defined( CATCH_CONFIG_NO_COUNTER ) && \ + !defined( CATCH_CONFIG_COUNTER ) +# define CATCH_CONFIG_COUNTER +#endif + + +#endif // CATCH_CONFIG_COUNTER_HPP_INCLUDED +#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 + +#endif // CATCH_UNIQUE_NAME_HPP_INCLUDED + // Adapted from donated nonius code. @@ -1570,8 +1628,8 @@ namespace Catch { # include <atomic> // atomic_thread_fence #endif + #include <type_traits> -#include <utility> namespace Catch { namespace Benchmark { @@ -1612,13 +1670,13 @@ namespace Catch { } 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...))); + inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<!std::is_same<void, decltype(fn(args...))>::value> { + deoptimize_value(CATCH_FORWARD(fn) (CATCH_FORWARD(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...)); + inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<std::is_same<void, decltype(fn(args...))>::value> { + CATCH_FORWARD(fn) (CATCH_FORWARD(args)...); } } // namespace Benchmark } // namespace Catch @@ -1633,113 +1691,17 @@ namespace Catch { -#ifndef CATCH_ENFORCE_HPP_INCLUDED -#define CATCH_ENFORCE_HPP_INCLUDED - - - -#ifndef CATCH_STREAM_HPP_INCLUDED -#define CATCH_STREAM_HPP_INCLUDED - - -#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 : Detail::NonCopyable { - std::size_t m_index; - std::ostream* m_oss; - public: - ReusableStringStream(); - ~ReusableStringStream(); - - //! Returns the serialized state - std::string str() const; - //! Sets internal state to `str` - void str(std::string const& str); - -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -// Old versions of GCC do not understand -Wnonnull-compare -#pragma GCC diagnostic ignored "-Wpragmas" -// Streaming a function pointer triggers Waddress and Wnonnull-compare -// on GCC, because it implicitly converts it to bool and then decides -// that the check it uses (a? true : false) is tautological and cannot -// be null... -#pragma GCC diagnostic ignored "-Waddress" -#pragma GCC diagnostic ignored "-Wnonnull-compare" -#endif - - template<typename T> - auto operator << ( T const& value ) -> ReusableStringStream& { - *m_oss << value; - return *this; - } - -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif - auto get() -> std::ostream& { return *m_oss; } - }; -} - -#endif // CATCH_STREAM_HPP_INCLUDED - -#include <exception> +#ifndef CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED +#define CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED 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) + //! Used to signal that an assertion macro failed + struct TestFailureException{}; +} // namespace Catch -#endif // CATCH_ENFORCE_HPP_INCLUDED +#endif // CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED #ifndef CATCH_META_HPP_INCLUDED @@ -1795,22 +1757,24 @@ namespace Catch { class TestCaseHandle; struct TestCaseInfo; - struct ITestCaseRegistry; - struct IExceptionTranslatorRegistry; - struct IExceptionTranslator; - struct IReporterRegistry; - struct IReporterFactory; - struct ITagAliasRegistry; - struct ITestInvoker; - struct IMutableEnumValuesRegistry; + class ITestCaseRegistry; + class IExceptionTranslatorRegistry; + class IExceptionTranslator; + class IReporterRegistry; + class IReporterFactory; + class ITagAliasRegistry; + class ITestInvoker; + class IMutableEnumValuesRegistry; struct SourceLineInfo; class StartupExceptionRegistry; + class EventListenerFactory; using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; - struct IRegistryHub { - virtual ~IRegistryHub(); + class IRegistryHub { + public: + virtual ~IRegistryHub(); // = default virtual IReporterRegistry const& getReporterRegistry() const = 0; virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; @@ -1821,12 +1785,13 @@ namespace Catch { virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0; }; - struct IMutableRegistryHub { - virtual ~IMutableRegistryHub(); + class IMutableRegistryHub { + public: + virtual ~IMutableRegistryHub(); // = default virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0; - virtual void registerListener( IReporterFactoryPtr factory ) = 0; + virtual void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) = 0; virtual void registerTest(Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker) = 0; - virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; + virtual void registerTranslator( Detail::unique_ptr<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; @@ -1842,7 +1807,6 @@ namespace Catch { #endif // CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED #include <type_traits> -#include <utility> namespace Catch { namespace Benchmark { @@ -1859,14 +1823,14 @@ namespace Catch { struct CompleteInvoker { template <typename Fun, typename... Args> static Result invoke(Fun&& fun, Args&&... args) { - return std::forward<Fun>(fun)(std::forward<Args>(args)...); + return CATCH_FORWARD(fun)(CATCH_FORWARD(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)...); + CATCH_FORWARD(fun)(CATCH_FORWARD(args)...); return {}; } }; @@ -1874,20 +1838,14 @@ namespace Catch { // invoke and not return void :( template <typename Fun, typename... Args> CompleteType_t<FunctionReturnType<Fun, Args...>> complete_invoke(Fun&& fun, Args&&... args) { - return CompleteInvoker<FunctionReturnType<Fun, Args...>>::invoke(std::forward<Fun>(fun), std::forward<Args>(args)...); + return CompleteInvoker<FunctionReturnType<Fun, Args...>>::invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...); } - extern const std::string benchmarkErrorMsg; } // namespace Detail template <typename Fun> Detail::CompleteType_t<FunctionReturnType<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); - } + return Detail::complete_invoke(CATCH_FORWARD(fun)); } } // namespace Benchmark } // namespace Catch @@ -1921,7 +1879,7 @@ namespace Catch { struct Chronometer { public: template <typename Fun> - void measure(Fun&& fun) { measure(std::forward<Fun>(fun), is_callable<Fun(int)>()); } + void measure(Fun&& fun) { measure(CATCH_FORWARD(fun), is_callable<Fun(int)>()); } int runs() const { return repeats; } @@ -1996,18 +1954,14 @@ namespace Catch { #define CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED -#include <cassert> #include <type_traits> -#include <utility> 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>> {}; + : std::is_same<std::decay_t<T>, std::decay_t<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 @@ -2020,7 +1974,7 @@ namespace Catch { private: struct callable { virtual void call(Chronometer meter) const = 0; - virtual callable* clone() const = 0; + virtual Catch::Detail::unique_ptr<callable> clone() const = 0; virtual ~callable(); // = default; callable() = default; @@ -2029,10 +1983,12 @@ namespace Catch { }; template <typename Fun> struct model : public callable { - model(Fun&& fun_) : fun(std::move(fun_)) {} + model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {} model(Fun const& fun_) : fun(fun_) {} - model<Fun>* clone() const override { return new model<Fun>(*this); } + Catch::Detail::unique_ptr<callable> clone() const override { + return Catch::Detail::make_unique<model<Fun>>( *this ); + } void call(Chronometer meter) const override { call(meter, is_callable<Fun(Chronometer)>()); @@ -2057,24 +2013,24 @@ namespace Catch { : f(new model<do_nothing>{ {} }) {} template <typename Fun, - typename std::enable_if<!is_related<Fun, BenchmarkFunction>::value, int>::type = 0> + std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0> BenchmarkFunction(Fun&& fun) - : f(new model<typename std::decay<Fun>::type>(std::forward<Fun>(fun))) {} + : f(new model<std::decay_t<Fun>>(CATCH_FORWARD(fun))) {} BenchmarkFunction( BenchmarkFunction&& that ) noexcept: - f( std::move( that.f ) ) {} + f( CATCH_MOVE( that.f ) ) {} BenchmarkFunction(BenchmarkFunction const& that) : f(that.f->clone()) {} BenchmarkFunction& operator=( BenchmarkFunction&& that ) noexcept { - f = std::move( that.f ); + f = CATCH_MOVE( that.f ); return *this; } BenchmarkFunction& operator=(BenchmarkFunction const& that) { - f.reset(that.f->clone()); + f = that.f->clone(); return *this; } @@ -2096,7 +2052,6 @@ namespace Catch { #define CATCH_REPEAT_HPP_INCLUDED #include <type_traits> -#include <utility> namespace Catch { namespace Benchmark { @@ -2111,8 +2066,8 @@ namespace Catch { Fun fun; }; template <typename Fun> - repeater<typename std::decay<Fun>::type> repeat(Fun&& fun) { - return { std::forward<Fun>(fun) }; + repeater<std::decay_t<Fun>> repeat(Fun&& fun) { + return { CATCH_FORWARD(fun) }; } } // namespace Detail } // namespace Benchmark @@ -2158,18 +2113,16 @@ namespace Catch { #endif // CATCH_TIMING_HPP_INCLUDED -#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&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...); auto end = Clock::now(); auto delta = end - start; - return { delta, std::forward<decltype(r)>(r), 1 }; + return { delta, CATCH_FORWARD(r), 1 }; } } // namespace Detail } // namespace Benchmark @@ -2177,7 +2130,6 @@ namespace Catch { #endif // CATCH_MEASURE_HPP_INCLUDED -#include <utility> #include <type_traits> namespace Catch { @@ -2192,24 +2144,27 @@ namespace Catch { Detail::ChronometerModel<Clock> meter; auto&& result = Detail::complete_invoke(fun, Chronometer(meter, iters)); - return { meter.elapsed(), std::move(result), iters }; + return { meter.elapsed(), CATCH_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; + using run_for_at_least_argument_t = std::conditional_t<is_callable<Fun(Chronometer)>::value, Chronometer, int>; [[noreturn]] void throw_optimized_away_error(); 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; + TimingOf<Clock, Fun, run_for_at_least_argument_t<Clock, Fun>> + run_for_at_least(ClockDuration<Clock> how_long, + const int initial_iterations, + Fun&& fun) { + auto iters = initial_iterations; 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 }; + return { Timing.elapsed, CATCH_MOVE(Timing.result), iters }; } iters *= 2; } @@ -2222,6 +2177,7 @@ namespace Catch { #endif // CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED #include <algorithm> +#include <iterator> namespace Catch { namespace Benchmark { @@ -2279,13 +2235,16 @@ namespace Catch { #include <numeric> #include <tuple> #include <cmath> -#include <utility> namespace Catch { namespace Benchmark { namespace Detail { using sample = std::vector<double>; + // Used when we know we want == comparison of two doubles + // to centralize warning suppression + bool directCompare( double lhs, double rhs ); + double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last); template <typename Iterator> @@ -2316,12 +2275,12 @@ namespace Catch { double mean(Iterator first, Iterator last) { auto count = last - first; double sum = std::accumulate(first, last, 0.); - return sum / count; + return sum / static_cast<double>(count); } template <typename Estimator, typename Iterator> sample jackknife(Estimator&& estimator, Iterator first, Iterator last) { - auto n = last - first; + auto n = static_cast<size_t>(last - first); auto second = first; ++second; sample results; @@ -2362,23 +2321,26 @@ namespace Catch { }); 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; + long n = static_cast<long>(resample.size()); + double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / static_cast<double>(n); // degenerate case with uniform samples - if (prob_n == 0) return { point, point, point, confidence_level }; + if ( directCompare( 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 cumn = [n]( double x ) -> long { + return std::lround( normal_cdf( x ) * static_cast<double>(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); + auto lo = static_cast<size_t>((std::max)(cumn(a1), 0l)); + auto hi = static_cast<size_t>((std::min)(cumn(a2), n - 1)); return { point, resample[lo], resample[hi], confidence_level }; } @@ -2391,7 +2353,7 @@ namespace Catch { double outlier_variance; }; - bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last); + bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last); } // namespace Detail } // namespace Benchmark } // namespace Catch @@ -2409,11 +2371,11 @@ namespace Catch { template <typename Clock> std::vector<double> resolution(int k) { std::vector<TimePoint<Clock>> times; - times.reserve(k + 1); + times.reserve(static_cast<size_t>(k + 1)); std::generate_n(std::back_inserter(times), k + 1, now<Clock>{}); std::vector<double> deltas; - deltas.reserve(k); + deltas.reserve(static_cast<size_t>(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()); }); @@ -2447,7 +2409,9 @@ namespace Catch { } 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_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) { @@ -2461,7 +2425,7 @@ namespace Catch { 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); + times.reserve(static_cast<size_t>(nsamples)); std::generate_n(std::back_inserter(times), nsamples, [time_clock, &r] { return static_cast<double>((time_clock(r.iterations) / r.iterations).count()); }); @@ -2473,7 +2437,14 @@ namespace Catch { template <typename Clock> Environment<FloatDuration<Clock>> measure_environment() { - static Environment<FloatDuration<Clock>>* env = nullptr; +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wexit-time-destructors" +#endif + static Catch::Detail::unique_ptr<Environment<FloatDuration<Clock>>> env; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif if (env) { return *env; } @@ -2482,7 +2453,7 @@ namespace Catch { auto resolution = Detail::estimate_clock_resolution<Clock>(iters); auto cost = Detail::estimate_clock_cost<Clock>(resolution.mean); - env = new Environment<FloatDuration<Clock>>{ resolution, cost }; + env = Catch::Detail::make_unique<Environment<FloatDuration<Clock>>>( Environment<FloatDuration<Clock>>{resolution, cost} ); return *env; } } // namespace Detail @@ -2507,7 +2478,6 @@ namespace Catch { #include <algorithm> #include <vector> -#include <string> #include <iterator> namespace Catch { @@ -2526,7 +2496,7 @@ namespace Catch { samples2.reserve(samples.size()); std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); }); return { - std::move(samples2), + CATCH_MOVE(samples2), mean, standard_deviation, outliers, @@ -2550,7 +2520,7 @@ namespace Catch { SampleAnalysis<Duration> analyse(const IConfig &cfg, Environment<Duration>, Iterator first, Iterator last) { if (!cfg.benchmarkNoAnalysis()) { std::vector<double> samples; - samples.reserve(last - first); + samples.reserve(static_cast<size_t>(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()); @@ -2568,7 +2538,7 @@ namespace Catch { samples2.reserve(samples.size()); std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](double d) { return Duration(d); }); return { - std::move(samples2), + CATCH_MOVE(samples2), wrap_estimate(analysis.mean), wrap_estimate(analysis.standard_deviation), outliers, @@ -2576,7 +2546,7 @@ namespace Catch { }; } else { std::vector<Duration> samples; - samples.reserve(last - first); + samples.reserve(static_cast<size_t>(last - first)); Duration mean = Duration(0); int i = 0; @@ -2587,7 +2557,7 @@ namespace Catch { mean /= i; return { - std::move(samples), + CATCH_MOVE(samples), Estimate<Duration>{mean, mean, mean, 0.0}, Estimate<Duration>{Duration(0), Duration(0), Duration(0), 0.0}, OutlierClassification{}, @@ -2611,11 +2581,11 @@ namespace Catch { namespace Benchmark { struct Benchmark { Benchmark(std::string&& benchmarkName) - : name(std::move(benchmarkName)) {} + : name(CATCH_MOVE(benchmarkName)) {} template <class FUN> Benchmark(std::string&& benchmarkName , FUN &&func) - : fun(std::move(func)), name(std::move(benchmarkName)) {} + : fun(CATCH_MOVE(func)), name(CATCH_MOVE(benchmarkName)) {} template <typename Clock> ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const { @@ -2657,19 +2627,24 @@ namespace Catch { 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_ANON (TestFailureException) { + getResultCapture().benchmarkFailed("Benchmark failed due to failed assertion"_sr); } CATCH_CATCH_ALL{ - if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow. - std::rethrow_exception(std::current_exception()); + getResultCapture().benchmarkFailed(translateActiveException()); + // We let the exception go further up so that the + // test case is marked as failed. + 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> + template <typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value, int> = 0> Benchmark & operator=(Fun func) { - fun = Detail::BenchmarkFunction(func); - run(); + auto const* cfg = getCurrentContext().getConfig(); + if (!cfg->skipBenchmarks()) { + fun = Detail::BenchmarkFunction(func); + run(); + } return *this; } @@ -2698,16 +2673,16 @@ namespace Catch { #if defined(CATCH_CONFIG_PREFIX_ALL) #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__,,)) + INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), 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) + INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name) #else #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__,,)) + INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), 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) + INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name) #endif @@ -2719,6 +2694,7 @@ namespace Catch { #ifndef CATCH_CONSTRUCTOR_HPP_INCLUDED #define CATCH_CONSTRUCTOR_HPP_INCLUDED + #include <type_traits> namespace Catch { @@ -2727,9 +2703,7 @@ namespace Catch { template <typename T, bool Destruct> struct ObjectStorage { - using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type; - - ObjectStorage() : data() {} + ObjectStorage() = default; ObjectStorage(const ObjectStorage& other) { @@ -2738,7 +2712,7 @@ namespace Catch { ObjectStorage(ObjectStorage&& other) { - new(&data) T(std::move(other.stored_object())); + new(data) T(CATCH_MOVE(other.stored_object())); } ~ObjectStorage() { destruct_on_exit<T>(); } @@ -2746,11 +2720,11 @@ namespace Catch { template <typename... Args> void construct(Args&&... args) { - new (&data) T(std::forward<Args>(args)...); + new (data) T(CATCH_FORWARD(args)...); } template <bool AllowManualDestruction = !Destruct> - typename std::enable_if<AllowManualDestruction>::type destruct() + std::enable_if_t<AllowManualDestruction> destruct() { stored_object().~T(); } @@ -2758,21 +2732,21 @@ namespace Catch { 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>(); } + void destruct_on_exit(std::enable_if_t<Destruct, U>* = nullptr) { destruct<true>(); } // Otherwise, don't template <typename U> - void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { } + void destruct_on_exit(std::enable_if_t<!Destruct, U>* = nullptr) { } T& stored_object() { - return *static_cast<T*>(static_cast<void*>(&data)); + return *static_cast<T*>(static_cast<void*>(data)); } T const& stored_object() const { - return *static_cast<T*>(static_cast<void*>(&data)); + return *static_cast<T const*>(static_cast<void const*>(data)); } - TStorage data; + alignas( T ) unsigned char data[sizeof( T )]{}; }; } // namespace Detail @@ -2802,6 +2776,107 @@ namespace Catch { #include <cstddef> #include <type_traits> #include <string> +#include <string.h> + + + + +/** \file + * Wrapper for the WCHAR configuration option + * + * We want to support platforms that do not provide `wchar_t`, so we + * sometimes have to disable providing wchar_t overloads through Catch2, + * e.g. the StringMaker specialization for `std::wstring`. + */ + +#ifndef CATCH_CONFIG_WCHAR_HPP_INCLUDED +#define CATCH_CONFIG_WCHAR_HPP_INCLUDED + +// We assume that WCHAR should be enabled by default, and only disabled +// for a shortlist (so far only DJGPP) of compilers. + +#if defined(__DJGPP__) +# define CATCH_INTERNAL_CONFIG_NO_WCHAR +#endif // __DJGPP__ + +#if !defined( CATCH_INTERNAL_CONFIG_NO_WCHAR ) && \ + !defined( CATCH_CONFIG_NO_WCHAR ) && \ + !defined( CATCH_CONFIG_WCHAR ) +# define CATCH_CONFIG_WCHAR +#endif + +#endif // CATCH_CONFIG_WCHAR_HPP_INCLUDED + + +#ifndef CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED +#define CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED + + +#include <iosfwd> +#include <cstddef> +#include <ostream> +#include <string> + +namespace Catch { + + class ReusableStringStream : Detail::NonCopyable { + std::size_t m_index; + std::ostream* m_oss; + public: + ReusableStringStream(); + ~ReusableStringStream(); + + //! Returns the serialized state + std::string str() const; + //! Sets internal state to `str` + void str(std::string const& str); + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +// Old versions of GCC do not understand -Wnonnull-compare +#pragma GCC diagnostic ignored "-Wpragmas" +// Streaming a function pointer triggers Waddress and Wnonnull-compare +// on GCC, because it implicitly converts it to bool and then decides +// that the check it uses (a? true : false) is tautological and cannot +// be null... +#pragma GCC diagnostic ignored "-Waddress" +#pragma GCC diagnostic ignored "-Wnonnull-compare" +#endif + + template<typename T> + auto operator << ( T const& value ) -> ReusableStringStream& { + *m_oss << value; + return *this; + } + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + auto get() -> std::ostream& { return *m_oss; } + }; +} + +#endif // CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED + + +#ifndef CATCH_VOID_TYPE_HPP_INCLUDED +#define CATCH_VOID_TYPE_HPP_INCLUDED + + +namespace Catch { + namespace Detail { + + template <typename...> + struct make_void { using type = void; }; + + template <typename... Ts> + using void_t = typename make_void<Ts...>::type; + + } // namespace Detail +} // namespace Catch + + +#endif // CATCH_VOID_TYPE_HPP_INCLUDED #ifndef CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED @@ -2823,8 +2898,9 @@ namespace Catch { }; } // namespace Detail - struct IMutableEnumValuesRegistry { - virtual ~IMutableEnumValuesRegistry(); + class IMutableEnumValuesRegistry { + public: + virtual ~IMutableEnumValuesRegistry(); // = default; virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0; @@ -2852,10 +2928,26 @@ namespace Catch { #pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless #endif +// 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 { + // Bring in global namespace operator<< for ADL lookup in + // `IsStreamInsertable` below. + using ::operator<<; + namespace Detail { - extern const std::string unprintableString; + + constexpr StringRef unprintableString = "{?}"_sr; + + //! Encases `string in quotes, and optionally escapes invisibles + std::string convertIntoString( StringRef string, bool escapeInvisibles ); + + //! Encases `string` in quotes, and escapes invisibles if user requested + //! it via CLI + std::string convertIntoString( StringRef string ); std::string rawMemoryToString( const void *object, std::size_t size ); @@ -2884,7 +2976,7 @@ namespace Catch { std::enable_if_t< !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value, std::string> convertUnstreamable( T const& ) { - return Detail::unprintableString; + return std::string(Detail::unprintableString); } template<typename T> std::enable_if_t< @@ -2988,7 +3080,7 @@ namespace Catch { static std::string convert(char * str); }; -#ifdef CATCH_CONFIG_WCHAR +#if defined(CATCH_CONFIG_WCHAR) template<> struct StringMaker<std::wstring> { static std::string convert(const std::wstring& wstr); @@ -3009,26 +3101,33 @@ namespace Catch { struct StringMaker<wchar_t *> { static std::string convert(wchar_t * str); }; -#endif +#endif // CATCH_CONFIG_WCHAR - // TBD: Should we use `strnlen` to ensure that we don't go out of the buffer, - // while keeping string semantics? - template<int SZ> + template<size_t SZ> struct StringMaker<char[SZ]> { static std::string convert(char const* str) { - return ::Catch::Detail::stringify(std::string{ str }); + // Note that `strnlen` is not actually part of standard C++, + // but both POSIX and Windows cstdlib provide it. + return Detail::convertIntoString( + StringRef( str, strnlen( str, SZ ) ) ); } }; - template<int SZ> + template<size_t 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) }); + // See the plain `char const*` overload + auto reinterpreted = reinterpret_cast<char const*>(str); + return Detail::convertIntoString( + StringRef(reinterpreted, strnlen(reinterpreted, SZ))); } }; - template<int SZ> + template<size_t 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) }); + // See the plain `char const*` overload + auto reinterpreted = reinterpret_cast<char const*>(str); + return Detail::convertIntoString( + StringRef(reinterpreted, strnlen(reinterpreted, SZ))); } }; @@ -3189,13 +3288,11 @@ 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); + return ::Catch::Detail::stringify(*optional); } else { - rss << "{ }"; + return "{ }"; } - return rss.str(); } }; } @@ -3276,24 +3373,16 @@ namespace Catch { using std::begin; using std::end; - namespace detail { - template <typename...> - struct void_type { - using type = void; - }; - + namespace Detail { template <typename T, typename = void> - struct is_range_impl : std::false_type { - }; + struct is_range_impl : std::false_type {}; template <typename T> - struct is_range_impl<T, typename void_type<decltype(begin(std::declval<T>()))>::type> : std::true_type { - }; - } // namespace detail + struct is_range_impl<T, void_t<decltype(begin(std::declval<T>()))>> : std::true_type {}; + } // namespace Detail template <typename T> - struct is_range : detail::is_range_impl<T> { - }; + struct is_range : Detail::is_range_impl<T> {}; #if defined(_MANAGED) // Managed types are never ranges template <typename T> @@ -3331,7 +3420,7 @@ namespace Catch { } }; - template <typename T, int SZ> + template <typename T, size_t SZ> struct StringMaker<T[SZ]> { static std::string convert(T const(&arr)[SZ]) { return rangeToString(arr); @@ -3361,27 +3450,27 @@ struct ratio_string { template <> struct ratio_string<std::atto> { - static std::string symbol() { return "a"; } + static char symbol() { return 'a'; } }; template <> struct ratio_string<std::femto> { - static std::string symbol() { return "f"; } + static char symbol() { return 'f'; } }; template <> struct ratio_string<std::pico> { - static std::string symbol() { return "p"; } + static char symbol() { return 'p'; } }; template <> struct ratio_string<std::nano> { - static std::string symbol() { return "n"; } + static char symbol() { return 'n'; } }; template <> struct ratio_string<std::micro> { - static std::string symbol() { return "u"; } + static char symbol() { return 'u'; } }; template <> struct ratio_string<std::milli> { - static std::string symbol() { return "m"; } + static char symbol() { return 'm'; } }; //////////// @@ -3450,7 +3539,7 @@ struct ratio_string<std::milli> { #else std::strftime(timeStamp, timeStampSize, fmt, timeInfo); #endif - return std::string(timeStamp); + return std::string(timeStamp, timeStampSize - 1); } }; } @@ -3494,7 +3583,7 @@ namespace Catch { Approx operator-() const; template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> - Approx operator()( T const& value ) { + Approx operator()( T const& value ) const { Approx approx( static_cast<double>(value) ); approx.m_epsilon = m_epsilon; approx.m_margin = m_margin; @@ -3550,14 +3639,14 @@ namespace Catch { template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> Approx& epsilon( T const& newEpsilon ) { - double epsilonAsDouble = static_cast<double>(newEpsilon); + const auto epsilonAsDouble = static_cast<double>(newEpsilon); setEpsilon(epsilonAsDouble); return *this; } template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> Approx& margin( T const& newMargin ) { - double marginAsDouble = static_cast<double>(newMargin); + const auto marginAsDouble = static_cast<double>(newMargin); setMargin(marginAsDouble); return *this; } @@ -3578,8 +3667,8 @@ namespace Catch { }; namespace literals { - Approx operator "" _a(long double val); - Approx operator "" _a(unsigned long long val); + Approx operator ""_a(long double val); + Approx operator ""_a(unsigned long long val); } // end namespace literals template<> @@ -3638,8 +3727,7 @@ namespace Catch public: WildcardPattern( std::string const& pattern, CaseSensitive caseSensitivity ); - virtual ~WildcardPattern() = default; - virtual bool matches( std::string const& str ) const; + bool matches( std::string const& str ) const; private: std::string normaliseString( std::string const& str ) const; @@ -3656,7 +3744,7 @@ namespace Catch namespace Catch { - struct IConfig; + class IConfig; struct TestCaseInfo; class TestCaseHandle; @@ -3707,11 +3795,11 @@ namespace Catch { bool hasFilters() const; bool matches( TestCaseInfo const& testCase ) const; Matches matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const; - const vectorStrings & getInvalidArgs() const; + const vectorStrings & getInvalidSpecs() const; private: std::vector<Filter> m_filters; - std::vector<std::string> m_invalidArgs; + std::vector<std::string> m_invalidSpecs; friend class TestSpecParser; }; } @@ -3722,142 +3810,519 @@ namespace Catch { #endif // CATCH_TEST_SPEC_HPP_INCLUDED -#include <vector> -#include <string> + +#ifndef CATCH_OPTIONAL_HPP_INCLUDED +#define CATCH_OPTIONAL_HPP_INCLUDED + +#include <cassert> namespace Catch { - struct IStream; + // An optional type + template<typename T> + class Optional { + public: + Optional() : nullableValue( nullptr ) {} + Optional( T const& _value ) + : nullableValue( new( storage ) T( _value ) ) + {} + Optional( Optional const& _other ) + : nullableValue( _other ? new( storage ) T( *_other ) : nullptr ) + {} - struct ConfigData { - bool listTests = false; - bool listTags = false; - bool listReporters = false; + ~Optional() { + reset(); + } - bool showSuccessfulTests = false; - bool shouldDebugBreak = false; - bool noThrow = false; - bool showHelp = false; - bool showInvisibles = false; - bool filenamesAsTags = false; - bool libIdentify = false; + Optional& operator= ( Optional const& _other ) { + if( &_other != this ) { + reset(); + if( _other ) + nullableValue = new( storage ) T( *_other ); + } + return *this; + } + Optional& operator = ( T const& _value ) { + reset(); + nullableValue = new( storage ) T( _value ); + return *this; + } - int abortAfter = -1; - unsigned int rngSeed = 0; + void reset() { + if( nullableValue ) + nullableValue->~T(); + nullableValue = nullptr; + } - bool benchmarkNoAnalysis = false; - unsigned int benchmarkSamples = 100; - double benchmarkConfidenceInterval = 0.95; - unsigned int benchmarkResamples = 100000; - std::chrono::milliseconds::rep benchmarkWarmupTime = 100; + T& operator*() { + assert(nullableValue); + return *nullableValue; + } + T const& operator*() const { + assert(nullableValue); + return *nullableValue; + } + T* operator->() { + assert(nullableValue); + return nullableValue; + } + const T* operator->() const { + assert(nullableValue); + return nullableValue; + } - Verbosity verbosity = Verbosity::Normal; - WarnAbout::What warnings = WarnAbout::Nothing; - ShowDurations showDurations = ShowDurations::DefaultForReporter; - double minDuration = -1; - TestRunOrder runOrder = TestRunOrder::Declared; - UseColour useColour = UseColour::Auto; - WaitForKeypress::When waitForKeypress = WaitForKeypress::Never; + T valueOr( T const& defaultValue ) const { + return nullableValue ? *nullableValue : defaultValue; + } - 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 + bool some() const { return nullableValue != nullptr; } + bool none() const { return nullableValue == nullptr; } - std::vector<std::string> testsOrTags; - std::vector<std::string> sectionsToRun; - }; + bool operator !() const { return nullableValue == nullptr; } + explicit operator bool() const { + return some(); + } + friend bool operator==(Optional const& a, Optional const& b) { + if (a.none() && b.none()) { + return true; + } else if (a.some() && b.some()) { + return *a == *b; + } else { + return false; + } + } + friend bool operator!=(Optional const& a, Optional const& b) { + return !( a == b ); + } - class Config : public IConfig { - public: + private: + T *nullableValue; + alignas(alignof(T)) char storage[sizeof(T)]; + }; - Config() = default; - Config( ConfigData const& data ); - ~Config() override; // = default in the cpp file +} // end namespace Catch - std::string const& getFilename() const; +#endif // CATCH_OPTIONAL_HPP_INCLUDED - bool listTests() const; - bool listTags() const; - bool listReporters() const; - std::string getProcessName() const; - std::string const& getReporterName() const; +#ifndef CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED +#define CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED - std::vector<std::string> const& getTestsOrTags() const override; - std::vector<std::string> const& getSectionsToRun() const override; +#include <cstdint> - TestSpec const& testSpec() const override; - bool hasTestFilters() const override; +namespace Catch { - bool showHelp() const; + enum class GenerateFrom { + Time, + RandomDevice, + //! Currently equivalent to RandomDevice, but can change at any point + Default + }; - // 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 showDurations() const override; - double minDuration() const override; - TestRunOrder runOrder() const override; - unsigned int rngSeed() const override; - UseColour 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; + std::uint32_t generateRandomSeed(GenerateFrom from); - private: +} // end namespace Catch - IStream const* openStream(); - ConfigData m_data; +#endif // CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED - Detail::unique_ptr<IStream const> m_stream; - TestSpec m_testSpec; - bool m_hasTestFilters = false; - }; -} // end namespace Catch +#ifndef CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED +#define CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED -#endif // CATCH_CONFIG_HPP_INCLUDED -#ifndef CATCH_MESSAGE_HPP_INCLUDED -#define CATCH_MESSAGE_HPP_INCLUDED +#ifndef CATCH_CONSOLE_COLOUR_HPP_INCLUDED +#define CATCH_CONSOLE_COLOUR_HPP_INCLUDED -#include <string> -#include <vector> +#include <iosfwd> +#include <cstdint> namespace Catch { - struct MessageStream { + enum class ColourMode : std::uint8_t; + class IStream; - template<typename T> - MessageStream& operator << ( T const& value ) { - m_stream << value; - return *this; - } + struct Colour { + enum Code { + None = 0, - ReusableStringStream m_stream; - }; + 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 + }; + }; + + class ColourImpl { + protected: + //! The associated stream of this ColourImpl instance + IStream* m_stream; + public: + ColourImpl( IStream* stream ): m_stream( stream ) {} + + //! RAII wrapper around writing specific colour of text using specific + //! colour impl into a stream. + class ColourGuard { + ColourImpl const* m_colourImpl; + Colour::Code m_code; + bool m_engaged = false; + + public: + //! Does **not** engage the guard/start the colour + ColourGuard( Colour::Code code, + ColourImpl const* colour ); + + ColourGuard( ColourGuard const& rhs ) = delete; + ColourGuard& operator=( ColourGuard const& rhs ) = delete; + + ColourGuard( ColourGuard&& rhs ) noexcept; + ColourGuard& operator=( ColourGuard&& rhs ) noexcept; + + //! Removes colour _if_ the guard was engaged + ~ColourGuard(); + + /** + * Explicitly engages colour for given stream. + * + * The API based on operator<< should be preferred. + */ + ColourGuard& engage( std::ostream& stream ) &; + /** + * Explicitly engages colour for given stream. + * + * The API based on operator<< should be preferred. + */ + ColourGuard&& engage( std::ostream& stream ) &&; + + private: + //! Engages the guard and starts using colour + friend std::ostream& operator<<( std::ostream& lhs, + ColourGuard& guard ) { + guard.engageImpl( lhs ); + return lhs; + } + //! Engages the guard and starts using colour + friend std::ostream& operator<<( std::ostream& lhs, + ColourGuard&& guard) { + guard.engageImpl( lhs ); + return lhs; + } + + void engageImpl( std::ostream& stream ); + + }; + + virtual ~ColourImpl(); // = default + /** + * Creates a guard object for given colour and this colour impl + * + * **Important:** + * the guard starts disengaged, and has to be engaged explicitly. + */ + ColourGuard guardColour( Colour::Code colourCode ); + + private: + virtual void use( Colour::Code colourCode ) const = 0; + }; + + //! Provides ColourImpl based on global config and target compilation platform + Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode colourSelection, + IStream* stream ); + + //! Checks if specific colour impl has been compiled into the binary + bool isColourImplAvailable( ColourMode colourSelection ); + +} // end namespace Catch + +#endif // CATCH_CONSOLE_COLOUR_HPP_INCLUDED + +#include <map> +#include <string> +#include <vector> + +namespace Catch { + + enum class ColourMode : std::uint8_t; + + namespace Detail { + //! Splits the reporter spec into reporter name and kv-pair options + std::vector<std::string> splitReporterSpec( StringRef reporterSpec ); + + Optional<ColourMode> stringToColourMode( StringRef colourMode ); + } + + /** + * Structured reporter spec that a reporter can be created from + * + * Parsing has been validated, but semantics have not. This means e.g. + * that the colour mode is known to Catch2, but it might not be + * compiled into the binary, and the output filename might not be + * openable. + */ + class ReporterSpec { + std::string m_name; + Optional<std::string> m_outputFileName; + Optional<ColourMode> m_colourMode; + std::map<std::string, std::string> m_customOptions; + + friend bool operator==( ReporterSpec const& lhs, + ReporterSpec const& rhs ); + friend bool operator!=( ReporterSpec const& lhs, + ReporterSpec const& rhs ) { + return !( lhs == rhs ); + } + + public: + ReporterSpec( + std::string name, + Optional<std::string> outputFileName, + Optional<ColourMode> colourMode, + std::map<std::string, std::string> customOptions ); + + std::string const& name() const { return m_name; } + + Optional<std::string> const& outputFile() const { + return m_outputFileName; + } + + Optional<ColourMode> const& colourMode() const { return m_colourMode; } + + std::map<std::string, std::string> const& customOptions() const { + return m_customOptions; + } + }; + + /** + * Parses provided reporter spec string into + * + * Returns empty optional on errors, e.g. + * * field that is not first and not a key+value pair + * * duplicated keys in kv pair + * * unknown catch reporter option + * * empty key/value in an custom kv pair + * * ... + */ + Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec ); + +} + +#endif // CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED + +#include <chrono> +#include <map> +#include <string> +#include <vector> + +namespace Catch { + + class IStream; + + /** + * `ReporterSpec` but with the defaults filled in. + * + * Like `ReporterSpec`, the semantics are unchecked. + */ + struct ProcessedReporterSpec { + std::string name; + std::string outputFilename; + ColourMode colourMode; + std::map<std::string, std::string> customOptions; + friend bool operator==( ProcessedReporterSpec const& lhs, + ProcessedReporterSpec const& rhs ); + friend bool operator!=( ProcessedReporterSpec const& lhs, + ProcessedReporterSpec const& rhs ) { + return !( lhs == rhs ); + } + }; + + struct ConfigData { + + bool listTests = false; + bool listTags = false; + bool listReporters = false; + bool listListeners = false; + + bool showSuccessfulTests = false; + bool shouldDebugBreak = false; + bool noThrow = false; + bool showHelp = false; + bool showInvisibles = false; + bool filenamesAsTags = false; + bool libIdentify = false; + bool allowZeroTests = false; + + int abortAfter = -1; + uint32_t rngSeed = generateRandomSeed(GenerateFrom::Default); + + unsigned int shardCount = 1; + unsigned int shardIndex = 0; + + bool skipBenchmarks = false; + 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 showDurations = ShowDurations::DefaultForReporter; + double minDuration = -1; + TestRunOrder runOrder = TestRunOrder::Declared; + ColourMode defaultColourMode = ColourMode::PlatformDefault; + WaitForKeypress::When waitForKeypress = WaitForKeypress::Never; + + std::string defaultOutputFilename; + std::string name; + std::string processName; + std::vector<ReporterSpec> reporterSpecifications; + + std::vector<std::string> testsOrTags; + std::vector<std::string> sectionsToRun; + }; + + + class Config : public IConfig { + public: + + Config() = default; + Config( ConfigData const& data ); + ~Config() override; // = default in the cpp file + + bool listTests() const; + bool listTags() const; + bool listReporters() const; + bool listListeners() const; + + std::vector<ReporterSpec> const& getReporterSpecs() const; + std::vector<ProcessedReporterSpec> const& + getProcessedReporterSpecs() 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; + StringRef name() const override; + bool includeSuccessfulResults() const override; + bool warnAboutMissingAssertions() const override; + bool warnAboutUnmatchedTestSpecs() const override; + bool zeroTestsCountAsSuccess() const override; + ShowDurations showDurations() const override; + double minDuration() const override; + TestRunOrder runOrder() const override; + uint32_t rngSeed() const override; + unsigned int shardCount() const override; + unsigned int shardIndex() const override; + ColourMode defaultColourMode() const override; + bool shouldDebugBreak() const override; + int abortAfter() const override; + bool showInvisibles() const override; + Verbosity verbosity() const override; + bool skipBenchmarks() const override; + bool benchmarkNoAnalysis() const override; + unsigned int benchmarkSamples() const override; + double benchmarkConfidenceInterval() const override; + unsigned int benchmarkResamples() const override; + std::chrono::milliseconds benchmarkWarmupTime() const override; + + private: + ConfigData m_data; + std::vector<ProcessedReporterSpec> m_processedReporterSpecs; + TestSpec m_testSpec; + bool m_hasTestFilters = false; + }; +} // end namespace Catch + +#endif // CATCH_CONFIG_HPP_INCLUDED + + +#ifndef CATCH_MESSAGE_HPP_INCLUDED +#define CATCH_MESSAGE_HPP_INCLUDED + + + +#ifndef CATCH_STREAM_END_STOP_HPP_INCLUDED +#define CATCH_STREAM_END_STOP_HPP_INCLUDED + + +namespace Catch { + + // Use this in variadic streaming macros to allow + // << +StreamEndStop + // as well as + // << stuff +StreamEndStop + struct StreamEndStop { + StringRef operator+() const { return StringRef(); } + + template <typename T> + friend T const& operator+( T const& value, StreamEndStop ) { + return value; + } + }; + +} // namespace Catch + +#endif // CATCH_STREAM_END_STOP_HPP_INCLUDED + +#include <string> +#include <vector> + +namespace Catch { + + struct SourceLineInfo; + + struct MessageStream { + + template<typename T> + MessageStream& operator << ( T const& value ) { + m_stream << value; + return *this; + } + + ReusableStringStream m_stream; + }; + + struct MessageBuilder : MessageStream { + MessageBuilder( StringRef macroName, + SourceLineInfo const& lineInfo, + ResultWas::OfType type ): + m_info(macroName, lineInfo, type) {} - struct MessageBuilder : MessageStream { - MessageBuilder( StringRef const& macroName, - SourceLineInfo const& lineInfo, - ResultWas::OfType type ); template<typename T> MessageBuilder& operator << ( T const& value ) { @@ -3965,97 +4430,6 @@ namespace Catch { #endif // CATCH_MESSAGE_HPP_INCLUDED -#ifndef CATCH_REPORTER_REGISTRARS_HPP_INCLUDED -#define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED - - - -#ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED -#define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED - -namespace Catch { - - struct ReporterConfig; - - struct IReporterFactory { - virtual ~IReporterFactory(); // = default - - virtual IStreamingReporterPtr - create( ReporterConfig const& config ) const = 0; - virtual std::string getDescription() const = 0; - }; - using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; -} // namespace Catch - -#endif // CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED - -namespace Catch { - - template <typename T> - class ReporterFactory : public IReporterFactory { - - IStreamingReporterPtr create( ReporterConfig const& config ) const override { - return Detail::make_unique<T>( config ); - } - - std::string getDescription() const override { - return T::getDescription(); - } - }; - - - template<typename T> - class ReporterRegistrar { - public: - explicit ReporterRegistrar( std::string const& name ) { - getMutableRegistryHub().registerReporter( name, Detail::make_unique<ReporterFactory<T>>() ); - } - }; - - template<typename T> - class ListenerRegistrar { - - class ListenerFactory : public IReporterFactory { - - IStreamingReporterPtr create( ReporterConfig const& config ) const override { - return Detail::make_unique<T>(config); - } - std::string getDescription() const override { - return std::string(); - } - }; - - public: - - ListenerRegistrar() { - getMutableRegistryHub().registerListener( Detail::make_unique<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 // CATCH_REPORTER_REGISTRARS_HPP_INCLUDED - - #ifndef CATCH_SESSION_HPP_INCLUDED #define CATCH_SESSION_HPP_INCLUDED @@ -4092,11 +4466,11 @@ namespace Catch { #include <cassert> -#include <cctype> #include <memory> #include <ostream> #include <sstream> #include <string> +#include <type_traits> #include <vector> namespace Catch { @@ -4113,7 +4487,25 @@ namespace Catch { ShortCircuitSame }; + struct accept_many_t {}; + constexpr accept_many_t accept_many {}; + namespace Detail { + struct fake_arg { + template <typename T> + operator T(); + }; + + template <typename F, typename = void> + struct is_unary_function : std::false_type {}; + + template <typename F> + struct is_unary_function< + F, + Catch::Detail::void_t<decltype( + std::declval<F>()( fake_arg() ) ) + > + > : std::true_type {}; // Traits for extracting arg and return type of lambdas (for single // argument lambdas) @@ -4129,8 +4521,7 @@ namespace Catch { 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 ArgType = std::remove_const_t<std::remove_reference_t<ArgT>>; using ReturnType = ReturnT; }; @@ -4264,20 +4655,20 @@ namespace Catch { return { ResultType::Ok, value }; } static auto ok() -> BasicResult { return { ResultType::Ok }; } - static auto logicError( std::string const& message ) + static auto logicError( std::string&& message ) -> BasicResult { - return { ResultType::LogicError, message }; + return { ResultType::LogicError, CATCH_MOVE(message) }; } - static auto runtimeError( std::string const& message ) + static auto runtimeError( std::string&& message ) -> BasicResult { - return { ResultType::RuntimeError, message }; + return { ResultType::RuntimeError, CATCH_MOVE(message) }; } explicit operator bool() const { return m_type == ResultType::Ok; } auto type() const -> ResultType { return m_type; } - auto errorMessage() const -> std::string { + auto errorMessage() const -> std::string const& { return m_errorMessage; } @@ -4296,8 +4687,8 @@ namespace Catch { m_errorMessage; // Only populated if resultType is an error BasicResult( ResultType type, - std::string const& message ): - ResultValueBase<T>( type ), m_errorMessage( message ) { + std::string&& message ): + ResultValueBase<T>( type ), m_errorMessage( CATCH_MOVE(message) ) { assert( m_type != ResultType::Ok ); } @@ -4353,7 +4744,7 @@ namespace Catch { T temp; auto result = convertInto( source, temp ); if ( result ) - target = std::move( temp ); + target = CATCH_MOVE( temp ); return result; } #endif // CLARA_CONFIG_OPTIONAL_TYPE @@ -4454,6 +4845,11 @@ namespace Catch { } }; + template <typename L> struct BoundManyLambda : BoundLambda<L> { + explicit BoundManyLambda( L const& lambda ): BoundLambda<L>( lambda ) {} + bool isContainer() const override { return true; } + }; + template <typename L> struct BoundFlagLambda : BoundFlagRefBase { L m_lambda; @@ -4508,12 +4904,23 @@ namespace Catch { m_ref( ref ) {} public: - template <typename T> + template <typename LambdaT> + ParserRefImpl( accept_many_t, + LambdaT const& ref, + std::string const& hint ): + m_ref( std::make_shared<BoundManyLambda<LambdaT>>( ref ) ), + m_hint( hint ) {} + + template <typename T, + typename = typename std::enable_if_t< + !Detail::is_unary_function<T>::value>> ParserRefImpl( T& ref, std::string const& hint ): m_ref( std::make_shared<BoundValueRef<T>>( ref ) ), m_hint( hint ) {} - template <typename LambdaT> + template <typename LambdaT, + typename = typename std::enable_if_t< + Detail::is_unary_function<LambdaT>::value>> ParserRefImpl( LambdaT const& ref, std::string const& hint ): m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ), m_hint( hint ) {} @@ -4554,6 +4961,7 @@ namespace Catch { class Arg : public Detail::ParserRefImpl<Arg> { public: using ParserRefImpl::ParserRefImpl; + using ParserBase::parse; Detail::InternalParseResult parse(std::string const&, @@ -4573,13 +4981,21 @@ namespace Catch { explicit Opt(bool& ref); + template <typename LambdaT, + typename = typename std::enable_if_t< + Detail::is_unary_function<LambdaT>::value>> + Opt( LambdaT const& ref, std::string const& hint ): + ParserRefImpl( ref, hint ) {} + template <typename LambdaT> - Opt(LambdaT const& ref, std::string const& hint) : - ParserRefImpl(ref, hint) {} + Opt( accept_many_t, LambdaT const& ref, std::string const& hint ): + ParserRefImpl( accept_many, ref, hint ) {} - template <typename T> - Opt(T& ref, std::string const& hint) : - ParserRefImpl(ref, hint) {} + template <typename T, + typename = typename std::enable_if_t< + !Detail::is_unary_function<T>::value>> + Opt( T& ref, std::string const& hint ): + ParserRefImpl( ref, hint ) {} auto operator[](std::string const& optName) -> Opt& { m_optNames.push_back(optName); @@ -4604,12 +5020,6 @@ namespace Catch { std::shared_ptr<std::string> m_name; std::shared_ptr<Detail::BoundValueRefBase> m_ref; - template <typename LambdaT> - static auto makeRef(LambdaT const& lambda) - -> std::shared_ptr<Detail::BoundValueRefBase> { - return std::make_shared<Detail::BoundLambda<LambdaT>>(lambda); - } - public: ExeName(); explicit ExeName(std::string& ref); @@ -4879,7 +5289,11 @@ namespace Catch { namespace Catch { - struct ITransientExpression { + class ITransientExpression { + bool m_isBinaryExpression; + bool m_result; + + public: auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } auto getResult() const -> bool { return m_result; } virtual void streamReconstructedExpression( std::ostream &os ) const = 0; @@ -4897,8 +5311,6 @@ namespace Catch { // complain if it's not here :-( virtual ~ITransientExpression(); // = default; - bool m_isBinaryExpression; - bool m_result; friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); return out; @@ -5029,60 +5441,53 @@ namespace Catch { 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, "=="_sr, rhs }; + template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0> + friend auto operator == ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> { + return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs }; } - auto operator == ( bool rhs ) -> BinaryExpr<LhsT, bool> const { - return { m_lhs == rhs, m_lhs, "=="_sr, rhs }; + template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0> + friend auto operator == ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> { + return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs }; } - template<typename RhsT> - auto operator != ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { compareNotEqual( m_lhs, rhs ), m_lhs, "!="_sr, rhs }; + template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0> + friend auto operator != ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> { + return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs }; } - auto operator != ( bool rhs ) -> BinaryExpr<LhsT, bool> const { - return { m_lhs != rhs, m_lhs, "!="_sr, rhs }; + template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0> + friend auto operator != ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> { + return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs }; } - template<typename RhsT> - auto operator > ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs > rhs), m_lhs, ">"_sr, rhs }; - } - template<typename RhsT> - auto operator < ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs < rhs), m_lhs, "<"_sr, rhs }; - } - template<typename RhsT> - auto operator >= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs >= rhs), m_lhs, ">="_sr, rhs }; - } - template<typename RhsT> - auto operator <= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs <= rhs), m_lhs, "<="_sr, rhs }; - } - template <typename RhsT> - auto operator | (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs | rhs), m_lhs, "|"_sr, rhs }; - } - template <typename RhsT> - auto operator & (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs & rhs), m_lhs, "&"_sr, rhs }; - } - template <typename RhsT> - auto operator ^ (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs ^ rhs), m_lhs, "^"_sr, rhs }; + #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(op) \ + template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0> \ + friend auto operator op ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> { \ + return { static_cast<bool>(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0> \ + friend auto operator op ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> { \ + return { static_cast<bool>(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \ } + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<=) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>=) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(|) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(&) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(^) + + #undef CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR + template<typename RhsT> - auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { + friend auto operator && ( ExprLhs &&, RhsT && ) -> BinaryExpr<LhsT, RhsT 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 { + friend auto operator || ( ExprLhs &&, RhsT && ) -> BinaryExpr<LhsT, RhsT const&> { static_assert(always_false<RhsT>::value, "operator|| is not supported inside assertions, " "wrap the expression inside parentheses, or decompose it"); @@ -5093,21 +5498,15 @@ namespace Catch { } }; - 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 }; + template<typename T, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<T>>::value, int> = 0> + friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs<T const&> { + return ExprLhs<const T&>{ lhs }; } - auto operator <=( bool value ) -> ExprLhs<bool> { - return ExprLhs<bool>{ value }; + template<typename T, std::enable_if_t<std::is_arithmetic<T>::value, int> = 0> + friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs<T> { + return ExprLhs<T>{ value }; } }; @@ -5124,12 +5523,11 @@ namespace Catch { #endif // CATCH_DECOMPOSER_HPP_INCLUDED +#include <string> + namespace Catch { - struct TestFailureException{}; - struct AssertionResultData; - struct IResultCapture; - class RunContext; + class IResultCapture; struct AssertionReaction { bool shouldDebugBreak = false; @@ -5144,7 +5542,7 @@ namespace Catch { public: AssertionHandler - ( StringRef const& macroName, + ( StringRef macroName, SourceLineInfo const& lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition ); @@ -5161,7 +5559,7 @@ namespace Catch { } void handleExpr( ITransientExpression const& expr ); - void handleMessage(ResultWas::OfType resultType, StringRef const& message); + void handleMessage(ResultWas::OfType resultType, StringRef message); void handleExceptionThrownAsExpected(); void handleUnexpectedExceptionNotThrown(); @@ -5176,15 +5574,15 @@ namespace Catch { auto allowThrows() const -> bool; }; - void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString ); + void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ); } // namespace Catch #endif // CATCH_ASSERTION_HANDLER_HPP_INCLUDED -// We need this suppression to leak, because it took until GCC 9 +// We need this suppression to leak, because it took until GCC 10 // for the front end to handle local suppression via _Pragma properly -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ < 9 +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ <= 9 #pragma GCC diagnostic ignored "-Wparentheses" #endif @@ -5215,7 +5613,7 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \ - do { \ + do { /* NOLINT(bugprone-infinite-loop) */ \ /* 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 ); \ @@ -5226,7 +5624,8 @@ namespace Catch { CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ INTERNAL_CATCH_REACT( catchAssertionHandler ) \ - } while( (void)0, (false) && static_cast<bool>( !!(__VA_ARGS__) ) ) + } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look + // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&. /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \ @@ -5290,265 +5689,28 @@ namespace Catch { } while( false ) - -/////////////////////////////////////////////////////////////////////////////// -// 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 // CATCH_TEST_MACRO_IMPL_HPP_INCLUDED - - -#ifndef CATCH_PREPROCESSOR_HPP_INCLUDED -#define CATCH_PREPROCESSOR_HPP_INCLUDED - - -#if defined(__GNUC__) -// We need to silence "empty __VA_ARGS__ warning", and using just _Pragma does not work -#pragma GCC system_header -#endif - - -#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, _3, _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 // CATCH_PREPROCESSOR_HPP_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// 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 // CATCH_TEST_MACRO_IMPL_HPP_INCLUDED #ifndef CATCH_SECTION_HPP_INCLUDED @@ -5563,9 +5725,6 @@ namespace Catch { namespace Catch { - auto getCurrentNanosecondsSinceEpoch() -> uint64_t; - auto getEstimatedClockResolution() -> uint64_t; - class Timer { uint64_t m_nanoseconds = 0; public: @@ -5580,8 +5739,6 @@ namespace Catch { #endif // CATCH_TIMER_HPP_INCLUDED -#include <string> - namespace Catch { class Section : Detail::NonCopyable { @@ -5632,16 +5789,18 @@ namespace Catch { class TestSpec; struct TestCaseInfo; - struct ITestInvoker { + class ITestInvoker { + public: virtual void invoke () const = 0; - virtual ~ITestInvoker(); + virtual ~ITestInvoker(); // = default }; class TestCaseHandle; - struct IConfig; + class IConfig; - struct ITestCaseRegistry { - virtual ~ITestCaseRegistry(); + class ITestCaseRegistry { + public: + virtual ~ITestCaseRegistry(); // = default // TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later virtual std::vector<TestCaseInfo* > const& getAllInfos() const = 0; virtual std::vector<TestCaseHandle> const& getAllTests() const = 0; @@ -5657,6 +5816,20 @@ namespace Catch { #endif // CATCH_INTERFACES_TESTCASE_HPP_INCLUDED + +#ifndef CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED +#define CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED + +#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_REMOVE_PARENS( ... ) \ + INTERNAL_CATCH_EXPAND1( INTERNAL_CATCH_DEF __VA_ARGS__ ) + +#endif // CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED + // GCC 5 and older do not properly handle disabling unused-variable warning // with a _Pragma. This means that we have to leak the suppression to the // user code as well :-( @@ -5684,19 +5857,19 @@ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ); template<typename C> Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) { - return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsMethod<C>(testAsMethod) ); + return Detail::make_unique<TestInvokerAsMethod<C>>( testAsMethod ); } struct NameAndTags { - NameAndTags(StringRef const& name_ = StringRef(), - StringRef const& tags_ = StringRef()) noexcept: - name(name_), tags(tags_) {} + constexpr NameAndTags( StringRef name_ = StringRef(), + StringRef tags_ = StringRef() ) noexcept: + name( name_ ), tags( tags_ ) {} StringRef name; StringRef tags; }; struct AutoReg : Detail::NonCopyable { - AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept; + AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept; }; } // end namespace Catch @@ -5718,16 +5891,18 @@ struct AutoReg : Detail::NonCopyable { static void TestName(); \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_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__ ) + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__ ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_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 @@ -5735,6 +5910,7 @@ struct AutoReg : Detail::NonCopyable { #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ namespace{ \ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ @@ -5744,13 +5920,14 @@ struct AutoReg : Detail::NonCopyable { 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__ ) + INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \ do { \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_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 \ } while(false) @@ -5758,6 +5935,7 @@ struct AutoReg : Detail::NonCopyable { #endif // CATCH_TEST_REGISTRY_HPP_INCLUDED + // All of our user-facing macros support configuration toggle, that // forces them to be defined prefixed with CATCH_. We also like to // support another toggle that can minimize (disable) their implementation. @@ -5774,8 +5952,8 @@ struct AutoReg : Detail::NonCopyable { #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_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) + #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __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__ ) @@ -5796,9 +5974,13 @@ struct AutoReg : Detail::NonCopyable { #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__ ) + #define CATCH_STATIC_CHECK( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ ) + #define CATCH_STATIC_CHECK_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__ ) + #define CATCH_STATIC_CHECK( ... ) CATCH_CHECK( __VA_ARGS__ ) + #define CATCH_STATIC_CHECK_FALSE( ... ) CATCH_CHECK_FALSE( __VA_ARGS__ ) #endif @@ -5831,8 +6013,8 @@ struct AutoReg : Detail::NonCopyable { #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0) #define CATCH_CHECK_NOTHROW( ... ) (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_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) + #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) #define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0) #define CATCH_SECTION( ... ) @@ -5843,10 +6025,12 @@ struct AutoReg : Detail::NonCopyable { #define CATCH_STATIC_REQUIRE( ... ) (void)(0) #define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0) + #define CATCH_STATIC_CHECK( ... ) (void)(0) + #define CATCH_STATIC_CHECK_FALSE( ... ) (void)(0) // "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_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) + #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className ) #define CATCH_GIVEN( desc ) #define CATCH_AND_GIVEN( desc ) #define CATCH_WHEN( desc ) @@ -5865,8 +6049,8 @@ struct AutoReg : Detail::NonCopyable { #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 CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) + #define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __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__ ) @@ -5887,9 +6071,13 @@ struct AutoReg : Detail::NonCopyable { #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__ ")" ) + #define STATIC_CHECK( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ ) + #define STATIC_CHECK_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__ ) + #define STATIC_CHECK( ... ) CHECK( __VA_ARGS__ ) + #define STATIC_CHECK_FALSE( ... ) CHECK_FALSE( __VA_ARGS__ ) #endif // "BDD-style" convenience wrappers @@ -5921,8 +6109,8 @@ struct AutoReg : Detail::NonCopyable { #define CHECK_THROWS_AS( expr, exceptionType ) (void)(0) #define CHECK_NOTHROW( ... ) (void)(0) - #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__) - #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) + #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__) + #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define METHOD_AS_TEST_CASE( method, ... ) #define REGISTER_TEST_CASE( Function, ... ) (void)(0) #define SECTION( ... ) @@ -5933,10 +6121,12 @@ struct AutoReg : Detail::NonCopyable { #define STATIC_REQUIRE( ... ) (void)(0) #define STATIC_REQUIRE_FALSE( ... ) (void)(0) + #define STATIC_CHECK( ... ) (void)(0) + #define STATIC_CHECK_FALSE( ... ) (void)(0) // "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 SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ) ) + #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className ) #define GIVEN( desc ) #define AND_GIVEN( desc ) @@ -5952,8 +6142,240 @@ struct AutoReg : Detail::NonCopyable { #endif // CATCH_TEST_MACROS_HPP_INCLUDED -#ifndef CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED -#define CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED +#ifndef CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED +#define CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED + + + +#ifndef CATCH_PREPROCESSOR_HPP_INCLUDED +#define CATCH_PREPROCESSOR_HPP_INCLUDED + + +#if defined(__GNUC__) +// We need to silence "empty __VA_ARGS__ warning", and using just _Pragma does not work +#pragma GCC system_header +#endif + + +#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_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) + +#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, _3, _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 // CATCH_PREPROCESSOR_HPP_INCLUDED // GCC 5 and older do not properly handle disabling unused-variable warning @@ -5976,34 +6398,34 @@ struct AutoReg : Detail::NonCopyable { #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) ) #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) ) #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) ) #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) ) #endif #endif @@ -6024,9 +6446,9 @@ struct AutoReg : Detail::NonCopyable { template<typename...Types> \ struct TestName{\ TestName(){\ - int index = 0; \ + size_t index = 0; \ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ - using expander = int[];\ + using expander = size_t[];\ (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ }\ };\ @@ -6041,18 +6463,18 @@ struct AutoReg : Detail::NonCopyable { #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) ) #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \ @@ -6069,12 +6491,12 @@ struct AutoReg : Detail::NonCopyable { template<typename... Types> \ struct TestName { \ void reg_tests() { \ - int index = 0; \ - using expander = int[]; \ + size_t index = 0; \ + using expander = size_t[]; \ 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++)... };/* NOLINT */\ + (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++)... };/* NOLINT */\ } \ }; \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ @@ -6091,18 +6513,18 @@ struct AutoReg : Detail::NonCopyable { #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__) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T, __VA_ARGS__ ) ) #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__) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\ @@ -6117,8 +6539,8 @@ struct AutoReg : Detail::NonCopyable { template<typename... Types> \ struct TestName { \ void reg_tests() { \ - int index = 0; \ - using expander = int[]; \ + size_t index = 0; \ + using expander = size_t[]; \ (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++)... };/* NOLINT */\ } \ };\ @@ -6134,7 +6556,7 @@ struct AutoReg : Detail::NonCopyable { 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 ) + INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, TmplList ) #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \ @@ -6152,9 +6574,9 @@ struct AutoReg : Detail::NonCopyable { template<typename...Types> \ struct TestNameClass{\ TestNameClass(){\ - int index = 0; \ + size_t index = 0; \ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ - using expander = int[];\ + using expander = size_t[];\ (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ }\ };\ @@ -6169,18 +6591,18 @@ struct AutoReg : Detail::NonCopyable { #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) ) #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__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\ @@ -6200,12 +6622,12 @@ struct AutoReg : Detail::NonCopyable { template<typename...Types>\ struct TestNameClass{\ void reg_tests(){\ - int index = 0;\ - using expander = int[];\ + std::size_t index = 0;\ + using expander = std::size_t[];\ 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++)... };/* NOLINT */ \ + (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++)... };/* NOLINT */ \ }\ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ @@ -6222,18 +6644,18 @@ struct AutoReg : Detail::NonCopyable { #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__ ) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) ) #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__ ) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature, __VA_ARGS__ ) #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__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, TmplList) \ @@ -6251,8 +6673,8 @@ struct AutoReg : Detail::NonCopyable { template<typename...Types>\ struct TestNameClass{\ void reg_tests(){\ - int index = 0;\ - using expander = int[];\ + size_t index = 0;\ + using expander = size_t[];\ (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++)... };/* NOLINT */ \ }\ };\ @@ -6268,7 +6690,7 @@ struct AutoReg : Detail::NonCopyable { 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 ) + INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, TmplList ) #endif // CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED @@ -6391,14 +6813,24 @@ struct AutoReg : Detail::NonCopyable { namespace Catch { + /** + * A **view** of a tag string that provides case insensitive comparisons + * + * Note that in Catch2 internals, the square brackets around tags are + * not a part of tag's representation, so e.g. "[cool-tag]" is represented + * as "cool-tag" internally. + */ struct Tag { - Tag(StringRef original_, StringRef lowerCased_): - original(original_), lowerCased(lowerCased_) + constexpr Tag(StringRef original_): + original(original_) {} - StringRef original, lowerCased; + StringRef original; + + friend bool operator< ( Tag const& lhs, Tag const& rhs ); + friend bool operator==( Tag const& lhs, Tag const& rhs ); }; - struct ITestInvoker; + class ITestInvoker; enum class TestCaseProperties : uint8_t { None = 0, @@ -6410,10 +6842,18 @@ namespace Catch { Benchmark = 1 << 6 }; - + /** + * Various metadata about the test case. + * + * A test case is uniquely identified by its (class)name and tags + * combination, with source location being ignored, and other properties + * being determined from tags. + * + * Tags are kept sorted. + */ struct TestCaseInfo : Detail::NonCopyable { - TestCaseInfo(std::string const& _className, + TestCaseInfo(StringRef _className, NameAndTags const& _tags, SourceLineInfo const& _lineInfo); @@ -6425,13 +6865,17 @@ namespace Catch { // Adds the tag(s) with test's filename (for the -# flag) void addFilenameTag(); + //! Orders by name, classname and tags + friend bool operator<( TestCaseInfo const& lhs, + TestCaseInfo const& rhs ); + std::string tagsAsString() const; std::string name; - std::string className; + StringRef className; private: - std::string backingTags, backingLCaseTags; + std::string backingTags; // Internally we copy tags to the backing storage and then add // refs to this storage to the tags vector. void internalAppendTag(StringRef tagString); @@ -6441,6 +6885,12 @@ namespace Catch { TestCaseProperties properties = TestCaseProperties::None; }; + /** + * Wrapper over the test case information and the test case invoker + * + * Does not own either, and is specifically made to be cheap + * to copy around. + */ class TestCaseHandle { TestCaseInfo* m_info; ITestInvoker* m_invoker; @@ -6453,14 +6903,12 @@ namespace Catch { } TestCaseInfo const& getTestCaseInfo() const; - - bool operator== ( TestCaseHandle const& rhs ) const; - bool operator < ( TestCaseHandle const& rhs ) const; }; - Detail::unique_ptr<TestCaseInfo> makeTestCaseInfo( std::string const& className, - NameAndTags const& nameAndTags, - SourceLineInfo const& lineInfo ); + Detail::unique_ptr<TestCaseInfo> + makeTestCaseInfo( StringRef className, + NameAndTags const& nameAndTags, + SourceLineInfo const& lineInfo ); } #ifdef __clang__ @@ -6485,17 +6933,18 @@ namespace Catch { namespace Catch { using exceptionTranslateFunction = std::string(*)(); - struct IExceptionTranslator; + class IExceptionTranslator; using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>; - struct IExceptionTranslator { - virtual ~IExceptionTranslator(); + class IExceptionTranslator { + public: + virtual ~IExceptionTranslator(); // = default virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0; }; - struct IExceptionTranslatorRegistry { - virtual ~IExceptionTranslatorRegistry(); - + class IExceptionTranslatorRegistry { + public: + virtual ~IExceptionTranslatorRegistry(); // = default virtual std::string translateActiveException() const = 0; }; @@ -6539,8 +6988,9 @@ namespace Catch { public: template<typename T> ExceptionTranslatorRegistrar( std::string(*translateFunction)( T const& ) ) { - getMutableRegistryHub().registerTranslator - ( new ExceptionTranslator<T>( translateFunction ) ); + getMutableRegistryHub().registerTranslator( + Detail::make_unique<ExceptionTranslator<T>>(translateFunction) + ); } }; @@ -6573,6 +7023,7 @@ namespace Catch { #endif // CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED + #ifndef CATCH_VERSION_HPP_INCLUDED #define CATCH_VERSION_HPP_INCLUDED @@ -6611,7 +7062,7 @@ namespace Catch { #define CATCH_VERSION_MACROS_HPP_INCLUDED #define CATCH_VERSION_MAJOR 3 -#define CATCH_VERSION_MINOR 0 +#define CATCH_VERSION_MINOR 1 #define CATCH_VERSION_PATCH 0 #endif // CATCH_VERSION_MACROS_HPP_INCLUDED @@ -6670,10 +7121,30 @@ namespace Catch { #define CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED +#include <string> + namespace Catch { namespace Generators { class GeneratorUntypedBase { + // Caches result from `toStringImpl`, assume that when it is an + // empty string, the cache is invalidated. + mutable std::string m_stringReprCache; + + // Counts based on `next` returning true + std::size_t m_currentElementIndex = 0; + + /** + * 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; + + //! Customization point for `currentElementAsString` + virtual std::string stringifyImpl() const = 0; + public: GeneratorUntypedBase() = default; // Generation of copy ops is deprecated (and Clang will complain) @@ -6683,17 +7154,41 @@ namespace Catch { virtual ~GeneratorUntypedBase(); // = default; - // 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; + /** + * Attempts to move the generator to the next element + * + * Serves as a non-virtual interface to `next`, so that the + * top level interface can provide sanity checking and shared + * features. + * + * As with `next`, returns true iff the move succeeded and + * the generator has new valid element to provide. + */ + bool countedNext(); + + std::size_t currentElementIndex() const { return m_currentElementIndex; } + + /** + * Returns generator's current element as user-friendly string. + * + * By default returns string equivalent to calling + * `Catch::Detail::stringify` on the current element, but generators + * can customize their implementation as needed. + * + * Not thread-safe due to internal caching. + * + * The returned ref is valid only until the generator instance + * is destructed, or it moves onto the next element, whichever + * comes first. + */ + StringRef currentElementAsString() const; }; using GeneratorBasePtr = Catch::Detail::unique_ptr<GeneratorUntypedBase>; } // namespace Generators - struct IGeneratorTracker { + class IGeneratorTracker { + public: virtual ~IGeneratorTracker(); // = default; virtual auto hasGenerator() const -> bool = 0; virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0; @@ -6706,7 +7201,6 @@ namespace Catch { #include <vector> #include <tuple> -#include <utility> namespace Catch { @@ -6721,7 +7215,12 @@ namespace Detail { } // end namespace detail template<typename T> - struct IGenerator : GeneratorUntypedBase { + class IGenerator : public GeneratorUntypedBase { + std::string stringifyImpl() const override { + return ::Catch::Detail::stringify( get() ); + } + + public: ~IGenerator() override = default; IGenerator() = default; IGenerator(IGenerator const&) = default; @@ -6747,13 +7246,13 @@ namespace Detail { GeneratorWrapper(IGenerator<T>* generator): m_generator(generator) {} GeneratorWrapper(GeneratorPtr<T> generator): - m_generator(std::move(generator)) {} + m_generator(CATCH_MOVE(generator)) {} T const& get() const { return m_generator->get(); } bool next() { - return m_generator->next(); + return m_generator->countedNext(); } }; @@ -6762,8 +7261,11 @@ namespace Detail { class SingleValueGenerator final : public IGenerator<T> { T m_value; public: + SingleValueGenerator(T const& value) : + m_value(value) + {} SingleValueGenerator(T&& value): - m_value(std::forward<T>(value)) + m_value(CATCH_MOVE(value)) {} T const& get() const override { @@ -6793,9 +7295,11 @@ namespace Detail { } }; - template <typename T> - GeneratorWrapper<T> value(T&& value) { - return GeneratorWrapper<T>(Catch::Detail::make_unique<SingleValueGenerator<T>>(std::forward<T>(value))); + template <typename T, typename DecayedT = std::decay_t<T>> + GeneratorWrapper<DecayedT> value( T&& value ) { + return GeneratorWrapper<DecayedT>( + Catch::Detail::make_unique<SingleValueGenerator<DecayedT>>( + CATCH_FORWARD( value ) ) ); } template <typename T> GeneratorWrapper<T> values(std::initializer_list<T> values) { @@ -6807,27 +7311,36 @@ namespace Detail { std::vector<GeneratorWrapper<T>> m_generators; size_t m_current = 0; - void populate(GeneratorWrapper<T>&& generator) { - m_generators.emplace_back(std::move(generator)); + void add_generator( GeneratorWrapper<T>&& generator ) { + m_generators.emplace_back( CATCH_MOVE( generator ) ); + } + void add_generator( T const& val ) { + m_generators.emplace_back( value( val ) ); } - void populate(T&& val) { - m_generators.emplace_back(value(std::forward<T>(val))); + void add_generator( T&& val ) { + m_generators.emplace_back( value( CATCH_MOVE( val ) ) ); + } + template <typename U> + std::enable_if_t<!std::is_same<std::decay_t<U>, T>::value> + add_generator( U&& val ) { + add_generator( T( CATCH_FORWARD( val ) ) ); } - template<typename U> - void populate(U&& val) { - populate(T(std::forward<U>(val))); + + template <typename U> void add_generators( U&& valueOrGenerator ) { + add_generator( CATCH_FORWARD( valueOrGenerator ) ); } - template<typename U, typename... Gs> - void populate(U&& valueOrGenerator, Gs &&... moreGenerators) { - populate(std::forward<U>(valueOrGenerator)); - populate(std::forward<Gs>(moreGenerators)...); + + template <typename U, typename... Gs> + void add_generators( U&& valueOrGenerator, Gs&&... moreGenerators ) { + add_generator( CATCH_FORWARD( valueOrGenerator ) ); + add_generators( CATCH_FORWARD( moreGenerators )... ); } public: template <typename... Gs> Generators(Gs &&... moreGenerators) { m_generators.reserve(sizeof...(Gs)); - populate(std::forward<Gs>(moreGenerators)...); + add_generators(CATCH_FORWARD(moreGenerators)...); } T const& get() const override { @@ -6847,8 +7360,9 @@ namespace Detail { }; - template<typename... Ts> - GeneratorWrapper<std::tuple<Ts...>> table( std::initializer_list<std::tuple<std::decay_t<Ts>...>> tuples ) { + template <typename... Ts> + GeneratorWrapper<std::tuple<std::decay_t<Ts>...>> + table( std::initializer_list<std::tuple<std::decay_t<Ts>...>> tuples ) { return values<std::tuple<Ts...>>( tuples ); } @@ -6858,19 +7372,19 @@ namespace Detail { template<typename T, typename... Gs> auto makeGenerators( GeneratorWrapper<T>&& generator, Gs &&... moreGenerators ) -> Generators<T> { - return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...); + return Generators<T>(CATCH_MOVE(generator), CATCH_FORWARD(moreGenerators)...); } template<typename T> auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> { - return Generators<T>(std::move(generator)); + return Generators<T>(CATCH_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 )... ); + auto makeGenerators( T&& val, Gs &&... moreGenerators ) -> Generators<std::decay_t<T>> { + return makeGenerators( value( CATCH_FORWARD( val ) ), CATCH_FORWARD( 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 )... ); + return makeGenerators( value( T( CATCH_FORWARD( val ) ) ), CATCH_FORWARD( moreGenerators )... ); } auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker&; @@ -6914,6 +7428,8 @@ namespace Detail { #define CATCH_GENERATORS_ADAPTERS_HPP_INCLUDED +#include <cassert> + namespace Catch { namespace Generators { @@ -6924,7 +7440,7 @@ namespace Generators { size_t m_target; public: TakeGenerator(size_t target, GeneratorWrapper<T>&& generator): - m_generator(std::move(generator)), + m_generator(CATCH_MOVE(generator)), m_target(target) { assert(target != 0 && "Empty generators are not allowed"); @@ -6950,7 +7466,7 @@ namespace Generators { template <typename T> GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) { - return GeneratorWrapper<T>(Catch::Detail::make_unique<TakeGenerator<T>>(target, std::move(generator))); + return GeneratorWrapper<T>(Catch::Detail::make_unique<TakeGenerator<T>>(target, CATCH_MOVE(generator))); } @@ -6961,8 +7477,8 @@ namespace Generators { public: template <typename P = Predicate> FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator): - m_generator(std::move(generator)), - m_predicate(std::forward<P>(pred)) + m_generator(CATCH_MOVE(generator)), + m_predicate(CATCH_FORWARD(pred)) { if (!m_predicate(m_generator.get())) { // It might happen that there are no values that pass the @@ -6991,7 +7507,7 @@ namespace Generators { template <typename T, typename Predicate> GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) { - return GeneratorWrapper<T>(Catch::Detail::make_unique<FilterGenerator<T, Predicate>>(std::forward<Predicate>(pred), std::move(generator))); + return GeneratorWrapper<T>(Catch::Detail::make_unique<FilterGenerator<T, Predicate>>(CATCH_FORWARD(pred), CATCH_MOVE(generator))); } template <typename T> @@ -7006,7 +7522,7 @@ namespace Generators { size_t m_repeat_index = 0; public: RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator): - m_generator(std::move(generator)), + m_generator(CATCH_MOVE(generator)), m_target_repeats(repeats) { assert(m_target_repeats > 0 && "Repeat generator must repeat at least once"); @@ -7047,7 +7563,7 @@ namespace Generators { template <typename T> GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) { - return GeneratorWrapper<T>(Catch::Detail::make_unique<RepeatGenerator<T>>(repeats, std::move(generator))); + return GeneratorWrapper<T>(Catch::Detail::make_unique<RepeatGenerator<T>>(repeats, CATCH_MOVE(generator))); } template <typename T, typename U, typename Func> @@ -7060,8 +7576,8 @@ namespace Generators { public: template <typename F2 = Func> MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) : - m_generator(std::move(generator)), - m_function(std::forward<F2>(function)), + m_generator(CATCH_MOVE(generator)), + m_function(CATCH_FORWARD(function)), m_cache(m_function(m_generator.get())) {} @@ -7080,14 +7596,14 @@ namespace Generators { template <typename Func, typename U, typename T = FunctionReturnType<Func, U>> GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { return GeneratorWrapper<T>( - Catch::Detail::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + Catch::Detail::make_unique<MapGenerator<T, U, Func>>(CATCH_FORWARD(function), CATCH_MOVE(generator)) ); } template <typename T, typename U, typename Func> GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { return GeneratorWrapper<T>( - Catch::Detail::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + Catch::Detail::make_unique<MapGenerator<T, U, Func>>(CATCH_FORWARD(function), CATCH_MOVE(generator)) ); } @@ -7099,7 +7615,7 @@ namespace Generators { bool m_used_up = false; public: ChunkGenerator(size_t size, GeneratorWrapper<T> generator) : - m_chunk_size(size), m_generator(std::move(generator)) + m_chunk_size(size), m_generator(CATCH_MOVE(generator)) { m_chunk.reserve(m_chunk_size); if (m_chunk_size != 0) { @@ -7130,7 +7646,7 @@ namespace Generators { template <typename T> GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) { return GeneratorWrapper<std::vector<T>>( - Catch::Detail::make_unique<ChunkGenerator<T>>(size, std::move(generator)) + Catch::Detail::make_unique<ChunkGenerator<T>>(size, CATCH_MOVE(generator)) ); } @@ -7203,16 +7719,21 @@ namespace Catch { namespace Catch { namespace Generators { +namespace Detail { + // Returns a suitable seed for a random floating generator based off + // the primary internal rng. It does so by taking current value from + // the rng and returning it as the seed. + std::uint32_t getSeed(); +} template <typename Float> class RandomFloatingGenerator final : public IGenerator<Float> { - Catch::SimplePcg32& m_rng; + Catch::SimplePcg32 m_rng; std::uniform_real_distribution<Float> m_dist; Float m_current_number; public: - - RandomFloatingGenerator(Float a, Float b): - m_rng(rng()), + RandomFloatingGenerator( Float a, Float b, std::uint32_t seed ): + m_rng(seed), m_dist(a, b) { static_cast<void>(next()); } @@ -7228,13 +7749,12 @@ public: template <typename Integer> class RandomIntegerGenerator final : public IGenerator<Integer> { - Catch::SimplePcg32& m_rng; + Catch::SimplePcg32 m_rng; std::uniform_int_distribution<Integer> m_dist; Integer m_current_number; public: - - RandomIntegerGenerator(Integer a, Integer b): - m_rng(rng()), + RandomIntegerGenerator( Integer a, Integer b, std::uint32_t seed ): + m_rng(seed), m_dist(a, b) { static_cast<void>(next()); } @@ -7248,14 +7768,19 @@ public: } }; -// 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> -std::enable_if_t<std::is_integral<T>::value && !std::is_same<T, bool>::value, -GeneratorWrapper<T>> +std::enable_if_t<std::is_integral<T>::value, GeneratorWrapper<T>> random(T a, T b) { + static_assert( + !std::is_same<T, char>::value && + !std::is_same<T, int8_t>::value && + !std::is_same<T, uint8_t>::value && + !std::is_same<T, signed char>::value && + !std::is_same<T, unsigned char>::value && + !std::is_same<T, bool>::value, + "The requested type is not supported by the underlying random distributions from std" ); return GeneratorWrapper<T>( - Catch::Detail::make_unique<RandomIntegerGenerator<T>>(a, b) + Catch::Detail::make_unique<RandomIntegerGenerator<T>>(a, b, Detail::getSeed()) ); } @@ -7264,7 +7789,7 @@ std::enable_if_t<std::is_floating_point<T>::value, GeneratorWrapper<T>> random(T a, T b) { return GeneratorWrapper<T>( - Catch::Detail::make_unique<RandomFloatingGenerator<T>>(a, b) + Catch::Detail::make_unique<RandomFloatingGenerator<T>>(a, b, Detail::getSeed()) ); } @@ -7401,29 +7926,94 @@ GeneratorWrapper<ResultType> from_range(Container const& cnt) { +#ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED +#define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED + + +#include <string> + +namespace Catch { + + struct ReporterConfig; + class IConfig; + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; + + + class IReporterFactory { + public: + virtual ~IReporterFactory(); // = default + + virtual IEventListenerPtr + create( ReporterConfig&& config ) const = 0; + virtual std::string getDescription() const = 0; + }; + using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; + + class EventListenerFactory { + public: + virtual ~EventListenerFactory(); // = default + virtual IEventListenerPtr create( IConfig const* config ) const = 0; + //! Return a meaningful name for the listener, e.g. its type name + virtual StringRef getName() const = 0; + //! Return listener's description if available + virtual std::string getDescription() const = 0; + }; +} // namespace Catch + +#endif // CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED + + #ifndef CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED #define CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED + +#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED +#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED + + +namespace Catch { + namespace Detail { + //! Provides case-insensitive `op<` semantics when called + struct CaseInsensitiveLess { + bool operator()( StringRef lhs, + StringRef rhs ) const; + }; + + //! Provides case-insensitive `op==` semantics when called + struct CaseInsensitiveEqualTo { + bool operator()( StringRef lhs, + StringRef rhs ) const; + }; + + } // namespace Detail +} // namespace Catch + +#endif // CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED + #include <string> #include <vector> #include <map> namespace Catch { - struct IConfig; + class IConfig; - struct IStreamingReporter; - using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; - struct IReporterFactory; + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; + class IReporterFactory; using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; + struct ReporterConfig; + class EventListenerFactory; - struct IReporterRegistry { - using FactoryMap = std::map<std::string, IReporterFactoryPtr>; - using Listeners = std::vector<IReporterFactoryPtr>; + class IReporterRegistry { + public: + using FactoryMap = std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess>; + using Listeners = std::vector<Detail::unique_ptr<EventListenerFactory>>; - virtual ~IReporterRegistry(); - virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0; + virtual ~IReporterRegistry(); // = default + virtual IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const = 0; virtual FactoryMap const& getFactories() const = 0; virtual Listeners const& getListeners() const = 0; }; @@ -7433,20 +8023,6 @@ namespace Catch { #endif // CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED -#ifndef CATCH_INTERFACES_RUNNER_HPP_INCLUDED -#define CATCH_INTERFACES_RUNNER_HPP_INCLUDED - -namespace Catch { - - struct IRunner { - virtual ~IRunner(); - virtual bool aborting() const = 0; - }; -} - -#endif // CATCH_INTERFACES_RUNNER_HPP_INCLUDED - - #ifndef CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED #define CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED @@ -7456,8 +8032,9 @@ namespace Catch { struct TagAlias; - struct ITagAliasRegistry { - virtual ~ITagAliasRegistry(); + class ITagAliasRegistry { + public: + virtual ~ITagAliasRegistry(); // = default // Nullptr if not present virtual TagAlias const* find( std::string const& alias ) const = 0; virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0; @@ -7473,6 +8050,33 @@ namespace Catch { +/** \file + * Wrapper for ANDROID_LOGWRITE configuration option + * + * We want to default to enabling it when compiled for android, but + * users of the library should also be able to disable it if they want + * to. + */ + +#ifndef CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED +#define CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED + + +#if defined(__ANDROID__) +# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE +#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 + +#endif // CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED + + + /** \file * Wrapper for UNCAUGHT_EXCEPTIONS configuration option * @@ -7481,8 +8085,8 @@ namespace Catch { * in C++17, we want to use `std::uncaught_exceptions` if possible. */ -#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP -#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP +#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED +#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED #if defined(_MSC_VER) # if _MSC_VER >= 1900 // Visual Studio 2015 or newer @@ -7508,86 +8112,28 @@ namespace Catch { #endif -#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP - - -#ifndef CATCH_CONSOLE_COLOUR_HPP_INCLUDED -#define CATCH_CONSOLE_COLOUR_HPP_INCLUDED - - -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; - - friend std::ostream& operator << (std::ostream& os, Colour const&); - }; - - -} // end namespace Catch - -#endif // CATCH_CONSOLE_COLOUR_HPP_INCLUDED +#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED #ifndef CATCH_CONSOLE_WIDTH_HPP_INCLUDED #define CATCH_CONSOLE_WIDTH_HPP_INCLUDED +// This include must be kept so that user's configured value for CONSOLE_WIDTH +// is used before we attempt to provide a default value + #ifndef CATCH_CONFIG_CONSOLE_WIDTH #define CATCH_CONFIG_CONSOLE_WIDTH 80 #endif #endif // CATCH_CONSOLE_WIDTH_HPP_INCLUDED + #ifndef CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED #define CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED +#include <cstddef> +#include <initializer_list> // We want a simple polyfill over `std::empty`, `std::size` and so on // for C++14 or C++ libraries with incomplete support. @@ -7673,50 +8219,96 @@ namespace Catch { #if defined(__i386__) || defined(__x86_64__) #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */ + #elif defined(__aarch64__) + #define CATCH_TRAP() __asm__(".inst 0xd43e0000") + #endif + +#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 // CATCH_DEBUGGER_HPP_INCLUDED + + +#ifndef CATCH_ENFORCE_HPP_INCLUDED +#define CATCH_ENFORCE_HPP_INCLUDED + + +#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() -#elif defined(CATCH_PLATFORM_IPHONE) +#define CATCH_INTERNAL_ERROR(...) \ + Catch::throw_logic_error(CATCH_MAKE_MSG( CATCH_INTERNAL_LINEINFO << ": Internal Catch2 error: " << __VA_ARGS__)) - // 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 +#define CATCH_ERROR(...) \ + Catch::throw_domain_error(CATCH_MAKE_MSG( __VA_ARGS__ )) -#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_RUNTIME_ERROR(...) \ + Catch::throw_runtime_error(CATCH_MAKE_MSG( __VA_ARGS__ )) - #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 +#define CATCH_ENFORCE( condition, ... ) \ + do{ if( !(condition) ) CATCH_ERROR( __VA_ARGS__ ); } while(false) -#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 // CATCH_DEBUGGER_HPP_INCLUDED +#endif // CATCH_ENFORCE_HPP_INCLUDED #ifndef CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED @@ -7772,6 +8364,7 @@ namespace Catch { #ifndef CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED #define CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED + #include <vector> #include <string> @@ -7779,8 +8372,8 @@ namespace Catch { class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry { public: - ~ExceptionTranslatorRegistry(); - virtual void registerTranslator( const IExceptionTranslator* translator ); + ~ExceptionTranslatorRegistry() override; + void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ); std::string translateActiveException() const override; std::string tryTranslators() const; @@ -7796,91 +8389,217 @@ namespace Catch { #define CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED +#include <cassert> -#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED -#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED +namespace Catch { + /** + * Wrapper for platform-specific fatal error (signals/SEH) handlers + * + * Tries to be cooperative with other handlers, and not step over + * other handlers. This means that unknown structured exceptions + * are passed on, previous signal handlers are called, and so on. + * + * Can only be instantiated once, and assumes that once a signal + * is caught, the binary will end up terminating. Thus, there + */ + class FatalConditionHandler { + bool m_started = false; + + // Install/disengage implementation for specific platform. + // Should be if-defed to work on current platform, can assume + // engage-disengage 1:1 pairing. + void engage_platform(); + void disengage_platform() noexcept; + public: + // Should also have platform-specific implementations as needed + FatalConditionHandler(); + ~FatalConditionHandler(); -#if defined(CATCH_PLATFORM_WINDOWS) + void engage() { + assert(!m_started && "Handler cannot be installed twice."); + m_started = true; + engage_platform(); + } -#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 + void disengage() noexcept { + assert(m_started && "Handler cannot be uninstalled without being installed first"); + m_started = false; + disengage_platform(); + } + }; -#ifdef __AFXDLL -#include <AfxWin.h> -#else -#include <windows.h> -#endif + //! Simple RAII guard for (dis)engaging the FatalConditionHandler + class FatalConditionHandlerGuard { + FatalConditionHandler* m_handler; + public: + FatalConditionHandlerGuard(FatalConditionHandler* handler): + m_handler(handler) { + m_handler->engage(); + } + ~FatalConditionHandlerGuard() { + m_handler->disengage(); + } + }; -#ifdef CATCH_DEFINED_NOMINMAX -# undef NOMINMAX -#endif -#ifdef CATCH_DEFINED_WIN32_LEAN_AND_MEAN -# undef WIN32_LEAN_AND_MEAN -#endif +} // end namespace Catch -#endif // defined(CATCH_PLATFORM_WINDOWS) +#endif // CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED -#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED + +#ifndef CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED +#define CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED -#if defined( CATCH_CONFIG_WINDOWS_SEH ) + +#ifndef CATCH_POLYFILLS_HPP_INCLUDED +#define CATCH_POLYFILLS_HPP_INCLUDED namespace Catch { + bool isnan(float f); + bool isnan(double d); +} - struct FatalConditionHandler { +#endif // CATCH_POLYFILLS_HPP_INCLUDED - static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo); - FatalConditionHandler(); - static void reset(); - ~FatalConditionHandler() { reset(); } +#include <cassert> +#include <cmath> +#include <cstdint> +#include <utility> +#include <limits> - private: - static bool isSet; - static ULONG guaranteeSize; - static PVOID exceptionHandlerHandle; - }; +namespace Catch { + namespace Detail { -} // namespace Catch + uint32_t convertToBits(float f); + uint64_t convertToBits(double d); -#elif defined ( CATCH_CONFIG_POSIX_SIGNALS ) + } // end namespace Detail -#include <signal.h> -namespace Catch { - struct FatalConditionHandler { +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic push + // We do a bunch of direct compensations of floating point numbers, + // because we know what we are doing and actually do want the direct + // comparison behaviour. +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif - static bool isSet; - static struct sigaction oldSigActions[]; - static stack_t oldSigStack; - static char altStackMem[]; + /** + * Calculates the ULP distance between two floating point numbers + * + * The ULP distance of two floating point numbers is the count of + * valid floating point numbers representable between them. + * + * There are some exceptions between how this function counts the + * distance, and the interpretation of the standard as implemented. + * by e.g. `nextafter`. For this function it always holds that: + * * `(x == y) => ulpDistance(x, y) == 0` (so `ulpDistance(-0, 0) == 0`) + * * `ulpDistance(maxFinite, INF) == 1` + * * `ulpDistance(x, -x) == 2 * ulpDistance(x, 0)` + * + * \pre `!isnan( lhs )` + * \pre `!isnan( rhs )` + * \pre floating point numbers are represented in IEEE-754 format + */ + template <typename FP> + uint64_t ulpDistance( FP lhs, FP rhs ) { + assert( std::numeric_limits<FP>::is_iec559 && + "ulpDistance assumes IEEE-754 format for floating point types" ); + assert( !Catch::isnan( lhs ) && + "Distance between NaN and number is not meaningful" ); + assert( !Catch::isnan( rhs ) && + "Distance between NaN and number is not meaningful" ); + + // We want X == Y to imply 0 ULP distance even if X and Y aren't + // bit-equal (-0 and 0), or X - Y != 0 (same sign infinities). + if ( lhs == rhs ) { return 0; } + + // We need a properly typed positive zero for type inference. + static constexpr FP positive_zero{}; + + // We want to ensure that +/- 0 is always represented as positive zero + if ( lhs == positive_zero ) { lhs = positive_zero; } + if ( rhs == positive_zero ) { rhs = positive_zero; } + + // If arguments have different signs, we can handle them by summing + // how far are they from 0 each. + if ( std::signbit( lhs ) != std::signbit( rhs ) ) { + return ulpDistance( std::abs( lhs ), positive_zero ) + + ulpDistance( std::abs( rhs ), positive_zero ); + } + + // When both lhs and rhs are of the same sign, we can just + // read the numbers bitwise as integers, and then subtract them + // (assuming IEEE). + uint64_t lc = Detail::convertToBits( lhs ); + uint64_t rc = Detail::convertToBits( rhs ); + + // The ulp distance between two numbers is symmetric, so to avoid + // dealing with overflows we want the bigger converted number on the lhs + if ( lc < rc ) { + std::swap( lc, rc ); + } + + return lc - rc; + } - static void handleSignal( int sig ); +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic pop +#endif - FatalConditionHandler(); - ~FatalConditionHandler() { reset(); } - static void reset(); - }; -} // namespace Catch +} // end namespace Catch +#endif // CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED -#else + +#ifndef CATCH_ISTREAM_HPP_INCLUDED +#define CATCH_ISTREAM_HPP_INCLUDED + + +#include <iosfwd> +#include <cstddef> +#include <ostream> +#include <string> namespace Catch { - struct FatalConditionHandler {}; -} -#endif + class IStream { + public: + virtual ~IStream(); // = default + virtual std::ostream& stream() = 0; + /** + * Best guess on whether the instance is writing to a console (e.g. via stdout/stderr) + * + * This is useful for e.g. Win32 colour support, because the Win32 + * API manipulates console directly, unlike POSIX escape codes, + * that can be written anywhere. + * + * Due to variety of ways to change where the stdout/stderr is + * _actually_ being written, users should always assume that + * the answer might be wrong. + */ + virtual bool isConsole() const { return false; } + }; -#endif // CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED + /** + * Creates a stream wrapper that writes to specific file. + * + * Also recognizes 4 special filenames + * * `-` for stdout + * * `%stdout` for stdout + * * `%stderr` for stderr + * * `%debug` for platform specific debugging output + * + * \throws if passed an unrecognized %-prefixed stream + */ + auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream>; + +} + +#endif // CATCH_STREAM_HPP_INCLUDED #ifndef CATCH_LEAK_DETECTOR_HPP_INCLUDED @@ -7907,13 +8626,17 @@ namespace Catch { namespace Catch { - struct IStreamingReporter; + class IEventListener; class Config; struct ReporterDescription { std::string name, description; }; + struct ListenerDescription { + StringRef name; + std::string description; + }; struct TagInfo { void add(StringRef spelling); @@ -7923,81 +8646,13 @@ namespace Catch { std::size_t count = 0; }; - bool list( IStreamingReporter& reporter, Config const& config ); + bool list( IEventListener& reporter, Config const& config ); } // end namespace Catch #endif // CATCH_LIST_HPP_INCLUDED -#ifndef CATCH_OPTION_HPP_INCLUDED -#define 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 // CATCH_OPTION_HPP_INCLUDED - - #ifndef CATCH_OUTPUT_REDIRECT_HPP_INCLUDED #define CATCH_OUTPUT_REDIRECT_HPP_INCLUDED @@ -8108,17 +8763,6 @@ namespace Catch { #endif // CATCH_OUTPUT_REDIRECT_HPP_INCLUDED -#ifndef CATCH_POLYFILLS_HPP_INCLUDED -#define CATCH_POLYFILLS_HPP_INCLUDED - -namespace Catch { - bool isnan(float f); - bool isnan(double d); -} - -#endif // CATCH_POLYFILLS_HPP_INCLUDED - - #ifndef CATCH_REPORTER_REGISTRY_HPP_INCLUDED #define CATCH_REPORTER_REGISTRY_HPP_INCLUDED @@ -8133,10 +8777,10 @@ namespace Catch { ReporterRegistry(); ~ReporterRegistry() override; // = default, out of line to allow fwd decl - IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const override; + IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const override; void registerReporter( std::string const& name, IReporterFactoryPtr factory ); - void registerListener( IReporterFactoryPtr factory ); + void registerListener( Detail::unique_ptr<EventListenerFactory> factory ); FactoryMap const& getFactories() const override; Listeners const& getListeners() const override; @@ -8161,7 +8805,6 @@ namespace Catch { #include <string> #include <vector> -#include <memory> namespace Catch { namespace TestCaseTracking { @@ -8179,19 +8822,31 @@ namespace TestCaseTracking { class ITracker; - using ITrackerPtr = std::shared_ptr<ITracker>; + using ITrackerPtr = Catch::Detail::unique_ptr<ITracker>; - class ITracker { + class ITracker { NameAndLocation m_nameAndLocation; using Children = std::vector<ITrackerPtr>; protected: + enum CycleState { + NotStarted, + Executing, + ExecutingChildren, + NeedsAnotherRun, + CompletedSuccessfully, + Failed + }; + + ITracker* m_parent = nullptr; Children m_children; + CycleState m_runState = NotStarted; public: - ITracker(NameAndLocation const& nameAndLoc) : - m_nameAndLocation(nameAndLoc) + ITracker( NameAndLocation const& nameAndLoc, ITracker* parent ): + m_nameAndLocation( nameAndLoc ), + m_parent( parent ) {} @@ -8199,42 +8854,60 @@ namespace TestCaseTracking { NameAndLocation const& nameAndLocation() const { return m_nameAndLocation; } + ITracker* parent() const { + return m_parent; + } - virtual ~ITracker(); + virtual ~ITracker(); // = default // 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 hasStarted() const = 0; - virtual ITracker& parent() = 0; + //! Returns true if tracker run to completion (successfully or not) + virtual bool isComplete() const = 0; + //! Returns true if tracker run to completion succesfully + bool isSuccessfullyCompleted() const; + //! Returns true if tracker has started but hasn't been completed + bool isOpen() const; + //! Returns true iff tracker has started + bool hasStarted() const; // actions virtual void close() = 0; // Successfully complete virtual void fail() = 0; - virtual void markAsNeedingAnotherRun() = 0; + void markAsNeedingAnotherRun(); //! Register a nested ITracker - void addChild( ITrackerPtr const& child ); + void addChild( ITrackerPtr&& child ); /** * Returns ptr to specific child if register with this tracker. * * Returns nullptr if not found. */ - ITrackerPtr findChild( NameAndLocation const& nameAndLocation ); + ITracker* findChild( NameAndLocation const& nameAndLocation ); //! Have any children been added? bool hasChildren() const { return !m_children.empty(); } - virtual void openChild() = 0; + //! Marks tracker as executing a child, doing se recursively up the tree + void openChild(); - // Debug/ checking - virtual bool isSectionTracker() const = 0; - virtual bool isGeneratorTracker() const = 0; + /** + * Returns true if the instance is a section tracker + * + * Subclasses should override to true if they are, replaces RTTI + * for internal debug checks. + */ + virtual bool isSectionTracker() const; + /** + * Returns true if the instance is a generator tracker + * + * Subclasses should override to true if they are, replaces RTTI + * for internal debug checks. + */ + virtual bool isGeneratorTracker() const; }; class TrackerContext { @@ -8264,41 +8937,18 @@ namespace TestCaseTracking { class TrackerBase : public ITracker { protected: - enum CycleState { - NotStarted, - Executing, - ExecutingChildren, - NeedsAnotherRun, - CompletedSuccessfully, - Failed - }; TrackerContext& m_ctx; - ITracker* m_parent; - CycleState m_runState = NotStarted; public: TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ); bool isComplete() const override; - bool isSuccessfullyCompleted() const override; - bool isOpen() const override; - bool hasStarted() const override { - return m_runState != NotStarted; - } - - 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(); @@ -8306,7 +8956,7 @@ namespace TestCaseTracking { }; class SectionTracker : public TrackerBase { - std::vector<std::string> m_filters; + std::vector<StringRef> m_filters; std::string m_trimmed_name; public: SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ); @@ -8320,7 +8970,11 @@ namespace TestCaseTracking { void tryOpen(); void addInitialFilters( std::vector<std::string> const& filters ); - void addNextFilters( std::vector<std::string> const& filters ); + void addNextFilters( std::vector<StringRef> const& filters ); + //! Returns filters active in this tracker + std::vector<StringRef> const& getFilters() const; + //! Returns whitespace-trimmed name of the tracked section + StringRef trimmedName() const; }; } // namespace TestCaseTracking @@ -8337,25 +8991,22 @@ using TestCaseTracking::SectionTracker; namespace Catch { - struct IMutableContext; - struct IGeneratorTracker; - struct IConfig; + class IMutableContext; + class IGeneratorTracker; + class IConfig; /////////////////////////////////////////////////////////////////////////// - class RunContext : public IResultCapture, public IRunner { + class RunContext : public IResultCapture { public: RunContext( RunContext const& ) = delete; RunContext& operator =( RunContext const& ) = delete; - explicit RunContext( IConfig const* _config, IStreamingReporterPtr&& reporter ); + explicit RunContext( IConfig const* _config, IEventListenerPtr&& 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(TestCaseHandle const& testCase); public: // IResultCapture @@ -8368,7 +9019,7 @@ namespace Catch { void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef const& message, + StringRef message, AssertionReaction& reaction ) override; void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, @@ -8391,10 +9042,10 @@ namespace Catch { auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override; - void benchmarkPreparing( std::string const& name ) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting( BenchmarkInfo const& info ) override; void benchmarkEnded( BenchmarkStats<> const& stats ) override; - void benchmarkFailed( std::string const& error ) override; + void benchmarkFailed( StringRef error ) override; void pushScopedMessage( MessageInfo const& message ) override; void popScopedMessage( MessageInfo const& message ) override; @@ -8415,7 +9066,7 @@ namespace Catch { public: // !TBD We need to do this another way! - bool aborting() const override; + bool aborting() const; private: @@ -8442,27 +9093,63 @@ namespace Catch { IMutableContext& m_context; TestCaseHandle const* m_activeTestCase = nullptr; ITracker* m_testCaseTracker = nullptr; - Option<AssertionResult> m_lastResult; + Optional<AssertionResult> m_lastResult; IConfig const* m_config; Totals m_totals; - IStreamingReporterPtr m_reporter; + IEventListenerPtr 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; + FatalConditionHandler m_fatalConditionhandler; bool m_lastAssertionPassed = false; bool m_shouldReportUnexpected = true; bool m_includeSuccessfulResults; }; - void seedRng(IConfig const& config); - unsigned int rngSeed(); -} // end namespace Catch + void seedRng(IConfig const& config); + unsigned int rngSeed(); +} // end namespace Catch + +#endif // CATCH_RUN_CONTEXT_HPP_INCLUDED + + +#ifndef CATCH_SHARDING_HPP_INCLUDED +#define CATCH_SHARDING_HPP_INCLUDED + + +#include <cmath> + +namespace Catch { + + template<typename Container> + Container createShard(Container const& container, std::size_t const shardCount, std::size_t const shardIndex) { + assert(shardCount > shardIndex); + + if (shardCount == 1) { + return container; + } + + const std::size_t totalTestCount = container.size(); + + const std::size_t shardSize = totalTestCount / shardCount; + const std::size_t leftoverTests = totalTestCount % shardCount; + + const std::size_t startIndex = shardIndex * shardSize + (std::min)(shardIndex, leftoverTests); + const std::size_t endIndex = (shardIndex + 1) * shardSize + (std::min)(shardIndex + 1, leftoverTests); + + auto startIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(startIndex)); + auto endIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(endIndex)); + + return Container(startIterator, endIterator); + } -#endif // CATCH_RUN_CONTEXT_HPP_INCLUDED +} + +#endif // CATCH_SHARDING_HPP_INCLUDED #ifndef CATCH_SINGLETONS_HPP_INCLUDED @@ -8471,7 +9158,7 @@ namespace Catch { namespace Catch { struct ISingleton { - virtual ~ISingleton(); + virtual ~ISingleton(); // = default }; @@ -8529,6 +9216,23 @@ namespace Catch { #endif // CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED + +#ifndef CATCH_STDSTREAMS_HPP_INCLUDED +#define CATCH_STDSTREAMS_HPP_INCLUDED + +#include <iosfwd> + +namespace Catch { + + std::ostream& cout(); + std::ostream& cerr(); + std::ostream& clog(); + +} // namespace Catch + +#endif + + #ifndef CATCH_STRING_MANIP_HPP_INCLUDED #define CATCH_STRING_MANIP_HPP_INCLUDED @@ -8540,12 +9244,13 @@ namespace Catch { namespace Catch { bool startsWith( std::string const& s, std::string const& prefix ); - bool startsWith( std::string const& s, char prefix ); + bool startsWith( StringRef 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 ); + char toLower( char c ); //! 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! @@ -8555,13 +9260,27 @@ namespace Catch { 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 ); + /** + * Helper for streaming a "count [maybe-plural-of-label]" human-friendly string + * + * Usage example: + * ```cpp + * std::cout << "Found " << pluralise(count, "error") << '\n'; + * ``` + * + * **Important:** The provided string must outlive the instance + */ + class pluralise { + std::uint64_t m_count; + StringRef m_label; + + public: + constexpr pluralise(std::uint64_t count, StringRef label): + m_count(count), + m_label(label) + {} friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ); - - std::size_t m_count; - std::string m_label; }; } @@ -8576,6 +9295,7 @@ namespace Catch { #include <string> namespace Catch { + struct SourceLineInfo; class TagAliasRegistry : public ITagAliasRegistry { public: @@ -8593,6 +9313,30 @@ namespace Catch { #endif // CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED +#ifndef CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED +#define CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED + +#include <cstdint> + +namespace Catch { + + struct TestCaseInfo; + + class TestCaseInfoHasher { + public: + using hash_t = std::uint64_t; + TestCaseInfoHasher( hash_t seed ); + uint32_t operator()( TestCaseInfo const& t ) const; + + private: + hash_t m_seed; + }; + +} // namespace Catch + +#endif /* CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED */ + + #ifndef CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED #define CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED @@ -8602,7 +9346,7 @@ namespace Catch { namespace Catch { class TestCaseHandle; - struct IConfig; + class IConfig; class TestSpec; std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases ); @@ -8649,9 +9393,6 @@ namespace Catch { void invoke() const override; }; - - std::string extractClassName( StringRef const& classOrQualifiedMethodName ); - /////////////////////////////////////////////////////////////////////////// @@ -8675,7 +9416,7 @@ namespace Catch { namespace Catch { - struct ITagAliasRegistry; + class ITagAliasRegistry; class TestSpecParser { enum Mode{ None, Name, QuotedName, Tag, EscapedName }; @@ -8749,31 +9490,49 @@ namespace Catch { class Columns; + /** + * Represents a column of text with specific width and indentation + * + * When written out to a stream, it will perform linebreaking + * of the provided text so that the written lines fit within + * target width. + */ class Column { + // String to be written out std::string m_string; + // Width of the column for linebreaking size_t m_width = CATCH_CONFIG_CONSOLE_WIDTH - 1; + // Indentation of other lines (including first if initial indent is unset) size_t m_indent = 0; + // Indentation of the first line size_t m_initialIndent = std::string::npos; public: - class iterator { + /** + * Iterates "lines" in `Column` and return sthem + */ + class const_iterator { friend Column; struct EndTag {}; Column const& m_column; - size_t m_pos = 0; - - size_t m_len = 0; - size_t m_end = 0; - bool m_suffix = false; - - iterator( Column const& column, EndTag ): - m_column( column ), m_pos( m_column.m_string.size() ) {} - + // Where does the current line start? + size_t m_lineStart = 0; + // How long should the current line be? + size_t m_lineLength = 0; + // How far have we checked the string to iterate? + size_t m_parsedTo = 0; + // Should a '-' be appended to the line? + bool m_addHyphen = false; + + const_iterator( Column const& column, EndTag ): + m_column( column ), m_lineStart( m_column.m_string.size() ) {} + + // Calculates the length of the current line void calcLength(); // Returns current indention width - size_t indent() const; + size_t indentSize() const; // Creates an indented and (optionally) suffixed string from // current iterator position, indentation and length. @@ -8787,21 +9546,21 @@ namespace Catch { using reference = value_type&; using iterator_category = std::forward_iterator_tag; - explicit iterator( Column const& column ); + explicit const_iterator( Column const& column ); std::string operator*() const; - iterator& operator++(); - iterator operator++( int ); + const_iterator& operator++(); + const_iterator operator++( int ); - bool operator==( iterator const& other ) const { - return m_pos == other.m_pos && &m_column == &other.m_column; + bool operator==( const_iterator const& other ) const { + return m_lineStart == other.m_lineStart && &m_column == &other.m_column; } - bool operator!=( iterator const& other ) const { + bool operator!=( const_iterator const& other ) const { return !operator==( other ); } }; - using const_iterator = iterator; + using iterator = const_iterator; explicit Column( std::string const& text ): m_string( text ) {} @@ -8820,8 +9579,8 @@ namespace Catch { } size_t width() const { return m_width; } - iterator begin() const { return iterator( *this ); } - iterator end() const { return { *this, iterator::EndTag{} }; } + const_iterator begin() const { return const_iterator( *this ); } + const_iterator end() const { return { *this, const_iterator::EndTag{} }; } friend std::ostream& operator<<( std::ostream& os, Column const& col ); @@ -8841,7 +9600,7 @@ namespace Catch { struct EndTag {}; std::vector<Column> const& m_columns; - std::vector<Column::iterator> m_iterators; + std::vector<Column::const_iterator> m_iterators; size_t m_activeIterators; iterator( Columns const& columns, EndTag ); @@ -8914,16 +9673,37 @@ namespace Catch { #endif // CATCH_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED -#ifndef CATCH_XMLWRITER_HPP_INCLUDED -#define CATCH_XMLWRITER_HPP_INCLUDED +#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED +#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED -// FixMe: Without this include (and something inside it), MSVC goes crazy -// and reports that calls to XmlEncode's op << are ambiguous between -// the declaration and definition. -// It also has to be in the header. +#if defined(CATCH_PLATFORM_WINDOWS) + +// We might end up with the define made globally through the compiler, +// and we don't want to trigger warnings for this +#if !defined(NOMINMAX) +# define NOMINMAX +#endif +#if !defined(WIN32_LEAN_AND_MEAN) +# define WIN32_LEAN_AND_MEAN +#endif + +#ifdef __AFXDLL +#include <AfxWin.h> +#else +#include <windows.h> +#endif + +#endif // defined(CATCH_PLATFORM_WINDOWS) + +#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED +#ifndef CATCH_XMLWRITER_HPP_INCLUDED +#define CATCH_XMLWRITER_HPP_INCLUDED + + +#include <iosfwd> #include <vector> namespace Catch { @@ -8936,18 +9716,24 @@ namespace Catch { XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs); XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs); + /** + * Helper for XML-encoding text (escaping angle brackets, quotes, etc) + * + * Note: doesn't take ownership of passed strings, and thus the + * encoded string must outlive the encoding instance. + */ class XmlEncode { public: enum ForWhat { ForTextNodes, ForAttributes }; - XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes ); + XmlEncode( StringRef 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; + StringRef m_str; ForWhat m_forWhat; }; @@ -8963,20 +9749,32 @@ namespace Catch { ~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 ) { + ScopedElement& + writeText( StringRef text, + XmlFormatting fmt = XmlFormatting::Newline | + XmlFormatting::Indent ); + + ScopedElement& writeAttribute( StringRef name, + StringRef attribute ); + template <typename T, + // Without this SFINAE, this overload is a better match + // for `std::string`, `char const*`, `char const[N]` args. + // While it would still work, it would cause code bloat + // and multiple iteration over the strings + typename = typename std::enable_if_t< + !std::is_convertible<T, StringRef>::value>> + ScopedElement& writeAttribute( StringRef name, + T const& attribute ) { m_writer->writeAttribute( name, attribute ); return *this; } private: - mutable XmlWriter* m_writer = nullptr; + XmlWriter* m_writer = nullptr; XmlFormatting m_fmt; }; - XmlWriter( std::ostream& os = Catch::cout() ); + XmlWriter( std::ostream& os ); ~XmlWriter(); XmlWriter( XmlWriter const& ) = delete; @@ -8988,24 +9786,41 @@ namespace Catch { 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 ) { + //! The attribute content is XML-encoded + XmlWriter& writeAttribute( StringRef name, StringRef attribute ); + + //! Writes the attribute as "true/false" + XmlWriter& writeAttribute( StringRef name, bool attribute ); + + //! The attribute content is XML-encoded + XmlWriter& writeAttribute( StringRef name, char const* attribute ); + + //! The attribute value must provide op<<(ostream&, T). The resulting + //! serialization is XML-encoded + template <typename T, + // Without this SFINAE, this overload is a better match + // for `std::string`, `char const*`, `char const[N]` args. + // While it would still work, it would cause code bloat + // and multiple iteration over the strings + typename = typename std::enable_if_t< + !std::is_convertible<T, StringRef>::value>> + XmlWriter& writeAttribute( StringRef 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); + //! Writes escaped `text` in a element + XmlWriter& writeText( StringRef text, + XmlFormatting fmt = XmlFormatting::Newline | + XmlFormatting::Indent ); - void writeStylesheetRef( std::string const& url ); + //! Writes XML comment as "<!-- text -->" + XmlWriter& writeComment( StringRef text, + XmlFormatting fmt = XmlFormatting::Newline | + XmlFormatting::Indent ); - XmlWriter& writeBlankLine(); + void writeStylesheetRef( StringRef url ); void ensureTagClosed(); @@ -9063,35 +9878,32 @@ namespace Catch { MatcherT const& m_matcher; StringRef m_matcherString; public: - MatchExpr( ArgT && arg, MatcherT const& matcher, StringRef const& matcherString ) + MatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString ) : ITransientExpression{ true, matcher.match( arg ) }, // not forwarding arg here on purpose - m_arg( std::forward<ArgT>(arg) ), + m_arg( CATCH_FORWARD(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; + void streamReconstructedExpression( std::ostream& os ) const override { + os << Catch::Detail::stringify( m_arg ) + << ' ' + << m_matcher.toString(); } }; namespace Matchers { template <typename ArgT> - struct MatcherBase; + class MatcherBase; } using StringMatcher = Matchers::MatcherBase<std::string>; - void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ); + void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ); template<typename ArgT, typename MatcherT> - auto makeMatchExpr( ArgT && arg, MatcherT const& matcher, StringRef const& matcherString ) -> MatchExpr<ArgT, MatcherT> { - return MatchExpr<ArgT, MatcherT>( std::forward<ArgT>(arg), matcher, matcherString ); + auto makeMatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString ) -> MatchExpr<ArgT, MatcherT> { + return MatchExpr<ArgT, MatcherT>( CATCH_FORWARD(arg), matcher, matcherString ); } } // namespace Catch @@ -9155,27 +9967,20 @@ namespace Matchers { 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; - }; - -#ifdef __clang__ -# pragma clang diagnostic pop -#endif template<typename T> - struct MatcherBase : MatcherUntypedBase, MatcherMethod<T> {}; + class MatcherBase : public MatcherUntypedBase { + public: + virtual bool match( T const& arg ) const = 0; + }; namespace Detail { template<typename ArgT> - struct MatchAllOf final : MatcherBase<ArgT> { + class MatchAllOf final : public MatcherBase<ArgT> { + std::vector<MatcherBase<ArgT> const*> m_matchers; + + public: MatchAllOf() = default; MatchAllOf(MatchAllOf const&) = delete; MatchAllOf& operator=(MatchAllOf const&) = delete; @@ -9208,15 +10013,12 @@ namespace Matchers { friend MatchAllOf operator&& (MatchAllOf&& lhs, MatcherBase<ArgT> const& rhs) { lhs.m_matchers.push_back(&rhs); - return std::move(lhs); + return CATCH_MOVE(lhs); } friend MatchAllOf operator&& (MatcherBase<ArgT> const& lhs, MatchAllOf&& rhs) { rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs); - return std::move(rhs); + return CATCH_MOVE(rhs); } - - private: - std::vector<MatcherBase<ArgT> const*> m_matchers; }; //! lvalue overload is intentionally deleted, users should @@ -9229,7 +10031,9 @@ namespace Matchers { MatchAllOf<ArgT> operator&& (MatcherBase<ArgT> const& lhs, MatchAllOf<ArgT> const& rhs) = delete; template<typename ArgT> - struct MatchAnyOf final : MatcherBase<ArgT> { + class MatchAnyOf final : public MatcherBase<ArgT> { + std::vector<MatcherBase<ArgT> const*> m_matchers; + public: MatchAnyOf() = default; MatchAnyOf(MatchAnyOf const&) = delete; MatchAnyOf& operator=(MatchAnyOf const&) = delete; @@ -9261,15 +10065,12 @@ namespace Matchers { friend MatchAnyOf operator|| (MatchAnyOf&& lhs, MatcherBase<ArgT> const& rhs) { lhs.m_matchers.push_back(&rhs); - return std::move(lhs); + return CATCH_MOVE(lhs); } friend MatchAnyOf operator|| (MatcherBase<ArgT> const& lhs, MatchAnyOf&& rhs) { rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs); - return std::move(rhs); + return CATCH_MOVE(rhs); } - - private: - std::vector<MatcherBase<ArgT> const*> m_matchers; }; //! lvalue overload is intentionally deleted, users should @@ -9282,8 +10083,10 @@ namespace Matchers { MatchAnyOf<ArgT> operator|| (MatcherBase<ArgT> const& lhs, MatchAnyOf<ArgT> const& rhs) = delete; template<typename ArgT> - struct MatchNotOf final : MatcherBase<ArgT> { + class MatchNotOf final : public MatcherBase<ArgT> { + MatcherBase<ArgT> const& m_underlyingMatcher; + public: explicit MatchNotOf( MatcherBase<ArgT> const& underlyingMatcher ): m_underlyingMatcher( underlyingMatcher ) {} @@ -9295,9 +10098,6 @@ namespace Matchers { std::string describe() const override { return "not " + m_underlyingMatcher.toString(); } - - private: - MatcherBase<ArgT> const& m_underlyingMatcher; }; } // namespace Detail @@ -9382,13 +10182,13 @@ namespace Matchers { #include <algorithm> #include <string> #include <type_traits> -#include <utility> namespace Catch { namespace Matchers { - struct MatcherGenericBase : MatcherUntypedBase { + class MatcherGenericBase : public MatcherUntypedBase { + public: MatcherGenericBase() = default; - virtual ~MatcherGenericBase(); // = default; + ~MatcherGenericBase() override; // = default; MatcherGenericBase(MatcherGenericBase&) = default; MatcherGenericBase(MatcherGenericBase&&) = default; @@ -9422,11 +10222,11 @@ namespace Matchers { return arr; } - #ifdef CATCH_CPP17_OR_GREATER +#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510 using std::conjunction; - #else // CATCH_CPP17_OR_GREATER +#else // __cpp_lib_logical_traits template<typename... Cond> struct conjunction : std::true_type {}; @@ -9434,7 +10234,7 @@ namespace Matchers { template<typename Cond, typename... Rest> struct conjunction<Cond, Rest...> : std::integral_constant<bool, Cond::value && conjunction<Rest...>::value> {}; - #endif // CATCH_CPP17_OR_GREATER +#endif // __cpp_lib_logical_traits template<typename T> using is_generic_matcher = std::is_base_of< @@ -9486,7 +10286,8 @@ namespace Matchers { template<typename... MatcherTs> - struct MatchAllOfGeneric final : MatcherGenericBase { + class MatchAllOfGeneric final : public MatcherGenericBase { + public: MatchAllOfGeneric(MatchAllOfGeneric const&) = delete; MatchAllOfGeneric& operator=(MatchAllOfGeneric const&) = delete; MatchAllOfGeneric(MatchAllOfGeneric&&) = default; @@ -9504,7 +10305,11 @@ namespace Matchers { return describe_multi_matcher<MatcherTs...>(" and "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{}); } - std::array<void const*, sizeof...(MatcherTs)> m_matchers; + // Has to be public to enable the concatenating operators + // below, because they are not friend of the RHS, only LHS, + // and thus cannot access private fields of RHS + std::array<void const*, sizeof...( MatcherTs )> m_matchers; + //! Avoids type nesting for `GenericAllOf && GenericAllOf` case template<typename... MatchersRHS> @@ -9512,7 +10317,7 @@ namespace Matchers { MatchAllOfGeneric<MatcherTs..., MatchersRHS...> operator && ( MatchAllOfGeneric<MatcherTs...>&& lhs, MatchAllOfGeneric<MatchersRHS...>&& rhs) { - return MatchAllOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(std::move(lhs.m_matchers), std::move(rhs.m_matchers))}; + return MatchAllOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(CATCH_MOVE(lhs.m_matchers), CATCH_MOVE(rhs.m_matchers))}; } //! Avoids type nesting for `GenericAllOf && some matcher` case @@ -9521,7 +10326,7 @@ namespace Matchers { MatchAllOfGeneric<MatcherTs..., MatcherRHS>> operator && ( MatchAllOfGeneric<MatcherTs...>&& lhs, MatcherRHS const& rhs) { - return MatchAllOfGeneric<MatcherTs..., MatcherRHS>{array_cat(std::move(lhs.m_matchers), static_cast<void const*>(&rhs))}; + return MatchAllOfGeneric<MatcherTs..., MatcherRHS>{array_cat(CATCH_MOVE(lhs.m_matchers), static_cast<void const*>(&rhs))}; } //! Avoids type nesting for `some matcher && GenericAllOf` case @@ -9530,13 +10335,14 @@ namespace Matchers { MatchAllOfGeneric<MatcherLHS, MatcherTs...>> operator && ( MatcherLHS const& lhs, MatchAllOfGeneric<MatcherTs...>&& rhs) { - return MatchAllOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), std::move(rhs.m_matchers))}; + return MatchAllOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), CATCH_MOVE(rhs.m_matchers))}; } }; template<typename... MatcherTs> - struct MatchAnyOfGeneric final : MatcherGenericBase { + class MatchAnyOfGeneric final : public MatcherGenericBase { + public: MatchAnyOfGeneric(MatchAnyOfGeneric const&) = delete; MatchAnyOfGeneric& operator=(MatchAnyOfGeneric const&) = delete; MatchAnyOfGeneric(MatchAnyOfGeneric&&) = default; @@ -9554,14 +10360,18 @@ namespace Matchers { return describe_multi_matcher<MatcherTs...>(" or "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{}); } - std::array<void const*, sizeof...(MatcherTs)> m_matchers; + + // Has to be public to enable the concatenating operators + // below, because they are not friend of the RHS, only LHS, + // and thus cannot access private fields of RHS + std::array<void const*, sizeof...( MatcherTs )> m_matchers; //! Avoids type nesting for `GenericAnyOf || GenericAnyOf` case template<typename... MatchersRHS> friend MatchAnyOfGeneric<MatcherTs..., MatchersRHS...> operator || ( MatchAnyOfGeneric<MatcherTs...>&& lhs, MatchAnyOfGeneric<MatchersRHS...>&& rhs) { - return MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(std::move(lhs.m_matchers), std::move(rhs.m_matchers))}; + return MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(CATCH_MOVE(lhs.m_matchers), CATCH_MOVE(rhs.m_matchers))}; } //! Avoids type nesting for `GenericAnyOf || some matcher` case @@ -9570,7 +10380,7 @@ namespace Matchers { MatchAnyOfGeneric<MatcherTs..., MatcherRHS>> operator || ( MatchAnyOfGeneric<MatcherTs...>&& lhs, MatcherRHS const& rhs) { - return MatchAnyOfGeneric<MatcherTs..., MatcherRHS>{array_cat(std::move(lhs.m_matchers), static_cast<void const*>(std::addressof(rhs)))}; + return MatchAnyOfGeneric<MatcherTs..., MatcherRHS>{array_cat(CATCH_MOVE(lhs.m_matchers), static_cast<void const*>(std::addressof(rhs)))}; } //! Avoids type nesting for `some matcher || GenericAnyOf` case @@ -9579,13 +10389,16 @@ namespace Matchers { MatchAnyOfGeneric<MatcherLHS, MatcherTs...>> operator || ( MatcherLHS const& lhs, MatchAnyOfGeneric<MatcherTs...>&& rhs) { - return MatchAnyOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), std::move(rhs.m_matchers))}; + return MatchAnyOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), CATCH_MOVE(rhs.m_matchers))}; } }; template<typename MatcherT> - struct MatchNotOfGeneric final : MatcherGenericBase { + class MatchNotOfGeneric final : public MatcherGenericBase { + MatcherT const& m_matcher; + + public: MatchNotOfGeneric(MatchNotOfGeneric const&) = delete; MatchNotOfGeneric& operator=(MatchNotOfGeneric const&) = delete; MatchNotOfGeneric(MatchNotOfGeneric&&) = default; @@ -9606,8 +10419,6 @@ namespace Matchers { friend MatcherT const& operator ! (MatchNotOfGeneric<MatcherT> const& matcher) { return matcher.m_matcher; } - private: - MatcherT const& m_matcher; }; } // namespace Detail @@ -9668,7 +10479,6 @@ namespace Catch { class IsEmptyMatcher final : public MatcherGenericBase { public: - // todo: Use polyfills template <typename RangeLike> bool match(RangeLike&& rng) const { #if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS) @@ -9707,7 +10517,7 @@ namespace Catch { Matcher m_matcher; public: explicit SizeMatchesMatcher(Matcher m): - m_matcher(std::move(m)) + m_matcher(CATCH_MOVE(m)) {} template <typename RangeLike> @@ -9733,7 +10543,7 @@ namespace Catch { template <typename Matcher> std::enable_if_t<Detail::is_matcher<Matcher>::value, SizeMatchesMatcher<Matcher>> SizeIs(Matcher&& m) { - return SizeMatchesMatcher<Matcher>{std::forward<Matcher>(m)}; + return SizeMatchesMatcher<Matcher>{CATCH_FORWARD(m)}; } } // end namespace Matchers @@ -9748,7 +10558,6 @@ namespace Catch { #include <algorithm> #include <functional> -#include <utility> namespace Catch { namespace Matchers { @@ -9760,8 +10569,8 @@ namespace Catch { public: template <typename T2, typename Equality2> ContainsElementMatcher(T2&& target, Equality2&& predicate): - m_desired(std::forward<T2>(target)), - m_eq(std::forward<Equality2>(predicate)) + m_desired(CATCH_FORWARD(target)), + m_eq(CATCH_FORWARD(predicate)) {} std::string describe() const override { @@ -9788,12 +10597,11 @@ namespace Catch { // constructor (and also avoid some perfect forwarding failure // cases) ContainsMatcherMatcher(Matcher matcher): - m_matcher(std::move(matcher)) + m_matcher(CATCH_MOVE(matcher)) {} template <typename RangeLike> bool match(RangeLike&& rng) const { - using std::begin; using std::endl; for (auto&& elem : rng) { if (m_matcher.match(elem)) { return true; @@ -9815,14 +10623,14 @@ namespace Catch { template <typename T> std::enable_if_t<!Detail::is_matcher<T>::value, ContainsElementMatcher<T, std::equal_to<>>> Contains(T&& elem) { - return { std::forward<T>(elem), std::equal_to<>{} }; + return { CATCH_FORWARD(elem), std::equal_to<>{} }; } //! Creates a matcher that checks whether a range contains element matching a matcher template <typename Matcher> std::enable_if_t<Detail::is_matcher<Matcher>::value, ContainsMatcherMatcher<Matcher>> Contains(Matcher&& matcher) { - return { std::forward<Matcher>(matcher) }; + return { CATCH_FORWARD(matcher) }; } /** @@ -9832,7 +10640,7 @@ namespace Catch { */ template <typename T, typename Equality> ContainsElementMatcher<T, Equality> Contains(T&& elem, Equality&& eq) { - return { std::forward<T>(elem), std::forward<Equality>(eq) }; + return { CATCH_FORWARD(elem), CATCH_FORWARD(eq) }; } } @@ -9870,8 +10678,8 @@ ExceptionMessageMatcher Message(std::string const& message); #endif // CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED -#ifndef CATCH_MATCHERS_FLOATING_HPP_INCLUDED -#define CATCH_MATCHERS_FLOATING_HPP_INCLUDED +#ifndef CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED +#define CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED namespace Catch { @@ -9881,7 +10689,8 @@ namespace Matchers { enum class FloatingPointKind : uint8_t; } - struct WithinAbsMatcher final : MatcherBase<double> { + class WithinAbsMatcher final : public MatcherBase<double> { + public: WithinAbsMatcher(double target, double margin); bool match(double const& matchee) const override; std::string describe() const override; @@ -9890,8 +10699,11 @@ namespace Matchers { double m_margin; }; - struct WithinUlpsMatcher final : MatcherBase<double> { - WithinUlpsMatcher(double target, uint64_t ulps, Detail::FloatingPointKind baseType); + class WithinUlpsMatcher final : public MatcherBase<double> { + public: + WithinUlpsMatcher( double target, + uint64_t ulps, + Detail::FloatingPointKind baseType ); bool match(double const& matchee) const override; std::string describe() const override; private: @@ -9906,8 +10718,9 @@ namespace Matchers { // |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 final : MatcherBase<double> { - WithinRelMatcher(double target, double epsilon); + class WithinRelMatcher final : public MatcherBase<double> { + public: + WithinRelMatcher( double target, double epsilon ); bool match(double const& matchee) const override; std::string describe() const override; private: @@ -9934,7 +10747,7 @@ namespace Matchers { } // namespace Matchers } // namespace Catch -#endif // CATCH_MATCHERS_FLOATING_HPP_INCLUDED +#endif // CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED #ifndef CATCH_MATCHERS_PREDICATE_HPP_INCLUDED @@ -9942,7 +10755,6 @@ namespace Matchers { #include <string> -#include <utility> namespace Catch { namespace Matchers { @@ -9958,7 +10770,7 @@ class PredicateMatcher final : public MatcherBase<T> { public: PredicateMatcher(Predicate&& elem, std::string const& descr) - :m_predicate(std::forward<Predicate>(elem)), + :m_predicate(CATCH_FORWARD(elem)), m_description(Detail::finalizeDescription(descr)) {} @@ -9980,7 +10792,7 @@ public: PredicateMatcher<T, Pred> Predicate(Pred&& predicate, std::string const& description = "") { static_assert(is_callable<Pred(T)>::value, "Predicate not callable with argument T"); static_assert(std::is_same<bool, FunctionReturnType<Pred, T>>::value, "Predicate does not return bool"); - return PredicateMatcher<T, Pred>(std::forward<Pred>(predicate), description); + return PredicateMatcher<T, Pred>(CATCH_FORWARD(predicate), description); } } // namespace Matchers @@ -9989,6 +10801,164 @@ public: #endif // CATCH_MATCHERS_PREDICATE_HPP_INCLUDED +#ifndef CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED +#define CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED + + +namespace Catch { + namespace Matchers { + // Matcher for checking that all elements in range matches a given matcher. + template <typename Matcher> + class AllMatchMatcher final : public MatcherGenericBase { + Matcher m_matcher; + public: + AllMatchMatcher(Matcher matcher): + m_matcher(CATCH_MOVE(matcher)) + {} + + std::string describe() const override { + return "all match " + m_matcher.describe(); + } + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (!m_matcher.match(elem)) { + return false; + } + } + return true; + } + }; + + // Matcher for checking that no element in range matches a given matcher. + template <typename Matcher> + class NoneMatchMatcher final : public MatcherGenericBase { + Matcher m_matcher; + public: + NoneMatchMatcher(Matcher matcher): + m_matcher(CATCH_MOVE(matcher)) + {} + + std::string describe() const override { + return "none match " + m_matcher.describe(); + } + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (m_matcher.match(elem)) { + return false; + } + } + return true; + } + }; + + // Matcher for checking that at least one element in range matches a given matcher. + template <typename Matcher> + class AnyMatchMatcher final : public MatcherGenericBase { + Matcher m_matcher; + public: + AnyMatchMatcher(Matcher matcher): + m_matcher(CATCH_MOVE(matcher)) + {} + + std::string describe() const override { + return "any match " + m_matcher.describe(); + } + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (m_matcher.match(elem)) { + return true; + } + } + return false; + } + }; + + // Matcher for checking that all elements in range are true. + class AllTrueMatcher final : public MatcherGenericBase { + public: + std::string describe() const override; + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (!elem) { + return false; + } + } + return true; + } + }; + + // Matcher for checking that no element in range is true. + class NoneTrueMatcher final : public MatcherGenericBase { + public: + std::string describe() const override; + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (elem) { + return false; + } + } + return true; + } + }; + + // Matcher for checking that any element in range is true. + class AnyTrueMatcher final : public MatcherGenericBase { + public: + std::string describe() const override; + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (elem) { + return true; + } + } + return false; + } + }; + + // Creates a matcher that checks whether all elements in a range match a matcher + template <typename Matcher> + AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) { + return { CATCH_FORWARD(matcher) }; + } + + // Creates a matcher that checks whether no element in a range matches a matcher. + template <typename Matcher> + NoneMatchMatcher<Matcher> NoneMatch(Matcher&& matcher) { + return { CATCH_FORWARD(matcher) }; + } + + // Creates a matcher that checks whether any element in a range matches a matcher. + template <typename Matcher> + AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) { + return { CATCH_FORWARD(matcher) }; + } + + // Creates a matcher that checks whether all elements in a range are true + AllTrueMatcher AllTrue(); + + // Creates a matcher that checks whether no element in a range is true + NoneTrueMatcher NoneTrue(); + + // Creates a matcher that checks whether any element in a range is true + AnyTrueMatcher AnyTrue(); + } +} + +#endif // CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED + + #ifndef CATCH_MATCHERS_STRING_HPP_INCLUDED #define CATCH_MATCHERS_STRING_HPP_INCLUDED @@ -10007,45 +10977,52 @@ namespace Matchers { std::string m_str; }; - struct StringMatcherBase : MatcherBase<std::string> { - StringMatcherBase( std::string const& operation, CasedString const& comparator ); - std::string describe() const override; - + class StringMatcherBase : public MatcherBase<std::string> { + protected: CasedString m_comparator; - std::string m_operation; + StringRef m_operation; + + public: + StringMatcherBase( StringRef operation, + CasedString const& comparator ); + std::string describe() const override; }; - struct StringEqualsMatcher final : StringMatcherBase { + class StringEqualsMatcher final : public StringMatcherBase { + public: StringEqualsMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct StringContainsMatcher final : StringMatcherBase { + class StringContainsMatcher final : public StringMatcherBase { + public: StringContainsMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct StartsWithMatcher final : StringMatcherBase { + class StartsWithMatcher final : public StringMatcherBase { + public: StartsWithMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct EndsWithMatcher final : StringMatcherBase { + class EndsWithMatcher final : public StringMatcherBase { + public: EndsWithMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct RegexMatcher final : MatcherBase<std::string> { + class RegexMatcher final : public MatcherBase<std::string> { + std::string m_regex; + CaseSensitive m_caseSensitivity; + + public: RegexMatcher( std::string regex, CaseSensitive caseSensitivity ); bool match( std::string const& matchee ) const override; std::string describe() const override; - - private: - std::string m_regex; - CaseSensitive m_caseSensitivity; }; //! Creates matcher that accepts strings that are exactly equal to `str` StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that contain `str` - StringContainsMatcher Contains( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); + StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that _end_ with `str` EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that _start_ with `str` @@ -10069,8 +11046,10 @@ namespace Catch { namespace Matchers { template<typename T, typename Alloc> - struct VectorContainsElementMatcher final : MatcherBase<std::vector<T, Alloc>> { + class VectorContainsElementMatcher final : public MatcherBase<std::vector<T, Alloc>> { + T const& m_comparator; + public: VectorContainsElementMatcher(T const& comparator): m_comparator(comparator) {} @@ -10087,13 +11066,13 @@ namespace Matchers { std::string describe() const override { return "Contains: " + ::Catch::Detail::stringify( m_comparator ); } - - T const& m_comparator; }; template<typename T, typename AllocComp, typename AllocMatch> - struct ContainsMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class ContainsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_comparator; + public: ContainsMatcher(std::vector<T, AllocComp> const& comparator): m_comparator( comparator ) {} @@ -10119,13 +11098,13 @@ namespace Matchers { std::string describe() const override { return "Contains: " + ::Catch::Detail::stringify( m_comparator ); } - - std::vector<T, AllocComp> const& m_comparator; }; template<typename T, typename AllocComp, typename AllocMatch> - struct EqualsMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class EqualsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_comparator; + public: EqualsMatcher(std::vector<T, AllocComp> const& comparator): m_comparator( comparator ) {} @@ -10145,12 +11124,14 @@ namespace Matchers { std::string describe() const override { return "Equals: " + ::Catch::Detail::stringify( m_comparator ); } - std::vector<T, AllocComp> const& m_comparator; }; template<typename T, typename AllocComp, typename AllocMatch> - struct ApproxMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class ApproxMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_comparator; + mutable Catch::Approx approx = Catch::Approx::custom(); + public: ApproxMatcher(std::vector<T, AllocComp> const& comparator): m_comparator( comparator ) {} @@ -10181,13 +11162,13 @@ namespace Matchers { approx.scale(static_cast<double>(newScale)); return *this; } - - std::vector<T, AllocComp> const& m_comparator; - mutable Catch::Approx approx = Catch::Approx::custom(); }; template<typename T, typename AllocComp, typename AllocMatch> - struct UnorderedEqualsMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class UnorderedEqualsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_target; + + public: UnorderedEqualsMatcher(std::vector<T, AllocComp> const& target): m_target(target) {} @@ -10201,15 +11182,12 @@ namespace Matchers { std::string describe() const override { return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target); } - private: - std::vector<T, AllocComp> const& m_target; }; // The following functions create the actual matcher objects. // This allows the types to be inferred - //! Creates a matcher that matches vectors that contain all elements in `comparator` template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp> ContainsMatcher<T, AllocComp, AllocMatch> Contains( std::vector<T, AllocComp> const& comparator ) { @@ -10276,58 +11254,120 @@ namespace Matchers { -#include <iosfwd> +#ifndef CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED +#define CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED + + +#include <map> #include <string> -#include <vector> namespace Catch { + class ColourImpl; - 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; - }; + /** + * This is the base class for all reporters. + * + * If are writing a reporter, you must derive from this type, or one + * of the helper reporter bases that are derived from this type. + * + * ReporterBase centralizes handling of various common tasks in reporters, + * like storing the right stream for the reporters to write to, and + * providing the default implementation of the different listing events. + */ + class ReporterBase : public IEventListener { + protected: + //! The stream wrapper as passed to us by outside code + Detail::unique_ptr<IStream> m_wrapped_stream; + //! Cached output stream from `m_wrapped_stream` to reduce + //! number of indirect calls needed to write output. + std::ostream& m_stream; + //! Colour implementation this reporter was configured for + Detail::unique_ptr<ColourImpl> m_colour; + //! The custom reporter options user passed down to the reporter + std::map<std::string, std::string> m_customOptions; + + public: + ReporterBase( ReporterConfig&& config ); + ~ReporterBase() override; // = default; + /** + * Provides a simple default listing of reporters. + * + * Should look roughly like the reporter listing in v2 and earlier + * versions of Catch2. + */ + void listReporters( + std::vector<ReporterDescription> const& descriptions ) override; + /** + * Provides a simple default listing of listeners + * + * Looks similarly to listing of reporters, but with listener type + * instead of reporter name. + */ + void listListeners( + std::vector<ListenerDescription> const& descriptions ) override; + /** + * Provides a simple default listing of tests. + * + * Should look roughly like the test listing in v2 and earlier versions + * of Catch2. Especially supports low-verbosity listing that mimics the + * old `--list-test-names-only` output. + */ + void listTests( std::vector<TestCaseHandle> const& tests ) override; + /** + * Provides a simple default listing of tags. + * + * Should look roughly like the tag listing in v2 and earlier versions + * of Catch2. + */ + void listTags( std::vector<TagInfo> const& tags ) override; + }; +} // namespace Catch - struct StreamingReporterBase : IStreamingReporter { +#endif // CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED - StreamingReporterBase( ReporterConfig const& _config ): - m_config( _config.fullConfig() ), stream( _config.stream() ) { - } +#include <vector> +namespace Catch { + class StreamingReporterBase : public ReporterBase { + public: + // GCC5 compat: we cannot use inherited constructor, because it + // doesn't implement backport of P0136 + StreamingReporterBase(ReporterConfig&& _config): + ReporterBase(CATCH_MOVE(_config)) + {} ~StreamingReporterBase() override; - void noMatchingTestCases(std::string const&) override {} + void benchmarkPreparing( StringRef ) override {} + void benchmarkStarting( BenchmarkInfo const& ) override {} + void benchmarkEnded( BenchmarkStats<> const& ) override {} + void benchmarkFailed( StringRef ) override {} - void reportInvalidArguments(std::string const&) override {} + void fatalErrorEncountered( StringRef /*error*/ ) override {} + void noMatchingTestCases( StringRef /*unmatchedSpec*/ ) override {} + void reportInvalidTestSpec( StringRef /*invalidArgument*/ ) override {} void testRunStarting( TestRunInfo const& _testRunInfo ) override; - void testGroupStarting( GroupInfo const& _groupInfo ) override; - void testCaseStarting(TestCaseInfo const& _testInfo) override { currentTestCaseInfo = &_testInfo; } + void testCasePartialStarting( TestCaseInfo const&, uint64_t ) override {} void sectionStarting(SectionInfo const& _sectionInfo) override { m_sectionStack.push_back(_sectionInfo); } + void assertionStarting( AssertionInfo const& ) override {} + void assertionEnded( AssertionStats const& ) override {} + void sectionEnded(SectionStats const& /* _sectionStats */) override { m_sectionStack.pop_back(); } + void testCasePartialEnded( TestCaseStats const&, uint64_t ) override {} void testCaseEnded(TestCaseStats const& /* _testCaseStats */) override { currentTestCaseInfo = nullptr; } - void testGroupEnded( TestGroupStats const& ) override; void testRunEnded( TestRunStats const& /* _testRunStats */ ) override; void skipTest(TestCaseInfo const&) override { @@ -10335,13 +11375,11 @@ namespace Catch { // It can optionally be overridden in the derived class. } - IConfig const* m_config; - std::ostream& stream; - - LazyStat<TestRunInfo> currentTestRunInfo; - LazyStat<GroupInfo> currentGroupInfo; + protected: + TestRunInfo currentTestRunInfo{ "test run has not started yet"_sr }; TestCaseInfo const* currentTestCaseInfo = nullptr; + //! Stack of all _active_ sections in the _current_ test case std::vector<SectionInfo> m_sectionStack; }; @@ -10349,13 +11387,17 @@ namespace Catch { #endif // CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED +#include <string> + namespace Catch { - struct AutomakeReporter : StreamingReporterBase { - AutomakeReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ) + class AutomakeReporter final : public StreamingReporterBase { + public: + // GCC5 compat: we cannot use inherited constructor, because it + // doesn't implement backport of P0136 + AutomakeReporter(ReporterConfig&& _config): + StreamingReporterBase(CATCH_MOVE(_config)) {} - ~AutomakeReporter() override; static std::string getDescription() { @@ -10363,14 +11405,8 @@ namespace Catch { return "Reports test results in the format of Automake .trs files"s; } - void assertionStarting( AssertionInfo const& ) override {} - - bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; } - void testCaseEnded(TestCaseStats const& _testCaseStats) override; - void skipTest(TestCaseInfo const& testInfo) override; - }; } // end namespace Catch @@ -10386,19 +11422,19 @@ namespace Catch { namespace Catch { - struct CompactReporter : StreamingReporterBase { - + class CompactReporter final : public StreamingReporterBase { + public: using StreamingReporterBase::StreamingReporterBase; ~CompactReporter() override; static std::string getDescription(); - void noMatchingTestCases(std::string const& spec) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; - void assertionStarting(AssertionInfo const&) override; + void testRunStarting( TestRunInfo const& _testInfo ) override; - bool assertionEnded(AssertionStats const& _assertionStats) override; + void assertionEnded(AssertionStats const& _assertionStats) override; void sectionEnded(SectionStats const& _sectionStats) override; @@ -10415,53 +11451,43 @@ namespace Catch { #define CATCH_REPORTER_CONSOLE_HPP_INCLUDED -#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 { + class ConsoleReporter final : public StreamingReporterBase { Detail::unique_ptr<TablePrinter> m_tablePrinter; - ConsoleReporter(ReporterConfig const& config); + public: + ConsoleReporter(ReporterConfig&& config); ~ConsoleReporter() override; static std::string getDescription(); - void noMatchingTestCases(std::string const& spec) override; - - void reportInvalidArguments(std::string const&arg) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; + void reportInvalidTestSpec( StringRef arg ) override; void assertionStarting(AssertionInfo const&) override; - bool assertionEnded(AssertionStats const& _assertionStats) override; + void assertionEnded(AssertionStats const& _assertionStats) override; void sectionStarting(SectionInfo const& _sectionInfo) override; void sectionEnded(SectionStats const& _sectionStats) override; - void benchmarkPreparing(std::string const& name) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting(BenchmarkInfo const& info) override; void benchmarkEnded(BenchmarkStats<> const& stats) override; - void benchmarkFailed(std::string const& error) override; + void benchmarkFailed( StringRef error ) override; 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: + private: void lazyPrint(); void lazyPrintWithoutClosingBenchmarkTable(); void lazyPrintRunInfo(); - void lazyPrintGroupInfo(); void printTestCaseAndSectionHeader(); void printClosedHeader(std::string const& _name); @@ -10473,22 +11499,17 @@ namespace Catch { void printTotals(Totals const& totals); - void printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row); + void printSummaryRow(StringRef label, std::vector<SummaryColumn> const& cols, std::size_t row); void printTotalsDivider(Totals const& totals); void printSummaryDivider(); - void printTestFilters(); - private: bool m_headerPrinted = false; + bool m_testRunInfoPrinted = false; }; } // end namespace Catch -#if defined(_MSC_VER) -#pragma warning(pop) -#endif - #endif // CATCH_REPORTER_CONSOLE_HPP_INCLUDED @@ -10496,20 +11517,59 @@ namespace Catch { #define CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED -#include <iosfwd> -#include <memory> #include <string> #include <vector> namespace Catch { - struct CumulativeReporterBase : IStreamingReporter { + namespace Detail { + + //! Represents either an assertion or a benchmark result to be handled by cumulative reporter later + class AssertionOrBenchmarkResult { + // This should really be a variant, but this is much faster + // to write and the data layout here is already terrible + // enough that we do not have to care about the object size. + Optional<AssertionStats> m_assertion; + Optional<BenchmarkStats<>> m_benchmark; + public: + AssertionOrBenchmarkResult(AssertionStats const& assertion); + AssertionOrBenchmarkResult(BenchmarkStats<> const& benchmark); + + bool isAssertion() const; + bool isBenchmark() const; + + AssertionStats const& asAssertion() const; + BenchmarkStats<> const& asBenchmark() const; + }; + } + + /** + * Utility base for reporters that need to handle all results at once + * + * It stores tree of all test cases, sections and assertions, and after the + * test run is finished, calls into `testRunEndedCumulative` to pass the + * control to the deriving class. + * + * If you are deriving from this class and override any testing related + * member functions, you should first call into the base's implementation to + * avoid breaking the tree construction. + * + * Due to the way this base functions, it has to expand assertions up-front, + * even if they are later unused (e.g. because the deriving reporter does + * not report successful assertions, or because the deriving reporter does + * not use assertion expansion at all). Derived classes can use two + * customization points, `m_shouldStoreSuccesfulAssertions` and + * `m_shouldStoreFailedAssertions`, to disable the expansion and gain extra + * performance. **Accessing the assertion expansions if it wasn't stored is + * UB.** + */ + class CumulativeReporterBase : public ReporterBase { + public: template<typename T, typename ChildNodeT> struct Node { explicit Node( T const& _value ) : value( _value ) {} - virtual ~Node() {} - using ChildNodes = std::vector<std::shared_ptr<ChildNodeT>>; + using ChildNodes = std::vector<Detail::unique_ptr<ChildNodeT>>; T value; ChildNodes children; }; @@ -10520,54 +11580,74 @@ namespace Catch { return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; } + bool hasAnyAssertions() const; + SectionStats stats; - using ChildSections = std::vector<std::shared_ptr<SectionNode>>; - using Assertions = std::vector<AssertionStats>; - ChildSections childSections; - Assertions assertions; + std::vector<Detail::unique_ptr<SectionNode>> childSections; + std::vector<Detail::AssertionOrBenchmarkResult> assertionsAndBenchmarks; std::string stdOut; std::string stdErr; }; using TestCaseNode = Node<TestCaseStats, SectionNode>; - using TestGroupNode = Node<TestGroupStats, TestCaseNode>; - using TestRunNode = Node<TestRunStats, TestGroupNode>; + using TestRunNode = Node<TestRunStats, TestCaseNode>; - CumulativeReporterBase( ReporterConfig const& _config ): - m_config( _config.fullConfig() ), stream( _config.stream() ) {} + // GCC5 compat: we cannot use inherited constructor, because it + // doesn't implement backport of P0136 + CumulativeReporterBase(ReporterConfig&& _config): + ReporterBase(CATCH_MOVE(_config)) + {} ~CumulativeReporterBase() override; + void benchmarkPreparing( StringRef ) override {} + void benchmarkStarting( BenchmarkInfo const& ) override {} + void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override; + void benchmarkFailed( StringRef ) override {} + + void noMatchingTestCases( StringRef ) override {} + void reportInvalidTestSpec( StringRef ) override {} + void fatalErrorEncountered( StringRef /*error*/ ) override {} + void testRunStarting( TestRunInfo const& ) override {} - void testGroupStarting( GroupInfo const& ) override {} void testCaseStarting( TestCaseInfo const& ) override {} - + void testCasePartialStarting( TestCaseInfo const&, uint64_t ) override {} void sectionStarting( SectionInfo const& sectionInfo ) override; void assertionStarting( AssertionInfo const& ) override {} - bool assertionEnded( AssertionStats const& assertionStats ) override; + void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; + void testCasePartialEnded( TestCaseStats const&, uint64_t ) override {} void testCaseEnded( TestCaseStats const& testCaseStats ) override; - void testGroupEnded( TestGroupStats const& testGroupStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; + //! Customization point: called after last test finishes (testRunEnded has been handled) virtual void testRunEndedCumulative() = 0; void skipTest(TestCaseInfo const&) override {} - IConfig const* 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; + protected: + //! Should the cumulative base store the assertion expansion for succesful assertions? + bool m_shouldStoreSuccesfulAssertions = true; + //! Should the cumulative base store the assertion expansion for failed assertions? + bool m_shouldStoreFailedAssertions = true; - std::vector<std::shared_ptr<TestRunNode>> m_testRuns; + // We need lazy construction here. We should probably refactor it + // later, after the events are redone. + //! The root node of the test run tree. + Detail::unique_ptr<TestRunNode> m_testRun; - std::shared_ptr<SectionNode> m_rootSection; - std::shared_ptr<SectionNode> m_deepestSection; - std::vector<std::shared_ptr<SectionNode>> m_sectionStack; + private: + // Note: We rely on pointer identity being stable, which is why + // we store pointers to the nodes rather than the values. + std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases; + // Root section of the _current_ test case + Detail::unique_ptr<SectionNode> m_rootSection; + // Deepest section of the _current_ test case + SectionNode* m_deepestSection = nullptr; + // Stack of _active_ sections in the _current_ test case + std::vector<SectionNode*> m_sectionStack; }; } // end namespace Catch @@ -10582,38 +11662,44 @@ namespace Catch { namespace Catch { /** - * Base class identifying listeners. + * Base class to simplify implementing listeners. * - * Provides default implementation for all IStreamingReporter member - * functions, so that listeners implementations can pick which + * Provides empty default implementation for all IEventListener member + * functions, so that a listener implementation can pick which * member functions it actually cares about. */ - class EventListenerBase : public IStreamingReporter { - IConfig const* m_config; - + class EventListenerBase : public IEventListener { public: - EventListenerBase( ReporterConfig const& config ): - m_config( config.fullConfig() ) {} + using IEventListener::IEventListener; + + void reportInvalidTestSpec( StringRef unmatchedSpec ) override; + void fatalErrorEncountered( StringRef error ) override; + + void benchmarkPreparing( StringRef name ) override; + void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override; + void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override; + void benchmarkFailed( StringRef error ) override; void assertionStarting( AssertionInfo const& assertionInfo ) override; - bool assertionEnded( AssertionStats const& assertionStats ) override; + void assertionEnded( AssertionStats const& assertionStats ) override; - void - listReporters( std::vector<ReporterDescription> const& descriptions, - IConfig const& config ) override; - void listTests( std::vector<TestCaseHandle> const& tests, - IConfig const& config ) override; - void listTags( std::vector<TagInfo> const& tagInfos, - IConfig const& config ) override; + void listReporters( + std::vector<ReporterDescription> const& descriptions ) override; + void listListeners( + std::vector<ListenerDescription> const& descriptions ) override; + void listTests( std::vector<TestCaseHandle> const& tests ) override; + void listTags( std::vector<TagInfo> const& tagInfos ) override; - void noMatchingTestCases( std::string const& spec ) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; void testRunStarting( TestRunInfo const& testRunInfo ) override; - void testGroupStarting( GroupInfo const& groupInfo ) override; void testCaseStarting( TestCaseInfo const& testInfo ) override; + void testCasePartialStarting( TestCaseInfo const& testInfo, + uint64_t partNumber ) override; void sectionStarting( SectionInfo const& sectionInfo ) override; void sectionEnded( SectionStats const& sectionStats ) override; + void testCasePartialEnded( TestCaseStats const& testCaseStats, + uint64_t partNumber ) 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; }; @@ -10630,9 +11716,12 @@ namespace Catch { #include <string> #include <vector> + namespace Catch { - struct IConfig; + class IConfig; + class TestCaseHandle; + class ColourImpl; // Returns double formatted as %.3f (format expected on output) std::string getFormattedDuration( double duration ); @@ -10649,6 +11738,50 @@ namespace Catch { friend std::ostream& operator<<( std::ostream& out, lineOfChars value ); }; + /** + * Lists reporter descriptions to the provided stream in user-friendly + * format + * + * Used as the default listing implementation by the first party reporter + * bases. The output should be backwards compatible with the output of + * Catch2 v2 binaries. + */ + void + defaultListReporters( std::ostream& out, + std::vector<ReporterDescription> const& descriptions, + Verbosity verbosity ); + + /** + * Lists listeners descriptions to the provided stream in user-friendly + * format + */ + void defaultListListeners( std::ostream& out, + std::vector<ListenerDescription> const& descriptions ); + + /** + * Lists tag information to the provided stream in user-friendly format + * + * Used as the default listing implementation by the first party reporter + * bases. The output should be backwards compatible with the output of + * Catch2 v2 binaries. + */ + void defaultListTags( std::ostream& out, std::vector<TagInfo> const& tags, bool isFiltered ); + + /** + * Lists test case information to the provided stream in user-friendly + * format + * + * Used as the default listing implementation by the first party reporter + * bases. The output is backwards compatible with the output of Catch2 + * v2 binaries, and also supports the format specific to the old + * `--list-test-names-only` option, for people who used it in integrations. + */ + void defaultListTests( std::ostream& out, + ColourImpl* streamColour, + std::vector<TestCaseHandle> const& tests, + bool isFiltered, + Verbosity verbosity ); + } // end namespace Catch #endif // CATCH_REPORTER_HELPERS_HPP_INCLUDED @@ -10661,36 +11794,32 @@ namespace Catch { namespace Catch { - class JunitReporter : public CumulativeReporterBase { + class JunitReporter final : public CumulativeReporterBase { public: - JunitReporter(ReporterConfig const& _config); + JunitReporter(ReporterConfig&& _config); - ~JunitReporter() override; + ~JunitReporter() override = default; 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 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); + private: + void writeRun(TestRunNode const& testRunNode, double suiteTime); void writeTestCase(TestCaseNode const& testCaseNode); - void writeSection(std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode); + void writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode, + bool testOkToFail ); void writeAssertions(SectionNode const& sectionNode); void writeAssertion(AssertionStats const& stats); @@ -10708,59 +11837,189 @@ namespace Catch { #endif // CATCH_REPORTER_JUNIT_HPP_INCLUDED -#ifndef CATCH_REPORTER_LISTENING_HPP_INCLUDED -#define CATCH_REPORTER_LISTENING_HPP_INCLUDED +#ifndef CATCH_REPORTER_MULTI_HPP_INCLUDED +#define CATCH_REPORTER_MULTI_HPP_INCLUDED namespace Catch { - class ListeningReporter final : public IStreamingReporter { - using Reporters = std::vector<IStreamingReporterPtr>; - Reporters m_listeners; - IStreamingReporterPtr m_reporter = nullptr; + class MultiReporter final : public IEventListener { + /* + * Stores all added reporters and listeners + * + * All Listeners are stored before all reporters, and individual + * listeners/reporters are stored in order of insertion. + */ + std::vector<IEventListenerPtr> m_reporterLikes; + bool m_haveNoncapturingReporters = false; - public: - ListeningReporter(); + // Keep track of how many listeners we have already inserted, + // so that we can insert them into the main vector at the right place + size_t m_insertedListeners = 0; + + void updatePreferences(IEventListener const& reporterish); - void addListener( IStreamingReporterPtr&& listener ); - void addReporter( IStreamingReporterPtr&& reporter ); + public: + using IEventListener::IEventListener; - public: // IStreamingReporter + void addListener( IEventListenerPtr&& listener ); + void addReporter( IEventListenerPtr&& reporter ); - void noMatchingTestCases( std::string const& spec ) override; + public: // IEventListener - void reportInvalidArguments(std::string const&arg) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; + void fatalErrorEncountered( StringRef error ) override; + void reportInvalidTestSpec( StringRef arg ) override; - void benchmarkPreparing(std::string const& name) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override; void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override; - void benchmarkFailed(std::string const&) override; + void benchmarkFailed( StringRef error ) override; void testRunStarting( TestRunInfo const& testRunInfo ) override; - void testGroupStarting( GroupInfo const& groupInfo ) override; void testCaseStarting( TestCaseInfo const& testInfo ) override; + void testCasePartialStarting(TestCaseInfo const& testInfo, uint64_t partNumber) 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 assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; + void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) 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; - void listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) override; - void listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) override; - void listTags(std::vector<TagInfo> const& tags, IConfig const& config) override; + void listReporters(std::vector<ReporterDescription> const& descriptions) override; + void listListeners(std::vector<ListenerDescription> const& descriptions) override; + void listTests(std::vector<TestCaseHandle> const& tests) override; + void listTags(std::vector<TagInfo> const& tags) override; }; } // end namespace Catch -#endif // CATCH_REPORTER_LISTENING_HPP_INCLUDED +#endif // CATCH_REPORTER_MULTI_HPP_INCLUDED + + +#ifndef CATCH_REPORTER_REGISTRARS_HPP_INCLUDED +#define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED + + +#include <type_traits> + +namespace Catch { + + namespace Detail { + + template <typename T, typename = void> + struct has_description : std::false_type {}; + + template <typename T> + struct has_description< + T, + void_t<decltype( T::getDescription() )>> + : std::true_type {}; + + //! Indirection for reporter registration, so that the error handling is + //! independent on the reporter's concrete type + void registerReporterImpl( std::string const& name, + IReporterFactoryPtr reporterPtr ); + + } // namespace Detail + + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; + + template <typename T> + class ReporterFactory : public IReporterFactory { + + IEventListenerPtr create( ReporterConfig&& config ) const override { + return Detail::make_unique<T>( CATCH_MOVE(config) ); + } + + std::string getDescription() const override { + return T::getDescription(); + } + }; + + + template<typename T> + class ReporterRegistrar { + public: + explicit ReporterRegistrar( std::string const& name ) { + registerReporterImpl( name, + Detail::make_unique<ReporterFactory<T>>() ); + } + }; + + template<typename T> + class ListenerRegistrar { + + class TypedListenerFactory : public EventListenerFactory { + StringRef m_listenerName; + + std::string getDescriptionImpl( std::true_type ) const { + return T::getDescription(); + } + + std::string getDescriptionImpl( std::false_type ) const { + return "(No description provided)"; + } + + public: + TypedListenerFactory( StringRef listenerName ): + m_listenerName( listenerName ) {} + + IEventListenerPtr create( IConfig const* config ) const override { + return Detail::make_unique<T>( config ); + } + + StringRef getName() const override { + return m_listenerName; + } + + std::string getDescription() const override { + return getDescriptionImpl( Detail::has_description<T>{} ); + } + }; + + public: + ListenerRegistrar(StringRef listenerName) { + getMutableRegistryHub().registerListener( Detail::make_unique<TypedListenerFactory>(listenerName) ); + } + }; +} + +#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> INTERNAL_CATCH_UNIQUE_NAME( \ + catch_internal_RegistrarFor )( 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> INTERNAL_CATCH_UNIQUE_NAME( \ + 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 // CATCH_REPORTER_REGISTRARS_HPP_INCLUDED #ifndef CATCH_REPORTER_SONARQUBE_HPP_INCLUDED @@ -10770,35 +12029,33 @@ namespace Catch { namespace Catch { - struct SonarQubeReporter : CumulativeReporterBase { - - SonarQubeReporter(ReporterConfig const& config) - : CumulativeReporterBase(config) - , xml(config.stream()) { + class SonarQubeReporter final : public CumulativeReporterBase { + public: + SonarQubeReporter(ReporterConfig&& config) + : CumulativeReporterBase(CATCH_MOVE(config)) + , xml(m_stream) { m_preferences.shouldRedirectStdOut = true; m_preferences.shouldReportAllAssertions = true; + m_shouldStoreSuccesfulAssertions = false; } - ~SonarQubeReporter() override; + ~SonarQubeReporter() override = default; static std::string getDescription() { using namespace std::string_literals; return "Reports test results in the Generic Test Data SonarQube XML format"s; } - void noMatchingTestCases(std::string const& /*spec*/) override {} - - void testRunStarting(TestRunInfo const& testRunInfo) override; - - void testGroupEnded(TestGroupStats const& testGroupStats) override; + void testRunStarting( TestRunInfo const& testRunInfo ) override; void testRunEndedCumulative() override { + writeRun( *m_testRun ); xml.endElement(); } - void writeGroup(TestGroupNode const& groupNode); + void writeRun( TestRunNode const& groupNode ); - void writeTestFile(std::string const& filename, TestGroupNode::ChildNodes const& testCaseNodes); + void writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes); void writeTestCase(TestCaseNode const& testCaseNode); @@ -10824,24 +12081,24 @@ namespace Catch { namespace Catch { - struct TAPReporter : StreamingReporterBase { - - TAPReporter( ReporterConfig const& config ): - StreamingReporterBase( config ) { + class TAPReporter final : public StreamingReporterBase { + public: + TAPReporter( ReporterConfig&& config ): + StreamingReporterBase( CATCH_MOVE(config) ) { m_preferences.shouldReportAllAssertions = true; } - ~TAPReporter() override; + ~TAPReporter() override = default; static std::string getDescription() { using namespace std::string_literals; return "Reports test results in TAP format, suitable for test harnesses"s; } - void noMatchingTestCases(std::string const& spec) override; + void testRunStarting( TestRunInfo const& testInfo ) override; - void assertionStarting( AssertionInfo const& ) override {} + void noMatchingTestCases( StringRef unmatchedSpec ) override; - bool assertionEnded(AssertionStats const& _assertionStats) override; + void assertionEnded(AssertionStats const& _assertionStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; @@ -10867,9 +12124,10 @@ namespace Catch { namespace Catch { - struct TeamCityReporter : StreamingReporterBase { - TeamCityReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ) + class TeamCityReporter final : public StreamingReporterBase { + public: + TeamCityReporter( ReporterConfig&& _config ) + : StreamingReporterBase( CATCH_MOVE(_config) ) { m_preferences.shouldRedirectStdOut = true; } @@ -10881,17 +12139,11 @@ namespace Catch { return "Reports test results as TeamCity service messages"s; } - void skipTest( TestCaseInfo const& /* testInfo */ ) override {} - - void noMatchingTestCases( std::string const& /* spec */ ) override {} - - void testGroupStarting(GroupInfo const& groupInfo) override; - void testGroupEnded(TestGroupStats const& testGroupStats) override; - + void testRunStarting( TestRunInfo const& groupInfo ) override; + void testRunEnded( TestRunStats const& testGroupStats ) override; - void assertionStarting(AssertionInfo const&) override {} - bool assertionEnded(AssertionStats const& assertionStats) override; + void assertionEnded(AssertionStats const& assertionStats) override; void sectionStarting(SectionInfo const& sectionInfo) override { m_headerPrintedForThisSection = false; @@ -10905,7 +12157,6 @@ namespace Catch { private: void printSectionHeader(std::ostream& os); - private: bool m_headerPrintedForThisSection = false; Timer m_testTimer; }; @@ -10928,7 +12179,7 @@ namespace Catch { namespace Catch { class XmlReporter : public StreamingReporterBase { public: - XmlReporter(ReporterConfig const& _config); + XmlReporter(ReporterConfig&& _config); ~XmlReporter() override; @@ -10940,36 +12191,31 @@ namespace Catch { 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 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 benchmarkPreparing(std::string const& name) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting(BenchmarkInfo const&) override; void benchmarkEnded(BenchmarkStats<> const&) override; - void benchmarkFailed(std::string const&) override; + void benchmarkFailed( StringRef error ) override; - void listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) override; - void listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) override; - void listTags(std::vector<TagInfo> const& tags, IConfig const& config) override; + void listReporters(std::vector<ReporterDescription> const& descriptions) override; + void listListeners(std::vector<ListenerDescription> const& descriptions) override; + void listTests(std::vector<TestCaseHandle> const& tests) override; + void listTags(std::vector<TagInfo> const& tags) override; private: Timer m_testCaseTimer; diff --git a/packages/Catch2/src/CMakeLists.txt b/packages/Catch2/src/CMakeLists.txt index 7e30c1a47..c76a96d52 100644 --- a/packages/Catch2/src/CMakeLists.txt +++ b/packages/Catch2/src/CMakeLists.txt @@ -1,4 +1,11 @@ -include(MiscFunctions) +include(CatchMiscFunctions) + +# CMake derives a Visual Studio project GUID from the file path but can be overridden via a property +# (see https://gitlab.kitware.com/cmake/cmake/-/commit/c85367f4). Using a non-constant GUID +# can cause problems if other projects/repos want to reference the vcxproj file, +# so we force a constant GUID here. +set(Catch2_GUID_CMAKE "8d538cbe-01bf-4a2e-a98a-6c368fdf13d7" CACHE INTERNAL "Project GUID") +set(Catch2WithMain_GUID_CMAKE "8bd3552a-2cfb-4a59-ab15-2031b97ada1e" CACHE INTERNAL "Project GUID") # Please keep these ordered alphabetically set(BENCHMARK_HEADERS @@ -24,18 +31,23 @@ set(BENCHMARK_HEADERS ${SOURCES_DIR}/benchmark/detail/catch_timing.hpp ) set(BENCHMARK_SOURCES - ${SOURCES_DIR}/benchmark/internal/catch_benchmark_combined_tu.cpp + ${SOURCES_DIR}/benchmark/catch_chronometer.cpp + ${SOURCES_DIR}/benchmark/detail/catch_benchmark_function.cpp + ${SOURCES_DIR}/benchmark/detail/catch_run_for_at_least.cpp ${SOURCES_DIR}/benchmark/detail/catch_stats.cpp ) SOURCE_GROUP("benchmark" FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES}) set(INTERNAL_HEADERS + "${CMAKE_BINARY_DIR}/generated-includes/catch2/catch_user_config.hpp" + "${SOURCES_DIR}/catch_user_config.hpp.in" ${SOURCES_DIR}/catch_all.hpp ${SOURCES_DIR}/matchers/catch_matchers_all.hpp ${SOURCES_DIR}/generators/catch_generators_all.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_all.hpp ${SOURCES_DIR}/matchers/internal/catch_matchers_impl.hpp + ${SOURCES_DIR}/internal/catch_case_insensitive_comparisons.hpp ${SOURCES_DIR}/internal/catch_console_width.hpp ${SOURCES_DIR}/internal/catch_container_nonmembers.hpp ${SOURCES_DIR}/internal/catch_noncopyable.hpp @@ -66,7 +78,9 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/internal/catch_exception_translator_registry.hpp ${SOURCES_DIR}/internal/catch_fatal_condition_handler.hpp ${SOURCES_DIR}/internal/catch_floating_point_helpers.hpp + ${SOURCES_DIR}/internal/catch_istream.hpp ${SOURCES_DIR}/internal/catch_unique_name.hpp + ${SOURCES_DIR}/internal/catch_sharding.hpp ${SOURCES_DIR}/generators/catch_generator_exception.hpp ${SOURCES_DIR}/generators/catch_generators.hpp ${SOURCES_DIR}/generators/catch_generators_adapters.hpp @@ -100,26 +114,30 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/internal/catch_message_info.hpp ${SOURCES_DIR}/internal/catch_meta.hpp ${SOURCES_DIR}/internal/catch_move_and_forward.hpp - ${SOURCES_DIR}/internal/catch_option.hpp + ${SOURCES_DIR}/internal/catch_optional.hpp ${SOURCES_DIR}/internal/catch_output_redirect.hpp ${SOURCES_DIR}/internal/catch_platform.hpp ${SOURCES_DIR}/internal/catch_polyfills.hpp ${SOURCES_DIR}/internal/catch_preprocessor.hpp + ${SOURCES_DIR}/internal/catch_preprocessor_remove_parens.hpp ${SOURCES_DIR}/internal/catch_random_number_generator.hpp - ${SOURCES_DIR}/catch_reporter_registrars.hpp + ${SOURCES_DIR}/internal/catch_random_seed_generation.hpp ${SOURCES_DIR}/internal/catch_reporter_registry.hpp + ${SOURCES_DIR}/internal/catch_reporter_spec_parser.hpp ${SOURCES_DIR}/internal/catch_result_type.hpp ${SOURCES_DIR}/internal/catch_run_context.hpp ${SOURCES_DIR}/internal/catch_section.hpp + ${SOURCES_DIR}/internal/catch_stdstreams.hpp ${SOURCES_DIR}/catch_section_info.hpp ${SOURCES_DIR}/catch_session.hpp ${SOURCES_DIR}/internal/catch_singletons.hpp ${SOURCES_DIR}/internal/catch_startup_exception_registry.hpp - ${SOURCES_DIR}/internal/catch_stream.hpp + ${SOURCES_DIR}/internal/catch_reusable_string_stream.hpp ${SOURCES_DIR}/internal/catch_stream_end_stop.hpp ${SOURCES_DIR}/internal/catch_string_manip.hpp ${SOURCES_DIR}/internal/catch_stringref.hpp ${SOURCES_DIR}/catch_tag_alias.hpp + ${SOURCES_DIR}/catch_get_random_seed.hpp ${SOURCES_DIR}/catch_tag_alias_autoregistrar.hpp ${SOURCES_DIR}/internal/catch_tag_alias_registry.hpp ${SOURCES_DIR}/catch_test_case_info.hpp @@ -139,21 +157,23 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/catch_translate_exception.hpp ${SOURCES_DIR}/internal/catch_uncaught_exceptions.hpp ${SOURCES_DIR}/internal/catch_unique_ptr.hpp + ${SOURCES_DIR}/internal/catch_void_type.hpp ${SOURCES_DIR}/catch_version.hpp ${SOURCES_DIR}/catch_version_macros.hpp ${SOURCES_DIR}/internal/catch_wildcard_pattern.hpp ${SOURCES_DIR}/internal/catch_windows_h_proxy.hpp ${SOURCES_DIR}/internal/catch_xmlwriter.hpp + ${SOURCES_DIR}/internal/catch_test_case_info_hasher.hpp ) set(IMPL_SOURCES ${SOURCES_DIR}/catch_approx.cpp ${SOURCES_DIR}/internal/catch_assertion_handler.cpp ${SOURCES_DIR}/catch_assertion_result.cpp - ${SOURCES_DIR}/matchers/internal/catch_matchers_combined_tu.cpp ${SOURCES_DIR}/internal/catch_clara.cpp ${SOURCES_DIR}/internal/catch_commandline.cpp ${SOURCES_DIR}/internal/catch_source_line_info.cpp ${SOURCES_DIR}/catch_config.cpp + ${SOURCES_DIR}/internal/catch_case_insensitive_comparisons.cpp ${SOURCES_DIR}/internal/catch_console_colour.cpp ${SOURCES_DIR}/internal/catch_context.cpp ${SOURCES_DIR}/internal/catch_debug_console.cpp @@ -163,25 +183,28 @@ set(IMPL_SOURCES ${SOURCES_DIR}/internal/catch_exception_translator_registry.cpp ${SOURCES_DIR}/internal/catch_fatal_condition_handler.cpp ${SOURCES_DIR}/internal/catch_floating_point_helpers.cpp - ${SOURCES_DIR}/generators/internal/catch_generators_combined_tu.cpp - ${SOURCES_DIR}/interfaces/catch_interfaces_combined_tu.cpp + ${SOURCES_DIR}/internal/catch_istream.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_generatortracker.cpp ${SOURCES_DIR}/interfaces/catch_interfaces_reporter.cpp ${SOURCES_DIR}/internal/catch_list.cpp ${SOURCES_DIR}/matchers/catch_matchers_floating_point.cpp + ${SOURCES_DIR}/matchers/catch_matchers_quantifiers.cpp ${SOURCES_DIR}/matchers/catch_matchers_string.cpp ${SOURCES_DIR}/matchers/catch_matchers_templated.cpp ${SOURCES_DIR}/catch_message.cpp ${SOURCES_DIR}/internal/catch_output_redirect.cpp ${SOURCES_DIR}/catch_registry_hub.cpp - ${SOURCES_DIR}/internal/catch_combined_tu.cpp ${SOURCES_DIR}/internal/catch_random_number_generator.cpp + ${SOURCES_DIR}/internal/catch_random_seed_generation.cpp ${SOURCES_DIR}/internal/catch_reporter_registry.cpp + ${SOURCES_DIR}/internal/catch_reporter_spec_parser.cpp ${SOURCES_DIR}/internal/catch_result_type.cpp ${SOURCES_DIR}/internal/catch_run_context.cpp ${SOURCES_DIR}/internal/catch_section.cpp + ${SOURCES_DIR}/internal/catch_stdstreams.cpp ${SOURCES_DIR}/catch_session.cpp ${SOURCES_DIR}/internal/catch_singletons.cpp - ${SOURCES_DIR}/internal/catch_stream.cpp + ${SOURCES_DIR}/internal/catch_reusable_string_stream.cpp ${SOURCES_DIR}/internal/catch_stringref.cpp ${SOURCES_DIR}/internal/catch_string_manip.cpp ${SOURCES_DIR}/internal/catch_tag_alias_registry.cpp @@ -198,6 +221,32 @@ set(IMPL_SOURCES ${SOURCES_DIR}/catch_version.cpp ${SOURCES_DIR}/internal/catch_wildcard_pattern.cpp ${SOURCES_DIR}/internal/catch_xmlwriter.cpp + ${SOURCES_DIR}/internal/catch_test_case_info_hasher.cpp + ${SOURCES_DIR}/generators/catch_generators_random.cpp + ${SOURCES_DIR}/generators/catch_generator_exception.cpp + ${SOURCES_DIR}/generators/catch_generators.cpp + ${SOURCES_DIR}/matchers/catch_matchers.cpp + ${SOURCES_DIR}/matchers/catch_matchers_container_properties.cpp + ${SOURCES_DIR}/matchers/catch_matchers_exception.cpp + ${SOURCES_DIR}/matchers/catch_matchers_predicate.cpp + ${SOURCES_DIR}/matchers/internal/catch_matchers_impl.cpp + ${SOURCES_DIR}/catch_tag_alias_autoregistrar.cpp + ${SOURCES_DIR}/catch_get_random_seed.cpp + ${SOURCES_DIR}/internal/catch_decomposer.cpp + ${SOURCES_DIR}/internal/catch_errno_guard.cpp + ${SOURCES_DIR}/internal/catch_lazy_expr.cpp + ${SOURCES_DIR}/internal/catch_leak_detector.cpp + ${SOURCES_DIR}/internal/catch_message_info.cpp + ${SOURCES_DIR}/internal/catch_polyfills.cpp + ${SOURCES_DIR}/internal/catch_startup_exception_registry.cpp + ${SOURCES_DIR}/internal/catch_uncaught_exceptions.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_capture.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_config.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_exception.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_registry_hub.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_testcase.cpp ) set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS}) @@ -205,13 +254,15 @@ set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS}) set(REPORTER_HEADERS ${SOURCES_DIR}/reporters/catch_reporters_all.hpp ${SOURCES_DIR}/reporters/catch_reporter_automake.hpp + ${SOURCES_DIR}/reporters/catch_reporter_common_base.hpp ${SOURCES_DIR}/reporters/catch_reporter_compact.hpp ${SOURCES_DIR}/reporters/catch_reporter_console.hpp ${SOURCES_DIR}/reporters/catch_reporter_cumulative_base.hpp ${SOURCES_DIR}/reporters/catch_reporter_event_listener.hpp ${SOURCES_DIR}/reporters/catch_reporter_helpers.hpp ${SOURCES_DIR}/reporters/catch_reporter_junit.hpp - ${SOURCES_DIR}/reporters/catch_reporter_listening.hpp + ${SOURCES_DIR}/reporters/catch_reporter_multi.hpp + ${SOURCES_DIR}/reporters/catch_reporter_registrars.hpp ${SOURCES_DIR}/reporters/catch_reporter_sonarqube.hpp ${SOURCES_DIR}/reporters/catch_reporter_streaming_base.hpp ${SOURCES_DIR}/reporters/catch_reporter_tap.hpp @@ -220,12 +271,15 @@ set(REPORTER_HEADERS ) set(REPORTER_SOURCES ${SOURCES_DIR}/reporters/catch_reporter_automake.cpp - ${SOURCES_DIR}/reporters/catch_reporter_combined_tu.cpp + ${SOURCES_DIR}/reporters/catch_reporter_common_base.cpp ${SOURCES_DIR}/reporters/catch_reporter_compact.cpp ${SOURCES_DIR}/reporters/catch_reporter_console.cpp ${SOURCES_DIR}/reporters/catch_reporter_cumulative_base.cpp + ${SOURCES_DIR}/reporters/catch_reporter_event_listener.cpp + ${SOURCES_DIR}/reporters/catch_reporter_helpers.cpp ${SOURCES_DIR}/reporters/catch_reporter_junit.cpp - ${SOURCES_DIR}/reporters/catch_reporter_listening.cpp + ${SOURCES_DIR}/reporters/catch_reporter_multi.cpp + ${SOURCES_DIR}/reporters/catch_reporter_registrars.cpp ${SOURCES_DIR}/reporters/catch_reporter_sonarqube.cpp ${SOURCES_DIR}/reporters/catch_reporter_streaming_base.cpp ${SOURCES_DIR}/reporters/catch_reporter_tap.cpp @@ -234,9 +288,7 @@ set(REPORTER_SOURCES ) set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES}) -# Fixme: STATIC because for dynamic, we would need to handle visibility -# and I don't want to do the annotations right now -add_library(Catch2 STATIC +add_library(Catch2 ${REPORTER_FILES} ${INTERNAL_FILES} ${BENCHMARK_HEADERS} @@ -276,14 +328,20 @@ target_compile_features(Catch2 cxx_variadic_macros ) +configure_file( + "${SOURCES_DIR}/catch_user_config.hpp.in" + "${CMAKE_BINARY_DIR}/generated-includes/catch2/catch_user_config.hpp" +) + target_include_directories(Catch2 PUBLIC $<BUILD_INTERFACE:${SOURCES_DIR}/..> + $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated-includes> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> ) -add_library(Catch2WithMain STATIC +add_library(Catch2WithMain ${SOURCES_DIR}/internal/catch_main.cpp ) add_build_reproducibility_settings(Catch2WithMain) @@ -303,8 +361,12 @@ if (NOT_SUBPROJECT) Catch2WithMain EXPORT Catch2Targets - DESTINATION + LIBRARY DESTINATION + ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION + ${CMAKE_INSTALL_BINDIR} ) @@ -317,7 +379,15 @@ if (NOT_SUBPROJECT) ${CATCH_CMAKE_CONFIG_DESTINATION} ) # Install the headers - install(DIRECTORY ${SOURCES_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h*") + install( + DIRECTORY + "${SOURCES_DIR}" + "${CMAKE_BINARY_DIR}/generated-includes/catch2" # Also install the generated header + DESTINATION + "${CMAKE_INSTALL_INCLUDEDIR}" + FILES_MATCHING + PATTERN "*.hpp" + ) endif() # Some tests require a full recompilation of Catch2 lib with different @@ -336,6 +406,7 @@ if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS) target_include_directories(Catch2_buildall_interface INTERFACE $<BUILD_INTERFACE:${SOURCES_DIR}/..> + $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated-includes> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> ) target_compile_features(Catch2_buildall_interface @@ -365,3 +436,27 @@ endif() list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain) set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE) + + +# We still do not support building dynamic library with hidden visibility +# so we want to check & warn users if they do this. However, we won't abort +# the configuration step so that we don't have to also provide an override. +if (BUILD_SHARED_LIBS) + if (MSVC) + set_target_properties(Catch2 Catch2WithMain + PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON + ) + endif() + + get_target_property(_VisPreset Catch2 CXX_VISIBILITY_PRESET) + if (NOT MSVC AND _VisPreset STREQUAL "hidden") + set_target_properties(Catch2 Catch2WithMain + PROPERTIES + CXX_VISIBILITY_PRESET "default" + VISIBILITY_INLINES_HIDDEN OFF + ) + message(WARNING "Setting Catch2's visibility to default." + " Hidden visibility is not supported.") + endif() +endif() diff --git a/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp b/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp index 28664b613..66e3670f6 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp @@ -95,8 +95,11 @@ namespace Catch { // sets lambda to be used in fun *and* executes benchmark! template <typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value, int> = 0> Benchmark & operator=(Fun func) { - fun = Detail::BenchmarkFunction(func); - run(); + auto const* cfg = getCurrentContext().getConfig(); + if (!cfg->skipBenchmarks()) { + fun = Detail::BenchmarkFunction(func); + run(); + } return *this; } diff --git a/packages/Catch2/src/catch2/benchmark/catch_chronometer.cpp b/packages/Catch2/src/catch2/benchmark/catch_chronometer.cpp new file mode 100644 index 000000000..459a26c7e --- /dev/null +++ b/packages/Catch2/src/catch2/benchmark/catch_chronometer.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/benchmark/catch_chronometer.hpp> + +namespace Catch { + namespace Benchmark { + namespace Detail { + ChronometerConcept::~ChronometerConcept() = default; + } // namespace Detail + } // namespace Benchmark +} // namespace Catch diff --git a/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp b/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp index 9da1eaaf8..86bbfb00d 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp @@ -20,9 +20,7 @@ namespace Catch { template <typename T, bool Destruct> struct ObjectStorage { - using TStorage = std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value>; - - ObjectStorage() : data() {} + ObjectStorage() = default; ObjectStorage(const ObjectStorage& other) { @@ -31,7 +29,7 @@ namespace Catch { ObjectStorage(ObjectStorage&& other) { - new(&data) T(CATCH_MOVE(other.stored_object())); + new(data) T(CATCH_MOVE(other.stored_object())); } ~ObjectStorage() { destruct_on_exit<T>(); } @@ -39,7 +37,7 @@ namespace Catch { template <typename... Args> void construct(Args&&... args) { - new (&data) T(CATCH_FORWARD(args)...); + new (data) T(CATCH_FORWARD(args)...); } template <bool AllowManualDestruction = !Destruct> @@ -51,21 +49,21 @@ namespace Catch { private: // If this is a constructor benchmark, destruct the underlying object template <typename U> - void destruct_on_exit(std::enable_if_t<Destruct, U>* = 0) { destruct<true>(); } + void destruct_on_exit(std::enable_if_t<Destruct, U>* = nullptr) { destruct<true>(); } // Otherwise, don't template <typename U> - void destruct_on_exit(std::enable_if_t<!Destruct, U>* = 0) { } + void destruct_on_exit(std::enable_if_t<!Destruct, U>* = nullptr) { } T& stored_object() { - return *static_cast<T*>(static_cast<void*>(&data)); + return *static_cast<T*>(static_cast<void*>(data)); } T const& stored_object() const { - return *static_cast<T*>(static_cast<void*>(&data)); + return *static_cast<T const*>(static_cast<void const*>(data)); } - TStorage data; + alignas( T ) unsigned char data[sizeof( T )]{}; }; } // namespace Detail diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp index cf96a3d28..6652f5f4d 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp @@ -28,7 +28,7 @@ namespace Catch { SampleAnalysis<Duration> analyse(const IConfig &cfg, Environment<Duration>, Iterator first, Iterator last) { if (!cfg.benchmarkNoAnalysis()) { std::vector<double> samples; - samples.reserve(last - first); + samples.reserve(static_cast<size_t>(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()); @@ -54,7 +54,7 @@ namespace Catch { }; } else { std::vector<Duration> samples; - samples.reserve(last - first); + samples.reserve(static_cast<size_t>(last - first)); Duration mean = Duration(0); int i = 0; diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp new file mode 100644 index 000000000..9562d29e7 --- /dev/null +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/benchmark/detail/catch_benchmark_function.hpp> + +namespace Catch { + namespace Benchmark { + namespace Detail { + BenchmarkFunction::callable::~callable() = default; + } // namespace Detail + } // namespace Benchmark +} // namespace Catch diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp index 3bba791e4..c392ca4f7 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp @@ -29,11 +29,11 @@ namespace Catch { template <typename Clock> std::vector<double> resolution(int k) { std::vector<TimePoint<Clock>> times; - times.reserve(k + 1); + times.reserve(static_cast<size_t>(k + 1)); std::generate_n(std::back_inserter(times), k + 1, now<Clock>{}); std::vector<double> deltas; - deltas.reserve(k); + deltas.reserve(static_cast<size_t>(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()); }); @@ -83,7 +83,7 @@ namespace Catch { 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); + times.reserve(static_cast<size_t>(nsamples)); std::generate_n(std::back_inserter(times), nsamples, [time_clock, &r] { return static_cast<double>((time_clock(r.iterations) / r.iterations).count()); }); diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp b/packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp new file mode 100644 index 000000000..6c246d6a5 --- /dev/null +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.cpp @@ -0,0 +1,30 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/benchmark/detail/catch_run_for_at_least.hpp> +#include <exception> +#include <catch2/internal/catch_enforce.hpp> + +namespace Catch { + namespace Benchmark { + namespace Detail { + struct optimized_away_error : std::exception { + const char* what() const noexcept override; + }; + + const char* optimized_away_error::what() const noexcept { + return "could not measure benchmark, maybe it was optimized away"; + } + + void throw_optimized_away_error() { + Catch::throw_exception(optimized_away_error{}); + } + + } // namespace Detail + } // namespace Benchmark +} // namespace Catch diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp index 45190da86..023508064 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp @@ -12,6 +12,7 @@ #include <catch2/internal/catch_compiler_capabilities.hpp> #include <cassert> +#include <cstddef> #include <iterator> #include <random> @@ -25,8 +26,8 @@ namespace { using Catch::Benchmark::Detail::sample; template <typename URng, typename Estimator> - sample resample(URng& rng, int resamples, std::vector<double>::iterator first, std::vector<double>::iterator last, Estimator& estimator) { - auto n = last - first; + sample resample(URng& rng, unsigned int resamples, std::vector<double>::iterator first, std::vector<double>::iterator last, Estimator& estimator) { + auto n = static_cast<size_t>(last - first); std::uniform_int_distribution<decltype(n)> dist(0, n - 1); sample out; @@ -34,7 +35,7 @@ using Catch::Benchmark::Detail::sample; 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)]; }); + std::generate_n(std::back_inserter(resampled), n, [first, &dist, &rng] { return first[static_cast<std::ptrdiff_t>(dist(rng))]; }); return estimator(resampled.begin(), resampled.end()); }); std::sort(out.begin(), out.end()); @@ -119,11 +120,15 @@ using Catch::Benchmark::Detail::sample; 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); + 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 ); } } @@ -132,6 +137,15 @@ namespace Catch { namespace Benchmark { namespace Detail { +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + bool directCompare( double lhs, double rhs ) { return lhs == rhs; } +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic pop +#endif + 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); @@ -139,7 +153,9 @@ namespace Catch { double g = idx - j; std::nth_element(first, first + j, last); auto xj = first[j]; - if (g == 0) return xj; + if ( directCompare( g, 0 ) ) { + return xj; + } auto xj1 = *std::min_element(first + (j + 1), last); return xj + g * (xj1 - xj); @@ -194,7 +210,7 @@ namespace Catch { } - bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last) { + bootstrap_analysis analyse_samples(double confidence_level, unsigned 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; diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp index 8985670f0..bfeace2c1 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp @@ -24,6 +24,10 @@ namespace Catch { namespace Detail { using sample = std::vector<double>; + // Used when we know we want == comparison of two doubles + // to centralize warning suppression + bool directCompare( double lhs, double rhs ); + double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last); template <typename Iterator> @@ -54,12 +58,12 @@ namespace Catch { double mean(Iterator first, Iterator last) { auto count = last - first; double sum = std::accumulate(first, last, 0.); - return sum / count; + return sum / static_cast<double>(count); } template <typename Estimator, typename Iterator> sample jackknife(Estimator&& estimator, Iterator first, Iterator last) { - auto n = last - first; + auto n = static_cast<size_t>(last - first); auto second = first; ++second; sample results; @@ -100,23 +104,26 @@ namespace Catch { }); double accel = sum_cubes / (6 * std::pow(sum_squares, 1.5)); - int n = static_cast<int>(resample.size()); + long n = static_cast<long>(resample.size()); double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / static_cast<double>(n); // degenerate case with uniform samples - if (prob_n == 0) return { point, point, point, confidence_level }; + if ( directCompare( 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 cumn = [n]( double x ) -> long { + return std::lround( normal_cdf( x ) * static_cast<double>(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); + auto lo = static_cast<size_t>((std::max)(cumn(a1), 0l)); + auto hi = static_cast<size_t>((std::min)(cumn(a2), n - 1)); return { point, resample[lo], resample[hi], confidence_level }; } @@ -129,7 +136,7 @@ namespace Catch { double outlier_variance; }; - bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last); + bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last); } // namespace Detail } // namespace Benchmark } // namespace Catch diff --git a/packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp b/packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp deleted file mode 100644 index ffbae6962..000000000 --- a/packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp +++ /dev/null @@ -1,75 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small benchmarking-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -//////////////////////////////////////////// -// vvv formerly catch_chronometer.cpp vvv // -//////////////////////////////////////////// - -#include <catch2/benchmark/catch_chronometer.hpp> - -namespace Catch { - namespace Benchmark { - namespace Detail { - ChronometerConcept::~ChronometerConcept() = default; - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - -/////////////////////////////////////////////////// -// vvv formerly catch_benchmark_function.cpp vvv // -/////////////////////////////////////////////////// - -#include <catch2/benchmark/detail/catch_benchmark_function.hpp> - -namespace Catch { - namespace Benchmark { - namespace Detail { - BenchmarkFunction::callable::~callable() = default; - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - -///////////////////////////////////////////////// -// vvv formerly catch_run_for_at_least.cpp vvv // -///////////////////////////////////////////////// - -#include <catch2/benchmark/detail/catch_run_for_at_least.hpp> -#include <exception> -#include <catch2/internal/catch_enforce.hpp> - -namespace Catch { - namespace Benchmark { - namespace Detail { - struct optimized_away_error : std::exception { - const char* what() const noexcept override; - }; - - const char* optimized_away_error::what() const noexcept { - return "could not measure benchmark, maybe it was optimized away"; - } - - void throw_optimized_away_error() { - Catch::throw_exception(optimized_away_error{}); - } - - } // namespace Detail - } // namespace Benchmark -} // namespace Catch diff --git a/packages/Catch2/src/catch2/catch_all.hpp b/packages/Catch2/src/catch2/catch_all.hpp index 35bd9741a..94f552237 100644 --- a/packages/Catch2/src/catch2/catch_all.hpp +++ b/packages/Catch2/src/catch2/catch_all.hpp @@ -27,8 +27,8 @@ #include <catch2/catch_assertion_info.hpp> #include <catch2/catch_assertion_result.hpp> #include <catch2/catch_config.hpp> +#include <catch2/catch_get_random_seed.hpp> #include <catch2/catch_message.hpp> -#include <catch2/catch_reporter_registrars.hpp> #include <catch2/catch_section_info.hpp> #include <catch2/catch_session.hpp> #include <catch2/catch_tag_alias.hpp> @@ -46,6 +46,7 @@ #include <catch2/generators/catch_generators_all.hpp> #include <catch2/interfaces/catch_interfaces_all.hpp> #include <catch2/internal/catch_assertion_handler.hpp> +#include <catch2/internal/catch_case_insensitive_comparisons.hpp> #include <catch2/internal/catch_case_sensitive.hpp> #include <catch2/internal/catch_clara.hpp> #include <catch2/internal/catch_commandline.hpp> @@ -67,6 +68,7 @@ #include <catch2/internal/catch_exception_translator_registry.hpp> #include <catch2/internal/catch_fatal_condition_handler.hpp> #include <catch2/internal/catch_floating_point_helpers.hpp> +#include <catch2/internal/catch_istream.hpp> #include <catch2/internal/catch_lazy_expr.hpp> #include <catch2/internal/catch_leak_detector.hpp> #include <catch2/internal/catch_list.hpp> @@ -74,25 +76,31 @@ #include <catch2/internal/catch_meta.hpp> #include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/internal/catch_noncopyable.hpp> -#include <catch2/internal/catch_option.hpp> +#include <catch2/internal/catch_optional.hpp> #include <catch2/internal/catch_output_redirect.hpp> #include <catch2/internal/catch_platform.hpp> #include <catch2/internal/catch_polyfills.hpp> #include <catch2/internal/catch_preprocessor.hpp> +#include <catch2/internal/catch_preprocessor_remove_parens.hpp> #include <catch2/internal/catch_random_number_generator.hpp> +#include <catch2/internal/catch_random_seed_generation.hpp> #include <catch2/internal/catch_reporter_registry.hpp> +#include <catch2/internal/catch_reporter_spec_parser.hpp> #include <catch2/internal/catch_result_type.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <catch2/internal/catch_run_context.hpp> #include <catch2/internal/catch_section.hpp> +#include <catch2/internal/catch_sharding.hpp> #include <catch2/internal/catch_singletons.hpp> #include <catch2/internal/catch_source_line_info.hpp> #include <catch2/internal/catch_startup_exception_registry.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_stdstreams.hpp> #include <catch2/internal/catch_stream_end_stop.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_tag_alias_registry.hpp> #include <catch2/internal/catch_template_test_registry.hpp> +#include <catch2/internal/catch_test_case_info_hasher.hpp> #include <catch2/internal/catch_test_case_registry_impl.hpp> #include <catch2/internal/catch_test_case_tracker.hpp> #include <catch2/internal/catch_test_failure_exception.hpp> @@ -104,6 +112,7 @@ #include <catch2/internal/catch_uncaught_exceptions.hpp> #include <catch2/internal/catch_unique_name.hpp> #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_void_type.hpp> #include <catch2/internal/catch_wildcard_pattern.hpp> #include <catch2/internal/catch_windows_h_proxy.hpp> #include <catch2/internal/catch_xmlwriter.hpp> diff --git a/packages/Catch2/src/catch2/catch_approx.cpp b/packages/Catch2/src/catch2/catch_approx.cpp index 3dfebf466..b477d6ed9 100644 --- a/packages/Catch2/src/catch2/catch_approx.cpp +++ b/packages/Catch2/src/catch2/catch_approx.cpp @@ -7,6 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_approx.hpp> #include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <cmath> #include <limits> @@ -24,7 +25,7 @@ bool marginComparison(double lhs, double rhs, double margin) { namespace Catch { Approx::Approx ( double value ) - : m_epsilon( std::numeric_limits<float>::epsilon()*100 ), + : m_epsilon( std::numeric_limits<float>::epsilon()*100. ), m_margin( 0.0 ), m_scale( 0.0 ), m_value( value ) diff --git a/packages/Catch2/src/catch2/catch_approx.hpp b/packages/Catch2/src/catch2/catch_approx.hpp index 7c3a17c03..a46caeb53 100644 --- a/packages/Catch2/src/catch2/catch_approx.hpp +++ b/packages/Catch2/src/catch2/catch_approx.hpp @@ -86,14 +86,14 @@ namespace Catch { template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> Approx& epsilon( T const& newEpsilon ) { - double epsilonAsDouble = static_cast<double>(newEpsilon); + const auto epsilonAsDouble = static_cast<double>(newEpsilon); setEpsilon(epsilonAsDouble); return *this; } template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> Approx& margin( T const& newMargin ) { - double marginAsDouble = static_cast<double>(newMargin); + const auto marginAsDouble = static_cast<double>(newMargin); setMargin(marginAsDouble); return *this; } diff --git a/packages/Catch2/src/catch2/catch_assertion_result.cpp b/packages/Catch2/src/catch2/catch_assertion_result.cpp index 04e00d265..2912c8d30 100644 --- a/packages/Catch2/src/catch2/catch_assertion_result.cpp +++ b/packages/Catch2/src/catch2/catch_assertion_result.cpp @@ -6,7 +6,7 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_assertion_result.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> namespace Catch { diff --git a/packages/Catch2/src/catch2/catch_config.cpp b/packages/Catch2/src/catch2/catch_config.cpp index 92fcff206..4cb3627db 100644 --- a/packages/Catch2/src/catch2/catch_config.cpp +++ b/packages/Catch2/src/catch2/catch_config.cpp @@ -6,20 +6,51 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_config.hpp> +#include <catch2/catch_user_config.hpp> #include <catch2/internal/catch_enforce.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_platform.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_test_spec_parser.hpp> #include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp> +namespace { + bool provideBazelReporterOutput() { +#if defined(CATCH_CONFIG_BAZEL_SUPPORT) + return true; +#elif defined(CATCH_PLATFORM_WINDOWS_UWP) + // UWP does not support environment variables + return false; +#else + +# if defined( _MSC_VER ) + // On Windows getenv throws a warning as there is no input validation, + // since the switch is hardcoded, this should not be an issue. +# pragma warning( push ) +# pragma warning( disable : 4996 ) +# endif + + return std::getenv( "BAZEL_TEST" ) != nullptr; + +# if defined( _MSC_VER ) +# pragma warning( pop ) +# endif +#endif + } +} namespace Catch { - Config::Config( ConfigData const& data ) - : m_data( data ), - m_stream( Catch::makeStream(m_data.outputFilename) ) - { + bool operator==( ProcessedReporterSpec const& lhs, + ProcessedReporterSpec const& rhs ) { + return lhs.name == rhs.name && + lhs.outputFilename == rhs.outputFilename && + lhs.colourMode == rhs.colourMode && + lhs.customOptions == rhs.customOptions; + } + + Config::Config( ConfigData const& data ): + m_data( data ) { // We need to trim filter specs to avoid trouble with superfluous // whitespace (esp. important for bdd macros, as those are manually // aligned with whitespace). @@ -31,6 +62,7 @@ namespace Catch { elem = trim(elem); } + TestSpecParser parser(ITagAliasRegistry::get()); if (!m_data.testsOrTags.empty()) { m_hasTestFilters = true; @@ -39,24 +71,87 @@ namespace Catch { } } m_testSpec = parser.testSpec(); - } - Config::~Config() = default; + // Insert the default reporter if user hasn't asked for a specfic one + if ( m_data.reporterSpecifications.empty() ) { + m_data.reporterSpecifications.push_back( { +#if defined( CATCH_CONFIG_DEFAULT_REPORTER ) + CATCH_CONFIG_DEFAULT_REPORTER, +#else + "console", +#endif + {}, {}, {} + } ); + } + +#if !defined(CATCH_PLATFORM_WINDOWS_UWP) + if(provideBazelReporterOutput()){ + // Register a JUnit reporter for Bazel. Bazel sets an environment + // variable with the path to XML output. If this file is written to + // during test, Bazel will not generate a default XML output. + // This allows the XML output file to contain higher level of detail + // than what is possible otherwise. +# if defined( _MSC_VER ) + // On Windows getenv throws a warning as there is no input validation, + // since the key is hardcoded, this should not be an issue. +# pragma warning( push ) +# pragma warning( disable : 4996 ) +# endif + const auto bazelOutputFilePtr = std::getenv( "XML_OUTPUT_FILE" ); +# if defined( _MSC_VER ) +# pragma warning( pop ) +# endif + if ( bazelOutputFilePtr != nullptr ) { + m_data.reporterSpecifications.push_back( + { "junit", std::string( bazelOutputFilePtr ), {}, {} } ); + } + } +#endif + + // We now fixup the reporter specs to handle default output spec, + // default colour spec, etc + bool defaultOutputUsed = false; + for ( auto const& reporterSpec : m_data.reporterSpecifications ) { + // We do the default-output check separately, while always + // using the default output below to make the code simpler + // and avoid superfluous copies. + if ( reporterSpec.outputFile().none() ) { + CATCH_ENFORCE( !defaultOutputUsed, + "Internal error: cannot use default output for " + "multiple reporters" ); + defaultOutputUsed = true; + } - std::string const& Config::getFilename() const { - return m_data.outputFilename ; + m_processedReporterSpecs.push_back( ProcessedReporterSpec{ + reporterSpec.name(), + reporterSpec.outputFile() ? *reporterSpec.outputFile() + : data.defaultOutputFilename, + reporterSpec.colourMode().valueOr( data.defaultColourMode ), + reporterSpec.customOptions() } ); + } } + Config::~Config() = default; + + bool Config::listTests() const { return m_data.listTests; } bool Config::listTags() const { return m_data.listTags; } bool Config::listReporters() const { return m_data.listReporters; } - - std::string const& Config::getReporterName() const { return m_data.reporterName; } + bool Config::listListeners() const { return m_data.listListeners; } std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; } std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; } + std::vector<ReporterSpec> const& Config::getReporterSpecs() const { + return m_data.reporterSpecifications; + } + + std::vector<ProcessedReporterSpec> const& + Config::getProcessedReporterSpecs() const { + return m_processedReporterSpecs; + } + TestSpec const& Config::testSpec() const { return m_testSpec; } bool Config::hasTestFilters() const { return m_hasTestFilters; } @@ -64,23 +159,30 @@ namespace Catch { // IConfig interface bool Config::allowThrows() const { return !m_data.noThrow; } - std::ostream& Config::stream() const { return m_stream->stream(); } - StringRef Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; } + StringRef 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); } + bool Config::warnAboutMissingAssertions() const { + return !!( m_data.warnings & WarnAbout::NoAssertions ); + } + bool Config::warnAboutUnmatchedTestSpecs() const { + return !!( m_data.warnings & WarnAbout::UnmatchedTestSpec ); + } + bool Config::zeroTestsCountAsSuccess() const { return m_data.allowZeroTests; } ShowDurations Config::showDurations() const { return m_data.showDurations; } double Config::minDuration() const { return m_data.minDuration; } TestRunOrder Config::runOrder() const { return m_data.runOrder; } - unsigned int Config::rngSeed() const { return m_data.rngSeed; } - UseColour Config::useColour() const { return m_data.useColour; } + uint32_t Config::rngSeed() const { return m_data.rngSeed; } + unsigned int Config::shardCount() const { return m_data.shardCount; } + unsigned int Config::shardIndex() const { return m_data.shardIndex; } + ColourMode Config::defaultColourMode() const { return m_data.defaultColourMode; } 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::skipBenchmarks() const { return m_data.skipBenchmarks; } bool Config::benchmarkNoAnalysis() const { return m_data.benchmarkNoAnalysis; } - int Config::benchmarkSamples() const { return m_data.benchmarkSamples; } + unsigned 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); } diff --git a/packages/Catch2/src/catch2/catch_config.hpp b/packages/Catch2/src/catch2/catch_config.hpp index 7daf61c71..10df4d64a 100644 --- a/packages/Catch2/src/catch2/catch_config.hpp +++ b/packages/Catch2/src/catch2/catch_config.hpp @@ -11,18 +11,44 @@ #include <catch2/catch_test_spec.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_optional.hpp> +#include <catch2/internal/catch_stringref.hpp> +#include <catch2/internal/catch_random_seed_generation.hpp> +#include <catch2/internal/catch_reporter_spec_parser.hpp> -#include <vector> +#include <chrono> +#include <map> #include <string> +#include <vector> namespace Catch { - struct IStream; + class IStream; + + /** + * `ReporterSpec` but with the defaults filled in. + * + * Like `ReporterSpec`, the semantics are unchecked. + */ + struct ProcessedReporterSpec { + std::string name; + std::string outputFilename; + ColourMode colourMode; + std::map<std::string, std::string> customOptions; + friend bool operator==( ProcessedReporterSpec const& lhs, + ProcessedReporterSpec const& rhs ); + friend bool operator!=( ProcessedReporterSpec const& lhs, + ProcessedReporterSpec const& rhs ) { + return !( lhs == rhs ); + } + }; struct ConfigData { + bool listTests = false; bool listTags = false; bool listReporters = false; + bool listListeners = false; bool showSuccessfulTests = false; bool shouldDebugBreak = false; @@ -31,10 +57,15 @@ namespace Catch { bool showInvisibles = false; bool filenamesAsTags = false; bool libIdentify = false; + bool allowZeroTests = false; int abortAfter = -1; - unsigned int rngSeed = 0; + uint32_t rngSeed = generateRandomSeed(GenerateFrom::Default); + + unsigned int shardCount = 1; + unsigned int shardIndex = 0; + bool skipBenchmarks = false; bool benchmarkNoAnalysis = false; unsigned int benchmarkSamples = 100; double benchmarkConfidenceInterval = 0.95; @@ -46,17 +77,13 @@ namespace Catch { ShowDurations showDurations = ShowDurations::DefaultForReporter; double minDuration = -1; TestRunOrder runOrder = TestRunOrder::Declared; - UseColour useColour = UseColour::Auto; + ColourMode defaultColourMode = ColourMode::PlatformDefault; WaitForKeypress::When waitForKeypress = WaitForKeypress::Never; - std::string outputFilename; + std::string defaultOutputFilename; 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<ReporterSpec> reporterSpecifications; std::vector<std::string> testsOrTags; std::vector<std::string> sectionsToRun; @@ -70,13 +97,14 @@ namespace Catch { Config( ConfigData const& data ); ~Config() override; // = default in the cpp file - std::string const& getFilename() const; - bool listTests() const; bool listTags() const; bool listReporters() const; + bool listListeners() const; - std::string const& getReporterName() const; + std::vector<ReporterSpec> const& getReporterSpecs() const; + std::vector<ProcessedReporterSpec> const& + getProcessedReporterSpecs() const; std::vector<std::string> const& getTestsOrTags() const override; std::vector<std::string> const& getSectionsToRun() const override; @@ -88,34 +116,35 @@ namespace Catch { // IConfig interface bool allowThrows() const override; - std::ostream& stream() const override; StringRef name() const override; bool includeSuccessfulResults() const override; bool warnAboutMissingAssertions() const override; - bool warnAboutNoTests() const override; + bool warnAboutUnmatchedTestSpecs() const override; + bool zeroTestsCountAsSuccess() const override; ShowDurations showDurations() const override; double minDuration() const override; TestRunOrder runOrder() const override; - unsigned int rngSeed() const override; - UseColour useColour() const override; + uint32_t rngSeed() const override; + unsigned int shardCount() const override; + unsigned int shardIndex() const override; + ColourMode defaultColourMode() const override; bool shouldDebugBreak() const override; int abortAfter() const override; bool showInvisibles() const override; Verbosity verbosity() const override; + bool skipBenchmarks() const override; bool benchmarkNoAnalysis() const override; - int benchmarkSamples() const override; + unsigned int benchmarkSamples() const override; double benchmarkConfidenceInterval() const override; unsigned int benchmarkResamples() const override; std::chrono::milliseconds benchmarkWarmupTime() const override; private: ConfigData m_data; - - Detail::unique_ptr<IStream const> m_stream; + std::vector<ProcessedReporterSpec> m_processedReporterSpecs; TestSpec m_testSpec; bool m_hasTestFilters = false; }; - } // end namespace Catch #endif // CATCH_CONFIG_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/catch_get_random_seed.cpp b/packages/Catch2/src/catch2/catch_get_random_seed.cpp new file mode 100644 index 000000000..12a5b6d8c --- /dev/null +++ b/packages/Catch2/src/catch2/catch_get_random_seed.cpp @@ -0,0 +1,18 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_get_random_seed.hpp> + +#include <catch2/internal/catch_context.hpp> +#include <catch2/catch_config.hpp> + +namespace Catch { + std::uint32_t getSeed() { + return getCurrentContext().getConfig()->rngSeed(); + } +} diff --git a/packages/Catch2/src/catch2/catch_get_random_seed.hpp b/packages/Catch2/src/catch2/catch_get_random_seed.hpp new file mode 100644 index 000000000..6df3c3a00 --- /dev/null +++ b/packages/Catch2/src/catch2/catch_get_random_seed.hpp @@ -0,0 +1,18 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_GET_RANDOM_SEED_HPP_INCLUDED +#define CATCH_GET_RANDOM_SEED_HPP_INCLUDED + +#include <cstdint> + +namespace Catch { + //! Returns Catch2's current RNG seed. + std::uint32_t getSeed(); +} + +#endif // CATCH_GET_RANDOM_SEED_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/catch_message.hpp b/packages/Catch2/src/catch2/catch_message.hpp index 970ba438a..dac7a21d0 100644 --- a/packages/Catch2/src/catch2/catch_message.hpp +++ b/packages/Catch2/src/catch2/catch_message.hpp @@ -9,7 +9,7 @@ #define CATCH_MESSAGE_HPP_INCLUDED #include <catch2/internal/catch_result_type.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <catch2/internal/catch_stream_end_stop.hpp> #include <catch2/internal/catch_message_info.hpp> #include <catch2/interfaces/catch_interfaces_capture.hpp> diff --git a/packages/Catch2/src/catch2/catch_registry_hub.cpp b/packages/Catch2/src/catch2/catch_registry_hub.cpp index edf9b2b52..1fca78fb7 100644 --- a/packages/Catch2/src/catch2/catch_registry_hub.cpp +++ b/packages/Catch2/src/catch2/catch_registry_hub.cpp @@ -51,7 +51,7 @@ namespace Catch { void registerReporter( std::string const& name, IReporterFactoryPtr factory ) override { m_reporterRegistry.registerReporter( name, CATCH_MOVE(factory) ); } - void registerListener( IReporterFactoryPtr factory ) override { + void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) override { m_reporterRegistry.registerListener( CATCH_MOVE(factory) ); } void registerTest( Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker ) override { diff --git a/packages/Catch2/src/catch2/catch_reporter_registrars.hpp b/packages/Catch2/src/catch2/catch_reporter_registrars.hpp deleted file mode 100644 index 978d2925e..000000000 --- a/packages/Catch2/src/catch2/catch_reporter_registrars.hpp +++ /dev/null @@ -1,83 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -#ifndef CATCH_REPORTER_REGISTRARS_HPP_INCLUDED -#define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED - -#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> -#include <catch2/interfaces/catch_interfaces_reporter.hpp> -#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> -#include <catch2/internal/catch_unique_ptr.hpp> - -namespace Catch { - - struct IStreamingReporter; - using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; - - template <typename T> - class ReporterFactory : public IReporterFactory { - - IStreamingReporterPtr create( ReporterConfig const& config ) const override { - return Detail::make_unique<T>( config ); - } - - std::string getDescription() const override { - return T::getDescription(); - } - }; - - - template<typename T> - class ReporterRegistrar { - public: - explicit ReporterRegistrar( std::string const& name ) { - getMutableRegistryHub().registerReporter( name, Detail::make_unique<ReporterFactory<T>>() ); - } - }; - - template<typename T> - class ListenerRegistrar { - - class ListenerFactory : public IReporterFactory { - - IStreamingReporterPtr create( ReporterConfig const& config ) const override { - return Detail::make_unique<T>(config); - } - std::string getDescription() const override { - return std::string(); - } - }; - - public: - - ListenerRegistrar() { - getMutableRegistryHub().registerListener( Detail::make_unique<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 // CATCH_REPORTER_REGISTRARS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/catch_session.cpp b/packages/Catch2/src/catch2/catch_session.cpp index 9738cbb4f..df92559b5 100644 --- a/packages/Catch2/src/catch2/catch_session.cpp +++ b/packages/Catch2/src/catch2/catch_session.cpp @@ -11,19 +11,22 @@ #include <catch2/internal/catch_list.hpp> #include <catch2/internal/catch_context.hpp> #include <catch2/internal/catch_run_context.hpp> -#include <catch2/internal/catch_stream.hpp> #include <catch2/catch_test_spec.hpp> #include <catch2/catch_version.hpp> #include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/internal/catch_startup_exception_registry.hpp> +#include <catch2/internal/catch_sharding.hpp> #include <catch2/internal/catch_textflow.hpp> #include <catch2/internal/catch_windows_h_proxy.hpp> -#include <catch2/reporters/catch_reporter_listening.hpp> +#include <catch2/reporters/catch_reporter_multi.hpp> #include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_stdstreams.hpp> +#include <catch2/internal/catch_istream.hpp> #include <algorithm> +#include <cassert> #include <iomanip> #include <set> @@ -32,50 +35,77 @@ namespace Catch { namespace { const int MaxExitCode = 255; - IStreamingReporterPtr createReporter(std::string const& reporterName, IConfig const* config) { - auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config); - CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'"); + IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) { + auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config)); + CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << '\''); return reporter; } - IStreamingReporterPtr makeReporter(Config const* config) { - if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { - return createReporter(config->getReporterName(), config); + IEventListenerPtr prepareReporters(Config const* config) { + if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty() + && config->getProcessedReporterSpecs().size() == 1) { + auto const& spec = config->getProcessedReporterSpecs()[0]; + return createReporter( + spec.name, + ReporterConfig( config, + makeStream( spec.outputFilename ), + spec.colourMode, + spec.customOptions ) ); } - auto multi = Detail::make_unique<ListeningReporter>(config); + auto multi = Detail::make_unique<MultiReporter>(config); + auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); for (auto const& listener : listeners) { - multi->addListener(listener->create(Catch::ReporterConfig(config))); + multi->addListener(listener->create(config)); + } + + std::size_t reporterIdx = 0; + for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) { + multi->addReporter( createReporter( + reporterSpec.name, + ReporterConfig( config, + makeStream( reporterSpec.outputFilename ), + reporterSpec.colourMode, + reporterSpec.customOptions ) ) ); + reporterIdx++; } - multi->addReporter(createReporter(config->getReporterName(), config)); + return multi; } class TestGroup { public: - explicit TestGroup(IStreamingReporterPtr&& reporter, Config const* config): + explicit TestGroup(IEventListenerPtr&& reporter, Config const* config): m_reporter(reporter.get()), m_config{config}, m_context{config, CATCH_MOVE(reporter)} { - auto const& allTestCases = getAllTestCasesSorted(*m_config); - m_matches = m_config->testSpec().matchesByFilter(allTestCases, *m_config); - auto const& invalidArgs = m_config->testSpec().getInvalidArgs(); + assert( m_config->testSpec().getInvalidSpecs().empty() && + "Invalid test specs should be handled before running tests" ); - if (m_matches.empty() && invalidArgs.empty()) { - for (auto const& test : allTestCases) - if (!test.getTestCaseInfo().isHidden()) - m_tests.emplace(&test); + auto const& allTestCases = getAllTestCasesSorted(*m_config); + auto const& testSpec = m_config->testSpec(); + if ( !testSpec.hasFilters() ) { + for ( auto const& test : allTestCases ) { + if ( !test.getTestCaseInfo().isHidden() ) { + m_tests.emplace( &test ); + } + } } else { - for (auto const& match : m_matches) - m_tests.insert(match.tests.begin(), match.tests.end()); + m_matches = + testSpec.matchesByFilter( allTestCases, *m_config ); + for ( auto const& match : m_matches ) { + m_tests.insert( match.tests.begin(), + match.tests.end() ); + } } + + m_tests = createShard(m_tests, m_config->shardCount(), m_config->shardIndex()); } Totals execute() { - auto const& invalidArgs = m_config->testSpec().getInvalidArgs(); Totals totals; for (auto const& testCase : m_tests) { if (!m_context.aborting()) @@ -86,27 +116,26 @@ namespace Catch { for (auto const& match : m_matches) { if (match.tests.empty()) { - m_reporter->noMatchingTestCases(match.name); - totals.error = -1; + m_unmatchedTestSpecs = true; + m_reporter->noMatchingTestCases( match.name ); } } - if (!invalidArgs.empty()) { - for (auto const& invalidArg: invalidArgs) - m_reporter->reportInvalidArguments(invalidArg); - } - return totals; } - private: - using Tests = std::set<TestCaseHandle const*>; + bool hadUnmatchedTestSpecs() const { + return m_unmatchedTestSpecs; + } + - IStreamingReporter* m_reporter; + private: + IEventListener* m_reporter; Config const* m_config; RunContext m_context; - Tests m_tests; + std::set<TestCaseHandle const*> m_tests; TestSpec::Matches m_matches; + bool m_unmatchedTestSpecs = false; }; void applyFilenamesAsTags() { @@ -132,14 +161,17 @@ namespace Catch { getCurrentMutableContext().setConfig(m_config.get()); m_startupExceptions = true; - Colour colourGuard( Colour::Red ); - Catch::cerr() << "Errors occurred during startup!" << '\n'; + auto errStream = makeStream( "%stderr" ); + auto colourImpl = makeColourImpl( + ColourMode::PlatformDefault, errStream.get() ); + auto guard = colourImpl->guardColour( Colour::Red ); + errStream->stream() << "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() << TextFlow::Column( ex.what() ).indent(2) << '\n'; + errStream->stream() << TextFlow::Column( ex.what() ).indent(2) << '\n'; } } } @@ -154,7 +186,7 @@ namespace Catch { void Session::showHelp() const { Catch::cout() - << "\nCatch v" << libraryVersion() << '\n' + << "\nCatch2 v" << libraryVersion() << '\n' << m_cli << '\n' << "For more detailed usage please see the project docs\n\n" << std::flush; } @@ -162,7 +194,7 @@ namespace Catch { 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) << "framework: " << "Catch2\n" << std::left << std::setw(16) << "version: " << libraryVersion() << '\n' << std::flush; } @@ -171,15 +203,19 @@ namespace Catch { return 1; auto result = m_cli.parse( Clara::Args( argc, argv ) ); + if( !result ) { config(); getCurrentMutableContext().setConfig(m_config.get()); - Catch::cerr() - << Colour( Colour::Red ) + auto errStream = makeStream( "%stderr" ); + auto colour = makeColourImpl( ColourMode::PlatformDefault, errStream.get() ); + + errStream->stream() + << colour->guardColour( Colour::Red ) << "\nError(s) in input:\n" << TextFlow::Column( result.errorMessage() ).indent( 2 ) << "\n\n"; - Catch::cerr() << "Run with -? for usage\n\n" << std::flush; + errStream->stream() << "Run with -? for usage\n\n" << std::flush; return MaxExitCode; } @@ -187,6 +223,7 @@ namespace Catch { showHelp(); if( m_configData.libIdentify ) libIdentify(); + m_config.reset(); return 0; } @@ -256,6 +293,14 @@ namespace Catch { return 0; } + if ( m_configData.shardIndex >= m_configData.shardCount ) { + Catch::cerr() << "The shard count (" << m_configData.shardCount + << ") must be greater than the shard index (" + << m_configData.shardIndex << ")\n" + << std::flush; + return 1; + } + CATCH_TRY { config(); // Force config to be constructed @@ -269,7 +314,16 @@ namespace Catch { getCurrentMutableContext().setConfig(m_config.get()); // Create reporter(s) so we can route listings through them - auto reporter = makeReporter(m_config.get()); + auto reporter = prepareReporters(m_config.get()); + + auto const& invalidSpecs = m_config->testSpec().getInvalidSpecs(); + if ( !invalidSpecs.empty() ) { + for ( auto const& spec : invalidSpecs ) { + reporter->reportInvalidTestSpec( spec ); + } + return 1; + } + // Handle list request if (list(*reporter, *m_config)) { @@ -279,13 +333,20 @@ namespace Catch { TestGroup tests { CATCH_MOVE(reporter), m_config.get() }; auto const totals = tests.execute(); - if( m_config->warnAboutNoTests() && totals.error == -1 ) + if ( tests.hadUnmatchedTestSpecs() + && m_config->warnAboutUnmatchedTestSpecs() ) { + return 3; + } + + if ( totals.testCases.total() == 0 + && !m_config->zeroTestsCountAsSuccess() ) { 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))); + return (std::min) (MaxExitCode, static_cast<int>(totals.assertions.failed)); } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch( std::exception& ex ) { diff --git a/packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp b/packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp new file mode 100644 index 000000000..d3e10cb06 --- /dev/null +++ b/packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.cpp @@ -0,0 +1,24 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_tag_alias_autoregistrar.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> + +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/packages/Catch2/src/catch2/catch_test_case_info.cpp b/packages/Catch2/src/catch2/catch_test_case_info.cpp index 7dab6ae48..c1a0a4310 100644 --- a/packages/Catch2/src/catch2/catch_test_case_info.cpp +++ b/packages/Catch2/src/catch2/catch_test_case_info.cpp @@ -7,9 +7,8 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_case_info.hpp> #include <catch2/internal/catch_enforce.hpp> -#include <catch2/catch_test_spec.hpp> -#include <catch2/interfaces/catch_interfaces_testcase.hpp> #include <catch2/internal/catch_string_manip.hpp> +#include <catch2/internal/catch_case_insensitive_comparisons.hpp> #include <cassert> #include <cctype> @@ -59,7 +58,7 @@ namespace Catch { else if( tag == "!nonportable"_sr ) return TestCaseProperties::NonPortable; else if( tag == "!benchmark"_sr ) - return static_cast<TestCaseProperties>(TestCaseProperties::Benchmark | TestCaseProperties::IsHidden ); + return TestCaseProperties::Benchmark | TestCaseProperties::IsHidden; else return TestCaseProperties::None; } @@ -103,18 +102,23 @@ namespace Catch { } } // end unnamed namespace - bool operator<( Tag const& lhs, Tag const& rhs ) { - return lhs.original < rhs.original; + bool operator<( Tag const& lhs, Tag const& rhs ) { + Detail::CaseInsensitiveLess cmp; + return cmp( lhs.original, rhs.original ); + } + bool operator==( Tag const& lhs, Tag const& rhs ) { + Detail::CaseInsensitiveEqualTo cmp; + return cmp( lhs.original, rhs.original ); } Detail::unique_ptr<TestCaseInfo> - makeTestCaseInfo(std::string const& _className, + makeTestCaseInfo(StringRef _className, NameAndTags const& nameAndTags, SourceLineInfo const& _lineInfo ) { return Detail::make_unique<TestCaseInfo>(_className, nameAndTags, _lineInfo); } - TestCaseInfo::TestCaseInfo(std::string const& _className, + TestCaseInfo::TestCaseInfo(StringRef _className, NameAndTags const& _nameAndTags, SourceLineInfo const& _lineInfo): name( _nameAndTags.name.empty() ? makeDefaultName() : _nameAndTags.name ), @@ -126,7 +130,6 @@ namespace Catch { // (including optional hidden tag and filename tag) auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file); backingTags.reserve(requiredSize); - backingLCaseTags.reserve(requiredSize); // We cannot copy the tags directly, as we need to normalize // some tags, so that [.foo] is copied as [.][foo]. @@ -172,9 +175,8 @@ namespace Catch { } // Sort and prepare tags - toLowerInPlace(backingLCaseTags); - std::sort(begin(tags), end(tags), [](Tag lhs, Tag rhs) { return lhs.lowerCased < rhs.lowerCased; }); - tags.erase(std::unique(begin(tags), end(tags), [](Tag lhs, Tag rhs) {return lhs.lowerCased == rhs.lowerCased; }), + std::sort(begin(tags), end(tags)); + tags.erase(std::unique(begin(tags), end(tags)), end(tags)); } @@ -195,9 +197,6 @@ namespace Catch { std::string combined("#"); combined += extractFilenamePart(lineInfo.file); internalAppendTag(combined); - // TBD: Running this over all tags again is inefficient, but - // simple enough. In practice, the overhead is small enough. - toLowerInPlace(backingLCaseTags); } std::string TestCaseInfo::tagsAsString() const { @@ -223,13 +222,7 @@ namespace Catch { backingTags += tagStr; const auto backingEnd = backingTags.size(); backingTags += ']'; - backingLCaseTags += '['; - // We append the tag to the lower-case backing storage as-is, - // because we will perform the lower casing later, in bulk - backingLCaseTags += tagStr; - backingLCaseTags += ']'; - tags.emplace_back(StringRef(backingTags.c_str() + backingStart, backingEnd - backingStart), - StringRef(backingLCaseTags.c_str() + backingStart, backingEnd - backingStart)); + tags.emplace_back(StringRef(backingTags.c_str() + backingStart, backingEnd - backingStart)); } bool operator<( TestCaseInfo const& lhs, TestCaseInfo const& rhs ) { diff --git a/packages/Catch2/src/catch2/catch_test_case_info.hpp b/packages/Catch2/src/catch2/catch_test_case_info.hpp index 8048bd3a3..6cfc2aaf9 100644 --- a/packages/Catch2/src/catch2/catch_test_case_info.hpp +++ b/packages/Catch2/src/catch2/catch_test_case_info.hpp @@ -25,16 +25,24 @@ namespace Catch { + /** + * A **view** of a tag string that provides case insensitive comparisons + * + * Note that in Catch2 internals, the square brackets around tags are + * not a part of tag's representation, so e.g. "[cool-tag]" is represented + * as "cool-tag" internally. + */ struct Tag { - Tag(StringRef original_, StringRef lowerCased_): - original(original_), lowerCased(lowerCased_) + constexpr Tag(StringRef original_): + original(original_) {} - StringRef original, lowerCased; + StringRef original; - friend bool operator<( Tag const& lhs, Tag const& rhs ); + friend bool operator< ( Tag const& lhs, Tag const& rhs ); + friend bool operator==( Tag const& lhs, Tag const& rhs ); }; - struct ITestInvoker; + class ITestInvoker; enum class TestCaseProperties : uint8_t { None = 0, @@ -57,7 +65,7 @@ namespace Catch { */ struct TestCaseInfo : Detail::NonCopyable { - TestCaseInfo(std::string const& _className, + TestCaseInfo(StringRef _className, NameAndTags const& _tags, SourceLineInfo const& _lineInfo); @@ -77,9 +85,9 @@ namespace Catch { std::string tagsAsString() const; std::string name; - std::string className; + StringRef className; private: - std::string backingTags, backingLCaseTags; + std::string backingTags; // Internally we copy tags to the backing storage and then add // refs to this storage to the tags vector. void internalAppendTag(StringRef tagString); @@ -109,9 +117,10 @@ namespace Catch { TestCaseInfo const& getTestCaseInfo() const; }; - Detail::unique_ptr<TestCaseInfo> makeTestCaseInfo( std::string const& className, - NameAndTags const& nameAndTags, - SourceLineInfo const& lineInfo ); + Detail::unique_ptr<TestCaseInfo> + makeTestCaseInfo( StringRef className, + NameAndTags const& nameAndTags, + SourceLineInfo const& lineInfo ); } #ifdef __clang__ diff --git a/packages/Catch2/src/catch2/catch_test_macros.hpp b/packages/Catch2/src/catch2/catch_test_macros.hpp index 918fd4bff..e92a45f0f 100644 --- a/packages/Catch2/src/catch2/catch_test_macros.hpp +++ b/packages/Catch2/src/catch2/catch_test_macros.hpp @@ -10,7 +10,7 @@ #include <catch2/internal/catch_test_macro_impl.hpp> #include <catch2/catch_message.hpp> -#include <catch2/internal/catch_preprocessor.hpp> +#include <catch2/catch_user_config.hpp> #include <catch2/internal/catch_section.hpp> #include <catch2/internal/catch_test_registry.hpp> #include <catch2/internal/catch_unique_name.hpp> @@ -54,9 +54,13 @@ #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__ ) + #define CATCH_STATIC_CHECK( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ ) + #define CATCH_STATIC_CHECK_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__ ) + #define CATCH_STATIC_CHECK( ... ) CATCH_CHECK( __VA_ARGS__ ) + #define CATCH_STATIC_CHECK_FALSE( ... ) CATCH_CHECK_FALSE( __VA_ARGS__ ) #endif @@ -101,6 +105,8 @@ #define CATCH_STATIC_REQUIRE( ... ) (void)(0) #define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0) + #define CATCH_STATIC_CHECK( ... ) (void)(0) + #define CATCH_STATIC_CHECK_FALSE( ... ) (void)(0) // "BDD-style" convenience wrappers #define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) @@ -145,9 +151,13 @@ #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__ ")" ) + #define STATIC_CHECK( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ ) + #define STATIC_CHECK_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__ ) + #define STATIC_CHECK( ... ) CHECK( __VA_ARGS__ ) + #define STATIC_CHECK_FALSE( ... ) CHECK_FALSE( __VA_ARGS__ ) #endif // "BDD-style" convenience wrappers @@ -191,6 +201,8 @@ #define STATIC_REQUIRE( ... ) (void)(0) #define STATIC_REQUIRE_FALSE( ... ) (void)(0) + #define STATIC_CHECK( ... ) (void)(0) + #define STATIC_CHECK_FALSE( ... ) (void)(0) // "BDD-style" convenience wrappers #define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ) ) diff --git a/packages/Catch2/src/catch2/catch_test_spec.cpp b/packages/Catch2/src/catch2/catch_test_spec.cpp index df0d570f6..a3235d432 100644 --- a/packages/Catch2/src/catch2/catch_test_spec.cpp +++ b/packages/Catch2/src/catch2/catch_test_spec.cpp @@ -38,15 +38,13 @@ namespace Catch { TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString ) : Pattern( filterString ) - , m_tag( toLower( tag ) ) + , m_tag( tag ) {} bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const { - return std::find_if(begin(testCase.tags), - end(testCase.tags), - [&](Tag const& tag) { - return tag.lowerCased == m_tag; - }) != end(testCase.tags); + return std::find( begin( testCase.tags ), + end( testCase.tags ), + Tag( m_tag ) ) != end( testCase.tags ); } bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const { @@ -98,8 +96,8 @@ namespace Catch { return matches; } - const TestSpec::vectorStrings& TestSpec::getInvalidArgs() const{ - return (m_invalidArgs); + const TestSpec::vectorStrings& TestSpec::getInvalidSpecs() const { + return m_invalidSpecs; } } diff --git a/packages/Catch2/src/catch2/catch_test_spec.hpp b/packages/Catch2/src/catch2/catch_test_spec.hpp index c8804a2cb..499bfaa56 100644 --- a/packages/Catch2/src/catch2/catch_test_spec.hpp +++ b/packages/Catch2/src/catch2/catch_test_spec.hpp @@ -21,7 +21,7 @@ namespace Catch { - struct IConfig; + class IConfig; struct TestCaseInfo; class TestCaseHandle; @@ -72,11 +72,11 @@ namespace Catch { bool hasFilters() const; bool matches( TestCaseInfo const& testCase ) const; Matches matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const; - const vectorStrings & getInvalidArgs() const; + const vectorStrings & getInvalidSpecs() const; private: std::vector<Filter> m_filters; - std::vector<std::string> m_invalidArgs; + std::vector<std::string> m_invalidSpecs; friend class TestSpecParser; }; } diff --git a/packages/Catch2/src/catch2/catch_timer.cpp b/packages/Catch2/src/catch2/catch_timer.cpp index 659292dd1..d67d94ca6 100644 --- a/packages/Catch2/src/catch2/catch_timer.cpp +++ b/packages/Catch2/src/catch2/catch_timer.cpp @@ -9,49 +9,13 @@ #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; + static auto getCurrentNanosecondsSinceEpoch() -> uint64_t { + return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); } - } - auto getEstimatedClockResolution() -> uint64_t { - static auto s_resolution = estimateClockResolution(); - return s_resolution; - } + } // end unnamed namespace void Timer::start() { m_nanoseconds = getCurrentNanosecondsSinceEpoch(); diff --git a/packages/Catch2/src/catch2/catch_timer.hpp b/packages/Catch2/src/catch2/catch_timer.hpp index 03bbf4971..30e814150 100644 --- a/packages/Catch2/src/catch2/catch_timer.hpp +++ b/packages/Catch2/src/catch2/catch_timer.hpp @@ -12,9 +12,6 @@ namespace Catch { - auto getCurrentNanosecondsSinceEpoch() -> uint64_t; - auto getEstimatedClockResolution() -> uint64_t; - class Timer { uint64_t m_nanoseconds = 0; public: diff --git a/packages/Catch2/src/catch2/catch_tostring.hpp b/packages/Catch2/src/catch2/catch_tostring.hpp index e82552bf8..964c8a665 100644 --- a/packages/Catch2/src/catch2/catch_tostring.hpp +++ b/packages/Catch2/src/catch2/catch_tostring.hpp @@ -14,9 +14,11 @@ #include <type_traits> #include <string> #include <string.h> + #include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_config_wchar.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> +#include <catch2/internal/catch_void_type.hpp> #include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp> #ifdef CATCH_CONFIG_CPP17_STRING_VIEW @@ -203,7 +205,7 @@ namespace Catch { }; #endif // CATCH_CONFIG_WCHAR - template<int SZ> + template<size_t SZ> struct StringMaker<char[SZ]> { static std::string convert(char const* str) { // Note that `strnlen` is not actually part of standard C++, @@ -212,7 +214,7 @@ namespace Catch { StringRef( str, strnlen( str, SZ ) ) ); } }; - template<int SZ> + template<size_t SZ> struct StringMaker<signed char[SZ]> { static std::string convert(signed char const* str) { // See the plain `char const*` overload @@ -221,7 +223,7 @@ namespace Catch { StringRef(reinterpreted, strnlen(reinterpreted, SZ))); } }; - template<int SZ> + template<size_t SZ> struct StringMaker<unsigned char[SZ]> { static std::string convert(unsigned char const* str) { // See the plain `char const*` overload @@ -388,13 +390,11 @@ 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); + return ::Catch::Detail::stringify(*optional); } else { - rss << "{ }"; + return "{ }"; } - return rss.str(); } }; } @@ -476,19 +476,11 @@ namespace Catch { using std::end; namespace Detail { - template <typename...> - struct void_type { - using type = void; - }; - - template <typename... Ts> - using void_type_t = typename void_type<Ts...>::type; - template <typename T, typename = void> struct is_range_impl : std::false_type {}; template <typename T> - struct is_range_impl<T, void_type_t<decltype(begin(std::declval<T>()))>> : std::true_type {}; + struct is_range_impl<T, void_t<decltype(begin(std::declval<T>()))>> : std::true_type {}; } // namespace Detail template <typename T> @@ -530,7 +522,7 @@ namespace Catch { } }; - template <typename T, int SZ> + template <typename T, size_t SZ> struct StringMaker<T[SZ]> { static std::string convert(T const(&arr)[SZ]) { return rangeToString(arr); @@ -560,27 +552,27 @@ struct ratio_string { template <> struct ratio_string<std::atto> { - static std::string symbol() { return "a"; } + static char symbol() { return 'a'; } }; template <> struct ratio_string<std::femto> { - static std::string symbol() { return "f"; } + static char symbol() { return 'f'; } }; template <> struct ratio_string<std::pico> { - static std::string symbol() { return "p"; } + static char symbol() { return 'p'; } }; template <> struct ratio_string<std::nano> { - static std::string symbol() { return "n"; } + static char symbol() { return 'n'; } }; template <> struct ratio_string<std::micro> { - static std::string symbol() { return "u"; } + static char symbol() { return 'u'; } }; template <> struct ratio_string<std::milli> { - static std::string symbol() { return "m"; } + static char symbol() { return 'm'; } }; //////////// diff --git a/packages/Catch2/src/catch2/catch_totals.cpp b/packages/Catch2/src/catch2/catch_totals.cpp index a283c6589..14a23869d 100644 --- a/packages/Catch2/src/catch2/catch_totals.cpp +++ b/packages/Catch2/src/catch2/catch_totals.cpp @@ -24,7 +24,7 @@ namespace Catch { return *this; } - std::size_t Counts::total() const { + std::uint64_t Counts::total() const { return passed + failed + failedButOk; } bool Counts::allPassed() const { diff --git a/packages/Catch2/src/catch2/catch_totals.hpp b/packages/Catch2/src/catch2/catch_totals.hpp index 76d6ae47d..6bc444fc2 100644 --- a/packages/Catch2/src/catch2/catch_totals.hpp +++ b/packages/Catch2/src/catch2/catch_totals.hpp @@ -8,7 +8,7 @@ #ifndef CATCH_TOTALS_HPP_INCLUDED #define CATCH_TOTALS_HPP_INCLUDED -#include <cstddef> +#include <cstdint> namespace Catch { @@ -16,13 +16,13 @@ namespace Catch { Counts operator - ( Counts const& other ) const; Counts& operator += ( Counts const& other ); - std::size_t total() const; + std::uint64_t total() const; bool allPassed() const; bool allOk() const; - std::size_t passed = 0; - std::size_t failed = 0; - std::size_t failedButOk = 0; + std::uint64_t passed = 0; + std::uint64_t failed = 0; + std::uint64_t failedButOk = 0; }; struct Totals { @@ -32,7 +32,6 @@ namespace Catch { Totals delta( Totals const& prevTotals ) const; - int error = 0; Counts assertions; Counts testCases; }; diff --git a/packages/Catch2/src/catch2/catch_translate_exception.hpp b/packages/Catch2/src/catch2/catch_translate_exception.hpp index dfd95cd69..4a0be629d 100644 --- a/packages/Catch2/src/catch2/catch_translate_exception.hpp +++ b/packages/Catch2/src/catch2/catch_translate_exception.hpp @@ -81,4 +81,4 @@ namespace Catch { #endif -#endif // CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED \ No newline at end of file +#endif // CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/catch_user_config.hpp.in b/packages/Catch2/src/catch2/catch_user_config.hpp.in new file mode 100644 index 000000000..77c94291c --- /dev/null +++ b/packages/Catch2/src/catch2/catch_user_config.hpp.in @@ -0,0 +1,198 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * **AUTOGENERATED FROM CMAKE CONFIGURATION** + * + * Contains materialized compile-time configuration provided to Catch2's + * CMake configuration. All compile-time configuration options need to + * be here, and also documented in `docs/configuration.md`. + */ + +#ifndef CATCH_USER_CONFIG_HPP_INCLUDED +#define CATCH_USER_CONFIG_HPP_INCLUDED + + +// ------ +// Overridable compilation flags, +// these can have 3 "states": Force Yes, Force No, Use Default. +// Setting both Force Yes and Force No is an error +// ------ + +#cmakedefine CATCH_CONFIG_ANDROID_LOGWRITE +#cmakedefine CATCH_CONFIG_NO_ANDROID_LOGWRITE + +#if defined( CATCH_CONFIG_ANDROID_LOGWRITE ) && \ + defined( CATCH_CONFIG_NO_ANDROID_LOGWRITE ) +# error Cannot force ANDROID_LOGWRITE to both ON and OFF +#endif + +#cmakedefine CATCH_CONFIG_COLOUR_WIN32 +#cmakedefine CATCH_CONFIG_NO_COLOUR_WIN32 + +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) && \ + defined( CATCH_CONFIG_NO_COLOUR_WIN32 ) +# error Cannot force COLOUR_WIN32 to be ON and OFF +#endif + +#cmakedefine CATCH_CONFIG_COUNTER +#cmakedefine CATCH_CONFIG_NO_COUNTER + +#if defined( CATCH_CONFIG_COUNTER ) && \ + defined( CATCH_CONFIG_NO_COUNTER ) +# error Cannot force COUNTER to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_CPP11_TO_STRING +#cmakedefine CATCH_CONFIG_NO_CPP11_TO_STRING + +#if defined( CATCH_CONFIG_CPP11_TO_STRING ) && \ + defined( CATCH_CONFIG_NO_CPP11_TO_STRING ) +# error Cannot force CPP11_TO_STRING to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_CPP17_BYTE +#cmakedefine CATCH_CONFIG_NO_CPP17_BYTE + +#if defined( CATCH_CONFIG_CPP17_BYTE ) && \ + defined( CATCH_CONFIG_NO_CPP17_BYTE ) +# error Cannot force CPP17_BYTE to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_CPP17_OPTIONAL +#cmakedefine CATCH_CONFIG_NO_CPP17_OPTIONAL + +#if defined( CATCH_CONFIG_CPP17_OPTIONAL ) && \ + defined( CATCH_CONFIG_NO_CPP17_OPTIONAL ) +# error Cannot force CPP17_OPTIONAL to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_CPP17_STRING_VIEW +#cmakedefine CATCH_CONFIG_NO_CPP17_STRING_VIEW + +#if defined( CATCH_CONFIG_CPP17_STRING_VIEW ) && \ + defined( CATCH_CONFIG_NO_CPP17_STRING_VIEW ) +# error Cannot force CPP17_STRING_VIEW to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#cmakedefine CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS + +#if defined( CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS ) && \ + defined( CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS ) +# error Cannot force CPP17_UNCAUGHT_EXCEPTIONS to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_CPP17_VARIANT +#cmakedefine CATCH_CONFIG_NO_CPP17_VARIANT + +#if defined( CATCH_CONFIG_CPP17_VARIANT ) && \ + defined( CATCH_CONFIG_NO_CPP17_VARIANT ) +# error Cannot force CPP17_VARIANT to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_GLOBAL_NEXTAFTER +#cmakedefine CATCH_CONFIG_NO_GLOBAL_NEXTAFTER + +#if defined( CATCH_CONFIG_GLOBAL_NEXTAFTER ) && \ + defined( CATCH_CONFIG_NO_GLOBAL_NEXTAFTER ) +# error Cannot force GLOBAL_NEXTAFTER to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_POSIX_SIGNALS +#cmakedefine CATCH_CONFIG_NO_POSIX_SIGNALS + +#if defined( CATCH_CONFIG_POSIX_SIGNALS ) && \ + defined( CATCH_CONFIG_NO_POSIX_SIGNALS ) +# error Cannot force POSIX_SIGNALS to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_USE_ASYNC +#cmakedefine CATCH_CONFIG_NO_USE_ASYNC + +#if defined( CATCH_CONFIG_USE_ASYNC ) && \ + defined( CATCH_CONFIG_NO_USE_ASYNC ) +# error Cannot force USE_ASYNC to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_WCHAR +#cmakedefine CATCH_CONFIG_NO_WCHAR + +#if defined( CATCH_CONFIG_WCHAR ) && \ + defined( CATCH_CONFIG_NO_WCHAR ) +# error Cannot force WCHAR to both ON and OFF +#endif + + + +#cmakedefine CATCH_CONFIG_WINDOWS_SEH +#cmakedefine CATCH_CONFIG_NO_WINDOWS_SEH + +#if defined( CATCH_CONFIG_WINDOWS_SEH ) && \ + defined( CATCH_CONFIG_NO_WINDOWS_SEH ) +# error Cannot force WINDOWS_SEH to both ON and OFF +#endif + + +// ------ +// Simple toggle defines +// their value is never used and they cannot be overriden +// ------ + + +#cmakedefine CATCH_CONFIG_BAZEL_SUPPORT +#cmakedefine CATCH_CONFIG_DISABLE_EXCEPTIONS +#cmakedefine CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER +#cmakedefine CATCH_CONFIG_DISABLE +#cmakedefine CATCH_CONFIG_DISABLE_STRINGIFICATION +#cmakedefine CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS +#cmakedefine CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER +#cmakedefine CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER +#cmakedefine CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER +#cmakedefine CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER +#cmakedefine CATCH_CONFIG_EXPERIMENTAL_REDIRECT +#cmakedefine CATCH_CONFIG_FAST_COMPILE +#cmakedefine CATCH_CONFIG_NOSTDOUT +#cmakedefine CATCH_CONFIG_PREFIX_ALL +#cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG + + +// ------ +// "Variable" defines, these have actual values +// ------ + +#define CATCH_CONFIG_DEFAULT_REPORTER "@CATCH_CONFIG_DEFAULT_REPORTER@" +#define CATCH_CONFIG_CONSOLE_WIDTH @CATCH_CONFIG_CONSOLE_WIDTH@ + +// Unlike the macros above, CATCH_CONFIG_FALLBACK_STRINGIFIER does not +// have a good default value, so we cannot always define it, and cannot +// even expose it as a variable in CMake. The users will have to find +// out about it from docs and set it only if they use it. +#cmakedefine CATCH_CONFIG_FALLBACK_STRINGIFIER @CATCH_CONFIG_FALLBACK_STRINGIFIER@ + +#endif // CATCH_USER_CONFIG_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/catch_version.cpp b/packages/Catch2/src/catch2/catch_version.cpp index 96ab36407..a7075f300 100644 --- a/packages/Catch2/src/catch2/catch_version.cpp +++ b/packages/Catch2/src/catch2/catch_version.cpp @@ -36,7 +36,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 3, 0, 0, "preview", 3 ); + static Version version( 3, 1, 0, "", 0 ); return version; } diff --git a/packages/Catch2/src/catch2/catch_version_macros.hpp b/packages/Catch2/src/catch2/catch_version_macros.hpp index 51e50c5ce..c7212e3a6 100644 --- a/packages/Catch2/src/catch2/catch_version_macros.hpp +++ b/packages/Catch2/src/catch2/catch_version_macros.hpp @@ -9,7 +9,7 @@ #define CATCH_VERSION_MACROS_HPP_INCLUDED #define CATCH_VERSION_MAJOR 3 -#define CATCH_VERSION_MINOR 0 +#define CATCH_VERSION_MINOR 1 #define CATCH_VERSION_PATCH 0 #endif // CATCH_VERSION_MACROS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/generators/catch_generator_exception.cpp b/packages/Catch2/src/catch2/generators/catch_generator_exception.cpp new file mode 100644 index 000000000..70a991e3c --- /dev/null +++ b/packages/Catch2/src/catch2/generators/catch_generator_exception.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/generators/catch_generator_exception.hpp> + +namespace Catch { + + const char* GeneratorException::what() const noexcept { + return m_msg; + } + +} // end namespace Catch diff --git a/packages/Catch2/src/catch2/generators/internal/catch_generators_combined_tu.cpp b/packages/Catch2/src/catch2/generators/catch_generators.cpp similarity index 52% rename from packages/Catch2/src/catch2/generators/internal/catch_generators_combined_tu.cpp rename to packages/Catch2/src/catch2/generators/catch_generators.cpp index da1b62e9d..3e09bfd9e 100644 --- a/packages/Catch2/src/catch2/generators/internal/catch_generators_combined_tu.cpp +++ b/packages/Catch2/src/catch2/generators/catch_generators.cpp @@ -5,36 +5,6 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small generator-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -//////////////////////////////////////////////////// -// vvv formerly catch_generator_exception.cpp vvv // -//////////////////////////////////////////////////// - -#include <catch2/generators/catch_generator_exception.hpp> - -namespace Catch { - - const char* GeneratorException::what() const noexcept { - return m_msg; - } - -} // end namespace Catch - - -/////////////////////////////////////////// -// vvv formerly catch_generators.cpp vvv // -/////////////////////////////////////////// #include <catch2/generators/catch_generators.hpp> #include <catch2/internal/catch_enforce.hpp> diff --git a/packages/Catch2/src/catch2/generators/catch_generators.hpp b/packages/Catch2/src/catch2/generators/catch_generators.hpp index 9ffb9b76d..1de04e3bd 100644 --- a/packages/Catch2/src/catch2/generators/catch_generators.hpp +++ b/packages/Catch2/src/catch2/generators/catch_generators.hpp @@ -8,10 +8,13 @@ #ifndef CATCH_GENERATORS_HPP_INCLUDED #define CATCH_GENERATORS_HPP_INCLUDED +#include <catch2/catch_tostring.hpp> #include <catch2/interfaces/catch_interfaces_generatortracker.hpp> #include <catch2/internal/catch_source_line_info.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_unique_name.hpp> +#include <catch2/internal/catch_preprocessor.hpp> #include <vector> #include <tuple> @@ -29,7 +32,12 @@ namespace Detail { } // end namespace detail template<typename T> - struct IGenerator : GeneratorUntypedBase { + class IGenerator : public GeneratorUntypedBase { + std::string stringifyImpl() const override { + return ::Catch::Detail::stringify( get() ); + } + + public: ~IGenerator() override = default; IGenerator() = default; IGenerator(IGenerator const&) = default; @@ -61,7 +69,7 @@ namespace Detail { return m_generator->get(); } bool next() { - return m_generator->next(); + return m_generator->countedNext(); } }; diff --git a/packages/Catch2/src/catch2/generators/catch_generators_random.cpp b/packages/Catch2/src/catch2/generators/catch_generators_random.cpp new file mode 100644 index 000000000..57ad17455 --- /dev/null +++ b/packages/Catch2/src/catch2/generators/catch_generators_random.cpp @@ -0,0 +1,13 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/generators/catch_generators_random.hpp> + +#include <catch2/internal/catch_context.hpp> + +std::uint32_t Catch::Generators::Detail::getSeed() { return sharedRng()(); } diff --git a/packages/Catch2/src/catch2/generators/catch_generators_random.hpp b/packages/Catch2/src/catch2/generators/catch_generators_random.hpp index cc66f9080..e9ff92084 100644 --- a/packages/Catch2/src/catch2/generators/catch_generators_random.hpp +++ b/packages/Catch2/src/catch2/generators/catch_generators_random.hpp @@ -16,16 +16,21 @@ namespace Catch { namespace Generators { +namespace Detail { + // Returns a suitable seed for a random floating generator based off + // the primary internal rng. It does so by taking current value from + // the rng and returning it as the seed. + std::uint32_t getSeed(); +} template <typename Float> class RandomFloatingGenerator final : public IGenerator<Float> { - Catch::SimplePcg32& m_rng; + Catch::SimplePcg32 m_rng; std::uniform_real_distribution<Float> m_dist; Float m_current_number; public: - - RandomFloatingGenerator(Float a, Float b): - m_rng(rng()), + RandomFloatingGenerator( Float a, Float b, std::uint32_t seed ): + m_rng(seed), m_dist(a, b) { static_cast<void>(next()); } @@ -41,13 +46,12 @@ public: template <typename Integer> class RandomIntegerGenerator final : public IGenerator<Integer> { - Catch::SimplePcg32& m_rng; + Catch::SimplePcg32 m_rng; std::uniform_int_distribution<Integer> m_dist; Integer m_current_number; public: - - RandomIntegerGenerator(Integer a, Integer b): - m_rng(rng()), + RandomIntegerGenerator( Integer a, Integer b, std::uint32_t seed ): + m_rng(seed), m_dist(a, b) { static_cast<void>(next()); } @@ -61,14 +65,19 @@ public: } }; -// 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> -std::enable_if_t<std::is_integral<T>::value && !std::is_same<T, bool>::value, -GeneratorWrapper<T>> +std::enable_if_t<std::is_integral<T>::value, GeneratorWrapper<T>> random(T a, T b) { + static_assert( + !std::is_same<T, char>::value && + !std::is_same<T, int8_t>::value && + !std::is_same<T, uint8_t>::value && + !std::is_same<T, signed char>::value && + !std::is_same<T, unsigned char>::value && + !std::is_same<T, bool>::value, + "The requested type is not supported by the underlying random distributions from std" ); return GeneratorWrapper<T>( - Catch::Detail::make_unique<RandomIntegerGenerator<T>>(a, b) + Catch::Detail::make_unique<RandomIntegerGenerator<T>>(a, b, Detail::getSeed()) ); } @@ -77,7 +86,7 @@ std::enable_if_t<std::is_floating_point<T>::value, GeneratorWrapper<T>> random(T a, T b) { return GeneratorWrapper<T>( - Catch::Detail::make_unique<RandomFloatingGenerator<T>>(a, b) + Catch::Detail::make_unique<RandomFloatingGenerator<T>>(a, b, Detail::getSeed()) ); } diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp new file mode 100644 index 000000000..fb98a75d8 --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.cpp @@ -0,0 +1,13 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_capture.hpp> + +namespace Catch { + IResultCapture::~IResultCapture() = default; +} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp index 2e7a631f1..6981e724b 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp @@ -26,15 +26,15 @@ namespace Catch { struct AssertionReaction; struct SourceLineInfo; - struct ITransientExpression; - struct IGeneratorTracker; + class ITransientExpression; + class IGeneratorTracker; struct BenchmarkInfo; template <typename Duration = std::chrono::duration<double, std::nano>> struct BenchmarkStats; - struct IResultCapture { - + class IResultCapture { + public: virtual ~IResultCapture(); virtual bool sectionStarted( SectionInfo const& sectionInfo, diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp deleted file mode 100644 index 7acf0a124..000000000 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp +++ /dev/null @@ -1,88 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small interfaces-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -/////////////////////////////////////////////////// -// vvv formerly catch_interfaces_capture.cpp vvv // -/////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_capture.hpp> - -namespace Catch { - IResultCapture::~IResultCapture() = default; -} - - -////////////////////////////////////////////////// -// vvv formerly catch_interfaces_config.cpp vvv // -////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_config.hpp> - -namespace Catch { - IConfig::~IConfig() = default; -} - - -///////////////////////////////////////////////////// -// vvv formerly catch_interfaces_exception.cpp vvv // -///////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_exception.hpp> - -namespace Catch { - IExceptionTranslator::~IExceptionTranslator() = default; - IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default; -} - - -//////////////////////////////////////////////////////// -// vvv formerly catch_interfaces_registry_hub.cpp vvv // -//////////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> - -namespace Catch { - IRegistryHub::~IRegistryHub() = default; - IMutableRegistryHub::~IMutableRegistryHub() = default; -} - - -//////////////////////////////////////////////////// -// vvv formerly catch_interfaces_testcase.cpp vvv // -//////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_testcase.hpp> - -namespace Catch { - ITestInvoker::~ITestInvoker() = default; - ITestCaseRegistry::~ITestCaseRegistry() = default; -} - - -#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> -namespace Catch { - IReporterRegistry::~IReporterRegistry() = default; -} - - -#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> - -namespace Catch { - IReporterFactory::~IReporterFactory() = default; -} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp new file mode 100644 index 000000000..13d761dfb --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.cpp @@ -0,0 +1,13 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_config.hpp> + +namespace Catch { + IConfig::~IConfig() = default; +} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp index 60c4e9be8..5e358650a 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp @@ -26,8 +26,10 @@ namespace Catch { struct WarnAbout { enum What { Nothing = 0x00, + //! A test case or leaf section did not run any assertions NoAssertions = 0x01, - NoTests = 0x02 + //! A command line test spec matched no test cases + UnmatchedTestSpec = 0x02, }; }; enum class ShowDurations { @@ -40,10 +42,15 @@ namespace Catch { LexicographicallySorted, Randomized }; - enum class UseColour { - Auto, - Yes, - No + enum class ColourMode : std::uint8_t { + //! Let Catch2 pick implementation based on platform detection + PlatformDefault, + //! Use ANSI colour code escapes + ANSI, + //! Use Win32 console colour API + Win32, + //! Don't use any colour + None }; struct WaitForKeypress { enum When { Never, @@ -53,18 +60,19 @@ namespace Catch { }; }; class TestSpec; + class IStream; - struct IConfig : Detail::NonCopyable { - + class IConfig : public Detail::NonCopyable { + public: virtual ~IConfig(); virtual bool allowThrows() const = 0; - virtual std::ostream& stream() const = 0; virtual StringRef name() const = 0; virtual bool includeSuccessfulResults() const = 0; virtual bool shouldDebugBreak() const = 0; virtual bool warnAboutMissingAssertions() const = 0; - virtual bool warnAboutNoTests() const = 0; + virtual bool warnAboutUnmatchedTestSpecs() const = 0; + virtual bool zeroTestsCountAsSuccess() const = 0; virtual int abortAfter() const = 0; virtual bool showInvisibles() const = 0; virtual ShowDurations showDurations() const = 0; @@ -73,13 +81,16 @@ namespace Catch { virtual bool hasTestFilters() const = 0; virtual std::vector<std::string> const& getTestsOrTags() const = 0; virtual TestRunOrder runOrder() const = 0; - virtual unsigned int rngSeed() const = 0; - virtual UseColour useColour() const = 0; + virtual uint32_t rngSeed() const = 0; + virtual unsigned int shardCount() const = 0; + virtual unsigned int shardIndex() const = 0; + virtual ColourMode defaultColourMode() const = 0; virtual std::vector<std::string> const& getSectionsToRun() const = 0; virtual Verbosity verbosity() const = 0; + virtual bool skipBenchmarks() const = 0; virtual bool benchmarkNoAnalysis() const = 0; - virtual int benchmarkSamples() const = 0; + virtual unsigned int benchmarkSamples() const = 0; virtual double benchmarkConfidenceInterval() const = 0; virtual unsigned int benchmarkResamples() const = 0; virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp index e00f2c9db..cf25d896e 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp @@ -25,7 +25,8 @@ namespace Catch { }; } // namespace Detail - struct IMutableEnumValuesRegistry { + class IMutableEnumValuesRegistry { + public: virtual ~IMutableEnumValuesRegistry(); // = default; virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp new file mode 100644 index 000000000..f0de7450e --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_exception.hpp> + +namespace Catch { + IExceptionTranslator::~IExceptionTranslator() = default; + IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default; +} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp index c18340745..b72b49a10 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp @@ -17,17 +17,18 @@ namespace Catch { using exceptionTranslateFunction = std::string(*)(); - struct IExceptionTranslator; + class IExceptionTranslator; using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>; - struct IExceptionTranslator { + class IExceptionTranslator { + public: virtual ~IExceptionTranslator(); // = default virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0; }; - struct IExceptionTranslatorRegistry { + class IExceptionTranslatorRegistry { + public: virtual ~IExceptionTranslatorRegistry(); // = default - virtual std::string translateActiveException() const = 0; }; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp new file mode 100644 index 000000000..e8c67b543 --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.cpp @@ -0,0 +1,32 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_generatortracker.hpp> +#include <string> + +namespace Catch { + namespace Generators { + + bool GeneratorUntypedBase::countedNext() { + auto ret = next(); + if ( ret ) { + m_stringReprCache.clear(); + ++m_currentElementIndex; + } + return ret; + } + + StringRef GeneratorUntypedBase::currentElementAsString() const { + if ( m_stringReprCache.empty() ) { + m_stringReprCache = stringifyImpl(); + } + return m_stringReprCache; + } + + } // namespace Generators +} // namespace Catch diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.hpp index f1ca34417..83e3d783a 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_generatortracker.hpp @@ -9,11 +9,32 @@ #define CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_stringref.hpp> + +#include <string> namespace Catch { namespace Generators { class GeneratorUntypedBase { + // Caches result from `toStringImpl`, assume that when it is an + // empty string, the cache is invalidated. + mutable std::string m_stringReprCache; + + // Counts based on `next` returning true + std::size_t m_currentElementIndex = 0; + + /** + * 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; + + //! Customization point for `currentElementAsString` + virtual std::string stringifyImpl() const = 0; + public: GeneratorUntypedBase() = default; // Generation of copy ops is deprecated (and Clang will complain) @@ -23,17 +44,41 @@ namespace Catch { virtual ~GeneratorUntypedBase(); // = default; - // 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; + /** + * Attempts to move the generator to the next element + * + * Serves as a non-virtual interface to `next`, so that the + * top level interface can provide sanity checking and shared + * features. + * + * As with `next`, returns true iff the move succeeded and + * the generator has new valid element to provide. + */ + bool countedNext(); + + std::size_t currentElementIndex() const { return m_currentElementIndex; } + + /** + * Returns generator's current element as user-friendly string. + * + * By default returns string equivalent to calling + * `Catch::Detail::stringify` on the current element, but generators + * can customize their implementation as needed. + * + * Not thread-safe due to internal caching. + * + * The returned ref is valid only until the generator instance + * is destructed, or it moves onto the next element, whichever + * comes first. + */ + StringRef currentElementAsString() const; }; using GeneratorBasePtr = Catch::Detail::unique_ptr<GeneratorUntypedBase>; } // namespace Generators - struct IGeneratorTracker { + class IGeneratorTracker { + public: virtual ~IGeneratorTracker(); // = default; virtual auto hasGenerator() const -> bool = 0; virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp new file mode 100644 index 000000000..557f73037 --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> + +namespace Catch { + IRegistryHub::~IRegistryHub() = default; + IMutableRegistryHub::~IMutableRegistryHub() = default; +} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp index aeefeedb5..22e62b796 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp @@ -16,21 +16,23 @@ namespace Catch { class TestCaseHandle; struct TestCaseInfo; - struct ITestCaseRegistry; - struct IExceptionTranslatorRegistry; - struct IExceptionTranslator; - struct IReporterRegistry; - struct IReporterFactory; - struct ITagAliasRegistry; - struct ITestInvoker; - struct IMutableEnumValuesRegistry; + class ITestCaseRegistry; + class IExceptionTranslatorRegistry; + class IExceptionTranslator; + class IReporterRegistry; + class IReporterFactory; + class ITagAliasRegistry; + class ITestInvoker; + class IMutableEnumValuesRegistry; struct SourceLineInfo; class StartupExceptionRegistry; + class EventListenerFactory; using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; - struct IRegistryHub { + class IRegistryHub { + public: virtual ~IRegistryHub(); // = default virtual IReporterRegistry const& getReporterRegistry() const = 0; @@ -42,10 +44,11 @@ namespace Catch { virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0; }; - struct IMutableRegistryHub { + class IMutableRegistryHub { + public: virtual ~IMutableRegistryHub(); // = default virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0; - virtual void registerListener( IReporterFactoryPtr factory ) = 0; + virtual void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) = 0; virtual void registerTest(Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker) = 0; virtual void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) = 0; virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp index 89a86f59a..b1ad584c1 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -14,20 +14,38 @@ #include <catch2/internal/catch_string_manip.hpp> #include <catch2/catch_test_case_info.hpp> #include <catch2/reporters/catch_reporter_helpers.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_istream.hpp> #include <algorithm> +#include <cassert> #include <iomanip> namespace Catch { - ReporterConfig::ReporterConfig( IConfig const* _fullConfig ) - : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} + ReporterConfig::ReporterConfig( + IConfig const* _fullConfig, + Detail::unique_ptr<IStream> _stream, + ColourMode colourMode, + std::map<std::string, std::string> customOptions ): + m_stream( CATCH_MOVE(_stream) ), + m_fullConfig( _fullConfig ), + m_colourMode( colourMode ), + m_customOptions( CATCH_MOVE( customOptions ) ) {} + + Detail::unique_ptr<IStream> ReporterConfig::takeStream() && { + assert( m_stream ); + return CATCH_MOVE( m_stream ); + } + IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; } + ColourMode ReporterConfig::colourMode() const { return m_colourMode; } - ReporterConfig::ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream ) - : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} + std::map<std::string, std::string> const& + ReporterConfig::customOptions() const { + return m_customOptions; + } - std::ostream& ReporterConfig::stream() const { return *m_stream; } - IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; } + ReporterConfig::~ReporterConfig() = default; AssertionStats::AssertionStats( AssertionResult const& _assertionResult, std::vector<MessageInfo> const& _infoMessages, @@ -81,6 +99,6 @@ namespace Catch { aborting( _aborting ) {} - IStreamingReporter::~IStreamingReporter() = default; + IEventListener::~IEventListener() = default; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp index 681c8e4d8..421924385 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -19,6 +19,7 @@ #include <catch2/benchmark/catch_outlier_classification.hpp> +#include <map> #include <string> #include <vector> #include <iosfwd> @@ -26,26 +27,38 @@ namespace Catch { struct ReporterDescription; + struct ListenerDescription; struct TagInfo; struct TestCaseInfo; class TestCaseHandle; - struct IConfig; + class IConfig; + class IStream; + enum class ColourMode : std::uint8_t; struct ReporterConfig { - explicit ReporterConfig( IConfig const* _fullConfig ); + ReporterConfig( IConfig const* _fullConfig, + Detail::unique_ptr<IStream> _stream, + ColourMode colourMode, + std::map<std::string, std::string> customOptions ); - ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream ); + ReporterConfig( ReporterConfig&& ) = default; + ReporterConfig& operator=( ReporterConfig&& ) = default; + ~ReporterConfig(); // = default - std::ostream& stream() const; + Detail::unique_ptr<IStream> takeStream() &&; IConfig const* fullConfig() const; + ColourMode colourMode() const; + std::map<std::string, std::string> const& customOptions() const; private: - std::ostream* m_stream; + Detail::unique_ptr<IStream> m_stream; IConfig const* m_fullConfig; + ColourMode m_colourMode; + std::map<std::string, std::string> m_customOptions; }; struct TestRunInfo { - TestRunInfo(StringRef _name) : name(_name) {} + constexpr TestRunInfo(StringRef _name) : name(_name) {} StringRef name; }; @@ -105,7 +118,7 @@ namespace Catch { std::string name; double estimatedDuration; int iterations; - int samples; + unsigned int samples; unsigned int resamples; double clockResolution; double clockCost; @@ -151,8 +164,19 @@ namespace Catch { bool shouldReportAllAssertions = false; }; - - struct IStreamingReporter { + /** + * The common base for all reporters and event listeners + * + * Implementing classes must also implement: + * + * //! User-friendly description of the reporter/listener type + * static std::string getDescription() + * + * Generally shouldn't be derived from by users of Catch2 directly, + * instead they should derive from one of the utility bases that + * derive from this class. + */ + class IEventListener { protected: //! Derived classes can set up their preferences here ReporterPreferences m_preferences; @@ -160,9 +184,9 @@ namespace Catch { IConfig const* m_config; public: - IStreamingReporter( IConfig const* config ): m_config( config ) {} + IEventListener( IConfig const* config ): m_config( config ) {} - virtual ~IStreamingReporter(); // = default; + virtual ~IEventListener(); // = default; // Implementing class must also provide the following static methods: // static std::string getDescription(); @@ -171,46 +195,69 @@ namespace Catch { return m_preferences; } + //! Called when no test cases match provided test spec virtual void noMatchingTestCases( StringRef unmatchedSpec ) = 0; - virtual void reportInvalidArguments( StringRef invalidArgument ) = 0; - + //! Called for all invalid test specs from the cli + virtual void reportInvalidTestSpec( StringRef invalidArgument ) = 0; + + /** + * Called once in a testing run before tests are started + * + * Not called if tests won't be run (e.g. only listing will happen) + */ virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; //! Called _once_ for each TEST_CASE, no matter how many times it is entered virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) virtual void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ) = 0; + //! Called when a `SECTION` is being entered. Not called for skipped sections virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; + //! Called when user-code is being probed before the actual benchmark runs virtual void benchmarkPreparing( StringRef benchmarkName ) = 0; + //! Called after probe but before the user-code is being benchmarked virtual void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) = 0; + //! Called with the benchmark results if benchmark successfully finishes virtual void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) = 0; + //! Called if running the benchmarks fails for any reason virtual void benchmarkFailed( StringRef benchmarkName ) = 0; + //! Called before assertion success/failure is evaluated virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; + //! Called after assertion was fully evaluated virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; + //! Called after a `SECTION` has finished running virtual void sectionEnded( SectionStats const& sectionStats ) = 0; //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) virtual void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ) = 0; //! Called _once_ for each TEST_CASE, no matter how many times it is entered virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; + /** + * Called once after all tests in a testing run are finished + * + * Not called if tests weren't run (e.g. only listings happened) + */ virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; + //! Called with test cases that are skipped due to the test run aborting virtual void skipTest( TestCaseInfo const& testInfo ) = 0; + //! Called if a fatal error (signal/structured exception) occured virtual void fatalErrorEncountered( StringRef error ) = 0; //! Writes out information about provided reporters using reporter-specific format virtual void listReporters(std::vector<ReporterDescription> const& descriptions) = 0; + //! Writes out the provided listeners descriptions using reporter-specific format + virtual void listListeners(std::vector<ListenerDescription> const& descriptions) = 0; //! Writes out information about provided tests using reporter-specific format virtual void listTests(std::vector<TestCaseHandle> const& tests) = 0; //! Writes out information about the provided tags using reporter-specific format virtual void listTags(std::vector<TagInfo> const& tags) = 0; - }; - using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp new file mode 100644 index 000000000..8732ed89a --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> + +namespace Catch { + IReporterFactory::~IReporterFactory() = default; + EventListenerFactory::~EventListenerFactory() = default; +} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp index 5a40d1bde..323edde26 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp @@ -9,24 +9,37 @@ #define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_stringref.hpp> #include <string> namespace Catch { struct ReporterConfig; - struct IStreamingReporter; - using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; + class IConfig; + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; - struct IReporterFactory { + class IReporterFactory { + public: virtual ~IReporterFactory(); // = default - virtual IStreamingReporterPtr - create( ReporterConfig const& config ) const = 0; + virtual IEventListenerPtr + create( ReporterConfig&& config ) const = 0; virtual std::string getDescription() const = 0; }; using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; + + class EventListenerFactory { + public: + virtual ~EventListenerFactory(); // = default + virtual IEventListenerPtr create( IConfig const* config ) const = 0; + //! Return a meaningful name for the listener, e.g. its type name + virtual StringRef getName() const = 0; + //! Return listener's description if available + virtual std::string getDescription() const = 0; + }; } // namespace Catch #endif // CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.cpp new file mode 100644 index 000000000..bd38ac288 --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.cpp @@ -0,0 +1,13 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> + +namespace Catch { + IReporterRegistry::~IReporterRegistry() = default; +} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp index 54871cced..d2f2a1596 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp @@ -8,6 +8,7 @@ #ifndef CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED #define CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED +#include <catch2/internal/catch_case_insensitive_comparisons.hpp> #include <catch2/internal/catch_unique_ptr.hpp> #include <string> @@ -16,19 +17,22 @@ namespace Catch { - struct IConfig; + class IConfig; - struct IStreamingReporter; - using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; - struct IReporterFactory; + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; + class IReporterFactory; using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; + struct ReporterConfig; + class EventListenerFactory; - struct IReporterRegistry { - using FactoryMap = std::map<std::string, IReporterFactoryPtr>; - using Listeners = std::vector<IReporterFactoryPtr>; + class IReporterRegistry { + public: + using FactoryMap = std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess>; + using Listeners = std::vector<Detail::unique_ptr<EventListenerFactory>>; virtual ~IReporterRegistry(); // = default - virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0; + virtual IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const = 0; virtual FactoryMap const& getFactories() const = 0; virtual Listeners const& getListeners() const = 0; }; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp index 6b0973b40..141560a1f 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp @@ -14,7 +14,8 @@ namespace Catch { struct TagAlias; - struct ITagAliasRegistry { + class ITagAliasRegistry { + public: virtual ~ITagAliasRegistry(); // = default // Nullptr if not present virtual TagAlias const* find( std::string const& alias ) const = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp new file mode 100644 index 000000000..ec32d667b --- /dev/null +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_testcase.hpp> + +namespace Catch { + ITestInvoker::~ITestInvoker() = default; + ITestCaseRegistry::~ITestCaseRegistry() = default; +} diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp index 2d0b6c284..9701d3421 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp @@ -15,15 +15,17 @@ namespace Catch { class TestSpec; struct TestCaseInfo; - struct ITestInvoker { + class ITestInvoker { + public: virtual void invoke () const = 0; virtual ~ITestInvoker(); // = default }; class TestCaseHandle; - struct IConfig; + class IConfig; - struct ITestCaseRegistry { + class ITestCaseRegistry { + public: virtual ~ITestCaseRegistry(); // = default // TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later virtual std::vector<TestCaseInfo* > const& getAllInfos() const = 0; diff --git a/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp b/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp index b7c7613e3..5faa5e4ba 100644 --- a/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp +++ b/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp @@ -13,11 +13,11 @@ #include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/internal/catch_lazy_expr.hpp> +#include <string> + namespace Catch { - struct AssertionResultData; - struct IResultCapture; - class RunContext; + class IResultCapture; struct AssertionReaction { bool shouldDebugBreak = false; diff --git a/packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp b/packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp new file mode 100644 index 000000000..904c2289b --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.cpp @@ -0,0 +1,35 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_case_insensitive_comparisons.hpp> +#include <catch2/internal/catch_string_manip.hpp> + +#include <algorithm> + +namespace Catch { + namespace Detail { + + bool CaseInsensitiveLess::operator()( StringRef lhs, + StringRef rhs ) const { + return std::lexicographical_compare( + lhs.begin(), lhs.end(), + rhs.begin(), rhs.end(), + []( char l, char r ) { return toLower( l ) < toLower( r ); } ); + } + + bool + CaseInsensitiveEqualTo::operator()( StringRef lhs, + StringRef rhs ) const { + return std::equal( + lhs.begin(), lhs.end(), + rhs.begin(), rhs.end(), + []( char l, char r ) { return toLower( l ) == toLower( r ); } ); + } + + } // namespace Detail +} // namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.hpp b/packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.hpp new file mode 100644 index 000000000..a97b7b4b9 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_case_insensitive_comparisons.hpp @@ -0,0 +1,30 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED +#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED + +#include <catch2/internal/catch_stringref.hpp> + +namespace Catch { + namespace Detail { + //! Provides case-insensitive `op<` semantics when called + struct CaseInsensitiveLess { + bool operator()( StringRef lhs, + StringRef rhs ) const; + }; + + //! Provides case-insensitive `op==` semantics when called + struct CaseInsensitiveEqualTo { + bool operator()( StringRef lhs, + StringRef rhs ) const; + }; + + } // namespace Detail +} // namespace Catch + +#endif // CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_clara.cpp b/packages/Catch2/src/catch2/internal/catch_clara.cpp index eb7dacaea..b34ce9176 100644 --- a/packages/Catch2/src/catch2/internal/catch_clara.cpp +++ b/packages/Catch2/src/catch2/internal/catch_clara.cpp @@ -5,13 +5,16 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#include <algorithm> + #include <catch2/internal/catch_clara.hpp> #include <catch2/internal/catch_console_width.hpp> #include <catch2/internal/catch_platform.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_textflow.hpp> +#include <algorithm> +#include <ostream> + namespace { bool isOptPrefix( char c ) { return c == '-' @@ -113,7 +116,7 @@ namespace Catch { } else { return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + - source + "'" ); + source + '\'' ); } return ParserResult::ok( ParseResultType::Matched ); } @@ -230,7 +233,7 @@ namespace Catch { return Detail::InternalParseResult::runtimeError( "Expected argument following " + token.token); - auto result = valueRef->setValue(argToken.token); + const auto result = valueRef->setValue(argToken.token); if (!result) return Detail::InternalParseResult(result); if (result.value() == diff --git a/packages/Catch2/src/catch2/internal/catch_clara.hpp b/packages/Catch2/src/catch2/internal/catch_clara.hpp index 477cb08d1..512b0526c 100644 --- a/packages/Catch2/src/catch2/internal/catch_clara.hpp +++ b/packages/Catch2/src/catch2/internal/catch_clara.hpp @@ -29,14 +29,16 @@ # endif #endif -#include <catch2/internal/catch_noncopyable.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_noncopyable.hpp> +#include <catch2/internal/catch_void_type.hpp> #include <cassert> -#include <cctype> #include <memory> +#include <ostream> #include <sstream> #include <string> +#include <type_traits> #include <vector> namespace Catch { @@ -53,7 +55,25 @@ namespace Catch { ShortCircuitSame }; + struct accept_many_t {}; + constexpr accept_many_t accept_many {}; + namespace Detail { + struct fake_arg { + template <typename T> + operator T(); + }; + + template <typename F, typename = void> + struct is_unary_function : std::false_type {}; + + template <typename F> + struct is_unary_function< + F, + Catch::Detail::void_t<decltype( + std::declval<F>()( fake_arg() ) ) + > + > : std::true_type {}; // Traits for extracting arg and return type of lambdas (for single // argument lambdas) @@ -203,20 +223,20 @@ namespace Catch { return { ResultType::Ok, value }; } static auto ok() -> BasicResult { return { ResultType::Ok }; } - static auto logicError( std::string const& message ) + static auto logicError( std::string&& message ) -> BasicResult { - return { ResultType::LogicError, message }; + return { ResultType::LogicError, CATCH_MOVE(message) }; } - static auto runtimeError( std::string const& message ) + static auto runtimeError( std::string&& message ) -> BasicResult { - return { ResultType::RuntimeError, message }; + return { ResultType::RuntimeError, CATCH_MOVE(message) }; } explicit operator bool() const { return m_type == ResultType::Ok; } auto type() const -> ResultType { return m_type; } - auto errorMessage() const -> std::string { + auto errorMessage() const -> std::string const& { return m_errorMessage; } @@ -235,8 +255,8 @@ namespace Catch { m_errorMessage; // Only populated if resultType is an error BasicResult( ResultType type, - std::string const& message ): - ResultValueBase<T>( type ), m_errorMessage( message ) { + std::string&& message ): + ResultValueBase<T>( type ), m_errorMessage( CATCH_MOVE(message) ) { assert( m_type != ResultType::Ok ); } @@ -393,6 +413,11 @@ namespace Catch { } }; + template <typename L> struct BoundManyLambda : BoundLambda<L> { + explicit BoundManyLambda( L const& lambda ): BoundLambda<L>( lambda ) {} + bool isContainer() const override { return true; } + }; + template <typename L> struct BoundFlagLambda : BoundFlagRefBase { L m_lambda; @@ -447,12 +472,23 @@ namespace Catch { m_ref( ref ) {} public: - template <typename T> + template <typename LambdaT> + ParserRefImpl( accept_many_t, + LambdaT const& ref, + std::string const& hint ): + m_ref( std::make_shared<BoundManyLambda<LambdaT>>( ref ) ), + m_hint( hint ) {} + + template <typename T, + typename = typename std::enable_if_t< + !Detail::is_unary_function<T>::value>> ParserRefImpl( T& ref, std::string const& hint ): m_ref( std::make_shared<BoundValueRef<T>>( ref ) ), m_hint( hint ) {} - template <typename LambdaT> + template <typename LambdaT, + typename = typename std::enable_if_t< + Detail::is_unary_function<LambdaT>::value>> ParserRefImpl( LambdaT const& ref, std::string const& hint ): m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ), m_hint( hint ) {} @@ -513,13 +549,21 @@ namespace Catch { explicit Opt(bool& ref); + template <typename LambdaT, + typename = typename std::enable_if_t< + Detail::is_unary_function<LambdaT>::value>> + Opt( LambdaT const& ref, std::string const& hint ): + ParserRefImpl( ref, hint ) {} + template <typename LambdaT> - Opt(LambdaT const& ref, std::string const& hint) : - ParserRefImpl(ref, hint) {} + Opt( accept_many_t, LambdaT const& ref, std::string const& hint ): + ParserRefImpl( accept_many, ref, hint ) {} - template <typename T> - Opt(T& ref, std::string const& hint) : - ParserRefImpl(ref, hint) {} + template <typename T, + typename = typename std::enable_if_t< + !Detail::is_unary_function<T>::value>> + Opt( T& ref, std::string const& hint ): + ParserRefImpl( ref, hint ) {} auto operator[](std::string const& optName) -> Opt& { m_optNames.push_back(optName); @@ -544,12 +588,6 @@ namespace Catch { std::shared_ptr<std::string> m_name; std::shared_ptr<Detail::BoundValueRefBase> m_ref; - template <typename LambdaT> - static auto makeRef(LambdaT const& lambda) - -> std::shared_ptr<Detail::BoundValueRefBase> { - return std::make_shared<Detail::BoundLambda<LambdaT>>(lambda); - } - public: ExeName(); explicit ExeName(std::string& ref); diff --git a/packages/Catch2/src/catch2/internal/catch_combined_tu.cpp b/packages/Catch2/src/catch2/internal/catch_combined_tu.cpp deleted file mode 100644 index b78d19049..000000000 --- a/packages/Catch2/src/catch2/internal/catch_combined_tu.cpp +++ /dev/null @@ -1,237 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small top-level TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - - -//////////////////////////////////////////////////////// -// vvv formerly catch_tag_alias_autoregistrar.cpp vvv // -//////////////////////////////////////////////////////// - -#include <catch2/catch_tag_alias_autoregistrar.hpp> -#include <catch2/internal/catch_compiler_capabilities.hpp> -#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> - -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(); - } - } - -} - - -////////////////////////////////////////// -// vvv formerly catch_polyfills.cpp vvv // -////////////////////////////////////////// - -#include <catch2/internal/catch_polyfills.hpp> -#include <catch2/internal/catch_compiler_capabilities.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 - - -//////////////////////////////////////////////////// -// vvv formerly catch_uncaught_exceptions.cpp vvv // -//////////////////////////////////////////////////// - -#include <catch2/internal/catch_compiler_capabilities.hpp> -#include <catch2/internal/catch_uncaught_exceptions.hpp> -#include <catch2/internal/catch_config_uncaught_exceptions.hpp> - -#include <exception> - -namespace Catch { - bool uncaught_exceptions() { -#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) - return false; -#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) - return std::uncaught_exceptions() > 0; -#else - return std::uncaught_exception(); -#endif - } -} // end namespace Catch - - -//////////////////////////////////////////// -// vvv formerly catch_errno_guard.cpp vvv // -//////////////////////////////////////////// -#include <catch2/internal/catch_errno_guard.hpp> - -#include <cerrno> - -namespace Catch { - ErrnoGuard::ErrnoGuard():m_oldErrno(errno){} - ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; } -} - - -/////////////////////////////////////////// -// vvv formerly catch_decomposer.cpp vvv // -/////////////////////////////////////////// -#include <catch2/internal/catch_decomposer.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; - } -} - - -/////////////////////////////////////////////////////////// -// vvv formerly catch_startup_exception_registry.cpp vvv // -/////////////////////////////////////////////////////////// -#include <catch2/internal/catch_startup_exception_registry.hpp> -#include <catch2/internal/catch_compiler_capabilities.hpp> - -namespace Catch { -#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) - 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; - } -#endif - -} // end namespace Catch - - -////////////////////////////////////////////// -// vvv formerly catch_leak_detector.cpp vvv // -////////////////////////////////////////////// -#include <catch2/internal/catch_leak_detector.hpp> -#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> - - -#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 // ^^ Windows crt debug heap enabled // Windows crt debug heap disabled vv - - Catch::LeakDetector::LeakDetector() {} - -#endif // CATCH_CONFIG_WINDOWS_CRTDBG - -Catch::LeakDetector::~LeakDetector() { - Catch::cleanUp(); -} - - -///////////////////////////////////////////// -// vvv formerly catch_message_info.cpp vvv // -///////////////////////////////////////////// - -#include <catch2/internal/catch_message_info.hpp> - -namespace Catch { - - MessageInfo::MessageInfo( StringRef _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - type( _type ), - sequence( ++globalCount ) - {} - - // This may need protecting if threading support is added - unsigned int MessageInfo::globalCount = 0; - -} // end namespace Catch - - - - -////////////////////////////////////////// -// vvv formerly catch_lazy_expr.cpp vvv // -////////////////////////////////////////// -#include <catch2/internal/catch_lazy_expr.hpp> -#include <catch2/internal/catch_decomposer.hpp> - -namespace Catch { - - 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; - } - -} // namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_commandline.cpp b/packages/Catch2/src/catch2/internal/catch_commandline.cpp index 0cb160e06..fda4b2bd5 100644 --- a/packages/Catch2/src/catch2/internal/catch_commandline.cpp +++ b/packages/Catch2/src/catch2/internal/catch_commandline.cpp @@ -7,14 +7,16 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_commandline.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/catch_config.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> #include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> -#include <catch2/interfaces/catch_interfaces_reporter.hpp> +#include <catch2/internal/catch_console_colour.hpp> +#include <catch2/internal/catch_reporter_spec_parser.hpp> #include <fstream> -#include <ctime> +#include <string> namespace Catch { @@ -23,25 +25,21 @@ namespace Catch { 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 ); + if ( warning == "NoAssertions" ) { + config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::NoAssertions); return ParserResult::ok( ParseResultType::Matched ); - }; + } else if ( warning == "UnmatchedTestSpec" ) { + config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::UnmatchedTestSpec); + return ParserResult::ok( ParseResultType::Matched ); + } + + return ParserResult ::runtimeError( + "Unrecognised warning option: '" + warning + '\'' ); + }; 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 + "'" ); + return ParserResult::runtimeError( "Unable to load input file: '" + filename + '\'' ); std::string line; while( std::getline( f, line ) ) { @@ -67,28 +65,53 @@ namespace Catch { else if( startsWith( "random", order ) ) config.runOrder = TestRunOrder::Randomized; else - return ParserResult::runtimeError( "Unrecognised ordering: '" + order + "'" ); + return 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 ); + if( seed == "time" ) { + config.rngSeed = generateRandomSeed(GenerateFrom::Time); + return ParserResult::ok(ParseResultType::Matched); + } else if (seed == "random-device") { + config.rngSeed = generateRandomSeed(GenerateFrom::RandomDevice); + return ParserResult::ok(ParseResultType::Matched); + } + + CATCH_TRY { + std::size_t parsedTo = 0; + unsigned long parsedSeed = std::stoul(seed, &parsedTo, 0); + if (parsedTo != seed.size()) { + return ParserResult::runtimeError("Could not parse '" + seed + "' as seed"); + } + + // TODO: Ideally we could parse unsigned int directly, + // but the stdlib doesn't provide helper for that + // type. After this is refactored to use fixed size + // type, we should check the parsed value is in range + // of the underlying type. + config.rngSeed = static_cast<unsigned int>(parsedSeed); + return ParserResult::ok(ParseResultType::Matched); + } CATCH_CATCH_ANON(std::exception const&) { + return ParserResult::runtimeError("Could not parse '" + seed + "' as seed"); + } }; + auto const setDefaultColourMode = [&]( std::string const& colourMode ) { + Optional<ColourMode> maybeMode = Catch::Detail::stringToColourMode(toLower( colourMode )); + if ( !maybeMode ) { + return ParserResult::runtimeError( + "colour mode must be one of: default, ansi, win32, " + "or none. '" + + colourMode + "' is not recognised" ); + } + auto mode = *maybeMode; + if ( !isColourImplAvailable( mode ) ) { + return ParserResult::runtimeError( + "colour mode '" + colourMode + + "' is not supported in this binary" ); + } + config.defaultColourMode = mode; + return ParserResult::ok( ParseResultType::Matched ); + }; auto const setWaitForKeypress = [&]( std::string const& keypress ) { auto keypressLc = toLower( keypress ); if (keypressLc == "never") @@ -112,31 +135,95 @@ namespace Catch { else if( lcVerbosity == "high" ) config.verbosity = Verbosity::High; else - return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + "'" ); + 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 const setReporter = [&]( std::string const& userReporterSpec ) { + if ( userReporterSpec.empty() ) { + return ParserResult::runtimeError( "Received empty reporter spec." ); + } - auto lcReporter = toLower( reporter ); - auto result = factories.find( lcReporter ); + Optional<ReporterSpec> parsed = + parseReporterSpec( userReporterSpec ); + if ( !parsed ) { + return ParserResult::runtimeError( + "Could not parse reporter spec '" + userReporterSpec + + "'" ); + } + + auto const& reporterSpec = *parsed; + + IReporterRegistry::FactoryMap const& factories = + getRegistryHub().getReporterRegistry().getFactories(); + auto result = factories.find( reporterSpec.name() ); + + if ( result == factories.end() ) { + return ParserResult::runtimeError( + "Unrecognized reporter, '" + reporterSpec.name() + + "'. Check available with --list-reporters" ); + } + + + const bool hadOutputFile = reporterSpec.outputFile().some(); + config.reporterSpecifications.push_back( CATCH_MOVE( *parsed ) ); + // It would be enough to check this only once at the very end, but + // there is not a place where we could call this check, so do it + // every time it could fail. For valid inputs, this is still called + // at most once. + if (!hadOutputFile) { + int n_reporters_without_file = 0; + for (auto const& spec : config.reporterSpecifications) { + if (spec.outputFile().none()) { + n_reporters_without_file++; + } + } + if (n_reporters_without_file > 1) { + return ParserResult::runtimeError( "Only one reporter may have unspecified output file." ); + } + } - 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 const setShardCount = [&]( std::string const& shardCount ) { + CATCH_TRY{ + std::size_t parsedTo = 0; + int64_t parsedCount = std::stoll(shardCount, &parsedTo, 0); + if (parsedTo != shardCount.size()) { + return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count"); + } + if (parsedCount <= 0) { + return ParserResult::runtimeError("Shard count must be a positive number"); + } + + config.shardCount = static_cast<unsigned int>(parsedCount); + return ParserResult::ok(ParseResultType::Matched); + } CATCH_CATCH_ANON(std::exception const&) { + return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count"); + } + }; + + auto const setShardIndex = [&](std::string const& shardIndex) { + CATCH_TRY{ + std::size_t parsedTo = 0; + int64_t parsedIndex = std::stoll(shardIndex, &parsedTo, 0); + if (parsedTo != shardIndex.size()) { + return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index"); + } + if (parsedIndex < 0) { + return ParserResult::runtimeError("Shard index must be a non-negative number"); + } + + config.shardIndex = static_cast<unsigned int>(parsedIndex); + return ParserResult::ok(ParseResultType::Matched); + } CATCH_CATCH_ANON(std::exception const&) { + return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index"); + } + }; + 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" ) @@ -149,10 +236,10 @@ namespace Catch { | Opt( config.showInvisibles ) ["-i"]["--invisibles"] ( "show invisibles (tabs, newlines)" ) - | Opt( config.outputFilename, "filename" ) + | Opt( config.defaultOutputFilename, "filename" ) ["-o"]["--out"] - ( "output filename" ) - | Opt( setReporter, "name" ) + ( "default output filename" ) + | Opt( accept_many, setReporter, "name[::key=value]*" ) ["-r"]["--reporter"] ( "reporter to use (defaults to console)" ) | Opt( config.name, "name" ) @@ -164,7 +251,7 @@ namespace Catch { | Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" ) ["-x"]["--abortx"] ( "abort after x failures" ) - | Opt( setWarning, "warning name" ) + | Opt( accept_many, setWarning, "warning name" ) ["-w"]["--warn"] ( "enable warnings" ) | Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" ) @@ -185,24 +272,36 @@ namespace Catch { | Opt( setVerbosity, "quiet|normal|high" ) ["-v"]["--verbosity"] ( "set output verbosity" ) + | Opt( config.listTests ) + ["--list-tests"] + ( "list all/matching test cases" ) + | Opt( config.listTags ) + ["--list-tags"] + ( "list all/matching tags" ) | Opt( config.listReporters ) ["--list-reporters"] - ( "list all reporters" ) + ( "list all available reporters" ) + | Opt( config.listListeners ) + ["--list-listeners"] + ( "list all listeners" ) | Opt( setTestOrder, "decl|lex|rand" ) ["--order"] ( "test case order (defaults to decl)" ) - | Opt( setRngSeed, "'time'|number" ) + | Opt( setRngSeed, "'time'|'random-device'|number" ) ["--rng-seed"] ( "set a specific seed for random numbers" ) - | Opt( setColourUsage, "yes|no" ) - ["--use-colour"] - ( "should output be colourised" ) + | Opt( setDefaultColourMode, "ansi|win32|none|default" ) + ["--colour-mode"] + ( "what color mode should be used as default" ) | 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.skipBenchmarks) + ["--skip-benchmarks"] + ( "disable running benchmarks") | Opt( config.benchmarkSamples, "samples" ) ["--benchmark-samples"] ( "number of samples to collect (default: 100)" ) @@ -218,6 +317,15 @@ namespace Catch { | Opt( config.benchmarkWarmupTime, "benchmarkWarmupTime" ) ["--benchmark-warmup-time"] ( "amount of time in milliseconds spent on warming up each test (default: 100)" ) + | Opt( setShardCount, "shard count" ) + ["--shard-count"] + ( "split the tests to execute into this many groups" ) + | Opt( setShardIndex, "shard index" ) + ["--shard-index"] + ( "index of the group of tests to execute (see --shard-count)" ) | + Opt( config.allowZeroTests ) + ["--allow-running-no-tests"] + ( "Treat 'No tests run' as a success" ) | Arg( config.testsOrTags, "test name|pattern|tags" ) ( "which test or tests to use" ); diff --git a/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp b/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp index 0684050b9..85477ec23 100644 --- a/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp +++ b/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp @@ -25,6 +25,7 @@ // can be combined, en-mass, with the _NO_ forms later. #include <catch2/internal/catch_platform.hpp> +#include <catch2/catch_user_config.hpp> #ifdef __cplusplus @@ -56,11 +57,23 @@ #endif +#if defined(__CUDACC__) && !defined(__clang__) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic pop" ) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" ) +#endif + +// clang-cl defines _MSC_VER as well as __clang__, which could cause the +// start/stop internal suppression macros to be double defined. #if defined(__clang__) && !defined(_MSC_VER) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) +#endif // __clang__ && !_MSC_VER + +#if defined(__clang__) + // As of this writing, IBM XL's implementation of __builtin_constant_p has a bug // which results in calls to destructors being emitted for each temporary, // without a matching initialization. In practice, this can result in something @@ -115,7 +128,6 @@ #ifdef __OS400__ # define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS -# define CATCH_CONFIG_COLOUR_NONE #endif //////////////////////////////////////////////////////////////////////////////// @@ -162,8 +174,8 @@ // 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 +# if defined(CATCH_PLATFORM_WINDOWS_UWP) +# define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 # else # define CATCH_INTERNAL_CONFIG_WINDOWS_SEH # endif @@ -205,7 +217,7 @@ #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 + #define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 #endif #if !defined(_GLIBCXX_USE_C99_MATH_TR1) @@ -287,7 +299,9 @@ # define CATCH_CONFIG_NEW_CAPTURE #endif -#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +#if !defined( CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED ) && \ + !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS ) && \ + !defined( CATCH_CONFIG_NO_DISABLE_EXCEPTIONS ) # define CATCH_CONFIG_DISABLE_EXCEPTIONS #endif @@ -355,4 +369,12 @@ #define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #endif +#if defined( CATCH_PLATFORM_WINDOWS ) && \ + !defined( CATCH_CONFIG_COLOUR_WIN32 ) && \ + !defined( CATCH_CONFIG_NO_COLOUR_WIN32 ) && \ + !defined( CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 ) +# define CATCH_CONFIG_COLOUR_WIN32 +#endif + + #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_config_android_logwrite.hpp b/packages/Catch2/src/catch2/internal/catch_config_android_logwrite.hpp index 199c93759..670af2d55 100644 --- a/packages/Catch2/src/catch2/internal/catch_config_android_logwrite.hpp +++ b/packages/Catch2/src/catch2/internal/catch_config_android_logwrite.hpp @@ -17,6 +17,8 @@ #ifndef CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED #define CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED +#include <catch2/catch_user_config.hpp> + #if defined(__ANDROID__) # define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE #endif diff --git a/packages/Catch2/src/catch2/internal/catch_console_colour.cpp b/packages/Catch2/src/catch2/internal/catch_console_colour.cpp index e524b0baf..c77e82951 100644 --- a/packages/Catch2/src/catch2/internal/catch_console_colour.cpp +++ b/packages/Catch2/src/catch2/internal/catch_console_colour.cpp @@ -15,59 +15,114 @@ #include <catch2/internal/catch_enforce.hpp> #include <catch2/internal/catch_errno_guard.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_istream.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/internal/catch_context.hpp> #include <catch2/internal/catch_platform.hpp> #include <catch2/internal/catch_debugger.hpp> #include <catch2/internal/catch_windows_h_proxy.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <cassert> #include <ostream> +#include <utility> namespace Catch { - namespace { - struct IColourImpl { - virtual ~IColourImpl() = default; - virtual void use( Colour::Code _colourCode ) = 0; - }; + ColourImpl::~ColourImpl() = default; - struct NoColourImpl : IColourImpl { - void use( Colour::Code ) override {} + ColourImpl::ColourGuard ColourImpl::guardColour( Colour::Code colourCode ) { + return ColourGuard(colourCode, this ); + } - static IColourImpl* instance() { - static NoColourImpl s_instance; - return &s_instance; - } + void ColourImpl::ColourGuard::engageImpl( std::ostream& stream ) { + assert( &stream == &m_colourImpl->m_stream->stream() && + "Engaging colour guard for different stream than used by the " + "parent colour implementation" ); + static_cast<void>( stream ); + + m_engaged = true; + m_colourImpl->use( m_code ); + } + + ColourImpl::ColourGuard::ColourGuard( Colour::Code code, + ColourImpl const* colour ): + m_colourImpl( colour ), m_code( code ) { + } + ColourImpl::ColourGuard::ColourGuard( ColourGuard&& rhs ) noexcept: + m_colourImpl( rhs.m_colourImpl ), + m_code( rhs.m_code ), + m_engaged( rhs.m_engaged ) { + rhs.m_engaged = false; + } + ColourImpl::ColourGuard& + ColourImpl::ColourGuard::operator=( ColourGuard&& rhs ) noexcept { + using std::swap; + swap( m_colourImpl, rhs.m_colourImpl ); + swap( m_code, rhs.m_code ); + swap( m_engaged, rhs.m_engaged ); + + return *this; + } + ColourImpl::ColourGuard::~ColourGuard() { + if ( m_engaged ) { + m_colourImpl->use( Colour::None ); + } + } + + ColourImpl::ColourGuard& + ColourImpl::ColourGuard::engage( std::ostream& stream ) & { + engageImpl( stream ); + return *this; + } + + ColourImpl::ColourGuard&& + ColourImpl::ColourGuard::engage( std::ostream& stream ) && { + engageImpl( stream ); + return CATCH_MOVE(*this); + } + + namespace { + //! A do-nothing implementation of colour, used as fallback for unknown + //! platforms, and when the user asks to deactivate all colours. + class NoColourImpl : public ColourImpl { + public: + NoColourImpl( IStream* stream ): ColourImpl( stream ) {} + + private: + void use( Colour::Code ) const override {} }; + } // namespace - } // 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 +} // namespace Catch -#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) ///////////////////////////////////////// +#if defined ( CATCH_CONFIG_COLOUR_WIN32 ) ///////////////////////////////////////// namespace Catch { namespace { - class Win32ColourImpl : public IColourImpl { + class Win32ColourImpl : public ColourImpl { public: - Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) - { + Win32ColourImpl(IStream* stream): + ColourImpl(stream) { CONSOLE_SCREEN_BUFFER_INFO csbiInfo; - GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); + GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), + &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 { + static bool useImplementationForStream(IStream const& stream) { + // Win32 text colour APIs can only be used on console streams + // We cannot check that the output hasn't been redirected, + // so we just check that the original stream is console stream. + return stream.isConsole(); + } + + private: + void use( Colour::Code _colourCode ) const override { switch( _colourCode ) { case Colour::None: return setTextAttribute( originalForegroundAttributes ); case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); @@ -91,45 +146,63 @@ namespace { } } - private: - void setTextAttribute( WORD _textAttribute ) { - SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes ); + void setTextAttribute( WORD _textAttribute ) const { + SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), + _textAttribute | + originalBackgroundAttributes ); } - HANDLE stdoutHandle; WORD originalForegroundAttributes; WORD originalBackgroundAttributes; }; - IColourImpl* platformColourInstance() { - static Win32ColourImpl s_instance; - - auto const* config = getCurrentContext().getConfig(); - UseColour 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 ) ////////////////////////////////////// +#endif // Windows/ ANSI/ None + -#include <unistd.h> +#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) +# define CATCH_INTERNAL_HAS_ISATTY +# include <unistd.h> +#endif 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 { + class ANSIColourImpl : public ColourImpl { public: - void use( Colour::Code _colourCode ) override { + ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {} + + static bool useImplementationForStream(IStream const& stream) { + // This is kinda messy due to trying to support a bunch of + // different platforms at once. + // The basic idea is that if we are asked to do autodetection (as + // opposed to being told to use posixy colours outright), then we + // only want to use the colours if we are writing to console. + // However, console might be redirected, so we make an attempt at + // checking for that on platforms where we know how to do that. + bool useColour = stream.isConsole(); +#if defined( CATCH_INTERNAL_HAS_ISATTY ) && \ + !( defined( __DJGPP__ ) && defined( __STRICT_ANSI__ ) ) + ErrnoGuard _; // for isatty + useColour = useColour && isatty( STDOUT_FILENO ); +# endif +# if defined( CATCH_PLATFORM_MAC ) || defined( CATCH_PLATFORM_IPHONE ) + useColour = useColour && !isDebuggerActive(); +# endif + + return useColour; + } + + private: + void use( Colour::Code _colourCode ) const override { + auto setColour = [&out = + m_stream->stream()]( char const* escapeCode ) { + // The escape sequence must be flushed to console, otherwise + // if stdin and stderr are intermixed, we'd get accidentally + // coloured output. + out << '\033' << escapeCode << std::flush; + }; switch( _colourCode ) { case Colour::None: case Colour::White: return setColour( "[0m" ); @@ -150,89 +223,56 @@ namespace { default: CATCH_INTERNAL_ERROR( "Unknown colour requested" ); } } - static IColourImpl* instance() { - static PosixColourImpl s_instance; - return &s_instance; - } - - private: - void setColour( const char* _escapeCode ) { - // The escape sequence must be flushed to console, otherwise if - // stdin and stderr are intermixed, we'd get accidentally coloured output. - getCurrentContext().getConfig()->stream() - << '\033' << _escapeCode << std::flush; - } }; - 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; - auto const* config = getCurrentContext().getConfig(); - UseColour 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 + Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection, + IStream* stream ) { +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) + if ( implSelection == ColourMode::Win32 ) { + return Detail::make_unique<Win32ColourImpl>( stream ); + } +#endif + if ( implSelection == ColourMode::ANSI ) { + return Detail::make_unique<ANSIColourImpl>( stream ); + } + if ( implSelection == ColourMode::None ) { + return Detail::make_unique<NoColourImpl>( stream ); + } -namespace Catch { + if ( implSelection == ColourMode::PlatformDefault) { +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) + if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { + return Detail::make_unique<Win32ColourImpl>( stream ); + } +#endif + if ( ANSIColourImpl::useImplementationForStream( *stream ) ) { + return Detail::make_unique<ANSIColourImpl>( stream ); + } + return Detail::make_unique<NoColourImpl>( stream ); + } - 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; + CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(implSelection) ); } - 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 ); + bool isColourImplAvailable( ColourMode colourSelection ) { + switch ( colourSelection ) { +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) + case ColourMode::Win32: +#endif + case ColourMode::ANSI: + case ColourMode::None: + case ColourMode::PlatformDefault: + return true; + default: + return false; } } - std::ostream& operator << ( std::ostream& os, Colour const& ) { - return os; - } } // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_console_colour.hpp b/packages/Catch2/src/catch2/internal/catch_console_colour.hpp index 7b102013c..aa3d83a28 100644 --- a/packages/Catch2/src/catch2/internal/catch_console_colour.hpp +++ b/packages/Catch2/src/catch2/internal/catch_console_colour.hpp @@ -8,10 +8,16 @@ #ifndef CATCH_CONSOLE_COLOUR_HPP_INCLUDED #define CATCH_CONSOLE_COLOUR_HPP_INCLUDED +#include <catch2/internal/catch_unique_ptr.hpp> + #include <iosfwd> +#include <cstdint> namespace Catch { + enum class ColourMode : std::uint8_t; + class IStream; + struct Colour { enum Code { None = 0, @@ -48,22 +54,86 @@ namespace Catch { SecondaryText = LightGrey, Headers = White }; + }; - // Use constructed object for RAII guard - Colour( Code _colourCode ); - Colour( Colour&& other ) noexcept; - Colour& operator=( Colour&& other ) noexcept; - ~Colour(); + class ColourImpl { + protected: + //! The associated stream of this ColourImpl instance + IStream* m_stream; + public: + ColourImpl( IStream* stream ): m_stream( stream ) {} + + //! RAII wrapper around writing specific colour of text using specific + //! colour impl into a stream. + class ColourGuard { + ColourImpl const* m_colourImpl; + Colour::Code m_code; + bool m_engaged = false; + + public: + //! Does **not** engage the guard/start the colour + ColourGuard( Colour::Code code, + ColourImpl const* colour ); + + ColourGuard( ColourGuard const& rhs ) = delete; + ColourGuard& operator=( ColourGuard const& rhs ) = delete; + + ColourGuard( ColourGuard&& rhs ) noexcept; + ColourGuard& operator=( ColourGuard&& rhs ) noexcept; + + //! Removes colour _if_ the guard was engaged + ~ColourGuard(); + + /** + * Explicitly engages colour for given stream. + * + * The API based on operator<< should be preferred. + */ + ColourGuard& engage( std::ostream& stream ) &; + /** + * Explicitly engages colour for given stream. + * + * The API based on operator<< should be preferred. + */ + ColourGuard&& engage( std::ostream& stream ) &&; + + private: + //! Engages the guard and starts using colour + friend std::ostream& operator<<( std::ostream& lhs, + ColourGuard& guard ) { + guard.engageImpl( lhs ); + return lhs; + } + //! Engages the guard and starts using colour + friend std::ostream& operator<<( std::ostream& lhs, + ColourGuard&& guard) { + guard.engageImpl( lhs ); + return lhs; + } + + void engageImpl( std::ostream& stream ); - // Use static method for one-shot changes - static void use( Code _colourCode ); + }; - private: - bool m_moved = false; + virtual ~ColourImpl(); // = default + /** + * Creates a guard object for given colour and this colour impl + * + * **Important:** + * the guard starts disengaged, and has to be engaged explicitly. + */ + ColourGuard guardColour( Colour::Code colourCode ); - friend std::ostream& operator << (std::ostream& os, Colour const&); + private: + virtual void use( Colour::Code colourCode ) const = 0; }; + //! Provides ColourImpl based on global config and target compilation platform + Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode colourSelection, + IStream* stream ); + + //! Checks if specific colour impl has been compiled into the binary + bool isColourImplAvailable( ColourMode colourSelection ); } // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_console_width.hpp b/packages/Catch2/src/catch2/internal/catch_console_width.hpp index 52ef0f0ee..7156ec4ee 100644 --- a/packages/Catch2/src/catch2/internal/catch_console_width.hpp +++ b/packages/Catch2/src/catch2/internal/catch_console_width.hpp @@ -8,8 +8,12 @@ #ifndef CATCH_CONSOLE_WIDTH_HPP_INCLUDED #define CATCH_CONSOLE_WIDTH_HPP_INCLUDED +// This include must be kept so that user's configured value for CONSOLE_WIDTH +// is used before we attempt to provide a default value +#include <catch2/catch_user_config.hpp> + #ifndef CATCH_CONFIG_CONSOLE_WIDTH #define CATCH_CONFIG_CONSOLE_WIDTH 80 #endif -#endif // CATCH_CONSOLE_WIDTH_HPP_INCLUDED \ No newline at end of file +#endif // CATCH_CONSOLE_WIDTH_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_context.cpp b/packages/Catch2/src/catch2/internal/catch_context.cpp index 790a1b23d..6811b092f 100644 --- a/packages/Catch2/src/catch2/internal/catch_context.cpp +++ b/packages/Catch2/src/catch2/internal/catch_context.cpp @@ -55,7 +55,7 @@ namespace Catch { Context::~Context() = default; - SimplePcg32& rng() { + SimplePcg32& sharedRng() { static SimplePcg32 s_rng; return s_rng; } diff --git a/packages/Catch2/src/catch2/internal/catch_context.hpp b/packages/Catch2/src/catch2/internal/catch_context.hpp index d35524482..fe1297056 100644 --- a/packages/Catch2/src/catch2/internal/catch_context.hpp +++ b/packages/Catch2/src/catch2/internal/catch_context.hpp @@ -10,20 +10,20 @@ namespace Catch { - struct IResultCapture; - struct IConfig; + class IResultCapture; + class IConfig; - struct IContext - { + class IContext { + public: virtual ~IContext(); // = default virtual IResultCapture* getResultCapture() = 0; virtual IConfig const* getConfig() const = 0; }; - struct IMutableContext : IContext - { - virtual ~IMutableContext(); // = default + class IMutableContext : public IContext { + public: + ~IMutableContext() override; // = default virtual void setResultCapture( IResultCapture* resultCapture ) = 0; virtual void setConfig( IConfig const* config ) = 0; @@ -50,7 +50,7 @@ namespace Catch { void cleanUpContext(); class SimplePcg32; - SimplePcg32& rng(); + SimplePcg32& sharedRng(); } #endif // CATCH_CONTEXT_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_debug_console.cpp b/packages/Catch2/src/catch2/internal/catch_debug_console.cpp index 5942524eb..5564c6a88 100644 --- a/packages/Catch2/src/catch2/internal/catch_debug_console.cpp +++ b/packages/Catch2/src/catch2/internal/catch_debug_console.cpp @@ -5,11 +5,16 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 + #include <catch2/internal/catch_debug_console.hpp> + #include <catch2/internal/catch_config_android_logwrite.hpp> -#include <catch2/internal/catch_stream.hpp> #include <catch2/internal/catch_platform.hpp> #include <catch2/internal/catch_windows_h_proxy.hpp> +#include <catch2/catch_user_config.hpp> +#include <catch2/internal/catch_stdstreams.hpp> + +#include <ostream> #if defined(CATCH_CONFIG_ANDROID_LOGWRITE) #include <android/log.h> diff --git a/packages/Catch2/src/catch2/internal/catch_debugger.cpp b/packages/Catch2/src/catch2/internal/catch_debugger.cpp index 3c80173a6..349cf4ab3 100644 --- a/packages/Catch2/src/catch2/internal/catch_debugger.cpp +++ b/packages/Catch2/src/catch2/internal/catch_debugger.cpp @@ -7,8 +7,8 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_debugger.hpp> #include <catch2/internal/catch_errno_guard.hpp> -#include <catch2/internal/catch_stream.hpp> #include <catch2/internal/catch_platform.hpp> +#include <catch2/internal/catch_stdstreams.hpp> #if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE) diff --git a/packages/Catch2/src/catch2/internal/catch_debugger.hpp b/packages/Catch2/src/catch2/internal/catch_debugger.hpp index c300da72c..ede291d7f 100644 --- a/packages/Catch2/src/catch2/internal/catch_debugger.hpp +++ b/packages/Catch2/src/catch2/internal/catch_debugger.hpp @@ -19,7 +19,7 @@ namespace Catch { #if defined(__i386__) || defined(__x86_64__) #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */ #elif defined(__aarch64__) - #define CATCH_TRAP() __asm__(".inst 0xd4200000") + #define CATCH_TRAP() __asm__(".inst 0xd43e0000") #endif #elif defined(CATCH_PLATFORM_IPHONE) diff --git a/packages/Catch2/src/catch2/internal/catch_decomposer.cpp b/packages/Catch2/src/catch2/internal/catch_decomposer.cpp new file mode 100644 index 000000000..a85695389 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_decomposer.cpp @@ -0,0 +1,23 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_decomposer.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/packages/Catch2/src/catch2/internal/catch_decomposer.hpp b/packages/Catch2/src/catch2/internal/catch_decomposer.hpp index a747c34cd..e7dd1e9a4 100644 --- a/packages/Catch2/src/catch2/internal/catch_decomposer.hpp +++ b/packages/Catch2/src/catch2/internal/catch_decomposer.hpp @@ -33,7 +33,11 @@ namespace Catch { - struct ITransientExpression { + class ITransientExpression { + bool m_isBinaryExpression; + bool m_result; + + public: auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } auto getResult() const -> bool { return m_result; } virtual void streamReconstructedExpression( std::ostream &os ) const = 0; @@ -51,8 +55,6 @@ namespace Catch { // complain if it's not here :-( virtual ~ITransientExpression(); // = default; - bool m_isBinaryExpression; - bool m_result; friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); return out; diff --git a/packages/Catch2/src/catch2/internal/catch_enforce.cpp b/packages/Catch2/src/catch2/internal/catch_enforce.cpp index 3f4962cbf..4bc47ce3d 100644 --- a/packages/Catch2/src/catch2/internal/catch_enforce.cpp +++ b/packages/Catch2/src/catch2/internal/catch_enforce.cpp @@ -6,6 +6,7 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_stdstreams.hpp> #include <stdexcept> diff --git a/packages/Catch2/src/catch2/internal/catch_enforce.hpp b/packages/Catch2/src/catch2/internal/catch_enforce.hpp index 3f81ef1a0..db52a0e2d 100644 --- a/packages/Catch2/src/catch2/internal/catch_enforce.hpp +++ b/packages/Catch2/src/catch2/internal/catch_enforce.hpp @@ -10,7 +10,7 @@ #include <catch2/internal/catch_source_line_info.hpp> #include <catch2/internal/catch_compiler_capabilities.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <exception> diff --git a/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp b/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp index ef4baf9a9..32d0a16d9 100644 --- a/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp @@ -7,7 +7,6 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_enum_values_registry.hpp> #include <catch2/internal/catch_string_manip.hpp> -#include <catch2/internal/catch_stream.hpp> #include <cassert> diff --git a/packages/Catch2/src/catch2/internal/catch_errno_guard.cpp b/packages/Catch2/src/catch2/internal/catch_errno_guard.cpp new file mode 100644 index 000000000..95c192df0 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_errno_guard.cpp @@ -0,0 +1,16 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_errno_guard.hpp> + +#include <cerrno> + +namespace Catch { + ErrnoGuard::ErrnoGuard():m_oldErrno(errno){} + ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; } +} diff --git a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp index 9383257ce..3afd46f59 100644 --- a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp +++ b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp @@ -30,6 +30,7 @@ #include <catch2/internal/catch_enforce.hpp> #include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/internal/catch_windows_h_proxy.hpp> +#include <catch2/internal/catch_stdstreams.hpp> #include <algorithm> @@ -40,7 +41,7 @@ namespace Catch { // If neither SEH nor signal handling is required, the handler impls // do not have to do anything, and can be empty. void FatalConditionHandler::engage_platform() {} - void FatalConditionHandler::disengage_platform() {} + void FatalConditionHandler::disengage_platform() noexcept {} FatalConditionHandler::FatalConditionHandler() = default; FatalConditionHandler::~FatalConditionHandler() = default; @@ -78,13 +79,13 @@ namespace Catch { // 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" }, + { EXCEPTION_ILLEGAL_INSTRUCTION, "SIGILL - Illegal instruction signal" }, + { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" }, + { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" }, + { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" }, }; - static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { + static LONG CALLBACK topLevelExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) { for (auto const& def : signalDefs) { if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) { reportFatal(def.name); @@ -98,7 +99,7 @@ namespace Catch { // Since we do not support multiple instantiations, we put these // into global variables and rely on cleaning them up in outlined // constructors/destructors - static PVOID exceptionHandlerHandle = nullptr; + static LPTOP_LEVEL_EXCEPTION_FILTER previousTopLevelExceptionFilter = nullptr; // For MSVC, we reserve part of the stack memory for handling @@ -120,18 +121,17 @@ namespace Catch { void FatalConditionHandler::engage_platform() { - // Register as first handler in current chain - exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException); - if (!exceptionHandlerHandle) { - CATCH_RUNTIME_ERROR("Could not register vectored exception handler"); - } + // Register as a the top level exception filter. + previousTopLevelExceptionFilter = SetUnhandledExceptionFilter(topLevelExceptionFilter); } - void FatalConditionHandler::disengage_platform() { - if (!RemoveVectoredExceptionHandler(exceptionHandlerHandle)) { - CATCH_RUNTIME_ERROR("Could not unregister vectored exception handler"); + void FatalConditionHandler::disengage_platform() noexcept { + if (SetUnhandledExceptionFilter(previousTopLevelExceptionFilter) != topLevelExceptionFilter) { + Catch::cerr() + << "Unexpected SEH unhandled exception filter on disengage." + << " The filter was restored, but might be rolled back unexpectedly."; } - exceptionHandlerHandle = nullptr; + previousTopLevelExceptionFilter = nullptr; } } // end namespace Catch @@ -171,7 +171,7 @@ namespace Catch { static stack_t oldSigStack{}; static struct sigaction oldSigActions[sizeof(signalDefs) / sizeof(SignalDefs)]{}; - static void restorePreviousSignalHandlers() { + static void restorePreviousSignalHandlers() noexcept { // We set signal handlers back to the previous ones. Hopefully // nobody overwrote them in the meantime, and doesn't expect // their signal handlers to live past ours given that they @@ -234,7 +234,7 @@ namespace Catch { #endif - void FatalConditionHandler::disengage_platform() { + void FatalConditionHandler::disengage_platform() noexcept { restorePreviousSignalHandlers(); } diff --git a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp index 4a2818cb5..389dab5d4 100644 --- a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp +++ b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp @@ -32,7 +32,7 @@ namespace Catch { // Should be if-defed to work on current platform, can assume // engage-disengage 1:1 pairing. void engage_platform(); - void disengage_platform(); + void disengage_platform() noexcept; public: // Should also have platform-specific implementations as needed FatalConditionHandler(); @@ -44,7 +44,7 @@ namespace Catch { engage_platform(); } - void disengage() { + void disengage() noexcept { assert(m_started && "Handler cannot be uninstalled without being installed first"); m_started = false; disengage_platform(); diff --git a/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.hpp b/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.hpp index 3e73b3a72..f12128139 100644 --- a/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.hpp +++ b/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.hpp @@ -10,6 +10,7 @@ #include <catch2/internal/catch_polyfills.hpp> +#include <cassert> #include <cmath> #include <cstdint> #include <utility> @@ -24,6 +25,15 @@ namespace Catch { } // end namespace Detail + +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic push + // We do a bunch of direct compensations of floating point numbers, + // because we know what we are doing and actually do want the direct + // comparison behaviour. +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + /** * Calculates the ULP distance between two floating point numbers * @@ -83,6 +93,11 @@ namespace Catch { return lc - rc; } +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic pop +#endif + + } // end namespace Catch #endif // CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_stream.cpp b/packages/Catch2/src/catch2/internal/catch_istream.cpp similarity index 58% rename from packages/Catch2/src/catch2/internal/catch_stream.cpp rename to packages/Catch2/src/catch2/internal/catch_istream.cpp index 9890ae3a5..4cd350584 100644 --- a/packages/Catch2/src/catch2/internal/catch_stream.cpp +++ b/packages/Catch2/src/catch2/internal/catch_istream.cpp @@ -5,15 +5,14 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_istream.hpp> #include <catch2/internal/catch_enforce.hpp> -#include <catch2/internal/catch_stream.hpp> #include <catch2/internal/catch_debug_console.hpp> -#include <catch2/internal/catch_stringref.hpp> -#include <catch2/internal/catch_singletons.hpp> #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_stdstreams.hpp> #include <cstdio> -#include <iostream> #include <fstream> #include <sstream> #include <vector> @@ -34,7 +33,7 @@ namespace Detail { setp( data, data + sizeof(data) ); } - ~StreamBufImpl() noexcept { + ~StreamBufImpl() noexcept override { StreamBufImpl::sync(); } @@ -74,15 +73,15 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// class FileStream : public IStream { - mutable std::ofstream m_ofs; + std::ofstream m_ofs; public: FileStream( std::string const& filename ) { m_ofs.open( filename.c_str() ); - CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << "'" ); + CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' ); } ~FileStream() override = default; public: // IStream - std::ostream& stream() const override { + std::ostream& stream() override { return m_ofs; } }; @@ -90,7 +89,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// class CoutStream : public IStream { - mutable std::ostream m_os; + std::ostream m_os; public: // Store the streambuf from cout up-front because // cout may get redirected when running tests @@ -98,14 +97,29 @@ namespace Detail { ~CoutStream() override = default; public: // IStream - std::ostream& stream() const override { return m_os; } + std::ostream& stream() override { return m_os; } + bool isConsole() const override { return true; } + }; + + class CerrStream : public IStream { + std::ostream m_os; + + public: + // Store the streambuf from cerr up-front because + // cout may get redirected when running tests + CerrStream(): m_os( Catch::cerr().rdbuf() ) {} + ~CerrStream() override = default; + + public: // IStream + std::ostream& stream() override { return m_os; } + bool isConsole() const override { return true; } }; /////////////////////////////////////////////////////////////////////////// class DebugOutStream : public IStream { Detail::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf; - mutable std::ostream m_os; + std::ostream m_os; public: DebugOutStream() : m_streamBuf( Detail::make_unique<StreamBufImpl<OutputDebugWriter>>() ), @@ -115,7 +129,7 @@ namespace Detail { ~DebugOutStream() override = default; public: // IStream - std::ostream& stream() const override { return m_os; } + std::ostream& stream() override { return m_os; } }; } // unnamed namespace @@ -123,70 +137,22 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream const> { - if( filename.empty() ) + auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream> { + if ( filename.empty() || filename == "-" ) { return Detail::make_unique<Detail::CoutStream>(); - else if( filename[0] == '%' ) { - if( filename == "%debug" ) - return Detail::make_unique<Detail::DebugOutStream>(); - else - CATCH_ERROR( "Unrecognised stream: '" << filename << "'" ); } - else - return Detail::make_unique<Detail::FileStream>( filename ); - } - - - // This class encapsulates the idea of a pool of ostringstreams that can be reused. - struct StringStreams { - std::vector<Detail::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( Detail::make_unique<std::ostringstream>() ); - return m_streams.size()-1; - } - else { - auto index = m_unused.back(); - m_unused.pop_back(); - return index; + if( filename[0] == '%' ) { + if ( filename == "%debug" ) { + return Detail::make_unique<Detail::DebugOutStream>(); + } else if ( filename == "%stderr" ) { + return Detail::make_unique<Detail::CerrStream>(); + } else if ( filename == "%stdout" ) { + return Detail::make_unique<Detail::CoutStream>(); + } else { + CATCH_ERROR( "Unrecognised stream: '" << filename << '\'' ); } } - - 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 ); - } - - std::string ReusableStringStream::str() const { - return static_cast<std::ostringstream*>( m_oss )->str(); + return Detail::make_unique<Detail::FileStream>( filename ); } - void ReusableStringStream::str( std::string const& str ) { - static_cast<std::ostringstream*>( m_oss )->str( 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/packages/Catch2/src/catch2/internal/catch_istream.hpp b/packages/Catch2/src/catch2/internal/catch_istream.hpp new file mode 100644 index 000000000..629816c80 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_istream.hpp @@ -0,0 +1,54 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_ISTREAM_HPP_INCLUDED +#define CATCH_ISTREAM_HPP_INCLUDED + +#include <catch2/internal/catch_noncopyable.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> + +#include <iosfwd> +#include <cstddef> +#include <ostream> +#include <string> + +namespace Catch { + + class IStream { + public: + virtual ~IStream(); // = default + virtual std::ostream& stream() = 0; + /** + * Best guess on whether the instance is writing to a console (e.g. via stdout/stderr) + * + * This is useful for e.g. Win32 colour support, because the Win32 + * API manipulates console directly, unlike POSIX escape codes, + * that can be written anywhere. + * + * Due to variety of ways to change where the stdout/stderr is + * _actually_ being written, users should always assume that + * the answer might be wrong. + */ + virtual bool isConsole() const { return false; } + }; + + /** + * Creates a stream wrapper that writes to specific file. + * + * Also recognizes 4 special filenames + * * `-` for stdout + * * `%stdout` for stdout + * * `%stderr` for stderr + * * `%debug` for platform specific debugging output + * + * \throws if passed an unrecognized %-prefixed stream + */ + auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream>; + +} + +#endif // CATCH_STREAM_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_lazy_expr.cpp b/packages/Catch2/src/catch2/internal/catch_lazy_expr.cpp new file mode 100644 index 000000000..96ecf5c33 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_lazy_expr.cpp @@ -0,0 +1,29 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_lazy_expr.hpp> +#include <catch2/internal/catch_decomposer.hpp> + +namespace Catch { + + 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; + } + +} // namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp b/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp index e69a72ef3..d4aa79d7b 100644 --- a/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp +++ b/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp @@ -12,7 +12,7 @@ namespace Catch { - struct ITransientExpression; + class ITransientExpression; class LazyExpression { friend class AssertionHandler; diff --git a/packages/Catch2/src/catch2/internal/catch_leak_detector.cpp b/packages/Catch2/src/catch2/internal/catch_leak_detector.cpp new file mode 100644 index 000000000..c9abbdfcd --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_leak_detector.cpp @@ -0,0 +1,38 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_leak_detector.hpp> +#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> +#include <catch2/catch_user_config.hpp> + +#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 // ^^ Windows crt debug heap enabled // Windows crt debug heap disabled vv + + Catch::LeakDetector::LeakDetector() {} + +#endif // CATCH_CONFIG_WINDOWS_CRTDBG + +Catch::LeakDetector::~LeakDetector() { + Catch::cleanUp(); +} diff --git a/packages/Catch2/src/catch2/internal/catch_list.cpp b/packages/Catch2/src/catch2/internal/catch_list.cpp index 20613c707..2c22745ce 100644 --- a/packages/Catch2/src/catch2/internal/catch_list.cpp +++ b/packages/Catch2/src/catch2/internal/catch_list.cpp @@ -13,6 +13,7 @@ #include <catch2/interfaces/catch_interfaces_testcase.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_case_insensitive_comparisons.hpp> #include <catch2/internal/catch_context.hpp> #include <catch2/catch_config.hpp> @@ -22,22 +23,22 @@ namespace Catch { namespace { - void listTests(IStreamingReporter& reporter, IConfig const& config) { + void listTests(IEventListener& reporter, IConfig const& config) { auto const& testSpec = config.testSpec(); auto matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config); reporter.listTests(matchedTestCases); } - void listTags(IStreamingReporter& reporter, IConfig const& config) { + void listTags(IEventListener& reporter, IConfig const& config) { auto const& testSpec = config.testSpec(); std::vector<TestCaseHandle> matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config); - std::map<StringRef, TagInfo> tagCounts; + std::map<StringRef, TagInfo, Detail::CaseInsensitiveLess> tagCounts; for (auto const& testCase : matchedTestCases) { for (auto const& tagName : testCase.getTestCaseInfo().tags) { - auto it = tagCounts.find(tagName.lowerCased); + auto it = tagCounts.find(tagName.original); if (it == tagCounts.end()) - it = tagCounts.insert(std::make_pair(tagName.lowerCased, TagInfo())).first; + it = tagCounts.insert(std::make_pair(tagName.original, TagInfo())).first; it->second.add(tagName.original); } } @@ -50,7 +51,7 @@ namespace Catch { reporter.listTags(infos); } - void listReporters(IStreamingReporter& reporter) { + void listReporters(IEventListener& reporter) { std::vector<ReporterDescription> descriptions; IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); @@ -62,6 +63,19 @@ namespace Catch { reporter.listReporters(descriptions); } + void listListeners(IEventListener& reporter) { + std::vector<ListenerDescription> descriptions; + + auto const& factories = + getRegistryHub().getReporterRegistry().getListeners(); + descriptions.reserve( factories.size() ); + for ( auto const& fac : factories ) { + descriptions.push_back( { fac->getName(), fac->getDescription() } ); + } + + reporter.listListeners( descriptions ); + } + } // end anonymous namespace void TagInfo::add( StringRef spelling ) { @@ -85,7 +99,7 @@ namespace Catch { return out; } - bool list( IStreamingReporter& reporter, Config const& config ) { + bool list( IEventListener& reporter, Config const& config ) { bool listed = false; if (config.listTests()) { listed = true; @@ -99,6 +113,10 @@ namespace Catch { listed = true; listReporters(reporter); } + if ( config.listListeners() ) { + listed = true; + listListeners( reporter ); + } return listed; } diff --git a/packages/Catch2/src/catch2/internal/catch_list.hpp b/packages/Catch2/src/catch2/internal/catch_list.hpp index 2d1952c59..6fd759ea2 100644 --- a/packages/Catch2/src/catch2/internal/catch_list.hpp +++ b/packages/Catch2/src/catch2/internal/catch_list.hpp @@ -16,13 +16,17 @@ namespace Catch { - struct IStreamingReporter; + class IEventListener; class Config; struct ReporterDescription { std::string name, description; }; + struct ListenerDescription { + StringRef name; + std::string description; + }; struct TagInfo { void add(StringRef spelling); @@ -32,7 +36,7 @@ namespace Catch { std::size_t count = 0; }; - bool list( IStreamingReporter& reporter, Config const& config ); + bool list( IEventListener& reporter, Config const& config ); } // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_main.cpp b/packages/Catch2/src/catch2/internal/catch_main.cpp index ed89ab6ee..a0126c231 100644 --- a/packages/Catch2/src/catch2/internal/catch_main.cpp +++ b/packages/Catch2/src/catch2/internal/catch_main.cpp @@ -14,10 +14,13 @@ namespace Catch { CATCH_INTERNAL_START_WARNINGS_SUPPRESSION CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS - LeakDetector leakDetector; + static LeakDetector leakDetector; CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION } +// Allow users of amalgamated .cpp file to remove our main and provide their own. +#if !defined(CATCH_AMALGAMATED_CUSTOM_MAIN) + #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 __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) { @@ -32,3 +35,5 @@ int main (int argc, char * argv[]) { return Catch::Session().run( argc, argv ); } + +#endif // !defined(CATCH_AMALGAMATED_CUSTOM_MAIN diff --git a/packages/Catch2/src/catch2/internal/catch_message_info.cpp b/packages/Catch2/src/catch2/internal/catch_message_info.cpp new file mode 100644 index 000000000..11127e3f6 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_message_info.cpp @@ -0,0 +1,25 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_message_info.hpp> + +namespace Catch { + + MessageInfo::MessageInfo( StringRef _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + type( _type ), + sequence( ++globalCount ) + {} + + // This may need protecting if threading support is added + unsigned int MessageInfo::globalCount = 0; + +} // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_move_and_forward.hpp b/packages/Catch2/src/catch2/internal/catch_move_and_forward.hpp index 70520308f..01b7adae5 100644 --- a/packages/Catch2/src/catch2/internal/catch_move_and_forward.hpp +++ b/packages/Catch2/src/catch2/internal/catch_move_and_forward.hpp @@ -10,10 +10,10 @@ #include <type_traits> -//! TODO: replaces std::move for better performance +//! Replacement for std::move with better compile time performance #define CATCH_MOVE(...) static_cast<std::remove_reference_t<decltype(__VA_ARGS__)>&&>(__VA_ARGS__) +//! Replacement for std::forward with better compile time performance #define CATCH_FORWARD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__) #endif // CATCH_MOVE_AND_FORWARD_HPP_INCLUDED - \ No newline at end of file diff --git a/packages/Catch2/src/catch2/internal/catch_option.hpp b/packages/Catch2/src/catch2/internal/catch_optional.hpp similarity index 54% rename from packages/Catch2/src/catch2/internal/catch_option.hpp rename to packages/Catch2/src/catch2/internal/catch_optional.hpp index 04e4d69ec..86eca344c 100644 --- a/packages/Catch2/src/catch2/internal/catch_option.hpp +++ b/packages/Catch2/src/catch2/internal/catch_optional.hpp @@ -5,28 +5,30 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#ifndef CATCH_OPTION_HPP_INCLUDED -#define CATCH_OPTION_HPP_INCLUDED +#ifndef CATCH_OPTIONAL_HPP_INCLUDED +#define CATCH_OPTIONAL_HPP_INCLUDED + +#include <cassert> namespace Catch { // An optional type template<typename T> - class Option { + class Optional { public: - Option() : nullableValue( nullptr ) {} - Option( T const& _value ) + Optional() : nullableValue( nullptr ) {} + Optional( T const& _value ) : nullableValue( new( storage ) T( _value ) ) {} - Option( Option const& _other ) + Optional( Optional const& _other ) : nullableValue( _other ? new( storage ) T( *_other ) : nullptr ) {} - ~Option() { + ~Optional() { reset(); } - Option& operator= ( Option const& _other ) { + Optional& operator= ( Optional const& _other ) { if( &_other != this ) { reset(); if( _other ) @@ -34,7 +36,7 @@ namespace Catch { } return *this; } - Option& operator = ( T const& _value ) { + Optional& operator = ( T const& _value ) { reset(); nullableValue = new( storage ) T( _value ); return *this; @@ -46,10 +48,22 @@ namespace Catch { nullableValue = nullptr; } - T& operator*() { return *nullableValue; } - T const& operator*() const { return *nullableValue; } - T* operator->() { return nullableValue; } - const T* operator->() const { return nullableValue; } + T& operator*() { + assert(nullableValue); + return *nullableValue; + } + T const& operator*() const { + assert(nullableValue); + return *nullableValue; + } + T* operator->() { + assert(nullableValue); + return nullableValue; + } + const T* operator->() const { + assert(nullableValue); + return nullableValue; + } T valueOr( T const& defaultValue ) const { return nullableValue ? *nullableValue : defaultValue; @@ -63,6 +77,19 @@ namespace Catch { return some(); } + friend bool operator==(Optional const& a, Optional const& b) { + if (a.none() && b.none()) { + return true; + } else if (a.some() && b.some()) { + return *a == *b; + } else { + return false; + } + } + friend bool operator!=(Optional const& a, Optional const& b) { + return !( a == b ); + } + private: T *nullableValue; alignas(alignof(T)) char storage[sizeof(T)]; @@ -70,4 +97,4 @@ namespace Catch { } // end namespace Catch -#endif // CATCH_OPTION_HPP_INCLUDED +#endif // CATCH_OPTIONAL_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp b/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp index 49cfaa0d3..ae0601412 100644 --- a/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp +++ b/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp @@ -7,6 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_output_redirect.hpp> #include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_stdstreams.hpp> #include <cstdio> #include <cstring> diff --git a/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp b/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp index 26334d165..d3463d992 100644 --- a/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp +++ b/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp @@ -9,7 +9,8 @@ #define CATCH_OUTPUT_REDIRECT_HPP_INCLUDED #include <catch2/internal/catch_platform.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> #include <cstdio> #include <iosfwd> diff --git a/packages/Catch2/src/catch2/internal/catch_platform.hpp b/packages/Catch2/src/catch2/internal/catch_platform.hpp index 8ecf01ad2..01ee6cd9d 100644 --- a/packages/Catch2/src/catch2/internal/catch_platform.hpp +++ b/packages/Catch2/src/catch2/internal/catch_platform.hpp @@ -24,6 +24,10 @@ #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) # define CATCH_PLATFORM_WINDOWS + +# if defined( WINAPI_FAMILY ) && ( WINAPI_FAMILY == WINAPI_FAMILY_APP ) +# define CATCH_PLATFORM_WINDOWS_UWP +# endif #endif #endif // CATCH_PLATFORM_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_polyfills.cpp b/packages/Catch2/src/catch2/internal/catch_polyfills.cpp new file mode 100644 index 000000000..13e60f4a4 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_polyfills.cpp @@ -0,0 +1,34 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_polyfills.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/catch_user_config.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/packages/Catch2/src/catch2/internal/catch_preprocessor.hpp b/packages/Catch2/src/catch2/internal/catch_preprocessor.hpp index 00859b150..4292d0df5 100644 --- a/packages/Catch2/src/catch2/internal/catch_preprocessor.hpp +++ b/packages/Catch2/src/catch2/internal/catch_preprocessor.hpp @@ -8,6 +8,7 @@ #ifndef CATCH_PREPROCESSOR_HPP_INCLUDED #define CATCH_PREPROCESSOR_HPP_INCLUDED +#include <catch2/internal/catch_preprocessor_remove_parens.hpp> #if defined(__GNUC__) // We need to silence "empty __VA_ARGS__ warning", and using just _Pragma does not work @@ -59,10 +60,6 @@ #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__ @@ -77,8 +74,6 @@ #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__)) diff --git a/packages/Catch2/src/catch2/internal/catch_preprocessor_remove_parens.hpp b/packages/Catch2/src/catch2/internal/catch_preprocessor_remove_parens.hpp new file mode 100644 index 000000000..803378908 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_preprocessor_remove_parens.hpp @@ -0,0 +1,19 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED +#define CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED + +#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_REMOVE_PARENS( ... ) \ + INTERNAL_CATCH_EXPAND1( INTERNAL_CATCH_DEF __VA_ARGS__ ) + +#endif // CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_random_seed_generation.cpp b/packages/Catch2/src/catch2/internal/catch_random_seed_generation.cpp new file mode 100644 index 000000000..7fc1b90d4 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_random_seed_generation.cpp @@ -0,0 +1,34 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_random_seed_generation.hpp> + +#include <catch2/internal/catch_enforce.hpp> + +#include <ctime> +#include <random> + +namespace Catch { + + std::uint32_t generateRandomSeed( GenerateFrom from ) { + switch ( from ) { + case GenerateFrom::Time: + return static_cast<std::uint32_t>( std::time( nullptr ) ); + + case GenerateFrom::Default: + case GenerateFrom::RandomDevice: + // In theory, a platform could have random_device that returns just + // 16 bits. That is still some randomness, so we don't care too much + return static_cast<std::uint32_t>( std::random_device{}() ); + + default: + CATCH_ERROR("Unknown generation method"); + } + } + +} // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_random_seed_generation.hpp b/packages/Catch2/src/catch2/internal/catch_random_seed_generation.hpp new file mode 100644 index 000000000..42ca93db7 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_random_seed_generation.hpp @@ -0,0 +1,26 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED +#define CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED + +#include <cstdint> + +namespace Catch { + + enum class GenerateFrom { + Time, + RandomDevice, + //! Currently equivalent to RandomDevice, but can change at any point + Default + }; + + std::uint32_t generateRandomSeed(GenerateFrom from); + +} // end namespace Catch + +#endif // CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp b/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp index ee92ad7de..01b6b3a0a 100644 --- a/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp @@ -7,7 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_reporter_registry.hpp> -#include <catch2/catch_reporter_registrars.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> #include <catch2/reporters/catch_reporter_automake.hpp> #include <catch2/reporters/catch_reporter_compact.hpp> #include <catch2/reporters/catch_reporter_console.hpp> @@ -17,36 +17,41 @@ #include <catch2/reporters/catch_reporter_teamcity.hpp> #include <catch2/reporters/catch_reporter_xml.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_enforce.hpp> namespace Catch { ReporterRegistry::ReporterRegistry() { // Because it is impossible to move out of initializer list, // we have to add the elements manually - m_factories["automake"] = Detail::make_unique<ReporterFactory<AutomakeReporter>>(); + m_factories["Automake"] = Detail::make_unique<ReporterFactory<AutomakeReporter>>(); m_factories["compact"] = Detail::make_unique<ReporterFactory<CompactReporter>>(); m_factories["console"] = Detail::make_unique<ReporterFactory<ConsoleReporter>>(); - m_factories["junit"] = Detail::make_unique<ReporterFactory<JunitReporter>>(); - m_factories["sonarqube"] = Detail::make_unique<ReporterFactory<SonarQubeReporter>>(); - m_factories["tap"] = Detail::make_unique<ReporterFactory<TAPReporter>>(); - m_factories["teamcity"] = Detail::make_unique<ReporterFactory<TeamCityReporter>>(); - m_factories["xml"] = Detail::make_unique<ReporterFactory<XmlReporter>>(); + m_factories["JUnit"] = Detail::make_unique<ReporterFactory<JunitReporter>>(); + m_factories["SonarQube"] = Detail::make_unique<ReporterFactory<SonarQubeReporter>>(); + m_factories["TAP"] = Detail::make_unique<ReporterFactory<TAPReporter>>(); + m_factories["TeamCity"] = Detail::make_unique<ReporterFactory<TeamCityReporter>>(); + m_factories["XML"] = Detail::make_unique<ReporterFactory<XmlReporter>>(); } ReporterRegistry::~ReporterRegistry() = default; - IStreamingReporterPtr ReporterRegistry::create( std::string const& name, IConfig const* config ) const { + IEventListenerPtr ReporterRegistry::create( std::string const& name, ReporterConfig&& config ) const { auto it = m_factories.find( name ); if( it == m_factories.end() ) return nullptr; - return it->second->create( ReporterConfig( config ) ); + return it->second->create( CATCH_MOVE(config) ); } void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr factory ) { - m_factories.emplace(name, CATCH_MOVE(factory)); + CATCH_ENFORCE( name.find( "::" ) == name.npos, + "'::' is not allowed in reporter name: '" + name + '\'' ); + auto ret = m_factories.emplace(name, CATCH_MOVE(factory)); + CATCH_ENFORCE( ret.second, "reporter using '" + name + "' as name was already registered" ); } - void ReporterRegistry::registerListener( IReporterFactoryPtr factory ) { + void ReporterRegistry::registerListener( + Detail::unique_ptr<EventListenerFactory> factory ) { m_listeners.push_back( CATCH_MOVE(factory) ); } diff --git a/packages/Catch2/src/catch2/internal/catch_reporter_registry.hpp b/packages/Catch2/src/catch2/internal/catch_reporter_registry.hpp index 62c2023e9..b0864265c 100644 --- a/packages/Catch2/src/catch2/internal/catch_reporter_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_reporter_registry.hpp @@ -21,10 +21,10 @@ namespace Catch { ReporterRegistry(); ~ReporterRegistry() override; // = default, out of line to allow fwd decl - IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const override; + IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const override; void registerReporter( std::string const& name, IReporterFactoryPtr factory ); - void registerListener( IReporterFactoryPtr factory ); + void registerListener( Detail::unique_ptr<EventListenerFactory> factory ); FactoryMap const& getFactories() const override; Listeners const& getListeners() const override; diff --git a/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp b/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp new file mode 100644 index 000000000..30ee191c5 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp @@ -0,0 +1,173 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_reporter_spec_parser.hpp> + +#include <catch2/interfaces/catch_interfaces_config.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> + +#include <algorithm> + +namespace Catch { + + namespace { + struct kvPair { + StringRef key, value; + }; + + kvPair splitKVPair(StringRef kvString) { + auto splitPos = static_cast<size_t>( std::distance( + kvString.begin(), + std::find( kvString.begin(), kvString.end(), '=' ) ) ); + + return { kvString.substr( 0, splitPos ), + kvString.substr( splitPos + 1, kvString.size() ) }; + } + } + + namespace Detail { + std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) { + static constexpr auto separator = "::"; + static constexpr size_t separatorSize = 2; + + size_t separatorPos = 0; + auto findNextSeparator = [&reporterSpec]( size_t startPos ) { + static_assert( + separatorSize == 2, + "The code below currently assumes 2 char separator" ); + + auto currentPos = startPos; + do { + while ( currentPos < reporterSpec.size() && + reporterSpec[currentPos] != separator[0] ) { + ++currentPos; + } + if ( currentPos + 1 < reporterSpec.size() && + reporterSpec[currentPos + 1] == separator[1] ) { + return currentPos; + } + ++currentPos; + } while ( currentPos < reporterSpec.size() ); + + return static_cast<size_t>( -1 ); + }; + + std::vector<std::string> parts; + + while ( separatorPos < reporterSpec.size() ) { + const auto nextSeparator = findNextSeparator( separatorPos ); + parts.push_back( static_cast<std::string>( reporterSpec.substr( + separatorPos, nextSeparator - separatorPos ) ) ); + + if ( nextSeparator == static_cast<size_t>( -1 ) ) { + break; + } + separatorPos = nextSeparator + separatorSize; + } + + // Handle a separator at the end. + // This is not a valid spec, but we want to do validation in a + // centralized place + if ( separatorPos == reporterSpec.size() ) { + parts.emplace_back(); + } + + return parts; + } + + Optional<ColourMode> stringToColourMode( StringRef colourMode ) { + if ( colourMode == "default" ) { + return ColourMode::PlatformDefault; + } else if ( colourMode == "ansi" ) { + return ColourMode::ANSI; + } else if ( colourMode == "win32" ) { + return ColourMode::Win32; + } else if ( colourMode == "none" ) { + return ColourMode::None; + } else { + return {}; + } + } + } // namespace Detail + + + bool operator==( ReporterSpec const& lhs, ReporterSpec const& rhs ) { + return lhs.m_name == rhs.m_name && + lhs.m_outputFileName == rhs.m_outputFileName && + lhs.m_colourMode == rhs.m_colourMode && + lhs.m_customOptions == rhs.m_customOptions; + } + + Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec ) { + auto parts = Detail::splitReporterSpec( reporterSpec ); + + assert( parts.size() > 0 && "Split should never return empty vector" ); + + std::map<std::string, std::string> kvPairs; + Optional<std::string> outputFileName; + Optional<ColourMode> colourMode; + + // First part is always reporter name, so we skip it + for ( size_t i = 1; i < parts.size(); ++i ) { + auto kv = splitKVPair( parts[i] ); + auto key = kv.key, value = kv.value; + + if ( key.empty() || value.empty() ) { + return {}; + } else if ( key[0] == 'X' ) { + // This is a reporter-specific option, we don't check these + // apart from basic sanity checks + if ( key.size() == 1 ) { + return {}; + } + + auto ret = kvPairs.emplace( std::string(kv.key), std::string(kv.value) ); + if ( !ret.second ) { + // Duplicated key. We might want to handle this differently, + // e.g. by overwriting the existing value? + return {}; + } + } else if ( key == "out" ) { + // Duplicated key + if ( outputFileName ) { + return {}; + } + outputFileName = static_cast<std::string>( value ); + } else if ( key == "colour-mode" ) { + // Duplicated key + if ( colourMode ) { + return {}; + } + colourMode = Detail::stringToColourMode( value ); + // Parsing failed + if ( !colourMode ) { + return {}; + } + } else { + // Unrecognized option + return {}; + } + } + + return ReporterSpec{ CATCH_MOVE( parts[0] ), + CATCH_MOVE( outputFileName ), + CATCH_MOVE( colourMode ), + CATCH_MOVE( kvPairs ) }; + } + +ReporterSpec::ReporterSpec( + std::string name, + Optional<std::string> outputFileName, + Optional<ColourMode> colourMode, + std::map<std::string, std::string> customOptions ): + m_name( CATCH_MOVE( name ) ), + m_outputFileName( CATCH_MOVE( outputFileName ) ), + m_colourMode( CATCH_MOVE( colourMode ) ), + m_customOptions( CATCH_MOVE( customOptions ) ) {} + +} // namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.hpp b/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.hpp new file mode 100644 index 000000000..242e10222 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.hpp @@ -0,0 +1,85 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED +#define CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED + +#include <catch2/internal/catch_console_colour.hpp> +#include <catch2/internal/catch_optional.hpp> +#include <catch2/internal/catch_stringref.hpp> + +#include <map> +#include <string> +#include <vector> + +namespace Catch { + + enum class ColourMode : std::uint8_t; + + namespace Detail { + //! Splits the reporter spec into reporter name and kv-pair options + std::vector<std::string> splitReporterSpec( StringRef reporterSpec ); + + Optional<ColourMode> stringToColourMode( StringRef colourMode ); + } + + /** + * Structured reporter spec that a reporter can be created from + * + * Parsing has been validated, but semantics have not. This means e.g. + * that the colour mode is known to Catch2, but it might not be + * compiled into the binary, and the output filename might not be + * openable. + */ + class ReporterSpec { + std::string m_name; + Optional<std::string> m_outputFileName; + Optional<ColourMode> m_colourMode; + std::map<std::string, std::string> m_customOptions; + + friend bool operator==( ReporterSpec const& lhs, + ReporterSpec const& rhs ); + friend bool operator!=( ReporterSpec const& lhs, + ReporterSpec const& rhs ) { + return !( lhs == rhs ); + } + + public: + ReporterSpec( + std::string name, + Optional<std::string> outputFileName, + Optional<ColourMode> colourMode, + std::map<std::string, std::string> customOptions ); + + std::string const& name() const { return m_name; } + + Optional<std::string> const& outputFile() const { + return m_outputFileName; + } + + Optional<ColourMode> const& colourMode() const { return m_colourMode; } + + std::map<std::string, std::string> const& customOptions() const { + return m_customOptions; + } + }; + + /** + * Parses provided reporter spec string into + * + * Returns empty optional on errors, e.g. + * * field that is not first and not a key+value pair + * * duplicated keys in kv pair + * * unknown catch reporter option + * * empty key/value in an custom kv pair + * * ... + */ + Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec ); + +} + +#endif // CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp b/packages/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp new file mode 100644 index 000000000..9b0824236 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_reusable_string_stream.cpp @@ -0,0 +1,62 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#include <catch2/internal/catch_reusable_string_stream.hpp> +#include <catch2/internal/catch_singletons.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> + +#include <cstdio> +#include <sstream> +#include <vector> + +namespace Catch { + + // This class encapsulates the idea of a pool of ostringstreams that can be reused. + struct StringStreams { + std::vector<Detail::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( Detail::make_unique<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 ); + } + + std::string ReusableStringStream::str() const { + return static_cast<std::ostringstream*>( m_oss )->str(); + } + + void ReusableStringStream::str( std::string const& str ) { + static_cast<std::ostringstream*>( m_oss )->str( str ); + } + + +} diff --git a/packages/Catch2/src/catch2/internal/catch_stream.hpp b/packages/Catch2/src/catch2/internal/catch_reusable_string_stream.hpp similarity index 77% rename from packages/Catch2/src/catch2/internal/catch_stream.hpp rename to packages/Catch2/src/catch2/internal/catch_reusable_string_stream.hpp index 39a4c0c8c..55cff727e 100644 --- a/packages/Catch2/src/catch2/internal/catch_stream.hpp +++ b/packages/Catch2/src/catch2/internal/catch_reusable_string_stream.hpp @@ -5,11 +5,10 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#ifndef CATCH_STREAM_HPP_INCLUDED -#define CATCH_STREAM_HPP_INCLUDED +#ifndef CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED +#define CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED #include <catch2/internal/catch_noncopyable.hpp> -#include <catch2/internal/catch_unique_ptr.hpp> #include <iosfwd> #include <cstddef> @@ -18,17 +17,6 @@ namespace Catch { - std::ostream& cout(); - std::ostream& cerr(); - std::ostream& clog(); - - struct IStream { - virtual ~IStream(); // = default - virtual std::ostream& stream() const = 0; - }; - - auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream const>; - class ReusableStringStream : Detail::NonCopyable { std::size_t m_index; std::ostream* m_oss; @@ -66,4 +54,4 @@ namespace Catch { }; } -#endif // CATCH_STREAM_HPP_INCLUDED +#endif // CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_run_context.cpp b/packages/Catch2/src/catch2/internal/catch_run_context.cpp index b8e74e5f3..c8b0b30e3 100644 --- a/packages/Catch2/src/catch2/internal/catch_run_context.cpp +++ b/packages/Catch2/src/catch2/internal/catch_run_context.cpp @@ -7,6 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_run_context.hpp> +#include <catch2/catch_user_config.hpp> #include <catch2/interfaces/catch_interfaces_generatortracker.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> #include <catch2/internal/catch_compiler_capabilities.hpp> @@ -31,7 +32,7 @@ namespace Catch { GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) : TrackerBase( nameAndLocation, ctx, parent ) {} - ~GeneratorTracker(); + ~GeneratorTracker() override; static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation ) { GeneratorTracker* tracker; @@ -142,7 +143,7 @@ namespace Catch { // this generator is still waiting for any child to start. if ( should_wait_for_child || ( m_runState == CompletedSuccessfully && - m_generator->next() ) ) { + m_generator->countedNext() ) ) { m_children.clear(); m_runState = Executing; } @@ -159,7 +160,7 @@ namespace Catch { GeneratorTracker::~GeneratorTracker() = default; } - RunContext::RunContext(IConfig const* _config, IStreamingReporterPtr&& reporter) + RunContext::RunContext(IConfig const* _config, IEventListenerPtr&& reporter) : m_runInfo(_config->name()), m_context(getCurrentMutableContext()), m_config(_config), @@ -192,6 +193,39 @@ namespace Catch { assert(rootTracker.isSectionTracker()); static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); + // We intentionally only seed the internal RNG once per test case, + // before it is first invoked. The reason for that is a complex + // interplay of generator/section implementation details and the + // Random*Generator types. + // + // The issue boils down to us needing to seed the Random*Generators + // with different seed each, so that they return different sequences + // of random numbers. We do this by giving them a number from the + // shared RNG instance as their seed. + // + // However, this runs into an issue if the reseeding happens each + // time the test case is entered (as opposed to first time only), + // because multiple generators could get the same seed, e.g. in + // ```cpp + // TEST_CASE() { + // auto i = GENERATE(take(10, random(0, 100)); + // SECTION("A") { + // auto j = GENERATE(take(10, random(0, 100)); + // } + // SECTION("B") { + // auto k = GENERATE(take(10, random(0, 100)); + // } + // } + // ``` + // `i` and `j` would properly return values from different sequences, + // but `i` and `k` would return the same sequence, because their seed + // would be the same. + // (The reason their seeds would be the same is that the generator + // for k would be initialized when the test case is entered the second + // time, after the shared RNG instance was reset to the same value + // it had when the generator for i was initialized.) + seedRng( *m_config ); + uint64_t testRuns = 0; do { m_trackerContext.startCycle(); @@ -206,7 +240,7 @@ namespace Catch { redirectedCerr += oneRunCerr; const auto singleRunTotals = m_totals.delta(beforeRunTotals); - auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, redirectedCout, oneRunCerr, aborting()); + auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, oneRunCout, oneRunCerr, aborting()); m_reporter->testCasePartialEnded(statsForOneRun, testRuns); ++testRuns; @@ -421,8 +455,6 @@ namespace Catch { 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) { @@ -468,6 +500,11 @@ namespace Catch { // before running the tests themselves, or the binary can crash // without failed test being reported. FatalConditionHandlerGuard _(&m_fatalConditionhandler); + // We keep having issue where some compilers warn about an unused + // variable, even though the type has non-trivial constructor and + // destructor. This is annoying and ugly, but it makes them stfu. + (void)_; + m_activeTestCase->invoke(); } @@ -597,10 +634,7 @@ namespace Catch { } void seedRng(IConfig const& config) { - if (config.rngSeed() != 0) { - std::srand(config.rngSeed()); - rng().seed(config.rngSeed()); - } + sharedRng().seed(config.rngSeed()); } unsigned int rngSeed() { diff --git a/packages/Catch2/src/catch2/internal/catch_run_context.hpp b/packages/Catch2/src/catch2/internal/catch_run_context.hpp index 7c315e9ac..cf8941766 100644 --- a/packages/Catch2/src/catch2/internal/catch_run_context.hpp +++ b/packages/Catch2/src/catch2/internal/catch_run_context.hpp @@ -17,16 +17,16 @@ #include <catch2/internal/catch_test_case_tracker.hpp> #include <catch2/catch_assertion_info.hpp> #include <catch2/catch_assertion_result.hpp> -#include <catch2/internal/catch_option.hpp> +#include <catch2/internal/catch_optional.hpp> #include <catch2/internal/catch_move_and_forward.hpp> #include <string> namespace Catch { - struct IMutableContext; - struct IGeneratorTracker; - struct IConfig; + class IMutableContext; + class IGeneratorTracker; + class IConfig; /////////////////////////////////////////////////////////////////////////// @@ -36,7 +36,7 @@ namespace Catch { RunContext( RunContext const& ) = delete; RunContext& operator =( RunContext const& ) = delete; - explicit RunContext( IConfig const* _config, IStreamingReporterPtr&& reporter ); + explicit RunContext( IConfig const* _config, IEventListenerPtr&& reporter ); ~RunContext() override; @@ -126,11 +126,11 @@ namespace Catch { IMutableContext& m_context; TestCaseHandle const* m_activeTestCase = nullptr; ITracker* m_testCaseTracker = nullptr; - Option<AssertionResult> m_lastResult; + Optional<AssertionResult> m_lastResult; IConfig const* m_config; Totals m_totals; - IStreamingReporterPtr m_reporter; + IEventListenerPtr m_reporter; std::vector<MessageInfo> m_messages; std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */ AssertionInfo m_lastAssertionInfo; diff --git a/packages/Catch2/src/catch2/internal/catch_sharding.hpp b/packages/Catch2/src/catch2/internal/catch_sharding.hpp new file mode 100644 index 000000000..17a206f85 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_sharding.hpp @@ -0,0 +1,41 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_SHARDING_HPP_INCLUDED +#define CATCH_SHARDING_HPP_INCLUDED + +#include <catch2/catch_session.hpp> + +#include <cmath> + +namespace Catch { + + template<typename Container> + Container createShard(Container const& container, std::size_t const shardCount, std::size_t const shardIndex) { + assert(shardCount > shardIndex); + + if (shardCount == 1) { + return container; + } + + const std::size_t totalTestCount = container.size(); + + const std::size_t shardSize = totalTestCount / shardCount; + const std::size_t leftoverTests = totalTestCount % shardCount; + + const std::size_t startIndex = shardIndex * shardSize + (std::min)(shardIndex, leftoverTests); + const std::size_t endIndex = (shardIndex + 1) * shardSize + (std::min)(shardIndex + 1, leftoverTests); + + auto startIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(startIndex)); + auto endIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(endIndex)); + + return Container(startIterator, endIterator); + } + +} + +#endif // CATCH_SHARDING_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp b/packages/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp new file mode 100644 index 000000000..7681f442a --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_startup_exception_registry.cpp @@ -0,0 +1,29 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_startup_exception_registry.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/catch_user_config.hpp> + +namespace Catch { +#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) + 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; + } +#endif + +} // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_stdstreams.cpp b/packages/Catch2/src/catch2/internal/catch_stdstreams.cpp new file mode 100644 index 000000000..21a0e4e61 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_stdstreams.cpp @@ -0,0 +1,24 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_stdstreams.hpp> + +#include <catch2/catch_user_config.hpp> + +#include <iostream> + +namespace Catch { + +// If you #define this you must implement these functions +#if !defined( CATCH_CONFIG_NOSTDOUT ) + std::ostream& cout() { return std::cout; } + std::ostream& cerr() { return std::cerr; } + std::ostream& clog() { return std::clog; } +#endif + +} // namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_stdstreams.hpp b/packages/Catch2/src/catch2/internal/catch_stdstreams.hpp new file mode 100644 index 000000000..39d8bd750 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_stdstreams.hpp @@ -0,0 +1,22 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#ifndef CATCH_STDSTREAMS_HPP_INCLUDED +#define CATCH_STDSTREAMS_HPP_INCLUDED + +#include <iosfwd> + +namespace Catch { + + std::ostream& cout(); + std::ostream& cerr(); + std::ostream& clog(); + +} // namespace Catch + +#endif diff --git a/packages/Catch2/src/catch2/internal/catch_string_manip.cpp b/packages/Catch2/src/catch2/internal/catch_string_manip.cpp index 0444cd38e..e61bfd434 100644 --- a/packages/Catch2/src/catch2/internal/catch_string_manip.cpp +++ b/packages/Catch2/src/catch2/internal/catch_string_manip.cpp @@ -16,16 +16,10 @@ namespace Catch { - namespace { - char toLowerCh(char c) { - return static_cast<char>( std::tolower( static_cast<unsigned char>(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 ) { + bool startsWith( StringRef s, char prefix ) { return !s.empty() && s[0] == prefix; } bool endsWith( std::string const& s, std::string const& suffix ) { @@ -38,13 +32,19 @@ namespace Catch { return s.find( infix ) != std::string::npos; } void toLowerInPlace( std::string& s ) { - std::transform( s.begin(), s.end(), s.begin(), toLowerCh ); + std::transform( s.begin(), s.end(), s.begin(), []( char c ) { + return toLower( c ); + } ); } std::string toLower( std::string const& s ) { std::string lc = s; toLowerInPlace( lc ); return lc; } + char toLower(char c) { + return static_cast<char>(std::tolower(static_cast<unsigned char>(c))); + } + 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 ); diff --git a/packages/Catch2/src/catch2/internal/catch_string_manip.hpp b/packages/Catch2/src/catch2/internal/catch_string_manip.hpp index bd7d0ddf4..dc58a3360 100644 --- a/packages/Catch2/src/catch2/internal/catch_string_manip.hpp +++ b/packages/Catch2/src/catch2/internal/catch_string_manip.hpp @@ -17,12 +17,13 @@ namespace Catch { bool startsWith( std::string const& s, std::string const& prefix ); - bool startsWith( std::string const& s, char prefix ); + bool startsWith( StringRef 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 ); + char toLower( char c ); //! 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! @@ -42,16 +43,17 @@ namespace Catch { * * **Important:** The provided string must outlive the instance */ - struct pluralise { - pluralise(std::size_t count, StringRef label): + class pluralise { + std::uint64_t m_count; + StringRef m_label; + + public: + constexpr pluralise(std::uint64_t count, StringRef label): m_count(count), m_label(label) {} friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ); - - std::size_t m_count; - StringRef m_label; }; } diff --git a/packages/Catch2/src/catch2/internal/catch_stringref.cpp b/packages/Catch2/src/catch2/internal/catch_stringref.cpp index 36a6d2466..46bbfafdb 100644 --- a/packages/Catch2/src/catch2/internal/catch_stringref.cpp +++ b/packages/Catch2/src/catch2/internal/catch_stringref.cpp @@ -14,23 +14,44 @@ namespace Catch { StringRef::StringRef( char const* rawChars ) noexcept - : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) ) + : StringRef( rawChars, std::strlen(rawChars) ) {} - auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool { + auto StringRef::operator == ( StringRef other ) const noexcept -> bool { return m_size == other.m_size && (std::memcmp( m_start, other.m_start, m_size ) == 0); } - bool StringRef::operator<(StringRef const& rhs) const noexcept { + bool StringRef::operator<(StringRef rhs) const noexcept { if (m_size < rhs.m_size) { return strncmp(m_start, rhs.m_start, m_size) <= 0; } return strncmp(m_start, rhs.m_start, rhs.m_size) < 0; } - auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& { - return os.write(str.data(), str.size()); + int StringRef::compare( StringRef rhs ) const { + auto cmpResult = + strncmp( m_start, rhs.m_start, std::min( m_size, rhs.m_size ) ); + + // This means that strncmp found a difference before the strings + // ended, and we can return it directly + if ( cmpResult != 0 ) { + return cmpResult; + } + + // If strings are equal up to length, then their comparison results on + // their size + if ( m_size < rhs.m_size ) { + return -1; + } else if ( m_size > rhs.m_size ) { + return 1; + } else { + return 0; + } + } + + auto operator << ( std::ostream& os, StringRef str ) -> std::ostream& { + return os.write(str.data(), static_cast<std::streamsize>(str.size())); } std::string operator+(StringRef lhs, StringRef rhs) { @@ -41,7 +62,7 @@ namespace Catch { return ret; } - auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& { + auto operator+=( std::string& lhs, StringRef rhs ) -> std::string& { lhs.append(rhs.data(), rhs.size()); return lhs; } diff --git a/packages/Catch2/src/catch2/internal/catch_stringref.hpp b/packages/Catch2/src/catch2/internal/catch_stringref.hpp index 17f5d07da..e7f1ab70c 100644 --- a/packages/Catch2/src/catch2/internal/catch_stringref.hpp +++ b/packages/Catch2/src/catch2/internal/catch_stringref.hpp @@ -49,8 +49,8 @@ namespace Catch { } public: // operators - auto operator == ( StringRef const& other ) const noexcept -> bool; - auto operator != (StringRef const& other) const noexcept -> bool { + auto operator == ( StringRef other ) const noexcept -> bool; + auto operator != (StringRef other) const noexcept -> bool { return !(*this == other); } @@ -59,7 +59,7 @@ namespace Catch { return m_start[index]; } - bool operator<(StringRef const& rhs) const noexcept; + bool operator<(StringRef rhs) const noexcept; public: // named queries constexpr auto empty() const noexcept -> bool { @@ -69,7 +69,6 @@ namespace Catch { return m_size; } - public: // substrings and searches // Returns a substring of [start, start + length). // If start + length > size(), then the substring is [start, start + size()). // If start > size(), then the substring is empty. @@ -87,14 +86,21 @@ namespace Catch { return m_start; } - public: // iterators constexpr const_iterator begin() const { return m_start; } constexpr const_iterator end() const { return m_start + m_size; } - friend std::string& operator += (std::string& lhs, StringRef const& sr); - friend std::ostream& operator << (std::ostream& os, StringRef const& sr); + friend std::string& operator += (std::string& lhs, StringRef sr); + friend std::ostream& operator << (std::ostream& os, StringRef sr); friend std::string operator+(StringRef lhs, StringRef rhs); + + /** + * Provides a three-way comparison with rhs + * + * Returns negative number if lhs < rhs, 0 if lhs == rhs, and a positive + * number if lhs > rhs + */ + int compare( StringRef rhs ) const; }; diff --git a/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.hpp b/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.hpp index 9dd86c13a..3dbe05281 100644 --- a/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.hpp @@ -15,6 +15,7 @@ #include <string> namespace Catch { + struct SourceLineInfo; class TagAliasRegistry : public ITagAliasRegistry { public: diff --git a/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp b/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp index 1099f9db8..bfac3bc81 100644 --- a/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp @@ -83,9 +83,9 @@ template<typename...Types> \ struct TestName{\ TestName(){\ - int index = 0; \ + size_t index = 0; \ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ - using expander = int[];\ + using expander = size_t[];\ (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ }\ };\ @@ -128,12 +128,12 @@ template<typename... Types> \ struct TestName { \ void reg_tests() { \ - int index = 0; \ - using expander = int[]; \ + size_t index = 0; \ + using expander = size_t[]; \ 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++)... };/* NOLINT */\ + (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++)... };/* NOLINT */\ } \ }; \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ @@ -176,8 +176,8 @@ template<typename... Types> \ struct TestName { \ void reg_tests() { \ - int index = 0; \ - using expander = int[]; \ + size_t index = 0; \ + using expander = size_t[]; \ (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++)... };/* NOLINT */\ } \ };\ @@ -211,9 +211,9 @@ template<typename...Types> \ struct TestNameClass{\ TestNameClass(){\ - int index = 0; \ + size_t index = 0; \ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ - using expander = int[];\ + using expander = size_t[];\ (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ }\ };\ @@ -259,12 +259,12 @@ template<typename...Types>\ struct TestNameClass{\ void reg_tests(){\ - int index = 0;\ - using expander = int[];\ + std::size_t index = 0;\ + using expander = std::size_t[];\ 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++)... };/* NOLINT */ \ + (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++)... };/* NOLINT */ \ }\ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ @@ -310,8 +310,8 @@ template<typename...Types>\ struct TestNameClass{\ void reg_tests(){\ - int index = 0;\ - using expander = int[];\ + size_t index = 0;\ + using expander = size_t[];\ (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++)... };/* NOLINT */ \ }\ };\ diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp b/packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp new file mode 100644 index 000000000..692d066c4 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.cpp @@ -0,0 +1,39 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_case_info.hpp> +#include <catch2/internal/catch_test_case_info_hasher.hpp> + +namespace Catch { + TestCaseInfoHasher::TestCaseInfoHasher( hash_t seed ): m_seed( seed ) {} + + uint32_t TestCaseInfoHasher::operator()( TestCaseInfo const& t ) const { + // FNV-1a hash algorithm that is designed for uniqueness: + const hash_t prime = 1099511628211u; + hash_t hash = 14695981039346656037u; + for ( const char c : t.name ) { + hash ^= c; + hash *= prime; + } + for ( const char c : t.className ) { + hash ^= c; + hash *= prime; + } + for ( const Tag& tag : t.tags ) { + for ( const char c : tag.original ) { + hash ^= c; + hash *= prime; + } + } + hash ^= m_seed; + hash *= prime; + const uint32_t low{ static_cast<uint32_t>( hash ) }; + const uint32_t high{ static_cast<uint32_t>( hash >> 32 ) }; + return low * high; + } +} // namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.hpp b/packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.hpp new file mode 100644 index 000000000..afe233553 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_test_case_info_hasher.hpp @@ -0,0 +1,29 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED +#define CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED + +#include <cstdint> + +namespace Catch { + + struct TestCaseInfo; + + class TestCaseInfoHasher { + public: + using hash_t = std::uint64_t; + TestCaseInfoHasher( hash_t seed ); + uint32_t operator()( TestCaseInfo const& t ) const; + + private: + hash_t m_seed; + }; + +} // namespace Catch + +#endif /* CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED */ diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp index dd1744a70..6c491a959 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp @@ -12,41 +12,17 @@ #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> #include <catch2/internal/catch_random_number_generator.hpp> #include <catch2/internal/catch_run_context.hpp> +#include <catch2/internal/catch_sharding.hpp> #include <catch2/catch_test_case_info.hpp> #include <catch2/catch_test_spec.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_test_case_info_hasher.hpp> #include <algorithm> #include <set> namespace Catch { -namespace { - struct TestHasher { - using hash_t = uint64_t; - - explicit TestHasher( hash_t hashSuffix ): - m_hashSuffix( hashSuffix ) {} - - uint64_t m_hashSuffix; - - uint32_t operator()( TestCaseInfo const& t ) const { - // FNV-1a hash with multiplication fold. - const hash_t prime = 1099511628211u; - hash_t hash = 14695981039346656037u; - for (const char c : t.name) { - hash ^= c; - hash *= prime; - } - hash ^= m_hashSuffix; - hash *= prime; - const uint32_t low{ static_cast<uint32_t>(hash) }; - const uint32_t high{ static_cast<uint32_t>(hash >> 32) }; - return low * high; - } - }; -} // end anonymous namespace - std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases ) { switch (config.runOrder()) { case TestRunOrder::Declared: @@ -65,9 +41,9 @@ namespace { } case TestRunOrder::Randomized: { seedRng(config); - using TestWithHash = std::pair<TestHasher::hash_t, TestCaseHandle>; + using TestWithHash = std::pair<TestCaseInfoHasher::hash_t, TestCaseHandle>; - TestHasher h{ config.rngSeed() }; + TestCaseInfoHasher h{ config.rngSeed() }; std::vector<TestWithHash> indexed_tests; indexed_tests.reserve(unsortedTestCases.size()); @@ -135,7 +111,7 @@ namespace { filtered.push_back(testCase); } } - return filtered; + return createShard(filtered, config.shardCount(), config.shardIndex()); } std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config ) { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp index 60a8f9bdc..b0064cbbd 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp @@ -16,7 +16,7 @@ namespace Catch { class TestCaseHandle; - struct IConfig; + class IConfig; class TestSpec; std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases ); diff --git a/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp b/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp index 357e114dd..95384bc15 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp @@ -8,14 +8,15 @@ #ifndef CATCH_TEST_MACRO_IMPL_HPP_INCLUDED #define CATCH_TEST_MACRO_IMPL_HPP_INCLUDED +#include <catch2/catch_user_config.hpp> #include <catch2/internal/catch_assertion_handler.hpp> #include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_source_line_info.hpp> -// We need this suppression to leak, because it took until GCC 9 +// We need this suppression to leak, because it took until GCC 10 // for the front end to handle local suppression via _Pragma properly -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ < 9 +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ <= 9 #pragma GCC diagnostic ignored "-Wparentheses" #endif @@ -46,7 +47,7 @@ /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \ - do { \ + do { /* NOLINT(bugprone-infinite-loop) */ \ /* 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 ); \ @@ -57,7 +58,8 @@ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ INTERNAL_CATCH_REACT( catchAssertionHandler ) \ - } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) + } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look + // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&. /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \ diff --git a/packages/Catch2/src/catch2/internal/catch_test_registry.cpp b/packages/Catch2/src/catch2/internal/catch_test_registry.cpp index d33ba27ab..faadb101b 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_registry.cpp @@ -13,21 +13,38 @@ #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <algorithm> +#include <iterator> + namespace Catch { namespace { - std::string extractClassName( StringRef 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 ); + StringRef extractClassName( StringRef classOrMethodName ) { + if ( !startsWith( classOrMethodName, '&' ) ) { + return classOrMethodName; } - return className; + + // Remove the leading '&' to avoid having to special case it later + const auto methodName = + classOrMethodName.substr( 1, classOrMethodName.size() ); + + auto reverseStart = std::make_reverse_iterator( methodName.end() ); + auto reverseEnd = std::make_reverse_iterator( methodName.begin() ); + + // We make a simplifying assumption that ":" is only present + // in the input as part of "::" from C++ typenames (this is + // relatively safe assumption because the input is generated + // as stringification of type through preprocessor). + auto lastColons = std::find( reverseStart, reverseEnd, ':' ) + 1; + auto secondLastColons = + std::find( lastColons + 1, reverseEnd, ':' ); + + auto const startIdx = reverseEnd - secondLastColons; + auto const classNameSize = secondLastColons - lastColons - 1; + + return methodName.substr( + static_cast<std::size_t>( startIdx ), + static_cast<std::size_t>( classNameSize ) ); } } // namespace diff --git a/packages/Catch2/src/catch2/internal/catch_test_registry.hpp b/packages/Catch2/src/catch2/internal/catch_test_registry.hpp index 9a03e6dbf..6e064e083 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_registry.hpp @@ -14,6 +14,7 @@ #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_unique_ptr.hpp> #include <catch2/internal/catch_unique_name.hpp> +#include <catch2/internal/catch_preprocessor_remove_parens.hpp> // GCC 5 and older do not properly handle disabling unused-variable warning // with a _Pragma. This means that we have to leak the suppression to the @@ -76,6 +77,7 @@ struct AutoReg : Detail::NonCopyable { static void TestName(); \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_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() @@ -86,6 +88,7 @@ struct AutoReg : Detail::NonCopyable { #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_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 @@ -93,6 +96,7 @@ struct AutoReg : Detail::NonCopyable { #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ namespace{ \ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \ void test(); \ @@ -109,6 +113,7 @@ struct AutoReg : Detail::NonCopyable { do { \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_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 \ } while(false) diff --git a/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp b/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp index 86b25bfa6..4dd1ea2a1 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp @@ -28,7 +28,7 @@ namespace Catch { 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); + m_testSpec.m_invalidSpecs.push_back(arg); break; } endMode(); diff --git a/packages/Catch2/src/catch2/internal/catch_test_spec_parser.hpp b/packages/Catch2/src/catch2/internal/catch_test_spec_parser.hpp index 22b288ebb..75f2fd760 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_spec_parser.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_spec_parser.hpp @@ -20,7 +20,7 @@ namespace Catch { - struct ITagAliasRegistry; + class ITagAliasRegistry; class TestSpecParser { enum Mode{ None, Name, QuotedName, Tag, EscapedName }; diff --git a/packages/Catch2/src/catch2/internal/catch_textflow.cpp b/packages/Catch2/src/catch2/internal/catch_textflow.cpp index 01fd2df59..993e16229 100644 --- a/packages/Catch2/src/catch2/internal/catch_textflow.cpp +++ b/packages/Catch2/src/catch2/internal/catch_textflow.cpp @@ -6,6 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_textflow.hpp> + +#include <algorithm> #include <cstring> #include <ostream> @@ -39,96 +41,107 @@ namespace { namespace Catch { namespace TextFlow { - void Column::iterator::calcLength() { - m_suffix = false; - auto width = m_column.m_width - indent(); - m_end = m_pos; + void Column::const_iterator::calcLength() { + m_addHyphen = false; + m_parsedTo = m_lineStart; + std::string const& current_line = m_column.m_string; - if ( current_line[m_pos] == '\n' ) { - ++m_end; + if ( current_line[m_lineStart] == '\n' ) { + ++m_parsedTo; } - while ( m_end < current_line.size() && - current_line[m_end] != '\n' ) { - ++m_end; + + const auto maxLineLength = m_column.m_width - indentSize(); + const auto maxParseTo = std::min(current_line.size(), m_lineStart + maxLineLength); + while ( m_parsedTo < maxParseTo && + current_line[m_parsedTo] != '\n' ) { + ++m_parsedTo; } - if ( m_end < m_pos + width ) { - m_len = m_end - m_pos; + // If we encountered a newline before the column is filled, + // then we linebreak at the newline and consider this line + // finished. + if ( m_parsedTo < m_lineStart + maxLineLength ) { + m_lineLength = m_parsedTo - m_lineStart; } else { - size_t len = width; - while ( len > 0 && !isBoundary( current_line, m_pos + len ) ) { - --len; + // Look for a natural linebreak boundary in the column + // (We look from the end, so that the first found boundary is + // the right one) + size_t newLineLength = maxLineLength; + while ( newLineLength > 0 && !isBoundary( current_line, m_lineStart + newLineLength ) ) { + --newLineLength; } - while ( len > 0 && - isWhitespace( current_line[m_pos + len - 1] ) ) { - --len; + while ( newLineLength > 0 && + isWhitespace( current_line[m_lineStart + newLineLength - 1] ) ) { + --newLineLength; } - if ( len > 0 ) { - m_len = len; + // If we found one, then that is where we linebreak + if ( newLineLength > 0 ) { + m_lineLength = newLineLength; } else { - m_suffix = true; - m_len = width - 1; + // Otherwise we have to split text with a hyphen + m_addHyphen = true; + m_lineLength = maxLineLength - 1; } } } - size_t Column::iterator::indent() const { + size_t Column::const_iterator::indentSize() const { auto initial = - m_pos == 0 ? m_column.m_initialIndent : std::string::npos; + m_lineStart == 0 ? m_column.m_initialIndent : std::string::npos; return initial == std::string::npos ? m_column.m_indent : initial; } std::string - Column::iterator::addIndentAndSuffix( size_t position, + Column::const_iterator::addIndentAndSuffix( size_t position, size_t length ) const { std::string ret; - const auto desired_indent = indent(); - ret.reserve( desired_indent + length + m_suffix ); + const auto desired_indent = indentSize(); + ret.reserve( desired_indent + length + m_addHyphen ); ret.append( desired_indent, ' ' ); ret.append( m_column.m_string, position, length ); - if ( m_suffix ) { + if ( m_addHyphen ) { ret.push_back( '-' ); } return ret; } - Column::iterator::iterator( Column const& column ): m_column( column ) { + Column::const_iterator::const_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_pos = m_column.m_string.size(); + if ( m_lineLength == 0 ) { + m_lineStart = m_column.m_string.size(); } } - std::string Column::iterator::operator*() const { - assert( m_pos <= m_end ); - return addIndentAndSuffix( m_pos, m_len ); + std::string Column::const_iterator::operator*() const { + assert( m_lineStart <= m_parsedTo ); + return addIndentAndSuffix( m_lineStart, m_lineLength ); } - Column::iterator& Column::iterator::operator++() { - m_pos += m_len; + Column::const_iterator& Column::const_iterator::operator++() { + m_lineStart += m_lineLength; std::string const& current_line = m_column.m_string; - if ( m_pos < current_line.size() && current_line[m_pos] == '\n' ) { - m_pos += 1; + if ( m_lineStart < current_line.size() && current_line[m_lineStart] == '\n' ) { + m_lineStart += 1; } else { - while ( m_pos < current_line.size() && - isWhitespace( current_line[m_pos] ) ) { - ++m_pos; + while ( m_lineStart < current_line.size() && + isWhitespace( current_line[m_lineStart] ) ) { + ++m_lineStart; } } - if ( m_pos != current_line.size() ) { + if ( m_lineStart != current_line.size() ) { calcLength(); } return *this; } - Column::iterator Column::iterator::operator++( int ) { - iterator prev( *this ); + Column::const_iterator Column::const_iterator::operator++( int ) { + const_iterator prev( *this ); operator++(); return prev; } diff --git a/packages/Catch2/src/catch2/internal/catch_textflow.hpp b/packages/Catch2/src/catch2/internal/catch_textflow.hpp index 074146c87..e2cdff58b 100644 --- a/packages/Catch2/src/catch2/internal/catch_textflow.hpp +++ b/packages/Catch2/src/catch2/internal/catch_textflow.hpp @@ -18,31 +18,49 @@ namespace Catch { class Columns; + /** + * Represents a column of text with specific width and indentation + * + * When written out to a stream, it will perform linebreaking + * of the provided text so that the written lines fit within + * target width. + */ class Column { + // String to be written out std::string m_string; + // Width of the column for linebreaking size_t m_width = CATCH_CONFIG_CONSOLE_WIDTH - 1; + // Indentation of other lines (including first if initial indent is unset) size_t m_indent = 0; + // Indentation of the first line size_t m_initialIndent = std::string::npos; public: - class iterator { + /** + * Iterates "lines" in `Column` and return sthem + */ + class const_iterator { friend Column; struct EndTag {}; Column const& m_column; - size_t m_pos = 0; - - size_t m_len = 0; - size_t m_end = 0; - bool m_suffix = false; - - iterator( Column const& column, EndTag ): - m_column( column ), m_pos( m_column.m_string.size() ) {} - + // Where does the current line start? + size_t m_lineStart = 0; + // How long should the current line be? + size_t m_lineLength = 0; + // How far have we checked the string to iterate? + size_t m_parsedTo = 0; + // Should a '-' be appended to the line? + bool m_addHyphen = false; + + const_iterator( Column const& column, EndTag ): + m_column( column ), m_lineStart( m_column.m_string.size() ) {} + + // Calculates the length of the current line void calcLength(); // Returns current indention width - size_t indent() const; + size_t indentSize() const; // Creates an indented and (optionally) suffixed string from // current iterator position, indentation and length. @@ -56,21 +74,21 @@ namespace Catch { using reference = value_type&; using iterator_category = std::forward_iterator_tag; - explicit iterator( Column const& column ); + explicit const_iterator( Column const& column ); std::string operator*() const; - iterator& operator++(); - iterator operator++( int ); + const_iterator& operator++(); + const_iterator operator++( int ); - bool operator==( iterator const& other ) const { - return m_pos == other.m_pos && &m_column == &other.m_column; + bool operator==( const_iterator const& other ) const { + return m_lineStart == other.m_lineStart && &m_column == &other.m_column; } - bool operator!=( iterator const& other ) const { + bool operator!=( const_iterator const& other ) const { return !operator==( other ); } }; - using const_iterator = iterator; + using iterator = const_iterator; explicit Column( std::string const& text ): m_string( text ) {} @@ -89,8 +107,8 @@ namespace Catch { } size_t width() const { return m_width; } - iterator begin() const { return iterator( *this ); } - iterator end() const { return { *this, iterator::EndTag{} }; } + const_iterator begin() const { return const_iterator( *this ); } + const_iterator end() const { return { *this, const_iterator::EndTag{} }; } friend std::ostream& operator<<( std::ostream& os, Column const& col ); @@ -110,7 +128,7 @@ namespace Catch { struct EndTag {}; std::vector<Column> const& m_columns; - std::vector<Column::iterator> m_iterators; + std::vector<Column::const_iterator> m_iterators; size_t m_activeIterators; iterator( Columns const& columns, EndTag ); diff --git a/packages/Catch2/src/catch2/internal/catch_to_string.hpp b/packages/Catch2/src/catch2/internal/catch_to_string.hpp index d8ff35cfc..15b24e195 100644 --- a/packages/Catch2/src/catch2/internal/catch_to_string.hpp +++ b/packages/Catch2/src/catch2/internal/catch_to_string.hpp @@ -11,7 +11,7 @@ #include <string> #include <catch2/internal/catch_compiler_capabilities.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> namespace Catch { template <typename T> diff --git a/packages/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp b/packages/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp new file mode 100644 index 000000000..c6251a3f7 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_uncaught_exceptions.cpp @@ -0,0 +1,26 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_uncaught_exceptions.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/internal/catch_config_uncaught_exceptions.hpp> +#include <catch2/catch_user_config.hpp> + +#include <exception> + +namespace Catch { + bool uncaught_exceptions() { +#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) + return false; +#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) + return std::uncaught_exceptions() > 0; +#else + return std::uncaught_exception(); +#endif + } +} // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp b/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp index d3bc8417d..c453cde62 100644 --- a/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp +++ b/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp @@ -11,11 +11,15 @@ #include <cassert> #include <type_traits> +#include <catch2/internal/catch_move_and_forward.hpp> + namespace Catch { namespace Detail { - // reimplementation of unique_ptr for improved compilation times - // Does not support custom deleters (and thus does not require EBO) - // Does not support arrays + /** + * A reimplementation of `std::unique_ptr` for improved compilation performance + * + * Does not support arrays nor custom deleters. + */ template <typename T> class unique_ptr { T* m_ptr; @@ -98,20 +102,13 @@ namespace Detail { } }; - // Purposefully doesn't exist - // We could also rely on compiler warning + werror for calling plain delete - // on a T[], but this seems better. - // Maybe add definition and a static assert? + //! Specialization to cause compile-time error for arrays template <typename T> class unique_ptr<T[]>; template <typename T, typename... Args> unique_ptr<T> make_unique(Args&&... args) { - // static_cast<Args&&> does the same thing as std::forward in - // this case, but does not require including big header (<utility>) - // and compiles faster thanks to not requiring template instantiation - // and overload resolution - return unique_ptr<T>(new T(static_cast<Args&&>(args)...)); + return unique_ptr<T>(new T(CATCH_FORWARD(args)...)); } diff --git a/packages/Catch2/src/catch2/internal/catch_void_type.hpp b/packages/Catch2/src/catch2/internal/catch_void_type.hpp new file mode 100644 index 000000000..23875c352 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_void_type.hpp @@ -0,0 +1,25 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_VOID_TYPE_HPP_INCLUDED +#define CATCH_VOID_TYPE_HPP_INCLUDED + + +namespace Catch { + namespace Detail { + + template <typename...> + struct make_void { using type = void; }; + + template <typename... Ts> + using void_t = typename make_void<Ts...>::type; + + } // namespace Detail +} // namespace Catch + + +#endif // CATCH_VOID_TYPE_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_windows_h_proxy.hpp b/packages/Catch2/src/catch2/internal/catch_windows_h_proxy.hpp index a4c11fa62..14fe747d1 100644 --- a/packages/Catch2/src/catch2/internal/catch_windows_h_proxy.hpp +++ b/packages/Catch2/src/catch2/internal/catch_windows_h_proxy.hpp @@ -12,12 +12,12 @@ #if defined(CATCH_PLATFORM_WINDOWS) -#if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX) -# define CATCH_DEFINED_NOMINMAX +// We might end up with the define made globally through the compiler, +// and we don't want to trigger warnings for this +#if !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 +#if !defined(WIN32_LEAN_AND_MEAN) # define WIN32_LEAN_AND_MEAN #endif @@ -27,13 +27,6 @@ #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 // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp b/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp index b8635f7f2..93758cba7 100644 --- a/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp +++ b/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp @@ -87,7 +87,7 @@ namespace { // (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]; + unsigned char c = static_cast<unsigned char>(m_str[idx]); switch (c) { case '<': os << "<"; break; case '&': os << "&"; break; @@ -147,7 +147,7 @@ namespace { bool valid = true; uint32_t value = headerValue(c); for (std::size_t n = 1; n < encBytes; ++n) { - unsigned char nc = m_str[idx + n]; + unsigned char nc = static_cast<unsigned char>(m_str[idx + n]); valid &= ((nc & 0xC0) == 0x80); value = (value << 6) | (nc & 0x3F); } @@ -268,7 +268,7 @@ namespace { if (shouldIndent(fmt)) { m_os << m_indent; } - m_os << "</" << m_tags.back() << ">"; + m_os << "</" << m_tags.back() << '>'; } m_os << std::flush; applyFormatting(fmt); @@ -295,13 +295,14 @@ namespace { } XmlWriter& XmlWriter::writeText( StringRef text, XmlFormatting fmt ) { + CATCH_ENFORCE(!m_tags.empty(), "Cannot write text as top level element"); if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); if (tagWasOpen && shouldIndent(fmt)) { m_os << m_indent; } - m_os << XmlEncode( text ); + m_os << XmlEncode( text, XmlEncode::ForTextNodes ); applyFormatting(fmt); } return *this; @@ -312,7 +313,7 @@ namespace { if (shouldIndent(fmt)) { m_os << m_indent; } - m_os << "<!--" << text << "-->"; + m_os << "<!-- " << text << " -->"; applyFormatting(fmt); return *this; } @@ -321,12 +322,6 @@ namespace { m_os << R"(<?xml-stylesheet type="text/xsl" href=")" << url << R"("?>)" << '\n'; } - XmlWriter& XmlWriter::writeBlankLine() { - ensureTagClosed(); - m_os << '\n'; - return *this; - } - void XmlWriter::ensureTagClosed() { if( m_tagIsOpen ) { m_os << '>' << std::flush; diff --git a/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp b/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp index 3ba8c08ec..556339376 100644 --- a/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp +++ b/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp @@ -8,9 +8,10 @@ #ifndef CATCH_XMLWRITER_HPP_INCLUDED #define CATCH_XMLWRITER_HPP_INCLUDED -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <catch2/internal/catch_stringref.hpp> +#include <iosfwd> #include <vector> namespace Catch { @@ -77,11 +78,11 @@ namespace Catch { } private: - mutable XmlWriter* m_writer = nullptr; + XmlWriter* m_writer = nullptr; XmlFormatting m_fmt; }; - XmlWriter( std::ostream& os = Catch::cout() ); + XmlWriter( std::ostream& os ); ~XmlWriter(); XmlWriter( XmlWriter const& ) = delete; @@ -117,18 +118,18 @@ namespace Catch { return writeAttribute( name, rss.str() ); } + //! Writes escaped `text` in a element XmlWriter& writeText( StringRef text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent ); + //! Writes XML comment as "<!-- text -->" XmlWriter& writeComment( StringRef text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent ); void writeStylesheetRef( StringRef url ); - XmlWriter& writeBlankLine(); - void ensureTagClosed(); private: diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers.cpp new file mode 100644 index 000000000..6b604e4a1 --- /dev/null +++ b/packages/Catch2/src/catch2/matchers/catch_matchers.cpp @@ -0,0 +1,25 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + + +#include <catch2/matchers/catch_matchers.hpp> + +namespace Catch { +namespace Matchers { + + std::string MatcherUntypedBase::toString() const { + if (m_cachedToString.empty()) { + m_cachedToString = describe(); + } + return m_cachedToString; + } + + MatcherUntypedBase::~MatcherUntypedBase() = default; + +} // namespace Matchers +} // namespace Catch diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers.hpp index 86f63bee5..373e2a673 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers.hpp @@ -35,27 +35,20 @@ namespace Matchers { 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; - }; - -#ifdef __clang__ -# pragma clang diagnostic pop -#endif template<typename T> - struct MatcherBase : MatcherUntypedBase, MatcherMethod<T> {}; + class MatcherBase : public MatcherUntypedBase { + public: + virtual bool match( T const& arg ) const = 0; + }; namespace Detail { template<typename ArgT> - struct MatchAllOf final : MatcherBase<ArgT> { + class MatchAllOf final : public MatcherBase<ArgT> { + std::vector<MatcherBase<ArgT> const*> m_matchers; + + public: MatchAllOf() = default; MatchAllOf(MatchAllOf const&) = delete; MatchAllOf& operator=(MatchAllOf const&) = delete; @@ -94,9 +87,6 @@ namespace Matchers { rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs); return CATCH_MOVE(rhs); } - - private: - std::vector<MatcherBase<ArgT> const*> m_matchers; }; //! lvalue overload is intentionally deleted, users should @@ -109,7 +99,9 @@ namespace Matchers { MatchAllOf<ArgT> operator&& (MatcherBase<ArgT> const& lhs, MatchAllOf<ArgT> const& rhs) = delete; template<typename ArgT> - struct MatchAnyOf final : MatcherBase<ArgT> { + class MatchAnyOf final : public MatcherBase<ArgT> { + std::vector<MatcherBase<ArgT> const*> m_matchers; + public: MatchAnyOf() = default; MatchAnyOf(MatchAnyOf const&) = delete; MatchAnyOf& operator=(MatchAnyOf const&) = delete; @@ -147,9 +139,6 @@ namespace Matchers { rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs); return CATCH_MOVE(rhs); } - - private: - std::vector<MatcherBase<ArgT> const*> m_matchers; }; //! lvalue overload is intentionally deleted, users should @@ -162,8 +151,10 @@ namespace Matchers { MatchAnyOf<ArgT> operator|| (MatcherBase<ArgT> const& lhs, MatchAnyOf<ArgT> const& rhs) = delete; template<typename ArgT> - struct MatchNotOf final : MatcherBase<ArgT> { + class MatchNotOf final : public MatcherBase<ArgT> { + MatcherBase<ArgT> const& m_underlyingMatcher; + public: explicit MatchNotOf( MatcherBase<ArgT> const& underlyingMatcher ): m_underlyingMatcher( underlyingMatcher ) {} @@ -175,9 +166,6 @@ namespace Matchers { std::string describe() const override { return "not " + m_underlyingMatcher.toString(); } - - private: - MatcherBase<ArgT> const& m_underlyingMatcher; }; } // namespace Detail diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp new file mode 100644 index 000000000..5344abcd6 --- /dev/null +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.cpp @@ -0,0 +1,34 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/matchers/catch_matchers_container_properties.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> + +namespace Catch { +namespace Matchers { + + std::string IsEmptyMatcher::describe() const { + return "is empty"; + } + + std::string HasSizeMatcher::describe() const { + ReusableStringStream sstr; + sstr << "has size == " << m_target_size; + return sstr.str(); + } + + IsEmptyMatcher IsEmpty() { + return {}; + } + + HasSizeMatcher SizeIs(std::size_t sz) { + return HasSizeMatcher{ sz }; + } + +} // end namespace Matchers +} // end namespace Catch diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp index 082f834f2..f0688a57a 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp @@ -17,7 +17,6 @@ namespace Catch { class IsEmptyMatcher final : public MatcherGenericBase { public: - // todo: Use polyfills template <typename RangeLike> bool match(RangeLike&& rng) const { #if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS) diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_exception.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_exception.cpp new file mode 100644 index 000000000..af3ea15a6 --- /dev/null +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_exception.cpp @@ -0,0 +1,26 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#include <catch2/matchers/catch_matchers_exception.hpp> + +namespace Catch { +namespace Matchers { + +bool ExceptionMessageMatcher::match(std::exception const& ex) const { + return ex.what() == m_message; +} + +std::string ExceptionMessageMatcher::describe() const { + return "exception message matches \"" + m_message + '"'; +} + +ExceptionMessageMatcher Message(std::string const& message) { + return ExceptionMessageMatcher(message); +} + +} // namespace Matchers +} // namespace Catch diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp index ad0fd378c..4d40140fe 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp @@ -150,14 +150,26 @@ namespace Detail { ret << " (["; if (m_type == Detail::FloatingPointKind::Double) { - write(ret, step(m_target, static_cast<double>(-INFINITY), m_ulps)); + write( ret, + step( m_target, + -std::numeric_limits<double>::infinity(), + m_ulps ) ); ret << ", "; - write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps)); + write( ret, + step( m_target, + std::numeric_limits<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)); + write( ret, + step( static_cast<float>( m_target ), + -std::numeric_limits<float>::infinity(), + m_ulps ) ); ret << ", "; - write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps)); + write( ret, + step( static_cast<float>( m_target ), + std::numeric_limits<float>::infinity(), + m_ulps ) ); } ret << "])"; diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.hpp index dc0fa8f71..99572e433 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.hpp @@ -17,7 +17,8 @@ namespace Matchers { enum class FloatingPointKind : uint8_t; } - struct WithinAbsMatcher final : MatcherBase<double> { + class WithinAbsMatcher final : public MatcherBase<double> { + public: WithinAbsMatcher(double target, double margin); bool match(double const& matchee) const override; std::string describe() const override; @@ -26,8 +27,11 @@ namespace Matchers { double m_margin; }; - struct WithinUlpsMatcher final : MatcherBase<double> { - WithinUlpsMatcher(double target, uint64_t ulps, Detail::FloatingPointKind baseType); + class WithinUlpsMatcher final : public MatcherBase<double> { + public: + WithinUlpsMatcher( double target, + uint64_t ulps, + Detail::FloatingPointKind baseType ); bool match(double const& matchee) const override; std::string describe() const override; private: @@ -42,8 +46,9 @@ namespace Matchers { // |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 final : MatcherBase<double> { - WithinRelMatcher(double target, double epsilon); + class WithinRelMatcher final : public MatcherBase<double> { + public: + WithinRelMatcher( double target, double epsilon ); bool match(double const& matchee) const override; std::string describe() const override; private: diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp new file mode 100644 index 000000000..a9ecffc9f --- /dev/null +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_predicate.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/matchers/catch_matchers_predicate.hpp> + +std::string Catch::Matchers::Detail::finalizeDescription(const std::string& desc) { + if (desc.empty()) { + return "matches undescribed predicate"; + } else { + return "matches predicate: \"" + desc + '"'; + } +} diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp new file mode 100644 index 000000000..1f2e48d87 --- /dev/null +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.cpp @@ -0,0 +1,24 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#include <catch2/matchers/catch_matchers_quantifiers.hpp> + +namespace Catch { + namespace Matchers { + std::string AllTrueMatcher::describe() const { return "contains only true"; } + + AllTrueMatcher AllTrue() { return AllTrueMatcher{}; } + + std::string NoneTrueMatcher::describe() const { return "contains no true"; } + + NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; } + + std::string AnyTrueMatcher::describe() const { return "contains at least one true"; } + + AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; } + } // namespace Matchers +} // namespace Catch diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp index e0e1a62d7..8833440f2 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp @@ -85,7 +85,55 @@ namespace Catch { } }; - // Creates a matcher that checks whether a range contains element matching a matcher + // Matcher for checking that all elements in range are true. + class AllTrueMatcher final : public MatcherGenericBase { + public: + std::string describe() const override; + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (!elem) { + return false; + } + } + return true; + } + }; + + // Matcher for checking that no element in range is true. + class NoneTrueMatcher final : public MatcherGenericBase { + public: + std::string describe() const override; + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (elem) { + return false; + } + } + return true; + } + }; + + // Matcher for checking that any element in range is true. + class AnyTrueMatcher final : public MatcherGenericBase { + public: + std::string describe() const override; + + template <typename RangeLike> + bool match(RangeLike&& rng) const { + for (auto&& elem : rng) { + if (elem) { + return true; + } + } + return false; + } + }; + + // Creates a matcher that checks whether all elements in a range match a matcher template <typename Matcher> AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) { return { CATCH_FORWARD(matcher) }; @@ -102,6 +150,15 @@ namespace Catch { AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) { return { CATCH_FORWARD(matcher) }; } + + // Creates a matcher that checks whether all elements in a range are true + AllTrueMatcher AllTrue(); + + // Creates a matcher that checks whether no element in a range is true + NoneTrueMatcher NoneTrue(); + + // Creates a matcher that checks whether any element in a range is true + AnyTrueMatcher AnyTrue(); } } diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp index ee082d2c0..2fc3a5563 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp @@ -31,7 +31,7 @@ namespace Matchers { } - StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator ) + StringMatcherBase::StringMatcherBase( StringRef operation, CasedString const& comparator ) : m_comparator( comparator ), m_operation( operation ) { } @@ -43,33 +43,33 @@ namespace Matchers { description += m_operation; description += ": \""; description += m_comparator.m_str; - description += "\""; + description += '"'; description += m_comparator.caseSensitivitySuffix(); return description; } - StringEqualsMatcher::StringEqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals", comparator ) {} + StringEqualsMatcher::StringEqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals"_sr, comparator ) {} bool StringEqualsMatcher::match( std::string const& source ) const { return m_comparator.adjustString( source ) == m_comparator.m_str; } - StringContainsMatcher::StringContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains", comparator ) {} + StringContainsMatcher::StringContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains"_sr, comparator ) {} bool StringContainsMatcher::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 ) {} + StartsWithMatcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with"_sr, 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 ) {} + EndsWithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with"_sr, comparator ) {} bool EndsWithMatcher::match( std::string const& source ) const { return endsWith( m_comparator.adjustString( source ), m_comparator.m_str ); @@ -96,7 +96,7 @@ namespace Matchers { StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity ) { return StringEqualsMatcher( CasedString( str, caseSensitivity) ); } - StringContainsMatcher Contains( std::string const& str, CaseSensitive caseSensitivity ) { + StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity ) { return StringContainsMatcher( CasedString( str, caseSensitivity) ); } EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity ) { diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp index ed2b1f68c..7f961c45e 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp @@ -26,45 +26,52 @@ namespace Matchers { std::string m_str; }; - struct StringMatcherBase : MatcherBase<std::string> { - StringMatcherBase( std::string const& operation, CasedString const& comparator ); - std::string describe() const override; - + class StringMatcherBase : public MatcherBase<std::string> { + protected: CasedString m_comparator; - std::string m_operation; + StringRef m_operation; + + public: + StringMatcherBase( StringRef operation, + CasedString const& comparator ); + std::string describe() const override; }; - struct StringEqualsMatcher final : StringMatcherBase { + class StringEqualsMatcher final : public StringMatcherBase { + public: StringEqualsMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct StringContainsMatcher final : StringMatcherBase { + class StringContainsMatcher final : public StringMatcherBase { + public: StringContainsMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct StartsWithMatcher final : StringMatcherBase { + class StartsWithMatcher final : public StringMatcherBase { + public: StartsWithMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct EndsWithMatcher final : StringMatcherBase { + class EndsWithMatcher final : public StringMatcherBase { + public: EndsWithMatcher( CasedString const& comparator ); bool match( std::string const& source ) const override; }; - struct RegexMatcher final : MatcherBase<std::string> { + class RegexMatcher final : public MatcherBase<std::string> { + std::string m_regex; + CaseSensitive m_caseSensitivity; + + public: RegexMatcher( std::string regex, CaseSensitive caseSensitivity ); bool match( std::string const& matchee ) const override; std::string describe() const override; - - private: - std::string m_regex; - CaseSensitive m_caseSensitivity; }; //! Creates matcher that accepts strings that are exactly equal to `str` StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that contain `str` - StringContainsMatcher Contains( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); + StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that _end_ with `str` EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that _start_ with `str` diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_templated.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_templated.cpp index 3431bde08..a336d8989 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_templated.cpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_templated.cpp @@ -19,7 +19,7 @@ namespace Matchers { for ( auto desc = descriptions_begin; desc != descriptions_end; ++desc ) { combined_size += desc->size(); } - combined_size += (descriptions_end - descriptions_begin - 1) * combine.size(); + combined_size += static_cast<size_t>(descriptions_end - descriptions_begin - 1) * combine.size(); description.reserve(combined_size); diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp index 200ca74bf..8c7804ce9 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp @@ -19,9 +19,10 @@ namespace Catch { namespace Matchers { - struct MatcherGenericBase : MatcherUntypedBase { + class MatcherGenericBase : public MatcherUntypedBase { + public: MatcherGenericBase() = default; - virtual ~MatcherGenericBase(); // = default; + ~MatcherGenericBase() override; // = default; MatcherGenericBase(MatcherGenericBase&) = default; MatcherGenericBase(MatcherGenericBase&&) = default; @@ -119,7 +120,8 @@ namespace Matchers { template<typename... MatcherTs> - struct MatchAllOfGeneric final : MatcherGenericBase { + class MatchAllOfGeneric final : public MatcherGenericBase { + public: MatchAllOfGeneric(MatchAllOfGeneric const&) = delete; MatchAllOfGeneric& operator=(MatchAllOfGeneric const&) = delete; MatchAllOfGeneric(MatchAllOfGeneric&&) = default; @@ -137,7 +139,11 @@ namespace Matchers { return describe_multi_matcher<MatcherTs...>(" and "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{}); } - std::array<void const*, sizeof...(MatcherTs)> m_matchers; + // Has to be public to enable the concatenating operators + // below, because they are not friend of the RHS, only LHS, + // and thus cannot access private fields of RHS + std::array<void const*, sizeof...( MatcherTs )> m_matchers; + //! Avoids type nesting for `GenericAllOf && GenericAllOf` case template<typename... MatchersRHS> @@ -169,7 +175,8 @@ namespace Matchers { template<typename... MatcherTs> - struct MatchAnyOfGeneric final : MatcherGenericBase { + class MatchAnyOfGeneric final : public MatcherGenericBase { + public: MatchAnyOfGeneric(MatchAnyOfGeneric const&) = delete; MatchAnyOfGeneric& operator=(MatchAnyOfGeneric const&) = delete; MatchAnyOfGeneric(MatchAnyOfGeneric&&) = default; @@ -187,7 +194,11 @@ namespace Matchers { return describe_multi_matcher<MatcherTs...>(" or "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{}); } - std::array<void const*, sizeof...(MatcherTs)> m_matchers; + + // Has to be public to enable the concatenating operators + // below, because they are not friend of the RHS, only LHS, + // and thus cannot access private fields of RHS + std::array<void const*, sizeof...( MatcherTs )> m_matchers; //! Avoids type nesting for `GenericAnyOf || GenericAnyOf` case template<typename... MatchersRHS> @@ -218,7 +229,10 @@ namespace Matchers { template<typename MatcherT> - struct MatchNotOfGeneric final : MatcherGenericBase { + class MatchNotOfGeneric final : public MatcherGenericBase { + MatcherT const& m_matcher; + + public: MatchNotOfGeneric(MatchNotOfGeneric const&) = delete; MatchNotOfGeneric& operator=(MatchNotOfGeneric const&) = delete; MatchNotOfGeneric(MatchNotOfGeneric&&) = default; @@ -239,8 +253,6 @@ namespace Matchers { friend MatcherT const& operator ! (MatchNotOfGeneric<MatcherT> const& matcher) { return matcher.m_matcher; } - private: - MatcherT const& m_matcher; }; } // namespace Detail diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_vector.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_vector.hpp index 00ecbc33d..b9a02f579 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_vector.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_vector.hpp @@ -17,8 +17,10 @@ namespace Catch { namespace Matchers { template<typename T, typename Alloc> - struct VectorContainsElementMatcher final : MatcherBase<std::vector<T, Alloc>> { + class VectorContainsElementMatcher final : public MatcherBase<std::vector<T, Alloc>> { + T const& m_comparator; + public: VectorContainsElementMatcher(T const& comparator): m_comparator(comparator) {} @@ -35,13 +37,13 @@ namespace Matchers { std::string describe() const override { return "Contains: " + ::Catch::Detail::stringify( m_comparator ); } - - T const& m_comparator; }; template<typename T, typename AllocComp, typename AllocMatch> - struct ContainsMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class ContainsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_comparator; + public: ContainsMatcher(std::vector<T, AllocComp> const& comparator): m_comparator( comparator ) {} @@ -67,13 +69,13 @@ namespace Matchers { std::string describe() const override { return "Contains: " + ::Catch::Detail::stringify( m_comparator ); } - - std::vector<T, AllocComp> const& m_comparator; }; template<typename T, typename AllocComp, typename AllocMatch> - struct EqualsMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class EqualsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_comparator; + public: EqualsMatcher(std::vector<T, AllocComp> const& comparator): m_comparator( comparator ) {} @@ -93,12 +95,14 @@ namespace Matchers { std::string describe() const override { return "Equals: " + ::Catch::Detail::stringify( m_comparator ); } - std::vector<T, AllocComp> const& m_comparator; }; template<typename T, typename AllocComp, typename AllocMatch> - struct ApproxMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class ApproxMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_comparator; + mutable Catch::Approx approx = Catch::Approx::custom(); + public: ApproxMatcher(std::vector<T, AllocComp> const& comparator): m_comparator( comparator ) {} @@ -129,13 +133,13 @@ namespace Matchers { approx.scale(static_cast<double>(newScale)); return *this; } - - std::vector<T, AllocComp> const& m_comparator; - mutable Catch::Approx approx = Catch::Approx::custom(); }; template<typename T, typename AllocComp, typename AllocMatch> - struct UnorderedEqualsMatcher final : MatcherBase<std::vector<T, AllocMatch>> { + class UnorderedEqualsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> { + std::vector<T, AllocComp> const& m_target; + + public: UnorderedEqualsMatcher(std::vector<T, AllocComp> const& target): m_target(target) {} @@ -149,15 +153,12 @@ namespace Matchers { std::string describe() const override { return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target); } - private: - std::vector<T, AllocComp> const& m_target; }; // The following functions create the actual matcher objects. // This allows the types to be inferred - //! Creates a matcher that matches vectors that contain all elements in `comparator` template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp> ContainsMatcher<T, AllocComp, AllocMatch> Contains( std::vector<T, AllocComp> const& comparator ) { diff --git a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp deleted file mode 100644 index 4fab1b52f..000000000 --- a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp +++ /dev/null @@ -1,135 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small matcher-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -////////////////////////////////////////////// -// vvv formerly catch_matchers_impl.cpp vvv // -////////////////////////////////////////////// -#include <catch2/matchers/internal/catch_matchers_impl.hpp> -#include <catch2/matchers/catch_matchers.hpp> -#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> -#include <catch2/internal/catch_move_and_forward.hpp> - -namespace Catch { - - // 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 matcherString ) { - std::string exceptionMessage = Catch::translateActiveException(); - MatchExpr<std::string, StringMatcher const&> expr( CATCH_MOVE(exceptionMessage), matcher, matcherString ); - handler.handleExpr( expr ); - } - -} // namespace Catch - - -////////////////////////////////////////////////////////////// -// vvv formerly catch_matchers_container_properties.cpp vvv // -////////////////////////////////////////////////////////////// -#include <catch2/matchers/catch_matchers_container_properties.hpp> -#include <catch2/internal/catch_stream.hpp> - -namespace Catch { -namespace Matchers { - - std::string IsEmptyMatcher::describe() const { - return "is empty"; - } - - std::string HasSizeMatcher::describe() const { - ReusableStringStream sstr; - sstr << "has size == " << m_target_size; - return sstr.str(); - } - - IsEmptyMatcher IsEmpty() { - return {}; - } - - HasSizeMatcher SizeIs(std::size_t sz) { - return HasSizeMatcher{ sz }; - } - -} // end namespace Matchers -} // end namespace Catch - - - -///////////////////////////////////////// -// vvv formerly catch_matchers.cpp vvv // -///////////////////////////////////////// - -#include <catch2/matchers/catch_matchers.hpp> - -namespace Catch { -namespace Matchers { - - std::string MatcherUntypedBase::toString() const { - if (m_cachedToString.empty()) { - m_cachedToString = describe(); - } - return m_cachedToString; - } - - MatcherUntypedBase::~MatcherUntypedBase() = default; - -} // namespace Matchers -} // namespace Catch - - - -/////////////////////////////////////////////////// -// vvv formerly catch_matchers_predicate.cpp vvv // -/////////////////////////////////////////////////// -#include <catch2/matchers/catch_matchers_predicate.hpp> - -std::string Catch::Matchers::Detail::finalizeDescription(const std::string& desc) { - if (desc.empty()) { - return "matches undescribed predicate"; - } else { - return "matches predicate: \"" + desc + '"'; - } -} - - - - - -/////////////////////////////////////////////////// -// vvv formerly catch_matchers_exception.cpp vvv // -/////////////////////////////////////////////////// -#include <catch2/matchers/catch_matchers_exception.hpp> - -namespace Catch { -namespace Matchers { - -bool ExceptionMessageMatcher::match(std::exception const& ex) const { - return ex.what() == m_message; -} - -std::string ExceptionMessageMatcher::describe() const { - return "exception message matches \"" + m_message + "\""; -} - -ExceptionMessageMatcher Message(std::string const& message) { - return ExceptionMessageMatcher(message); -} - -} // namespace Matchers -} // namespace Catch diff --git a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp new file mode 100644 index 000000000..2c2a61179 --- /dev/null +++ b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.cpp @@ -0,0 +1,25 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/matchers/internal/catch_matchers_impl.hpp> +#include <catch2/matchers/catch_matchers.hpp> +#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> + +namespace Catch { + + // 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 matcherString ) { + std::string exceptionMessage = Catch::translateActiveException(); + MatchExpr<std::string, StringMatcher const&> expr( CATCH_MOVE(exceptionMessage), matcher, matcherString ); + handler.handleExpr( expr ); + } + +} // namespace Catch diff --git a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp index 2acbec1f3..5d00ad7d5 100644 --- a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp +++ b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp @@ -36,7 +36,7 @@ namespace Catch { namespace Matchers { template <typename ArgT> - struct MatcherBase; + class MatcherBase; } using StringMatcher = Matchers::MatcherBase<std::string>; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_automake.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_automake.cpp index ec11f605f..90b12928d 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_automake.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_automake.cpp @@ -16,20 +16,20 @@ namespace Catch { void AutomakeReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR. - stream << ":test-result: "; + m_stream << ":test-result: "; if (_testCaseStats.totals.assertions.allPassed()) { - stream << "PASS"; + m_stream << "PASS"; } else if (_testCaseStats.totals.assertions.allOk()) { - stream << "XFAIL"; + m_stream << "XFAIL"; } else { - stream << "FAIL"; + m_stream << "FAIL"; } - stream << ' ' << _testCaseStats.testInfo->name << '\n'; + m_stream << ' ' << _testCaseStats.testInfo->name << '\n'; StreamingReporterBase::testCaseEnded(_testCaseStats); } void AutomakeReporter::skipTest(TestCaseInfo const& testInfo) { - stream << ":test-result: SKIP " << testInfo.name << '\n'; + m_stream << ":test-result: SKIP " << testInfo.name << '\n'; } } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp index 84fad7902..bf18fddf7 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp @@ -8,15 +8,21 @@ #ifndef CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED #define CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED +#include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> + +#include <string> namespace Catch { - struct AutomakeReporter final : StreamingReporterBase { - AutomakeReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ) + class AutomakeReporter final : public StreamingReporterBase { + public: + // GCC5 compat: we cannot use inherited constructor, because it + // doesn't implement backport of P0136 + AutomakeReporter(ReporterConfig&& _config): + StreamingReporterBase(CATCH_MOVE(_config)) {} - ~AutomakeReporter() override; static std::string getDescription() { @@ -26,7 +32,6 @@ namespace Catch { void testCaseEnded(TestCaseStats const& _testCaseStats) override; void skipTest(TestCaseInfo const& testInfo) override; - }; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp new file mode 100644 index 000000000..698435d04 --- /dev/null +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_common_base.cpp @@ -0,0 +1,49 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/reporters/catch_reporter_common_base.hpp> + +#include <catch2/reporters/catch_reporter_helpers.hpp> +#include <catch2/internal/catch_console_colour.hpp> +#include <catch2/internal/catch_istream.hpp> + + +namespace Catch { + ReporterBase::ReporterBase( ReporterConfig&& config ): + IEventListener( config.fullConfig() ), + m_wrapped_stream( CATCH_MOVE(config).takeStream() ), + m_stream( m_wrapped_stream->stream() ), + m_colour( makeColourImpl( config.colourMode(), m_wrapped_stream.get() ) ), + m_customOptions( config.customOptions() ) + {} + + ReporterBase::~ReporterBase() = default; + + void ReporterBase::listReporters( + std::vector<ReporterDescription> const& descriptions ) { + defaultListReporters(m_stream, descriptions, m_config->verbosity()); + } + + void ReporterBase::listListeners( + std::vector<ListenerDescription> const& descriptions ) { + defaultListListeners( m_stream, descriptions ); + } + + void ReporterBase::listTests(std::vector<TestCaseHandle> const& tests) { + defaultListTests(m_stream, + m_colour.get(), + tests, + m_config->hasTestFilters(), + m_config->verbosity()); + } + + void ReporterBase::listTags(std::vector<TagInfo> const& tags) { + defaultListTags( m_stream, tags, m_config->hasTestFilters() ); + } + +} // namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_common_base.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_common_base.hpp new file mode 100644 index 000000000..e6888be16 --- /dev/null +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_common_base.hpp @@ -0,0 +1,79 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED +#define CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED + +#include <catch2/interfaces/catch_interfaces_reporter.hpp> + +#include <map> +#include <string> + +namespace Catch { + class ColourImpl; + + /** + * This is the base class for all reporters. + * + * If are writing a reporter, you must derive from this type, or one + * of the helper reporter bases that are derived from this type. + * + * ReporterBase centralizes handling of various common tasks in reporters, + * like storing the right stream for the reporters to write to, and + * providing the default implementation of the different listing events. + */ + class ReporterBase : public IEventListener { + protected: + //! The stream wrapper as passed to us by outside code + Detail::unique_ptr<IStream> m_wrapped_stream; + //! Cached output stream from `m_wrapped_stream` to reduce + //! number of indirect calls needed to write output. + std::ostream& m_stream; + //! Colour implementation this reporter was configured for + Detail::unique_ptr<ColourImpl> m_colour; + //! The custom reporter options user passed down to the reporter + std::map<std::string, std::string> m_customOptions; + + public: + ReporterBase( ReporterConfig&& config ); + ~ReporterBase() override; // = default; + + /** + * Provides a simple default listing of reporters. + * + * Should look roughly like the reporter listing in v2 and earlier + * versions of Catch2. + */ + void listReporters( + std::vector<ReporterDescription> const& descriptions ) override; + /** + * Provides a simple default listing of listeners + * + * Looks similarly to listing of reporters, but with listener type + * instead of reporter name. + */ + void listListeners( + std::vector<ListenerDescription> const& descriptions ) override; + /** + * Provides a simple default listing of tests. + * + * Should look roughly like the test listing in v2 and earlier versions + * of Catch2. Especially supports low-verbosity listing that mimics the + * old `--list-test-names-only` output. + */ + void listTests( std::vector<TestCaseHandle> const& tests ) override; + /** + * Provides a simple default listing of tags. + * + * Should look roughly like the tag listing in v2 and earlier versions + * of Catch2. + */ + void listTags( std::vector<TagInfo> const& tags ) override; + }; +} // namespace Catch + +#endif // CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp index 1bd997bdc..a09f0483d 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp @@ -7,6 +7,8 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/reporters/catch_reporter_compact.hpp> +#include <catch2/catch_get_random_seed.hpp> +#include <catch2/catch_test_spec.hpp> #include <catch2/reporters/catch_reporter_helpers.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> #include <catch2/internal/catch_platform.hpp> @@ -18,10 +20,7 @@ namespace { - // Colour::LightGrey - constexpr Catch::Colour::Code dimColour() { return Catch::Colour::FileName; } - - constexpr Catch::StringRef bothOrAll( std::size_t count ) { + constexpr Catch::StringRef bothOrAll( std::uint64_t count ) { switch (count) { case 1: return Catch::StringRef{}; @@ -38,6 +37,9 @@ namespace { namespace Catch { namespace { + // Colour::LightGrey + static constexpr Colour::Code compactDimColour = Colour::FileName; + #ifdef CATCH_PLATFORM_MAC static constexpr Catch::StringRef compactFailedString = "FAILED"_sr; static constexpr Catch::StringRef compactPassedString = "PASSED"_sr; @@ -52,11 +54,11 @@ namespace { // - 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) { +void printTotals(std::ostream& out, const Totals& totals, ColourImpl* colourImpl) { if (totals.testCases.total() == 0) { out << "No tests ran."; } else if (totals.testCases.failed == totals.testCases.total()) { - Colour colour(Colour::ResultError); + auto guard = colourImpl->guardColour( Colour::ResultError ).engage( out ); const StringRef qualify_assertions_failed = totals.assertions.failed == totals.assertions.total() ? bothOrAll(totals.assertions.failed) : StringRef{}; @@ -71,13 +73,11 @@ void printTotals(std::ostream& out, const Totals& totals) { << pluralise(totals.testCases.total(), "test case"_sr) << " (no assertions)."; } else if (totals.assertions.failed) { - Colour colour(Colour::ResultError); - out << + out << colourImpl->guardColour( Colour::ResultError ) << "Failed " << pluralise(totals.testCases.failed, "test case"_sr) << ", " "failed " << pluralise(totals.assertions.failed, "assertion"_sr) << '.'; } else { - Colour colour(Colour::ResultSuccess); - out << + out << colourImpl->guardColour( Colour::ResultSuccess ) << "Passed " << bothOrAll(totals.testCases.passed) << pluralise(totals.testCases.passed, "test case"_sr) << " with " << pluralise(totals.assertions.passed, "assertion"_sr) << '.'; @@ -89,12 +89,14 @@ class AssertionPrinter { public: AssertionPrinter& operator= (AssertionPrinter const&) = delete; AssertionPrinter(AssertionPrinter const&) = delete; - AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages) + AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages, ColourImpl* colourImpl_) : stream(_stream) , result(_stats.assertionResult) , messages(_stats.infoMessages) , itMessage(_stats.infoMessages.begin()) - , printInfoMessages(_printInfoMessages) {} + , printInfoMessages(_printInfoMessages) + , colourImpl(colourImpl_) + {} void print() { printSourceInfo(); @@ -166,16 +168,13 @@ public: private: void printSourceInfo() const { - Colour colourGuard(Colour::FileName); - stream << result.getSourceInfo() << ':'; + stream << colourImpl->guardColour( Colour::FileName ) + << result.getSourceInfo() << ':'; } void printResultType(Colour::Code colour, StringRef passOrFail) const { if (!passOrFail.empty()) { - { - Colour colourGuard(colour); - stream << ' ' << passOrFail; - } + stream << colourImpl->guardColour(colour) << ' ' << passOrFail; stream << ':'; } } @@ -188,8 +187,7 @@ private: if (result.hasExpression()) { stream << ';'; { - Colour colour(dimColour()); - stream << " expression was:"; + stream << colourImpl->guardColour(compactDimColour) << " expression was:"; } printOriginalExpression(); } @@ -203,10 +201,7 @@ private: void printReconstructedExpression() const { if (result.hasExpandedExpression()) { - { - Colour colour(dimColour()); - stream << " for: "; - } + stream << colourImpl->guardColour(compactDimColour) << " for: "; stream << result.getExpandedExpression(); } } @@ -218,25 +213,22 @@ private: } } - void printRemainingMessages(Colour::Code colour = dimColour()) { + void printRemainingMessages(Colour::Code colour = compactDimColour) { 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"_sr) << ':'; - } + stream << colourImpl->guardColour( colour ) << " with " + << pluralise( N, "message"_sr ) << ':'; 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"; + stream << colourImpl->guardColour(compactDimColour) << " and"; } continue; } @@ -250,6 +242,7 @@ private: std::vector<MessageInfo> messages; std::vector<MessageInfo>::const_iterator itMessage; bool printInfoMessages; + ColourImpl* colourImpl; }; } // anon namespace @@ -259,7 +252,17 @@ private: } void CompactReporter::noMatchingTestCases( StringRef unmatchedSpec ) { - stream << "No test cases matched '" << unmatchedSpec << "'\n"; + m_stream << "No test cases matched '" << unmatchedSpec << "'\n"; + } + + void CompactReporter::testRunStarting( TestRunInfo const& ) { + if ( m_config->testSpec().hasFilters() ) { + m_stream << m_colour->guardColour( Colour::BrightYellow ) + << "Filters: " + << serializeFilters( m_config->getTestsOrTags() ) + << '\n'; + } + m_stream << "RNG seed: " << getSeed() << '\n'; } void CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) { @@ -274,22 +277,22 @@ private: printInfoMessages = false; } - AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); + AssertionPrinter printer( m_stream, _assertionStats, printInfoMessages, m_colour.get() ); printer.print(); - stream << '\n' << std::flush; + m_stream << '\n' << std::flush; } void CompactReporter::sectionEnded(SectionStats const& _sectionStats) { double dur = _sectionStats.durationInSeconds; if ( shouldShowDuration( *m_config, dur ) ) { - stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; + m_stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; } } void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) { - printTotals( stream, _testRunStats.totals ); - stream << "\n\n" << std::flush; + printTotals( m_stream, _testRunStats.totals, m_colour.get() ); + m_stream << "\n\n" << std::flush; StreamingReporterBase::testRunEnded( _testRunStats ); } diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp index b39bd18ae..6362fc297 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp @@ -14,8 +14,8 @@ namespace Catch { - struct CompactReporter final : StreamingReporterBase { - + class CompactReporter final : public StreamingReporterBase { + public: using StreamingReporterBase::StreamingReporterBase; ~CompactReporter() override; @@ -24,6 +24,8 @@ namespace Catch { void noMatchingTestCases( StringRef unmatchedSpec ) override; + void testRunStarting( TestRunInfo const& _testInfo ) override; + void assertionEnded(AssertionStats const& _assertionStats) override; void sectionEnded(SectionStats const& _sectionStats) override; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp index d7c2dd595..88d43b531 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp @@ -13,12 +13,13 @@ #include <catch2/internal/catch_string_manip.hpp> #include <catch2/catch_version.hpp> #include <catch2/internal/catch_textflow.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/catch_test_case_info.hpp> #include <catch2/internal/catch_console_width.hpp> #include <catch2/reporters/catch_reporter_helpers.hpp> #include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/catch_get_random_seed.hpp> #include <cstdio> @@ -45,13 +46,14 @@ class ConsoleAssertionPrinter { public: ConsoleAssertionPrinter& operator= (ConsoleAssertionPrinter const&) = delete; ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete; - ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages) + ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, ColourImpl* colourImpl_, bool _printInfoMessages) : stream(_stream), stats(_stats), result(_stats.assertionResult), colour(Colour::None), message(result.getMessage()), messages(_stats.infoMessages), + colourImpl(colourImpl_), printInfoMessages(_printInfoMessages) { switch (result.getResultType()) { case ResultWas::Ok: @@ -134,23 +136,22 @@ public: private: void printResultType() const { if (!passOrFail.empty()) { - Colour colourGuard(colour); - stream << passOrFail << ":\n"; + stream << colourImpl->guardColour(colour) << passOrFail << ":\n"; } } void printOriginalExpression() const { if (result.hasExpression()) { - Colour colourGuard(Colour::OriginalExpression); - stream << " "; - stream << result.getExpressionInMacro(); - stream << '\n'; + stream << colourImpl->guardColour( Colour::OriginalExpression ) + << " " << result.getExpressionInMacro() << '\n'; } } void printReconstructedExpression() const { if (result.hasExpandedExpression()) { stream << "with expansion:\n"; - Colour colourGuard(Colour::ReconstructedExpression); - stream << TextFlow::Column(result.getExpandedExpression()).indent(2) << '\n'; + stream << colourImpl->guardColour( Colour::ReconstructedExpression ) + << TextFlow::Column( result.getExpandedExpression() ) + .indent( 2 ) + << '\n'; } } void printMessage() const { @@ -163,8 +164,8 @@ private: } } void printSourceInfo() const { - Colour colourGuard(Colour::FileName); - stream << result.getSourceInfo() << ": "; + stream << colourImpl->guardColour( Colour::FileName ) + << result.getSourceInfo() << ": "; } std::ostream& stream; @@ -175,15 +176,16 @@ private: std::string messageLabel; std::string message; std::vector<MessageInfo> messages; + ColourImpl* colourImpl; 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 makeRatio( std::uint64_t number, std::uint64_t total ) { + const auto ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number / total : 0; + return (ratio == 0 && number > 0) ? 1 : static_cast<std::size_t>(ratio); } -std::size_t& findMax(std::size_t& i, std::size_t& j, std::size_t& k) { +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) @@ -196,7 +198,7 @@ enum class Justification { Left, Right }; struct ColumnInfo { std::string name; - int width; + std::size_t width; Justification justification; }; struct ColumnBreak {}; @@ -299,7 +301,8 @@ public: TextFlow::Columns headerCols; auto spacer = TextFlow::Spacer(2); for (auto const& info : m_columnInfos) { - headerCols += TextFlow::Column(info.name).width(static_cast<std::size_t>(info.width - 2)); + assert(info.width > 2); + headerCols += TextFlow::Column(info.name).width(info.width - 2); headerCols += spacer; } m_os << headerCols << '\n'; @@ -333,7 +336,7 @@ public: tp.m_currentColumn++; auto colInfo = tp.m_columnInfos[tp.m_currentColumn]; - auto padding = (strSize + 1 < static_cast<std::size_t>(colInfo.width)) + auto padding = (strSize + 1 < colInfo.width) ? std::string(colInfo.width - (strSize + 1), ' ') : std::string(); if (colInfo.justification == Justification::Left) @@ -352,9 +355,9 @@ public: } }; -ConsoleReporter::ConsoleReporter(ReporterConfig const& config) - : StreamingReporterBase(config), - m_tablePrinter(Detail::make_unique<TablePrinter>(config.stream(), +ConsoleReporter::ConsoleReporter(ReporterConfig&& config): + StreamingReporterBase( CATCH_MOVE( config ) ), + m_tablePrinter(Detail::make_unique<TablePrinter>(m_stream, [&config]() -> std::vector<ColumnInfo> { if (config.fullConfig()->benchmarkNoAnalysis()) { @@ -382,11 +385,11 @@ std::string ConsoleReporter::getDescription() { } void ConsoleReporter::noMatchingTestCases( StringRef unmatchedSpec ) { - stream << "No test cases matched '" << unmatchedSpec << "'\n"; + m_stream << "No test cases matched '" << unmatchedSpec << "'\n"; } -void ConsoleReporter::reportInvalidArguments( StringRef arg ) { - stream << "Invalid Filter: " << arg << '\n'; +void ConsoleReporter::reportInvalidTestSpec( StringRef arg ) { + m_stream << "Invalid Filter: " << arg << '\n'; } void ConsoleReporter::assertionStarting(AssertionInfo const&) {} @@ -402,9 +405,9 @@ void ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) { lazyPrint(); - ConsoleAssertionPrinter printer(stream, _assertionStats, includeResults); + ConsoleAssertionPrinter printer(m_stream, _assertionStats, m_colour.get(), includeResults); printer.print(); - stream << '\n' << std::flush; + m_stream << '\n' << std::flush; } void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) { @@ -416,16 +419,17 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) { m_tablePrinter->close(); if (_sectionStats.missingAssertions) { lazyPrint(); - Colour colour(Colour::ResultError); + auto guard = + m_colour->guardColour( Colour::ResultError ).engage( m_stream ); if (m_sectionStack.size() > 1) - stream << "\nNo assertions in section"; + m_stream << "\nNo assertions in section"; else - stream << "\nNo assertions in test case"; - stream << " '" << _sectionStats.sectionInfo.name << "'\n\n" << std::flush; + m_stream << "\nNo assertions in test case"; + m_stream << " '" << _sectionStats.sectionInfo.name << "'\n\n" << std::flush; } double dur = _sectionStats.durationInSeconds; if (shouldShowDuration(*m_config, dur)) { - stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; + m_stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; } if (m_headerPrinted) { m_headerPrinted = false; @@ -437,8 +441,7 @@ void ConsoleReporter::benchmarkPreparing( StringRef name ) { lazyPrintWithoutClosingBenchmarkTable(); auto nameCol = TextFlow::Column( static_cast<std::string>( name ) ) - .width( static_cast<std::size_t>( - m_tablePrinter->columnInfos()[0].width - 2 ) ); + .width( m_tablePrinter->columnInfos()[0].width - 2 ); bool firstLine = true; for (auto line : nameCol) { @@ -475,7 +478,7 @@ void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) { } void ConsoleReporter::benchmarkFailed( StringRef error ) { - Colour colour(Colour::Red); + auto guard = m_colour->guardColour( Colour::Red ).engage( m_stream ); (*m_tablePrinter) << "Benchmark failed (" << error << ')' << ColumnBreak() << RowBreak(); @@ -489,12 +492,16 @@ void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { printTotalsDivider(_testRunStats.totals); printTotals(_testRunStats.totals); - stream << '\n' << std::flush; + m_stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { StreamingReporterBase::testRunStarting(_testInfo); - printTestFilters(); + if ( m_config->testSpec().hasFilters() ) { + m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " + << serializeFilters( m_config->getTestsOrTags() ) << '\n'; + } + m_stream << "Randomness seeded to: " << getSeed() << '\n'; } void ConsoleReporter::lazyPrint() { @@ -505,7 +512,7 @@ void ConsoleReporter::lazyPrint() { void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() { - if ( !currentTestRunInfo.used ) { + if ( !m_testRunInfoPrinted ) { lazyPrintRunInfo(); } if (!m_headerPrinted) { @@ -514,23 +521,21 @@ void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() { } } void ConsoleReporter::lazyPrintRunInfo() { - stream << '\n' << lineOfChars('~') << '\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; + m_stream << '\n' + << lineOfChars( '~' ) << '\n' + << m_colour->guardColour( Colour::SecondaryText ) + << currentTestRunInfo.name << " is a Catch2 v" << libraryVersion() + << " host application.\n" + << "Run with -? for options\n\n"; + + m_testRunInfoPrinted = true; } void ConsoleReporter::printTestCaseAndSectionHeader() { assert(!m_sectionStack.empty()); printOpenHeader(currentTestCaseInfo->name); if (m_sectionStack.size() > 1) { - Colour colourGuard(Colour::Headers); + auto guard = m_colour->guardColour( Colour::Headers ).engage( m_stream ); auto it = m_sectionStack.begin() + 1, // Skip first section (test case) @@ -542,33 +547,55 @@ void ConsoleReporter::printTestCaseAndSectionHeader() { SourceLineInfo lineInfo = m_sectionStack.back().lineInfo; - stream << lineOfChars('-') << '\n'; - Colour colourGuard(Colour::FileName); - stream << lineInfo << '\n'; - stream << lineOfChars('.') << "\n\n" << std::flush; + m_stream << lineOfChars( '-' ) << '\n' + << m_colour->guardColour( Colour::FileName ) << lineInfo << '\n' + << lineOfChars( '.' ) << "\n\n" + << std::flush; } void ConsoleReporter::printClosedHeader(std::string const& _name) { printOpenHeader(_name); - stream << lineOfChars('.') << '\n'; + m_stream << lineOfChars('.') << '\n'; } void ConsoleReporter::printOpenHeader(std::string const& _name) { - stream << lineOfChars('-') << '\n'; + m_stream << lineOfChars('-') << '\n'; { - Colour colourGuard(Colour::Headers); + auto guard = m_colour->guardColour( Colour::Headers ).engage( m_stream ); 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 << TextFlow::Column(_string).indent(indent + i).initialIndent(indent) << '\n'; + // We want to get a bit fancy with line breaking here, so that subsequent + // lines start after ":" if one is present, e.g. + // ``` + // blablabla: Fancy + // linebreaking + // ``` + // but we also want to avoid problems with overly long indentation causing + // the text to take up too many lines, e.g. + // ``` + // blablabla: F + // a + // n + // c + // y + // . + // . + // . + // ``` + // So we limit the prefix indentation check to first quarter of the possible + // width + std::size_t idx = _string.find( ": " ); + if ( idx != std::string::npos && idx < CATCH_CONFIG_CONSOLE_WIDTH / 4 ) { + idx += 2; + } else { + idx = 0; + } + m_stream << TextFlow::Column( _string ) + .indent( indent + idx ) + .initialIndent( indent ) + << '\n'; } struct SummaryColumn { @@ -576,7 +603,7 @@ struct SummaryColumn { SummaryColumn( std::string _label, Colour::Code _colour ) : label( CATCH_MOVE( _label ) ), colour( _colour ) {} - SummaryColumn addRow( std::size_t count ) { + SummaryColumn addRow( std::uint64_t count ) { ReusableStringStream rss; rss << count; std::string row = rss.str(); @@ -598,10 +625,12 @@ struct SummaryColumn { void ConsoleReporter::printTotals( Totals const& totals ) { if (totals.testCases.total() == 0) { - stream << Colour(Colour::Warning) << "No tests ran\n"; + m_stream << m_colour->guardColour( Colour::Warning ) + << "No tests ran\n"; } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) { - stream << Colour(Colour::ResultSuccess) << "All tests passed"; - stream << " (" + m_stream << m_colour->guardColour( Colour::ResultSuccess ) + << "All tests passed"; + m_stream << " (" << pluralise(totals.assertions.passed, "assertion"_sr) << " in " << pluralise(totals.testCases.passed, "test case"_sr) << ')' << '\n'; @@ -627,20 +656,22 @@ void ConsoleReporter::printTotals( Totals const& totals ) { } void ConsoleReporter::printSummaryRow(StringRef label, std::vector<SummaryColumn> const& cols, std::size_t row) { for (auto col : cols) { - std::string value = col.rows[row]; + std::string const& value = col.rows[row]; if (col.label.empty()) { - stream << label << ": "; - if (value != "0") - stream << value; - else - stream << Colour(Colour::Warning) << "- none -"; + m_stream << label << ": "; + if ( value != "0" ) { + m_stream << value; + } else { + m_stream << m_colour->guardColour( Colour::Warning ) + << "- none -"; + } } else if (value != "0") { - stream << Colour(Colour::LightGrey) << " | "; - stream << Colour(col.colour) - << value << ' ' << col.label; + m_stream << m_colour->guardColour( Colour::LightGrey ) << " | " + << m_colour->guardColour( col.colour ) << value << ' ' + << col.label; } } - stream << '\n'; + m_stream << '\n'; } void ConsoleReporter::printTotalsDivider(Totals const& totals) { @@ -653,26 +684,25 @@ void ConsoleReporter::printTotalsDivider(Totals const& totals) { 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, '='); + m_stream << m_colour->guardColour( Colour::Error ) + << std::string( failedRatio, '=' ) + << m_colour->guardColour( Colour::ResultExpectedFailure ) + << std::string( failedButOkRatio, '=' ); + if ( totals.testCases.allPassed() ) { + m_stream << m_colour->guardColour( Colour::ResultSuccess ) + << std::string( passedRatio, '=' ); + } else { + m_stream << m_colour->guardColour( Colour::Success ) + << std::string( passedRatio, '=' ); + } } else { - stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '='); + m_stream << m_colour->guardColour( Colour::Warning ) + << std::string( CATCH_CONFIG_CONSOLE_WIDTH - 1, '=' ); } - stream << '\n'; + m_stream << '\n'; } void ConsoleReporter::printSummaryDivider() { - stream << lineOfChars('-') << '\n'; -} - -void ConsoleReporter::printTestFilters() { - if (m_config->testSpec().hasFilters()) { - Colour guard(Colour::BrightYellow); - stream << "Filters: " << serializeFilters(m_config->getTestsOrTags()) << '\n'; - } + m_stream << lineOfChars('-') << '\n'; } } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp index ec7430935..719dcc449 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp @@ -16,15 +16,16 @@ namespace Catch { struct SummaryColumn; class TablePrinter; - struct ConsoleReporter final : StreamingReporterBase { + class ConsoleReporter final : public StreamingReporterBase { Detail::unique_ptr<TablePrinter> m_tablePrinter; - ConsoleReporter(ReporterConfig const& config); + public: + ConsoleReporter(ReporterConfig&& config); ~ConsoleReporter() override; static std::string getDescription(); void noMatchingTestCases( StringRef unmatchedSpec ) override; - void reportInvalidArguments( StringRef arg ) override; + void reportInvalidTestSpec( StringRef arg ) override; void assertionStarting(AssertionInfo const&) override; @@ -41,8 +42,8 @@ namespace Catch { void testCaseEnded(TestCaseStats const& _testCaseStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; void testRunStarting(TestRunInfo const& _testRunInfo) override; - private: + private: void lazyPrint(); void lazyPrintWithoutClosingBenchmarkTable(); @@ -62,10 +63,9 @@ namespace Catch { void printTotalsDivider(Totals const& totals); void printSummaryDivider(); - void printTestFilters(); - private: bool m_headerPrinted = false; + bool m_testRunInfoPrinted = false; }; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp index 64afac18c..957880d09 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -6,7 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/reporters/catch_reporter_cumulative_base.hpp> -#include <catch2/reporters/catch_reporter_helpers.hpp> + +#include <catch2/internal/catch_move_and_forward.hpp> #include <algorithm> #include <cassert> @@ -32,9 +33,41 @@ namespace Catch { } // namespace + namespace Detail { + AssertionOrBenchmarkResult::AssertionOrBenchmarkResult( + AssertionStats const& assertion ): + m_assertion( assertion ) {} + + AssertionOrBenchmarkResult::AssertionOrBenchmarkResult( + BenchmarkStats<> const& benchmark ): + m_benchmark( benchmark ) {} + + bool AssertionOrBenchmarkResult::isAssertion() const { + return m_assertion.some(); + } + bool AssertionOrBenchmarkResult::isBenchmark() const { + return m_benchmark.some(); + } + + AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const { + assert(m_assertion.some()); + + return *m_assertion; + } + BenchmarkStats<> const& AssertionOrBenchmarkResult::asBenchmark() const { + assert(m_benchmark.some()); + + return *m_benchmark; + } + + } CumulativeReporterBase::~CumulativeReporterBase() = default; + void CumulativeReporterBase::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) { + m_sectionStack.back()->assertionsAndBenchmarks.emplace_back(benchmarkStats); + } + void CumulativeReporterBase::sectionStarting( SectionInfo const& sectionInfo ) { SectionStats incompleteStats( sectionInfo, Counts(), 0, false ); @@ -72,10 +105,18 @@ namespace Catch { // 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. - static_cast<void>( - assertionStats.assertionResult.getExpandedExpression() ); + if ( m_shouldStoreFailedAssertions && + !assertionStats.assertionResult.isOk() ) { + static_cast<void>( + assertionStats.assertionResult.getExpandedExpression() ); + } + if ( m_shouldStoreSuccesfulAssertions && + assertionStats.assertionResult.isOk() ) { + static_cast<void>( + assertionStats.assertionResult.getExpandedExpression() ); + } SectionNode& sectionNode = *m_sectionStack.back(); - sectionNode.assertions.push_back( assertionStats ); + sectionNode.assertionsAndBenchmarks.emplace_back( assertionStats ); } void CumulativeReporterBase::sectionEnded( SectionStats const& sectionStats ) { @@ -105,19 +146,13 @@ namespace Catch { testRunEndedCumulative(); } - void CumulativeReporterBase::listReporters(std::vector<ReporterDescription> const& descriptions) { - defaultListReporters(stream, descriptions, m_config->verbosity()); - } - - void CumulativeReporterBase::listTests(std::vector<TestCaseHandle> const& tests) { - defaultListTests(stream, - tests, - m_config->hasTestFilters(), - m_config->verbosity()); - } - - void CumulativeReporterBase::listTags(std::vector<TagInfo> const& tags) { - defaultListTags( stream, tags, m_config->hasTestFilters() ); + bool CumulativeReporterBase::SectionNode::hasAnyAssertions() const { + return std::any_of( + assertionsAndBenchmarks.begin(), + assertionsAndBenchmarks.end(), + []( Detail::AssertionOrBenchmarkResult const& res ) { + return res.isAssertion(); + } ); } } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp index a6acc54f7..c4dcdae03 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp @@ -9,15 +9,59 @@ #define CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_reporter.hpp> +#include <catch2/reporters/catch_reporter_common_base.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_optional.hpp> -#include <iosfwd> #include <string> #include <vector> namespace Catch { - struct CumulativeReporterBase : IStreamingReporter { + namespace Detail { + + //! Represents either an assertion or a benchmark result to be handled by cumulative reporter later + class AssertionOrBenchmarkResult { + // This should really be a variant, but this is much faster + // to write and the data layout here is already terrible + // enough that we do not have to care about the object size. + Optional<AssertionStats> m_assertion; + Optional<BenchmarkStats<>> m_benchmark; + public: + AssertionOrBenchmarkResult(AssertionStats const& assertion); + AssertionOrBenchmarkResult(BenchmarkStats<> const& benchmark); + + bool isAssertion() const; + bool isBenchmark() const; + + AssertionStats const& asAssertion() const; + BenchmarkStats<> const& asBenchmark() const; + }; + } + + /** + * Utility base for reporters that need to handle all results at once + * + * It stores tree of all test cases, sections and assertions, and after the + * test run is finished, calls into `testRunEndedCumulative` to pass the + * control to the deriving class. + * + * If you are deriving from this class and override any testing related + * member functions, you should first call into the base's implementation to + * avoid breaking the tree construction. + * + * Due to the way this base functions, it has to expand assertions up-front, + * even if they are later unused (e.g. because the deriving reporter does + * not report successful assertions, or because the deriving reporter does + * not use assertion expansion at all). Derived classes can use two + * customization points, `m_shouldStoreSuccesfulAssertions` and + * `m_shouldStoreFailedAssertions`, to disable the expansion and gain extra + * performance. **Accessing the assertion expansions if it wasn't stored is + * UB.** + */ + class CumulativeReporterBase : public ReporterBase { + public: template<typename T, typename ChildNodeT> struct Node { explicit Node( T const& _value ) : value( _value ) {} @@ -33,9 +77,11 @@ namespace Catch { return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; } + bool hasAnyAssertions() const; + SectionStats stats; std::vector<Detail::unique_ptr<SectionNode>> childSections; - std::vector<AssertionStats> assertions; + std::vector<Detail::AssertionOrBenchmarkResult> assertionsAndBenchmarks; std::string stdOut; std::string stdErr; }; @@ -44,21 +90,22 @@ namespace Catch { using TestCaseNode = Node<TestCaseStats, SectionNode>; using TestRunNode = Node<TestRunStats, TestCaseNode>; - CumulativeReporterBase( ReporterConfig const& _config ): - IStreamingReporter( _config.fullConfig() ), - stream( _config.stream() ) {} + // GCC5 compat: we cannot use inherited constructor, because it + // doesn't implement backport of P0136 + CumulativeReporterBase(ReporterConfig&& _config): + ReporterBase(CATCH_MOVE(_config)) + {} ~CumulativeReporterBase() override; void benchmarkPreparing( StringRef ) override {} void benchmarkStarting( BenchmarkInfo const& ) override {} - void benchmarkEnded( BenchmarkStats<> const& ) override {} + void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override; void benchmarkFailed( StringRef ) override {} void noMatchingTestCases( StringRef ) override {} - void reportInvalidArguments( StringRef ) override {} + void reportInvalidTestSpec( StringRef ) override {} void fatalErrorEncountered( StringRef /*error*/ ) override {} - void testRunStarting( TestRunInfo const& ) override {} void testCaseStarting( TestCaseInfo const& ) override {} @@ -77,21 +124,26 @@ namespace Catch { void skipTest(TestCaseInfo const&) override {} - void listReporters( std::vector<ReporterDescription> const& descriptions ) override; - void listTests( std::vector<TestCaseHandle> const& tests ) override; - void listTags( std::vector<TagInfo> const& tags ) override; - protected: - std::ostream& stream; - // Note: We rely on pointer identity being stable, which is why - // we store pointers to the nodes rather than the values. - std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases; + //! Should the cumulative base store the assertion expansion for succesful assertions? + bool m_shouldStoreSuccesfulAssertions = true; + //! Should the cumulative base store the assertion expansion for failed assertions? + bool m_shouldStoreFailedAssertions = true; + // We need lazy construction here. We should probably refactor it // later, after the events are redone. + //! The root node of the test run tree. Detail::unique_ptr<TestRunNode> m_testRun; + private: + // Note: We rely on pointer identity being stable, which is why + // we store pointers to the nodes rather than the values. + std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases; + // Root section of the _current_ test case Detail::unique_ptr<SectionNode> m_rootSection; + // Deepest section of the _current_ test case SectionNode* m_deepestSection = nullptr; + // Stack of _active_ sections in the _current_ test case std::vector<SectionNode*> m_sectionStack; }; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp new file mode 100644 index 000000000..a997a315d --- /dev/null +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.cpp @@ -0,0 +1,40 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/reporters/catch_reporter_event_listener.hpp> + +namespace Catch { + + void EventListenerBase::fatalErrorEncountered( StringRef ) {} + + void EventListenerBase::benchmarkPreparing( StringRef ) {} + void EventListenerBase::benchmarkStarting( BenchmarkInfo const& ) {} + void EventListenerBase::benchmarkEnded( BenchmarkStats<> const& ) {} + void EventListenerBase::benchmarkFailed( StringRef ) {} + + void EventListenerBase::assertionStarting( AssertionInfo const& ) {} + + void EventListenerBase::assertionEnded( AssertionStats const& ) {} + void EventListenerBase::listReporters( + std::vector<ReporterDescription> const& ) {} + void EventListenerBase::listListeners( + std::vector<ListenerDescription> const& ) {} + void EventListenerBase::listTests( std::vector<TestCaseHandle> const& ) {} + void EventListenerBase::listTags( std::vector<TagInfo> const& ) {} + void EventListenerBase::noMatchingTestCases( StringRef ) {} + void EventListenerBase::reportInvalidTestSpec( StringRef ) {} + void EventListenerBase::testRunStarting( TestRunInfo const& ) {} + void EventListenerBase::testCaseStarting( TestCaseInfo const& ) {} + void EventListenerBase::testCasePartialStarting(TestCaseInfo const&, uint64_t) {} + void EventListenerBase::sectionStarting( SectionInfo const& ) {} + void EventListenerBase::sectionEnded( SectionStats const& ) {} + void EventListenerBase::testCasePartialEnded(TestCaseStats const&, uint64_t) {} + void EventListenerBase::testCaseEnded( TestCaseStats const& ) {} + void EventListenerBase::testRunEnded( TestRunStats const& ) {} + void EventListenerBase::skipTest( TestCaseInfo const& ) {} +} // namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp index d2cccb6be..3a6d822cc 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp @@ -13,18 +13,17 @@ namespace Catch { /** - * Base class identifying listeners. + * Base class to simplify implementing listeners. * - * Provides empty default implementation for all IStreamingReporter member - * functions, so that listeners implementations can pick which + * Provides empty default implementation for all IEventListener member + * functions, so that a listener implementation can pick which * member functions it actually cares about. */ - class EventListenerBase : public IStreamingReporter { + class EventListenerBase : public IEventListener { public: - EventListenerBase( ReporterConfig const& config ): - IStreamingReporter( config.fullConfig() ) {} + using IEventListener::IEventListener; - void reportInvalidArguments( StringRef unmatchedSpec ) override; + void reportInvalidTestSpec( StringRef unmatchedSpec ) override; void fatalErrorEncountered( StringRef error ) override; void benchmarkPreparing( StringRef name ) override; @@ -37,6 +36,8 @@ namespace Catch { void listReporters( std::vector<ReporterDescription> const& descriptions ) override; + void listListeners( + std::vector<ListenerDescription> const& descriptions ) override; void listTests( std::vector<TestCaseHandle> const& tests ) override; void listTags( std::vector<TagInfo> const& tagInfos ) override; @@ -52,7 +53,6 @@ namespace Catch { void testCaseEnded( TestCaseStats const& testCaseStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; void skipTest( TestCaseInfo const& testInfo ) override; - }; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_combined_tu.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_helpers.cpp similarity index 74% rename from packages/Catch2/src/catch2/reporters/catch_reporter_combined_tu.cpp rename to packages/Catch2/src/catch2/reporters/catch_reporter_helpers.cpp index 2ca76c935..31df851a8 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_combined_tu.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_helpers.cpp @@ -5,24 +5,13 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small reporter-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ #include <catch2/reporters/catch_reporter_helpers.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> #include <catch2/internal/catch_console_width.hpp> #include <catch2/internal/catch_errno_guard.hpp> #include <catch2/internal/catch_textflow.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_console_colour.hpp> #include <catch2/catch_tostring.hpp> @@ -139,7 +128,7 @@ namespace Catch { .width( 5 + maxNameLen ) << '\n'; } else { - out << TextFlow::Column( desc.name + ":" ) + out << TextFlow::Column( desc.name + ':' ) .indent( 2 ) .width( 5 + maxNameLen ) + TextFlow::Column( desc.description ) @@ -152,6 +141,38 @@ namespace Catch { out << '\n' << std::flush; } + void defaultListListeners( std::ostream& out, + std::vector<ListenerDescription> const& descriptions ) { + out << "Registered listeners:\n"; + + if(descriptions.empty()) { + return; + } + + const auto maxNameLen = + std::max_element( descriptions.begin(), + descriptions.end(), + []( ListenerDescription const& lhs, + ListenerDescription const& rhs ) { + return lhs.name.size() < rhs.name.size(); + } ) + ->name.size(); + + for ( auto const& desc : descriptions ) { + out << TextFlow::Column( static_cast<std::string>( desc.name ) + + ':' ) + .indent( 2 ) + .width( maxNameLen + 5 ) + + TextFlow::Column( desc.description ) + .initialIndent( 0 ) + .indent( 2 ) + .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8 ) + << '\n'; + } + + out << '\n' << std::flush; + } + void defaultListTags( std::ostream& out, std::vector<TagInfo> const& tags, bool isFiltered ) { @@ -174,7 +195,7 @@ namespace Catch { out << pluralise(tags.size(), "tag"_sr) << "\n\n" << std::flush; } - void defaultListTests(std::ostream& out, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity) { + void defaultListTests(std::ostream& out, ColourImpl* streamColour, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity) { // We special case this to provide the equivalent of old // `--list-test-names-only`, which could then be used by the // `--input-file` option. @@ -194,9 +215,9 @@ namespace Catch { Colour::Code colour = testCaseInfo.isHidden() ? Colour::SecondaryText : Colour::None; - Colour colourGuard(colour); + auto colourGuard = streamColour->guardColour( colour ).engage( out ); - out << TextFlow::Column(testCaseInfo.name).initialIndent(2).indent(4) << '\n'; + out << TextFlow::Column(testCaseInfo.name).indent(2) << '\n'; if (verbosity >= Verbosity::High) { out << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << '\n'; } @@ -215,35 +236,3 @@ namespace Catch { } } // namespace Catch - - -#include <catch2/reporters/catch_reporter_event_listener.hpp> - -namespace Catch { - - void EventListenerBase::fatalErrorEncountered( StringRef ) {} - - void EventListenerBase::benchmarkPreparing( StringRef ) {} - void EventListenerBase::benchmarkStarting( BenchmarkInfo const& ) {} - void EventListenerBase::benchmarkEnded( BenchmarkStats<> const& ) {} - void EventListenerBase::benchmarkFailed( StringRef ) {} - - void EventListenerBase::assertionStarting( AssertionInfo const& ) {} - - void EventListenerBase::assertionEnded( AssertionStats const& ) {} - void EventListenerBase::listReporters( - std::vector<ReporterDescription> const& ) {} - void EventListenerBase::listTests( std::vector<TestCaseHandle> const& ) {} - void EventListenerBase::listTags( std::vector<TagInfo> const& ) {} - void EventListenerBase::noMatchingTestCases( StringRef ) {} - void EventListenerBase::reportInvalidArguments( StringRef ) {} - void EventListenerBase::testRunStarting( TestRunInfo const& ) {} - void EventListenerBase::testCaseStarting( TestCaseInfo const& ) {} - void EventListenerBase::testCasePartialStarting(TestCaseInfo const&, uint64_t) {} - void EventListenerBase::sectionStarting( SectionInfo const& ) {} - void EventListenerBase::sectionEnded( SectionStats const& ) {} - void EventListenerBase::testCasePartialEnded(TestCaseStats const&, uint64_t) {} - void EventListenerBase::testCaseEnded( TestCaseStats const& ) {} - void EventListenerBase::testRunEnded( TestRunStats const& ) {} - void EventListenerBase::skipTest( TestCaseInfo const& ) {} -} // namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_helpers.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_helpers.hpp index d16d92f20..ef43534cb 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_helpers.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_helpers.hpp @@ -17,8 +17,9 @@ namespace Catch { - struct IConfig; + class IConfig; class TestCaseHandle; + class ColourImpl; // Returns double formatted as %.3f (format expected on output) std::string getFormattedDuration( double duration ); @@ -48,6 +49,13 @@ namespace Catch { std::vector<ReporterDescription> const& descriptions, Verbosity verbosity ); + /** + * Lists listeners descriptions to the provided stream in user-friendly + * format + */ + void defaultListListeners( std::ostream& out, + std::vector<ListenerDescription> const& descriptions ); + /** * Lists tag information to the provided stream in user-friendly format * @@ -67,6 +75,7 @@ namespace Catch { * `--list-test-names-only` option, for people who used it in integrations. */ void defaultListTests( std::ostream& out, + ColourImpl* streamColour, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity ); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp index f7420b7ad..c24d1efa2 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp @@ -13,10 +13,12 @@ #include <catch2/internal/catch_textflow.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> #include <catch2/catch_test_case_info.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <cassert> #include <ctime> #include <algorithm> +#include <iomanip> namespace Catch { @@ -54,14 +56,35 @@ namespace Catch { } return std::string(); } + + // Formats the duration in seconds to 3 decimal places. + // This is done because some genius defined Maven Surefire schema + // in a way that only accepts 3 decimal places, and tools like + // Jenkins use that schema for validation JUnit reporter output. + std::string formatDuration( double seconds ) { + ReusableStringStream rss; + rss << std::fixed << std::setprecision( 3 ) << seconds; + return rss.str(); + } + + static void normalizeNamespaceMarkers(std::string& str) { + std::size_t pos = str.find( "::" ); + while ( pos != str.npos ) { + str.replace( pos, 2, "." ); + pos += 1; + pos = str.find( "::", pos ); + } + } + } // anonymous namespace - JunitReporter::JunitReporter( ReporterConfig const& _config ) - : CumulativeReporterBase( _config ), - xml( _config.stream() ) + JunitReporter::JunitReporter( ReporterConfig&& _config ) + : CumulativeReporterBase( CATCH_MOVE(_config) ), + xml( m_stream ) { m_preferences.shouldRedirectStdOut = true; m_preferences.shouldReportAllAssertions = true; + m_shouldStoreSuccesfulAssertions = false; } std::string JunitReporter::getDescription() { @@ -111,22 +134,20 @@ namespace Catch { if( m_config->showDurations() == ShowDurations::Never ) xml.writeAttribute( "time"_sr, ""_sr ); else - xml.writeAttribute( "time"_sr, suiteTime ); + xml.writeAttribute( "time"_sr, formatDuration( suiteTime ) ); xml.writeAttribute( "timestamp"_sr, getCurrentTimestamp() ); - // Write properties if there are any - if (m_config->hasTestFilters() || m_config->rngSeed() != 0) { + // Write properties + { auto properties = xml.scopedElement("properties"); + xml.scopedElement("property") + .writeAttribute("name"_sr, "random-seed"_sr) + .writeAttribute("value"_sr, m_config->rngSeed()); if (m_config->hasTestFilters()) { xml.scopedElement("property") .writeAttribute("name"_sr, "filters"_sr) .writeAttribute("value"_sr, serializeFilters(m_config->getTestsOrTags())); } - if (m_config->rngSeed() != 0) { - xml.scopedElement("property") - .writeAttribute("name"_sr, "random-seed"_sr) - .writeAttribute("value"_sr, m_config->rngSeed()); - } } // Write test cases @@ -145,30 +166,35 @@ namespace Catch { assert( testCaseNode.children.size() == 1 ); SectionNode const& rootSection = *testCaseNode.children.front(); - std::string className = stats.testInfo->className; + std::string className = + static_cast<std::string>( stats.testInfo->className ); if( className.empty() ) { className = fileNameTag(stats.testInfo->tags); - if ( className.empty() ) + if ( className.empty() ) { className = "global"; + } } if ( !m_config->name().empty() ) - className = m_config->name() + "." + className; + className = static_cast<std::string>(m_config->name()) + '.' + className; - writeSection( className, "", rootSection ); + normalizeNamespaceMarkers(className); + + writeSection( className, "", rootSection, stats.testInfo->okToFail() ); } - void JunitReporter::writeSection( std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode ) { + void JunitReporter::writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode, + bool testOkToFail) { std::string name = trim( sectionNode.stats.sectionInfo.name ); if( !rootName.empty() ) name = rootName + '/' + name; - if( !sectionNode.assertions.empty() || - !sectionNode.stdOut.empty() || - !sectionNode.stdErr.empty() ) { + if( sectionNode.hasAnyAssertions() + || !sectionNode.stdOut.empty() + || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); if( className.empty() ) { xml.writeAttribute( "classname"_sr, name ); @@ -178,15 +204,21 @@ namespace Catch { xml.writeAttribute( "classname"_sr, className ); xml.writeAttribute( "name"_sr, name ); } - xml.writeAttribute( "time"_sr, ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) ); + xml.writeAttribute( "time"_sr, formatDuration( sectionNode.stats.durationInSeconds ) ); // This is not ideal, but it should be enough to mimic gtest's // junit output. // Ideally the JUnit reporter would also handle `skipTest` // events and write those out appropriately. xml.writeAttribute( "status"_sr, "run"_sr ); + if (sectionNode.stats.assertions.failedButOk) { + xml.scopedElement("skipped") + .writeAttribute("message", "TEST_CASE tagged with !mayfail"); + } + writeAssertions( sectionNode ); + if( !sectionNode.stdOut.empty() ) xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline ); if( !sectionNode.stdErr.empty() ) @@ -194,14 +226,17 @@ namespace Catch { } for( auto const& childNode : sectionNode.childSections ) if( className.empty() ) - writeSection( name, "", *childNode ); + writeSection( name, "", *childNode, testOkToFail ); else - writeSection( className, name, *childNode ); + writeSection( className, name, *childNode, testOkToFail ); } void JunitReporter::writeAssertions( SectionNode const& sectionNode ) { - for( auto const& assertion : sectionNode.assertions ) - writeAssertion( assertion ); + for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) { + if (assertionOrBenchmark.isAssertion()) { + writeAssertion(assertionOrBenchmark.asAssertion()); + } + } } void JunitReporter::writeAssertion( AssertionStats const& stats ) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp index 6665663ce..a45344de6 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp @@ -17,7 +17,7 @@ namespace Catch { class JunitReporter final : public CumulativeReporterBase { public: - JunitReporter(ReporterConfig const& _config); + JunitReporter(ReporterConfig&& _config); ~JunitReporter() override = default; @@ -39,7 +39,8 @@ namespace Catch { void writeSection( std::string const& className, std::string const& rootName, - SectionNode const& sectionNode ); + SectionNode const& sectionNode, + bool testOkToFail ); void writeAssertions(SectionNode const& sectionNode); void writeAssertion(AssertionStats const& stats); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp deleted file mode 100644 index f233b0a2e..000000000 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp +++ /dev/null @@ -1,175 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -#include <catch2/reporters/catch_reporter_listening.hpp> -#include <catch2/internal/catch_move_and_forward.hpp> - -#include <cassert> - -namespace Catch { - - void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) { - m_listeners.push_back( CATCH_MOVE( listener ) ); - } - - void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) { - assert(!m_reporter && "Listening reporter can wrap only 1 real reporter"); - m_reporter = CATCH_MOVE( reporter ); - m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut; - } - - void ListeningReporter::noMatchingTestCases( StringRef unmatchedSpec ) { - for ( auto& listener : m_listeners ) { - listener->noMatchingTestCases( unmatchedSpec ); - } - m_reporter->noMatchingTestCases( unmatchedSpec ); - } - - void ListeningReporter::fatalErrorEncountered( StringRef error ) { - for ( auto& listener : m_listeners ) { - listener->fatalErrorEncountered( error ); - } - m_reporter->fatalErrorEncountered( error ); - } - - void ListeningReporter::reportInvalidArguments( StringRef arg ) { - for ( auto& listener : m_listeners ) { - listener->reportInvalidArguments( arg ); - } - m_reporter->reportInvalidArguments( arg ); - } - - void ListeningReporter::benchmarkPreparing( StringRef name ) { - for (auto& listener : m_listeners) { - listener->benchmarkPreparing(name); - } - m_reporter->benchmarkPreparing(name); - } - void ListeningReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) { - for ( auto& listener : m_listeners ) { - listener->benchmarkStarting( benchmarkInfo ); - } - m_reporter->benchmarkStarting( benchmarkInfo ); - } - void ListeningReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) { - for ( auto& listener : m_listeners ) { - listener->benchmarkEnded( benchmarkStats ); - } - m_reporter->benchmarkEnded( benchmarkStats ); - } - - void ListeningReporter::benchmarkFailed( StringRef error ) { - for (auto& listener : m_listeners) { - listener->benchmarkFailed(error); - } - m_reporter->benchmarkFailed(error); - } - - void ListeningReporter::testRunStarting( TestRunInfo const& testRunInfo ) { - for ( auto& listener : m_listeners ) { - listener->testRunStarting( testRunInfo ); - } - m_reporter->testRunStarting( testRunInfo ); - } - - void ListeningReporter::testCaseStarting( TestCaseInfo const& testInfo ) { - for ( auto& listener : m_listeners ) { - listener->testCaseStarting( testInfo ); - } - m_reporter->testCaseStarting( testInfo ); - } - - void - ListeningReporter::testCasePartialStarting( TestCaseInfo const& testInfo, - uint64_t partNumber ) { - for ( auto& listener : m_listeners ) { - listener->testCasePartialStarting( testInfo, partNumber ); - } - m_reporter->testCasePartialStarting( testInfo, partNumber ); - } - - void ListeningReporter::sectionStarting( SectionInfo const& sectionInfo ) { - for ( auto& listener : m_listeners ) { - listener->sectionStarting( sectionInfo ); - } - m_reporter->sectionStarting( sectionInfo ); - } - - void ListeningReporter::assertionStarting( AssertionInfo const& assertionInfo ) { - for ( auto& listener : m_listeners ) { - listener->assertionStarting( assertionInfo ); - } - m_reporter->assertionStarting( assertionInfo ); - } - - // The return value indicates if the messages buffer should be cleared: - void ListeningReporter::assertionEnded( AssertionStats const& assertionStats ) { - for( auto& listener : m_listeners ) { - listener->assertionEnded( assertionStats ); - } - m_reporter->assertionEnded( assertionStats ); - } - - void ListeningReporter::sectionEnded( SectionStats const& sectionStats ) { - for ( auto& listener : m_listeners ) { - listener->sectionEnded( sectionStats ); - } - m_reporter->sectionEnded( sectionStats ); - } - - void ListeningReporter::testCasePartialEnded( TestCaseStats const& testInfo, - uint64_t partNumber ) { - for ( auto& listener : m_listeners ) { - listener->testCasePartialEnded( testInfo, partNumber ); - } - m_reporter->testCasePartialEnded( testInfo, partNumber ); - } - - void ListeningReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { - for ( auto& listener : m_listeners ) { - listener->testCaseEnded( testCaseStats ); - } - m_reporter->testCaseEnded( testCaseStats ); - } - - void ListeningReporter::testRunEnded( TestRunStats const& testRunStats ) { - for ( auto& listener : m_listeners ) { - listener->testRunEnded( testRunStats ); - } - m_reporter->testRunEnded( testRunStats ); - } - - - void ListeningReporter::skipTest( TestCaseInfo const& testInfo ) { - for ( auto& listener : m_listeners ) { - listener->skipTest( testInfo ); - } - m_reporter->skipTest( testInfo ); - } - - void ListeningReporter::listReporters(std::vector<ReporterDescription> const& descriptions) { - for (auto& listener : m_listeners) { - listener->listReporters(descriptions); - } - m_reporter->listReporters(descriptions); - } - - void ListeningReporter::listTests(std::vector<TestCaseHandle> const& tests) { - for (auto& listener : m_listeners) { - listener->listTests(tests); - } - m_reporter->listTests(tests); - } - - void ListeningReporter::listTags(std::vector<TagInfo> const& tags) { - for (auto& listener : m_listeners) { - listener->listTags(tags); - } - m_reporter->listTags(tags); - } - -} // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_multi.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_multi.cpp new file mode 100644 index 000000000..cf18cb81b --- /dev/null +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_multi.cpp @@ -0,0 +1,198 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#include <catch2/reporters/catch_reporter_multi.hpp> + +#include <catch2/catch_config.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_stdstreams.hpp> + +#include <ostream> + +namespace Catch { + void MultiReporter::updatePreferences(IEventListener const& reporterish) { + m_preferences.shouldRedirectStdOut |= + reporterish.getPreferences().shouldRedirectStdOut; + m_preferences.shouldReportAllAssertions |= + reporterish.getPreferences().shouldReportAllAssertions; + } + + void MultiReporter::addListener( IEventListenerPtr&& listener ) { + updatePreferences(*listener); + m_reporterLikes.insert(m_reporterLikes.begin() + m_insertedListeners, CATCH_MOVE(listener) ); + ++m_insertedListeners; + } + + void MultiReporter::addReporter( IEventListenerPtr&& reporter ) { + updatePreferences(*reporter); + + // We will need to output the captured stdout if there are reporters + // that do not want it captured. + // We do not consider listeners, because it is generally assumed that + // listeners are output-transparent, even though they can ask for stdout + // capture to do something with it. + m_haveNoncapturingReporters |= !reporter->getPreferences().shouldRedirectStdOut; + + // Reporters can always be placed to the back without breaking the + // reporting order + m_reporterLikes.push_back( CATCH_MOVE( reporter ) ); + } + + void MultiReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->noMatchingTestCases( unmatchedSpec ); + } + } + + void MultiReporter::fatalErrorEncountered( StringRef error ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->fatalErrorEncountered( error ); + } + } + + void MultiReporter::reportInvalidTestSpec( StringRef arg ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->reportInvalidTestSpec( arg ); + } + } + + void MultiReporter::benchmarkPreparing( StringRef name ) { + for (auto& reporterish : m_reporterLikes) { + reporterish->benchmarkPreparing(name); + } + } + void MultiReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->benchmarkStarting( benchmarkInfo ); + } + } + void MultiReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->benchmarkEnded( benchmarkStats ); + } + } + + void MultiReporter::benchmarkFailed( StringRef error ) { + for (auto& reporterish : m_reporterLikes) { + reporterish->benchmarkFailed(error); + } + } + + void MultiReporter::testRunStarting( TestRunInfo const& testRunInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testRunStarting( testRunInfo ); + } + } + + void MultiReporter::testCaseStarting( TestCaseInfo const& testInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCaseStarting( testInfo ); + } + } + + void + MultiReporter::testCasePartialStarting( TestCaseInfo const& testInfo, + uint64_t partNumber ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCasePartialStarting( testInfo, partNumber ); + } + } + + void MultiReporter::sectionStarting( SectionInfo const& sectionInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->sectionStarting( sectionInfo ); + } + } + + void MultiReporter::assertionStarting( AssertionInfo const& assertionInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->assertionStarting( assertionInfo ); + } + } + + // The return value indicates if the messages buffer should be cleared: + void MultiReporter::assertionEnded( AssertionStats const& assertionStats ) { + const bool reportByDefault = + assertionStats.assertionResult.getResultType() != ResultWas::Ok || + m_config->includeSuccessfulResults(); + + for ( auto & reporterish : m_reporterLikes ) { + if ( reportByDefault || + reporterish->getPreferences().shouldReportAllAssertions ) { + reporterish->assertionEnded( assertionStats ); + } + } + } + + void MultiReporter::sectionEnded( SectionStats const& sectionStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->sectionEnded( sectionStats ); + } + } + + void MultiReporter::testCasePartialEnded( TestCaseStats const& testStats, + uint64_t partNumber ) { + if ( m_preferences.shouldRedirectStdOut && + m_haveNoncapturingReporters ) { + if ( !testStats.stdOut.empty() ) { + Catch::cout() << testStats.stdOut << std::flush; + } + if ( !testStats.stdErr.empty() ) { + Catch::cerr() << testStats.stdErr << std::flush; + } + } + + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCasePartialEnded( testStats, partNumber ); + } + } + + void MultiReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testCaseEnded( testCaseStats ); + } + } + + void MultiReporter::testRunEnded( TestRunStats const& testRunStats ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->testRunEnded( testRunStats ); + } + } + + + void MultiReporter::skipTest( TestCaseInfo const& testInfo ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->skipTest( testInfo ); + } + } + + void MultiReporter::listReporters(std::vector<ReporterDescription> const& descriptions) { + for (auto& reporterish : m_reporterLikes) { + reporterish->listReporters(descriptions); + } + } + + void MultiReporter::listListeners( + std::vector<ListenerDescription> const& descriptions ) { + for ( auto& reporterish : m_reporterLikes ) { + reporterish->listListeners( descriptions ); + } + } + + void MultiReporter::listTests(std::vector<TestCaseHandle> const& tests) { + for (auto& reporterish : m_reporterLikes) { + reporterish->listTests(tests); + } + } + + void MultiReporter::listTags(std::vector<TagInfo> const& tags) { + for (auto& reporterish : m_reporterLikes) { + reporterish->listTags(tags); + } + } + +} // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_multi.hpp similarity index 62% rename from packages/Catch2/src/catch2/reporters/catch_reporter_listening.hpp rename to packages/Catch2/src/catch2/reporters/catch_reporter_multi.hpp index caa5c1a84..e35ea5041 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_multi.hpp @@ -5,34 +5,40 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#ifndef CATCH_REPORTER_LISTENING_HPP_INCLUDED -#define CATCH_REPORTER_LISTENING_HPP_INCLUDED +#ifndef CATCH_REPORTER_MULTI_HPP_INCLUDED +#define CATCH_REPORTER_MULTI_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_reporter.hpp> namespace Catch { - class ListeningReporter final : public IStreamingReporter { - using Reporters = std::vector<IStreamingReporterPtr>; - Reporters m_listeners; - IStreamingReporterPtr m_reporter = nullptr; + class MultiReporter final : public IEventListener { + /* + * Stores all added reporters and listeners + * + * All Listeners are stored before all reporters, and individual + * listeners/reporters are stored in order of insertion. + */ + std::vector<IEventListenerPtr> m_reporterLikes; + bool m_haveNoncapturingReporters = false; - public: - ListeningReporter( IConfig const* config ): - IStreamingReporter( config ) { - // We will assume that listeners will always want all assertions - m_preferences.shouldReportAllAssertions = true; - } + // Keep track of how many listeners we have already inserted, + // so that we can insert them into the main vector at the right place + size_t m_insertedListeners = 0; + + void updatePreferences(IEventListener const& reporterish); + public: + using IEventListener::IEventListener; - void addListener( IStreamingReporterPtr&& listener ); - void addReporter( IStreamingReporterPtr&& reporter ); + void addListener( IEventListenerPtr&& listener ); + void addReporter( IEventListenerPtr&& reporter ); - public: // IStreamingReporter + public: // IEventListener void noMatchingTestCases( StringRef unmatchedSpec ) override; void fatalErrorEncountered( StringRef error ) override; - void reportInvalidArguments( StringRef arg ) override; + void reportInvalidTestSpec( StringRef arg ) override; void benchmarkPreparing( StringRef name ) override; void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override; @@ -54,6 +60,7 @@ namespace Catch { void skipTest( TestCaseInfo const& testInfo ) override; void listReporters(std::vector<ReporterDescription> const& descriptions) override; + void listListeners(std::vector<ListenerDescription> const& descriptions) override; void listTests(std::vector<TestCaseHandle> const& tests) override; void listTags(std::vector<TagInfo> const& tags) override; @@ -62,4 +69,4 @@ namespace Catch { } // end namespace Catch -#endif // CATCH_REPORTER_LISTENING_HPP_INCLUDED +#endif // CATCH_REPORTER_MULTI_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp new file mode 100644 index 000000000..fd1bc76ca --- /dev/null +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_registrars.cpp @@ -0,0 +1,30 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <catch2/internal/catch_compiler_capabilities.hpp> + +namespace Catch { + namespace Detail { + + void registerReporterImpl( std::string const& name, + IReporterFactoryPtr reporterPtr ) { + CATCH_TRY { + getMutableRegistryHub().registerReporter( + name, CATCH_MOVE( reporterPtr ) ); + } + CATCH_CATCH_ALL { + // Do not throw when constructing global objects, instead + // register the exception to be processed later + getMutableRegistryHub().registerStartupException(); + } + } + + } // namespace Detail +} // namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_registrars.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_registrars.hpp new file mode 100644 index 000000000..e33ecf8b6 --- /dev/null +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_registrars.hpp @@ -0,0 +1,132 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_REPORTER_REGISTRARS_HPP_INCLUDED +#define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED + +#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> +#include <catch2/interfaces/catch_interfaces_reporter.hpp> +#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/internal/catch_unique_name.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/internal/catch_void_type.hpp> + +#include <type_traits> + +namespace Catch { + + namespace Detail { + + template <typename T, typename = void> + struct has_description : std::false_type {}; + + template <typename T> + struct has_description< + T, + void_t<decltype( T::getDescription() )>> + : std::true_type {}; + + //! Indirection for reporter registration, so that the error handling is + //! independent on the reporter's concrete type + void registerReporterImpl( std::string const& name, + IReporterFactoryPtr reporterPtr ); + + } // namespace Detail + + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; + + template <typename T> + class ReporterFactory : public IReporterFactory { + + IEventListenerPtr create( ReporterConfig&& config ) const override { + return Detail::make_unique<T>( CATCH_MOVE(config) ); + } + + std::string getDescription() const override { + return T::getDescription(); + } + }; + + + template<typename T> + class ReporterRegistrar { + public: + explicit ReporterRegistrar( std::string const& name ) { + registerReporterImpl( name, + Detail::make_unique<ReporterFactory<T>>() ); + } + }; + + template<typename T> + class ListenerRegistrar { + + class TypedListenerFactory : public EventListenerFactory { + StringRef m_listenerName; + + std::string getDescriptionImpl( std::true_type ) const { + return T::getDescription(); + } + + std::string getDescriptionImpl( std::false_type ) const { + return "(No description provided)"; + } + + public: + TypedListenerFactory( StringRef listenerName ): + m_listenerName( listenerName ) {} + + IEventListenerPtr create( IConfig const* config ) const override { + return Detail::make_unique<T>( config ); + } + + StringRef getName() const override { + return m_listenerName; + } + + std::string getDescription() const override { + return getDescriptionImpl( Detail::has_description<T>{} ); + } + }; + + public: + ListenerRegistrar(StringRef listenerName) { + getMutableRegistryHub().registerListener( Detail::make_unique<TypedListenerFactory>(listenerName) ); + } + }; +} + +#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> INTERNAL_CATCH_UNIQUE_NAME( \ + catch_internal_RegistrarFor )( 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> INTERNAL_CATCH_UNIQUE_NAME( \ + 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 // CATCH_REPORTER_REGISTRARS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp index e09b51090..8119c3b8f 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp @@ -9,13 +9,25 @@ #include <catch2/internal/catch_string_manip.hpp> #include <catch2/catch_test_case_info.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> +#include <catch2/interfaces/catch_interfaces_config.hpp> #include <map> namespace Catch { + namespace { + std::string createRngSeedString(uint32_t seed) { + ReusableStringStream sstr; + sstr << "rng-seed=" << seed; + return sstr.str(); + } + } + void SonarQubeReporter::testRunStarting(TestRunInfo const& testRunInfo) { CumulativeReporterBase::testRunStarting(testRunInfo); + + xml.writeComment( createRngSeedString( m_config->rngSeed() ) ); xml.startElement("testExecutions"); xml.writeAttribute("version"_sr, '1'); } @@ -54,7 +66,9 @@ namespace Catch { if (!rootName.empty()) name = rootName + '/' + name; - if (!sectionNode.assertions.empty() || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty()) { + if ( sectionNode.hasAnyAssertions() + || !sectionNode.stdOut.empty() + || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement("testCase"); xml.writeAttribute("name"_sr, name); xml.writeAttribute("duration"_sr, static_cast<long>(sectionNode.stats.durationInSeconds * 1000)); @@ -67,8 +81,11 @@ namespace Catch { } void SonarQubeReporter::writeAssertions(SectionNode const& sectionNode, bool okToFail) { - for (auto const& assertion : sectionNode.assertions) - writeAssertion(assertion, okToFail); + for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) { + if (assertionOrBenchmark.isAssertion()) { + writeAssertion(assertionOrBenchmark.asAssertion(), okToFail); + } + } } void SonarQubeReporter::writeAssertion(AssertionStats const& stats, bool okToFail) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp index 720c0ea0f..32756b488 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp @@ -11,16 +11,18 @@ #include <catch2/reporters/catch_reporter_cumulative_base.hpp> #include <catch2/internal/catch_xmlwriter.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { - struct SonarQubeReporter final : CumulativeReporterBase { - - SonarQubeReporter(ReporterConfig const& config) - : CumulativeReporterBase(config) - , xml(config.stream()) { + class SonarQubeReporter final : public CumulativeReporterBase { + public: + SonarQubeReporter(ReporterConfig&& config) + : CumulativeReporterBase(CATCH_MOVE(config)) + , xml(m_stream) { m_preferences.shouldRedirectStdOut = true; m_preferences.shouldReportAllAssertions = true; + m_shouldStoreSuccesfulAssertions = false; } ~SonarQubeReporter() override = default; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp index 1c2787ca0..a9c898ed8 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp @@ -6,7 +6,6 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/reporters/catch_reporter_streaming_base.hpp> -#include <catch2/reporters/catch_reporter_helpers.hpp> namespace Catch { @@ -19,22 +18,6 @@ namespace Catch { void StreamingReporterBase::testRunEnded( TestRunStats const& ) { currentTestCaseInfo = nullptr; - currentTestRunInfo.reset(); - } - - void StreamingReporterBase::listReporters(std::vector<ReporterDescription> const& descriptions) { - defaultListReporters( stream, descriptions, m_config->verbosity() ); - } - - void StreamingReporterBase::listTests(std::vector<TestCaseHandle> const& tests) { - defaultListTests(stream, - tests, - m_config->hasTestFilters(), - m_config->verbosity()); - } - - void StreamingReporterBase::listTags(std::vector<TagInfo> const& tags) { - defaultListTags( stream, tags, m_config->hasTestFilters() ); } } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp index e7b6e5b3a..76788d8d5 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp @@ -9,37 +9,20 @@ #define CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_reporter.hpp> +#include <catch2/reporters/catch_reporter_common_base.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> -#include <catch2/internal/catch_option.hpp> - -#include <iosfwd> -#include <string> #include <vector> namespace Catch { - 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 StreamingReporterBase : IStreamingReporter { - - StreamingReporterBase( ReporterConfig const& _config ): - IStreamingReporter( _config.fullConfig() ), - stream( _config.stream() ) {} - - + class StreamingReporterBase : public ReporterBase { + public: + // GCC5 compat: we cannot use inherited constructor, because it + // doesn't implement backport of P0136 + StreamingReporterBase(ReporterConfig&& _config): + ReporterBase(CATCH_MOVE(_config)) + {} ~StreamingReporterBase() override; void benchmarkPreparing( StringRef ) override {} @@ -49,7 +32,7 @@ namespace Catch { void fatalErrorEncountered( StringRef /*error*/ ) override {} void noMatchingTestCases( StringRef /*unmatchedSpec*/ ) override {} - void reportInvalidArguments( StringRef /*invalidArgument*/ ) override {} + void reportInvalidTestSpec( StringRef /*invalidArgument*/ ) override {} void testRunStarting( TestRunInfo const& _testRunInfo ) override; @@ -78,15 +61,11 @@ namespace Catch { // It can optionally be overridden in the derived class. } - void listReporters( std::vector<ReporterDescription> const& descriptions ) override; - void listTests( std::vector<TestCaseHandle> const& tests ) override; - void listTags( std::vector<TagInfo> const& tags ) override; - - std::ostream& stream; - - LazyStat<TestRunInfo> currentTestRunInfo; + protected: + TestRunInfo currentTestRunInfo{ "test run has not started yet"_sr }; TestCaseInfo const* currentTestCaseInfo = nullptr; + //! Stack of all _active_ sections in the _current_ test case std::vector<SectionInfo> m_sectionStack; }; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp index 46a0994da..6058f2422 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp @@ -9,8 +9,10 @@ #include <catch2/internal/catch_console_colour.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/catch_test_case_info.hpp> +#include <catch2/interfaces/catch_interfaces_config.hpp> #include <algorithm> +#include <iterator> #include <ostream> namespace Catch { @@ -20,18 +22,20 @@ namespace Catch { // Making older compiler happy is hard. static constexpr StringRef tapFailedString = "not ok"_sr; static constexpr StringRef tapPassedString = "ok"_sr; + static constexpr Colour::Code tapDimColour = Colour::FileName; class TapAssertionPrinter { public: TapAssertionPrinter& operator= (TapAssertionPrinter const&) = delete; TapAssertionPrinter(TapAssertionPrinter const&) = delete; - TapAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, std::size_t _counter) + TapAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, std::size_t _counter, ColourImpl* colour_) : stream(_stream) , result(_stats.assertionResult) , messages(_stats.infoMessages) , itMessage(_stats.infoMessages.begin()) , printInfoMessages(true) - , counter(_counter) {} + , counter(_counter) + , colourImpl( colour_ ) {} void print() { itMessage = messages.begin(); @@ -104,13 +108,6 @@ namespace Catch { } private: - static Colour::Code dimColour() { return Colour::FileName; } - - void printSourceInfo() const { - Colour colourGuard(dimColour()); - stream << result.getSourceInfo() << ':'; - } - void printResultType(StringRef passOrFail) const { if (!passOrFail.empty()) { stream << passOrFail << ' ' << counter << " -"; @@ -124,10 +121,8 @@ namespace Catch { void printExpressionWas() { if (result.hasExpression()) { stream << ';'; - { - Colour colour(dimColour()); - stream << " expression was:"; - } + stream << colourImpl->guardColour( tapDimColour ) + << " expression was:"; printOriginalExpression(); } } @@ -140,10 +135,8 @@ namespace Catch { void printReconstructedExpression() const { if (result.hasExpandedExpression()) { - { - Colour colour(dimColour()); - stream << " for: "; - } + stream << colourImpl->guardColour( tapDimColour ) << " for: "; + std::string expr = result.getExpandedExpression(); std::replace(expr.begin(), expr.end(), '\n', ' '); stream << expr; @@ -157,7 +150,7 @@ namespace Catch { } } - void printRemainingMessages(Colour::Code colour = dimColour()) { + void printRemainingMessages(Colour::Code colour = tapDimColour) { if (itMessage == messages.end()) { return; } @@ -166,18 +159,15 @@ namespace Catch { 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"_sr) << ':'; - } + stream << colourImpl->guardColour( colour ) << " with " + << pluralise( N, "message"_sr ) << ':'; 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"; + stream << colourImpl->guardColour(tapDimColour) << " and"; } } } @@ -190,30 +180,35 @@ namespace Catch { std::vector<MessageInfo>::const_iterator itMessage; bool printInfoMessages; std::size_t counter; + ColourImpl* colourImpl; }; } // End anonymous namespace + void TAPReporter::testRunStarting( TestRunInfo const& ) { + m_stream << "# rng-seed: " << m_config->rngSeed() << '\n'; + } + void TAPReporter::noMatchingTestCases( StringRef unmatchedSpec ) { - stream << "# No test cases matched '" << unmatchedSpec << "'\n"; + m_stream << "# No test cases matched '" << unmatchedSpec << "'\n"; } void TAPReporter::assertionEnded(AssertionStats const& _assertionStats) { ++counter; - stream << "# " << currentTestCaseInfo->name << '\n'; - TapAssertionPrinter printer(stream, _assertionStats, counter); + m_stream << "# " << currentTestCaseInfo->name << '\n'; + TapAssertionPrinter printer(m_stream, _assertionStats, counter, m_colour.get()); printer.print(); - stream << '\n' << std::flush; + m_stream << '\n' << std::flush; } void TAPReporter::testRunEnded(TestRunStats const& _testRunStats) { - stream << "1.." << _testRunStats.totals.assertions.total(); + m_stream << "1.." << _testRunStats.totals.assertions.total(); if (_testRunStats.totals.testCases.total() == 0) { - stream << " # Skipped: No tests ran."; + m_stream << " # Skipped: No tests ran."; } - stream << "\n\n" << std::flush; + m_stream << "\n\n" << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp index e7c22cfa9..0c4b14b47 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp @@ -9,13 +9,14 @@ #define CATCH_REPORTER_TAP_HPP_INCLUDED #include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { - struct TAPReporter final : StreamingReporterBase { - - TAPReporter( ReporterConfig const& config ): - StreamingReporterBase( config ) { + class TAPReporter final : public StreamingReporterBase { + public: + TAPReporter( ReporterConfig&& config ): + StreamingReporterBase( CATCH_MOVE(config) ) { m_preferences.shouldReportAllAssertions = true; } ~TAPReporter() override = default; @@ -25,6 +26,8 @@ namespace Catch { return "Reports test results in TAP format, suitable for test harnesses"s; } + void testRunStarting( TestRunInfo const& testInfo ) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; void assertionEnded(AssertionStats const& _assertionStats) override; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp index 1972b8c49..142dffbb1 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp @@ -14,6 +14,7 @@ #include <catch2/catch_test_case_info.hpp> #include <cassert> +#include <ostream> namespace Catch { @@ -47,12 +48,12 @@ namespace Catch { TeamCityReporter::~TeamCityReporter() {} void TeamCityReporter::testRunStarting( TestRunInfo const& runInfo ) { - stream << "##teamcity[testSuiteStarted name='" << escape( runInfo.name ) + m_stream << "##teamcity[testSuiteStarted name='" << escape( runInfo.name ) << "']\n"; } void TeamCityReporter::testRunEnded( TestRunStats const& runStats ) { - stream << "##teamcity[testSuiteFinished name='" + m_stream << "##teamcity[testSuiteFinished name='" << escape( runStats.runInfo.name ) << "']\n"; } @@ -112,43 +113,43 @@ namespace Catch { if (currentTestCaseInfo->okToFail()) { msg << "- failure ignore as test marked as 'ok to fail'\n"; - stream << "##teamcity[testIgnored" + m_stream << "##teamcity[testIgnored" << " name='" << escape(currentTestCaseInfo->name) << '\'' << " message='" << escape(msg.str()) << '\'' << "]\n"; } else { - stream << "##teamcity[testFailed" + m_stream << "##teamcity[testFailed" << " name='" << escape(currentTestCaseInfo->name) << '\'' << " message='" << escape(msg.str()) << '\'' << "]\n"; } } - stream.flush(); + m_stream.flush(); } void TeamCityReporter::testCaseStarting(TestCaseInfo const& testInfo) { m_testTimer.start(); StreamingReporterBase::testCaseStarting(testInfo); - stream << "##teamcity[testStarted name='" + m_stream << "##teamcity[testStarted name='" << escape(testInfo.name) << "']\n"; - stream.flush(); + m_stream.flush(); } void TeamCityReporter::testCaseEnded(TestCaseStats const& testCaseStats) { StreamingReporterBase::testCaseEnded(testCaseStats); auto const& testCaseInfo = *testCaseStats.testInfo; if (!testCaseStats.stdOut.empty()) - stream << "##teamcity[testStdOut name='" + m_stream << "##teamcity[testStdOut name='" << escape(testCaseInfo.name) << "' out='" << escape(testCaseStats.stdOut) << "']\n"; if (!testCaseStats.stdErr.empty()) - stream << "##teamcity[testStdErr name='" + m_stream << "##teamcity[testStdErr name='" << escape(testCaseInfo.name) << "' out='" << escape(testCaseStats.stdErr) << "']\n"; - stream << "##teamcity[testFinished name='" + m_stream << "##teamcity[testFinished name='" << escape(testCaseInfo.name) << "' duration='" << m_testTimer.getElapsedMilliseconds() << "']\n"; - stream.flush(); + m_stream.flush(); } void TeamCityReporter::printSectionHeader(std::ostream& os) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp index 7abe81853..5007193bb 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp @@ -20,9 +20,10 @@ namespace Catch { - struct TeamCityReporter final : StreamingReporterBase { - TeamCityReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ) + class TeamCityReporter final : public StreamingReporterBase { + public: + TeamCityReporter( ReporterConfig&& _config ) + : StreamingReporterBase( CATCH_MOVE(_config) ) { m_preferences.shouldRedirectStdOut = true; } @@ -52,7 +53,6 @@ namespace Catch { private: void printSectionHeader(std::ostream& os); - private: bool m_headerPrintedForThisSection = false; Timer m_testTimer; }; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp index 4e2a9a34f..1e5def417 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp @@ -13,6 +13,8 @@ #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_list.hpp> #include <catch2/catch_test_case_info.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> +#include <catch2/catch_version.hpp> #if defined(_MSC_VER) #pragma warning(push) @@ -22,9 +24,9 @@ #endif namespace Catch { - XmlReporter::XmlReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ), - m_xml(_config.stream()) + XmlReporter::XmlReporter( ReporterConfig&& _config ) + : StreamingReporterBase( CATCH_MOVE(_config) ), + m_xml(m_stream) { m_preferences.shouldRedirectStdOut = true; m_preferences.shouldReportAllAssertions = true; @@ -51,14 +53,12 @@ namespace Catch { std::string stylesheetRef = getStylesheetRef(); if( !stylesheetRef.empty() ) m_xml.writeStylesheetRef( stylesheetRef ); - m_xml.startElement( "Catch2TestRun" ); - if( !m_config->name().empty() ) - m_xml.writeAttribute( "name"_sr, m_config->name() ); + m_xml.startElement("Catch2TestRun") + .writeAttribute("name"_sr, m_config->name()) + .writeAttribute("rng-seed"_sr, m_config->rngSeed()) + .writeAttribute("catch2-version"_sr, libraryVersion()); if (m_config->testSpec().hasFilters()) m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) ); - if( m_config->rngSeed() != 0 ) - m_xml.scopedElement( "Randomness" ) - .writeAttribute( "seed"_sr, m_config->rngSeed() ); } void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) { @@ -259,6 +259,19 @@ namespace Catch { } } + void XmlReporter::listListeners(std::vector<ListenerDescription> const& descriptions) { + auto outerTag = m_xml.scopedElement( "RegisteredListeners" ); + for ( auto const& listener : descriptions ) { + auto inner = m_xml.scopedElement( "Listener" ); + m_xml.startElement( "Name", XmlFormatting::Indent ) + .writeText( listener.name, XmlFormatting::None ) + .endElement( XmlFormatting::Newline ); + m_xml.startElement( "Description", XmlFormatting::Indent ) + .writeText( listener.description, XmlFormatting::None ) + .endElement( XmlFormatting::Newline ); + } + } + void XmlReporter::listTests(std::vector<TestCaseHandle> const& tests) { auto outerTag = m_xml.scopedElement("MatchingTests"); for (auto const& test : tests) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp index 46dd667a9..573f9321a 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp @@ -17,7 +17,7 @@ namespace Catch { class XmlReporter : public StreamingReporterBase { public: - XmlReporter(ReporterConfig const& _config); + XmlReporter(ReporterConfig&& _config); ~XmlReporter() override; @@ -51,6 +51,7 @@ namespace Catch { void benchmarkFailed( StringRef error ) override; void listReporters(std::vector<ReporterDescription> const& descriptions) override; + void listListeners(std::vector<ListenerDescription> const& descriptions) override; void listTests(std::vector<TestCaseHandle> const& tests) override; void listTags(std::vector<TagInfo> const& tags) override; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporters_all.hpp b/packages/Catch2/src/catch2/reporters/catch_reporters_all.hpp index bf29c6fe2..d3a59eb7d 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporters_all.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporters_all.hpp @@ -22,13 +22,15 @@ #define CATCH_REPORTERS_ALL_HPP_INCLUDED #include <catch2/reporters/catch_reporter_automake.hpp> +#include <catch2/reporters/catch_reporter_common_base.hpp> #include <catch2/reporters/catch_reporter_compact.hpp> #include <catch2/reporters/catch_reporter_console.hpp> #include <catch2/reporters/catch_reporter_cumulative_base.hpp> #include <catch2/reporters/catch_reporter_event_listener.hpp> #include <catch2/reporters/catch_reporter_helpers.hpp> #include <catch2/reporters/catch_reporter_junit.hpp> -#include <catch2/reporters/catch_reporter_listening.hpp> +#include <catch2/reporters/catch_reporter_multi.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> #include <catch2/reporters/catch_reporter_sonarqube.hpp> #include <catch2/reporters/catch_reporter_streaming_base.hpp> #include <catch2/reporters/catch_reporter_tap.hpp> diff --git a/packages/Catch2/tests/CMakeLists.txt b/packages/Catch2/tests/CMakeLists.txt index 7f7c32fe7..7f5af9949 100644 --- a/packages/Catch2/tests/CMakeLists.txt +++ b/packages/Catch2/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -include(MiscFunctions) +include(CatchMiscFunctions) if (CATCH_BUILD_SURROGATES) message(STATUS "Configuring targets for surrogate TUs") @@ -79,6 +79,8 @@ set(TEST_SOURCES ${SELF_TEST_DIR}/TestRegistrations.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Clara.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/CmdLine.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/CmdLineHelpers.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/ColourImpl.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Details.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/FloatingPoint.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/GeneratorsImpl.tests.cpp @@ -87,6 +89,11 @@ set(TEST_SOURCES ${SELF_TEST_DIR}/IntrospectiveTests/RandomNumberGeneration.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Reporters.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Tag.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/TestCaseInfoHasher.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/TestSpecParser.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/TextFlow.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/Sharding.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/Stream.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/String.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/StringManip.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Xml.tests.cpp @@ -139,6 +146,12 @@ include(CTest) add_executable(SelfTest ${TEST_SOURCES}) target_link_libraries(SelfTest PRIVATE Catch2WithMain) +if (BUILD_SHARED_LIBS AND WIN32) + add_custom_command(TARGET SelfTest PRE_LINK + COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Catch2> + $<TARGET_FILE:Catch2WithMain> $<TARGET_FILE_DIR:SelfTest> + ) +endif() if (CATCH_ENABLE_COVERAGE) set(ENABLE_COVERAGE ON CACHE BOOL "Enable coverage build." FORCE) @@ -200,20 +213,80 @@ set_tests_properties(List::Reporters::XmlOutput PROPERTIES FAIL_REGULAR_EXPRESSION "Available reporters:" ) - +add_test(NAME List::Listeners::Output + COMMAND + $<TARGET_FILE:SelfTest> --list-listeners +) +set_tests_properties(List::Listeners::Output + PROPERTIES + PASS_REGULAR_EXPRESSION "Registered listeners:" +) +add_test(NAME List::Listeners::ExitCode + COMMAND + $<TARGET_FILE:SelfTest> --list-listeners +) +add_test(NAME List::Listeners::XmlOutput + COMMAND + $<TARGET_FILE:SelfTest> + --list-listeners + --reporter xml +) +set_tests_properties(List::Listeners::XmlOutput + PROPERTIES + PASS_REGULAR_EXPRESSION "<RegisteredListeners>" + FAIL_REGULAR_EXPRESSION "Registered listeners:" +) add_test(NAME NoAssertions COMMAND $<TARGET_FILE:SelfTest> -w NoAssertions "An empty test with no assertions") 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 +# We cannot combine a regular expression on output with return code check +# in one test, so we register two instead of making a checking script because +# the runtime overhead is small enough. +add_test(NAME TestSpecs::CombiningMatchingAndNonMatchingIsOk-1 COMMAND $<TARGET_FILE:SelfTest> Tracker, "___nonexistent_test___") + +add_test(NAME TestSpecs::CombiningMatchingAndNonMatchingIsOk-2 COMMAND $<TARGET_FILE:SelfTest> Tracker, "___nonexistent_test___") +set_tests_properties(TestSpecs::CombiningMatchingAndNonMatchingIsOk-2 PROPERTIES PASS_REGULAR_EXPRESSION "No test cases matched '___nonexistent_test___'" FAIL_REGULAR_EXPRESSION "No tests ran" ) -add_test(NAME WarnAboutNoTests COMMAND ${CMAKE_COMMAND} -P ${SELF_TEST_DIR}/WarnAboutNoTests.cmake $<TARGET_FILE:SelfTest>) +add_test(NAME TestSpecs::NoMatchedTestsFail + COMMAND $<TARGET_FILE:SelfTest> "___nonexistent_test___" +) +set_tests_properties(TestSpecs::NoMatchedTestsFail + PROPERTIES + WILL_FAIL ON +) +add_test(NAME TestSpecs::OverrideFailureWithNoMatchedTests + COMMAND $<TARGET_FILE:SelfTest> "___nonexistent_test___" --allow-running-no-tests +) + +add_test(NAME Warnings::UnmatchedTestSpecIsAccepted + COMMAND $<TARGET_FILE:SelfTest> Tracker --warn UnmatchedTestSpec +) +set_tests_properties(Warnings::UnmatchedTestSpecIsAccepted + PROPERTIES + FAIL_REGULAR_EXPRESSION "Unrecognised warning option: " +) + +add_test(NAME Warnings::MultipleWarningsCanBeSpecified + COMMAND + $<TARGET_FILE:SelfTest> Tracker + --warn NoAssertions + --warn UnmatchedTestSpec +) + +add_test(NAME TestSpecs::WarnUnmatchedTestSpecFailsWithUnmatchedTestSpec + COMMAND + $<TARGET_FILE:SelfTest> Tracker, "___nonexistent_test___" --warn UnmatchedTestSpec +) +set_tests_properties(TestSpecs::WarnUnmatchedTestSpecFailsWithUnmatchedTestSpec + PROPERTIES + WILL_FAIL ON +) -add_test(NAME UnmatchedOutputFilter COMMAND $<TARGET_FILE:SelfTest> [this-tag-does-not-exist] -w NoTests) +add_test(NAME UnmatchedOutputFilter COMMAND $<TARGET_FILE:SelfTest> [this-tag-does-not-exist]) set_tests_properties(UnmatchedOutputFilter PROPERTIES PASS_REGULAR_EXPRESSION "No test cases matched '\\[this-tag-does-not-exist\\]'" @@ -244,6 +317,7 @@ add_test( $<TARGET_FILE:SelfTest> "#2025: same-level sections" -c "A" -c "B" + --colour-mode none ) set_tests_properties(FilteredSection::GeneratorsDontCauseInfiniteLoop-2 PROPERTIES @@ -257,13 +331,14 @@ set_tests_properties(ApprovalTests FAIL_REGULAR_EXPRESSION "Results differed" COST 120 # We know that this is either the most, or second most, # expensive test in the test suite, so we give it high estimate for CI runs + LABELS "uses-python" ) 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}") +set_tests_properties(VersionCheck PROPERTIES PASS_REGULAR_EXPRESSION "Catch2 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") @@ -292,14 +367,12 @@ set_tests_properties(TestsInFile::SimpleSpecs PROPERTIES PASS_REGULAR_EXPRESSION add_test(NAME TestsInFile::EscapeSpecialCharacters COMMAND $<TARGET_FILE:SelfTest> "-f ${SELF_TEST_DIR}/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 ${SELF_TEST_DIR}/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 ${SELF_TEST_DIR}/Misc/invalid-test-names.input") -set_tests_properties(TestsInFile::InvalidTestNames-2 PROPERTIES PASS_REGULAR_EXPRESSION "No tests ran") +set_tests_properties(TestsInFile::InvalidTestNames-1 + PROPERTIES + PASS_REGULAR_EXPRESSION "Invalid Filter: \"Test with special, characters in \\\\\" name\"" + FAIL_REGULAR_EXPRESSION "No tests ran" +) add_test(NAME TagAlias COMMAND $<TARGET_FILE:SelfTest> [@tricky] --list-tests) set_tests_properties(TagAlias PROPERTIES @@ -309,11 +382,32 @@ set_tests_properties(TagAlias PROPERTIES add_test(NAME RandomTestOrdering COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tests/TestScripts/testRandomOrder.py $<TARGET_FILE:SelfTest>) +set_tests_properties(RandomTestOrdering + PROPERTIES + LABELS "uses-python" +) add_test(NAME CheckConvenienceHeaders COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tools/scripts/checkConvenienceHeaders.py ) +set_tests_properties(CheckConvenienceHeaders + PROPERTIES + LABELS "uses-python" +) + +add_test(NAME "Benchmarking::SkipBenchmarkMacros" + COMMAND + $<TARGET_FILE:SelfTest> "Skip benchmark macros" + --reporter console + --skip-benchmarks + --colour-mode none +) +set_tests_properties("Benchmarking::SkipBenchmarkMacros" + PROPERTIES + PASS_REGULAR_EXPRESSION "All tests passed \\(2 assertions in 1 test case\\)" + FAIL_REGULAR_EXPRESSION "benchmark name" +) add_test(NAME "Benchmarking::FailureReporting::OptimizedOut" @@ -368,14 +462,152 @@ set_tests_properties("Benchmarking::FailureReporting::ShouldFailIsRespected" PASS_REGULAR_EXPRESSION "1 failed as expected" ) +add_test(NAME "ErrorHandling::InvalidTestSpecExitsEarly" + COMMAND + $<TARGET_FILE:SelfTest> "[aa,a]" +) +set_tests_properties("ErrorHandling::InvalidTestSpecExitsEarly" + PROPERTIES + PASS_REGULAR_EXPRESSION "Invalid Filter: \\[aa\,a\\]" + FAIL_REGULAR_EXPRESSION "No tests ran" +) + +if (MSVC) + set(_NullFile "NUL") +else() + set(_NullFile "/dev/null") +endif() + +# This test checks that there is nothing written out from the process, +# but if CMake is running the tests under Valgrind or similar tool, then +# that will write its own output to stdout and the test would fail. +if (NOT MEMORYCHECK_COMMAND) + add_test(NAME "MultiReporter::CapturingReportersDontPropagateStdOut" + COMMAND + $<TARGET_FILE:SelfTest> "Sends stuff to stdout and stderr" + --reporter xml::out=${_NullFile} + --reporter junit::out=${_NullFile} + ) + set_tests_properties("MultiReporter::CapturingReportersDontPropagateStdOut" + PROPERTIES + FAIL_REGULAR_EXPRESSION ".+" + ) +endif() + +add_test(NAME "MultiReporter::NonCapturingReportersPropagateStdout" + COMMAND + $<TARGET_FILE:SelfTest> "Sends stuff to stdout and stderr" + --reporter xml::out=${_NullFile} + --reporter console::out=${_NullFile} +) +set_tests_properties("MultiReporter::NonCapturingReportersPropagateStdout" + PROPERTIES + PASS_REGULAR_EXPRESSION "A string sent to stderr via clog" +) + +add_test(NAME "Outputs::DashAsOutLocationSendsOutputToStdout" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --out=- + --colour-mode none +) +set_tests_properties("Outputs::DashAsOutLocationSendsOutputToStdout" + PROPERTIES + PASS_REGULAR_EXPRESSION "All tests passed \\(5 assertions in 1 test case\\)" +) + +add_test(NAME "Reporters::DashAsLocationInReporterSpecSendsOutputToStdout" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --reporter console::out=- + --colour-mode none +) +set_tests_properties("Reporters::DashAsLocationInReporterSpecSendsOutputToStdout" + PROPERTIES + PASS_REGULAR_EXPRESSION "All tests passed \\(5 assertions in 1 test case\\)" +) + +add_test(NAME "Reporters::ReporterSpecificColourOverridesDefaultColour" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --reporter console::colour-mode=ansi + --colour-mode none +) +set_tests_properties("Reporters::ReporterSpecificColourOverridesDefaultColour" + PROPERTIES + PASS_REGULAR_EXPRESSION "\\[1\;32mAll tests passed" +) + +add_test(NAME "Reporters::UnrecognizedOptionInSpecCausesError" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --reporter console::bad-option=ansi +) +set_tests_properties("Reporters::UnrecognizedOptionInSpecCausesError" + PROPERTIES + WILL_FAIL ON +) -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") +add_test(NAME "Colours::ColourModeCanBeExplicitlySetToAnsi" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --reporter console + --colour-mode ansi +) +set_tests_properties("Colours::ColourModeCanBeExplicitlySetToAnsi" + PROPERTIES + PASS_REGULAR_EXPRESSION "\\[1\;32mAll tests passed" +) + +add_test(NAME "Reporters::JUnit::NamespacesAreNormalized" + COMMAND + $<TARGET_FILE:SelfTest> + --reporter junit + "A TEST_CASE_METHOD testing junit classname normalization" +) +set_tests_properties("Reporters::JUnit::NamespacesAreNormalized" + PROPERTIES + PASS_REGULAR_EXPRESSION "testcase classname=\"SelfTest(\.exe)?\\.A\\.B\\.TestClass\"" +) + +if (CATCH_ENABLE_CONFIGURE_TESTS) + foreach(testName "DefaultReporter" "Disable" "DisableStringification" + "ExperimentalRedirect") + + add_test(NAME "CMakeConfig::${testName}" + COMMAND + "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/TestScripts/testConfigure${testName}.py" "${CATCH_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" + ) + set_tests_properties("CMakeConfig::${testName}" + PROPERTIES + COST 240 + LABELS "uses-python" + ) + + endforeach() endif() +foreach (reporterName # "Automake" - the simple .trs format does not support any kind of comments/metadata + "compact" + "console" + "JUnit" + "SonarQube" + "TAP" + # "TeamCity" - does not seem to support test suite-level metadata/comments + "XML") + add_test(NAME "Reporters:RngSeed:${reporterName}" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --reporter ${reporterName} + --rng-seed 18181818 + ) + set_tests_properties("Reporters:RngSeed:${reporterName}" + PROPERTIES + PASS_REGULAR_EXPRESSION "18181818" + ) + +endforeach() + + list(APPEND CATCH_WARNING_TARGETS SelfTest) set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE) diff --git a/packages/Catch2/tests/ExtraTests/CMakeLists.txt b/packages/Catch2/tests/ExtraTests/CMakeLists.txt index bce10df5b..f1a02af3f 100644 --- a/packages/Catch2/tests/ExtraTests/CMakeLists.txt +++ b/packages/Catch2/tests/ExtraTests/CMakeLists.txt @@ -8,6 +8,26 @@ project( Catch2ExtraTests LANGUAGES CXX ) message( STATUS "Extra tests included" ) + +add_test( + NAME TestShardingIntegration + COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tests/TestScripts/testSharding.py $<TARGET_FILE:SelfTest> +) +set_tests_properties(TestShardingIntegration + PROPERTIES + LABELS "uses-python" +) + +add_test( + NAME TestSharding::OverlyLargeShardIndex + COMMAND $<TARGET_FILE:SelfTest> --shard-index 5 --shard-count 5 +) +set_tests_properties( + TestSharding::OverlyLargeShardIndex + PROPERTIES + PASS_REGULAR_EXPRESSION "The shard count \\(5\\) must be greater than the shard index \\(5\\)" +) + # The MinDuration reporting tests do not need separate compilation, but # they have non-trivial execution time, so they are categorized as # extra tests, so that they are run less. @@ -105,6 +125,30 @@ set_tests_properties( FAIL_REGULAR_EXPRESSION "abort;terminate;fatal" ) +add_executable( BazelReporter ${TESTS_DIR}/X30-BazelReporter.cpp ) +target_compile_definitions( BazelReporter PRIVATE CATCH_CONFIG_BAZEL_SUPPORT ) +target_link_libraries(BazelReporter Catch2_buildall_interface) +add_test(NAME CATCH_CONFIG_BAZEL_REPORTER-1 + COMMAND + "${PYTHON_EXECUTABLE}" "${CATCH_DIR}/tests/TestScripts/testBazelReporter.py" $<TARGET_FILE:BazelReporter> "${CMAKE_CURRENT_BINARY_DIR}" +) +set_tests_properties(CATCH_CONFIG_BAZEL_REPORTER-1 + PROPERTIES + LABELS "uses-python" +) + +# We must now test this works without the build flag. +add_executable( BazelReporterNoCatchConfig ${TESTS_DIR}/X30-BazelReporter.cpp ) +target_link_libraries(BazelReporterNoCatchConfig Catch2WithMain) +add_test(NAME NO_CATCH_CONFIG_BAZEL_REPORTER-1 + COMMAND + "${PYTHON_EXECUTABLE}" "${CATCH_DIR}/tests/TestScripts/testBazelReporter.py" $<TARGET_FILE:BazelReporterNoCatchConfig> "${CMAKE_CURRENT_BINARY_DIR}" +) +set_tests_properties(NO_CATCH_CONFIG_BAZEL_REPORTER-1 + PROPERTIES + LABELS "uses-python" + ENVIRONMENT "BAZEL_TEST=1" +) # The default handler on Windows leads to the just-in-time debugger firing, # which makes this test unsuitable for CI and headless runs, as it opens @@ -135,6 +179,17 @@ set_tests_properties( ) +add_executable(DeferredStaticChecks ${TESTS_DIR}/X05-DeferredStaticChecks.cpp) +target_link_libraries(DeferredStaticChecks PRIVATE Catch2WithMain) +target_compile_definitions(DeferredStaticChecks PRIVATE "CATCH_CONFIG_RUNTIME_STATIC_REQUIRE") + +add_test(NAME DeferredStaticChecks COMMAND DeferredStaticChecks -r compact) +set_tests_properties( + DeferredStaticChecks + PROPERTIES + PASS_REGULAR_EXPRESSION "Failed 1 test case, failed all 3 assertions." +) + add_executable(FallbackStringifier ${TESTS_DIR}/X10-FallbackStringifier.cpp) target_compile_definitions( FallbackStringifier PRIVATE CATCH_CONFIG_FALLBACK_STRINGIFIER=fallbackStringifier ) @@ -179,6 +234,155 @@ add_test( NAME PartialTestCaseEvents COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tests/TestScripts/testPartialTestCaseEvent.py $<TARGET_FILE:PartialTestCaseEvents> ) +set_tests_properties(PartialTestCaseEvents + PROPERTIES + LABELS "uses-python" +) + +add_executable(BenchmarksInCumulativeReporter ${TESTS_DIR}/X22-BenchmarksInCumulativeReporter.cpp) +target_link_libraries(BenchmarksInCumulativeReporter PRIVATE Catch2::Catch2WithMain) +add_test( + NAME BenchmarksInCumulativeReporter + COMMAND BenchmarksInCumulativeReporter --reporter testReporter +) +set_tests_properties( + BenchmarksInCumulativeReporter + PROPERTIES + PASS_REGULAR_EXPRESSION "1\n2\n3\n4\n5\n" +) + + +add_executable(CasingInReporterNames ${TESTS_DIR}/X23-CasingInReporterNames.cpp) +target_link_libraries(CasingInReporterNames PRIVATE Catch2::Catch2WithMain) +add_test( + NAME Reporters::registration-is-case-preserving + COMMAND CasingInReporterNames --list-reporters +) +set_tests_properties( + Reporters::registration-is-case-preserving + PROPERTIES + PASS_REGULAR_EXPRESSION "testReporterCASED" +) +add_test( + NAME Reporters::selection-is-case-insensitive + COMMAND CasingInReporterNames -r testReportercased +) +set_tests_properties( + Reporters::selection-is-case-insensitive + PROPERTIES + PASS_REGULAR_EXPRESSION "TestReporter constructed" +) + +add_executable(CapturedStdoutInTestCaseEvents ${TESTS_DIR}/X27-CapturedStdoutInTestCaseEvents.cpp) +target_link_libraries(CapturedStdoutInTestCaseEvents PRIVATE Catch2::Catch2WithMain) +add_test( + NAME Reporters::CapturedStdOutInEvents + COMMAND CapturedStdoutInTestCaseEvents + --reporter test-reporter +) +set_tests_properties( + Reporters::CapturedStdOutInEvents + PROPERTIES + PASS_REGULAR_EXPRESSION "X27 - TestReporter constructed" + FAIL_REGULAR_EXPRESSION "X27 ERROR" +) + + +if (MSVC) + set(_NullFile "NUL") +else() + set(_NullFile "/dev/null") +endif() + +add_executable(ListenerStdoutCaptureInMultireporter ${TESTS_DIR}/X24-ListenerStdoutCaptureInMultireporter.cpp) +target_link_libraries(ListenerStdoutCaptureInMultireporter PRIVATE Catch2::Catch2WithMain) + +# This test checks that there is nothing written out from the process, +# but if CMake is running the tests under Valgrind or similar tool, then +# that will write its own output to stdout and the test would fail. +if (NOT MEMORYCHECK_COMMAND) + add_test( + NAME MultiReporter::NoncapturingListenerDoesntCauseStdoutPassThrough + COMMAND ListenerStdoutCaptureInMultireporter + --reporter xml::out=${_NullFile} + --reporter junit::out=${_NullFile} + ) + + set_tests_properties( + MultiReporter::NoncapturingListenerDoesntCauseStdoutPassThrough + PROPERTIES + PASS_REGULAR_EXPRESSION "X24 - NonCapturingListener initialized" + FAIL_REGULAR_EXPRESSION "X24 - FooBarBaz" + ) +endif() + + +add_executable(ListenerCanAskForCapturedStdout ${TESTS_DIR}/X25-ListenerCanAskForCapturedStdout.cpp) +target_link_libraries(ListenerCanAskForCapturedStdout PRIVATE Catch2::Catch2WithMain) +add_test( + NAME MultiReporter::CapturingListenerCausesStdoutCapture + COMMAND ListenerCanAskForCapturedStdout + --reporter compact::out=${_NullFile} + --reporter console::out=${_NullFile} +) +set_tests_properties( + MultiReporter::CapturingListenerCausesStdoutCapture + PROPERTIES + PASS_REGULAR_EXPRESSION "CapturingListener initialized" + FAIL_REGULAR_EXPRESSION "X25 - ERROR" +) + +add_executable(ReporterPreferencesForPassingAssertionsIsRespected ${TESTS_DIR}/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp) +target_link_libraries(ReporterPreferencesForPassingAssertionsIsRespected PRIVATE Catch2::Catch2WithMain) +add_test( + NAME Reporters::PreferencesForPassingAssertionsIsRespected + COMMAND ReporterPreferencesForPassingAssertionsIsRespected + --reporter test-reporter +) +set_tests_properties( + Reporters::PreferencesForPassingAssertionsIsRespected + PROPERTIES + PASS_REGULAR_EXPRESSION "X26 - TestReporter constructed" + FAIL_REGULAR_EXPRESSION "X26 - assertionEnded" +) +add_test( + NAME MultiReporter::PreferencesForPassingAssertionsIsRespected + COMMAND ReporterPreferencesForPassingAssertionsIsRespected + --reporter test-reporter + --reporter console::out=${_NullFile} +) +set_tests_properties( + MultiReporter::PreferencesForPassingAssertionsIsRespected + PROPERTIES + PASS_REGULAR_EXPRESSION "X26 - TestReporter constructed" + FAIL_REGULAR_EXPRESSION "X26 - assertionEnded" +) + +add_executable(ListenersGetEventsBeforeReporters ${TESTS_DIR}/X28-ListenersGetEventsBeforeReporters.cpp) +target_link_libraries(ListenersGetEventsBeforeReporters PRIVATE Catch2::Catch2WithMain) +add_test( + NAME ListenersGetEventsBeforeReporters + COMMAND ListenersGetEventsBeforeReporters --reporter test-reporter +) +set_tests_properties( + ListenersGetEventsBeforeReporters + PROPERTIES + PASS_REGULAR_EXPRESSION "X28 - TestReporter constructed" + FAIL_REGULAR_EXPRESSION "X28 - ERROR" +) + +add_executable(CustomArgumentsForReporters ${TESTS_DIR}/X29-CustomArgumentsForReporters.cpp) +target_link_libraries(CustomArgumentsForReporters PRIVATE Catch2::Catch2WithMain) +add_test( + NAME CustomArgumentsForReporters + COMMAND CustomArgumentsForReporters + --reporter "test-reporter::Xa b=c 1::Xz:e = 1234" +) +set_tests_properties( + CustomArgumentsForReporters + PROPERTIES + PASS_REGULAR_EXPRESSION "Xa b=c 1::Xz:e = 1234" +) add_executable(DuplicatedTestCases-SameNameAndTags ${TESTS_DIR}/X31-DuplicatedTestCases.cpp) @@ -229,6 +433,20 @@ set_tests_properties( FAIL_REGULAR_EXPRESSION "error: .* already defined\\." ) + +add_executable(DuplicatedReporters ${TESTS_DIR}/X35-DuplicatedReporterNames.cpp) +target_link_libraries(DuplicatedReporters PRIVATE Catch2::Catch2WithMain) +add_test( + NAME Reporters::RegistrationErrorsAreCaught + COMMAND $<TARGET_FILE:DuplicatedReporters> +) +set_tests_properties( + Reporters::RegistrationErrorsAreCaught + PROPERTIES + PASS_REGULAR_EXPRESSION "Errors occurred during startup!" +) + + #add_executable(DebugBreakMacros ${TESTS_DIR}/X12-CustomDebugBreakMacro.cpp) #target_link_libraries(DebugBreakMacros Catch2) #add_test(NAME DebugBreakMacros COMMAND DebugBreakMacros --break) @@ -238,6 +456,25 @@ set_tests_properties( # PASS_REGULAR_EXPRESSION "Pretty please, break into debugger" #) +add_executable(NoTests ${TESTS_DIR}/X92-NoTests.cpp) +target_link_libraries(NoTests PRIVATE Catch2::Catch2WithMain) + +add_test( + NAME TestSpecs::EmptySpecWithNoTestsFails + COMMAND $<TARGET_FILE:NoTests> +) +set_tests_properties(TestSpecs::EmptySpecWithNoTestsFails + PROPERTIES + WILL_FAIL ON +) +add_test( + NAME TestSpecs::OverrideFailureWithEmptySpec + COMMAND $<TARGET_FILE:NoTests> --allow-running-no-tests +) +add_test( + NAME List::Listeners::WorksWithoutRegisteredListeners + COMMAND $<TARGET_FILE:NoTests> --list-listeners +) set( EXTRA_TEST_BINARIES PrefixedMacros DisabledMacros @@ -249,6 +486,8 @@ set( EXTRA_TEST_BINARIES DuplicatedTestCases-SameNameAndTags DuplicatedTestCases-SameNameDifferentTags DuplicatedTestCases-DuplicatedTestCaseMethods + NoTests + ListenersGetEventsBeforeReporters # DebugBreakMacros ) diff --git a/packages/Catch2/tests/ExtraTests/X01-PrefixedMacros.cpp b/packages/Catch2/tests/ExtraTests/X01-PrefixedMacros.cpp index 43452d766..65235194c 100644 --- a/packages/Catch2/tests/ExtraTests/X01-PrefixedMacros.cpp +++ b/packages/Catch2/tests/ExtraTests/X01-PrefixedMacros.cpp @@ -1,7 +1,18 @@ -// X01-DisableStringification.cpp -// Test that Catch's prefixed macros compile and run properly. -// This won't provide full coverage, but it might be worth checking -// the other branch as well + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that Catch's prefixed macros compile and run properly. + * + * We intentionally do not provide full coverage of all macros, but we + * test a smattering and can add other ones as they have regressions. + */ + #include <catch2/catch_test_macros.hpp> #include <catch2/matchers/catch_matchers_predicate.hpp> @@ -55,6 +66,7 @@ CATCH_TEST_CASE("PrefixedMacros") { CATCH_SECTION("some section") { int i = 1; CATCH_CAPTURE( i ); + CATCH_CAPTURE( i, i + 1 ); CATCH_DYNAMIC_SECTION("Dynamic section: " << i) { CATCH_FAIL_CHECK( "failure" ); } @@ -62,6 +74,8 @@ CATCH_TEST_CASE("PrefixedMacros") { CATCH_STATIC_REQUIRE( std::is_void<void>::value ); CATCH_STATIC_REQUIRE_FALSE( std::is_void<int>::value ); + CATCH_STATIC_CHECK( std::is_void<void>::value ); + CATCH_STATIC_CHECK_FALSE( std::is_void<int>::value ); CATCH_FAIL(""); } diff --git a/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp b/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp index c2d997c9c..37d35e11c 100644 --- a/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp +++ b/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp @@ -1,8 +1,21 @@ -// X02-DisabledMacros.cpp -// Test that CATCH_CONFIG_DISABLE turns off TEST_CASE autoregistration -// and expressions in assertion macros are not run. + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that CATCH_CONFIG_DISABLE turns off TEST_CASE autoregistration + * and expressions in assertion macros are not run. + */ + #include <catch2/catch_test_macros.hpp> +#include <catch2/benchmark/catch_benchmark.hpp> +#include <catch2/matchers/catch_matchers.hpp> +#include <catch2/matchers/catch_matchers_predicate.hpp> #include <iostream> @@ -20,7 +33,7 @@ struct foo { #pragma clang diagnostic ignored "-Wglobal-constructors" #endif // Construct foo, but `foo::print` should not be run -foo f; +static foo f; #if defined(__clang__) @@ -30,8 +43,21 @@ foo f; // This test should not be run, because it won't be registered TEST_CASE( "Disabled Macros" ) { + CHECK( 1 == 2 ); + REQUIRE( 1 == 2 ); std::cout << "This should not happen\n"; FAIL(); + + // Test that static assertions don't fire when macros are disabled + STATIC_CHECK( 0 == 1 ); + STATIC_REQUIRE( !true ); + + CAPTURE( 1 ); + CAPTURE( 1, "captured" ); + + REQUIRE_THAT( 1, + Catch::Matchers::Predicate( []( int ) { return false; } ) ); + BENCHMARK( "Disabled benchmark" ) { REQUIRE( 1 == 2 ); }; } #if defined(__clang__) diff --git a/packages/Catch2/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp b/packages/Catch2/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp index c981fa0bb..74b651c75 100644 --- a/packages/Catch2/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp +++ b/packages/Catch2/tests/ExtraTests/X03-DisabledExceptions-DefaultHandler.cpp @@ -1,4 +1,15 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> +#include <catch2/benchmark/catch_benchmark.hpp> +#include <catch2/matchers/catch_matchers.hpp> +#include <catch2/matchers/catch_matchers_predicate.hpp> TEST_CASE("Tests that run") { // All of these should be run and be reported @@ -20,3 +31,9 @@ TEST_CASE("Tests that abort") { // We should not get here, because the test above aborts REQUIRE(1 != 4); } + +TEST_CASE( "Misc. macros to check that they compile without exceptions" ) { + BENCHMARK( "simple benchmark" ) { return 1 * 2 + 3; }; + REQUIRE_THAT( 1, + Catch::Matchers::Predicate<int>( []( int i ) { return i == 1; } ) ); +} diff --git a/packages/Catch2/tests/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp b/packages/Catch2/tests/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp index ae698165e..725440ec3 100644 --- a/packages/Catch2/tests/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp +++ b/packages/Catch2/tests/ExtraTests/X04-DisabledExceptions-CustomHandler.cpp @@ -1,10 +1,20 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> +#include <iostream> + 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'; + std::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); diff --git a/packages/Catch2/tests/ExtraTests/X05-DeferredStaticChecks.cpp b/packages/Catch2/tests/ExtraTests/X05-DeferredStaticChecks.cpp new file mode 100644 index 000000000..62ceb4a77 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X05-DeferredStaticChecks.cpp @@ -0,0 +1,21 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Checks that when `STATIC_CHECK` is deferred to runtime and fails, it + * does not abort the test case. + */ + +#include <catch2/catch_test_macros.hpp> + +TEST_CASE("Deferred static checks") { + STATIC_CHECK(1 == 2); + STATIC_CHECK_FALSE(1 != 2); + // This last assertion must be executed too + CHECK(1 == 2); +} diff --git a/packages/Catch2/tests/ExtraTests/X10-FallbackStringifier.cpp b/packages/Catch2/tests/ExtraTests/X10-FallbackStringifier.cpp index af31047b4..61ad62ea1 100644 --- a/packages/Catch2/tests/ExtraTests/X10-FallbackStringifier.cpp +++ b/packages/Catch2/tests/ExtraTests/X10-FallbackStringifier.cpp @@ -1,5 +1,18 @@ -// X10-FallbackStringifier.cpp -// Test that defining fallbackStringifier compiles + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that the user can define custom fallbackStringifier + * + * This is done by defining a custom fallback stringifier that prints + * out a specific string, and then asserting (to cause stringification) + * over a type without stringification support. + */ #include <string> diff --git a/packages/Catch2/tests/ExtraTests/X11-DisableStringification.cpp b/packages/Catch2/tests/ExtraTests/X11-DisableStringification.cpp index b127d246a..97dcea7b6 100644 --- a/packages/Catch2/tests/ExtraTests/X11-DisableStringification.cpp +++ b/packages/Catch2/tests/ExtraTests/X11-DisableStringification.cpp @@ -1,8 +1,18 @@ -// 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 :-) + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that stringification of original expression can be disabled. + * + * This is a workaround for VS 2017, 2019 issue with Raw String literals + * and preprocessor token pasting. + */ + #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/ExtraTests/X12-CustomDebugBreakMacro.cpp b/packages/Catch2/tests/ExtraTests/X12-CustomDebugBreakMacro.cpp index 25ab4a0ec..e52c1c2b6 100644 --- a/packages/Catch2/tests/ExtraTests/X12-CustomDebugBreakMacro.cpp +++ b/packages/Catch2/tests/ExtraTests/X12-CustomDebugBreakMacro.cpp @@ -1,5 +1,14 @@ -// X12-CustomDebugBreakMacro.cpp -// Test that user-defined `CATCH_BREAK_INTO_DEBUGGER` is respected and used. + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that user-defined `CATCH_BREAK_INTO_DEBUGGER` is respected and used. + */ #include <iostream> diff --git a/packages/Catch2/tests/ExtraTests/X21-PartialTestCaseEvents.cpp b/packages/Catch2/tests/ExtraTests/X21-PartialTestCaseEvents.cpp index 997b9b9f3..686b50b1d 100644 --- a/packages/Catch2/tests/ExtraTests/X21-PartialTestCaseEvents.cpp +++ b/packages/Catch2/tests/ExtraTests/X21-PartialTestCaseEvents.cpp @@ -18,7 +18,7 @@ #include <catch2/catch_test_macros.hpp> #include <catch2/reporters/catch_reporter_streaming_base.hpp> #include <catch2/catch_test_case_info.hpp> -#include <catch2/catch_reporter_registrars.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> #include <catch2/generators/catch_generators.hpp> diff --git a/packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp b/packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp new file mode 100644 index 000000000..c75d891e5 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp @@ -0,0 +1,79 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that the cumulative reporter base stores both assertions and + * benchmarks, and stores them in the right order. + * + * This is done through a custom reporter that writes out the assertions + * and benchmarks and checking that the output is in right order. + */ + +#include <catch2/catch_test_macros.hpp> +#include <catch2/benchmark/catch_benchmark.hpp> +#include <catch2/reporters/catch_reporter_cumulative_base.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <iostream> +#include <utility> + +class CumulativeBenchmarkReporter final : public Catch::CumulativeReporterBase { + +public: + CumulativeBenchmarkReporter(Catch::ReporterConfig&& _config) : + CumulativeReporterBase(std::move(_config)) { + m_preferences.shouldReportAllAssertions = true; + } + + static std::string getDescription() { + return "Custom reporter for testing cumulative reporter base"; + } + + virtual void testRunEndedCumulative() override; +}; + +CATCH_REGISTER_REPORTER("testReporter", CumulativeBenchmarkReporter) + +#include <chrono> +#include <thread> + +TEST_CASE("Some assertions and benchmarks") { + using namespace std::chrono_literals; + + REQUIRE(1); + BENCHMARK("2") { + std::this_thread::sleep_for(1ms); + }; + REQUIRE(3); + BENCHMARK("4") { + std::this_thread::sleep_for(1ms); + }; + REQUIRE(5); +} + +void CumulativeBenchmarkReporter::testRunEndedCumulative() { + auto const& testCases = m_testRun->children; + assert(testCases.size() == 1); + + auto const& testCase = *testCases.front(); + auto const& sections = testCase.children; + assert(sections.size() == 1); + + auto const& section = *sections.front(); + assert(section.childSections.empty()); + for (auto const& aob : section.assertionsAndBenchmarks) { + if (aob.isAssertion()) { + auto const& assertion = aob.asAssertion(); + std::cout << assertion.assertionResult.getExpandedExpression() << '\n'; + } + if (aob.isBenchmark()) { + auto const& bench = aob.asBenchmark(); + std::cout << bench.info.name << '\n'; + } + } +} diff --git a/packages/Catch2/tests/ExtraTests/X23-CasingInReporterNames.cpp b/packages/Catch2/tests/ExtraTests/X23-CasingInReporterNames.cpp new file mode 100644 index 000000000..0e13f205b --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X23-CasingInReporterNames.cpp @@ -0,0 +1,41 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that reporter registration is case-preserving, selection is + * case-insensitive. + * + * This is done by registering a custom reporter that prints out a marker + * string upon construction and then invoking the binary with different + * casings of the name. + */ + +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <iostream> +#include <utility> + +class TestReporter : public Catch::StreamingReporterBase { +public: + TestReporter(Catch::ReporterConfig&& _config): + StreamingReporterBase(std::move(_config)) { + std::cout << "TestReporter constructed\n"; + } + + static std::string getDescription() { + return "Reporter for testing casing handling in reporter registration/selection"; + } + + ~TestReporter() override; +}; + +TestReporter::~TestReporter() = default; + +CATCH_REGISTER_REPORTER("testReporterCASED", TestReporter) + diff --git a/packages/Catch2/tests/ExtraTests/X24-ListenerStdoutCaptureInMultireporter.cpp b/packages/Catch2/tests/ExtraTests/X24-ListenerStdoutCaptureInMultireporter.cpp new file mode 100644 index 000000000..605458515 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X24-ListenerStdoutCaptureInMultireporter.cpp @@ -0,0 +1,40 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Registers custom listener that does not ask for captured stdout/err + * + * Running the binary with this listener, and asking for multiple _capturing_ + * reporters (one would be sufficient, but that would also mean depending on + * implementation details inside Catch2's handling of listeners), we check that + * nothing is written to stdout, because listeners should not be considered in + * whether the stdout should be passed-through or not. + */ + +#include <catch2/catch_test_macros.hpp> +#include <catch2/reporters/catch_reporter_event_listener.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <iostream> + +namespace { + class NonCapturingListener : public Catch::EventListenerBase { + public: + NonCapturingListener( Catch::IConfig const* config ): + EventListenerBase( config ) { + m_preferences.shouldRedirectStdOut = false; + std::cerr << "X24 - NonCapturingListener initialized.\n"; + } + }; +} + +CATCH_REGISTER_LISTENER( NonCapturingListener ) + +TEST_CASE( "Writes to stdout" ) { + std::cout << "X24 - FooBarBaz\n"; +} diff --git a/packages/Catch2/tests/ExtraTests/X25-ListenerCanAskForCapturedStdout.cpp b/packages/Catch2/tests/ExtraTests/X25-ListenerCanAskForCapturedStdout.cpp new file mode 100644 index 000000000..a4a55ad75 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X25-ListenerCanAskForCapturedStdout.cpp @@ -0,0 +1,47 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Registers custom listener that asks for captured stdout/err + * + * Running the binary with this listener, and asking for multiple _noncapturing_ + * reporters (one would be sufficient, but that would also mean depending on + * implementation details inside Catch2's handling of listeners), we check that + * the listener gets redirected stdout, even though the reporters didn't ask for + * it. + */ + +#include <catch2/catch_test_macros.hpp> +#include <catch2/reporters/catch_reporter_event_listener.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <iostream> + +namespace { + class CapturingListener : public Catch::EventListenerBase { + public: + CapturingListener( Catch::IConfig const* config ): + EventListenerBase( config ) { + m_preferences.shouldRedirectStdOut = true; + std::cerr << "CapturingListener initialized\n"; + } + + void + testCaseEnded( Catch::TestCaseStats const& testCaseStats ) override { + if ( testCaseStats.stdOut.empty() ) { + std::cerr << "X25 - ERROR: empty stdout\n"; + } + } + }; +} + +CATCH_REGISTER_LISTENER( CapturingListener ) + +TEST_CASE( "Writes to stdout" ) { + std::cout << "X25 - FooBarBaz\n"; +} diff --git a/packages/Catch2/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp b/packages/Catch2/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp new file mode 100644 index 000000000..01aca7c0c --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp @@ -0,0 +1,52 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that reporter is not passed passing assertions when it + * doesn't ask for it. + */ + +#include <catch2/catch_test_macros.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <iostream> +#include <utility> + +namespace { + + class TestReporter : public Catch::StreamingReporterBase { + public: + TestReporter(Catch::ReporterConfig&& _config): + StreamingReporterBase(std::move(_config)) { + m_preferences.shouldReportAllAssertions = false; + std::cout << "X26 - TestReporter constructed\n"; + } + + static std::string getDescription() { + return "X26 - test reporter that opts out of passing assertions"; + } + + void + assertionEnded( Catch::AssertionStats const& ) override { + std::cerr << "X26 - assertionEnded\n"; + } + + ~TestReporter() override; + }; + + TestReporter::~TestReporter() = default; + +} + +CATCH_REGISTER_REPORTER("test-reporter", TestReporter) + +TEST_CASE( "Test with only passing assertions" ) { + REQUIRE( 1 == 1 ); + REQUIRE( 2 == 2 ); +} diff --git a/packages/Catch2/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp b/packages/Catch2/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp new file mode 100644 index 000000000..cb29be0c1 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp @@ -0,0 +1,82 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that the captured stdout/err in (partial) testCaseEnded events + * is correct (e.g. that the partial test case event does not get accumulated + * output). + * + * This is done by having a single test case that is entered multiple + * times through generator, and a custom capturing reporter that knows + * what it should expect captured from the test case. + */ + + +#include <catch2/catch_test_macros.hpp> +#include <catch2/generators/catch_generators.hpp> +#include <catch2/generators/catch_generators_range.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + + +#include <iostream> +#include <string> +#include <utility> + +class TestReporter : public Catch::StreamingReporterBase { + std::string stdOutString( uint64_t iter ){ + return "stdout " + std::to_string( iter ) + '\n'; + } + std::string stdErrString(uint64_t iter) { + return "stderr " + std::to_string( iter ) + '\n'; + } + +public: + TestReporter( Catch::ReporterConfig&& _config ): + StreamingReporterBase( std::move(_config) ) { + m_preferences.shouldRedirectStdOut = true; + std::cout << "X27 - TestReporter constructed\n"; + } + + static std::string getDescription() { + return "X27 test reporter"; + } + + void testCasePartialEnded( Catch::TestCaseStats const& stats, + uint64_t iter ) override { + if ( stats.stdOut != stdOutString( iter ) ) { + std::cerr << "X27 ERROR in partial stdout\n" << stats.stdOut; + } + if ( stats.stdErr != stdErrString( iter ) ) { + std::cerr << "X27 ERROR in partial stderr\n" << stats.stdErr; + } + } + + void testCaseEnded( Catch::TestCaseStats const& stats ) override { + if ( stats.stdOut != "stdout 0\nstdout 1\nstdout 2\nstdout 3\nstdout 4\nstdout 5\n" ) { + std::cerr << "X27 ERROR in full stdout\n" << stats.stdOut; + } + if ( stats.stdErr != "stderr 0\nstderr 1\nstderr 2\nstderr 3\nstderr 4\nstderr 5\n" ) { + std::cerr << "X27 ERROR in full stderr\n" << stats.stdErr; + } + } + + ~TestReporter() override; +}; + +TestReporter::~TestReporter() = default; + +CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) + +TEST_CASE( "repeatedly entered test case" ) { + auto i = GENERATE( range(0, 6) ); + std::cout << "stdout " << i << '\n'; + // Switch between writing to std::cerr and std::clog just to make sure + // both are properly captured and redirected. + ( ( i % 2 == 0 ) ? std::cerr : std::clog ) << "stderr " << i << '\n'; +} diff --git a/packages/Catch2/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp b/packages/Catch2/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp new file mode 100644 index 000000000..c8102edb2 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp @@ -0,0 +1,99 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that the different events are sent to listeners before they are + * sent to the reporters. + * + * We only do this for a subset of the events, as doing all of them would + * be annoying, and we can assume that their implementation is roughly + * the same, and thus if few work, all work. + */ + +#include <catch2/catch_test_macros.hpp> +#include <catch2/reporters/catch_reporter_event_listener.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> + +#include <iostream> +#include <utility> + +namespace { + + static bool testRunStartingReceivedByListener = false; + static bool testRunEndedReceivedByListener = false; + static bool assertionStartingReceivedByListener = false; + static bool assertionEndedReceivedByListener = false; + + class TestListener : public Catch::EventListenerBase { + public: + TestListener( Catch::IConfig const* config ): + EventListenerBase( config ) { + std::cout << "X28 - TestListener constructed.\n"; + } + + void testRunStarting( Catch::TestRunInfo const& ) override { + testRunStartingReceivedByListener = true; + } + + void testRunEnded( Catch::TestRunStats const& ) override { + testRunEndedReceivedByListener = true; + } + + void assertionStarting( Catch::AssertionInfo const& ) override { + assertionStartingReceivedByListener = true; + } + + void assertionEnded( Catch::AssertionStats const& ) override { + assertionEndedReceivedByListener = true; + } + }; + + class TestReporter : public Catch::StreamingReporterBase { + public: + TestReporter( Catch::ReporterConfig&& _config ): + StreamingReporterBase( std::move(_config) ) { + std::cout << "X28 - TestReporter constructed\n"; + } + + void testRunStarting( Catch::TestRunInfo const& ) override { + if ( !testRunStartingReceivedByListener ) { + std::cout << "X28 - ERROR\n"; + } + } + + void testRunEnded( Catch::TestRunStats const& ) override { + if ( !testRunEndedReceivedByListener ) { + std::cout << "X28 - ERROR\n"; + } + } + + void assertionStarting( Catch::AssertionInfo const& ) override { + if ( !assertionStartingReceivedByListener ) { + std::cout << "X28 - ERROR\n"; + } + } + + void assertionEnded( Catch::AssertionStats const& ) override { + if ( !assertionEndedReceivedByListener ) { + std::cout << "X28 - ERROR\n"; + } + } + + static std::string getDescription() { return "X28 test reporter"; } + ~TestReporter() override; + }; + + TestReporter::~TestReporter() = default; + +} // end unnamed namespace + +CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) +CATCH_REGISTER_LISTENER( TestListener ) + +TEST_CASE( "Dummy test case" ) { REQUIRE( 1 == 1 ); } diff --git a/packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp b/packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp new file mode 100644 index 000000000..d3af7dc75 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp @@ -0,0 +1,59 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that custom options are properly passed down to the reporter. + * + * We print out the arguments sorted by key, to have a stable expected + * output. + */ + +#include <catch2/catch_test_macros.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <algorithm> +#include <iostream> +#include <string> +#include <utility> +#include <vector> + +class TestReporter : public Catch::StreamingReporterBase { +public: + TestReporter( Catch::ReporterConfig&& _config ): + StreamingReporterBase( std::move(_config) ) { + std::cout << "X29 - TestReporter constructed\n"; + } + + static std::string getDescription() { + return "X29 test reporter"; + } + + void testRunStarting( Catch::TestRunInfo const& ) override { + std::vector<std::pair<std::string, std::string>> options; + for ( auto const& kv : m_customOptions ) { + options.push_back( kv ); + } + std::sort( options.begin(), options.end() ); + bool first = true; + for ( auto const& kv : options ) { + if ( !first ) { std::cout << "::"; } + std::cout << kv.first << "=" << kv.second; + first = false; + } + std::cout << '\n'; + } + + ~TestReporter() override; +}; + +TestReporter::~TestReporter() = default; + +CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) + +TEST_CASE( "Just a test case to run things" ) {} diff --git a/packages/Catch2/tests/ExtraTests/X30-BazelReporter.cpp b/packages/Catch2/tests/ExtraTests/X30-BazelReporter.cpp new file mode 100644 index 000000000..6a6168dbe --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X30-BazelReporter.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test the Bazel report functionality with a simple set + * of dummy test cases. + */ + +#include <catch2/catch_test_macros.hpp> + +TEST_CASE( "Passing test case" ) { REQUIRE( 1 == 1 ); } +TEST_CASE( "Failing test case" ) { REQUIRE( 2 == 1 ); } diff --git a/packages/Catch2/tests/ExtraTests/X35-DuplicatedReporterNames.cpp b/packages/Catch2/tests/ExtraTests/X35-DuplicatedReporterNames.cpp new file mode 100644 index 000000000..cc0dd0b97 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X35-DuplicatedReporterNames.cpp @@ -0,0 +1,31 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Checks that reporter registration errors are caught and handled as + * startup errors, by causing a registration error by registering multiple + * reporters with the same name. + */ + +#include <catch2/catch_test_macros.hpp> + +#include <catch2/reporters/catch_reporter_registrars.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> + +namespace { + //! Trivial custom reporter for registration + class TestReporter : public Catch::StreamingReporterBase { + public: + using StreamingReporterBase::StreamingReporterBase; + + static std::string getDescription() { return "X35 test reporter"; } + }; +} + +CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) +CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) diff --git a/packages/Catch2/tests/ExtraTests/X90-WindowsHeaderInclusion.cpp b/packages/Catch2/tests/ExtraTests/X90-WindowsHeaderInclusion.cpp index 307e877f2..739b34d40 100644 --- a/packages/Catch2/tests/ExtraTests/X90-WindowsHeaderInclusion.cpp +++ b/packages/Catch2/tests/ExtraTests/X90-WindowsHeaderInclusion.cpp @@ -1,7 +1,17 @@ -// 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. + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * 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> #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp b/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp index e3b31f9b2..d77f55d5b 100644 --- a/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp +++ b/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp @@ -1,5 +1,12 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + /**\file - * * This file serves as a simple compilation test against the amalgamated * version of Catch2. */ diff --git a/packages/Catch2/tests/ExtraTests/X92-NoTests.cpp b/packages/Catch2/tests/ExtraTests/X92-NoTests.cpp new file mode 100644 index 000000000..fc6bf597a --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X92-NoTests.cpp @@ -0,0 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Links into executable with no tests which should fail when run + */ diff --git a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt index 5d599b6ef..b8b595660 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -1,5 +1,4 @@ :test-result: PASS # A test name that starts with a # -:test-result: PASS #1005: Comparing pointer to int and long (NULL can be either on various systems) :test-result: PASS #1027: Bitfields can be captured :test-result: PASS #1147 :test-result: PASS #1175 - Hidden Test @@ -29,7 +28,7 @@ Nor would this :test-result: XFAIL #748 - captures with unexpected exceptions :test-result: PASS #809 :test-result: PASS #833 -:test-result: XFAIL #835 -- errno should not be touched by Catch +:test-result: XFAIL #835 -- errno should not be touched by Catch2 :test-result: PASS #872 :test-result: PASS #961 -- Dynamically created sections should all be reported :test-result: FAIL 'Not' checks that should fail @@ -100,8 +99,12 @@ Nor would this :test-result: PASS CAPTURE can deal with complex expressions involving commas :test-result: PASS CAPTURE parses string and character constants :test-result: PASS Capture and info messages +:test-result: PASS CaseInsensitiveEqualsTo is case insensitive +:test-result: PASS CaseInsensitiveLess is case insensitive :test-result: PASS Character pretty printing :test-result: PASS Clara::Arg supports single-arg parse the way Opt does +:test-result: PASS Clara::Opt supports accept-many lambdas +:test-result: PASS ColourGuard behaviour :test-result: PASS Combining MatchAllOfGeneric does not nest :test-result: PASS Combining MatchAnyOfGeneric does not nest :test-result: PASS Combining MatchNotOfGeneric does not nest @@ -120,11 +123,14 @@ Nor would this :test-result: PASS Composed matchers shortcircuit :test-result: FAIL Contains string matcher :test-result: PASS Copy and then generate a range +:test-result: PASS Cout stream properly declares it writes to stdout :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 Default scale is invisible to comparison :test-result: PASS Directly creating an EnumInfo +:test-result: PASS Empty stream name opens cout stream +:test-result: PASS Empty tag is not allowed :test-result: FAIL EndsWith string matcher :test-result: PASS Enums can quickly have stringification enabled using REGISTER_ENUM :test-result: PASS Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM @@ -149,6 +155,10 @@ Nor would this :test-result: PASS Generators -- simple :test-result: PASS Generators internals :test-result: PASS Greater-than inequalities with different epsilons +:test-result: PASS Hashers with different seed produce different hash with same test case +:test-result: PASS Hashers with same seed produce same hash +:test-result: PASS Hashing different test cases produces different result +:test-result: PASS Hashing test case produces same hash across multiple calls :test-result: FAIL 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 @@ -164,7 +174,10 @@ Nor would this :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: XFAIL Mayfail test case with nested sections :test-result: FAIL Mismatching exception messages failing the test +:test-result: PASS Multireporter calls reporters and listeners in correct order +:test-result: PASS Multireporter updates ReporterPreferences properly :test-result: PASS Nested generators and captured variables :test-result: FAIL Nice descriptive name :test-result: FAIL Non-std exceptions can be translated @@ -176,6 +189,10 @@ Nor would this :test-result: FAIL Output from all sections is reported :test-result: PASS Overloaded comma or address-of operators are not used :test-result: PASS Parse test names and tags +:test-result: PASS Parsed tags are matched case insensitive +:test-result: PASS Parsing sharding-related cli flags +:test-result: PASS Parsing tags with non-alphabetical characters is pass-through +:test-result: PASS Parsing warnings :test-result: PASS Pointers can be compared to null :test-result: PASS Precision of floating point stringification can be set :test-result: PASS Predicate matcher can accept const char* @@ -183,11 +200,15 @@ Nor would this :test-result: PASS Product with differing arities - std::tuple<int, double, float> :test-result: PASS Product with differing arities - std::tuple<int, double> :test-result: PASS Product with differing arities - std::tuple<int> +:test-result: PASS Random seed generation accepts known methods +:test-result: PASS Random seed generation reports unknown methods :test-result: PASS Range type with sentinel :test-result: FAIL Reconstruction should be based on stringification: #914 :test-result: FAIL Regex string matcher +:test-result: PASS Registering reporter with '::' in name fails :test-result: PASS Regression test #1 :test-result: PASS Reporter's write listings to provided stream +:test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla :test-result: PASS SUCCEED counts as a test pass :test-result: PASS SUCCEED does not require an argument :test-result: PASS Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods @@ -215,6 +236,7 @@ Message from section two :test-result: PASS Stringifying std::chrono::time_point<system_clock> :test-result: FAIL Tabs and newlines show in output :test-result: PASS Tag alias can be registered against tag patterns +:test-result: PASS Tags with spaces and non-alphanumerical characters are accepted :test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 0 :test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 1 :test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 2 @@ -233,6 +255,7 @@ Message from section two :test-result: PASS TemplateTestSig: vectors can be sized and resized - float,4 :test-result: PASS TemplateTestSig: vectors can be sized and resized - int,5 :test-result: PASS TemplateTestSig: vectors can be sized and resized - std::string,15 +:test-result: PASS Test case with identical tags keeps just one :test-result: PASS Test case with one argument :test-result: PASS Test enum bit values :test-result: PASS Test with special, characters "in name @@ -248,8 +271,11 @@ Message from section two :test-result: FAIL Unexpected exceptions can be translated :test-result: PASS Upcasting special member functions :test-result: PASS Usage of AllMatch range matcher +:test-result: PASS Usage of AllTrue range matcher :test-result: PASS Usage of AnyMatch range matcher +:test-result: PASS Usage of AnyTrue range matcher :test-result: PASS Usage of NoneMatch range matcher +:test-result: PASS Usage of NoneTrue range matcher :test-result: PASS Usage of the SizeIs range matcher :test-result: PASS Use a custom approx :test-result: PASS Variadic macros @@ -264,8 +290,6 @@ Message from section two :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: FAIL When unchecked exceptions are thrown, but caught, they do not affect the test -:test-result: FAIL Where the LHS is not a simple value -:test-result: FAIL 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 @@ -274,7 +298,6 @@ Message from section two :test-result: PASS XmlWriter writes boolean attributes as true/false :test-result: PASS analyse no analysis :test-result: PASS array<int, N> -> toString -:test-result: PASS atomic if :test-result: PASS benchmark function call :test-result: PASS boolean member :test-result: PASS checkedElse @@ -292,6 +315,7 @@ Message from section two :test-result: FAIL first tag loose text artifact :test-result: FAIL has printf +:test-result: PASS is_unary_function :test-result: FAIL just failure :test-result: FAIL just failure after unscoped info :test-result: FAIL just info @@ -299,6 +323,7 @@ loose text artifact :test-result: PASS long long :test-result: FAIL looped SECTION tests :test-result: FAIL looped tests +:test-result: PASS makeStream recognizes %debug stream name :test-result: PASS make_unique reimplementation :test-result: PASS mean :test-result: PASS measure @@ -321,6 +346,7 @@ loose text artifact :test-result: FAIL prints unscoped info only for the first assertion :test-result: PASS random SECTION tests :test-result: PASS replaceInPlace +:test-result: PASS request an unknown %-starting stream fails :test-result: PASS resolution :test-result: PASS run_for_at_least, chronometer :test-result: PASS run_for_at_least, int @@ -330,12 +356,13 @@ loose text artifact :test-result: PASS shortened hide tags are split apart :test-result: PASS splitString :test-result: FAIL stacks unscoped info in loops +:test-result: PASS startsWith :test-result: PASS std::map is convertible string :test-result: PASS std::pair<int,const std::string> -> toString :test-result: PASS std::pair<int,std::string> -> toString :test-result: PASS std::set is convertible string :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 stdout and stderr streams have %-starting name :test-result: PASS stringify ranges :test-result: PASS stringify( has_maker ) :test-result: PASS stringify( has_maker_and_operator ) @@ -360,7 +387,6 @@ loose text artifact :test-result: PASS tuple<> :test-result: PASS tuple<float,int> :test-result: PASS tuple<int> -:test-result: PASS tuple<0,int,const char *> :test-result: PASS tuple<string,string> :test-result: PASS tuple<tuple<int>,tuple<>,float> :test-result: PASS uniform samples diff --git a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt new file mode 100644 index 000000000..2afd308bc --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt @@ -0,0 +1,394 @@ +:test-result: PASS # A test name that starts with a # +:test-result: PASS #1027: Bitfields can be captured +:test-result: PASS #1147 +:test-result: PASS #1175 - Hidden Test +:test-result: PASS #1238 +:test-result: PASS #1245 +:test-result: PASS #1319: Sections can have description (even if it is not saved +:test-result: PASS #1403 +:test-result: FAIL #1455 - INFO and WARN can start with a linebreak +:test-result: FAIL #1514: stderr/stdout is not captured in tests aborted by an exception +:test-result: PASS #1548 +:test-result: PASS #1905 -- test spec parser properly clears internal state between compound tests +:test-result: PASS #1912 -- test spec parser handles escaping +:test-result: PASS #1913 - GENERATE inside a for loop should not keep recreating the generator +:test-result: PASS #1913 - GENERATEs can share a line +:test-result: PASS #1938 - GENERATE after a section +:test-result: PASS #1938 - Section followed by flat generate +:test-result: PASS #1938 - flat generate +:test-result: PASS #1938 - mixed sections and generates +:test-result: PASS #1938 - nested generate +:test-result: PASS #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 +:test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0 +:test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0 +:test-result: PASS #2152 - ULP checks between differently signed values were wrong - double +:test-result: PASS #2152 - ULP checks between differently signed values were wrong - float +:test-result: XFAIL #748 - captures with unexpected exceptions +:test-result: PASS #809 +:test-result: PASS #833 +:test-result: XFAIL #835 -- errno should not be touched by Catch2 +:test-result: PASS #872 +:test-result: PASS #961 -- Dynamically created sections should all be reported +: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: PASS 3x3x3 ints +: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 TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float> +:test-result: FAIL A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int> +:test-result: FAIL A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float> +:test-result: FAIL A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int> +:test-result: FAIL A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6> +:test-result: FAIL A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<int, 2> +:test-result: FAIL A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6> +:test-result: FAIL A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<float,6> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6> +:test-result: PASS A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2> +:test-result: FAIL A TEMPLATE_TEST_CASE_METHOD based test run that fails - double +:test-result: FAIL A TEMPLATE_TEST_CASE_METHOD based test run that fails - float +:test-result: FAIL A TEMPLATE_TEST_CASE_METHOD based test run that fails - int +:test-result: PASS A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double +:test-result: PASS A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float +:test-result: PASS A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int +:test-result: FAIL A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1 +:test-result: FAIL A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3 +:test-result: FAIL A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6 +:test-result: PASS A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1 +:test-result: PASS A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3 +:test-result: PASS A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6 +: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: PASS A Template product test case - Foo<float> +:test-result: PASS A Template product test case - Foo<int> +:test-result: PASS A Template product test case - std::vector<float> +:test-result: PASS A Template product test case - std::vector<int> +:test-result: PASS A Template product test case with array signature - Bar<float, 42> +:test-result: PASS A Template product test case with array signature - Bar<int, 9> +:test-result: PASS A Template product test case with array signature - std::array<float, 42> +:test-result: PASS A Template product test case with array signature - std::array<int, 9> +:test-result: PASS A comparison that uses literals instead of the normal constructor +: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 Absolute margin +:test-result: FAIL 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 Approx setters validate their arguments +:test-result: PASS Approx with exactly-representable margin +: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 Arbitrary predicate matcher +:test-result: PASS Assertion macros support bit operators and bool conversions +:test-result: PASS Assertions then sections +:test-result: PASS Basic use of the Contains range matcher +:test-result: PASS Basic use of the Empty range matcher +:test-result: PASS CAPTURE can deal with complex expressions +:test-result: PASS CAPTURE can deal with complex expressions involving commas +:test-result: PASS CAPTURE parses string and character constants +:test-result: PASS Capture and info messages +:test-result: PASS CaseInsensitiveEqualsTo is case insensitive +:test-result: PASS CaseInsensitiveLess is case insensitive +:test-result: PASS Character pretty printing +:test-result: PASS Clara::Arg supports single-arg parse the way Opt does +:test-result: PASS Clara::Opt supports accept-many lambdas +:test-result: PASS ColourGuard behaviour +:test-result: PASS Combining MatchAllOfGeneric does not nest +:test-result: PASS Combining MatchAnyOfGeneric does not nest +:test-result: PASS Combining MatchNotOfGeneric does not nest +:test-result: PASS Combining concrete matchers does not use templated matchers +:test-result: PASS Combining only templated matchers +:test-result: PASS Combining templated and concrete matchers +:test-result: PASS Combining templated matchers +:test-result: PASS Commas in various macros are allowed +:test-result: PASS Comparing function pointers +:test-result: PASS Comparison ops +:test-result: PASS Comparison with explicitly convertible types +: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: PASS Composed generic matchers shortcircuit +:test-result: PASS Composed matchers shortcircuit +:test-result: FAIL Contains string matcher +:test-result: PASS Copy and then generate a range +:test-result: PASS Cout stream properly declares it writes to stdout +: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 Default scale is invisible to comparison +:test-result: PASS Directly creating an EnumInfo +:test-result: PASS Empty stream name opens cout stream +:test-result: PASS Empty tag is not allowed +:test-result: FAIL EndsWith string matcher +:test-result: PASS Enums can quickly have stringification enabled using REGISTER_ENUM +:test-result: PASS Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM +:test-result: PASS Epsilon only applies to Approx's value +: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 as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified +:test-result: FAIL Exception matchers that fail +:test-result: PASS Exception matchers that succeed +:test-result: PASS Exception messages can be tested for +:test-result: PASS Exceptions matchers +: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: FAIL FAIL_CHECK does not abort the test +:test-result: PASS Factorials are computed +:test-result: PASS Floating point matchers: double +:test-result: PASS Floating point matchers: float +:test-result: PASS Generators -- adapters +:test-result: PASS Generators -- simple +:test-result: PASS Generators internals +:test-result: PASS Greater-than inequalities with different epsilons +:test-result: PASS Hashers with different seed produce different hash with same test case +:test-result: PASS Hashers with same seed produce same hash +:test-result: PASS Hashing different test cases produces different result +:test-result: PASS Hashing test case produces same hash across multiple calls +:test-result: FAIL 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: FAIL INFO is reset for each loop +:test-result: XFAIL Inequality checks that should fail +:test-result: PASS Inequality checks that should succeed +:test-result: PASS Lambdas in assertions +:test-result: PASS Less-than inequalities with different epsilons +: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: XFAIL Mayfail test case with nested sections +:test-result: FAIL Mismatching exception messages failing the test +:test-result: PASS Multireporter calls reporters and listeners in correct order +:test-result: PASS Multireporter updates ReporterPreferences properly +:test-result: PASS Nested generators and captured variables +:test-result: FAIL Nice descriptive name +:test-result: FAIL Non-std exceptions can be translated +:test-result: PASS Objects that evaluated in boolean contexts can be checked +:test-result: PASS Optionally static assertions +:test-result: FAIL Ordering comparison checks that should fail +:test-result: PASS Ordering comparison checks that should succeed +:test-result: PASS Our PCG implementation provides expected results for known seeds +:test-result: FAIL Output from all sections is reported +:test-result: PASS Overloaded comma or address-of operators are not used +:test-result: PASS Parse test names and tags +:test-result: PASS Parsed tags are matched case insensitive +:test-result: PASS Parsing sharding-related cli flags +:test-result: PASS Parsing tags with non-alphabetical characters is pass-through +:test-result: PASS Parsing warnings +:test-result: PASS Pointers can be compared to null +:test-result: PASS Precision of floating point stringification can be set +:test-result: PASS Predicate matcher can accept const char* +:test-result: PASS Process can be configured on command line +:test-result: PASS Product with differing arities - std::tuple<int, double, float> +:test-result: PASS Product with differing arities - std::tuple<int, double> +:test-result: PASS Product with differing arities - std::tuple<int> +:test-result: PASS Random seed generation accepts known methods +:test-result: PASS Random seed generation reports unknown methods +:test-result: PASS Range type with sentinel +:test-result: FAIL Reconstruction should be based on stringification: #914 +:test-result: FAIL Regex string matcher +:test-result: PASS Registering reporter with '::' in name fails +:test-result: PASS Regression test #1 +:test-result: PASS Reporter's write listings to provided stream +:test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla +:test-result: PASS SUCCEED counts as a test pass +:test-result: PASS SUCCEED 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 +:test-result: FAIL Sends stuff to stdout and stderr +:test-result: PASS Some simple comparisons between doubles +:test-result: FAIL Standard output from all sections is reported +:test-result: FAIL StartsWith string matcher +:test-result: PASS Static arrays are convertible to string +:test-result: PASS String matchers +:test-result: PASS StringRef +:test-result: PASS StringRef at compilation time +:test-result: PASS Stringifying char arrays with statically known sizes - char +:test-result: PASS Stringifying char arrays with statically known sizes - signed char +:test-result: PASS Stringifying char arrays with statically known sizes - unsigned char +:test-result: PASS Stringifying std::chrono::duration helpers +:test-result: PASS Stringifying std::chrono::duration with weird ratios +:test-result: PASS Stringifying std::chrono::time_point<system_clock> +:test-result: FAIL Tabs and newlines show in output +:test-result: PASS Tag alias can be registered against tag patterns +:test-result: PASS Tags with spaces and non-alphanumerical characters are accepted +:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 0 +:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 1 +:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 2 +:test-result: PASS Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0 +:test-result: PASS Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1 +:test-result: PASS Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0 +:test-result: PASS Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1 +:test-result: PASS Template test case with test types specified inside std::tuple - MyTypes - 0 +:test-result: PASS Template test case with test types specified inside std::tuple - MyTypes - 1 +:test-result: PASS Template test case with test types specified inside std::tuple - MyTypes - 2 +:test-result: PASS TemplateTest: vectors can be sized and resized - float +:test-result: PASS TemplateTest: vectors can be sized and resized - int +:test-result: PASS TemplateTest: vectors can be sized and resized - std::string +:test-result: PASS TemplateTest: vectors can be sized and resized - std::tuple<int,float> +:test-result: PASS TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +:test-result: PASS TemplateTestSig: vectors can be sized and resized - float,4 +:test-result: PASS TemplateTestSig: vectors can be sized and resized - int,5 +:test-result: PASS TemplateTestSig: vectors can be sized and resized - std::string,15 +:test-result: PASS Test case with identical tags keeps just one +:test-result: PASS Test case with one argument +:test-result: PASS Test enum bit values +:test-result: PASS Test with special, characters "in name +:test-result: PASS Testing checked-if +:test-result: XFAIL Testing checked-if 2 +:test-result: XFAIL Testing checked-if 3 +:test-result: FAIL The NO_FAIL macro reports a failure but does not fail the test +:test-result: PASS The default listing implementation write to provided stream +:test-result: FAIL This test 'should' fail but doesn't +:test-result: FAIL Thrown string literals are translated +:test-result: PASS Tracker +:test-result: PASS Trim strings +:test-result: FAIL Unexpected exceptions can be translated +:test-result: PASS Upcasting special member functions +:test-result: PASS Usage of AllMatch range matcher +:test-result: PASS Usage of AllTrue range matcher +:test-result: PASS Usage of AnyMatch range matcher +:test-result: PASS Usage of AnyTrue range matcher +:test-result: PASS Usage of NoneMatch range matcher +:test-result: PASS Usage of NoneTrue range matcher +:test-result: PASS Usage of the SizeIs range matcher +:test-result: PASS Use a custom approx +:test-result: PASS Variadic macros +:test-result: PASS Vector Approx matcher +:test-result: FAIL Vector Approx matcher -- failing +:test-result: PASS Vector matchers +:test-result: FAIL Vector matchers that fail +: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: FAIL When unchecked exceptions are thrown, but caught, they do not affect the test +: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 XmlWriter writes boolean attributes as true/false +:test-result: PASS analyse no analysis +:test-result: PASS array<int, N> -> toString +:test-result: PASS benchmark function call +: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 classify_outliers +:test-result: PASS comparisons between const int variables +:test-result: PASS comparisons between int variables +:test-result: PASS convertToBits +:test-result: PASS empty tags are not allowed +:test-result: PASS erfc_inv +:test-result: PASS estimate_clock_resolution +:test-result: PASS even more nested SECTION tests +:test-result: FAIL first tag +:test-result: FAIL has printf +:test-result: PASS is_unary_function +:test-result: FAIL just failure +:test-result: FAIL just failure after unscoped info +:test-result: FAIL just info +:test-result: FAIL just unscoped info +:test-result: PASS long long +:test-result: FAIL looped SECTION tests +:test-result: FAIL looped tests +:test-result: PASS makeStream recognizes %debug stream name +:test-result: PASS make_unique reimplementation +:test-result: PASS mean +:test-result: PASS measure +:test-result: FAIL mix info, unscoped info and warning +:test-result: FAIL more nested SECTION tests +:test-result: PASS nested SECTION tests +:test-result: PASS non streamable - with conv. op +:test-result: PASS non-copyable objects +:test-result: PASS normal_cdf +:test-result: PASS normal_quantile +:test-result: PASS not allowed +:test-result: FAIL not prints unscoped info from previous failures +:test-result: PASS null strings +:test-result: PASS null_ptr +:test-result: PASS pair<pair<int,const char *,pair<std::string,int> > -> toString +:test-result: PASS parseEnums +:test-result: PASS pointer to class +:test-result: PASS print unscoped info if passing unscoped info is printed +:test-result: FAIL prints unscoped info on failure +:test-result: FAIL prints unscoped info only for the first assertion +:test-result: PASS random SECTION tests +:test-result: PASS replaceInPlace +:test-result: PASS request an unknown %-starting stream fails +:test-result: PASS resolution +:test-result: PASS run_for_at_least, chronometer +:test-result: PASS run_for_at_least, int +:test-result: FAIL second tag +:test-result: FAIL send a single char to INFO +:test-result: FAIL sends information to INFO +:test-result: PASS shortened hide tags are split apart +:test-result: PASS splitString +:test-result: FAIL stacks unscoped info in loops +:test-result: PASS startsWith +:test-result: PASS std::map is convertible string +:test-result: PASS std::pair<int,const std::string> -> toString +:test-result: PASS std::pair<int,std::string> -> toString +:test-result: PASS std::set is convertible string +:test-result: PASS std::vector<std::pair<std::string,int> > -> toString +:test-result: PASS stdout and stderr streams have %-starting name +:test-result: PASS stringify ranges +:test-result: PASS stringify( has_maker ) +:test-result: PASS stringify( has_maker_and_operator ) +:test-result: PASS stringify( has_neither ) +:test-result: PASS stringify( has_operator ) +:test-result: PASS stringify( has_template_operator ) +:test-result: PASS stringify( vectors<has_maker> ) +:test-result: PASS stringify( vectors<has_maker_and_operator> ) +:test-result: PASS stringify( vectors<has_operator> ) +:test-result: PASS strlen3 +:test-result: PASS tables +:test-result: PASS tags with dots in later positions are not parsed as hidden +:test-result: FAIL thrown std::strings are translated +: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(enum class w/operator<<) +:test-result: PASS toString(enum class) +:test-result: PASS toString(enum w/operator<<) +:test-result: PASS toString(enum) +:test-result: PASS tuple<> +:test-result: PASS tuple<float,int> +:test-result: PASS tuple<int> +:test-result: PASS tuple<string,string> +:test-result: PASS tuple<tuple<int>,tuple<>,float> +:test-result: PASS uniform samples +:test-result: PASS unique_ptr reimplementation: basic functionality +:test-result: PASS vec<vec<string,alloc>> -> toString +:test-result: PASS vector<bool> -> toString +:test-result: PASS vector<int,allocator> -> toString +:test-result: PASS vector<int> -> toString +:test-result: PASS vector<string> -> toString +:test-result: PASS vectors can be sized and resized +:test-result: PASS warmup +:test-result: PASS weighted_average_quantile +:test-result: PASS xmlentitycheck diff --git a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt index 556db2616..6d23d01de 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -1,6 +1,6 @@ +Filters: ~[!nonportable]~[!benchmark]~[approvals] * +RNG seed: 1 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: t1 == t2 for: {?} == {?} @@ -96,7 +96,7 @@ Compilation.tests.cpp:<line number>: passed: throws_int(false) Compilation.tests.cpp:<line number>: passed: "aaa", Catch::Matchers::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 +Misc.tests.cpp:<line number>: passed: errno_after == 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' @@ -334,6 +334,21 @@ Message.tests.cpp:<line number>: passed: with 7 messages: 'std::vector<int>{1, 2 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' +Details.tests.cpp:<line number>: passed: eq( "", "" ) for: true +Details.tests.cpp:<line number>: passed: !(eq( "", "a" )) for: !false +Details.tests.cpp:<line number>: passed: eq( "a", "a" ) for: true +Details.tests.cpp:<line number>: passed: eq( "a", "A" ) for: true +Details.tests.cpp:<line number>: passed: eq( "A", "a" ) for: true +Details.tests.cpp:<line number>: passed: eq( "A", "A" ) for: true +Details.tests.cpp:<line number>: passed: !(eq( "a", "b" )) for: !false +Details.tests.cpp:<line number>: passed: !(eq( "a", "B" )) for: !false +Details.tests.cpp:<line number>: passed: lt( "", "a" ) for: true +Details.tests.cpp:<line number>: passed: !(lt( "a", "a" )) for: !false +Details.tests.cpp:<line number>: passed: !(lt( "", "" )) for: !false +Details.tests.cpp:<line number>: passed: lt( "a", "b" ) for: true +Details.tests.cpp:<line number>: passed: lt( "a", "B" ) for: true +Details.tests.cpp:<line number>: passed: lt( "A", "b" ) for: true +Details.tests.cpp:<line number>: passed: lt( "A", "B" ) for: true 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' @@ -350,33 +365,63 @@ ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 4 == 4 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 5 == 5 Clara.tests.cpp:<line number>: passed: name.empty() for: true Clara.tests.cpp:<line number>: passed: name == "foo" for: "foo" == "foo" +Clara.tests.cpp:<line number>: passed: !(parse_result) for: !{?} +Clara.tests.cpp:<line number>: passed: parse_result for: {?} +Clara.tests.cpp:<line number>: passed: res == std::vector<std::string>{ "aaa", "bbb" } for: { "aaa", "bbb" } == { "aaa", "bbb" } +ColourImpl.tests.cpp:<line number>: passed: streamWrapper.str().empty() for: true +ColourImpl.tests.cpp:<line number>: passed: streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" for: "1 +Using code: 2 +2 +Using code: 0 +3 +" +== +"1 +Using code: 2 +2 +Using code: 0 +3 +" +ColourImpl.tests.cpp:<line number>: passed: streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" for: "Using code: 2 +A +B +Using code: 0 +C +" +== +"Using code: 2 +A +B +Using code: 0 +C +" Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' -Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' -Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' -Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' -Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' -Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' -Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' -Matchers.tests.cpp:<line number>: passed: 0, !MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f +Matchers.tests.cpp:<line number>: passed: 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1" Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value' -Matchers.tests.cpp:<line number>: passed: 1, !!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f +Matchers.tests.cpp:<line number>: passed: 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1" Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' -Matchers.tests.cpp:<line number>: passed: 0, !!!MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f +Matchers.tests.cpp:<line number>: passed: 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1" Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value' -Matchers.tests.cpp:<line number>: passed: 1, !!!!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f +Matchers.tests.cpp:<line number>: passed: 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1" Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value' Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value' -Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value' -Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value' -Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) Matchers.tests.cpp:<line number>: passed: vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) for: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) Matchers.tests.cpp:<line number>: passed: str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) Matchers.tests.cpp:<line number>: passed: str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) @@ -447,8 +492,8 @@ Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true Matchers.tests.cpp:<line number>: passed: matcher.match( 1 ) for: true Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true -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" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ContainsSubstring( "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(), ContainsSubstring( "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 @@ -463,6 +508,7 @@ 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 +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "-" )->isConsole() for: true 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' @@ -473,6 +519,8 @@ ToString.tests.cpp:<line number>: passed: enumInfo->lookup(1) == "Value2" for: V ToString.tests.cpp:<line number>: passed: enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **} == "{** unexpected enum value **}" +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "" )->isConsole() for: true +Tag.tests.cpp:<line number>: passed: Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) 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" @@ -528,8 +576,8 @@ Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" fo 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) +Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except" +Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "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" @@ -692,7 +740,12 @@ 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() == 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: filter([](int) { return false; }, values({ 1, 2, 3 })), 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 @@ -865,6 +918,24 @@ Approx.tests.cpp:<line number>: passed: d >= Approx( 1.22 ) for: 1.23 >= Approx( 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 ) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) 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' @@ -904,15 +975,38 @@ Approx.tests.cpp:<line number>: passed: d <= Approx( 1.23 ) for: 1.23 <= Approx( 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" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "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(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "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(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !ContainsSubstring( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly 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" +Reporters.tests.cpp:<line number>: passed: records == expected for: { "Hello", "world", "Goodbye", "world" } +== +{ "Hello", "world", "Goodbye", "world" } +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true 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 @@ -936,6 +1030,8 @@ 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)' +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 @@ -1174,6 +1270,32 @@ CmdLine.tests.cpp:<line number>: passed: !(spec.matches(*fakeTestCase("hidden an 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 +TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true +TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true +TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-count=8" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.shardCount == 8 for: 8 == 8 +CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?} +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?} +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-index=2" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.shardIndex == 2 for: 2 == 2 +CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?} +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") for: "Shard index must be a non-negative number" contains: "Shard index must be a non-negative number" +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-index=0" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.shardIndex == 0 for: 0 == 0 +TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true with 1 message: 'tagString := "[tag with spaces]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[tag with spaces]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true with 1 message: 'tagString := "[tag with spaces]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "-w", "NoAssertions" } ) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.warnings == WarnAbout::NoAssertions for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?} +CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3 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 @@ -1194,8 +1316,12 @@ CmdLine.tests.cpp:<line number>: passed: config.processName == "test" for: "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: config.reporterSpecifications.empty() for: true CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs().size() == 1 for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } for: {?} == {?} +CmdLine.tests.cpp:<line number>: passed: cfg.getProcessedReporterSpecs().size() == 1 for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } for: {?} == {?} 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 @@ -1208,15 +1334,24 @@ 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: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: !result for: true +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } 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: result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") for: "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." 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: {?} @@ -1226,7 +1361,7 @@ 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: result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("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: {?} @@ -1236,29 +1371,29 @@ CmdLine.tests.cpp:<line number>: passed: config.waitForKeypress == std::get<1>(i 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: result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("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: config.defaultOutputFilename == "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: config.defaultOutputFilename == "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: config.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 +CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--colour-mode", "default" } ) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 +CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--colour-mode", "ansi"}) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.defaultColourMode == ColourMode::ANSI for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--colour-mode", "none"}) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.defaultColourMode == ColourMode::None for: 3 == 3 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: result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: default, ansi, win32, or none. 'wrong' is 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: {?} @@ -1272,146 +1407,151 @@ CmdLine.tests.cpp:<line number>: passed: config.benchmarkWarmupTime == 10 for: 1 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 +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method) +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method) +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method) +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }" 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 +Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'" Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag -" contains: "fakeTag" with 1 message: 'Tested reporter: automake' +" contains: "fakeTag" with 1 message: 'Tested reporter: Automake' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description -" contains: "fake reporter" with 1 message: 'Tested reporter: automake' +" contains: "fake reporter" with 1 message: 'Tested reporter: Automake' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case -" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: automake' +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: Automake' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag -" contains: "fakeTag" with 1 message: 'Tested reporter: junit' +" contains: "fakeTag" with 1 message: 'Tested reporter: JUnit' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description -" contains: "fake reporter" with 1 message: 'Tested reporter: junit' +" contains: "fake reporter" with 1 message: 'Tested reporter: JUnit' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case -" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: junit' +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JUnit' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag -" contains: "fakeTag" with 1 message: 'Tested reporter: sonarqube' +" contains: "fakeTag" with 1 message: 'Tested reporter: SonarQube' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description -" contains: "fake reporter" with 1 message: 'Tested reporter: sonarqube' +" contains: "fake reporter" with 1 message: 'Tested reporter: SonarQube' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case -" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: sonarqube' +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: SonarQube' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag -" contains: "fakeTag" with 1 message: 'Tested reporter: tap' +" contains: "fakeTag" with 1 message: 'Tested reporter: TAP' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description -" contains: "fake reporter" with 1 message: 'Tested reporter: tap' +" contains: "fake reporter" with 1 message: 'Tested reporter: TAP' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case -" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: tap' +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TAP' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag -" contains: "fakeTag" with 1 message: 'Tested reporter: teamcity' +" contains: "fakeTag" with 1 message: 'Tested reporter: TeamCity' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description -" contains: "fake reporter" with 1 message: 'Tested reporter: teamcity' +" contains: "fake reporter" with 1 message: 'Tested reporter: TeamCity' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case -" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: teamcity' +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TeamCity' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> <TagsFromMatchingTests> <Tag> <Count>1</Count> @@ -1419,17 +1559,17 @@ Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) f <Alias>fakeTag</Alias> </Aliases> </Tag> -</TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: xml' +</TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: XML' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> <AvailableReporters> <Reporter> <Name>fake reporter</Name> <Description>fake description</Description> </Reporter> -</AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: xml' +</AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: XML' Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> <MatchingTests> <TestCase> <Name>fake test name</Name> @@ -1440,7 +1580,8 @@ Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test n <Line>123456789</Line> </SourceInfo> </TestCase> -</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: xml' +</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: XML' +Reporters.tests.cpp:<line number>: passed: 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 @@ -1476,10 +1617,10 @@ ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(arr) = 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(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "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" @@ -1493,6 +1634,8 @@ String.tests.cpp:<line number>: passed: std::strcmp( rawChars, "hello" ) == 0 fo 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.data() +String.tests.cpp:<line number>: passed: original.begin() == copy.begin() for: "original string" == "original string" +String.tests.cpp:<line number>: passed: original.begin() == copy.begin() for: "original string" == "original string" 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 @@ -1560,22 +1703,24 @@ Misc.tests.cpp:<line number>: failed: s1 == s2 for: "if ($b == 10) { $a = 20; } " -Tag.tests.cpp:<line number>: passed: what, Contains( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:<line number>: passed: what, ContainsSubstring( "[@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. +Tag.tests.cpp:<line number>: passed: what, ContainsSubstring( "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. +Tag.tests.cpp:<line number>: passed: what, ContainsSubstring( "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. +Tag.tests.cpp:<line number>: passed: what, ContainsSubstring( "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 ) ) +Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 2 for: 2 == 2 +Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} ) 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 @@ -1722,6 +1867,8 @@ 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 +Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 1 for: 1 == 1 +Tag.tests.cpp:<line number>: passed: testCase.tags[0] == Tag( "tag1" ) for: {?} == {?} 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: @@ -1736,21 +1883,25 @@ Misc.tests.cpp:<line number>: failed: explicitly Misc.tests.cpp:<line number>: failed - but was ok: false Misc.tests.cpp:<line number>: failed: explicitly Message.tests.cpp:<line number>: failed - but was ok: 1 == 2 -Reporters.tests.cpp:<line number>: passed: listingString, Contains("[fakeTag]"s) for: "All available tags: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" -Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: fake reporter: fake description -" contains: "fake reporter" -Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +" ( contains: "fake reporter" and contains: "fake description" ) +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) for: "Registered listeners: + fakeListener: fake description + +" ( contains: "fakeListener" and contains: "fake description" ) 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 @@ -1851,47 +2002,104 @@ MatchersRanges.tests.cpp:<line number>: passed: data, AllMatch(SizeIs(5)) for: { MatchersRanges.tests.cpp:<line number>: passed: data, !AllMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, AllTrue() for: { true, true, true, true, true } contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, AllTrue() for: { } contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { true, true, false, true, true } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { false, false, false, false, false } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, AllTrue() for: { true, true, true, true, true } contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { true, true, false, true, true } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { false, false, false, false, false } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: mocked, AllTrue() for: { true, true, true, true, true } contains only true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, !AllTrue() for: { true, true, false, true, true } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 MatchersRanges.tests.cpp:<line number>: passed: data, !AnyMatch(Contains(0) && Contains(10)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[1]) for: !false -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[2]) for: !false -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { true, true, true, true, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, !AnyTrue() for: { } not contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { false, false, true, false, false } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { true, true, true, true, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { false, false, true, false, false } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: mocked, AnyTrue() for: { false, false, false, false, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, AnyTrue() for: { false, false, true, true, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 MatchersRanges.tests.cpp:<line number>: passed: data, !NoneMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) MatchersRanges.tests.cpp:<line number>: passed: needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate -MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[1]) for: !false -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[2]) for: !false -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false -MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { true, true, true, true, true } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, NoneTrue() for: { } contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { false, false, true, false, false } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, NoneTrue() for: { false, false, false, false, false } contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { true, true, true, true, true } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { false, false, true, false, false } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, NoneTrue() for: { false, false, false, false, false } contains no true +MatchersRanges.tests.cpp:<line number>: passed: mocked, NoneTrue() for: { false, false, false, false, false } contains no true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, !NoneTrue() for: { false, false, true, true, true } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2 @@ -1965,8 +2173,6 @@ Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'e 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: @@ -1987,7 +2193,7 @@ Xml.tests.cpp:<line number>: passed: encode( stringWithQuotes, Catch::XmlEncode: "don't "quote" 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]" -Xml.tests.cpp:<line number>: passed: stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> +Xml.tests.cpp:<line number>: passed: stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> <Element1 attr1="true" attr2="false"/> " ( contains: "attr1="true"" and contains: "attr2="false"" ) InternalBenchmark.tests.cpp:<line number>: passed: analysis.mean.point.count() == 23 for: 23.0 == 23 @@ -2006,7 +2212,6 @@ InternalBenchmark.tests.cpp:<line number>: passed: analysis.outlier_variance == 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 InternalBenchmark.tests.cpp:<line number>: passed: model.started == 1 for: 1 == 1 InternalBenchmark.tests.cpp:<line number>: passed: model.finished == 0 for: 0 == 0 InternalBenchmark.tests.cpp:<line number>: passed: model.started == 1 for: 1 == 1 @@ -2090,6 +2295,18 @@ Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: loose text artifact +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<int>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<std::string const&>::value)' 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>) @@ -2113,6 +2330,7 @@ Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 mes 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' +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%debug" ) UniquePtr.tests.cpp:<line number>: passed: !(lval.has_moved) for: !false UniquePtr.tests.cpp:<line number>: passed: rval.has_moved for: true UniquePtr.tests.cpp:<line number>: passed: *ptr == std::tuple<int, double, int>{1, 2., 3} for: {?} == {?} @@ -2184,6 +2402,7 @@ StringManip.tests.cpp:<line number>: passed: !(Catch::replaceInPlace(letters, "x 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" +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%somestream" ) InternalBenchmark.tests.cpp:<line number>: passed: res.size() == count for: 10 == 10 InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) @@ -2218,12 +2437,15 @@ InternalBenchmark.tests.cpp:<line number>: passed: Timing.result == Timing.itera InternalBenchmark.tests.cpp:<line number>: passed: Timing.iterations >= time.count() for: 128 >= 100 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: tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) for: { ., magic-tag } ( Contains: magic-tag and Contains: . ) +Tag.tests.cpp:<line number>: passed: testcase.tags, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} 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' +StringManip.tests.cpp:<line number>: passed: !(startsWith("", 'c')) for: !false +StringManip.tests.cpp:<line number>: passed: startsWith(std::string("abc"), 'a') for: true +StringManip.tests.cpp:<line number>: passed: startsWith("def"_catch_sr, 'd') for: true 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 } }" @@ -2239,7 +2461,8 @@ ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( set ) 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" +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%stderr" )->isConsole() for: true +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%stdout" )->isConsole() for: true ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" for: "op<<(streamable_range)" == "op<<(streamable_range)" @@ -2301,9 +2524,6 @@ ToStringTuple.tests.cpp:<line number>: passed: "{ }" == ::Catch::Detail::stringi 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" }" @@ -2379,5 +2599,5 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: -Failed 86 test cases, failed 146 assertions. +Failed 83 test cases, failed 143 assertions. diff --git a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt new file mode 100644 index 000000000..a3500a352 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -0,0 +1,2595 @@ +Filters: ~[!nonportable]~[!benchmark]~[approvals] * +RNG seed: 1 +Misc.tests.cpp:<line number>: passed: with 1 message: 'yay' +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: +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' +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 +CmdLine.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase("spec . char")) for: true +CmdLine.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase("spec , char")) for: true +CmdLine.tests.cpp:<line number>: passed: !(spec.matches(*fakeTestCase(R"(spec \, char)"))) for: !false +CmdLine.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase(R"(spec {a} char)")) for: true +CmdLine.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase(R"(spec [a] char)")) for: true +CmdLine.tests.cpp:<line number>: passed: !(spec.matches(*fakeTestCase("differs but has similar tag", "[a]"))) for: !false +CmdLine.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase(R"(spec \ char)")) for: true +Generators.tests.cpp:<line number>: passed: counter < 7 for: 3 < 7 +Generators.tests.cpp:<line number>: passed: counter < 7 for: 6 < 7 +Generators.tests.cpp:<line number>: passed: i != j for: 1 != 3 +Generators.tests.cpp:<line number>: passed: i != j for: 1 != 4 +Generators.tests.cpp:<line number>: passed: i != j for: 2 != 3 +Generators.tests.cpp:<line number>: passed: i != j for: 2 != 4 +PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A' +PartTracker.tests.cpp:<line number>: passed: m for: 1 +PartTracker.tests.cpp:<line number>: passed: m for: 2 +PartTracker.tests.cpp:<line number>: passed: m for: 3 +PartTracker.tests.cpp:<line number>: passed: 1 +PartTracker.tests.cpp:<line number>: passed: m for: 2 +PartTracker.tests.cpp:<line number>: passed: m for: 3 +PartTracker.tests.cpp:<line number>: passed: m for: 1 +PartTracker.tests.cpp:<line number>: passed: m for: 2 +PartTracker.tests.cpp:<line number>: passed: m for: 3 +PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 3' and 'k := 5' +PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 3' and 'k := 6' +PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 4' and 'k := 5' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 4' and 'k := 6' +PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 3' and 'k := 5' +PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 3' and 'k := 6' +PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 4' and 'k := 5' +PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 4' and 'k := 6' +PartTracker.tests.cpp:<line number>: passed: m for: 1 +PartTracker.tests.cpp:<line number>: passed: n for: 1 +PartTracker.tests.cpp:<line number>: passed: m for: 1 +PartTracker.tests.cpp:<line number>: passed: n for: 2 +PartTracker.tests.cpp:<line number>: passed: m for: 1 +PartTracker.tests.cpp:<line number>: passed: n for: 3 +PartTracker.tests.cpp:<line number>: passed: m for: 2 +PartTracker.tests.cpp:<line number>: passed: n for: 1 +PartTracker.tests.cpp:<line number>: passed: m for: 2 +PartTracker.tests.cpp:<line number>: passed: n for: 2 +PartTracker.tests.cpp:<line number>: passed: m for: 2 +PartTracker.tests.cpp:<line number>: passed: n for: 3 +PartTracker.tests.cpp:<line number>: passed: m for: 3 +PartTracker.tests.cpp:<line number>: passed: n for: 1 +PartTracker.tests.cpp:<line number>: passed: m for: 3 +PartTracker.tests.cpp:<line number>: passed: n for: 2 +PartTracker.tests.cpp:<line number>: passed: m for: 3 +PartTracker.tests.cpp:<line number>: passed: n for: 3 +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, 4.9406564584124654e-324]) +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e-324, -0.0000000000000000e+00]) +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00]) +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::Matchers::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_after == 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 +Compilation.tests.cpp:<line number>: passed: lhs | rhs for: Val: 1 | Val: 2 +Compilation.tests.cpp:<line number>: passed: !(lhs & rhs) for: !(Val: 1 & Val: 2) +Compilation.tests.cpp:<line number>: passed: HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1 +Compilation.tests.cpp:<line number>: passed: lhs ^ rhs for: Val: 1 ^ Val: 2 +Compilation.tests.cpp:<line number>: passed: !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1) +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 +MatchersRanges.tests.cpp:<line number>: passed: a, Contains(1) for: { 1, 2, 3 } contains element 1 +MatchersRanges.tests.cpp:<line number>: passed: b, Contains(1) for: { 0, 1, 2 } contains element 1 +MatchersRanges.tests.cpp:<line number>: passed: c, !Contains(1) for: { 4, 5, 6 } not contains element 1 +MatchersRanges.tests.cpp:<line number>: passed: a, Contains(0, close_enough) for: { 1, 2, 3 } contains element 0 +MatchersRanges.tests.cpp:<line number>: passed: b, Contains(0, close_enough) for: { 0, 1, 2 } contains element 0 +MatchersRanges.tests.cpp:<line number>: passed: c, !Contains(0, close_enough) for: { 4, 5, 6 } not contains element 0 +MatchersRanges.tests.cpp:<line number>: passed: a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 +MatchersRanges.tests.cpp:<line number>: passed: in, Contains(1) for: { 1, 2, 3, 4, 5 } contains element 1 +MatchersRanges.tests.cpp:<line number>: passed: in, !Contains(8) for: { 1, 2, 3, 4, 5 } not contains element 8 +MatchersRanges.tests.cpp:<line number>: passed: in, Contains(MoveOnlyTestElement{ 2 }) for: { 1, 2, 3 } contains element 2 +MatchersRanges.tests.cpp:<line number>: passed: in, !Contains(MoveOnlyTestElement{ 9 }) for: { 1, 2, 3 } not contains element 9 +MatchersRanges.tests.cpp:<line number>: passed: in, Contains(Catch::Matchers::WithinAbs(0.5, 0.5)) for: { 1.0, 2.0, 3.0, 0.0 } contains element matching is within 0.5 of 0.5 +MatchersRanges.tests.cpp:<line number>: passed: empty_array, IsEmpty() for: { } is empty +MatchersRanges.tests.cpp:<line number>: passed: non_empty_array, !IsEmpty() for: { 0.0 } not is empty +MatchersRanges.tests.cpp:<line number>: passed: empty_vec, IsEmpty() for: { } is empty +MatchersRanges.tests.cpp:<line number>: passed: non_empty_vec, !IsEmpty() for: { 'a', 'b', 'c' } not is empty +MatchersRanges.tests.cpp:<line number>: passed: inner_lists_are_empty, !IsEmpty() for: { { } } not is empty +MatchersRanges.tests.cpp:<line number>: passed: inner_lists_are_empty.front(), IsEmpty() for: { } is empty +MatchersRanges.tests.cpp:<line number>: passed: has_empty{}, !IsEmpty() for: {?} not is empty +MatchersRanges.tests.cpp:<line number>: passed: unrelated::ADL_empty{}, IsEmpty() for: {?} is empty +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' +Details.tests.cpp:<line number>: passed: eq( "", "" ) for: true +Details.tests.cpp:<line number>: passed: !(eq( "", "a" )) for: !false +Details.tests.cpp:<line number>: passed: eq( "a", "a" ) for: true +Details.tests.cpp:<line number>: passed: eq( "a", "A" ) for: true +Details.tests.cpp:<line number>: passed: eq( "A", "a" ) for: true +Details.tests.cpp:<line number>: passed: eq( "A", "A" ) for: true +Details.tests.cpp:<line number>: passed: !(eq( "a", "b" )) for: !false +Details.tests.cpp:<line number>: passed: !(eq( "a", "B" )) for: !false +Details.tests.cpp:<line number>: passed: lt( "", "a" ) for: true +Details.tests.cpp:<line number>: passed: !(lt( "a", "a" )) for: !false +Details.tests.cpp:<line number>: passed: !(lt( "", "" )) for: !false +Details.tests.cpp:<line number>: passed: lt( "a", "b" ) for: true +Details.tests.cpp:<line number>: passed: lt( "a", "B" ) for: true +Details.tests.cpp:<line number>: passed: lt( "A", "b" ) for: true +Details.tests.cpp:<line number>: passed: lt( "A", "B" ) for: true +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 +Clara.tests.cpp:<line number>: passed: name.empty() for: true +Clara.tests.cpp:<line number>: passed: name == "foo" for: "foo" == "foo" +Clara.tests.cpp:<line number>: passed: !(parse_result) for: !{?} +Clara.tests.cpp:<line number>: passed: parse_result for: {?} +Clara.tests.cpp:<line number>: passed: res == std::vector<std::string>{ "aaa", "bbb" } for: { "aaa", "bbb" } == { "aaa", "bbb" } +ColourImpl.tests.cpp:<line number>: passed: streamWrapper.str().empty() for: true +ColourImpl.tests.cpp:<line number>: passed: streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" for: "1 +Using code: 2 +2 +Using code: 0 +3 +" +== +"1 +Using code: 2 +2 +Using code: 0 +3 +" +ColourImpl.tests.cpp:<line number>: passed: streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" for: "Using code: 2 +A +B +Using code: 0 +C +" +== +"Using code: 2 +A +B +Using code: 0 +C +" +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' +Matchers.tests.cpp:<line number>: passed: 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1" +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value' +Matchers.tests.cpp:<line number>: passed: 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1" +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' +Matchers.tests.cpp:<line number>: passed: 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1" +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value' +Matchers.tests.cpp:<line number>: passed: 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1" +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value' +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value' +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value' +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) +Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value' +Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) +Matchers.tests.cpp:<line number>: passed: vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) for: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) +Matchers.tests.cpp:<line number>: passed: str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) +Matchers.tests.cpp:<line number>: passed: str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) +Matchers.tests.cpp:<line number>: passed: str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +Matchers.tests.cpp:<line number>: passed: str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +Matchers.tests.cpp:<line number>: passed: str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) for: "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) +Matchers.tests.cpp:<line number>: passed: str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) for: "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) +Matchers.tests.cpp:<line number>: passed: container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) for: { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) +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: !(matcher.match( 1 )) for: !false +Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true +Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true +Matchers.tests.cpp:<line number>: passed: matcher.match( 1 ) for: true +Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true +Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true +Matchers.tests.cpp:<line number>: passed: !(matcher.match( 1 )) for: !false +Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true +Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true +Matchers.tests.cpp:<line number>: passed: matcher.match( 1 ) for: true +Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true +Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ContainsSubstring( "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(), ContainsSubstring( "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 +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "-" )->isConsole() for: true +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 **}" +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "" )->isConsole() for: true +Tag.tests.cpp:<line number>: passed: Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) +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(), ContainsSubstring( "except" ) for: "expected exception" contains: "except" +Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "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: -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: 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: filter([](int) { return false; }, values({ 1, 2, 3 })), 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 ) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) +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 +Compilation.tests.cpp:<line number>: passed: []() { return true; }() for: true +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(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "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(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "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(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !ContainsSubstring( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly +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" +Reporters.tests.cpp:<line number>: passed: records == expected for: { "Hello", "world", "Goodbye", "world" } +== +{ "Hello", "world", "Goodbye", "world" } +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +Reporters.tests.cpp:<line number>: passed: multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +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)' +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' +Matchers.tests.cpp:<line number>: passed: ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed +Matchers.tests.cpp:<line number>: passed: &EvilMatcher(), EvilAddressOfOperatorUsed +Matchers.tests.cpp:<line number>: passed: EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) +Matchers.tests.cpp:<line number>: passed: ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() +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 ) == 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 ) == 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 ) == 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 ) == 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 +TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true +TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true +TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-count=8" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.shardCount == 8 for: 8 == 8 +CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?} +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?} +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-index=2" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.shardIndex == 2 for: 2 == 2 +CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?} +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") for: "Shard index must be a non-negative number" contains: "Shard index must be a non-negative number" +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-index=0" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.shardIndex == 0 for: 0 == 0 +TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true with 1 message: 'tagString := "[tag with spaces]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[tag with spaces]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true with 1 message: 'tagString := "[tag with spaces]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "-w", "NoAssertions" } ) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.warnings == WarnAbout::NoAssertions for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?} +CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3 +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.reporterSpecifications.empty() for: true +CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs().size() == 1 for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } for: {?} == {?} +CmdLine.tests.cpp:<line number>: passed: cfg.getProcessedReporterSpecs().size() == 1 for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } for: {?} == {?} +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: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: !result for: true +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +CmdLine.tests.cpp:<line number>: passed: !result for: true +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") for: "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." +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(), ContainsSubstring("convert") && ContainsSubstring("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(), ContainsSubstring("never") && ContainsSubstring("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.defaultOutputFilename == "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.defaultOutputFilename == "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.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 +CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--colour-mode", "default" } ) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 +CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--colour-mode", "ansi"}) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.defaultColourMode == ColourMode::ANSI for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--colour-mode", "none"}) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.defaultColourMode == ColourMode::None for: 3 == 3 +CmdLine.tests.cpp:<line number>: passed: !result for: true +CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: default, ansi, win32, or none. 'wrong' is 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::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 +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method) +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method) +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method) +RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) +ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }" +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 +Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'" +Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" with 1 message: 'Tested reporter: Automake' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" with 1 message: 'Tested reporter: Automake' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: Automake' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" with 1 message: 'Tested reporter: compact' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" with 1 message: 'Tested reporter: compact' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" with 1 message: 'Tested reporter: console' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" with 1 message: 'Tested reporter: console' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> +All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" with 1 message: 'Tested reporter: JUnit' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Available reporters: + fake reporter: fake description + +" contains: "fake reporter" with 1 message: 'Tested reporter: JUnit' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> +All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JUnit' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> +All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" with 1 message: 'Tested reporter: SonarQube' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> +Available reporters: + fake reporter: fake description + +" contains: "fake reporter" with 1 message: 'Tested reporter: SonarQube' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> +All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: SonarQube' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" with 1 message: 'Tested reporter: TAP' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" with 1 message: 'Tested reporter: TAP' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TAP' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" with 1 message: 'Tested reporter: TeamCity' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" with 1 message: 'Tested reporter: TeamCity' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TeamCity' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> +<TagsFromMatchingTests> + <Tag> + <Count>1</Count> + <Aliases> + <Alias>fakeTag</Alias> + </Aliases> + </Tag> +</TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: XML' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> +<AvailableReporters> + <Reporter> + <Name>fake reporter</Name> + <Description>fake description</Description> + </Reporter> +</AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: XML' +Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> +<MatchingTests> + <TestCase> + <Name>fake test name</Name> + <ClassName/> + <Tags>[fakeTestTag]</Tags> + <SourceInfo> + <File>fake-file.cpp</File> + <Line>123456789</Line> + </SourceInfo> + </TestCase> +</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: XML' +Reporters.tests.cpp:<line number>: passed: +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 +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 +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(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "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: std::strcmp( empty.data(), "" ) == 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: std::strcmp( rawChars, "hello" ) == 0 for: 0 == 0 +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.data() +String.tests.cpp:<line number>: passed: original.begin() == copy.begin() for: "original string" == "original string" +String.tests.cpp:<line number>: passed: original.begin() == copy.begin() for: "original string" == "original string" +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.data(), "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.data(), "world!") == 0 for: 0 == 0 +String.tests.cpp:<line number>: passed: s.substr(1'000'000, 1).empty() for: true +String.tests.cpp:<line number>: passed: reinterpret_cast<char*>(buffer1) != reinterpret_cast<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: lhs == "some string += the stringref contents" for: "some string += the stringref contents" +== +"some string += the stringref contents" +String.tests.cpp:<line number>: passed: together == "abrakadabra" for: "abrakadabra" == "abrakadabra" +String.tests.cpp:<line number>: passed: with 1 message: 'empty.size() == 0' +String.tests.cpp:<line number>: passed: with 1 message: 'empty.begin() == empty.end()' +String.tests.cpp:<line number>: passed: with 1 message: 'stringref.size() == 3' +String.tests.cpp:<line number>: passed: with 1 message: 'stringref.data() == abc' +String.tests.cpp:<line number>: passed: with 1 message: 'stringref.begin() == abc' +String.tests.cpp:<line number>: passed: with 1 message: 'stringref.begin() != stringref.end()' +String.tests.cpp:<line number>: passed: with 1 message: 'stringref.substr(10, 0).empty()' +String.tests.cpp:<line number>: passed: with 1 message: 'stringref.substr(2, 1).data() == abc + 2' +String.tests.cpp:<line number>: passed: with 1 message: 'stringref[1] == 'b'' +String.tests.cpp:<line number>: passed: with 1 message: 'shortened.size() == 2' +String.tests.cpp:<line number>: passed: with 1 message: 'shortened.data() == abc' +String.tests.cpp:<line number>: passed: with 1 message: 'shortened.begin() != shortened.end()' +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: 'sr2.empty()' +String.tests.cpp:<line number>: passed: with 1 message: 'sr2.size() == 0' +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +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, ContainsSubstring( "[@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, ContainsSubstring( "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, ContainsSubstring( "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, ContainsSubstring( "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 ) ) +Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 2 for: 2 == 2 +Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} ) +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 +Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 1 for: 1 == 1 +Tag.tests.cpp:<line number>: passed: testCase.tags[0] == Tag( "tag1" ) for: {?} == {?} +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: +Misc.tests.cpp:<line number>: passed: true +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: failed - but was ok: false +Misc.tests.cpp:<line number>: passed: true +Misc.tests.cpp:<line number>: failed - but was ok: false +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: true +Misc.tests.cpp:<line number>: failed: explicitly +Misc.tests.cpp:<line number>: failed - but was ok: false +Misc.tests.cpp:<line number>: failed: explicitly +Message.tests.cpp:<line number>: failed - but was ok: 1 == 2 +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: + 1 [fakeTag] +1 tag + +" contains: "[fakeTag]" +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: + fake reporter: fake description + +" ( contains: "fake reporter" and contains: "fake description" ) +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) for: "Registered listeners: + fakeListener: fake description + +" ( contains: "fakeListener" and contains: "fake description" ) +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' +UniquePtr.tests.cpp:<line number>: passed: bptr->i == 3 for: 3 == 3 +UniquePtr.tests.cpp:<line number>: passed: bptr->i == 3 for: 3 == 3 +MatchersRanges.tests.cpp:<line number>: passed: data, AllMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5 +MatchersRanges.tests.cpp:<line number>: passed: data, !AllMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) +MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, AllTrue() for: { true, true, true, true, true } contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, AllTrue() for: { } contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { true, true, false, true, true } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { false, false, false, false, false } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, AllTrue() for: { true, true, true, true, true } contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { true, true, false, true, true } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: data, !AllTrue() for: { false, false, false, false, false } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: mocked, AllTrue() for: { true, true, true, true, true } contains only true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, !AllTrue() for: { true, true, false, true, true } not contains only true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 +MatchersRanges.tests.cpp:<line number>: passed: data, !AnyMatch(Contains(0) && Contains(10)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) +MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { true, true, true, true, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, !AnyTrue() for: { } not contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { false, false, true, false, false } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { true, true, true, true, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, AnyTrue() for: { false, false, true, false, false } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: mocked, AnyTrue() for: { false, false, false, false, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, AnyTrue() for: { false, false, true, true, true } contains at least one true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) +MatchersRanges.tests.cpp:<line number>: passed: needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { true, true, true, true, true } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, NoneTrue() for: { } contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { false, false, true, false, false } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, NoneTrue() for: { false, false, false, false, false } contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { true, true, true, true, true } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, !NoneTrue() for: { false, false, true, false, false } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: data, NoneTrue() for: { false, false, false, false, false } contains no true +MatchersRanges.tests.cpp:<line number>: passed: mocked, NoneTrue() for: { false, false, false, false, false } contains no true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked, !NoneTrue() for: { false, false, true, true, true } not contains no true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true +MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false +MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0 +MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2 +MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2 +MatchersRanges.tests.cpp:<line number>: passed: arr, SizeIs(2) for: { 0, 0 } has size == 2 +MatchersRanges.tests.cpp:<line number>: passed: arr, SizeIs( Lt(3)) for: { 0, 0 } size matches is less than 3 +MatchersRanges.tests.cpp:<line number>: passed: arr, !SizeIs(!Lt(3)) for: { 0, 0 } not size matches not is less than 3 +MatchersRanges.tests.cpp:<line number>: passed: map, SizeIs(3) for: { {?}, {?}, {?} } has size == 3 +MatchersRanges.tests.cpp:<line number>: passed: unrelated::ADL_size{}, SizeIs(12) for: {?} has size == 12 +MatchersRanges.tests.cpp:<line number>: passed: has_size{}, SizeIs(13) for: {?} has size == 13 +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<double>( { 1., 2., 3. } ) 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: v5, ( VectorContains<int, CustomAllocator<int>>( 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<int>( { 1, 2 } ) for: { 1, 2, 3 } Contains: { 1, 2 } +Matchers.tests.cpp:<line number>: passed: v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( 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: v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Contains: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v5, Contains( v6 ) for: { 1, 2, 3 } Contains: { 1, 2 } +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<int>( { 1, 2, 3 } ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v, Equals( v2 ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v5, Equals( v6 ) 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: v, UnorderedEquals<int>( { 3, 2, 1 } ) for: { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } +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>: passed: v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) for: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } +Matchers.tests.cpp:<line number>: passed: v5_permuted, UnorderedEquals( v5 ) for: { 1, 3, 2 } 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>: 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 & jones" for: "smith & jones" == "smith & 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 > jones" for: "smith > jones" == "smith > jones" +Xml.tests.cpp:<line number>: passed: encode( "smith ]]> jones" ) == "smith ]]> jones" for: "smith ]]> jones" +== +"smith ]]> 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 "quote" me on that" for: "don't "quote" me on that" +== +"don't "quote" 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]" +Xml.tests.cpp:<line number>: passed: stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> +<Element1 attr1="true" attr2="false"/> +" ( contains: "attr1="true"" and contains: "attr2="false"" ) +InternalBenchmark.tests.cpp:<line number>: passed: analysis.mean.point.count() == 23 for: 23.0 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.mean.lower_bound.count() == 23 for: 23.0 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.mean.upper_bound.count() == 23 for: 23.0 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.standard_deviation.point.count() == 0 for: 0.0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.standard_deviation.lower_bound.count() == 0 for: 0.0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.standard_deviation.upper_bound.count() == 0 for: 0.0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.outliers.total() == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.outliers.low_mild == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.outliers.low_severe == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.outliers.high_mild == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.outliers.high_severe == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.outliers.samples_seen == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: analysis.outlier_variance == 0 for: 0.0 == 0 +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 }" +InternalBenchmark.tests.cpp:<line number>: passed: model.started == 1 for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: model.finished == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: model.started == 1 for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: model.finished == 1 for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: called == 1 for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: model.started == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: model.finished == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: model.started == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: model.finished == 0 for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: called == 1 for: 1 == 1 +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 - but was ok: 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 - but was ok: flag for: false +Misc.tests.cpp:<line number>: failed: testCheckedIf( false ) for: false +InternalBenchmark.tests.cpp:<line number>: passed: o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_severe == los for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_mild == lom for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_mild == him for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_severe == his for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.total() == los + lom + him + his for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_severe == los for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_mild == lom for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_mild == him for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_severe == his for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.total() == los + lom + him + his for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_severe == los for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_mild == lom for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_mild == him for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_severe == his for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.total() == los + lom + him + his for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_severe == los for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_mild == lom for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_mild == him for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_severe == his for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.total() == los + lom + him + his for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_severe == los for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_mild == lom for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_mild == him for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_severe == his for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.total() == los + lom + him + his for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_severe == los for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.low_mild == lom for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_mild == him for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: o.high_severe == his for: 0 == 0 +InternalBenchmark.tests.cpp:<line number>: passed: o.total() == los + lom + him + his for: 2 == 2 +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 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( 0.f ) == 0 for: 0 == 0 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( -0.f ) == ( 1ULL << 31 ) for: 2147483648 (0x<hex digits>) +== +2147483648 (0x<hex digits>) +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( 0. ) == 0 for: 0 == 0 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( -0. ) == ( 1ULL << 63 ) for: 9223372036854775808 (0x<hex digits>) +== +9223372036854775808 (0x<hex digits>) +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 for: 1 == 1 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 for: 1 == 1 +Tag.tests.cpp:<line number>: passed: Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) +InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.0920368762 == Approx( -0.0920368762 ) +InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.0598029112 == Approx( -0.0598029112 ) +InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.3859038243 == Approx( 1.3859038243 ) +InternalBenchmark.tests.cpp:<line number>: passed: res.mean.count() == rate for: 2000.0 == 2000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res.outliers.total() == 0 for: 0 == 0 +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<int>::value)' +Clara.tests.cpp:<line number>: passed: with 1 message: '!(Catch::Clara::Detail::is_unary_function<std::string const&>::value)' +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' +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%debug" ) +UniquePtr.tests.cpp:<line number>: passed: !(lval.has_moved) for: !false +UniquePtr.tests.cpp:<line number>: passed: rval.has_moved for: true +UniquePtr.tests.cpp:<line number>: passed: *ptr == std::tuple<int, double, int>{1, 2., 3} for: {?} == {?} +InternalBenchmark.tests.cpp:<line number>: passed: m == 19. for: 19.0 == 19.0 +InternalBenchmark.tests.cpp:<line number>: passed: x == 17 for: 17 == 17 +InternalBenchmark.tests.cpp:<line number>: passed: x == 23 for: 23 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: r.elapsed.count() == 42 for: 42 == 42 +InternalBenchmark.tests.cpp:<line number>: passed: r.result == 23 for: 23 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: r.iterations == 1 for: 1 == 1 +InternalBenchmark.tests.cpp:<line number>: passed: s.elapsed.count() == 69 for: 69 == 69 +InternalBenchmark.tests.cpp:<line number>: passed: s.result == 17 for: 17 == 17 +InternalBenchmark.tests.cpp:<line number>: passed: s.iterations == 1 for: 1 == 1 +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: {?} == {?} +InternalBenchmark.tests.cpp:<line number>: passed: normal_cdf(0.000000) == Approx(0.50000000000000000) for: 0.5 == Approx( 0.5 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_cdf(1.000000) == Approx(0.84134474606854293) for: 0.8413447461 == Approx( 0.8413447461 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_cdf(-1.000000) == Approx(0.15865525393145705) for: 0.1586552539 == Approx( 0.1586552539 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_cdf(2.809729) == Approx(0.99752083845315409) for: 0.9975208385 == Approx( 0.9975208385 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_cdf(-1.352570) == Approx(0.08809652095066035) for: 0.088096521 == Approx( 0.088096521 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.551780) == Approx(0.13015979861484198) for: 0.1301597986 == Approx( 0.1301597986 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.084574088 == Approx( 0.084574088 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.9599639845 == Approx( -1.9599639845 ) +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" +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%somestream" ) +InternalBenchmark.tests.cpp:<line number>: passed: res.size() == count for: 10 == 10 +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 1 >= 1 +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 2 >= 1 +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 4 >= 2 +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 8 >= 4 +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 16 >= 8 +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 32 >= 16 +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 64 >= 32 +InternalBenchmark.tests.cpp:<line number>: passed: meter.runs() >= old_runs for: 128 >= 64 +InternalBenchmark.tests.cpp:<line number>: passed: Timing.elapsed >= time for: 128 ns >= 100 ns +InternalBenchmark.tests.cpp:<line number>: passed: Timing.result == Timing.iterations + 17 for: 145 == 145 +InternalBenchmark.tests.cpp:<line number>: passed: Timing.iterations >= time.count() for: 128 >= 100 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 1 >= 1 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 2 >= 1 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 4 >= 2 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 8 >= 4 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 16 >= 8 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 32 >= 16 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 64 >= 32 +InternalBenchmark.tests.cpp:<line number>: passed: x >= old_x for: 128 >= 64 +InternalBenchmark.tests.cpp:<line number>: passed: Timing.elapsed >= time for: 128 ns >= 100 ns +InternalBenchmark.tests.cpp:<line number>: passed: Timing.result == Timing.iterations + 17 for: 145 == 145 +InternalBenchmark.tests.cpp:<line number>: passed: Timing.iterations >= time.count() for: 128 >= 100 +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, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} 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' +StringManip.tests.cpp:<line number>: passed: !(startsWith("", 'c')) for: !false +StringManip.tests.cpp:<line number>: passed: startsWith(std::string("abc"), 'a') for: true +StringManip.tests.cpp:<line number>: passed: startsWith("def"_catch_sr, 'd') for: true +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 } }" +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%stderr" )->isConsole() for: true +Stream.tests.cpp:<line number>: passed: Catch::makeStream( "%stdout" )->isConsole() for: true +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 +Tag.tests.cpp:<line number>: passed: testcase.tags.size() == 1 for: 1 == 1 +Tag.tests.cpp:<line number>: passed: testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag +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: "{ \"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 }" +InternalBenchmark.tests.cpp:<line number>: passed: e.point == 23 for: 23.0 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: e.upper_bound == 23 for: 23.0 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: e.lower_bound == 23 for: 23.0 == 23 +InternalBenchmark.tests.cpp:<line number>: passed: e.confidence_interval == 0.95 for: 0.95 == 0.95 +UniquePtr.tests.cpp:<line number>: passed: !(ptr) for: !{?} +UniquePtr.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0 +UniquePtr.tests.cpp:<line number>: passed: ptr for: {?} +UniquePtr.tests.cpp:<line number>: passed: *ptr == 0 for: 0 == 0 +UniquePtr.tests.cpp:<line number>: passed: ptr.get() == naked_ptr for: 0x<hex digits> == 0x<hex digits> +UniquePtr.tests.cpp:<line number>: passed: !(ptr) for: !{?} +UniquePtr.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0 +UniquePtr.tests.cpp:<line number>: passed: ptr for: {?} +UniquePtr.tests.cpp:<line number>: passed: *ptr == 0 for: 0 == 0 +UniquePtr.tests.cpp:<line number>: passed: ptr.get() == naked_ptr for: 0x<hex digits> == 0x<hex digits> +UniquePtr.tests.cpp:<line number>: passed: ptr for: {?} +UniquePtr.tests.cpp:<line number>: passed: ptr.get() != 0 for: 0x<hex digits> != 0 +UniquePtr.tests.cpp:<line number>: passed: *ptr == 2 for: 2 == 2 +UniquePtr.tests.cpp:<line number>: passed: !(ptr) for: !{?} +UniquePtr.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0 +UniquePtr.tests.cpp:<line number>: passed: !(ptr1) for: !{?} +UniquePtr.tests.cpp:<line number>: passed: ptr2 for: {?} +UniquePtr.tests.cpp:<line number>: passed: *ptr2 == 1 for: 1 == 1 +UniquePtr.tests.cpp:<line number>: passed: !(ptr2) for: !{?} +UniquePtr.tests.cpp:<line number>: passed: ptr1 for: {?} +UniquePtr.tests.cpp:<line number>: passed: *ptr1 == 2 for: 2 == 2 +UniquePtr.tests.cpp:<line number>: passed: *ptr1 == 2 for: 2 == 2 +UniquePtr.tests.cpp:<line number>: passed: *ptr2 == 1 for: 1 == 1 +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 +InternalBenchmark.tests.cpp:<line number>: passed: (iterations * rate) > Catch::Benchmark::Detail::warmup_time.count() for: 160000000 (0x<hex digits>) > 100 +InternalBenchmark.tests.cpp:<line number>: passed: (end - start) > Catch::Benchmark::Detail::warmup_time for: 310016000 ns > 100 ms +InternalBenchmark.tests.cpp:<line number>: passed: q1 == 14.5 for: 14.5 == 14.5 +InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0 +InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0 +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: +Failed 83 test cases, failed 143 assertions. + diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt index 8704f8b37..6962e5082 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt @@ -1,11 +1,10 @@ Filters: ~[!nonportable]~[!benchmark]~[approvals] * +Randomness seeded to: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -<exe-name> is a <version> host application. +<exe-name> is a Catch2 v<version> host application. Run with -? for options -Randomness seeded to: 1 - ------------------------------------------------------------------------------- #1455 - INFO and WARN can start with a linebreak ------------------------------------------------------------------------------- @@ -54,7 +53,7 @@ due to unexpected exception with messages: expected exception ------------------------------------------------------------------------------- -#835 -- errno should not be touched by Catch +#835 -- errno should not be touched by Catch2 ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -332,13 +331,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" @@ -678,7 +677,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -690,10 +689,50 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" +------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + ------------------------------------------------------------------------------- Mismatching exception messages failing the test ------------------------------------------------------------------------------- @@ -1125,26 +1164,6 @@ 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 ------------------------------------------------------------------------------- @@ -1364,17 +1383,6 @@ with messages: 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 ------------------------------------------------------------------------------- @@ -1386,6 +1394,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 368 | 292 passed | 70 failed | 6 failed as expected -assertions: 2103 | 1951 passed | 129 failed | 23 failed as expected +test cases: 394 | 318 passed | 69 failed | 7 failed as expected +assertions: 2284 | 2129 passed | 128 failed | 27 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt index 08cef9ace..63dd231e8 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt @@ -1,11 +1,10 @@ Filters: ~[!nonportable]~[!benchmark]~[approvals] * +Randomness seeded to: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -<exe-name> is a <version> host application. +<exe-name> is a Catch2 v<version> host application. Run with -? for options -Randomness seeded to: 1 - ------------------------------------------------------------------------------- # A test name that starts with a # ------------------------------------------------------------------------------- @@ -16,23 +15,6 @@ 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: Bitfields can be captured ------------------------------------------------------------------------------- @@ -863,7 +845,7 @@ with expansion: true ------------------------------------------------------------------------------- -#835 -- errno should not be touched by Catch +#835 -- errno should not be touched by Catch2 ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -874,7 +856,7 @@ with expansion: 1 == 0 Misc.tests.cpp:<line number>: PASSED: - REQUIRE( errno == 1 ) + REQUIRE( errno_after == 1 ) with expansion: 1 == 1 @@ -2801,6 +2783,109 @@ ToStringGeneral.tests.cpp:<line number>: PASSED: with message: 3 +------------------------------------------------------------------------------- +CaseInsensitiveEqualsTo is case insensitive + Degenerate cases +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "", "" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( eq( "", "a" ) ) +with expansion: + !false + +------------------------------------------------------------------------------- +CaseInsensitiveEqualsTo is case insensitive + Plain comparisons +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "a", "a" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "a", "A" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "A", "a" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "A", "A" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( eq( "a", "b" ) ) +with expansion: + !false + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( eq( "a", "B" ) ) +with expansion: + !false + +------------------------------------------------------------------------------- +CaseInsensitiveLess is case insensitive + Degenerate cases +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "", "a" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lt( "a", "a" ) ) +with expansion: + !false + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lt( "", "" ) ) +with expansion: + !false + +------------------------------------------------------------------------------- +CaseInsensitiveLess is case insensitive + Plain comparisons +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "a", "b" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "a", "B" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "A", "b" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "A", "B" ) ) +with expansion: + true + ------------------------------------------------------------------------------- Character pretty printing Specifically escaped @@ -2908,6 +2993,95 @@ Clara.tests.cpp:<line number>: PASSED: with expansion: "foo" == "foo" +------------------------------------------------------------------------------- +Clara::Opt supports accept-many lambdas + Parsing fails on multiple options without accept_many +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: + CHECK_FALSE( parse_result ) +with expansion: + !{?} + +------------------------------------------------------------------------------- +Clara::Opt supports accept-many lambdas + Parsing succeeds on multiple options with accept_many +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: + CHECK( parse_result ) +with expansion: + {?} + +Clara.tests.cpp:<line number>: PASSED: + CHECK( res == std::vector<std::string>{ "aaa", "bbb" } ) +with expansion: + { "aaa", "bbb" } == { "aaa", "bbb" } + +------------------------------------------------------------------------------- +ColourGuard behaviour + ColourGuard is disengaged by default +------------------------------------------------------------------------------- +ColourImpl.tests.cpp:<line number> +............................................................................... + +ColourImpl.tests.cpp:<line number>: PASSED: + REQUIRE( streamWrapper.str().empty() ) +with expansion: + true + +------------------------------------------------------------------------------- +ColourGuard behaviour + ColourGuard is engaged by op<< +------------------------------------------------------------------------------- +ColourImpl.tests.cpp:<line number> +............................................................................... + +ColourImpl.tests.cpp:<line number>: PASSED: + REQUIRE( streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" ) +with expansion: + "1 + Using code: 2 + 2 + Using code: 0 + 3 + " + == + "1 + Using code: 2 + 2 + Using code: 0 + 3 + " + +------------------------------------------------------------------------------- +ColourGuard behaviour + ColourGuard can be engaged explicitly +------------------------------------------------------------------------------- +ColourImpl.tests.cpp:<line number> +............................................................................... + +ColourImpl.tests.cpp:<line number>: PASSED: + REQUIRE( streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" ) +with expansion: + "Using code: 2 + A + B + Using code: 0 + C + " + == + "Using code: 2 + A + B + Using code: 0 + C + " + ------------------------------------------------------------------------------- Combining MatchAllOfGeneric does not nest ------------------------------------------------------------------------------- @@ -2922,7 +3096,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && MatcherC() ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) Matchers.tests.cpp:<line number>: PASSED: @@ -2933,7 +3107,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() && ( MatcherB() && MatcherC() ) ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) Matchers.tests.cpp:<line number>: PASSED: @@ -2945,7 +3119,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true ) ------------------------------------------------------------------------------- @@ -2962,7 +3136,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || MatcherC() ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) Matchers.tests.cpp:<line number>: PASSED: @@ -2973,7 +3147,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() || ( MatcherB() || MatcherC() ) ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) Matchers.tests.cpp:<line number>: PASSED: @@ -2985,7 +3159,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true ) ------------------------------------------------------------------------------- @@ -3002,7 +3176,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0, !MatcherA() ) with expansion: - 0 not equals: (int) 1 or (float) 1.0f + 0 not equals: (int) 1 or (string) "1" Matchers.tests.cpp:<line number>: PASSED: with message: @@ -3011,7 +3185,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, !!MatcherA() ) with expansion: - 1 equals: (int) 1 or (float) 1.0f + 1 equals: (int) 1 or (string) "1" Matchers.tests.cpp:<line number>: PASSED: with message: @@ -3021,7 +3195,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0, !!!MatcherA() ) with expansion: - 0 not equals: (int) 1 or (float) 1.0f + 0 not equals: (int) 1 or (string) "1" Matchers.tests.cpp:<line number>: PASSED: with message: @@ -3030,7 +3204,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, !!!!MatcherA() ) with expansion: - 1 equals: (int) 1 or (float) 1.0f + 1 equals: (int) 1 or (string) "1" ------------------------------------------------------------------------------- Combining concrete matchers does not use templated matchers @@ -3058,7 +3232,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() || MatcherB() ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) Matchers.tests.cpp:<line number>: PASSED: with message: @@ -3068,7 +3242,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() && MatcherB() ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) Matchers.tests.cpp:<line number>: PASSED: with message: @@ -3079,7 +3253,7 @@ with message: Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() || !MatcherB() ) with expansion: - 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) + 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) ------------------------------------------------------------------------------- Combining templated and concrete matchers @@ -3519,13 +3693,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" @@ -3690,6 +3864,17 @@ Generators.tests.cpp:<line number>: PASSED: with expansion: 6 == 6 +------------------------------------------------------------------------------- +Cout stream properly declares it writes to stdout +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "-" )->isConsole() ) +with expansion: + true + ------------------------------------------------------------------------------- Custom exceptions can be translated when testing for nothrow ------------------------------------------------------------------------------- @@ -3761,6 +3946,26 @@ with expansion: == "{** unexpected enum value **}" +------------------------------------------------------------------------------- +Empty stream name opens cout stream +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "" )->isConsole() ) +with expansion: + true + +------------------------------------------------------------------------------- +Empty tag is not allowed +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) ) + ------------------------------------------------------------------------------- EndsWith string matcher ------------------------------------------------------------------------------- @@ -4119,12 +4324,12 @@ with expansion: "expected exception" ends with: "exception" Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) ) + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "except" ) ) with expansion: "expected exception" contains: "except" Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) ) + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) ) with expansion: "expected exception" contains: "except" (case insensitive) @@ -5411,6 +5616,35 @@ with expansion: ------------------------------------------------------------------------------- Generators internals Filter generator + Simple filtering +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Generators internals + Filter generator + Filter out multiple elements at the start and end ------------------------------------------------------------------------------- GeneratorsImpl.tests.cpp:<line number> ............................................................................... @@ -5435,8 +5669,19 @@ GeneratorsImpl.tests.cpp:<line number>: PASSED: with expansion: !false +------------------------------------------------------------------------------- +Generators internals + Filter generator + Throws on construction if it can't get initial element +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + GeneratorsImpl.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( filter([] (int) { return false; }, value(1)), Catch::GeneratorException ) + REQUIRE_THROWS_AS( filter([](int) { return false; }, value(1)), Catch::GeneratorException ) + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( filter([](int) { return false; }, values({ 1, 2, 3 })), Catch::GeneratorException ) ------------------------------------------------------------------------------- Generators internals @@ -6586,6 +6831,87 @@ Approx.tests.cpp:<line number>: PASSED: with expansion: 1.23 >= Approx( 1.24 ) +------------------------------------------------------------------------------- +Hashers with different seed produce different hash with same test case +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) != h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + != + 130711275 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashers with same seed produce same hash +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) == h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different test name +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2903002874 (0x<hex digits>) + != + 2668622104 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different classname +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2673152918 (0x<hex digits>) + != + 3916075712 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different tags +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2074929312 (0x<hex digits>) + != + 3429949824 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing test case produces same hash across multiple calls +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy ) == h( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + ------------------------------------------------------------------------------- INFO and WARN do not abort tests ------------------------------------------------------------------------------- @@ -6893,7 +7219,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) @@ -6905,13 +7231,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "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" ) ) + CHECK_THAT( testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) ) with expansion: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) @@ -6923,7 +7249,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) @@ -6935,7 +7261,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -6947,7 +7273,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), !Contains( "different" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "different" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "different" @@ -6958,39 +7284,198 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" ------------------------------------------------------------------------------- -Mismatching exception messages failing the test +Mayfail test case with nested sections + A + 1 ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Condition.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" +Condition.tests.cpp:<line number>: FAILED: ------------------------------------------------------------------------------- -Nested generators and captured variables +Mayfail test case with nested sections + A + 2 ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Condition.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - REQUIRE( values > -6 ) -with expansion: - 3 > -6 +Condition.tests.cpp:<line number>: FAILED: ------------------------------------------------------------------------------- -Nested generators and captured variables +Mayfail test case with nested sections + B + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +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" + +------------------------------------------------------------------------------- +Multireporter calls reporters and listeners in correct order +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( records == expected ) +with expansion: + { "Hello", "world", "Goodbye", "world" } + == + { "Hello", "world", "Goodbye", "world" } + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly + Adding listeners +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly + Adding reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +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> ............................................................................... @@ -7203,6 +7688,14 @@ 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) + Compilation.tests.cpp:<line number>: PASSED: with message: std::is_void<void>::value @@ -8563,155 +9056,401 @@ with expansion: true ------------------------------------------------------------------------------- -Pointers can be compared to null +Parsed tags are matched case insensitive ------------------------------------------------------------------------------- -Condition.tests.cpp:<line number> +TestSpecParser.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 ) +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.hasFilters() ) with expansion: - 0x<hex digits> != 0 + true -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( cp != 0 ) +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.getInvalidSpecs().empty() ) with expansion: - 0x<hex digits> != 0 + true -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( cpc != 0 ) +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches( testCase ) ) with expansion: - 0x<hex digits> != 0 + true -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( returnsNull() == 0 ) -with expansion: - {null string} == 0 +------------------------------------------------------------------------------- +Parsing sharding-related cli flags + shard-count +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( returnsConstNull() == 0 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "--shard-count=8" }) ) with expansion: - {null string} == 0 + {?} -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 0 != p ) +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.shardCount == 8 ) with expansion: - 0 != 0x<hex digits> + 8 == 8 ------------------------------------------------------------------------------- -Precision of floating point stringification can be set - Floats +Parsing sharding-related cli flags + Negative shard count reports error ------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( str1.size() == 3 + 5 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK_FALSE( result ) with expansion: - 8 == 8 + !{?} -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( str2.size() == 3 + 10 ) +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Shard count must be a positive number") ) with expansion: - 13 == 13 + "Shard count must be a positive number" contains: "Shard count must be a + positive number" ------------------------------------------------------------------------------- -Precision of floating point stringification can be set - Double +Parsing sharding-related cli flags + Zero shard count reports error ------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( str1.size() == 2 + 5 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK_FALSE( result ) with expansion: - 7 == 7 + !{?} -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( str2.size() == 2 + 15 ) +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Shard count must be a positive number") ) with expansion: - 17 == 17 + "Shard count must be a positive number" contains: "Shard count must be a + positive number" ------------------------------------------------------------------------------- -Predicate matcher can accept const char* +Parsing sharding-related cli flags + shard-index ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "foo", Predicate<const char*>( []( const char* const& ) { return true; } ) ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "--shard-index=2" }) ) with expansion: - "foo" matches undescribed predicate + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.shardIndex == 2 ) +with expansion: + 2 == 2 ------------------------------------------------------------------------------- -Process can be configured on command line - empty args don't cause a crash +Parsing sharding-related cli flags + Negative shard index reports error ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( result ) + CHECK_FALSE( result ) with expansion: - {?} + !{?} CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.processName == "" ) + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") ) with expansion: - "" == "" + "Shard index must be a non-negative number" contains: "Shard index must be a + non-negative number" ------------------------------------------------------------------------------- -Process can be configured on command line - default - no arguments +Parsing sharding-related cli flags + Shard index 0 is accepted ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( result ) + CHECK( cli.parse({ "test", "--shard-index=0" }) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.processName == "test" ) + REQUIRE( config.shardIndex == 0 ) with expansion: - "test" == "test" + 0 == 0 -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.shouldDebugBreak == false ) -with expansion: - false == false +------------------------------------------------------------------------------- +Parsing tags with non-alphabetical characters is pass-through +------------------------------------------------------------------------------- +TestSpecParser.tests.cpp:<line number> +............................................................................... -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.abortAfter == -1 ) +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.hasFilters() ) with expansion: - -1 == -1 + true +with message: + tagString := "[tag with spaces]" -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.noThrow == false ) +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.getInvalidSpecs().empty() ) with expansion: - false == false + true +with message: + tagString := "[tag with spaces]" -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.reporterName == "console" ) +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches( testCase ) ) with expansion: - "console" == "console" + true +with message: + tagString := "[tag with spaces]" + +------------------------------------------------------------------------------- +Parsing tags with non-alphabetical characters is pass-through +------------------------------------------------------------------------------- +TestSpecParser.tests.cpp:<line number> +............................................................................... + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.hasFilters() ) +with expansion: + true +with message: + tagString := "[I said "good day" sir!]" + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.getInvalidSpecs().empty() ) +with expansion: + true +with message: + tagString := "[I said "good day" sir!]" + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches( testCase ) ) +with expansion: + true +with message: + tagString := "[I said "good day" sir!]" + +------------------------------------------------------------------------------- +Parsing warnings + NoAssertions +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( cli.parse( { "test", "-w", "NoAssertions" } ) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.warnings == WarnAbout::NoAssertions ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +Parsing warnings + NoTests is no longer supported +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( cli.parse( { "test", "-w", "NoTests" } ) ) +with expansion: + !{?} + +------------------------------------------------------------------------------- +Parsing warnings + Combining multiple warnings +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +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.reporterSpecifications.empty() ) +with expansion: + true CmdLine.tests.cpp:<line number>: PASSED: CHECK_FALSE( cfg.hasTestFilters() ) with expansion: !false +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getReporterSpecs().size() == 1 ) +with expansion: + 1 == 1 + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } ) +with expansion: + {?} == {?} + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getProcessedReporterSpecs().size() == 1 ) +with expansion: + 1 == 1 + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } ) +with expansion: + {?} == {?} + ------------------------------------------------------------------------------- Process can be configured on command line test lists @@ -8805,14 +9544,18 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-r", "console"}) ) + CHECK( result ) with expansion: {?} +with message: + result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterName == "console" ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } ) with expansion: - "console" == "console" + { {?} } == { {?} } +with message: + result.errorMessage() := "" ------------------------------------------------------------------------------- Process can be configured on command line @@ -8823,14 +9566,18 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-r", "xml"}) ) + CHECK( result ) with expansion: {?} +with message: + result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterName == "xml" ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } ) with expansion: - "xml" == "xml" + { {?} } == { {?} } +with message: + result.errorMessage() := "" ------------------------------------------------------------------------------- Process can be configured on command line @@ -8841,27 +9588,18 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--reporter", "junit"}) ) + CHECK( result ) with expansion: {?} +with message: + result.errorMessage() := "" 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" }) ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } ) with expansion: - !{?} + { {?} } == { {?} } +with message: + result.errorMessage() := "" ------------------------------------------------------------------------------- Process can be configured on command line @@ -8877,62 +9615,164 @@ with expansion: true CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("Unrecognized reporter") ) + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Unrecognized reporter") ) with expansion: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" ------------------------------------------------------------------------------- Process can be configured on command line - debugger - -b + reporter + With output file ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-b"}) ) + CHECK( result ) with expansion: {?} +with message: + result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.shouldDebugBreak == true ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } ) with expansion: - true == true + { {?} } == { {?} } +with message: + result.errorMessage() := "" ------------------------------------------------------------------------------- Process can be configured on command line - debugger - --break + reporter + With Windows-like absolute path as output file ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--break"}) ) + CHECK( result ) with expansion: {?} +with message: + result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.shouldDebugBreak ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } ) with expansion: - true + { {?} } == { {?} } +with message: + result.errorMessage() := "" ------------------------------------------------------------------------------- Process can be configured on command line - abort - -a aborts after first failure + reporter + Multiple reporters + All with output files ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-a"}) ) + CHECK( cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.abortAfter == 1 ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } ) +with expansion: + { {?}, {?} } == { {?}, {?} } + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + Multiple reporters + Mixed output files and default output +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } ) +with expansion: + { {?}, {?} } == { {?}, {?} } + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + Multiple reporters + cannot have multiple reporters with default output +------------------------------------------------------------------------------- +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(), ContainsSubstring("Only one reporter may have unspecified output file.") ) +with expansion: + "Only one reporter may have unspecified output file." contains: "Only one + reporter may have unspecified output file." + +------------------------------------------------------------------------------- +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 @@ -8968,7 +9808,7 @@ with expansion: true CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("convert") && Contains("oops") ) + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") ) with expansion: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) @@ -9064,7 +9904,7 @@ with expansion: true CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("never") && Contains("both") ) + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") ) with expansion: "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) @@ -9119,7 +9959,7 @@ with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.outputFilename == "filename.ext" ) + REQUIRE( config.defaultOutputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" @@ -9137,7 +9977,7 @@ with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.outputFilename == "filename.ext" ) + REQUIRE( config.defaultOutputFilename == "filename.ext" ) with expansion: "filename.ext" == "filename.ext" @@ -9183,7 +10023,7 @@ with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::Auto ) + REQUIRE( config.defaultColourMode == ColourMode::PlatformDefault ) with expansion: 0 == 0 @@ -9196,12 +10036,12 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--use-colour", "auto"}) ) + CHECK( cli.parse( { "test", "--colour-mode", "default" } ) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::Auto ) + REQUIRE( config.defaultColourMode == ColourMode::PlatformDefault ) with expansion: 0 == 0 @@ -9214,12 +10054,12 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--use-colour", "yes"}) ) + CHECK( cli.parse({"test", "--colour-mode", "ansi"}) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::Yes ) + REQUIRE( config.defaultColourMode == ColourMode::ANSI ) with expansion: 1 == 1 @@ -9232,14 +10072,14 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--use-colour", "no"}) ) + CHECK( cli.parse({"test", "--colour-mode", "none"}) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::No ) + REQUIRE( config.defaultColourMode == ColourMode::None ) with expansion: - 2 == 2 + 3 == 3 ------------------------------------------------------------------------------- Process can be configured on command line @@ -9255,10 +10095,10 @@ with expansion: true CmdLine.tests.cpp:<line number>: PASSED: - CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ) + CHECK_THAT( result.errorMessage(), ContainsSubstring( "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" + "colour mode must be one of: default, ansi, win32, or none. 'wrong' is not + recognised" contains: "colour mode must be one of" ------------------------------------------------------------------------------- Process can be configured on command line @@ -9383,6 +10223,42 @@ Misc.tests.cpp:<line number>: PASSED: with expansion: 1 >= 1 +------------------------------------------------------------------------------- +Random seed generation accepts known methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::generateRandomSeed(method) ) + +------------------------------------------------------------------------------- +Random seed generation accepts known methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::generateRandomSeed(method) ) + +------------------------------------------------------------------------------- +Random seed generation accepts known methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::generateRandomSeed(method) ) + +------------------------------------------------------------------------------- +Random seed generation reports unknown methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) ) + ------------------------------------------------------------------------------- Range type with sentinel ------------------------------------------------------------------------------- @@ -9429,6 +10305,18 @@ with expansion: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively +------------------------------------------------------------------------------- +Registering reporter with '::' in name fails +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" ) +with expansion: + "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is + not allowed in reporter name: 'with::doublecolons'" + ------------------------------------------------------------------------------- Regression test #1 ------------------------------------------------------------------------------- @@ -9453,13 +10341,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - automake reporter lists tags + Automake reporter lists tags ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9467,7 +10355,7 @@ with expansion: " contains: "fakeTag" with message: - Tested reporter: automake + Tested reporter: Automake ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9482,20 +10370,20 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - automake reporter lists reporters + Automake reporter lists reporters ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description " contains: "fake reporter" with message: - Tested reporter: automake + Tested reporter: Automake ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9510,13 +10398,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - automake reporter lists tests + Automake reporter lists tests ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9525,7 +10413,7 @@ with expansion: " ( contains: "fake test name" and contains: "fakeTestTag" ) with message: - Tested reporter: automake + Tested reporter: Automake ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9546,7 +10434,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9575,7 +10463,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -9603,7 +10491,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9633,7 +10521,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9662,7 +10550,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -9690,7 +10578,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9714,13 +10602,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - junit reporter lists tags + JUnit reporter lists tags ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> All available tags: @@ -9729,7 +10617,7 @@ with expansion: " contains: "fakeTag" with message: - Tested reporter: junit + Tested reporter: JUnit ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9744,13 +10632,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - junit reporter lists reporters + JUnit reporter lists reporters ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: @@ -9758,7 +10646,7 @@ with expansion: " contains: "fake reporter" with message: - Tested reporter: junit + Tested reporter: JUnit ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9773,13 +10661,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - junit reporter lists tests + JUnit reporter lists tests ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: @@ -9789,7 +10677,7 @@ with expansion: " ( contains: "fake test name" and contains: "fakeTestTag" ) with message: - Tested reporter: junit + Tested reporter: JUnit ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9804,13 +10692,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - sonarqube reporter lists tags + SonarQube reporter lists tags ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> All available tags: @@ -9819,7 +10707,7 @@ with expansion: " contains: "fakeTag" with message: - Tested reporter: sonarqube + Tested reporter: SonarQube ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9834,13 +10722,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - sonarqube reporter lists reporters + SonarQube reporter lists reporters ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: @@ -9848,7 +10736,7 @@ with expansion: " contains: "fake reporter" with message: - Tested reporter: sonarqube + Tested reporter: SonarQube ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9863,13 +10751,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - sonarqube reporter lists tests + SonarQube reporter lists tests ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: @@ -9879,7 +10767,7 @@ with expansion: " ( contains: "fake test name" and contains: "fakeTestTag" ) with message: - Tested reporter: sonarqube + Tested reporter: SonarQube ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9894,13 +10782,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - tap reporter lists tags + TAP reporter lists tags ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9908,7 +10796,7 @@ with expansion: " contains: "fakeTag" with message: - Tested reporter: tap + Tested reporter: TAP ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9923,20 +10811,20 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - tap reporter lists reporters + TAP reporter lists reporters ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description " contains: "fake reporter" with message: - Tested reporter: tap + Tested reporter: TAP ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9951,13 +10839,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - tap reporter lists tests + TAP reporter lists tests ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9966,7 +10854,7 @@ with expansion: " ( contains: "fake test name" and contains: "fakeTestTag" ) with message: - Tested reporter: tap + Tested reporter: TAP ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -9981,13 +10869,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - teamcity reporter lists tags + TeamCity reporter lists tags ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9995,7 +10883,7 @@ with expansion: " contains: "fakeTag" with message: - Tested reporter: teamcity + Tested reporter: TeamCity ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -10010,20 +10898,20 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - teamcity reporter lists reporters + TeamCity reporter lists reporters ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description " contains: "fake reporter" with message: - Tested reporter: teamcity + Tested reporter: TeamCity ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -10038,13 +10926,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - teamcity reporter lists tests + TeamCity reporter lists tests ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -10053,7 +10941,7 @@ with expansion: " ( contains: "fake test name" and contains: "fakeTestTag" ) with message: - Tested reporter: teamcity + Tested reporter: TeamCity ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -10068,13 +10956,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - xml reporter lists tags + XML reporter lists tags ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> <TagsFromMatchingTests> @@ -10086,7 +10974,7 @@ with expansion: </Tag> </TagsFromMatchingTests>" contains: "fakeTag" with message: - Tested reporter: xml + Tested reporter: XML ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -10101,13 +10989,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - xml reporter lists reporters + XML reporter lists reporters ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> <AvailableReporters> @@ -10117,7 +11005,7 @@ with expansion: </Reporter> </AvailableReporters>" contains: "fake reporter" with message: - Tested reporter: xml + Tested reporter: XML ------------------------------------------------------------------------------- Reporter's write listings to provided stream @@ -10132,13 +11020,13 @@ with expansion: ------------------------------------------------------------------------------- Reporter's write listings to provided stream - xml reporter lists tests + XML reporter lists tests ------------------------------------------------------------------------------- Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> <MatchingTests> @@ -10153,7 +11041,16 @@ with expansion: </TestCase> </MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with message: - Tested reporter: xml + Tested reporter: XML + +------------------------------------------------------------------------------- +Reproducer for #2309 - a very long description past 80 chars (default console +width) with a late colon : blablabla +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- SUCCEED counts as a test pass @@ -10474,23 +11371,23 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( testStringForMatching(), Contains( "string" ) ) + REQUIRE_THAT( testStringForMatching(), ContainsSubstring( "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 ) ) + REQUIRE_THAT( testStringForMatching(), ContainsSubstring( "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" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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 ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) @@ -10579,6 +11476,30 @@ String.tests.cpp:<line number>: PASSED: String.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( original.data() ) +------------------------------------------------------------------------------- +StringRef + Copy construction is shallow +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( original.begin() == copy.begin() ) +with expansion: + "original string" == "original string" + +------------------------------------------------------------------------------- +StringRef + Copy assignment is shallow +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( original.begin() == copy.begin() ) +with expansion: + "original string" == "original string" + ------------------------------------------------------------------------------- StringRef Substrings @@ -11035,28 +11956,28 @@ Tag.tests.cpp:<line number> ............................................................................... Tag.tests.cpp:<line number>: PASSED: - CHECK_THAT( what, Contains( "[@zzz]" ) ) + CHECK_THAT( what, ContainsSubstring( "[@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" ) ) + CHECK_THAT( what, ContainsSubstring( "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" ) ) + CHECK_THAT( what, ContainsSubstring( "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" ) ) + CHECK_THAT( what, ContainsSubstring( "10" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 @@ -11081,6 +12002,22 @@ Tag.tests.cpp:<line number>: PASSED: Tag.tests.cpp:<line number>: PASSED: CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) ) +------------------------------------------------------------------------------- +Tags with spaces and non-alphanumerical characters are accepted +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testCase.tags.size() == 2 ) +with expansion: + 2 == 2 + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) ) +with expansion: + { {?}, {?} } ( Contains: {?} and Contains: {?} ) + ------------------------------------------------------------------------------- Template test case method with test types specified inside std::tuple - MyTypes - 0 @@ -12358,6 +13295,22 @@ Misc.tests.cpp:<line number>: PASSED: with expansion: 15 >= 15 +------------------------------------------------------------------------------- +Test case with identical tags keeps just one +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testCase.tags.size() == 1 ) +with expansion: + 1 == 1 + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testCase.tags[0] == Tag( "tag1" ) ) +with expansion: + {?} == {?} + ------------------------------------------------------------------------------- Test case with one argument ------------------------------------------------------------------------------- @@ -12451,7 +13404,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("[fakeTag]"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("[fakeTag]"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -12467,12 +13420,12 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) ) with expansion: "Available reporters: fake reporter: fake description -" contains: "fake reporter" +" ( contains: "fake reporter" and contains: "fake description" ) ------------------------------------------------------------------------------- The default listing implementation write to provided stream @@ -12482,7 +13435,7 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -12491,6 +13444,21 @@ with expansion: " ( contains: "fake test name" and contains: "fakeTestTag" ) +------------------------------------------------------------------------------- +The default listing implementation write to provided stream + Listing listeners +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) ) +with expansion: + "Registered listeners: + fakeListener: fake description + +" ( contains: "fakeListener" and contains: "fake description" ) + ------------------------------------------------------------------------------- This test 'should' fail but doesn't ------------------------------------------------------------------------------- @@ -13032,78 +14000,520 @@ with expansion: 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 + 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 + +------------------------------------------------------------------------------- +Upcasting special member functions + Move constructor +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( bptr->i == 3 ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +Upcasting special member functions + move assignment +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( bptr->i == 3 ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Basic usage +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllMatch(SizeIs(5)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } all match has size == 5 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllMatch(Contains(0) && Contains(1)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains + element 1 ) + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Type requires ADL found begin and end +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) ) +with expansion: + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, allMatch ) +with expansion: + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !allMatch ) +with expansion: + { 1, 2, 3, 4, 5 } not all match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + All true evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllTrue() ) +with expansion: + { true, true, true, true, true } contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + Empty evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllTrue() ) +with expansion: + { } contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + One false evalutes to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { true, true, false, true, true } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + All false evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { false, false, false, false, false } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Contained type is convertible to bool + All true evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllTrue() ) +with expansion: + { true, true, true, true, true } contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Contained type is convertible to bool + One false evalutes to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { true, true, false, true, true } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Contained type is convertible to bool + All false evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { false, false, false, false, false } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, AllTrue() ) +with expansion: + { true, true, true, true, true } contains only true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !AllTrue() ) +with expansion: + { true, true, false, true, true } not contains only true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Basic usage +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyMatch(SizeIs(5)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } any match has size == 5 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AnyMatch(Contains(0) && Contains(10)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains + element 10 ) + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Type requires ADL found begin and end +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) ) +with expansion: + { 1, 2, 3, 4, 5 } any match matches undescribed predicate + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !anyMatch ) +with expansion: + { 1, 2, 3, 4, 5 } not any match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, anyMatch ) +with expansion: + { 1, 2, 3, 4, 5 } any match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[1] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[2] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Basic usage + All true evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyTrue() ) +with expansion: + { true, true, true, true, true } contains at least one true ------------------------------------------------------------------------------- -Unexpected exceptions can be translated +Usage of AnyTrue range matcher + Basic usage + Empty evaluates to false ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +MatchersRanges.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: FAILED: -due to unexpected exception with message: - 3.14 +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AnyTrue() ) +with expansion: + { } not contains at least one true ------------------------------------------------------------------------------- -Upcasting special member functions - Move constructor +Usage of AnyTrue range matcher + Basic usage + One true evalutes to true ------------------------------------------------------------------------------- -UniquePtr.tests.cpp:<line number> +MatchersRanges.tests.cpp:<line number> ............................................................................... -UniquePtr.tests.cpp:<line number>: PASSED: - REQUIRE( bptr->i == 3 ) +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyTrue() ) with expansion: - 3 == 3 + { false, false, true, false, false } contains at least one true ------------------------------------------------------------------------------- -Upcasting special member functions - move assignment +Usage of AnyTrue range matcher + Basic usage + All false evaluates to false ------------------------------------------------------------------------------- -UniquePtr.tests.cpp:<line number> +MatchersRanges.tests.cpp:<line number> ............................................................................... -UniquePtr.tests.cpp:<line number>: PASSED: - REQUIRE( bptr->i == 3 ) +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AnyTrue() ) with expansion: - 3 == 3 + { false, false, false, false, false } not contains at least one true ------------------------------------------------------------------------------- -Usage of AllMatch range matcher - Basic usage +Usage of AnyTrue range matcher + Contained type is convertible to bool + All true evaluates to true ------------------------------------------------------------------------------- MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( data, AllMatch(SizeIs(5)) ) + REQUIRE_THAT( data, AnyTrue() ) with expansion: - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 - }, { 1, 0, 0, -1, 5 } } all match has size == 5 + { true, true, true, true, true } contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Contained type is convertible to bool + One true evalutes to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( data, !AllMatch(Contains(0) && Contains(1)) ) + REQUIRE_THAT( data, AnyTrue() ) with expansion: - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 - }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains - element 1 ) + { false, false, true, false, false } contains at least one true ------------------------------------------------------------------------------- -Usage of AllMatch range matcher - Type requires ADL found begin and end +Usage of AnyTrue range matcher + Contained type is convertible to bool + All false evaluates to false ------------------------------------------------------------------------------- MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) ) + REQUIRE_THAT( data, !AnyTrue() ) with expansion: - { 1, 2, 3, 4, 5 } all match matches undescribed predicate + { false, false, false, false, false } not contains at least one true ------------------------------------------------------------------------------- -Usage of AllMatch range matcher +Usage of AnyTrue range matcher Shortcircuiting All are read ------------------------------------------------------------------------------- @@ -13111,37 +14521,37 @@ MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( mocked, allMatch ) + REQUIRE_THAT( mocked, AnyTrue() ) with expansion: - { 1, 2, 3, 4, 5 } all match matches undescribed predicate + { false, false, false, false, true } contains at least one true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[0] ) + REQUIRE( mocked.m_derefed[0] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[1] ) + REQUIRE( mocked.m_derefed[1] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[2] ) + REQUIRE( mocked.m_derefed[2] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[3] ) + REQUIRE( mocked.m_derefed[3] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[4] ) + REQUIRE( mocked.m_derefed[4] ) with expansion: true ------------------------------------------------------------------------------- -Usage of AllMatch range matcher +Usage of AnyTrue range matcher Shortcircuiting Short-circuited ------------------------------------------------------------------------------- @@ -13149,69 +14559,69 @@ MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( mocked, !allMatch ) + REQUIRE_THAT( mocked, AnyTrue() ) with expansion: - { 1, 2, 3, 4, 5 } not all match matches undescribed predicate + { false, false, true, true, true } contains at least one true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[0] ) + REQUIRE( mocked.m_derefed[0] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[1] ) + REQUIRE( mocked.m_derefed[1] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[2] ) + REQUIRE( mocked.m_derefed[2] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[3] ) + REQUIRE_FALSE( mocked.m_derefed[3] ) with expansion: !false MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[4] ) + REQUIRE_FALSE( mocked.m_derefed[4] ) with expansion: !false ------------------------------------------------------------------------------- -Usage of AnyMatch range matcher +Usage of NoneMatch range matcher Basic usage ------------------------------------------------------------------------------- MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( data, AnyMatch(SizeIs(5)) ) + REQUIRE_THAT( data, NoneMatch(SizeIs(6)) ) with expansion: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 - }, { 1, 0, 0, -1, 5 } } any match has size == 5 + }, { 1, 0, 0, -1, 5 } } none match has size == 6 MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( data, !AnyMatch(Contains(0) && Contains(10)) ) + REQUIRE_THAT( data, !NoneMatch(Contains(0) && Contains(1)) ) with expansion: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 - }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains - element 10 ) + }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains + element 1 ) ------------------------------------------------------------------------------- -Usage of AnyMatch range matcher +Usage of NoneMatch range matcher Type requires ADL found begin and end ------------------------------------------------------------------------------- MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) ) + REQUIRE_THAT( needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) ) with expansion: - { 1, 2, 3, 4, 5 } any match matches undescribed predicate + { 1, 2, 3, 4, 5 } none match matches undescribed predicate ------------------------------------------------------------------------------- -Usage of AnyMatch range matcher +Usage of NoneMatch range matcher Shortcircuiting All are read ------------------------------------------------------------------------------- @@ -13219,37 +14629,37 @@ MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( mocked, !anyMatch ) + REQUIRE_THAT( mocked, noneMatch ) with expansion: - { 1, 2, 3, 4, 5 } not any match matches undescribed predicate + { 1, 2, 3, 4, 5 } none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[0] ) + REQUIRE( mocked.m_derefed[0] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[1] ) + REQUIRE( mocked.m_derefed[1] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[2] ) + REQUIRE( mocked.m_derefed[2] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[3] ) + REQUIRE( mocked.m_derefed[3] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[4] ) + REQUIRE( mocked.m_derefed[4] ) with expansion: true ------------------------------------------------------------------------------- -Usage of AnyMatch range matcher +Usage of NoneMatch range matcher Shortcircuiting Short-circuited ------------------------------------------------------------------------------- @@ -13257,69 +14667,128 @@ MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( mocked, anyMatch ) + REQUIRE_THAT( mocked, !noneMatch ) with expansion: - { 1, 2, 3, 4, 5 } any match matches undescribed predicate + { 1, 2, 3, 4, 5 } not none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[0] ) + REQUIRE( mocked.m_derefed[0] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[1] ) + REQUIRE_FALSE( mocked.m_derefed[1] ) with expansion: !false MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[2] ) + REQUIRE_FALSE( mocked.m_derefed[2] ) with expansion: !false MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[3] ) + REQUIRE_FALSE( mocked.m_derefed[3] ) with expansion: !false MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[4] ) + REQUIRE_FALSE( mocked.m_derefed[4] ) with expansion: !false ------------------------------------------------------------------------------- -Usage of NoneMatch range matcher +Usage of NoneTrue range matcher Basic usage + All true evaluates to false ------------------------------------------------------------------------------- MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( data, NoneMatch(SizeIs(6)) ) + REQUIRE_THAT( data, !NoneTrue() ) with expansion: - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 - }, { 1, 0, 0, -1, 5 } } none match has size == 6 + { true, true, true, true, true } not contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Basic usage + Empty evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( data, !NoneMatch(Contains(0) && Contains(1)) ) + REQUIRE_THAT( data, NoneTrue() ) with expansion: - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 - }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains - element 1 ) + { } contains no true ------------------------------------------------------------------------------- -Usage of NoneMatch range matcher - Type requires ADL found begin and end +Usage of NoneTrue range matcher + Basic usage + One true evalutes to false ------------------------------------------------------------------------------- MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) ) + REQUIRE_THAT( data, !NoneTrue() ) with expansion: - { 1, 2, 3, 4, 5 } none match matches undescribed predicate + { false, false, true, false, false } not contains no true ------------------------------------------------------------------------------- -Usage of NoneMatch range matcher +Usage of NoneTrue range matcher + Basic usage + All false evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, NoneTrue() ) +with expansion: + { false, false, false, false, false } contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Contained type is convertible to bool + All true evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !NoneTrue() ) +with expansion: + { true, true, true, true, true } not contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Contained type is convertible to bool + One true evalutes to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !NoneTrue() ) +with expansion: + { false, false, true, false, false } not contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Contained type is convertible to bool + All false evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, NoneTrue() ) +with expansion: + { false, false, false, false, false } contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher Shortcircuiting All are read ------------------------------------------------------------------------------- @@ -13327,37 +14796,37 @@ MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( mocked, noneMatch ) + REQUIRE_THAT( mocked, NoneTrue() ) with expansion: - { 1, 2, 3, 4, 5 } none match matches undescribed predicate + { false, false, false, false, false } contains no true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[0] ) + REQUIRE( mocked.m_derefed[0] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[1] ) + REQUIRE( mocked.m_derefed[1] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[2] ) + REQUIRE( mocked.m_derefed[2] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[3] ) + REQUIRE( mocked.m_derefed[3] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[4] ) + REQUIRE( mocked.m_derefed[4] ) with expansion: true ------------------------------------------------------------------------------- -Usage of NoneMatch range matcher +Usage of NoneTrue range matcher Shortcircuiting Short-circuited ------------------------------------------------------------------------------- @@ -13365,32 +14834,32 @@ MatchersRanges.tests.cpp:<line number> ............................................................................... MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( mocked, !noneMatch ) + REQUIRE_THAT( mocked, !NoneTrue() ) with expansion: - { 1, 2, 3, 4, 5 } not none match matches undescribed predicate + { false, false, true, true, true } not contains no true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE( mocked.derefed[0] ) + REQUIRE( mocked.m_derefed[0] ) with expansion: true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[1] ) + REQUIRE( mocked.m_derefed[1] ) with expansion: - !false + true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[2] ) + REQUIRE( mocked.m_derefed[2] ) with expansion: - !false + true MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[3] ) + REQUIRE_FALSE( mocked.m_derefed[3] ) with expansion: !false MatchersRanges.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( mocked.derefed[4] ) + REQUIRE_FALSE( mocked.m_derefed[4] ) with expansion: !false @@ -13939,32 +15408,6 @@ 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 ------------------------------------------------------------------------------- @@ -14116,7 +15559,7 @@ Xml.tests.cpp:<line number> ............................................................................... Xml.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") ) + REQUIRE_THAT( stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") ) with expansion: "<?xml version="1.0" encoding="UTF-8"?> <Element1 attr1="true" attr2="false"/> @@ -14214,17 +15657,6 @@ ToStringVector.tests.cpp:<line number>: PASSED: 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 - ------------------------------------------------------------------------------- benchmark function call without chronometer @@ -14772,6 +16204,60 @@ Tricky.tests.cpp:<line number> No assertions in test case 'has printf' +------------------------------------------------------------------------------- +is_unary_function +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<int>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<std::string const&>::value) + ------------------------------------------------------------------------------- just failure ------------------------------------------------------------------------------- @@ -15005,6 +16491,15 @@ with expansion: with message: Testing if fib[7] (21) is even +------------------------------------------------------------------------------- +makeStream recognizes %debug stream name +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::makeStream( "%debug" ) ) + ------------------------------------------------------------------------------- make_unique reimplementation From lvalue copies @@ -15591,6 +17086,15 @@ StringManip.tests.cpp:<line number>: PASSED: with expansion: "didn|'t" == "didn|'t" +------------------------------------------------------------------------------- +request an unknown %-starting stream fails +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::makeStream( "%somestream" ) ) + ------------------------------------------------------------------------------- resolution ------------------------------------------------------------------------------- @@ -15808,9 +17312,9 @@ Tag.tests.cpp:<line number> ............................................................................... Tag.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) ) + REQUIRE_THAT( testcase.tags, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) ) with expansion: - { ., magic-tag } ( Contains: magic-tag and Contains: . ) + { {?}, {?} } ( Contains: {?} and Contains: {?} ) ------------------------------------------------------------------------------- splitString @@ -15855,6 +17359,27 @@ with messages: 5 6 +------------------------------------------------------------------------------- +startsWith +------------------------------------------------------------------------------- +StringManip.tests.cpp:<line number> +............................................................................... + +StringManip.tests.cpp:<line number>: PASSED: + CHECK_FALSE( startsWith("", 'c') ) +with expansion: + !false + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( startsWith(std::string("abc"), 'a') ) +with expansion: + true + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( startsWith("def"_catch_sr, 'd') ) +with expansion: + true + ------------------------------------------------------------------------------- std::map is convertible string empty @@ -15967,15 +17492,20 @@ with expansion: "{ { "green", 55 } }" ------------------------------------------------------------------------------- -string literals of different sizes can be compared +stdout and stderr streams have %-starting name ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Stream.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: FAILED: - REQUIRE( std::string( "first" ) == "second" ) +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "%stderr" )->isConsole() ) +with expansion: + true + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "%stdout" )->isConsole() ) with expansion: - "first" == "second" + true ------------------------------------------------------------------------------- stringify ranges @@ -16381,19 +17911,6 @@ ToStringTuple.tests.cpp:<line number>: PASSED: 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> ------------------------------------------------------------------------------- @@ -16933,6 +18450,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 368 | 276 passed | 86 failed | 6 failed as expected -assertions: 2120 | 1951 passed | 146 failed | 23 failed as expected +test cases: 394 | 304 passed | 83 failed | 7 failed as expected +assertions: 2299 | 2129 passed | 143 failed | 27 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt new file mode 100644 index 000000000..9cba323d9 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -0,0 +1,18447 @@ +Filters: ~[!nonportable]~[!benchmark]~[approvals] * +Randomness seeded to: 1 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +<exe-name> is a Catch2 v<version> host application. +Run with -? for options + +------------------------------------------------------------------------------- +# A test name that starts with a # +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: +with message: + yay + +------------------------------------------------------------------------------- +#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: + +------------------------------------------------------------------------------- +#1319: Sections can have description (even if it is not saved + SectionName +------------------------------------------------------------------------------- +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' + +------------------------------------------------------------------------------- +#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 + +------------------------------------------------------------------------------- +#1905 -- test spec parser properly clears internal state between compound tests +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches(*fakeTestCase("spec . char")) ) +with expansion: + true + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches(*fakeTestCase("spec , char")) ) +with expansion: + true + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( spec.matches(*fakeTestCase(R"(spec \, char)")) ) +with expansion: + !false + +------------------------------------------------------------------------------- +#1912 -- test spec parser handles escaping + Various parentheses +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches(*fakeTestCase(R"(spec {a} char)")) ) +with expansion: + true + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches(*fakeTestCase(R"(spec [a] char)")) ) +with expansion: + true + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( spec.matches(*fakeTestCase("differs but has similar tag", "[a]")) ) +with expansion: + !false + +------------------------------------------------------------------------------- +#1912 -- test spec parser handles escaping + backslash in test name +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches(*fakeTestCase(R"(spec \ char)")) ) +with expansion: + true + +------------------------------------------------------------------------------- +#1913 - GENERATE inside a for loop should not keep recreating the generator +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( counter < 7 ) +with expansion: + 3 < 7 + +------------------------------------------------------------------------------- +#1913 - GENERATE inside a for loop should not keep recreating the generator +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( counter < 7 ) +with expansion: + 6 < 7 + +------------------------------------------------------------------------------- +#1913 - GENERATEs can share a line +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i != j ) +with expansion: + 1 != 3 + +------------------------------------------------------------------------------- +#1913 - GENERATEs can share a line +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i != j ) +with expansion: + 1 != 4 + +------------------------------------------------------------------------------- +#1913 - GENERATEs can share a line +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i != j ) +with expansion: + 2 != 3 + +------------------------------------------------------------------------------- +#1913 - GENERATEs can share a line +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i != j ) +with expansion: + 2 != 4 + +------------------------------------------------------------------------------- +#1938 - GENERATE after a section + A +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with message: + A + +------------------------------------------------------------------------------- +#1938 - GENERATE after a section + B +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 1 + +------------------------------------------------------------------------------- +#1938 - GENERATE after a section + B +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 2 + +------------------------------------------------------------------------------- +#1938 - GENERATE after a section + B +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 3 + +------------------------------------------------------------------------------- +#1938 - Section followed by flat generate + A +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( 1 ) + +------------------------------------------------------------------------------- +#1938 - Section followed by flat generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 2 + +------------------------------------------------------------------------------- +#1938 - Section followed by flat generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 3 + +------------------------------------------------------------------------------- +#1938 - flat generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 1 + +------------------------------------------------------------------------------- +#1938 - flat generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 2 + +------------------------------------------------------------------------------- +#1938 - flat generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 3 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates + A +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with message: + A + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 1 + j := 3 + k := 5 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates + B +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with message: + B + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 1 + j := 3 + k := 6 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates + B +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with message: + B + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 1 + j := 4 + k := 5 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 1 + j := 4 + k := 6 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates + A +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with message: + A + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 2 + j := 3 + k := 5 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates + B +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with message: + B + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 2 + j := 3 + k := 6 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates + B +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with message: + B + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 2 + j := 4 + k := 5 + +------------------------------------------------------------------------------- +#1938 - mixed sections and generates +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: +with messages: + i := 2 + j := 4 + k := 6 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 1 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 1 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 1 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 2 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 1 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 3 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 2 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 1 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 2 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 2 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 2 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 3 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 3 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 1 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 3 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 2 + +------------------------------------------------------------------------------- +#1938 - nested generate +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( m ) +with expansion: + 3 + +PartTracker.tests.cpp:<line number>: PASSED: + REQUIRE( n ) +with expansion: + 3 + +------------------------------------------------------------------------------- +#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +#2152 - ULP checks between differently signed values were wrong - double +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) ) +with expansion: + 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, + 4.9406564584124654e-324]) + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) ) +with expansion: + 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e- + 324, -0.0000000000000000e+00]) + +------------------------------------------------------------------------------- +#2152 - ULP checks between differently signed values were wrong - float +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) ) +with expansion: + 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) ) +with expansion: + 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0. + 00000000e+00]) + +------------------------------------------------------------------------------- +#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::Matchers::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 Catch2 +------------------------------------------------------------------------------- +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_after == 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 + +------------------------------------------------------------------------------- +Assertion macros support bit operators and bool conversions +------------------------------------------------------------------------------- +Compilation.tests.cpp:<line number> +............................................................................... + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( lhs | rhs ) +with expansion: + Val: 1 | Val: 2 + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lhs & rhs ) +with expansion: + !(Val: 1 & Val: 2) + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( HasBitOperators{ 1 } & HasBitOperators{ 1 } ) +with expansion: + Val: 1 & Val: 1 + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( lhs ^ rhs ) +with expansion: + Val: 1 ^ Val: 2 + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lhs ^ lhs ) +with expansion: + !(Val: 1 ^ Val: 1) + +------------------------------------------------------------------------------- +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 ) + +------------------------------------------------------------------------------- +Basic use of the Contains range matcher + Different argument ranges, same element type, default comparison +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( a, Contains(1) ) +with expansion: + { 1, 2, 3 } contains element 1 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( b, Contains(1) ) +with expansion: + { 0, 1, 2 } contains element 1 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( c, !Contains(1) ) +with expansion: + { 4, 5, 6 } not contains element 1 + +------------------------------------------------------------------------------- +Basic use of the Contains range matcher + Different argument ranges, same element type, custom comparison +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( a, Contains(0, close_enough) ) +with expansion: + { 1, 2, 3 } contains element 0 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( b, Contains(0, close_enough) ) +with expansion: + { 0, 1, 2 } contains element 0 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( c, !Contains(0, close_enough) ) +with expansion: + { 4, 5, 6 } not contains element 0 + +------------------------------------------------------------------------------- +Basic use of the Contains range matcher + Different element type, custom comparisons +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) ) +with expansion: + { "abc", "abcd", "abcde" } contains element 4 + +------------------------------------------------------------------------------- +Basic use of the Contains range matcher + Can handle type that requires ADL-found free function begin and end +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( in, Contains(1) ) +with expansion: + { 1, 2, 3, 4, 5 } contains element 1 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( in, !Contains(8) ) +with expansion: + { 1, 2, 3, 4, 5 } not contains element 8 + +------------------------------------------------------------------------------- +Basic use of the Contains range matcher + Initialization with move only types +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( in, Contains(MoveOnlyTestElement{ 2 }) ) +with expansion: + { 1, 2, 3 } contains element 2 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( in, !Contains(MoveOnlyTestElement{ 9 }) ) +with expansion: + { 1, 2, 3 } not contains element 9 + +------------------------------------------------------------------------------- +Basic use of the Contains range matcher + Matching using matcher +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( in, Contains(Catch::Matchers::WithinAbs(0.5, 0.5)) ) +with expansion: + { 1.0, 2.0, 3.0, 0.0 } contains element matching is within 0.5 of 0.5 + +------------------------------------------------------------------------------- +Basic use of the Empty range matcher + Simple, std-provided containers +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( empty_array, IsEmpty() ) +with expansion: + { } is empty + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( non_empty_array, !IsEmpty() ) +with expansion: + { 0.0 } not is empty + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( empty_vec, IsEmpty() ) +with expansion: + { } is empty + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( non_empty_vec, !IsEmpty() ) +with expansion: + { 'a', 'b', 'c' } not is empty + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( inner_lists_are_empty, !IsEmpty() ) +with expansion: + { { } } not is empty + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( inner_lists_are_empty.front(), IsEmpty() ) +with expansion: + { } is empty + +------------------------------------------------------------------------------- +Basic use of the Empty range matcher + Type with empty +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( has_empty{}, !IsEmpty() ) +with expansion: + {?} not is empty + +------------------------------------------------------------------------------- +Basic use of the Empty range matcher + Type requires ADL found empty free function +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( unrelated::ADL_empty{}, IsEmpty() ) +with expansion: + {?} is empty + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +CaseInsensitiveEqualsTo is case insensitive + Degenerate cases +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "", "" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( eq( "", "a" ) ) +with expansion: + !false + +------------------------------------------------------------------------------- +CaseInsensitiveEqualsTo is case insensitive + Plain comparisons +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "a", "a" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "a", "A" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "A", "a" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( eq( "A", "A" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( eq( "a", "b" ) ) +with expansion: + !false + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( eq( "a", "B" ) ) +with expansion: + !false + +------------------------------------------------------------------------------- +CaseInsensitiveLess is case insensitive + Degenerate cases +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "", "a" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lt( "a", "a" ) ) +with expansion: + !false + +Details.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lt( "", "" ) ) +with expansion: + !false + +------------------------------------------------------------------------------- +CaseInsensitiveLess is case insensitive + Plain comparisons +------------------------------------------------------------------------------- +Details.tests.cpp:<line number> +............................................................................... + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "a", "b" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "a", "B" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "A", "b" ) ) +with expansion: + true + +Details.tests.cpp:<line number>: PASSED: + REQUIRE( lt( "A", "B" ) ) +with expansion: + true + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Clara::Arg supports single-arg parse the way Opt does +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: + CHECK( name.empty() ) +with expansion: + true + +Clara.tests.cpp:<line number>: PASSED: + REQUIRE( name == "foo" ) +with expansion: + "foo" == "foo" + +------------------------------------------------------------------------------- +Clara::Opt supports accept-many lambdas + Parsing fails on multiple options without accept_many +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: + CHECK_FALSE( parse_result ) +with expansion: + !{?} + +------------------------------------------------------------------------------- +Clara::Opt supports accept-many lambdas + Parsing succeeds on multiple options with accept_many +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: + CHECK( parse_result ) +with expansion: + {?} + +Clara.tests.cpp:<line number>: PASSED: + CHECK( res == std::vector<std::string>{ "aaa", "bbb" } ) +with expansion: + { "aaa", "bbb" } == { "aaa", "bbb" } + +------------------------------------------------------------------------------- +ColourGuard behaviour + ColourGuard is disengaged by default +------------------------------------------------------------------------------- +ColourImpl.tests.cpp:<line number> +............................................................................... + +ColourImpl.tests.cpp:<line number>: PASSED: + REQUIRE( streamWrapper.str().empty() ) +with expansion: + true + +------------------------------------------------------------------------------- +ColourGuard behaviour + ColourGuard is engaged by op<< +------------------------------------------------------------------------------- +ColourImpl.tests.cpp:<line number> +............................................................................... + +ColourImpl.tests.cpp:<line number>: PASSED: + REQUIRE( streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" ) +with expansion: + "1 + Using code: 2 + 2 + Using code: 0 + 3 + " + == + "1 + Using code: 2 + 2 + Using code: 0 + 3 + " + +------------------------------------------------------------------------------- +ColourGuard behaviour + ColourGuard can be engaged explicitly +------------------------------------------------------------------------------- +ColourImpl.tests.cpp:<line number> +............................................................................... + +ColourImpl.tests.cpp:<line number>: PASSED: + REQUIRE( streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" ) +with expansion: + "Using code: 2 + A + B + Using code: 0 + C + " + == + "Using code: 2 + A + B + Using code: 0 + C + " + +------------------------------------------------------------------------------- +Combining MatchAllOfGeneric does not nest +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch:: + Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && MatcherC() ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) + 1 ) + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch:: + Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, MatcherA() && ( MatcherB() && MatcherC() ) ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) + 1 ) + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && + MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, + MatcherB, MatcherC, MatcherD>>:: value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) + 1 and equals: true ) + +------------------------------------------------------------------------------- +Combining MatchAnyOfGeneric does not nest +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch:: + Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || MatcherC() ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 + ) + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch:: + Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, MatcherA() || ( MatcherB() || MatcherC() ) ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 + ) + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || + MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, + MatcherB, MatcherC, MatcherD>>:: value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 + or equals: true ) + +------------------------------------------------------------------------------- +Combining MatchNotOfGeneric does not nest +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail:: + MatchNotOfGeneric<MatcherA>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0, !MatcherA() ) +with expansion: + 0 not equals: (int) 1 or (string) "1" + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, !!MatcherA() ) +with expansion: + 1 equals: (int) 1 or (string) "1" + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail:: + MatchNotOfGeneric<MatcherA>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0, !!!MatcherA() ) +with expansion: + 0 not equals: (int) 1 or (string) "1" + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, !!!!MatcherA() ) +with expansion: + 1 equals: (int) 1 or (string) "1" + +------------------------------------------------------------------------------- +Combining concrete matchers does not use templated matchers +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && + EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail:: + MatchAnyOf<std::string>>::value + +------------------------------------------------------------------------------- +Combining only templated matchers +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: + MatchAnyOfGeneric<MatcherA, MatcherB>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, MatcherA() || MatcherB() ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: + MatchAllOfGeneric<MatcherA, MatcherB>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, MatcherA() && MatcherB() ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) + +Matchers.tests.cpp:<line number>: PASSED: +with message: + std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail: + :MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric + <MatcherB>>>::value + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, MatcherA() || !MatcherB() ) +with expansion: + 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) + +------------------------------------------------------------------------------- +Combining templated and concrete matchers +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) ) +with expansion: + { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, + 3, 1 } ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) ) +with expansion: + "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } + and ends with: "bar" ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) ) +with expansion: + "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' + } and ends with: "bar" ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) ) +with expansion: + "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" + and ends with: "bar" ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) ) +with expansion: + "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: + "foo" and ends with: "bar" ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) ) +with expansion: + "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" + and ends with: "bar" ) ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) ) +with expansion: + "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', + 'f', 'b', 'a', 'r' } ) + +------------------------------------------------------------------------------- +Combining templated matchers +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) ) +with expansion: + { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 + } ) + +------------------------------------------------------------------------------- +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 generic matchers shortcircuit + MatchAllOf +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_FALSE( matcher.match( 1 ) ) +with expansion: + !false + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( first.matchCalled ) +with expansion: + true + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( !second.matchCalled ) +with expansion: + true + +------------------------------------------------------------------------------- +Composed generic matchers shortcircuit + MatchAnyOf +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK( matcher.match( 1 ) ) +with expansion: + true + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( first.matchCalled ) +with expansion: + true + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( !second.matchCalled ) +with expansion: + true + +------------------------------------------------------------------------------- +Composed matchers shortcircuit + MatchAllOf +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_FALSE( matcher.match( 1 ) ) +with expansion: + !false + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( first.matchCalled ) +with expansion: + true + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( !second.matchCalled ) +with expansion: + true + +------------------------------------------------------------------------------- +Composed matchers shortcircuit + MatchAnyOf +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK( matcher.match( 1 ) ) +with expansion: + true + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( first.matchCalled ) +with expansion: + true + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE( !second.matchCalled ) +with expansion: + true + +------------------------------------------------------------------------------- +Contains string matcher +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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(), ContainsSubstring( "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 + +------------------------------------------------------------------------------- +Cout stream properly declares it writes to stdout +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "-" )->isConsole() ) +with expansion: + true + +------------------------------------------------------------------------------- +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 **}" + +------------------------------------------------------------------------------- +Empty stream name opens cout stream +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "" )->isConsole() ) +with expansion: + true + +------------------------------------------------------------------------------- +Empty tag is not allowed +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) ) + +------------------------------------------------------------------------------- +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(), ContainsSubstring( "except" ) ) +with expansion: + "expected exception" contains: "except" + +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "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( -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 + Simple filtering +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Generators internals + Filter generator + Filter out multiple elements at the start and end +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Generators internals + Filter generator + Throws on construction if it can't get initial element +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( filter([](int) { return false; }, value(1)), Catch::GeneratorException ) + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( filter([](int) { return false; }, values({ 1, 2, 3 })), 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 ) + +------------------------------------------------------------------------------- +Hashers with different seed produce different hash with same test case +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) != h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + != + 130711275 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashers with same seed produce same hash +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) == h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different test name +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2903002874 (0x<hex digits>) + != + 2668622104 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different classname +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2673152918 (0x<hex digits>) + != + 3916075712 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different tags +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2074929312 (0x<hex digits>) + != + 3429949824 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing test case produces same hash across multiple calls +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy ) == h( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Lambdas in assertions +------------------------------------------------------------------------------- +Compilation.tests.cpp:<line number> +............................................................................... + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( []() { return true; }() ) +with expansion: + true + +------------------------------------------------------------------------------- +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(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "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(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "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(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "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(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "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(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "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(), !ContainsSubstring( "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(), !ContainsSubstring( "substring" ) ) +with expansion: + "this string contains 'abc' as a substring" not contains: "substring" + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +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" + +------------------------------------------------------------------------------- +Multireporter calls reporters and listeners in correct order +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( records == expected ) +with expansion: + { "Hello", "world", "Goodbye", "world" } + == + { "Hello", "world", "Goodbye", "world" } + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly + Adding listeners +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +Multireporter updates ReporterPreferences properly + Adding reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ) +with expansion: + false == false + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ) +with expansion: + true == true + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ) +with expansion: + true == true + +------------------------------------------------------------------------------- +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) + +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 + +------------------------------------------------------------------------------- +Overloaded comma or address-of operators are not used +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( &EvilMatcher(), EvilAddressOfOperatorUsed ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() ) + +------------------------------------------------------------------------------- +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 ) == false ) +with expansion: + false == false + +------------------------------------------------------------------------------- +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 ) == 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 + 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 + +------------------------------------------------------------------------------- +Parsed tags are matched case insensitive +------------------------------------------------------------------------------- +TestSpecParser.tests.cpp:<line number> +............................................................................... + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.hasFilters() ) +with expansion: + true + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.getInvalidSpecs().empty() ) +with expansion: + true + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches( testCase ) ) +with expansion: + true + +------------------------------------------------------------------------------- +Parsing sharding-related cli flags + shard-count +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "--shard-count=8" }) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.shardCount == 8 ) +with expansion: + 8 == 8 + +------------------------------------------------------------------------------- +Parsing sharding-related cli flags + Negative shard count reports error +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK_FALSE( result ) +with expansion: + !{?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Shard count must be a positive number") ) +with expansion: + "Shard count must be a positive number" contains: "Shard count must be a + positive number" + +------------------------------------------------------------------------------- +Parsing sharding-related cli flags + Zero shard count reports error +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK_FALSE( result ) +with expansion: + !{?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Shard count must be a positive number") ) +with expansion: + "Shard count must be a positive number" contains: "Shard count must be a + positive number" + +------------------------------------------------------------------------------- +Parsing sharding-related cli flags + shard-index +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "--shard-index=2" }) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.shardIndex == 2 ) +with expansion: + 2 == 2 + +------------------------------------------------------------------------------- +Parsing sharding-related cli flags + Negative shard index reports error +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK_FALSE( result ) +with expansion: + !{?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") ) +with expansion: + "Shard index must be a non-negative number" contains: "Shard index must be a + non-negative number" + +------------------------------------------------------------------------------- +Parsing sharding-related cli flags + Shard index 0 is accepted +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "--shard-index=0" }) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.shardIndex == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Parsing tags with non-alphabetical characters is pass-through +------------------------------------------------------------------------------- +TestSpecParser.tests.cpp:<line number> +............................................................................... + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.hasFilters() ) +with expansion: + true +with message: + tagString := "[tag with spaces]" + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.getInvalidSpecs().empty() ) +with expansion: + true +with message: + tagString := "[tag with spaces]" + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches( testCase ) ) +with expansion: + true +with message: + tagString := "[tag with spaces]" + +------------------------------------------------------------------------------- +Parsing tags with non-alphabetical characters is pass-through +------------------------------------------------------------------------------- +TestSpecParser.tests.cpp:<line number> +............................................................................... + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.hasFilters() ) +with expansion: + true +with message: + tagString := "[I said "good day" sir!]" + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.getInvalidSpecs().empty() ) +with expansion: + true +with message: + tagString := "[I said "good day" sir!]" + +TestSpecParser.tests.cpp:<line number>: PASSED: + REQUIRE( spec.matches( testCase ) ) +with expansion: + true +with message: + tagString := "[I said "good day" sir!]" + +------------------------------------------------------------------------------- +Parsing warnings + NoAssertions +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( cli.parse( { "test", "-w", "NoAssertions" } ) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.warnings == WarnAbout::NoAssertions ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +Parsing warnings + NoTests is no longer supported +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( cli.parse( { "test", "-w", "NoTests" } ) ) +with expansion: + !{?} + +------------------------------------------------------------------------------- +Parsing warnings + Combining multiple warnings +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +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.reporterSpecifications.empty() ) +with expansion: + true + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK_FALSE( cfg.hasTestFilters() ) +with expansion: + !false + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getReporterSpecs().size() == 1 ) +with expansion: + 1 == 1 + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } ) +with expansion: + {?} == {?} + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getProcessedReporterSpecs().size() == 1 ) +with expansion: + 1 == 1 + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } ) +with expansion: + {?} == {?} + +------------------------------------------------------------------------------- +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( result ) +with expansion: + {?} +with message: + result.errorMessage() := "" + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } ) +with expansion: + { {?} } == { {?} } +with message: + result.errorMessage() := "" + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + -r/xml +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( result ) +with expansion: + {?} +with message: + result.errorMessage() := "" + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } ) +with expansion: + { {?} } == { {?} } +with message: + result.errorMessage() := "" + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + --reporter/junit +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( result ) +with expansion: + {?} +with message: + result.errorMessage() := "" + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } ) +with expansion: + { {?} } == { {?} } +with message: + result.errorMessage() := "" + +------------------------------------------------------------------------------- +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(), ContainsSubstring("Unrecognized reporter") ) +with expansion: + "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" + contains: "Unrecognized reporter" + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + With output file +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( result ) +with expansion: + {?} +with message: + result.errorMessage() := "" + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } ) +with expansion: + { {?} } == { {?} } +with message: + result.errorMessage() := "" + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + With Windows-like absolute path as output file +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( result ) +with expansion: + {?} +with message: + result.errorMessage() := "" + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } ) +with expansion: + { {?} } == { {?} } +with message: + result.errorMessage() := "" + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + Multiple reporters + All with output files +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } ) +with expansion: + { {?}, {?} } == { {?}, {?} } + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + Multiple reporters + Mixed output files and default output +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } ) +with expansion: + { {?}, {?} } == { {?}, {?} } + +------------------------------------------------------------------------------- +Process can be configured on command line + reporter + Multiple reporters + cannot have multiple reporters with default output +------------------------------------------------------------------------------- +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(), ContainsSubstring("Only one reporter may have unspecified output file.") ) +with expansion: + "Only one reporter may have unspecified output file." contains: "Only one + reporter may have unspecified output file." + +------------------------------------------------------------------------------- +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(), ContainsSubstring("convert") && ContainsSubstring("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(), ContainsSubstring("never") && ContainsSubstring("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.defaultOutputFilename == "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.defaultOutputFilename == "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.defaultColourMode == ColourMode::PlatformDefault ) +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", "--colour-mode", "default" } ) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.defaultColourMode == ColourMode::PlatformDefault ) +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", "--colour-mode", "ansi"}) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.defaultColourMode == ColourMode::ANSI ) +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", "--colour-mode", "none"}) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.defaultColourMode == ColourMode::None ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +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(), ContainsSubstring( "colour mode must be one of" ) ) +with expansion: + "colour mode must be one of: default, ansi, win32, or none. 'wrong' is 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::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 + +------------------------------------------------------------------------------- +Random seed generation accepts known methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::generateRandomSeed(method) ) + +------------------------------------------------------------------------------- +Random seed generation accepts known methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::generateRandomSeed(method) ) + +------------------------------------------------------------------------------- +Random seed generation accepts known methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::generateRandomSeed(method) ) + +------------------------------------------------------------------------------- +Random seed generation reports unknown methods +------------------------------------------------------------------------------- +RandomNumberGeneration.tests.cpp:<line number> +............................................................................... + +RandomNumberGeneration.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) ) + +------------------------------------------------------------------------------- +Range type with sentinel +------------------------------------------------------------------------------- +ToString.tests.cpp:<line number> +............................................................................... + +ToString.tests.cpp:<line number>: PASSED: + CHECK( Catch::Detail::stringify(UsesSentinel{}) == "{ }" ) +with expansion: + "{ }" == "{ }" + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Registering reporter with '::' in name fails +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" ) +with expansion: + "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is + not allowed in reporter name: 'with::doublecolons'" + +------------------------------------------------------------------------------- +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' } + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + Automake reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "All available tags: + 1 [fakeTag] + 1 tag + +" contains: "fakeTag" +with message: + Tested reporter: Automake + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + Automake reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" +with message: + Tested reporter: Automake + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + Automake reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: Automake + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + compact reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "All available tags: + 1 [fakeTag] + 1 tag + +" contains: "fakeTag" +with message: + Tested reporter: compact + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + compact reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" +with message: + Tested reporter: compact + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + compact reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: compact + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + console reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "All available tags: + 1 [fakeTag] + 1 tag + +" contains: "fakeTag" +with message: + Tested reporter: console + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + console reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" +with message: + Tested reporter: console + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + console reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: console + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + JUnit reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + All available tags: + 1 [fakeTag] + 1 tag + +" contains: "fakeTag" +with message: + Tested reporter: JUnit + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + JUnit reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + Available reporters: + fake reporter: fake description + +" contains: "fake reporter" +with message: + Tested reporter: JUnit + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + JUnit reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: JUnit + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + SonarQube reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + All available tags: + 1 [fakeTag] + 1 tag + +" contains: "fakeTag" +with message: + Tested reporter: SonarQube + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + SonarQube reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + Available reporters: + fake reporter: fake description + +" contains: "fake reporter" +with message: + Tested reporter: SonarQube + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + SonarQube reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: SonarQube + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + TAP reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "All available tags: + 1 [fakeTag] + 1 tag + +" contains: "fakeTag" +with message: + Tested reporter: TAP + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + TAP reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" +with message: + Tested reporter: TAP + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + TAP reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: TAP + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + TeamCity reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "All available tags: + 1 [fakeTag] + 1 tag + +" contains: "fakeTag" +with message: + Tested reporter: TeamCity + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + TeamCity reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" +with message: + Tested reporter: TeamCity + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + TeamCity reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: TeamCity + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + XML reporter lists tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + <TagsFromMatchingTests> + <Tag> + <Count>1</Count> + <Aliases> + <Alias>fakeTag</Alias> + </Aliases> + </Tag> + </TagsFromMatchingTests>" contains: "fakeTag" +with message: + Tested reporter: XML + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + XML reporter lists reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + <AvailableReporters> + <Reporter> + <Name>fake reporter</Name> + <Description>fake description</Description> + </Reporter> + </AvailableReporters>" contains: "fake reporter" +with message: + Tested reporter: XML + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( factories.empty() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Reporter's write listings to provided stream + XML reporter lists tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + <MatchingTests> + <TestCase> + <Name>fake test name</Name> + <ClassName/> + <Tags>[fakeTestTag]</Tags> + <SourceInfo> + <File>fake-file.cpp</File> + <Line>123456789</Line> + </SourceInfo> + </TestCase> + </MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) +with message: + Tested reporter: XML + +------------------------------------------------------------------------------- +Reproducer for #2309 - a very long description past 80 chars (default console +width) with a late colon : blablabla +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Standard output from all sections is reported + one +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + + +No assertions in section 'one' + +------------------------------------------------------------------------------- +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(), ContainsSubstring( "string" ) ) +with expansion: + "this string contains 'abc' as a substring" contains: "string" + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( testStringForMatching(), ContainsSubstring( "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(), ContainsSubstring( "abc" ) ) +with expansion: + "this string contains 'abc' as a substring" contains: "abc" + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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( std::strcmp( empty.data(), "" ) == 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( std::strcmp( rawChars, "hello" ) == 0 ) +with expansion: + 0 == 0 + +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_NOTHROW( original.data() ) + +------------------------------------------------------------------------------- +StringRef + Copy construction is shallow +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( original.begin() == copy.begin() ) +with expansion: + "original string" == "original string" + +------------------------------------------------------------------------------- +StringRef + Copy assignment is shallow +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( original.begin() == copy.begin() ) +with expansion: + "original string" == "original string" + +------------------------------------------------------------------------------- +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.data(), "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.data(), "world!") == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +StringRef + Substrings + substring start after the end is empty +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( s.substr(1'000'000, 1).empty() ) +with expansion: + true + +------------------------------------------------------------------------------- +StringRef + Comparisons are deep +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + CHECK( reinterpret_cast<char*>(buffer1) != reinterpret_cast<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 + std::string += StringRef +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( lhs == "some string += the stringref contents" ) +with expansion: + "some string += the stringref contents" + == + "some string += the stringref contents" + +------------------------------------------------------------------------------- +StringRef + StringRef + StringRef +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( together == "abrakadabra" ) +with expansion: + "abrakadabra" == "abrakadabra" + +------------------------------------------------------------------------------- +StringRef at compilation time + Simple constructors +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: +with message: + empty.size() == 0 + +String.tests.cpp:<line number>: PASSED: +with message: + empty.begin() == empty.end() + +String.tests.cpp:<line number>: PASSED: +with message: + stringref.size() == 3 + +String.tests.cpp:<line number>: PASSED: +with message: + stringref.data() == abc + +String.tests.cpp:<line number>: PASSED: +with message: + stringref.begin() == abc + +String.tests.cpp:<line number>: PASSED: +with message: + stringref.begin() != stringref.end() + +String.tests.cpp:<line number>: PASSED: +with message: + stringref.substr(10, 0).empty() + +String.tests.cpp:<line number>: PASSED: +with message: + stringref.substr(2, 1).data() == abc + 2 + +String.tests.cpp:<line number>: PASSED: +with message: + stringref[1] == 'b' + +String.tests.cpp:<line number>: PASSED: +with message: + shortened.size() == 2 + +String.tests.cpp:<line number>: PASSED: +with message: + shortened.data() == abc + +String.tests.cpp:<line number>: PASSED: +with message: + shortened.begin() != shortened.end() + +------------------------------------------------------------------------------- +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: + sr2.empty() + +String.tests.cpp:<line number>: PASSED: +with message: + sr2.size() == 0 + +------------------------------------------------------------------------------- +Stringifying char arrays with statically known sizes - char +------------------------------------------------------------------------------- +ToString.tests.cpp:<line number> +............................................................................... + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +------------------------------------------------------------------------------- +Stringifying char arrays with statically known sizes - signed char +------------------------------------------------------------------------------- +ToString.tests.cpp:<line number> +............................................................................... + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +------------------------------------------------------------------------------- +Stringifying char arrays with statically known sizes - unsigned char +------------------------------------------------------------------------------- +ToString.tests.cpp:<line number> +............................................................................... + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +------------------------------------------------------------------------------- +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, ContainsSubstring( "[@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, ContainsSubstring( "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, ContainsSubstring( "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, ContainsSubstring( "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 ) ) ) + +------------------------------------------------------------------------------- +Tags with spaces and non-alphanumerical characters are accepted +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testCase.tags.size() == 2 ) +with expansion: + 2 == 2 + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) ) +with expansion: + { {?}, {?} } ( Contains: {?} and Contains: {?} ) + +------------------------------------------------------------------------------- +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 identical tags keeps just one +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testCase.tags.size() == 1 ) +with expansion: + 1 == 1 + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testCase.tags[0] == Tag( "tag1" ) ) +with expansion: + {?} == {?} + +------------------------------------------------------------------------------- +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: + +------------------------------------------------------------------------------- +Testing checked-if +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + CHECKED_IF( true ) + +Misc.tests.cpp:<line number>: PASSED: + +Misc.tests.cpp:<line number>: FAILED - but was ok: + CHECKED_IF( false ) + +Misc.tests.cpp:<line number>: PASSED: + CHECKED_ELSE( true ) + +Misc.tests.cpp:<line number>: FAILED - but was ok: + CHECKED_ELSE( false ) + +Misc.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +Testing checked-if 2 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + CHECKED_IF( true ) + +Misc.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Testing checked-if 3 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: FAILED - but was ok: + CHECKED_ELSE( false ) + +Misc.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +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' + +------------------------------------------------------------------------------- +The default listing implementation write to provided stream + Listing tags +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring("[fakeTag]"s) ) +with expansion: + "All available tags: + 1 [fakeTag] + 1 tag + +" contains: "[fakeTag]" + +------------------------------------------------------------------------------- +The default listing implementation write to provided stream + Listing reporters +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) ) +with expansion: + "Available reporters: + fake reporter: fake description + +" ( contains: "fake reporter" and contains: "fake description" ) + +------------------------------------------------------------------------------- +The default listing implementation write to provided stream + Listing tests +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) +with expansion: + "All available test cases: + fake test name + [fakeTestTag] + 1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + +------------------------------------------------------------------------------- +The default listing implementation write to provided stream + Listing listeners +------------------------------------------------------------------------------- +Reporters.tests.cpp:<line number> +............................................................................... + +Reporters.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) ) +with expansion: + "Registered listeners: + fakeListener: fake description + +" ( contains: "fakeListener" and contains: "fake description" ) + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +Upcasting special member functions + Move constructor +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( bptr->i == 3 ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +Upcasting special member functions + move assignment +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( bptr->i == 3 ) +with expansion: + 3 == 3 + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Basic usage +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllMatch(SizeIs(5)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } all match has size == 5 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllMatch(Contains(0) && Contains(1)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains + element 1 ) + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Type requires ADL found begin and end +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) ) +with expansion: + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, allMatch ) +with expansion: + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of AllMatch range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !allMatch ) +with expansion: + { 1, 2, 3, 4, 5 } not all match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + All true evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllTrue() ) +with expansion: + { true, true, true, true, true } contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + Empty evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllTrue() ) +with expansion: + { } contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + One false evalutes to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { true, true, false, true, true } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Basic usage + All false evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { false, false, false, false, false } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Contained type is convertible to bool + All true evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AllTrue() ) +with expansion: + { true, true, true, true, true } contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Contained type is convertible to bool + One false evalutes to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { true, true, false, true, true } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Contained type is convertible to bool + All false evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AllTrue() ) +with expansion: + { false, false, false, false, false } not contains only true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, AllTrue() ) +with expansion: + { true, true, true, true, true } contains only true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of AllTrue range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !AllTrue() ) +with expansion: + { true, true, false, true, true } not contains only true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Basic usage +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyMatch(SizeIs(5)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } any match has size == 5 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AnyMatch(Contains(0) && Contains(10)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains + element 10 ) + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Type requires ADL found begin and end +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) ) +with expansion: + { 1, 2, 3, 4, 5 } any match matches undescribed predicate + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !anyMatch ) +with expansion: + { 1, 2, 3, 4, 5 } not any match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of AnyMatch range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, anyMatch ) +with expansion: + { 1, 2, 3, 4, 5 } any match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[1] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[2] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Basic usage + All true evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyTrue() ) +with expansion: + { true, true, true, true, true } contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Basic usage + Empty evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AnyTrue() ) +with expansion: + { } not contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Basic usage + One true evalutes to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyTrue() ) +with expansion: + { false, false, true, false, false } contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Basic usage + All false evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AnyTrue() ) +with expansion: + { false, false, false, false, false } not contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Contained type is convertible to bool + All true evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyTrue() ) +with expansion: + { true, true, true, true, true } contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Contained type is convertible to bool + One true evalutes to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, AnyTrue() ) +with expansion: + { false, false, true, false, false } contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Contained type is convertible to bool + All false evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !AnyTrue() ) +with expansion: + { false, false, false, false, false } not contains at least one true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, AnyTrue() ) +with expansion: + { false, false, false, false, true } contains at least one true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of AnyTrue range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, AnyTrue() ) +with expansion: + { false, false, true, true, true } contains at least one true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of NoneMatch range matcher + Basic usage +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, NoneMatch(SizeIs(6)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } none match has size == 6 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !NoneMatch(Contains(0) && Contains(1)) ) +with expansion: + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 + }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains + element 1 ) + +------------------------------------------------------------------------------- +Usage of NoneMatch range matcher + Type requires ADL found begin and end +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) ) +with expansion: + { 1, 2, 3, 4, 5 } none match matches undescribed predicate + +------------------------------------------------------------------------------- +Usage of NoneMatch range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, noneMatch ) +with expansion: + { 1, 2, 3, 4, 5 } none match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of NoneMatch range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !noneMatch ) +with expansion: + { 1, 2, 3, 4, 5 } not none match matches undescribed predicate + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[1] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[2] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Basic usage + All true evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !NoneTrue() ) +with expansion: + { true, true, true, true, true } not contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Basic usage + Empty evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, NoneTrue() ) +with expansion: + { } contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Basic usage + One true evalutes to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !NoneTrue() ) +with expansion: + { false, false, true, false, false } not contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Basic usage + All false evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, NoneTrue() ) +with expansion: + { false, false, false, false, false } contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Contained type is convertible to bool + All true evaluates to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !NoneTrue() ) +with expansion: + { true, true, true, true, true } not contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Contained type is convertible to bool + One true evalutes to false +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, !NoneTrue() ) +with expansion: + { false, false, true, false, false } not contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Contained type is convertible to bool + All false evaluates to true +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( data, NoneTrue() ) +with expansion: + { false, false, false, false, false } contains no true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Shortcircuiting + All are read +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, NoneTrue() ) +with expansion: + { false, false, false, false, false } contains no true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[3] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[4] ) +with expansion: + true + +------------------------------------------------------------------------------- +Usage of NoneTrue range matcher + Shortcircuiting + Short-circuited +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( mocked, !NoneTrue() ) +with expansion: + { false, false, true, true, true } not contains no true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[0] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[1] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE( mocked.m_derefed[2] ) +with expansion: + true + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[3] ) +with expansion: + !false + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( mocked.m_derefed[4] ) +with expansion: + !false + +------------------------------------------------------------------------------- +Usage of the SizeIs range matcher + Some with stdlib containers +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( empty_vec, SizeIs(0) ) +with expansion: + { } has size == 0 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( empty_vec, !SizeIs(2) ) +with expansion: + { } not has size == 2 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( empty_vec, SizeIs(Lt(2)) ) +with expansion: + { } size matches is less than 2 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( arr, SizeIs(2) ) +with expansion: + { 0, 0 } has size == 2 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( arr, SizeIs( Lt(3)) ) +with expansion: + { 0, 0 } size matches is less than 3 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( arr, !SizeIs(!Lt(3)) ) +with expansion: + { 0, 0 } not size matches not is less than 3 + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( map, SizeIs(3) ) +with expansion: + { {?}, {?}, {?} } has size == 3 + +------------------------------------------------------------------------------- +Usage of the SizeIs range matcher + Type requires ADL found size free function +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( unrelated::ADL_size{}, SizeIs(12) ) +with expansion: + {?} has size == 12 + +------------------------------------------------------------------------------- +Usage of the SizeIs range matcher + Type has size member +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( has_size{}, SizeIs(13) ) +with expansion: + {?} has size == 13 + +------------------------------------------------------------------------------- +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 } + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( v1, Approx<double>( { 1., 2., 3. } ) ) +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 + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5, ( VectorContains<int, CustomAllocator<int>>( 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<int>( { 1, 2 } ) ) +with expansion: + { 1, 2, 3 } Contains: { 1, 2 } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( 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: { } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) ) +with expansion: + { 1, 2, 3 } Contains: { 1, 2, 3 } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5, Contains( v6 ) ) +with expansion: + { 1, 2, 3 } Contains: { 1, 2 } + +------------------------------------------------------------------------------- +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<int>( { 1, 2, 3 } ) ) +with expansion: + { 1, 2, 3 } Equals: { 1, 2, 3 } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v, Equals( v2 ) ) +with expansion: + { 1, 2, 3 } Equals: { 1, 2, 3 } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) ) +with expansion: + { 1, 2, 3 } Equals: { 1, 2, 3 } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5, Equals( v6 ) ) +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( v, UnorderedEquals<int>( { 3, 2, 1 } ) ) +with expansion: + { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } + +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 } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) ) +with expansion: + { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( v5_permuted, UnorderedEquals( v5 ) ) +with expansion: + { 1, 3, 2 } 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' + +------------------------------------------------------------------------------- +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 & jones" ) +with expansion: + "smith & jones" == "smith & jones" + +------------------------------------------------------------------------------- +XmlEncode + string with less-than +------------------------------------------------------------------------------- +Xml.tests.cpp:<line number> +............................................................................... + +Xml.tests.cpp:<line number>: PASSED: + REQUIRE( encode( "smith < jones" ) == "smith < jones" ) +with expansion: + "smith < jones" == "smith < 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 ]]> jones" ) +with expansion: + "smith ]]> jones" + == + "smith ]]> 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 "quote" me on that" ) +with expansion: + "don't "quote" me on that" + == + "don't "quote" 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]" + +------------------------------------------------------------------------------- +XmlWriter writes boolean attributes as true/false +------------------------------------------------------------------------------- +Xml.tests.cpp:<line number> +............................................................................... + +Xml.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + <Element1 attr1="true" attr2="false"/> + " ( contains: "attr1="true"" and contains: "attr2="false"" ) + +------------------------------------------------------------------------------- +analyse no analysis +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.mean.point.count() == 23 ) +with expansion: + 23.0 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.mean.lower_bound.count() == 23 ) +with expansion: + 23.0 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.mean.upper_bound.count() == 23 ) +with expansion: + 23.0 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.standard_deviation.point.count() == 0 ) +with expansion: + 0.0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.standard_deviation.lower_bound.count() == 0 ) +with expansion: + 0.0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.standard_deviation.upper_bound.count() == 0 ) +with expansion: + 0.0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.outliers.total() == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.outliers.low_mild == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.outliers.low_severe == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.outliers.high_mild == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.outliers.high_severe == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.outliers.samples_seen == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( analysis.outlier_variance == 0 ) +with expansion: + 0.0 == 0 + +------------------------------------------------------------------------------- +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 }" + +------------------------------------------------------------------------------- +benchmark function call + without chronometer +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.started == 1 ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.finished == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.started == 1 ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.finished == 1 ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( called == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +benchmark function call + with chronometer +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.started == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.finished == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.started == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( model.finished == 0 ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( called == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +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 - but was ok: + 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 - but was ok: + CHECKED_IF( flag ) +with expansion: + false + +Misc.tests.cpp:<line number>: FAILED: + REQUIRE( testCheckedIf( false ) ) +with expansion: + false + +------------------------------------------------------------------------------- +classify_outliers + none +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.samples_seen == static_cast<int>(x.size()) ) +with expansion: + 6 == 6 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_severe == los ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_mild == lom ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_mild == him ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_severe == his ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.total() == los + lom + him + his ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +classify_outliers + low severe +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.samples_seen == static_cast<int>(x.size()) ) +with expansion: + 6 == 6 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_severe == los ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_mild == lom ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_mild == him ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_severe == his ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.total() == los + lom + him + his ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +classify_outliers + low mild +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.samples_seen == static_cast<int>(x.size()) ) +with expansion: + 6 == 6 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_severe == los ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_mild == lom ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_mild == him ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_severe == his ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.total() == los + lom + him + his ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +classify_outliers + high mild +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.samples_seen == static_cast<int>(x.size()) ) +with expansion: + 6 == 6 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_severe == los ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_mild == lom ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_mild == him ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_severe == his ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.total() == los + lom + him + his ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +classify_outliers + high severe +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.samples_seen == static_cast<int>(x.size()) ) +with expansion: + 6 == 6 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_severe == los ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_mild == lom ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_mild == him ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_severe == his ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.total() == los + lom + him + his ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +classify_outliers + mixed +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.samples_seen == static_cast<int>(x.size()) ) +with expansion: + 6 == 6 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_severe == los ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.low_mild == lom ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_mild == him ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.high_severe == his ) +with expansion: + 0 == 0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( o.total() == los + lom + him + his ) +with expansion: + 2 == 2 + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +convertToBits +------------------------------------------------------------------------------- +FloatingPoint.tests.cpp:<line number> +............................................................................... + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( 0.f ) == 0 ) +with expansion: + 0 == 0 + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( -0.f ) == ( 1ULL << 31 ) ) +with expansion: + 2147483648 (0x<hex digits>) + == + 2147483648 (0x<hex digits>) + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( 0. ) == 0 ) +with expansion: + 0 == 0 + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( -0. ) == ( 1ULL << 63 ) ) +with expansion: + 9223372036854775808 (0x<hex digits>) + == + 9223372036854775808 (0x<hex digits>) + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 ) +with expansion: + 1 == 1 + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +empty tags are not allowed +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) ) + +------------------------------------------------------------------------------- +erfc_inv +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( erfc_inv(1.103560) == Approx(-0.09203687623843015) ) +with expansion: + -0.0920368762 == Approx( -0.0920368762 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( erfc_inv(1.067400) == Approx(-0.05980291115763361) ) +with expansion: + -0.0598029112 == Approx( -0.0598029112 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( erfc_inv(0.050000) == Approx(1.38590382434967796) ) +with expansion: + 1.3859038243 == Approx( 1.3859038243 ) + +------------------------------------------------------------------------------- +estimate_clock_resolution +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res.mean.count() == rate ) +with expansion: + 2000.0 == 2000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res.outliers.total() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +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' + +------------------------------------------------------------------------------- +has printf +------------------------------------------------------------------------------- +Tricky.tests.cpp:<line number> +............................................................................... + + +No assertions in test case 'has printf' + +------------------------------------------------------------------------------- +is_unary_function +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<int>::value) + +Clara.tests.cpp:<line number>: PASSED: +with message: + !(Catch::Clara::Detail::is_unary_function<std::string const&>::value) + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +makeStream recognizes %debug stream name +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Catch::makeStream( "%debug" ) ) + +------------------------------------------------------------------------------- +make_unique reimplementation + From lvalue copies +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lval.has_moved ) +with expansion: + !false + +------------------------------------------------------------------------------- +make_unique reimplementation + From rvalue moves +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( rval.has_moved ) +with expansion: + true + +------------------------------------------------------------------------------- +make_unique reimplementation + Variadic constructor +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr == std::tuple<int, double, int>{1, 2., 3} ) +with expansion: + {?} == {?} + +------------------------------------------------------------------------------- +mean +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( m == 19. ) +with expansion: + 19.0 == 19.0 + +------------------------------------------------------------------------------- +measure +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x == 17 ) +with expansion: + 17 == 17 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x == 23 ) +with expansion: + 23 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( r.elapsed.count() == 42 ) +with expansion: + 42 == 42 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( r.result == 23 ) +with expansion: + 23 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( r.iterations == 1 ) +with expansion: + 1 == 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( s.elapsed.count() == 69 ) +with expansion: + 69 == 69 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( s.result == 17 ) +with expansion: + 17 == 17 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( s.iterations == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +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: + {?} == {?} + +------------------------------------------------------------------------------- +normal_cdf +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_cdf(0.000000) == Approx(0.50000000000000000) ) +with expansion: + 0.5 == Approx( 0.5 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_cdf(1.000000) == Approx(0.84134474606854293) ) +with expansion: + 0.8413447461 == Approx( 0.8413447461 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_cdf(-1.000000) == Approx(0.15865525393145705) ) +with expansion: + 0.1586552539 == Approx( 0.1586552539 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_cdf(2.809729) == Approx(0.99752083845315409) ) +with expansion: + 0.9975208385 == Approx( 0.9975208385 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_cdf(-1.352570) == Approx(0.08809652095066035) ) +with expansion: + 0.088096521 == Approx( 0.088096521 ) + +------------------------------------------------------------------------------- +normal_quantile +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_quantile(0.551780) == Approx(0.13015979861484198) ) +with expansion: + 0.1301597986 == Approx( 0.1301597986 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_quantile(0.533700) == Approx(0.08457408802851875) ) +with expansion: + 0.084574088 == Approx( 0.084574088 ) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( normal_quantile(0.025000) == Approx(-1.95996398454005449) ) +with expansion: + -1.9599639845 == Approx( -1.9599639845 ) + +------------------------------------------------------------------------------- +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" + +------------------------------------------------------------------------------- +request an unknown %-starting stream fails +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::makeStream( "%somestream" ) ) + +------------------------------------------------------------------------------- +resolution +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res.size() == count ) +with expansion: + 10 == 10 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( res[i] == rate ) +with expansion: + 1000.0 == 1000 (0x<hex digits>) + +------------------------------------------------------------------------------- +run_for_at_least, chronometer +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 1 >= 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 2 >= 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 4 >= 2 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 8 >= 4 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 16 >= 8 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 32 >= 16 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 64 >= 32 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( meter.runs() >= old_runs ) +with expansion: + 128 >= 64 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( Timing.elapsed >= time ) +with expansion: + 128 ns >= 100 ns + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( Timing.result == Timing.iterations + 17 ) +with expansion: + 145 == 145 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( Timing.iterations >= time.count() ) +with expansion: + 128 >= 100 + +------------------------------------------------------------------------------- +run_for_at_least, int +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 1 >= 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 2 >= 1 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 4 >= 2 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 8 >= 4 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 16 >= 8 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 32 >= 16 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 64 >= 32 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( x >= old_x ) +with expansion: + 128 >= 64 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( Timing.elapsed >= time ) +with expansion: + 128 ns >= 100 ns + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( Timing.result == Timing.iterations + 17 ) +with expansion: + 145 == 145 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( Timing.iterations >= time.count() ) +with expansion: + 128 >= 100 + +------------------------------------------------------------------------------- +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, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) ) +with expansion: + { {?}, {?} } ( Contains: {?} 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 + +------------------------------------------------------------------------------- +startsWith +------------------------------------------------------------------------------- +StringManip.tests.cpp:<line number> +............................................................................... + +StringManip.tests.cpp:<line number>: PASSED: + CHECK_FALSE( startsWith("", 'c') ) +with expansion: + !false + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( startsWith(std::string("abc"), 'a') ) +with expansion: + true + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( startsWith("def"_catch_sr, 'd') ) +with expansion: + true + +------------------------------------------------------------------------------- +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 } }" + +------------------------------------------------------------------------------- +stdout and stderr streams have %-starting name +------------------------------------------------------------------------------- +Stream.tests.cpp:<line number> +............................................................................... + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "%stderr" )->isConsole() ) +with expansion: + true + +Stream.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::makeStream( "%stdout" )->isConsole() ) +with expansion: + true + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +tags with dots in later positions are not parsed as hidden +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testcase.tags.size() == 1 ) +with expansion: + 1 == 1 + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testcase.tags[0].original == "magic.tag"_catch_sr ) +with expansion: + magic.tag == magic.tag + +------------------------------------------------------------------------------- +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<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 }" + +------------------------------------------------------------------------------- +uniform samples +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( e.point == 23 ) +with expansion: + 23.0 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( e.upper_bound == 23 ) +with expansion: + 23.0 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( e.lower_bound == 23 ) +with expansion: + 23.0 == 23 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + CHECK( e.confidence_interval == 0.95 ) +with expansion: + 0.95 == 0.95 + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Default constructed unique_ptr is empty +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( ptr ) +with expansion: + !{?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr.get() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Take ownership of allocation +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr ) +with expansion: + {?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr == 0 ) +with expansion: + 0 == 0 + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr.get() == naked_ptr ) +with expansion: + 0x<hex digits> == 0x<hex digits> + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Take ownership of allocation + Plain reset deallocates +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( ptr ) +with expansion: + !{?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr.get() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Take ownership of allocation +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr ) +with expansion: + {?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr == 0 ) +with expansion: + 0 == 0 + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr.get() == naked_ptr ) +with expansion: + 0x<hex digits> == 0x<hex digits> + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Take ownership of allocation + Reset replaces ownership +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr ) +with expansion: + {?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr.get() != 0 ) +with expansion: + 0x<hex digits> != 0 + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr == 2 ) +with expansion: + 2 == 2 + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Release releases ownership +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + CHECK_FALSE( ptr ) +with expansion: + !{?} + +UniquePtr.tests.cpp:<line number>: PASSED: + CHECK( ptr.get() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Move constructor +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( ptr1 ) +with expansion: + !{?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr2 ) +with expansion: + {?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr2 == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + Move assignment +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( ptr2 ) +with expansion: + !{?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( ptr1 ) +with expansion: + {?} + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr1 == 2 ) +with expansion: + 2 == 2 + +------------------------------------------------------------------------------- +unique_ptr reimplementation: basic functionality + free swap +------------------------------------------------------------------------------- +UniquePtr.tests.cpp:<line number> +............................................................................... + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr1 == 2 ) +with expansion: + 2 == 2 + +UniquePtr.tests.cpp:<line number>: PASSED: + REQUIRE( *ptr2 == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +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 + +------------------------------------------------------------------------------- +warmup +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( (iterations * rate) > Catch::Benchmark::Detail::warmup_time.count() ) +with expansion: + 160000000 (0x<hex digits>) > 100 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( (end - start) > Catch::Benchmark::Detail::warmup_time ) +with expansion: + 310016000 ns > 100 ms + +------------------------------------------------------------------------------- +weighted_average_quantile +------------------------------------------------------------------------------- +InternalBenchmark.tests.cpp:<line number> +............................................................................... + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( q1 == 14.5 ) +with expansion: + 14.5 == 14.5 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( med == 18. ) +with expansion: + 18.0 == 18.0 + +InternalBenchmark.tests.cpp:<line number>: PASSED: + REQUIRE( q3 == 23. ) +with expansion: + 23.0 == 23.0 + +------------------------------------------------------------------------------- +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: 394 | 304 passed | 83 failed | 7 failed as expected +assertions: 2299 | 2129 passed | 143 failed | 27 failed as expected + diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt index df003bd3f..ede2d59cc 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt @@ -1,11 +1,10 @@ Filters: ~[!nonportable]~[!benchmark]~[approvals] * +Randomness seeded to: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -<exe-name> is a <version> host application. +<exe-name> is a Catch2 v<version> host application. Run with -? for options -Randomness seeded to: 1 - ------------------------------------------------------------------------------- # A test name that starts with a # ------------------------------------------------------------------------------- @@ -16,23 +15,6 @@ 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: Bitfields can be captured ------------------------------------------------------------------------------- @@ -863,7 +845,7 @@ with expansion: true ------------------------------------------------------------------------------- -#835 -- errno should not be touched by Catch +#835 -- errno should not be touched by Catch2 ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -874,7 +856,7 @@ with expansion: 1 == 0 Misc.tests.cpp:<line number>: PASSED: - REQUIRE( errno == 1 ) + REQUIRE( errno_after == 1 ) with expansion: 1 == 1 @@ -959,6 +941,6 @@ Condition.tests.cpp:<line number>: FAILED: CHECK( true != true ) =============================================================================== -test cases: 33 | 28 passed | 3 failed | 2 failed as expected -assertions: 103 | 96 passed | 4 failed | 3 failed as expected +test cases: 32 | 27 passed | 3 failed | 2 failed as expected +assertions: 101 | 94 passed | 4 failed | 3 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/default.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/default.sw.multi.approved.txt new file mode 100644 index 000000000..12717aa5f --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/default.sw.multi.approved.txt @@ -0,0 +1,8 @@ +This would not be caught previously +Nor would this +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 +loose text artifact diff --git a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt index 88e96b0fc..f7411501d 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,13 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="129" tests="2120" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="126" tests="2299" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> - <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> <property name="random-seed" value="1"/> + <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> </properties> <testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1027: Bitfields can be captured" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1147" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1175 - Hidden Test" time="{duration}" status="run"/> @@ -50,6 +49,7 @@ Nor would this <testcase classname="<exe-name>.global" name="#2152 - ULP checks between differently signed values were wrong - double" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#2152 - ULP checks between differently signed values were wrong - float" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <error type="TEST_CASE"> FAILED: expected exception @@ -58,6 +58,7 @@ Exception.tests.cpp:<line number> </error> </testcase> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/inside REQUIRE_NOTHROW" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <error message="thisThrows()" type="REQUIRE_NOTHROW"> FAILED: REQUIRE_NOTHROW( thisThrows() ) @@ -69,7 +70,8 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/inside REQUIRE_THROWS" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#809" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#833" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="#835 -- errno should not be touched by Catch" time="{duration}" status="run"> + <testcase classname="<exe-name>.global" name="#835 -- errno should not be touched by Catch2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure message="f() == 0" type="CHECK"> FAILED: CHECK( f() == 0 ) @@ -375,10 +377,19 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="CAPTURE parses string and character constants" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Capture and info messages/Capture should stringify like assertions" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Capture and info messages/Info should NOT stringify the way assertions do" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveEqualsTo is case insensitive/Degenerate cases" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveEqualsTo is case insensitive/Plain comparisons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveLess is case insensitive/Degenerate cases" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveLess is case insensitive/Plain comparisons" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Character pretty printing/Specifically escaped" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Character pretty printing/General chars" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Character pretty printing/Low ASCII" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Clara::Arg supports single-arg parse the way Opt does" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Clara::Opt supports accept-many lambdas/Parsing fails on multiple options without accept_many" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Clara::Opt supports accept-many lambdas/Parsing succeeds on multiple options with accept_many" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="ColourGuard behaviour/ColourGuard is disengaged by default" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="ColourGuard behaviour/ColourGuard is engaged by op<<" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="ColourGuard behaviour/ColourGuard can be engaged explicitly" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Combining MatchAllOfGeneric does not nest" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Combining MatchAnyOfGeneric does not nest" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Combining MatchNotOfGeneric does not nest" time="{duration}" status="run"/> @@ -398,17 +409,17 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAllOf" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAnyOf" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}" status="run"> - <failure message="testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No )" type="CHECK_THAT"> + <failure message="testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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( "STRING" )" type="CHECK_THAT"> + <failure message="testStringForMatching(), ContainsSubstring( "STRING" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" Matchers.tests.cpp:<line number> @@ -417,6 +428,7 @@ Matchers.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Copy and then generate a range/from var and iterators" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Copy and then generate a range/From a temporary container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Copy and then generate a range/Final validation" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Cout stream properly declares it writes to stdout" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Custom exceptions can be translated when testing for nothrow" time="{duration}" status="run"> <error message="throwCustom()" type="REQUIRE_NOTHROW"> FAILED: @@ -442,6 +454,8 @@ Exception.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Default scale is invisible to comparison" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Directly creating an EnumInfo" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Empty stream name opens cout stream" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Empty tag is not allowed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="EndsWith string matcher" time="{duration}" status="run"> <failure message="testStringForMatching(), EndsWith( "Substring" )" type="CHECK_THAT"> FAILED: @@ -463,6 +477,7 @@ Matchers.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Epsilon only applies to Approx's value" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Equality checks that should fail" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure message="data.int_seven == 6" type="CHECK"> FAILED: CHECK( data.int_seven == 6 ) @@ -692,7 +707,9 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Generators internals/Preset values" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Generator combinator" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Explicitly typed generator sequence" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Generators internals/Filter generator" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Filter generator/Simple filtering" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Filter generator/Filter out multiple elements at the start and end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Filter generator/Throws on construction if it can't get initial element" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take less" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take more" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Map with explicit return type" time="{duration}" status="run"/> @@ -711,6 +728,12 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly over end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly under end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Greater-than inequalities with different epsilons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with different seed produce different hash with same test case" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with same seed produce same hash" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different test name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different classname" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing test case produces same hash across multiple calls" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="INFO and WARN do not abort tests" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="INFO gets logged on failure" time="{duration}" status="run"> <failure message="a == 1" type="REQUIRE"> @@ -756,6 +779,7 @@ Message.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Inequality checks that should fail" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure message="data.int_seven != 7" type="CHECK"> FAILED: CHECK( data.int_seven != 7 ) @@ -800,9 +824,9 @@ Condition.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Matchers can be (AnyOf) composed with the || operator" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Matchers can be composed with both && and ||" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Matchers can be composed with both && and || - failing" time="{duration}" status="run"> - <failure message="testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" )" type="CHECK_THAT"> + <failure message="testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -811,14 +835,42 @@ Matchers.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Matchers can be negated (Not) with the ! operator" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Matchers can be negated (Not) with the ! operator - failing" time="{duration}" status="run"> - <failure message="testStringForMatching(), !Contains( "substring" )" type="CHECK_THAT"> + <failure message="testStringForMatching(), !ContainsSubstring( "substring" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "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="Mayfail test case with nested sections/1/A" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2/A" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1/B" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2/B" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> <testcase classname="<exe-name>.global" name="Mismatching exception messages failing the test" time="{duration}" status="run"> <failure message="thisThrows(), "should fail"" type="REQUIRE_THROWS_WITH"> FAILED: @@ -828,6 +880,10 @@ with expansion: Exception.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Multireporter calls reporters and listeners in correct order" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Multireporter updates ReporterPreferences properly" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Multireporter updates ReporterPreferences properly/Adding listeners" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Multireporter updates ReporterPreferences properly/Adding reporters" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Nested generators and captured variables" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Nice descriptive name" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Non-std exceptions can be translated" time="{duration}" status="run"> @@ -1027,6 +1083,17 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Parse test names and tags/Leading and trailing spaces in test name" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Parse test names and tags/Shortened hide tags are split apart when parsing" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Parse test names and tags/Shortened hide tags also properly handle exclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsed tags are matched case insensitive" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/shard-count" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Negative shard count reports error" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Zero shard count reports error" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/shard-index" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Negative shard index reports error" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Shard index 0 is accepted" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing tags with non-alphabetical characters is pass-through" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing warnings/NoAssertions" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing warnings/NoTests is no longer supported" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing warnings/Combining multiple warnings" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Pointers can be compared to null" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Precision of floating point stringification can be set/Floats" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Precision of floating point stringification can be set/Double" time="{duration}" status="run"/> @@ -1039,8 +1106,12 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/-r/console" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/-r/xml" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/--reporter/junit" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Only one reporter is accepted" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/must match one of the available ones" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/With output file" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/With Windows-like absolute path as output file" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Multiple reporters/All with output files" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Multiple reporters/Mixed output files and default output" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Multiple reporters/cannot have multiple reporters with default output" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/-b" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/--break" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-a aborts after first failure" time="{duration}" status="run"/> @@ -1066,6 +1137,8 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double, float>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Random seed generation accepts known methods" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Random seed generation reports unknown methods" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run"> <failure message="truthy(false)" type="CHECK"> @@ -1102,32 +1175,34 @@ with expansion: Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Registering reporter with '::' in name fails" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/automake reporter lists tags" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/automake reporter lists reporters" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/automake reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tests" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists tags" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists reporters" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists tests" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists tags" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists reporters" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists tests" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/junit reporter lists tags" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/junit reporter lists reporters" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/junit reporter lists tests" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/sonarqube reporter lists tags" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/sonarqube reporter lists reporters" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/sonarqube reporter lists tests" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/tap reporter lists tags" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/tap reporter lists reporters" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/tap reporter lists tests" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/teamcity reporter lists tags" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/teamcity reporter lists reporters" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/teamcity reporter lists tests" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/xml reporter lists tags" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/xml reporter lists reporters" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/xml reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/JUnit reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/JUnit reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/JUnit reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/SonarQube reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/SonarQube reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/SonarQube reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TAP reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TAP reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TAP reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TeamCity reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TeamCity reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TeamCity reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/XML reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/XML reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/XML reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="SUCCEED counts as a test pass" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="SUCCEED does not require an argument" time="{duration}" status="run"/> <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}" status="run"/> @@ -1179,6 +1254,8 @@ Matchers.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="StringRef/Empty string" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="StringRef/From string literal" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="StringRef/From sub-string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Copy construction is shallow" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Copy assignment is shallow" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="StringRef/Substrings/zero-based substring" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="StringRef/Substrings/non-zero-based substring" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="StringRef/Substrings/Pointer values of full refs should match" time="{duration}" status="run"/> @@ -1220,6 +1297,7 @@ Misc.tests.cpp:<line number> </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}" status="run"/> <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tags with spaces and non-alphanumerical characters are accepted" time="{duration}" status="run"/> <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 1" time="{duration}" status="run"/> <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 2" time="{duration}" status="run"/> @@ -1278,17 +1356,20 @@ Misc.tests.cpp:<line number> <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}" status="run"/> <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}" status="run"/> <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Test case with identical tags keeps just one" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test case with one argument" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test with special, characters "in name" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Testing checked-if" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Testing checked-if 2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure type="FAIL"> FAILED: Misc.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Testing checked-if 3" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure type="FAIL"> FAILED: Misc.tests.cpp:<line number> @@ -1298,6 +1379,7 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing tags" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing reporters" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing listeners" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="This test 'should' fail but doesn't" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Thrown string literals are translated" time="{duration}" status="run"> <error type="TEST_CASE"> @@ -1330,14 +1412,41 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Usage of AllMatch range matcher/Type requires ADL found begin and end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of AllMatch range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of AllMatch range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/Empty evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/One false evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Contained type is convertible to bool/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Contained type is convertible to bool/One false evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Contained type is convertible to bool/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Basic usage" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Type requires ADL found begin and end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/Empty evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/One true evalutes to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Contained type is convertible to bool/One true evalutes to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Basic usage" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Type requires ADL found begin and end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/All true evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/Empty evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/One true evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/All false evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All true evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Contained type is convertible to bool/One true evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All false evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher/Some with stdlib containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher/Type requires ADL found size free function" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher/Type has size member" time="{duration}" status="run"/> @@ -1501,8 +1610,6 @@ 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}" status="run"/> - <testcase classname="<exe-name>.global" name="Where there is more to the expression after the RHS" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="X/level/0/a" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="X/level/0/b" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="X/level/1/a" time="{duration}" status="run"/> @@ -1518,7 +1625,6 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="XmlWriter writes boolean attributes as true/false" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="analyse no analysis" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="array<int, N> -> toString" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="atomic if" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="benchmark function call/without chronometer" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="benchmark function call/with chronometer" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="boolean member" time="{duration}" status="run"/> @@ -1557,6 +1663,7 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c/d (leaf)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c/e (leaf)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="even more nested SECTION tests/f (leaf)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="is_unary_function" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="just failure" time="{duration}" status="run"> <failure type="FAIL"> FAILED: @@ -1648,6 +1755,7 @@ Testing if fib[7] (21) is even Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="makeStream recognizes %debug stream name" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="make_unique reimplementation/From lvalue copies" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="make_unique reimplementation/From rvalue moves" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="make_unique reimplementation/Variadic constructor" time="{duration}" status="run"/> @@ -1714,6 +1822,7 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="replaceInPlace/replace all chars" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="replaceInPlace/replace no chars" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="replaceInPlace/escape '" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="request an unknown %-starting stream fails" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="resolution" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="run_for_at_least, chronometer" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="run_for_at_least, int" time="{duration}" status="run"/> @@ -1756,6 +1865,7 @@ Count 4 to 6... Message.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="startsWith" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="std::map is convertible string/empty" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="std::map is convertible string/single item" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="std::map is convertible string/several items" time="{duration}" status="run"/> @@ -1765,15 +1875,7 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="std::set is convertible string/single item" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="std::set is convertible string/several items" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="std::vector<std::pair<std::string,int> > -> toString" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="string literals of different sizes can be compared" time="{duration}" status="run"> - <failure message="std::string( "first" ) == "second"" 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="stdout and stderr streams have %-starting name" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="stringify ranges" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="stringify( has_maker )" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="stringify( has_maker_and_operator )" time="{duration}" status="run"/> @@ -1804,7 +1906,6 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="tuple<>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="tuple<float,int>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="tuple<int>" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="tuple<0,int,const char *>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="tuple<string,string>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="tuple<tuple<int>,tuple<>,float>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="uniform samples" time="{duration}" status="run"/> diff --git a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt new file mode 100644 index 000000000..aa0860a3c --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -0,0 +1,1946 @@ +<?xml version="1.0" encoding="UTF-8"?> +<testsuites> + <testsuite name="<exe-name>" errors="17" failures="126" tests="2299" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <properties> + <property name="random-seed" value="1"/> + <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> + </properties> + <testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1027: Bitfields can be captured" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1147" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1175 - Hidden Test" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1238" time="{duration}" status="run"/> + <testcase classname="<exe-name>.(Fixture_1245<int, int>)" name="#1245" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1319: Sections can have description (even if it is not saved/SectionName" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1403" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1455 - INFO and WARN can start with a linebreak" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1514: stderr/stdout is not captured in tests aborted by an exception" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="#1905 -- test spec parser properly clears internal state between compound tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1912 -- test spec parser handles escaping/Various parentheses" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1912 -- test spec parser handles escaping/backslash in test name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1913 - GENERATE inside a for loop should not keep recreating the generator" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1913 - GENERATEs can share a line" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - GENERATE after a section/A" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - GENERATE after a section/B" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - Section followed by flat generate" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - Section followed by flat generate/A" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - flat generate" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates/A" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates/B" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1938 - nested generate" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#2152 - ULP checks between differently signed values were wrong - double" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#2152 - ULP checks between differently signed values were wrong - float" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <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}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="#809" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#833" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#835 -- errno should not be touched by Catch2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 1" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 2" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 3" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#961 -- Dynamically created sections should all be reported/Looped section 4" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="'Not' checks that should fail" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/compare to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/compare to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/negation" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/double negation" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/direct" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="3x3x3 ints" time="{duration}" status="run"/> + <testcase classname="<exe-name>.TestClass" name="A METHOD_AS_TEST_CASE based test run that fails" time="{duration}" status="run"> + <failure message="s == "world"" 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}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>::m_a.size() == 1" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<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<int>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>::m_a.size() == 1" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<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<float>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>::m_a.size() == 1" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<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<int>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>::m_a.size() == 1" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<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<float>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>{}.m_a.size() < 2" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 6 < 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<int, 2>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>{}.m_a.size() < 2" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 2 < 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<float, 6>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>{}.m_a.size() < 2" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 6 < 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<int, 2>" time="{duration}" status="run"> + <failure message="Template_Fixture_2<TestType>{}.m_a.size() < 2" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 2 < 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<float,6>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" time="{duration}" status="run"> + <failure message="Template_Fixture<TestType>::m_a == 2" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture<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}" status="run"> + <failure message="Template_Fixture<TestType>::m_a == 2" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture<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}" status="run"> + <failure message="Template_Fixture<TestType>::m_a == 2" type="REQUIRE"> +FAILED: + REQUIRE( Template_Fixture<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}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1" time="{duration}" status="run"> + <failure message="Nttp_Fixture<V>::value == 0" type="REQUIRE"> +FAILED: + REQUIRE( Nttp_Fixture<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}" status="run"> + <failure message="Nttp_Fixture<V>::value == 0" type="REQUIRE"> +FAILED: + REQUIRE( Nttp_Fixture<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}" status="run"> + <failure message="Nttp_Fixture<V>::value == 0" type="REQUIRE"> +FAILED: + REQUIRE( Nttp_Fixture<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}" status="run"/> + <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Nttp_Fixture" name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Fixture" name="A TEST_CASE_METHOD based test run that fails" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case - Foo<float>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case - Foo<int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case - std::vector<float>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case - std::vector<int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case with array signature - Bar<float, 42>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case with array signature - Bar<int, 9>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case with array signature - std::array<float, 42>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A Template product test case with array signature - std::array<int, 9>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A comparison that uses literals instead of the normal constructor" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="A couple of nested sections followed by a failure" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="A failing expression with a non streamable type is still captured" time="{duration}" status="run"> + <failure message="&o1 == &o2" type="CHECK"> +FAILED: + CHECK( &o1 == &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}" status="run"/> + <testcase classname="<exe-name>.global" name="An expression with side-effects should only be evaluated once" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="An unchecked exception reports the line of the last assertion" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Approx setters validate their arguments" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Approx with exactly-representable margin" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Approximate PI" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Approximate comparisons with different epsilons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Approximate comparisons with floats" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Approximate comparisons with ints" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Approximate comparisons with mixed numeric types" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Function pointer" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Lambdas + different type" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Assertion macros support bit operators and bool conversions" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Assertions then sections" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Assertions then sections/A section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another other section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Contains range matcher/Different argument ranges, same element type, default comparison" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Contains range matcher/Different argument ranges, same element type, custom comparison" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Contains range matcher/Different element type, custom comparisons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Contains range matcher/Can handle type that requires ADL-found free function begin and end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Contains range matcher/Initialization with move only types" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Contains range matcher/Matching using matcher" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Empty range matcher/Simple, std-provided containers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Empty range matcher/Type with empty" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Basic use of the Empty range matcher/Type requires ADL found empty free function" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CAPTURE can deal with complex expressions involving commas" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CAPTURE parses string and character constants" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Capture and info messages/Capture should stringify like assertions" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Capture and info messages/Info should NOT stringify the way assertions do" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveEqualsTo is case insensitive/Degenerate cases" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveEqualsTo is case insensitive/Plain comparisons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveLess is case insensitive/Degenerate cases" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="CaseInsensitiveLess is case insensitive/Plain comparisons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Character pretty printing/Specifically escaped" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Character pretty printing/General chars" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Character pretty printing/Low ASCII" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Clara::Arg supports single-arg parse the way Opt does" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Clara::Opt supports accept-many lambdas/Parsing fails on multiple options without accept_many" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Clara::Opt supports accept-many lambdas/Parsing succeeds on multiple options with accept_many" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="ColourGuard behaviour/ColourGuard is disengaged by default" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="ColourGuard behaviour/ColourGuard is engaged by op<<" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="ColourGuard behaviour/ColourGuard can be engaged explicitly" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Combining MatchAllOfGeneric does not nest" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Combining MatchAnyOfGeneric does not nest" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Combining MatchNotOfGeneric does not nest" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Combining concrete matchers does not use templated matchers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Combining only templated matchers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Combining templated and concrete matchers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Combining templated matchers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Comparisons between ints where one side is computed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Comparisons with int literals don't warn when mixing signed/ unsigned" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Composed generic matchers shortcircuit/MatchAllOf" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Composed generic matchers shortcircuit/MatchAnyOf" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAllOf" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAnyOf" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}" status="run"> + <failure message="testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No )" type="CHECK_THAT"> +FAILED: + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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(), ContainsSubstring( "STRING" )" type="CHECK_THAT"> +FAILED: + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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}" status="run"/> + <testcase classname="<exe-name>.global" name="Copy and then generate a range/From a temporary container" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Copy and then generate a range/Final validation" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Cout stream properly declares it writes to stdout" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Custom exceptions can be translated when testing for nothrow" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Directly creating an EnumInfo" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Empty stream name opens cout stream" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Empty tag is not allowed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="EndsWith string matcher" time="{duration}" status="run"> + <failure message="testStringForMatching(), EndsWith( "Substring" )" 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( "this", 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}" status="run"/> + <testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Epsilon only applies to Approx's value" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Equality checks that should fail" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <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 == "goodbye"" type="CHECK"> +FAILED: + CHECK( data.str_hello == "goodbye" ) +with expansion: + "hello" == "goodbye" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello == "hell"" type="CHECK"> +FAILED: + CHECK( data.str_hello == "hell" ) +with expansion: + "hello" == "hell" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello == "hello1"" 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}" status="run"/> + <testcase classname="<exe-name>.global" name="Equals" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Equals string matcher" time="{duration}" status="run"> + <failure message="testStringForMatching(), Equals( "this string contains 'ABC' as a substring" )" 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( "something else", 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}" status="run"/> + <testcase classname="<exe-name>.global" name="Exception matchers that fail/No exception" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Exception messages can be tested for/exact match" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Exception messages can be tested for/different case" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Exception messages can be tested for/wildcarded" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Exceptions matchers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Expected exceptions that don't throw or unexpected exceptions fail the test" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double/Margin" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double/ULPs" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double/Composed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double/Constructor validation" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float/Relative" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float/Relative/Some subnormal values" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float/Margin" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float/ULPs" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float/Composed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Shortening a range" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Same type" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Different type" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Different deduced type" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Repeating a generator" time="{duration}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Chunk size of zero" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Throws on too small generators" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- simple/one" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- simple/two" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Single value" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Preset values" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Generator combinator" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Explicitly typed generator sequence" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Filter generator/Simple filtering" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Filter generator/Filter out multiple elements at the start and end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Filter generator/Throws on construction if it can't get initial element" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take less" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take more" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Map with explicit return type" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Map with deduced return type" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Repeat/Singular repeat" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Repeat/Actual repeat" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive auto step/Integer" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative auto step/Integer" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Exact" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly over end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly under end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Exact" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Slightly over end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Slightly under end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Exact" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly over end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly under end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Greater-than inequalities with different epsilons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with different seed produce different hash with same test case" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with same seed produce same hash" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different test name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different classname" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing test case produces same hash across multiple calls" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="INFO and WARN do not abort tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="INFO gets logged on failure" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"> + <failure message="i < 10" type="REQUIRE"> +FAILED: + REQUIRE( i < 10 ) +with expansion: + 10 < 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}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <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 != "hello"" 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}" status="run"/> + <testcase classname="<exe-name>.global" name="Lambdas in assertions" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Less-than inequalities with different epsilons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="ManuallyRegistered" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Matchers can be (AllOf) composed with the && operator" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Matchers can be (AnyOf) composed with the || operator" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Matchers can be composed with both && and ||" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Matchers can be composed with both && and || - failing" time="{duration}" status="run"> + <failure message="testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" )" type="CHECK_THAT"> +FAILED: + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "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}" status="run"/> + <testcase classname="<exe-name>.global" name="Matchers can be negated (Not) with the ! operator - failing" time="{duration}" status="run"> + <failure message="testStringForMatching(), !ContainsSubstring( "substring" )" type="CHECK_THAT"> +FAILED: + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "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="Mayfail test case with nested sections/1/A" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2/A" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1/B" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2/B" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mismatching exception messages failing the test" time="{duration}" status="run"> + <failure message="thisThrows(), "should fail"" 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="Multireporter calls reporters and listeners in correct order" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Multireporter updates ReporterPreferences properly" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Multireporter updates ReporterPreferences properly/Adding listeners" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Multireporter updates ReporterPreferences properly/Adding reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Nested generators and captured variables" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Nice descriptive name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Non-std exceptions can be translated" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Optionally static assertions" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Ordering comparison checks that should fail" time="{duration}" status="run"> + <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 < 7" type="CHECK"> +FAILED: + CHECK( data.int_seven < 7 ) +with expansion: + 7 < 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 < 6" type="CHECK"> +FAILED: + CHECK( data.int_seven < 6 ) +with expansion: + 7 < 6 +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.int_seven < -1" type="CHECK"> +FAILED: + CHECK( data.int_seven < -1 ) +with expansion: + 7 < -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 <= 6" type="CHECK"> +FAILED: + CHECK( data.int_seven <= 6 ) +with expansion: + 7 <= 6 +Condition.tests.cpp:<line number> + </failure> + <failure message="data.float_nine_point_one < 9" type="CHECK"> +FAILED: + CHECK( data.float_nine_point_one < 9 ) +with expansion: + 9.1f < 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 > "hello"" type="CHECK"> +FAILED: + CHECK( data.str_hello > "hello" ) +with expansion: + "hello" > "hello" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello < "hello"" type="CHECK"> +FAILED: + CHECK( data.str_hello < "hello" ) +with expansion: + "hello" < "hello" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello > "hellp"" type="CHECK"> +FAILED: + CHECK( data.str_hello > "hellp" ) +with expansion: + "hello" > "hellp" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello > "z"" type="CHECK"> +FAILED: + CHECK( data.str_hello > "z" ) +with expansion: + "hello" > "z" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello < "hellm"" type="CHECK"> +FAILED: + CHECK( data.str_hello < "hellm" ) +with expansion: + "hello" < "hellm" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello < "a"" type="CHECK"> +FAILED: + CHECK( data.str_hello < "a" ) +with expansion: + "hello" < "a" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello >= "z"" type="CHECK"> +FAILED: + CHECK( data.str_hello >= "z" ) +with expansion: + "hello" >= "z" +Condition.tests.cpp:<line number> + </failure> + <failure message="data.str_hello <= "a"" type="CHECK"> +FAILED: + CHECK( data.str_hello <= "a" ) +with expansion: + "hello" <= "a" +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Ordering comparison checks that should succeed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Our PCG implementation provides expected results for known seeds/Default seeded" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Our PCG implementation provides expected results for known seeds/Specific seed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Output from all sections is reported/one" time="{duration}" status="run"> + <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}" status="run"> + <failure type="FAIL"> +FAILED: +Message from section two +Message.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Overloaded comma or address-of operators are not used" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Empty test spec should have no filters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from empty string should have no filters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from just a comma should have no filters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from name should have one filter" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from quoted name should have one filter" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Test spec from name should have one filter" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at the start" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at the end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at both ends" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Redundant wildcard at the start" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Redundant wildcard at the end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Redundant wildcard at both ends" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcard at both ends, redundant at start" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Just wildcard" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Single tag" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Single tag, two matches" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Two tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Two tags, spare separated" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Wildcarded name and tag" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Single tag exclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/One tag exclusion and one tag inclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/One tag exclusion and one wldcarded name inclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/One tag exclusion, using exclude:, and one wldcarded name inclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/name exclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/wildcarded name exclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/wildcarded name exclusion with tag inclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/wildcarded name exclusion, using exclude:, with tag inclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/two wildcarded names" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/empty tag" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/empty quoted name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/quoted string followed by tag exclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Leading and trailing spaces in test spec" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Leading and trailing spaces in test name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Shortened hide tags are split apart when parsing" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parse test names and tags/Shortened hide tags also properly handle exclusion" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsed tags are matched case insensitive" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/shard-count" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Negative shard count reports error" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Zero shard count reports error" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/shard-index" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Negative shard index reports error" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Shard index 0 is accepted" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing tags with non-alphabetical characters is pass-through" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing warnings/NoAssertions" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing warnings/NoTests is no longer supported" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Parsing warnings/Combining multiple warnings" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Pointers can be compared to null" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Precision of floating point stringification can be set/Floats" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Precision of floating point stringification can be set/Double" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Predicate matcher can accept const char*" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/empty args don't cause a crash" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/default - no arguments" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/test lists/Specify one test case using" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/test lists/Specify one test case exclusion using exclude:" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/test lists/Specify one test case exclusion using ~" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/-r/console" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/-r/xml" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/--reporter/junit" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/must match one of the available ones" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/With output file" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/With Windows-like absolute path as output file" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Multiple reporters/All with output files" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Multiple reporters/Mixed output files and default output" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/reporter/Multiple reporters/cannot have multiple reporters with default output" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/-b" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/debugger/--break" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-a aborts after first failure" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-x 2 aborts after two failures" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/-x must be numeric" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/wait-for-keypress/Accepted options" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/abort/wait-for-keypress/invalid options are reported" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/nothrow/-e" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/nothrow/--nothrow" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/output filename/-o filename" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/output filename/--out" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/combinations/Single character flags can be combined" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/without option" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/auto" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/yes" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/no" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/error" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/resamples" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/confidence-interval" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/no-analysis" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/warmup-time" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double, float>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Random seed generation accepts known methods" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Random seed generation reports unknown methods" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run"> + <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}" status="run"> + <failure message="testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" )" 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( "contains 'abc' as a substring" )" 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( "this string contains 'abc' as a" )" 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="Registering reporter with '::' in name fails" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/JUnit reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/JUnit reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/JUnit reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/SonarQube reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/SonarQube reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/SonarQube reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TAP reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TAP reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TAP reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TeamCity reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TeamCity reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/TeamCity reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/XML reporter lists tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/XML reporter lists reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/XML reporter lists tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="SUCCEED counts as a test pass" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="SUCCEED does not require an argument" time="{duration}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Scenario: Vector resizing affects size and capacity/Given: an empty vector" time="{duration}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Sends stuff to stdout and stderr" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Standard output from all sections is reported/two" time="{duration}" status="run"> + <system-out> +Message from section one +Message from section two + </system-out> + </testcase> + <testcase classname="<exe-name>.global" name="StartsWith string matcher" time="{duration}" status="run"> + <failure message="testStringForMatching(), StartsWith( "This String" )" 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( "string", 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}" status="run"/> + <testcase classname="<exe-name>.global" name="Static arrays are convertible to string/Multiple" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Static arrays are convertible to string/Non-trivial inner items" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="String matchers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Empty string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/From string literal" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/From sub-string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Copy construction is shallow" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Copy assignment is shallow" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Substrings/zero-based substring" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Substrings/non-zero-based substring" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Substrings/Pointer values of full refs should match" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Substrings/Pointer values of substring refs should also match" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Substrings/Past the end substring" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Substrings/Substring off the end are trimmed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Substrings/substring start after the end is empty" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/Comparisons are deep" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/from std::string/implicitly constructed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/from std::string/explicitly constructed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/from std::string/assigned" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/to std::string/explicitly constructed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/to std::string/assigned" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/std::string += StringRef" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef/StringRef + StringRef" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef at compilation time/Simple constructors" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="StringRef at compilation time/UDL construction" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying char arrays with statically known sizes - char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying char arrays with statically known sizes - signed char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying char arrays with statically known sizes - unsigned char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying std::chrono::duration helpers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying std::chrono::duration with weird ratios" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying std::chrono::time_point<system_clock>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tabs and newlines show in output" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tags with spaces and non-alphanumerical characters are accepted" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 1" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 2" time="{duration}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Template test case with test types specified inside std::tuple - MyTypes - 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Template test case with test types specified inside std::tuple - MyTypes - 1" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Template test case with test types specified inside std::tuple - MyTypes - 2" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - float/reserving smaller does not change size or capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - int/reserving smaller does not change size or capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::string/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving smaller does not change size or capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/reserving smaller does not change size or capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - float,4/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - int,5/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Test case with identical tags keeps just one" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Test case with one argument" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Test with special, characters "in name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Testing checked-if" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Testing checked-if 2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Misc.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Testing checked-if 3" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Misc.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="The NO_FAIL macro reports a failure but does not fail the test" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing reporters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing tests" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing listeners" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="This test 'should' fail but doesn't" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Thrown string literals are translated" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Tracker/successfully close one section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tracker/fail one section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tracker/fail one section/re-enter after failed section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tracker/fail one section/re-enter after failed section and find next section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tracker/successfully close one section, then find another" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2" time="{duration}" status="run"/> + <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}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Tracker/open a nested section" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Trim strings" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Unexpected exceptions can be translated" time="{duration}" status="run"> + <error type="TEST_CASE"> +FAILED: +3.14 +Exception.tests.cpp:<line number> + </error> + </testcase> + <testcase classname="<exe-name>.global" name="Upcasting special member functions/Move constructor" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Upcasting special member functions/move assignment" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllMatch range matcher/Basic usage" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllMatch range matcher/Type requires ADL found begin and end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllMatch range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllMatch range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/Empty evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/One false evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Contained type is convertible to bool/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Contained type is convertible to bool/One false evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Contained type is convertible to bool/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Basic usage" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Type requires ADL found begin and end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyMatch range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/Empty evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/One true evalutes to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All true evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Contained type is convertible to bool/One true evalutes to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Basic usage" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Type requires ADL found begin and end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneMatch range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/All true evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/Empty evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/One true evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage/All false evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All true evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Contained type is convertible to bool/One true evalutes to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All false evaluates to true" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Shortcircuiting/All are read" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Shortcircuiting/Short-circuited" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher/Some with stdlib containers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher/Type requires ADL found size free function" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher/Type has size member" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Use a custom approx" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Variadic macros/Section with one argument" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector Approx matcher/Empty vector is roughly equal to an empty vector" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/A vector is approx equal to itself" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/Different length" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/Same length, different elements" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector Approx matcher -- failing/Empty and non empty vectors are not approx equal" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector matchers/Contains (vector)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector matchers/Contains (element), composed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector matchers/Equals" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector matchers/UnorderedEquals" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Vector matchers that fail/Contains (element)" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown directly they are always failures" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"> + <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}" status="run"> + <error type="TEST_CASE"> +FAILED: +unexpected exception +Exception.tests.cpp:<line number> + </error> + </testcase> + <testcase classname="<exe-name>.global" name="X/level/0/a" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="X/level/0/b" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="X/level/1/a" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="X/level/1/b" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/normal string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/empty string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/string with ampersand" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/string with less-than" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/string with greater-than" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/string with quotes" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/string with control char (1)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode/string with control char (x7F)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlWriter writes boolean attributes as true/false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="analyse no analysis" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="array<int, N> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="benchmark function call/without chronometer" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="benchmark function call/with chronometer" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="boolean member" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="checkedElse" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="checkedElse, failing" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="checkedIf, failing" time="{duration}" status="run"> + <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="classify_outliers/none" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="classify_outliers/low severe" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="classify_outliers/low mild" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="classify_outliers/high mild" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="classify_outliers/high severe" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="classify_outliers/mixed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="comparisons between const int variables" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="comparisons between int variables" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="convertToBits" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="empty tags are not allowed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="erfc_inv" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="estimate_clock_resolution" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c/d (leaf)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c/e (leaf)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="even more nested SECTION tests/f (leaf)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="is_unary_function" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="just failure" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 0" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 3" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 4" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 5" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 6" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 7" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 8" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests/b is currently: 9" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped tests" time="{duration}" status="run"> + <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="makeStream recognizes %debug stream name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="make_unique reimplementation/From lvalue copies" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="make_unique reimplementation/From rvalue moves" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="make_unique reimplementation/Variadic constructor" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="mean" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="measure" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="mix info, unscoped info and warning" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="more nested SECTION tests/equal/doesn't equal" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="more nested SECTION tests/doesn't equal/less than" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="nested SECTION tests/doesn't equal" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="nested SECTION tests/doesn't equal/not equal" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="non streamable - with conv. op" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="non-copyable objects" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="normal_cdf" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="normal_quantile" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="not allowed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="not prints unscoped info from previous failures" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="null_ptr" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="pair<pair<int,const char *,pair<std::string,int> > -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="parseEnums/No enums" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="parseEnums/One enum value" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="parseEnums/Multiple enum values" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="pointer to class" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="print unscoped info if passing unscoped info is printed" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="prints unscoped info on failure" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="random SECTION tests/not equal" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/replace single char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/replace two chars" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/replace first char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/replace last char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/replace all chars" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/replace no chars" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/escape '" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="request an unknown %-starting stream fails" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="resolution" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="run_for_at_least, chronometer" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="run_for_at_least, int" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="send a single char to INFO" time="{duration}" status="run"> + <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}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="splitString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stacks unscoped info in loops" time="{duration}" status="run"> + <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="startsWith" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::map is convertible string/empty" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::map is convertible string/single item" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::map is convertible string/several items" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::pair<int,const std::string> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::pair<int,std::string> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::set is convertible string/empty" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::set is convertible string/single item" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::set is convertible string/several items" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="std::vector<std::pair<std::string,int> > -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stdout and stderr streams have %-starting name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify ranges" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( has_maker )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( has_maker_and_operator )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( has_neither )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( has_operator )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( has_template_operator )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( vectors<has_maker> )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( vectors<has_maker_and_operator> )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="stringify( vectors<has_operator> )" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="strlen3" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tables" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tags with dots in later positions are not parsed as hidden" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="thrown std::strings are translated" time="{duration}" status="run"> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="toString on const wchar_t pointer returns the string contents" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="toString on wchar_t const pointer returns the string contents" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="toString on wchar_t returns the string contents" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="toString(enum class w/operator<<)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="toString(enum class)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="toString(enum w/operator<<)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="toString(enum)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tuple<>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tuple<float,int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tuple<int>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tuple<string,string>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tuple<tuple<int>,tuple<>,float>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="uniform samples" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/Default constructed unique_ptr is empty" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/Take ownership of allocation" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/Take ownership of allocation/Plain reset deallocates" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/Take ownership of allocation/Reset replaces ownership" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/Release releases ownership" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/Move constructor" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/Move assignment" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality/free swap" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vec<vec<string,alloc>> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vector<bool> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vector<int,allocator> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vector<int> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vector<string> -> toString" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vectors can be sized and resized" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vectors can be sized and resized/resizing bigger changes size and capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vectors can be sized and resized/resizing smaller changes size but not capacity" time="{duration}" status="run"/> + <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}" status="run"/> + <testcase classname="<exe-name>.global" name="vectors can be sized and resized/reserving bigger changes capacity but not size" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="vectors can be sized and resized/reserving smaller does not change size or capacity" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="warmup" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="weighted_average_quantile" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="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>" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="xmlentitycheck/encoded chars: these should all be encoded: &&&"""<<<&"<<&"" time="{duration}" status="run"/> + <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/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index 924a14b19..a9319a628 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- rng-seed=1 --> <testExecutions version="1"loose text artifact > <file path="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp"> <testCase name="Clara::Arg supports single-arg parse the way Opt does" duration="{duration}"/> + <testCase name="Clara::Opt supports accept-many lambdas/Parsing fails on multiple options without accept_many" duration="{duration}"/> + <testCase name="Clara::Opt supports accept-many lambdas/Parsing succeeds on multiple options with accept_many" duration="{duration}"/> + <testCase name="is_unary_function" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp"> <testCase name="#1905 -- test spec parser properly clears internal state between compound tests" duration="{duration}"/> @@ -43,6 +47,15 @@ <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="Parsing sharding-related cli flags/shard-count" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Negative shard count reports error" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Zero shard count reports error" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/shard-index" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Negative shard index reports error" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Shard index 0 is accepted" duration="{duration}"/> + <testCase name="Parsing warnings/NoAssertions" duration="{duration}"/> + <testCase name="Parsing warnings/NoTests is no longer supported" duration="{duration}"/> + <testCase name="Parsing warnings/Combining multiple warnings" 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}"/> @@ -51,8 +64,12 @@ <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/reporter/With output file" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/With Windows-like absolute path as output file" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/Multiple reporters/All with output files" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/Multiple reporters/Mixed output files and default output" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/Multiple reporters/cannot have multiple reporters with default output" 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}"/> @@ -77,6 +94,17 @@ <testCase name="Process can be configured on command line/Benchmark options/warmup-time" duration="{duration}"/> <testCase name="Test with special, characters "in name" duration="{duration}"/> </file> + <file path="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp"> + <testCase name="ColourGuard behaviour/ColourGuard is disengaged by default" duration="{duration}"/> + <testCase name="ColourGuard behaviour/ColourGuard is engaged by op<<" duration="{duration}"/> + <testCase name="ColourGuard behaviour/ColourGuard can be engaged explicitly" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp"> + <testCase name="CaseInsensitiveEqualsTo is case insensitive/Degenerate cases" duration="{duration}"/> + <testCase name="CaseInsensitiveEqualsTo is case insensitive/Plain comparisons" duration="{duration}"/> + <testCase name="CaseInsensitiveLess is case insensitive/Degenerate cases" duration="{duration}"/> + <testCase name="CaseInsensitiveLess is case insensitive/Plain comparisons" duration="{duration}"/> + </file> <file path="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp"> <testCase name="convertToBits" duration="{duration}"/> </file> @@ -85,7 +113,9 @@ <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/Filter generator/Simple filtering" duration="{duration}"/> + <testCase name="Generators internals/Filter generator/Filter out multiple elements at the start and end" duration="{duration}"/> + <testCase name="Generators internals/Filter generator/Throws on construction if it can't get initial element" 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}"/> @@ -152,41 +182,59 @@ <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}"/> + <testCase name="Random seed generation accepts known methods" duration="{duration}"/> + <testCase name="Random seed generation reports unknown methods" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp"> + <testCase name="Multireporter calls reporters and listeners in correct order" duration="{duration}"/> + <testCase name="Multireporter updates ReporterPreferences properly" duration="{duration}"/> + <testCase name="Multireporter updates ReporterPreferences properly/Adding listeners" duration="{duration}"/> + <testCase name="Multireporter updates ReporterPreferences properly/Adding reporters" duration="{duration}"/> + <testCase name="Registering reporter with '::' in name fails" duration="{duration}"/> <testCase name="Reporter's write listings to provided stream" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/automake reporter lists tags" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/automake reporter lists reporters" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/automake reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/Automake reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/Automake reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/Automake reporter lists tests" duration="{duration}"/> <testCase name="Reporter's write listings to provided stream/compact reporter lists tags" duration="{duration}"/> <testCase name="Reporter's write listings to provided stream/compact reporter lists reporters" duration="{duration}"/> <testCase name="Reporter's write listings to provided stream/compact reporter lists tests" duration="{duration}"/> <testCase name="Reporter's write listings to provided stream/console reporter lists tags" duration="{duration}"/> <testCase name="Reporter's write listings to provided stream/console reporter lists reporters" duration="{duration}"/> <testCase name="Reporter's write listings to provided stream/console reporter lists tests" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/junit reporter lists tags" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/junit reporter lists reporters" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/junit reporter lists tests" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/sonarqube reporter lists tags" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/sonarqube reporter lists reporters" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/sonarqube reporter lists tests" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/tap reporter lists tags" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/tap reporter lists reporters" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/tap reporter lists tests" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/teamcity reporter lists tags" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/teamcity reporter lists reporters" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/teamcity reporter lists tests" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/xml reporter lists tags" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/xml reporter lists reporters" duration="{duration}"/> - <testCase name="Reporter's write listings to provided stream/xml reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/JUnit reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/JUnit reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/JUnit reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/SonarQube reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/SonarQube reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/SonarQube reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TAP reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TAP reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TAP reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TeamCity reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TeamCity reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TeamCity reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/XML reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/XML reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/XML reporter lists tests" duration="{duration}"/> + <testCase name="Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla" duration="{duration}"/> <testCase name="The default listing implementation write to provided stream/Listing tags" duration="{duration}"/> <testCase name="The default listing implementation write to provided stream/Listing reporters" duration="{duration}"/> <testCase name="The default listing implementation write to provided stream/Listing tests" duration="{duration}"/> + <testCase name="The default listing implementation write to provided stream/Listing listeners" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp"> + <testCase name="Cout stream properly declares it writes to stdout" duration="{duration}"/> + <testCase name="Empty stream name opens cout stream" duration="{duration}"/> + <testCase name="makeStream recognizes %debug stream name" duration="{duration}"/> + <testCase name="request an unknown %-starting stream fails" duration="{duration}"/> + <testCase name="stdout and stderr streams have %-starting name" duration="{duration}"/> </file> <file path="tests/<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/Copy construction is shallow" duration="{duration}"/> + <testCase name="StringRef/Copy assignment is shallow" 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}"/> @@ -215,14 +263,30 @@ <testCase name="replaceInPlace/replace no chars" duration="{duration}"/> <testCase name="replaceInPlace/escape '" duration="{duration}"/> <testCase name="splitString" duration="{duration}"/> + <testCase name="startsWith" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp"> + <testCase name="Empty tag is not allowed" duration="{duration}"/> <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="Tags with spaces and non-alphanumerical characters are accepted" duration="{duration}"/> + <testCase name="Test case with identical tags keeps just one" duration="{duration}"/> <testCase name="empty tags are not allowed" duration="{duration}"/> <testCase name="shortened hide tags are split apart" duration="{duration}"/> <testCase name="tags with dots in later positions are not parsed as hidden" duration="{duration}"/> </file> + <file path="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp"> + <testCase name="Hashers with different seed produce different hash with same test case" duration="{duration}"/> + <testCase name="Hashers with same seed produce same hash" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different test name" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different classname" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different tags" duration="{duration}"/> + <testCase name="Hashing test case produces same hash across multiple calls" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp"> + <testCase name="Parsed tags are matched case insensitive" duration="{duration}"/> + <testCase name="Parsing tags with non-alphabetical characters is pass-through" duration="{duration}"/> + </file> <file path="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp"> <testCase name="Directly creating an EnumInfo" duration="{duration}"/> <testCase name="Range type with sentinel" duration="{duration}"/> @@ -657,6 +721,30 @@ Condition.tests.cpp:<line number> </skipped> </testCase> <testCase name="Inequality checks that should succeed" duration="{duration}"/> + <testCase name="Mayfail test case with nested sections/1/A" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/2/A" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/1/B" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/2/B" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> <testCase name="Ordering comparison checks that should fail" duration="{duration}"> <failure message="CHECK(data.int_seven > 7)"> FAILED: @@ -798,7 +886,6 @@ Condition.tests.cpp:<line number> <testCase name="comparisons between int variables" duration="{duration}"/> </file> <file path="tests/<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: @@ -1007,16 +1094,16 @@ Exception.tests.cpp:<line number> <testCase name="Composed matchers shortcircuit/MatchAllOf" duration="{duration}"/> <testCase name="Composed matchers shortcircuit/MatchAnyOf" duration="{duration}"/> <testCase name="Contains string matcher" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ))"> + <failure message="CHECK_THAT(testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ))"> FAILED: - CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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( "STRING" ))"> + <failure message="CHECK_THAT(testStringForMatching(), ContainsSubstring( "STRING" ))"> FAILED: - CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" Matchers.tests.cpp:<line number> @@ -1115,9 +1202,9 @@ Matchers.tests.cpp:<line number> <testCase name="Matchers can be (AnyOf) composed with the || operator" duration="{duration}"/> <testCase name="Matchers can be composed with both && and ||" duration="{duration}"/> <testCase name="Matchers can be composed with both && and || - failing" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ))"> + <failure message="CHECK_THAT(testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ))"> FAILED: - CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) Matchers.tests.cpp:<line number> @@ -1125,9 +1212,9 @@ Matchers.tests.cpp:<line number> </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( "substring" ))"> + <failure message="CHECK_THAT(testStringForMatching(), !ContainsSubstring( "substring" ))"> FAILED: - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" Matchers.tests.cpp:<line number> @@ -1310,14 +1397,41 @@ Matchers.tests.cpp:<line number> <testCase name="Usage of AllMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/> <testCase name="Usage of AllMatch range matcher/Shortcircuiting/All are read" duration="{duration}"/> <testCase name="Usage of AllMatch range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/Empty evaluates to true" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/One false evalutes to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Contained type is convertible to bool/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Contained type is convertible to bool/One false evalutes to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Contained type is convertible to bool/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> <testCase name="Usage of AnyMatch range matcher/Basic usage" duration="{duration}"/> <testCase name="Usage of AnyMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/> <testCase name="Usage of AnyMatch range matcher/Shortcircuiting/All are read" duration="{duration}"/> <testCase name="Usage of AnyMatch range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/Empty evaluates to false" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/One true evalutes to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Contained type is convertible to bool/One true evalutes to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> <testCase name="Usage of NoneMatch range matcher/Basic usage" duration="{duration}"/> <testCase name="Usage of NoneMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/> <testCase name="Usage of NoneMatch range matcher/Shortcircuiting/All are read" duration="{duration}"/> <testCase name="Usage of NoneMatch range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/All true evaluates to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/Empty evaluates to true" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/One true evalutes to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/All false evaluates to true" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All true evaluates to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Contained type is convertible to bool/One true evalutes to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All false evaluates to true" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> <testCase name="Usage of the SizeIs range matcher/Some with stdlib containers" duration="{duration}"/> <testCase name="Usage of the SizeIs range matcher/Type requires ADL found size free function" duration="{duration}"/> <testCase name="Usage of the SizeIs range matcher/Type has size member" duration="{duration}"/> @@ -1486,7 +1600,7 @@ Message.tests.cpp:<line number> <testCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" duration="{duration}"/> <testCase name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" duration="{duration}"/> <testCase name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" duration="{duration}"/> - <testCase name="#835 -- errno should not be touched by Catch" duration="{duration}"> + <testCase name="#835 -- errno should not be touched by Catch2" duration="{duration}"> <skipped message="CHECK(f() == 0)"> FAILED: CHECK( f() == 0 ) @@ -1608,7 +1722,6 @@ Misc.tests.cpp:<line number> </skipped> </testCase> <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="REQUIRE(testCheckedElse( false ))"> @@ -1781,7 +1894,6 @@ Misc.tests.cpp:<line number> <testCase name="tuple<>" duration="{duration}"/> <testCase name="tuple<float,int>" duration="{duration}"/> <testCase name="tuple<int>" duration="{duration}"/> - <testCase name="tuple<0,int,const char *>" duration="{duration}"/> <testCase name="tuple<string,string>" duration="{duration}"/> <testCase name="tuple<tuple<int>,tuple<>,float>" duration="{duration}"/> </file> @@ -1842,8 +1954,6 @@ Tricky.tests.cpp:<line number> <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}"/> @@ -1853,15 +1963,6 @@ Tricky.tests.cpp:<line number> <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( "first" ) == "second")"> -FAILED: - REQUIRE( std::string( "first" ) == "second" ) -with expansion: - "first" == "second" -Tricky.tests.cpp:<line number> - </failure> - </testCase> </file> <file path="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp"> <testCase name="Anonymous test case 1" duration="{duration}"/> diff --git a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt new file mode 100644 index 000000000..97b2d9881 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -0,0 +1,1971 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- rng-seed=1 --> +<testExecutions version="1"> + <file path="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp"> + <testCase name="Clara::Arg supports single-arg parse the way Opt does" duration="{duration}"/> + <testCase name="Clara::Opt supports accept-many lambdas/Parsing fails on multiple options without accept_many" duration="{duration}"/> + <testCase name="Clara::Opt supports accept-many lambdas/Parsing succeeds on multiple options with accept_many" duration="{duration}"/> + <testCase name="is_unary_function" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp"> + <testCase name="#1905 -- test spec parser properly clears internal state between compound tests" duration="{duration}"/> + <testCase name="#1912 -- test spec parser handles escaping/Various parentheses" duration="{duration}"/> + <testCase name="#1912 -- test spec parser handles escaping/backslash in test name" duration="{duration}"/> + <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="Parsing sharding-related cli flags/shard-count" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Negative shard count reports error" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Zero shard count reports error" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/shard-index" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Negative shard index reports error" duration="{duration}"/> + <testCase name="Parsing sharding-related cli flags/Shard index 0 is accepted" duration="{duration}"/> + <testCase name="Parsing warnings/NoAssertions" duration="{duration}"/> + <testCase name="Parsing warnings/NoTests is no longer supported" duration="{duration}"/> + <testCase name="Parsing warnings/Combining multiple warnings" 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/must match one of the available ones" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/With output file" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/With Windows-like absolute path as output file" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/Multiple reporters/All with output files" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/Multiple reporters/Mixed output files and default output" duration="{duration}"/> + <testCase name="Process can be configured on command line/reporter/Multiple reporters/cannot have multiple reporters with default output" 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 "in name" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp"> + <testCase name="ColourGuard behaviour/ColourGuard is disengaged by default" duration="{duration}"/> + <testCase name="ColourGuard behaviour/ColourGuard is engaged by op<<" duration="{duration}"/> + <testCase name="ColourGuard behaviour/ColourGuard can be engaged explicitly" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp"> + <testCase name="CaseInsensitiveEqualsTo is case insensitive/Degenerate cases" duration="{duration}"/> + <testCase name="CaseInsensitiveEqualsTo is case insensitive/Plain comparisons" duration="{duration}"/> + <testCase name="CaseInsensitiveLess is case insensitive/Degenerate cases" duration="{duration}"/> + <testCase name="CaseInsensitiveLess is case insensitive/Plain comparisons" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp"> + <testCase name="convertToBits" duration="{duration}"/> + </file> + <file path="tests/<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/Simple filtering" duration="{duration}"/> + <testCase name="Generators internals/Filter generator/Filter out multiple elements at the start and end" duration="{duration}"/> + <testCase name="Generators internals/Filter generator/Throws on construction if it can't get initial element" 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="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp"> + <testCase name="analyse no analysis" duration="{duration}"/> + <testCase name="benchmark function call/without chronometer" duration="{duration}"/> + <testCase name="benchmark function call/with chronometer" duration="{duration}"/> + <testCase name="classify_outliers/none" duration="{duration}"/> + <testCase name="classify_outliers/low severe" duration="{duration}"/> + <testCase name="classify_outliers/low mild" duration="{duration}"/> + <testCase name="classify_outliers/high mild" duration="{duration}"/> + <testCase name="classify_outliers/high severe" duration="{duration}"/> + <testCase name="classify_outliers/mixed" duration="{duration}"/> + <testCase name="erfc_inv" duration="{duration}"/> + <testCase name="estimate_clock_resolution" duration="{duration}"/> + <testCase name="mean" duration="{duration}"/> + <testCase name="measure" duration="{duration}"/> + <testCase name="normal_cdf" duration="{duration}"/> + <testCase name="normal_quantile" duration="{duration}"/> + <testCase name="resolution" duration="{duration}"/> + <testCase name="run_for_at_least, chronometer" duration="{duration}"/> + <testCase name="run_for_at_least, int" duration="{duration}"/> + <testCase name="uniform samples" duration="{duration}"/> + <testCase name="warmup" duration="{duration}"/> + <testCase name="weighted_average_quantile" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp"> + <testCase name="#1938 - GENERATE after a section/A" duration="{duration}"/> + <testCase name="#1938 - GENERATE after a section/B" duration="{duration}"/> + <testCase name="#1938 - Section followed by flat generate" duration="{duration}"/> + <testCase name="#1938 - Section followed by flat generate/A" duration="{duration}"/> + <testCase name="#1938 - flat generate" duration="{duration}"/> + <testCase name="#1938 - mixed sections and generates" duration="{duration}"/> + <testCase name="#1938 - mixed sections and generates/A" duration="{duration}"/> + <testCase name="#1938 - mixed sections and generates/B" duration="{duration}"/> + <testCase name="#1938 - nested generate" duration="{duration}"/> + <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="tests/<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}"/> + <testCase name="Random seed generation accepts known methods" duration="{duration}"/> + <testCase name="Random seed generation reports unknown methods" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp"> + <testCase name="Multireporter calls reporters and listeners in correct order" duration="{duration}"/> + <testCase name="Multireporter updates ReporterPreferences properly" duration="{duration}"/> + <testCase name="Multireporter updates ReporterPreferences properly/Adding listeners" duration="{duration}"/> + <testCase name="Multireporter updates ReporterPreferences properly/Adding reporters" duration="{duration}"/> + <testCase name="Registering reporter with '::' in name fails" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/Automake reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/Automake reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/Automake reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/compact reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/compact reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/compact reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/console reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/console reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/console reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/JUnit reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/JUnit reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/JUnit reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/SonarQube reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/SonarQube reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/SonarQube reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TAP reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TAP reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TAP reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TeamCity reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TeamCity reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/TeamCity reporter lists tests" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/XML reporter lists tags" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/XML reporter lists reporters" duration="{duration}"/> + <testCase name="Reporter's write listings to provided stream/XML reporter lists tests" duration="{duration}"/> + <testCase name="Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla" duration="{duration}"/> + <testCase name="The default listing implementation write to provided stream/Listing tags" duration="{duration}"/> + <testCase name="The default listing implementation write to provided stream/Listing reporters" duration="{duration}"/> + <testCase name="The default listing implementation write to provided stream/Listing tests" duration="{duration}"/> + <testCase name="The default listing implementation write to provided stream/Listing listeners" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp"> + <testCase name="Cout stream properly declares it writes to stdout" duration="{duration}"/> + <testCase name="Empty stream name opens cout stream" duration="{duration}"/> + <testCase name="makeStream recognizes %debug stream name" duration="{duration}"/> + <testCase name="request an unknown %-starting stream fails" duration="{duration}"/> + <testCase name="stdout and stderr streams have %-starting name" duration="{duration}"/> + </file> + <file path="tests/<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/Copy construction is shallow" duration="{duration}"/> + <testCase name="StringRef/Copy assignment is shallow" 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/Substrings/substring start after the end is empty" 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/std::string += StringRef" duration="{duration}"/> + <testCase name="StringRef/StringRef + StringRef" 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="tests/<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}"/> + <testCase name="startsWith" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp"> + <testCase name="Empty tag is not allowed" duration="{duration}"/> + <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="Tags with spaces and non-alphanumerical characters are accepted" duration="{duration}"/> + <testCase name="Test case with identical tags keeps just one" duration="{duration}"/> + <testCase name="empty tags are not allowed" duration="{duration}"/> + <testCase name="shortened hide tags are split apart" duration="{duration}"/> + <testCase name="tags with dots in later positions are not parsed as hidden" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp"> + <testCase name="Hashers with different seed produce different hash with same test case" duration="{duration}"/> + <testCase name="Hashers with same seed produce same hash" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different test name" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different classname" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different tags" duration="{duration}"/> + <testCase name="Hashing test case produces same hash across multiple calls" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp"> + <testCase name="Parsed tags are matched case insensitive" duration="{duration}"/> + <testCase name="Parsing tags with non-alphabetical characters is pass-through" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp"> + <testCase name="Directly creating an EnumInfo" duration="{duration}"/> + <testCase name="Range type with sentinel" duration="{duration}"/> + <testCase name="Stringifying char arrays with statically known sizes - char" duration="{duration}"/> + <testCase name="Stringifying char arrays with statically known sizes - signed char" duration="{duration}"/> + <testCase name="Stringifying char arrays with statically known sizes - unsigned char" 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="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp"> + <testCase name="Upcasting special member functions/Move constructor" duration="{duration}"/> + <testCase name="Upcasting special member functions/move assignment" duration="{duration}"/> + <testCase name="make_unique reimplementation/From lvalue copies" duration="{duration}"/> + <testCase name="make_unique reimplementation/From rvalue moves" duration="{duration}"/> + <testCase name="make_unique reimplementation/Variadic constructor" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/Default constructed unique_ptr is empty" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/Take ownership of allocation" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/Take ownership of allocation/Plain reset deallocates" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/Take ownership of allocation/Reset replaces ownership" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/Release releases ownership" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/Move constructor" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/Move assignment" duration="{duration}"/> + <testCase name="unique_ptr reimplementation: basic functionality/free swap" duration="{duration}"/> + </file> + <file path="tests/<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}"/> + <testCase name="XmlWriter writes boolean attributes as true/false" duration="{duration}"/> + </file> + <file path="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Class.tests.cpp"> + <testCase name="A METHOD_AS_TEST_CASE based test run that fails" duration="{duration}"> + <failure message="REQUIRE(s == "world")"> +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<float>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>::m_a.size() == 1)"> +FAILED: + REQUIRE( Template_Fixture_2<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<int>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>::m_a.size() == 1)"> +FAILED: + REQUIRE( Template_Fixture_2<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<float>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>::m_a.size() == 1)"> +FAILED: + REQUIRE( Template_Fixture_2<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<int>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>::m_a.size() == 1)"> +FAILED: + REQUIRE( Template_Fixture_2<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<float>" duration="{duration}"/> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>" duration="{duration}"/> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>" duration="{duration}"/> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>" duration="{duration}"/> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2)"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 6 < 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<int, 2>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2)"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 2 < 2 +Class.tests.cpp:<line number> + </failure> + </testCase> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2)"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 6 < 2 +Class.tests.cpp:<line number> + </failure> + </testCase> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2>" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2)"> +FAILED: + REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 ) +with expansion: + 2 < 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<float,6>" duration="{duration}"/> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2>" duration="{duration}"/> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6>" duration="{duration}"/> + <testCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2>" duration="{duration}"/> + <testCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" duration="{duration}"> + <failure message="REQUIRE(Template_Fixture<TestType>::m_a == 2)"> +FAILED: + REQUIRE( Template_Fixture<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<TestType>::m_a == 2)"> +FAILED: + REQUIRE( Template_Fixture<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<TestType>::m_a == 2)"> +FAILED: + REQUIRE( Template_Fixture<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<V>::value == 0)"> +FAILED: + REQUIRE( Nttp_Fixture<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<V>::value == 0)"> +FAILED: + REQUIRE( Nttp_Fixture<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<V>::value == 0)"> +FAILED: + REQUIRE( Nttp_Fixture<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="tests/<exe-name>/UsageTests/Compilation.tests.cpp"> + <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="#1319: Sections can have description (even if it is not saved/SectionName" 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="Assertion macros support bit operators and bool conversions" duration="{duration}"/> + <testCase name="Lambdas in assertions" duration="{duration}"/> + <testCase name="Optionally static assertions" duration="{duration}"/> + </file> + <file path="tests/<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 == "goodbye")"> +FAILED: + CHECK( data.str_hello == "goodbye" ) +with expansion: + "hello" == "goodbye" +Condition.tests.cpp:<line number> + </skipped> + <skipped message="CHECK(data.str_hello == "hell")"> +FAILED: + CHECK( data.str_hello == "hell" ) +with expansion: + "hello" == "hell" +Condition.tests.cpp:<line number> + </skipped> + <skipped message="CHECK(data.str_hello == "hello1")"> +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 != "hello")"> +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="Mayfail test case with nested sections/1/A" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/2/A" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/1/B" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/2/B" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <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 < 7)"> +FAILED: + CHECK( data.int_seven < 7 ) +with expansion: + 7 < 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 < 6)"> +FAILED: + CHECK( data.int_seven < 6 ) +with expansion: + 7 < 6 +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.int_seven < 0)"> +FAILED: + CHECK( data.int_seven < 0 ) +with expansion: + 7 < 0 +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.int_seven < -1)"> +FAILED: + CHECK( data.int_seven < -1 ) +with expansion: + 7 < -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 <= 6)"> +FAILED: + CHECK( data.int_seven <= 6 ) +with expansion: + 7 <= 6 +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.float_nine_point_one < 9)"> +FAILED: + CHECK( data.float_nine_point_one < 9 ) +with expansion: + 9.1f < 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 > "hello")"> +FAILED: + CHECK( data.str_hello > "hello" ) +with expansion: + "hello" > "hello" +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.str_hello < "hello")"> +FAILED: + CHECK( data.str_hello < "hello" ) +with expansion: + "hello" < "hello" +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.str_hello > "hellp")"> +FAILED: + CHECK( data.str_hello > "hellp" ) +with expansion: + "hello" > "hellp" +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.str_hello > "z")"> +FAILED: + CHECK( data.str_hello > "z" ) +with expansion: + "hello" > "z" +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.str_hello < "hellm")"> +FAILED: + CHECK( data.str_hello < "hellm" ) +with expansion: + "hello" < "hellm" +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.str_hello < "a")"> +FAILED: + CHECK( data.str_hello < "a" ) +with expansion: + "hello" < "a" +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.str_hello >= "z")"> +FAILED: + CHECK( data.str_hello >= "z" ) +with expansion: + "hello" >= "z" +Condition.tests.cpp:<line number> + </failure> + <failure message="CHECK(data.str_hello <= "a")"> +FAILED: + CHECK( data.str_hello <= "a" ) +with expansion: + "hello" <= "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="tests/<exe-name>/UsageTests/Decomposition.tests.cpp"> + <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="tests/<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<<)" duration="{duration}"/> + <testCase name="toString(enum class)" duration="{duration}"/> + <testCase name="toString(enum w/operator<<)" duration="{duration}"/> + <testCase name="toString(enum)" duration="{duration}"/> + </file> + <file path="tests/<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(), "should fail")"> +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="tests/<exe-name>/UsageTests/Generators.tests.cpp"> + <testCase name="#1913 - GENERATE inside a for loop should not keep recreating the generator" duration="{duration}"/> + <testCase name="#1913 - GENERATEs can share a line" duration="{duration}"/> + <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="tests/<exe-name>/UsageTests/Matchers.tests.cpp"> + <testCase name="#2152 - ULP checks between differently signed values were wrong - double" duration="{duration}"/> + <testCase name="#2152 - ULP checks between differently signed values were wrong - float" duration="{duration}"/> + <testCase name="Arbitrary predicate matcher/Function pointer" duration="{duration}"/> + <testCase name="Arbitrary predicate matcher/Lambdas + different type" duration="{duration}"/> + <testCase name="Combining MatchAllOfGeneric does not nest" duration="{duration}"/> + <testCase name="Combining MatchAnyOfGeneric does not nest" duration="{duration}"/> + <testCase name="Combining MatchNotOfGeneric does not nest" duration="{duration}"/> + <testCase name="Combining concrete matchers does not use templated matchers" duration="{duration}"/> + <testCase name="Combining only templated matchers" duration="{duration}"/> + <testCase name="Combining templated and concrete matchers" duration="{duration}"/> + <testCase name="Combining templated matchers" duration="{duration}"/> + <testCase name="Composed generic matchers shortcircuit/MatchAllOf" duration="{duration}"/> + <testCase name="Composed generic matchers shortcircuit/MatchAnyOf" duration="{duration}"/> + <testCase name="Composed matchers shortcircuit/MatchAllOf" duration="{duration}"/> + <testCase name="Composed matchers shortcircuit/MatchAnyOf" duration="{duration}"/> + <testCase name="Contains string matcher" duration="{duration}"> + <failure message="CHECK_THAT(testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ))"> +FAILED: + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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(), ContainsSubstring( "STRING" ))"> +FAILED: + CHECK_THAT( testStringForMatching(), ContainsSubstring( "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( "Substring" ))"> +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( "this", 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( "this string contains 'ABC' as a substring" ))"> +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( "something else", 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 && operator" duration="{duration}"/> + <testCase name="Matchers can be (AnyOf) composed with the || operator" duration="{duration}"/> + <testCase name="Matchers can be composed with both && and ||" duration="{duration}"/> + <testCase name="Matchers can be composed with both && and || - failing" duration="{duration}"> + <failure message="CHECK_THAT(testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ))"> +FAILED: + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "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(), !ContainsSubstring( "substring" ))"> +FAILED: + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ) +with expansion: + "this string contains 'abc' as a substring" not contains: "substring" +Matchers.tests.cpp:<line number> + </failure> + </testCase> + <testCase name="Overloaded comma or address-of operators are not used" duration="{duration}"/> + <testCase name="Predicate matcher can accept const char*" duration="{duration}"/> + <testCase name="Regex string matcher" duration="{duration}"> + <failure message="CHECK_THAT(testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ))"> +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( "contains 'abc' as a substring" ))"> +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( "this string contains 'abc' as a" ))"> +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( "This String" ))"> +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( "string", 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="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp"> + <testCase name="Basic use of the Contains range matcher/Different argument ranges, same element type, default comparison" duration="{duration}"/> + <testCase name="Basic use of the Contains range matcher/Different argument ranges, same element type, custom comparison" duration="{duration}"/> + <testCase name="Basic use of the Contains range matcher/Different element type, custom comparisons" duration="{duration}"/> + <testCase name="Basic use of the Contains range matcher/Can handle type that requires ADL-found free function begin and end" duration="{duration}"/> + <testCase name="Basic use of the Contains range matcher/Initialization with move only types" duration="{duration}"/> + <testCase name="Basic use of the Contains range matcher/Matching using matcher" duration="{duration}"/> + <testCase name="Basic use of the Empty range matcher/Simple, std-provided containers" duration="{duration}"/> + <testCase name="Basic use of the Empty range matcher/Type with empty" duration="{duration}"/> + <testCase name="Basic use of the Empty range matcher/Type requires ADL found empty free function" duration="{duration}"/> + <testCase name="Usage of AllMatch range matcher/Basic usage" duration="{duration}"/> + <testCase name="Usage of AllMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/> + <testCase name="Usage of AllMatch range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of AllMatch range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/Empty evaluates to true" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/One false evalutes to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Contained type is convertible to bool/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Contained type is convertible to bool/One false evalutes to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Contained type is convertible to bool/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of AnyMatch range matcher/Basic usage" duration="{duration}"/> + <testCase name="Usage of AnyMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/> + <testCase name="Usage of AnyMatch range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of AnyMatch range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/Empty evaluates to false" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/One true evalutes to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All true evaluates to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Contained type is convertible to bool/One true evalutes to true" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Contained type is convertible to bool/All false evaluates to false" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of NoneMatch range matcher/Basic usage" duration="{duration}"/> + <testCase name="Usage of NoneMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/> + <testCase name="Usage of NoneMatch range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of NoneMatch range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/All true evaluates to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/Empty evaluates to true" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/One true evalutes to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage/All false evaluates to true" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All true evaluates to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Contained type is convertible to bool/One true evalutes to false" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Contained type is convertible to bool/All false evaluates to true" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Shortcircuiting/All are read" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Shortcircuiting/Short-circuited" duration="{duration}"/> + <testCase name="Usage of the SizeIs range matcher/Some with stdlib containers" duration="{duration}"/> + <testCase name="Usage of the SizeIs range matcher/Type requires ADL found size free function" duration="{duration}"/> + <testCase name="Usage of the SizeIs range matcher/Type has size member" duration="{duration}"/> + </file> + <file path="tests/<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 < 10)"> +FAILED: + REQUIRE( i < 10 ) +with expansion: + 10 < 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="tests/<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="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" duration="{duration}"/> + <testCase name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" duration="{duration}"/> + <testCase name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" duration="{duration}"/> + <testCase name="#835 -- errno should not be touched by Catch2" 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<float>" duration="{duration}"/> + <testCase name="A Template product test case - Foo<int>" duration="{duration}"/> + <testCase name="A Template product test case - std::vector<float>" duration="{duration}"/> + <testCase name="A Template product test case - std::vector<int>" duration="{duration}"/> + <testCase name="A Template product test case with array signature - Bar<float, 42>" duration="{duration}"/> + <testCase name="A Template product test case with array signature - Bar<int, 9>" duration="{duration}"/> + <testCase name="A Template product test case with array signature - std::array<float, 42>" duration="{duration}"/> + <testCase name="A Template product test case with array signature - std::array<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<int, double, float>" duration="{duration}"/> + <testCase name="Product with differing arities - std::tuple<int, double>" duration="{duration}"/> + <testCase name="Product with differing arities - std::tuple<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<int,float>" duration="{duration}"/> + <testCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing bigger changes size and capacity" duration="{duration}"/> + <testCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing smaller changes size but not capacity" duration="{duration}"/> + <testCase name="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" duration="{duration}"/> + <testCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving bigger changes capacity but not size" duration="{duration}"/> + <testCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving smaller does not change size or capacity" duration="{duration}"/> + <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6" duration="{duration}"/> + <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/resizing bigger changes size and capacity" duration="{duration}"/> + <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/resizing smaller changes size but not capacity" duration="{duration}"/> + <testCase name="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" duration="{duration}"/> + <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/reserving bigger changes capacity but not size" duration="{duration}"/> + <testCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<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="Testing checked-if" duration="{duration}"/> + <testCase name="Testing checked-if 2" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Misc.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Testing checked-if 3" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Misc.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="This test 'should' fail but doesn't" duration="{duration}"/> + <testCase name="checkedElse" duration="{duration}"/> + <testCase name="checkedElse, failing" duration="{duration}"> + <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="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: <test>it should be possible to embed xml characters, such as <, " or &, or even whole <xml>documents</xml> within an attribute</test>" duration="{duration}"/> + <testCase name="xmlentitycheck/encoded chars: these should all be encoded: &&&"""<<<&"<<&"" duration="{duration}"/> + </file> + <file path="tests/<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<system_clock>" duration="{duration}"/> + </file> + <file path="tests/<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="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp"> + <testCase name="pair<pair<int,const char *,pair<std::string,int> > -> toString" duration="{duration}"/> + <testCase name="std::pair<int,const std::string> -> toString" duration="{duration}"/> + <testCase name="std::pair<int,std::string> -> toString" duration="{duration}"/> + <testCase name="std::vector<std::pair<std::string,int> > -> toString" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp"> + <testCase name="tuple<>" duration="{duration}"/> + <testCase name="tuple<float,int>" duration="{duration}"/> + <testCase name="tuple<int>" duration="{duration}"/> + <testCase name="tuple<string,string>" duration="{duration}"/> + <testCase name="tuple<tuple<int>,tuple<>,float>" duration="{duration}"/> + </file> + <file path="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp"> + <testCase name="array<int, N> -> toString" duration="{duration}"/> + <testCase name="vec<vec<string,alloc>> -> toString" duration="{duration}"/> + <testCase name="vector<bool> -> toString" duration="{duration}"/> + <testCase name="vector<int,allocator> -> toString" duration="{duration}"/> + <testCase name="vector<int> -> toString" duration="{duration}"/> + <testCase name="vector<string> -> toString" duration="{duration}"/> + </file> + <file path="tests/<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<has_maker> )" duration="{duration}"/> + <testCase name="stringify( vectors<has_maker_and_operator> )" duration="{duration}"/> + <testCase name="stringify( vectors<has_operator> )" duration="{duration}"/> + </file> + <file path="tests/<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(&o1 == &o2)"> +FAILED: + CHECK( &o1 == &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="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}"/> + </file> + <file path="tests/<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/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt index 724cd499b..2c7adae54 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -1,9 +1,6 @@ +# rng-seed: 1 # # A test name that starts with a # ok {test-number} - with 1 message: 'yay' -# #1005: Comparing pointer to int and long (NULL can be either on various systems) -ok {test-number} - fptr == 0 for: 0 == 0 -# #1005: Comparing pointer to int and long (NULL can be either on various systems) -ok {test-number} - fptr == 0l for: 0 == 0 # #1027: Bitfields can be captured ok {test-number} - y.v == 0 for: 0 == 0 # #1027: Bitfields can be captured @@ -188,10 +185,10 @@ ok {test-number} - throws_int(false) ok {test-number} - "aaa", Catch::Matchers::EndsWith("aaa") for: "aaa" ends with: "aaa" # #833 ok {test-number} - templated_tests<int>(3) for: true -# #835 -- errno should not be touched by Catch +# #835 -- errno should not be touched by Catch2 not ok {test-number} - f() == 0 for: 1 == 0 -# #835 -- errno should not be touched by Catch -ok {test-number} - errno == 1 for: 1 == 1 +# #835 -- errno should not be touched by Catch2 +ok {test-number} - errno_after == 1 for: 1 == 1 # #872 ok {test-number} - x == 4 for: {?} == 4 with 1 message: 'dummy := 0' # #961 -- Dynamically created sections should all be reported @@ -666,6 +663,36 @@ ok {test-number} - with 11 messages: '("comma, in string", "escaped, \", ") := " ok {test-number} - true with 1 message: 'i := 2' # Capture and info messages ok {test-number} - true with 1 message: '3' +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "", "" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - !(eq( "", "a" )) for: !false +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "a", "a" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "a", "A" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "A", "a" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "A", "A" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - !(eq( "a", "b" )) for: !false +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - !(eq( "a", "B" )) for: !false +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "", "a" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - !(lt( "a", "a" )) for: !false +# CaseInsensitiveLess is case insensitive +ok {test-number} - !(lt( "", "" )) for: !false +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "a", "b" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "a", "B" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "A", "b" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "A", "B" ) for: true # Character pretty printing ok {test-number} - tab == '\t' for: '\t' == '\t' # Character pretty printing @@ -698,60 +725,72 @@ ok {test-number} - c == i for: 5 == 5 ok {test-number} - name.empty() for: true # Clara::Arg supports single-arg parse the way Opt does ok {test-number} - name == "foo" for: "foo" == "foo" +# Clara::Opt supports accept-many lambdas +ok {test-number} - !(parse_result) for: !{?} +# Clara::Opt supports accept-many lambdas +ok {test-number} - parse_result for: {?} +# Clara::Opt supports accept-many lambdas +ok {test-number} - res == std::vector<std::string>{ "aaa", "bbb" } for: { "aaa", "bbb" } == { "aaa", "bbb" } +# ColourGuard behaviour +ok {test-number} - streamWrapper.str().empty() for: true +# ColourGuard behaviour +ok {test-number} - streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" for: "1 Using code: 2 2 Using code: 0 3 " == "1 Using code: 2 2 Using code: 0 3 " +# ColourGuard behaviour +ok {test-number} - streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" for: "Using code: 2 A B Using code: 0 C " == "Using code: 2 A B Using code: 0 C " # Combining MatchAllOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAllOfGeneric does not nest -ok {test-number} - 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) +ok {test-number} - 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) # Combining MatchAllOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAllOfGeneric does not nest -ok {test-number} - 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) +ok {test-number} - 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) # Combining MatchAllOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' # Combining MatchAllOfGeneric does not nest -ok {test-number} - 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) +ok {test-number} - 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true ) # Combining MatchAnyOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAnyOfGeneric does not nest -ok {test-number} - 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) +ok {test-number} - 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) # Combining MatchAnyOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAnyOfGeneric does not nest -ok {test-number} - 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) +ok {test-number} - 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) # Combining MatchAnyOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' # Combining MatchAnyOfGeneric does not nest -ok {test-number} - 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) +ok {test-number} - 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true ) # Combining MatchNotOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' # Combining MatchNotOfGeneric does not nest -ok {test-number} - 0, !MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f +ok {test-number} - 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1" # Combining MatchNotOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value' # Combining MatchNotOfGeneric does not nest -ok {test-number} - 1, !!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f +ok {test-number} - 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1" # Combining MatchNotOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' # Combining MatchNotOfGeneric does not nest -ok {test-number} - 0, !!!MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f +ok {test-number} - 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1" # Combining MatchNotOfGeneric does not nest ok {test-number} - with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value' # Combining MatchNotOfGeneric does not nest -ok {test-number} - 1, !!!!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f +ok {test-number} - 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1" # Combining concrete matchers does not use templated matchers ok {test-number} - with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value' # Combining only templated matchers ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value' # Combining only templated matchers -ok {test-number} - 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) +ok {test-number} - 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) # Combining only templated matchers ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value' # Combining only templated matchers -ok {test-number} - 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) +ok {test-number} - 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) # Combining only templated matchers ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value' # Combining only templated matchers -ok {test-number} - 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) +ok {test-number} - 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) # Combining templated and concrete matchers ok {test-number} - vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) for: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) # Combining templated and concrete matchers @@ -893,9 +932,9 @@ ok {test-number} - first.matchCalled for: true # Composed matchers shortcircuit ok {test-number} - !second.matchCalled for: true # Contains string matcher -not ok {test-number} - testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) +not ok {test-number} - testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) # Contains string matcher -not ok {test-number} - testStringForMatching(), Contains( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" +not ok {test-number} - testStringForMatching(), ContainsSubstring( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" # Copy and then generate a range ok {test-number} - elem % 2 == 1 for: 1 == 1 # Copy and then generate a range @@ -924,6 +963,8 @@ ok {test-number} - elem % 2 == 1 for: 1 == 1 ok {test-number} - call_count == 1 for: 1 == 1 # Copy and then generate a range ok {test-number} - make_data().size() == test_count for: 6 == 6 +# Cout stream properly declares it writes to stdout +ok {test-number} - Catch::makeStream( "-" )->isConsole() for: true # Custom exceptions can be translated when testing for nothrow not ok {test-number} - unexpected exception with message: 'custom exception - not std'; expression was: throwCustom() # Custom exceptions can be translated when testing for throwing as something else @@ -940,6 +981,10 @@ ok {test-number} - enumInfo->lookup(0) == "Value1" for: Value1 == "Value1" ok {test-number} - enumInfo->lookup(1) == "Value2" for: Value2 == "Value2" # Directly creating an EnumInfo ok {test-number} - enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **} == "{** unexpected enum value **}" +# Empty stream name opens cout stream +ok {test-number} - Catch::makeStream( "" )->isConsole() for: true +# Empty tag is not allowed +ok {test-number} - Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) # EndsWith string matcher not ok {test-number} - testStringForMatching(), EndsWith( "Substring" ) for: "this string contains 'abc' as a substring" ends with: "Substring" # EndsWith string matcher @@ -1039,9 +1084,9 @@ ok {test-number} - thisThrows(), StartsWith( "expected" ) for: "expected excepti # Exception messages can be tested for ok {test-number} - thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception" # Exception messages can be tested for -ok {test-number} - thisThrows(), Contains( "except" ) for: "expected exception" contains: "except" +ok {test-number} - thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except" # Exception messages can be tested for -ok {test-number} - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) +ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) # Exceptions matchers ok {test-number} - throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what" # Exceptions matchers @@ -1367,7 +1412,17 @@ ok {test-number} - gen.get() == 3 for: 3 == 3 # Generators internals ok {test-number} - !(gen.next()) for: !false # Generators internals -ok {test-number} - filter([] (int) { return false; }, value(1)), Catch::GeneratorException +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 3 for: 3 == 3 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - filter([](int) { return false; }, value(1)), Catch::GeneratorException +# Generators internals +ok {test-number} - filter([](int) { return false; }, values({ 1, 2, 3 })), Catch::GeneratorException # Generators internals ok {test-number} - gen.get() == 1 for: 1 == 1 # Generators internals @@ -1712,6 +1767,18 @@ ok {test-number} - d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) # Greater-than inequalities with different epsilons ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +# Hashers with different seed produce different hash with same test case +ok {test-number} - h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) != 130711275 (0x<hex digits>) +# Hashers with same seed produce same hash +ok {test-number} - h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) != 2668622104 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) != 3916075712 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) != 3429949824 (0x<hex digits>) +# Hashing test case produces same hash across multiple calls +ok {test-number} - h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) # INFO and WARN do not abort tests warning {test-number} - 'this is a message' with 1 message: 'this is a warning' # INFO gets logged on failure @@ -1791,23 +1858,65 @@ ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) # ManuallyRegistered ok {test-number} - with 1 message: 'was called' # Matchers can be (AllOf) composed with the && operator -ok {test-number} - 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" ) +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "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 -ok {test-number} - testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) # Matchers can be (AnyOf) composed with the || operator -ok {test-number} - 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" ) +ok {test-number} - testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) # Matchers can be composed with both && and || -ok {test-number} - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +ok {test-number} - testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) # Matchers can be composed with both && and || - failing -not ok {test-number} - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +not ok {test-number} - testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) # Matchers can be negated (Not) with the ! operator -ok {test-number} - testStringForMatching(), !Contains( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" +ok {test-number} - testStringForMatching(), !ContainsSubstring( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" # Matchers can be negated (Not) with the ! operator - failing -not ok {test-number} - testStringForMatching(), !Contains( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" +not ok {test-number} - testStringForMatching(), !ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" +# Mayfail test case with nested sections +not ok {test-number} - explicitly +# Mayfail test case with nested sections +not ok {test-number} - explicitly +# Mayfail test case with nested sections +not ok {test-number} - explicitly +# Mayfail test case with nested sections +not ok {test-number} - explicitly # Mismatching exception messages failing the test ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" # Mismatching exception messages failing the test not ok {test-number} - thisThrows(), "should fail" for: "expected exception" equals: "should fail" +# Multireporter calls reporters and listeners in correct order +ok {test-number} - records == expected for: { "Hello", "world", "Goodbye", "world" } == { "Hello", "world", "Goodbye", "world" } +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true # Nested generators and captured variables ok {test-number} - values > -6 for: 3 > -6 # Nested generators and captured variables @@ -1854,6 +1963,10 @@ ok {test-number} - !(False) for: !{?} ok {test-number} - with 1 message: 'std::is_void<void>::value' # Optionally static assertions ok {test-number} - with 1 message: '!(std::is_void<int>::value)' +# Optionally static assertions +ok {test-number} - with 1 message: 'std::is_void<void>::value' +# Optionally static assertions +ok {test-number} - with 1 message: '!(std::is_void<int>::value)' # Ordering comparison checks that should fail not ok {test-number} - data.int_seven > 7 for: 7 > 7 # Ordering comparison checks that should fail @@ -2270,6 +2383,58 @@ ok {test-number} - !(spec.matches(*fakeTestCase("only foo", "[foo]"))) for: !fal ok {test-number} - !(spec.matches(*fakeTestCase("only hidden", "[.]"))) for: !false # Parse test names and tags ok {test-number} - spec.matches(*fakeTestCase("neither foo nor hidden", "[bar]")) for: true +# Parsed tags are matched case insensitive +ok {test-number} - spec.hasFilters() for: true +# Parsed tags are matched case insensitive +ok {test-number} - spec.getInvalidSpecs().empty() for: true +# Parsed tags are matched case insensitive +ok {test-number} - spec.matches( testCase ) for: true +# Parsing sharding-related cli flags +ok {test-number} - cli.parse({ "test", "--shard-count=8" }) for: {?} +# Parsing sharding-related cli flags +ok {test-number} - config.shardCount == 8 for: 8 == 8 +# Parsing sharding-related cli flags +ok {test-number} - !(result) for: !{?} +# Parsing sharding-related cli flags +ok {test-number} - result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +# Parsing sharding-related cli flags +ok {test-number} - !(result) for: !{?} +# Parsing sharding-related cli flags +ok {test-number} - result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +# Parsing sharding-related cli flags +ok {test-number} - cli.parse({ "test", "--shard-index=2" }) for: {?} +# Parsing sharding-related cli flags +ok {test-number} - config.shardIndex == 2 for: 2 == 2 +# Parsing sharding-related cli flags +ok {test-number} - !(result) for: !{?} +# Parsing sharding-related cli flags +ok {test-number} - result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") for: "Shard index must be a non-negative number" contains: "Shard index must be a non-negative number" +# Parsing sharding-related cli flags +ok {test-number} - cli.parse({ "test", "--shard-index=0" }) for: {?} +# Parsing sharding-related cli flags +ok {test-number} - config.shardIndex == 0 for: 0 == 0 +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.hasFilters() for: true with 1 message: 'tagString := "[tag with spaces]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[tag with spaces]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.matches( testCase ) for: true with 1 message: 'tagString := "[tag with spaces]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.hasFilters() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.matches( testCase ) for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +# Parsing warnings +ok {test-number} - cli.parse( { "test", "-w", "NoAssertions" } ) for: {?} +# Parsing warnings +ok {test-number} - config.warnings == WarnAbout::NoAssertions for: 1 == 1 +# Parsing warnings +ok {test-number} - !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?} +# Parsing warnings +ok {test-number} - cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?} +# Parsing warnings +ok {test-number} - config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3 # Pointers can be compared to null ok {test-number} - p == 0 for: 0 == 0 # Pointers can be compared to null @@ -2311,10 +2476,18 @@ ok {test-number} - config.abortAfter == -1 for: -1 == -1 # Process can be configured on command line ok {test-number} - config.noThrow == false for: false == false # Process can be configured on command line -ok {test-number} - config.reporterName == "console" for: "console" == "console" +ok {test-number} - config.reporterSpecifications.empty() for: true # Process can be configured on command line ok {test-number} - !(cfg.hasTestFilters()) for: !false # Process can be configured on command line +ok {test-number} - cfg.getReporterSpecs().size() == 1 for: 1 == 1 +# Process can be configured on command line +ok {test-number} - cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } for: {?} == {?} +# Process can be configured on command line +ok {test-number} - cfg.getProcessedReporterSpecs().size() == 1 for: 1 == 1 +# Process can be configured on command line +ok {test-number} - cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } for: {?} == {?} +# Process can be configured on command line ok {test-number} - result for: {?} # Process can be configured on command line ok {test-number} - cfg.hasTestFilters() for: true @@ -2339,23 +2512,41 @@ ok {test-number} - cfg.testSpec().matches(*fakeTestCase("test1")) == false for: # Process can be configured on command line ok {test-number} - cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) for: true # Process can be configured on command line -ok {test-number} - cli.parse({"test", "-r", "console"}) for: {?} +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' # Process can be configured on command line -ok {test-number} - config.reporterName == "console" for: "console" == "console" +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - cli.parse({"test", "-r", "xml"}) for: {?} +ok {test-number} - result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" # Process can be configured on command line -ok {test-number} - config.reporterName == "xml" for: "xml" == "xml" +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' # Process can be configured on command line -ok {test-number} - cli.parse({"test", "--reporter", "junit"}) for: {?} +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' # Process can be configured on command line -ok {test-number} - config.reporterName == "junit" for: "junit" == "junit" +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' # Process can be configured on command line -ok {test-number} - !(cli.parse({ "test", "-r", "xml", "-r", "junit" })) for: !{?} +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } for: { {?}, {?} } == { {?}, {?} } # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - result.errorMessage(), Contains("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" +ok {test-number} - result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") for: "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." # Process can be configured on command line ok {test-number} - cli.parse({"test", "-b"}) for: {?} # Process can be configured on command line @@ -2375,7 +2566,7 @@ ok {test-number} - config.abortAfter == 2 for: 2 == 2 # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - result.errorMessage(), Contains("convert") && Contains("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) +ok {test-number} - result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) # Process can be configured on command line ok {test-number} - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} # Process can be configured on command line @@ -2395,7 +2586,7 @@ ok {test-number} - config.waitForKeypress == std::get<1>(input) for: 3 == 3 # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - 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" ) +ok {test-number} - result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") for: "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 ok {test-number} - cli.parse({"test", "-e"}) for: {?} # Process can be configured on command line @@ -2407,11 +2598,11 @@ ok {test-number} - config.noThrow for: true # Process can be configured on command line ok {test-number} - cli.parse({"test", "-o", "filename.ext"}) for: {?} # Process can be configured on command line -ok {test-number} - config.outputFilename == "filename.ext" for: "filename.ext" == "filename.ext" +ok {test-number} - config.defaultOutputFilename == "filename.ext" for: "filename.ext" == "filename.ext" # Process can be configured on command line ok {test-number} - cli.parse({"test", "--out", "filename.ext"}) for: {?} # Process can be configured on command line -ok {test-number} - config.outputFilename == "filename.ext" for: "filename.ext" == "filename.ext" +ok {test-number} - config.defaultOutputFilename == "filename.ext" for: "filename.ext" == "filename.ext" # Process can be configured on command line ok {test-number} - cli.parse({"test", "-abe"}) for: {?} # Process can be configured on command line @@ -2423,23 +2614,23 @@ ok {test-number} - config.noThrow == true for: true == true # Process can be configured on command line ok {test-number} - cli.parse({"test"}) for: {?} # Process can be configured on command line -ok {test-number} - config.useColour == UseColour::Auto for: 0 == 0 +ok {test-number} - config.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 # Process can be configured on command line -ok {test-number} - cli.parse({"test", "--use-colour", "auto"}) for: {?} +ok {test-number} - cli.parse( { "test", "--colour-mode", "default" } ) for: {?} # Process can be configured on command line -ok {test-number} - config.useColour == UseColour::Auto for: 0 == 0 +ok {test-number} - config.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 # Process can be configured on command line -ok {test-number} - cli.parse({"test", "--use-colour", "yes"}) for: {?} +ok {test-number} - cli.parse({"test", "--colour-mode", "ansi"}) for: {?} # Process can be configured on command line -ok {test-number} - config.useColour == UseColour::Yes for: 1 == 1 +ok {test-number} - config.defaultColourMode == ColourMode::ANSI for: 1 == 1 # Process can be configured on command line -ok {test-number} - cli.parse({"test", "--use-colour", "no"}) for: {?} +ok {test-number} - cli.parse({"test", "--colour-mode", "none"}) for: {?} # Process can be configured on command line -ok {test-number} - config.useColour == UseColour::No for: 2 == 2 +ok {test-number} - config.defaultColourMode == ColourMode::None for: 3 == 3 # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - 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" +ok {test-number} - result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: default, ansi, win32, or none. 'wrong' is not recognised" contains: "colour mode must be one of" # Process can be configured on command line ok {test-number} - cli.parse({ "test", "--benchmark-samples=200" }) for: {?} # Process can be configured on command line @@ -2466,6 +2657,14 @@ ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 3 >= 1 ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 2 >= 1 # Product with differing arities - std::tuple<int> ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 1 >= 1 +# Random seed generation accepts known methods +ok {test-number} - Catch::generateRandomSeed(method) +# Random seed generation accepts known methods +ok {test-number} - Catch::generateRandomSeed(method) +# Random seed generation accepts known methods +ok {test-number} - Catch::generateRandomSeed(method) +# Random seed generation reports unknown methods +ok {test-number} - Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) # Range type with sentinel ok {test-number} - Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }" # Reconstruction should be based on stringification: #914 @@ -2476,104 +2675,108 @@ not ok {test-number} - testStringForMatching(), Matches( "this STRING contains ' not ok {test-number} - testStringForMatching(), Matches( "contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively # Regex string matcher not ok {test-number} - 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 +# Registering reporter with '::' in name fails +ok {test-number} - registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'" # Regression test #1 ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: automake' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: Automake' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: automake' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: Automake' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: automake' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: Automake' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: junit' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: JUnit' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: junit' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: JUnit' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: junit' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JUnit' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: sonarqube' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: SonarQube' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: sonarqube' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: SonarQube' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: sonarqube' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: SonarQube' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: tap' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: TAP' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: tap' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: TAP' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: tap' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TAP' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: teamcity' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: TeamCity' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: teamcity' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: TeamCity' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: teamcity' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TeamCity' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> <TagsFromMatchingTests> <Tag> <Count>1</Count> <Aliases> <Alias>fakeTag</Alias> </Aliases> </Tag> </TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: xml' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> <TagsFromMatchingTests> <Tag> <Count>1</Count> <Aliases> <Alias>fakeTag</Alias> </Aliases> </Tag> </TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: XML' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> <AvailableReporters> <Reporter> <Name>fake reporter</Name> <Description>fake description</Description> </Reporter> </AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: xml' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> <AvailableReporters> <Reporter> <Name>fake reporter</Name> <Description>fake description</Description> </Reporter> </AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: XML' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> <MatchingTests> <TestCase> <Name>fake test name</Name> <ClassName/> <Tags>[fakeTestTag]</Tags> <SourceInfo> <File>fake-file.cpp</File> <Line>123456789</Line> </SourceInfo> </TestCase> </MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: xml' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> <MatchingTests> <TestCase> <Name>fake test name</Name> <ClassName/> <Tags>[fakeTestTag]</Tags> <SourceInfo> <File>fake-file.cpp</File> <Line>123456789</Line> </SourceInfo> </TestCase> </MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: XML' +# Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla +ok {test-number} - # SUCCEED counts as a test pass ok {test-number} - with 1 message: 'this is a success' # SUCCEED does not require an argument @@ -2636,13 +2839,13 @@ ok {test-number} - Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" for: "{ 3, 2, # Static arrays are convertible to string ok {test-number} - 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" } }" # String matchers -ok {test-number} - testStringForMatching(), Contains( "string" ) for: "this string contains 'abc' as a substring" contains: "string" +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string" # String matchers -ok {test-number} - testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +ok {test-number} - testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) # String matchers -ok {test-number} - testStringForMatching(), Contains( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" +ok {test-number} - testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" # String matchers -ok {test-number} - testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) +ok {test-number} - testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) # String matchers ok {test-number} - testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this" # String matchers @@ -2670,6 +2873,10 @@ ok {test-number} - original == "original" # StringRef ok {test-number} - original.data() # StringRef +ok {test-number} - original.begin() == copy.begin() for: "original string" == "original string" +# StringRef +ok {test-number} - original.begin() == copy.begin() for: "original string" == "original string" +# StringRef ok {test-number} - ss.empty() == false for: false == false # StringRef ok {test-number} - ss.size() == 5 for: 5 == 5 @@ -2782,13 +2989,13 @@ ok {test-number} - now != later for: {iso8601-timestamp} != {iso8601-timestamp} # Tabs and newlines show in output not ok {test-number} - s1 == s2 for: "if ($b == 10) { $a = 20; }" == "if ($b == 10) { $a = 20; } " # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" +ok {test-number} - what, ContainsSubstring( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "file" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" +ok {test-number} - what, ContainsSubstring( "file" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "2" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" +ok {test-number} - what, ContainsSubstring( "2" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "10" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "10" +ok {test-number} - what, ContainsSubstring( "10" ) for: "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 ok {test-number} - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) # Tag alias can be registered against tag patterns @@ -2797,6 +3004,10 @@ ok {test-number} - registry.add( "[the @ is not at the start]", "", Catch::Sourc ok {test-number} - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) # Tag alias can be registered against tag patterns ok {test-number} - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) +# Tags with spaces and non-alphanumerical characters are accepted +ok {test-number} - testCase.tags.size() == 2 for: 2 == 2 +# Tags with spaces and non-alphanumerical characters are accepted +ok {test-number} - testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} ) # Template test case method with test types specified inside std::tuple - MyTypes - 0 ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1 # Template test case method with test types specified inside std::tuple - MyTypes - 1 @@ -3089,6 +3300,10 @@ ok {test-number} - v.capacity() >= V for: 15 >= 15 ok {test-number} - v.size() == V for: 15 == 15 # TemplateTestSig: vectors can be sized and resized - std::string,15 ok {test-number} - v.capacity() >= V for: 15 >= 15 +# Test case with identical tags keeps just one +ok {test-number} - testCase.tags.size() == 1 for: 1 == 1 +# Test case with identical tags keeps just one +ok {test-number} - testCase.tags[0] == Tag( "tag1" ) for: {?} == {?} # Test case with one argument ok {test-number} - with 1 message: 'no assertions' # Test enum bit values @@ -3118,11 +3333,13 @@ not ok {test-number} - explicitly # The NO_FAIL macro reports a failure but does not fail the test ok {test-number} - 1 == 2 # TODO # The default listing implementation write to provided stream -ok {test-number} - listingString, Contains("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" +ok {test-number} - listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" +# The default listing implementation write to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: fake reporter: fake description " ( contains: "fake reporter" and contains: "fake description" ) # The default listing implementation write to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) # The default listing implementation write to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) +ok {test-number} - listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) for: "Registered listeners: fakeListener: fake description " ( contains: "fakeListener" and contains: "fake description" ) # This test 'should' fail but doesn't ok {test-number} - with 1 message: 'oops!' # Thrown string literals are translated @@ -3292,27 +3509,65 @@ ok {test-number} - needs_adl, AllMatch( Predicate<int>( []( int elem ) { return # Usage of AllMatch range matcher ok {test-number} - mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[0] for: true +ok {test-number} - mocked.m_derefed[0] for: true # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[1] for: true +ok {test-number} - mocked.m_derefed[1] for: true # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[2] for: true +ok {test-number} - mocked.m_derefed[2] for: true # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[3] for: true +ok {test-number} - mocked.m_derefed[3] for: true # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[4] for: true +ok {test-number} - mocked.m_derefed[4] for: true # Usage of AllMatch range matcher ok {test-number} - mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[0] for: true +ok {test-number} - mocked.m_derefed[0] for: true # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[1] for: true +ok {test-number} - mocked.m_derefed[1] for: true # Usage of AllMatch range matcher -ok {test-number} - mocked.derefed[2] for: true +ok {test-number} - mocked.m_derefed[2] for: true # Usage of AllMatch range matcher -ok {test-number} - !(mocked.derefed[3]) for: !false +ok {test-number} - !(mocked.m_derefed[3]) for: !false # Usage of AllMatch range matcher -ok {test-number} - !(mocked.derefed[4]) for: !false +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of AllTrue range matcher +ok {test-number} - data, AllTrue() for: { true, true, true, true, true } contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, AllTrue() for: { } contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { true, true, false, true, true } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { false, false, false, false, false } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, AllTrue() for: { true, true, true, true, true } contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { true, true, false, true, true } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { false, false, false, false, false } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - mocked, AllTrue() for: { true, true, true, true, true } contains only true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked, !AllTrue() for: { true, true, false, true, true } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AllTrue range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of AllTrue range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false # Usage of AnyMatch range matcher ok {test-number} - data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 # Usage of AnyMatch range matcher @@ -3322,27 +3577,65 @@ ok {test-number} - needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return # Usage of AnyMatch range matcher ok {test-number} - mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate # Usage of AnyMatch range matcher -ok {test-number} - mocked.derefed[0] for: true +ok {test-number} - mocked.m_derefed[0] for: true # Usage of AnyMatch range matcher -ok {test-number} - mocked.derefed[1] for: true +ok {test-number} - mocked.m_derefed[1] for: true # Usage of AnyMatch range matcher -ok {test-number} - mocked.derefed[2] for: true +ok {test-number} - mocked.m_derefed[2] for: true # Usage of AnyMatch range matcher -ok {test-number} - mocked.derefed[3] for: true +ok {test-number} - mocked.m_derefed[3] for: true # Usage of AnyMatch range matcher -ok {test-number} - mocked.derefed[4] for: true +ok {test-number} - mocked.m_derefed[4] for: true # Usage of AnyMatch range matcher ok {test-number} - mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate # Usage of AnyMatch range matcher -ok {test-number} - mocked.derefed[0] for: true +ok {test-number} - mocked.m_derefed[0] for: true # Usage of AnyMatch range matcher -ok {test-number} - !(mocked.derefed[1]) for: !false +ok {test-number} - !(mocked.m_derefed[1]) for: !false # Usage of AnyMatch range matcher -ok {test-number} - !(mocked.derefed[2]) for: !false +ok {test-number} - !(mocked.m_derefed[2]) for: !false # Usage of AnyMatch range matcher -ok {test-number} - !(mocked.derefed[3]) for: !false +ok {test-number} - !(mocked.m_derefed[3]) for: !false # Usage of AnyMatch range matcher -ok {test-number} - !(mocked.derefed[4]) for: !false +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { true, true, true, true, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, !AnyTrue() for: { } not contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { false, false, true, false, false } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { true, true, true, true, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { false, false, true, false, false } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - mocked, AnyTrue() for: { false, false, false, false, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked, AnyTrue() for: { false, false, true, true, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AnyTrue range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of AnyTrue range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false # Usage of NoneMatch range matcher ok {test-number} - data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 # Usage of NoneMatch range matcher @@ -3352,27 +3645,65 @@ ok {test-number} - needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return # Usage of NoneMatch range matcher ok {test-number} - mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate # Usage of NoneMatch range matcher -ok {test-number} - mocked.derefed[0] for: true +ok {test-number} - mocked.m_derefed[0] for: true # Usage of NoneMatch range matcher -ok {test-number} - mocked.derefed[1] for: true +ok {test-number} - mocked.m_derefed[1] for: true # Usage of NoneMatch range matcher -ok {test-number} - mocked.derefed[2] for: true +ok {test-number} - mocked.m_derefed[2] for: true # Usage of NoneMatch range matcher -ok {test-number} - mocked.derefed[3] for: true +ok {test-number} - mocked.m_derefed[3] for: true # Usage of NoneMatch range matcher -ok {test-number} - mocked.derefed[4] for: true +ok {test-number} - mocked.m_derefed[4] for: true # Usage of NoneMatch range matcher ok {test-number} - mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate # Usage of NoneMatch range matcher -ok {test-number} - mocked.derefed[0] for: true +ok {test-number} - mocked.m_derefed[0] for: true # Usage of NoneMatch range matcher -ok {test-number} - !(mocked.derefed[1]) for: !false +ok {test-number} - !(mocked.m_derefed[1]) for: !false # Usage of NoneMatch range matcher -ok {test-number} - !(mocked.derefed[2]) for: !false +ok {test-number} - !(mocked.m_derefed[2]) for: !false # Usage of NoneMatch range matcher -ok {test-number} - !(mocked.derefed[3]) for: !false +ok {test-number} - !(mocked.m_derefed[3]) for: !false # Usage of NoneMatch range matcher -ok {test-number} - !(mocked.derefed[4]) for: !false +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { true, true, true, true, true } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, NoneTrue() for: { } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { false, false, true, false, false } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, NoneTrue() for: { false, false, false, false, false } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { true, true, true, true, true } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { false, false, true, false, false } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, NoneTrue() for: { false, false, false, false, false } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - mocked, NoneTrue() for: { false, false, false, false, false } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked, !NoneTrue() for: { false, false, true, true, true } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of NoneTrue range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of NoneTrue range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false # Usage of the SizeIs range matcher ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0 # Usage of the SizeIs range matcher @@ -3519,10 +3850,6 @@ not ok {test-number} - unexpected exception with message: 'expected exception'; not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows() == 0 # When unchecked exceptions are thrown from sections they are always failures not ok {test-number} - unexpected exception with message: 'unexpected exception' -# Where the LHS is not a simple value -warning {test-number} - '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 -warning {test-number} - 'Uncomment the code in this test to check that it gives a sensible compiler error' # X/level/0/a ok {test-number} - # X/level/0/b @@ -3552,7 +3879,7 @@ ok {test-number} - encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" # XmlEncode ok {test-number} - encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" # XmlWriter writes boolean attributes as true/false -ok {test-number} - stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> <Element1 attr1="true" attr2="false"/> " ( contains: "attr1="true"" and contains: "attr2="false"" ) +ok {test-number} - stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> <Element1 attr1="true" attr2="false"/> " ( contains: "attr1="true"" and contains: "attr2="false"" ) # analyse no analysis ok {test-number} - analysis.mean.point.count() == 23 for: 23.0 == 23 # analyse no analysis @@ -3585,8 +3912,6 @@ ok {test-number} - Catch::Detail::stringify( empty ) == "{ }" for: "{ }" == "{ ok {test-number} - Catch::Detail::stringify( oneValue ) == "{ 42 }" for: "{ 42 }" == "{ 42 }" # array<int, N> -> toString ok {test-number} - Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" -# atomic if -ok {test-number} - x == 0 for: 0 == 0 # benchmark function call ok {test-number} - model.started == 1 for: 1 == 1 # benchmark function call @@ -3744,6 +4069,30 @@ ok {test-number} - # even more nested SECTION tests ok {test-number} - loose text artifact +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<int>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<std::string const&>::value)' # just failure not ok {test-number} - explicitly with 1 message: 'Previous info should not be seen' # just failure after unscoped info @@ -3786,6 +4135,8 @@ ok {test-number} - ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if f not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even' # looped tests not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even' +# makeStream recognizes %debug stream name +ok {test-number} - Catch::makeStream( "%debug" ) # make_unique reimplementation ok {test-number} - !(lval.has_moved) for: !false # make_unique reimplementation @@ -3924,6 +4275,8 @@ ok {test-number} - letters == letters for: "abcdefcg" == "abcdefcg" ok {test-number} - Catch::replaceInPlace(s, "'", "|'") for: true # replaceInPlace ok {test-number} - s == "didn|'t" for: "didn|'t" == "didn|'t" +# request an unknown %-starting stream fails +ok {test-number} - Catch::makeStream( "%somestream" ) # resolution ok {test-number} - res.size() == count for: 10 == 10 # resolution @@ -3993,7 +4346,7 @@ not ok {test-number} - false with 1 message: '3' # sends information to INFO not ok {test-number} - false with 2 messages: 'hi' and 'i := 7' # shortened hide tags are split apart -ok {test-number} - tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) for: { ., magic-tag } ( Contains: magic-tag and Contains: . ) +ok {test-number} - testcase.tags, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} ) # splitString ok {test-number} - splitStringRef("", ','), Equals(std::vector<StringRef>()) for: { } Equals: { } # splitString @@ -4004,6 +4357,12 @@ ok {test-number} - splitStringRef("abc,def", ','), Equals(std::vector<StringRef> not ok {test-number} - false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' # stacks unscoped info in loops not ok {test-number} - false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6' +# startsWith +ok {test-number} - !(startsWith("", 'c')) for: !false +# startsWith +ok {test-number} - startsWith(std::string("abc"), 'a') for: true +# startsWith +ok {test-number} - startsWith("def"_catch_sr, 'd') for: true # std::map is convertible string ok {test-number} - Catch::Detail::stringify( emptyMap ) == "{ }" for: "{ }" == "{ }" # std::map is convertible string @@ -4022,8 +4381,10 @@ ok {test-number} - Catch::Detail::stringify( set ) == "{ \"one\" }" for: "{ "one ok {test-number} - Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" for: "{ "abc", "def", "ghi" }" == "{ "abc", "def", "ghi" }" # std::vector<std::pair<std::string,int> > -> toString ok {test-number} - ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" for: "{ { "green", 55 } }" == "{ { "green", 55 } }" -# string literals of different sizes can be compared -not ok {test-number} - std::string( "first" ) == "second" for: "first" == "second" +# stdout and stderr streams have %-starting name +ok {test-number} - Catch::makeStream( "%stderr" )->isConsole() for: true +# stdout and stderr streams have %-starting name +ok {test-number} - Catch::makeStream( "%stdout" )->isConsole() for: true # stringify ranges ok {test-number} - ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" for: "op<<(streamable_range)" == "op<<(streamable_range)" # stringify ranges @@ -4106,8 +4467,6 @@ ok {test-number} - "1.2f" == ::Catch::Detail::stringify(float(1.2)) for: "1.2f" ok {test-number} - "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) for: "{ 1.2f, 0 }" == "{ 1.2f, 0 }" # tuple<int> ok {test-number} - "{ 0 }" == ::Catch::Detail::stringify(type{0}) for: "{ 0 }" == "{ 0 }" -# tuple<0,int,const char *> -ok {test-number} - "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) for: "{ 0, 42, "Catch me" }" == "{ 0, 42, "Catch me" }" # tuple<string,string> ok {test-number} - "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) for: "{ "hello", "world" }" == "{ "hello", "world" }" # tuple<tuple<int>,tuple<>,float> @@ -4242,5 +4601,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2120 +1..2299 diff --git a/packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt new file mode 100644 index 000000000..d13b493c9 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -0,0 +1,4597 @@ +# rng-seed: 1 +# # A test name that starts with a # +ok {test-number} - with 1 message: 'yay' +# #1027: Bitfields can be captured +ok {test-number} - y.v == 0 for: 0 == 0 +# #1027: Bitfields can be captured +ok {test-number} - 0 == y.v for: 0 == 0 +# #1147 +ok {test-number} - t1 == t2 for: {?} == {?} +# #1147 +ok {test-number} - t1 != t2 for: {?} != {?} +# #1147 +ok {test-number} - t1 < t2 for: {?} < {?} +# #1147 +ok {test-number} - t1 > t2 for: {?} > {?} +# #1147 +ok {test-number} - t1 <= t2 for: {?} <= {?} +# #1147 +ok {test-number} - t1 >= t2 for: {?} >= {?} +# #1175 - Hidden Test +ok {test-number} - +# #1238 +ok {test-number} - std::memcmp(uarr, "123", sizeof(uarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"' +# #1238 +ok {test-number} - std::memcmp(sarr, "456", sizeof(sarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"' +# #1245 +ok {test-number} - +# #1319: Sections can have description (even if it is not saved +ok {test-number} - +# #1403 +ok {test-number} - h1 == h2 for: [1403 helper] == [1403 helper] +# #1455 - INFO and WARN can start with a linebreak +warning {test-number} - ' +This info message starts with a linebreak' with 1 message: ' +This warning message starts with a linebreak' +# #1514: stderr/stdout is not captured in tests aborted by an exception +not ok {test-number} - explicitly with 1 message: '1514' +# #1548 +ok {test-number} - std::is_same<TypeList<int>, TypeList<int>>::value for: true +# #1905 -- test spec parser properly clears internal state between compound tests +ok {test-number} - spec.matches(*fakeTestCase("spec . char")) for: true +# #1905 -- test spec parser properly clears internal state between compound tests +ok {test-number} - spec.matches(*fakeTestCase("spec , char")) for: true +# #1905 -- test spec parser properly clears internal state between compound tests +ok {test-number} - !(spec.matches(*fakeTestCase(R"(spec \, char)"))) for: !false +# #1912 -- test spec parser handles escaping +ok {test-number} - spec.matches(*fakeTestCase(R"(spec {a} char)")) for: true +# #1912 -- test spec parser handles escaping +ok {test-number} - spec.matches(*fakeTestCase(R"(spec [a] char)")) for: true +# #1912 -- test spec parser handles escaping +ok {test-number} - !(spec.matches(*fakeTestCase("differs but has similar tag", "[a]"))) for: !false +# #1912 -- test spec parser handles escaping +ok {test-number} - spec.matches(*fakeTestCase(R"(spec \ char)")) for: true +# #1913 - GENERATE inside a for loop should not keep recreating the generator +ok {test-number} - counter < 7 for: 3 < 7 +# #1913 - GENERATE inside a for loop should not keep recreating the generator +ok {test-number} - counter < 7 for: 6 < 7 +# #1913 - GENERATEs can share a line +ok {test-number} - i != j for: 1 != 3 +# #1913 - GENERATEs can share a line +ok {test-number} - i != j for: 1 != 4 +# #1913 - GENERATEs can share a line +ok {test-number} - i != j for: 2 != 3 +# #1913 - GENERATEs can share a line +ok {test-number} - i != j for: 2 != 4 +# #1938 - GENERATE after a section +ok {test-number} - with 1 message: 'A' +# #1938 - GENERATE after a section +ok {test-number} - m for: 1 +# #1938 - GENERATE after a section +ok {test-number} - m for: 2 +# #1938 - GENERATE after a section +ok {test-number} - m for: 3 +# #1938 - Section followed by flat generate +ok {test-number} - 1 +# #1938 - Section followed by flat generate +ok {test-number} - m for: 2 +# #1938 - Section followed by flat generate +ok {test-number} - m for: 3 +# #1938 - flat generate +ok {test-number} - m for: 1 +# #1938 - flat generate +ok {test-number} - m for: 2 +# #1938 - flat generate +ok {test-number} - m for: 3 +# #1938 - mixed sections and generates +ok {test-number} - with 1 message: 'A' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 1' and 'j := 3' and 'k := 5' +# #1938 - mixed sections and generates +ok {test-number} - with 1 message: 'B' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 1' and 'j := 3' and 'k := 6' +# #1938 - mixed sections and generates +ok {test-number} - with 1 message: 'B' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 1' and 'j := 4' and 'k := 5' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 1' and 'j := 4' and 'k := 6' +# #1938 - mixed sections and generates +ok {test-number} - with 1 message: 'A' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 2' and 'j := 3' and 'k := 5' +# #1938 - mixed sections and generates +ok {test-number} - with 1 message: 'B' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 2' and 'j := 3' and 'k := 6' +# #1938 - mixed sections and generates +ok {test-number} - with 1 message: 'B' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 2' and 'j := 4' and 'k := 5' +# #1938 - mixed sections and generates +ok {test-number} - with 3 messages: 'i := 2' and 'j := 4' and 'k := 6' +# #1938 - nested generate +ok {test-number} - m for: 1 +# #1938 - nested generate +ok {test-number} - n for: 1 +# #1938 - nested generate +ok {test-number} - m for: 1 +# #1938 - nested generate +ok {test-number} - n for: 2 +# #1938 - nested generate +ok {test-number} - m for: 1 +# #1938 - nested generate +ok {test-number} - n for: 3 +# #1938 - nested generate +ok {test-number} - m for: 2 +# #1938 - nested generate +ok {test-number} - n for: 1 +# #1938 - nested generate +ok {test-number} - m for: 2 +# #1938 - nested generate +ok {test-number} - n for: 2 +# #1938 - nested generate +ok {test-number} - m for: 2 +# #1938 - nested generate +ok {test-number} - n for: 3 +# #1938 - nested generate +ok {test-number} - m for: 3 +# #1938 - nested generate +ok {test-number} - n for: 1 +# #1938 - nested generate +ok {test-number} - m for: 3 +# #1938 - nested generate +ok {test-number} - n for: 2 +# #1938 - nested generate +ok {test-number} - m for: 3 +# #1938 - nested generate +ok {test-number} - n for: 3 +# #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 +ok {test-number} - +# #1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0 +ok {test-number} - +# #1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0 +ok {test-number} - +# #2152 - ULP checks between differently signed values were wrong - double +ok {test-number} - smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, 4.9406564584124654e-324]) +# #2152 - ULP checks between differently signed values were wrong - double +ok {test-number} - smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e-324, -0.0000000000000000e+00]) +# #2152 - ULP checks between differently signed values were wrong - float +ok {test-number} - smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) +# #2152 - ULP checks between differently signed values were wrong - float +ok {test-number} - smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00]) +# #748 - captures with unexpected exceptions +not ok {test-number} - unexpected exception with message: 'answer := 42' with 1 message: 'expected exception' +# #748 - captures with unexpected exceptions +not ok {test-number} - unexpected exception with message: 'answer := 42'; expression was: thisThrows() with 1 message: 'expected exception' +# #748 - captures with unexpected exceptions +ok {test-number} - thisThrows() with 1 message: 'answer := 42' +# #809 +ok {test-number} - 42 == f for: 42 == {?} +# #833 +ok {test-number} - a == t for: 3 == 3 +# #833 +ok {test-number} - a == t for: 3 == 3 +# #833 +ok {test-number} - throws_int(true) +# #833 +ok {test-number} - throws_int(true), int +# #833 +ok {test-number} - throws_int(false) +# #833 +ok {test-number} - "aaa", Catch::Matchers::EndsWith("aaa") for: "aaa" ends with: "aaa" +# #833 +ok {test-number} - templated_tests<int>(3) for: true +# #835 -- errno should not be touched by Catch2 +not ok {test-number} - f() == 0 for: 1 == 0 +# #835 -- errno should not be touched by Catch2 +ok {test-number} - errno_after == 1 for: 1 == 1 +# #872 +ok {test-number} - x == 4 for: {?} == 4 with 1 message: 'dummy := 0' +# #961 -- Dynamically created sections should all be reported +ok {test-number} - with 1 message: 'Everything is OK' +# #961 -- Dynamically created sections should all be reported +ok {test-number} - with 1 message: 'Everything is OK' +# #961 -- Dynamically created sections should all be reported +ok {test-number} - with 1 message: 'Everything is OK' +# #961 -- Dynamically created sections should all be reported +ok {test-number} - with 1 message: 'Everything is OK' +# #961 -- Dynamically created sections should all be reported +ok {test-number} - with 1 message: 'Everything is OK' +# 'Not' checks that should fail +not ok {test-number} - false != false +# 'Not' checks that should fail +not ok {test-number} - true != true +# 'Not' checks that should fail +not ok {test-number} - !true for: false +# 'Not' checks that should fail +not ok {test-number} - !(true) for: !true +# 'Not' checks that should fail +not ok {test-number} - !trueValue for: false +# 'Not' checks that should fail +not ok {test-number} - !(trueValue) for: !true +# 'Not' checks that should fail +not ok {test-number} - !(1 == 1) for: false +# 'Not' checks that should fail +not ok {test-number} - !(1 == 1) +# 'Not' checks that should succeed +ok {test-number} - false == false +# 'Not' checks that should succeed +ok {test-number} - true == true +# 'Not' checks that should succeed +ok {test-number} - !false for: true +# 'Not' checks that should succeed +ok {test-number} - !(false) for: !false +# 'Not' checks that should succeed +ok {test-number} - !falseValue for: true +# 'Not' checks that should succeed +ok {test-number} - !(falseValue) for: !false +# 'Not' checks that should succeed +ok {test-number} - !(1 == 2) for: true +# 'Not' checks that should succeed +ok {test-number} - !(1 == 2) +# (unimplemented) static bools can be evaluated +ok {test-number} - is_true<true>::value == true for: true == true +# (unimplemented) static bools can be evaluated +ok {test-number} - true == is_true<true>::value for: true == true +# (unimplemented) static bools can be evaluated +ok {test-number} - is_true<false>::value == false for: false == false +# (unimplemented) static bools can be evaluated +ok {test-number} - false == is_true<false>::value for: false == false +# (unimplemented) static bools can be evaluated +ok {test-number} - !is_true<false>::value for: true +# (unimplemented) static bools can be evaluated +ok {test-number} - !!is_true<true>::value for: true +# (unimplemented) static bools can be evaluated +ok {test-number} - is_true<true>::value for: true +# (unimplemented) static bools can be evaluated +ok {test-number} - !(is_true<false>::value) for: !false +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 1 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 1 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 2 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 2 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 4 +# 3x3x3 ints +ok {test-number} - y < z for: 4 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 5 +# 3x3x3 ints +ok {test-number} - y < z for: 5 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 9 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 7 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 7 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 8 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 8 +# 3x3x3 ints +ok {test-number} - x < y for: 3 < 6 +# 3x3x3 ints +ok {test-number} - y < z for: 6 < 9 +# 3x3x3 ints +ok {test-number} - x < z for: 3 < 9 +# A METHOD_AS_TEST_CASE based test run that fails +not ok {test-number} - s == "world" for: "hello" == "world" +# A METHOD_AS_TEST_CASE based test run that succeeds +ok {test-number} - s == "hello" for: "hello" == "hello" +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float> +not ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int> +not ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float> +not ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int> +not ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float> +ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int> +ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float> +ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int> +ok {test-number} - Template_Fixture_2<TestType>::m_a.size() == 0 for: 0 == 0 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6> +not ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 6 < 2 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<int, 2> +not ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 2 < 2 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6> +not ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 6 < 2 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2> +not ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() < 2 for: 2 < 2 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<float,6> +ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 6 >= 2 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2> +ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 2 >= 2 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6> +ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 6 >= 2 +# A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2> +ok {test-number} - Template_Fixture_2<TestType>{}.m_a.size() >= 2 for: 2 >= 2 +# A TEMPLATE_TEST_CASE_METHOD based test run that fails - double +not ok {test-number} - Template_Fixture<TestType>::m_a == 2 for: 1.0 == 2 +# A TEMPLATE_TEST_CASE_METHOD based test run that fails - float +not ok {test-number} - Template_Fixture<TestType>::m_a == 2 for: 1.0f == 2 +# A TEMPLATE_TEST_CASE_METHOD based test run that fails - int +not ok {test-number} - Template_Fixture<TestType>::m_a == 2 for: 1 == 2 +# A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double +ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1 +# A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float +ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1.0f == 1 +# A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int +ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1 +# A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1 +not ok {test-number} - Nttp_Fixture<V>::value == 0 for: 1 == 0 +# A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3 +not ok {test-number} - Nttp_Fixture<V>::value == 0 for: 3 == 0 +# A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6 +not ok {test-number} - Nttp_Fixture<V>::value == 0 for: 6 == 0 +# A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1 +ok {test-number} - Nttp_Fixture<V>::value > 0 for: 1 > 0 +# A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3 +ok {test-number} - Nttp_Fixture<V>::value > 0 for: 3 > 0 +# A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6 +ok {test-number} - Nttp_Fixture<V>::value > 0 for: 6 > 0 +# A TEST_CASE_METHOD based test run that fails +not ok {test-number} - m_a == 2 for: 1 == 2 +# A TEST_CASE_METHOD based test run that succeeds +ok {test-number} - m_a == 1 for: 1 == 1 +# A Template product test case - Foo<float> +ok {test-number} - x.size() == 0 for: 0 == 0 +# A Template product test case - Foo<int> +ok {test-number} - x.size() == 0 for: 0 == 0 +# A Template product test case - std::vector<float> +ok {test-number} - x.size() == 0 for: 0 == 0 +# A Template product test case - std::vector<int> +ok {test-number} - x.size() == 0 for: 0 == 0 +# A Template product test case with array signature - Bar<float, 42> +ok {test-number} - x.size() > 0 for: 42 > 0 +# A Template product test case with array signature - Bar<int, 9> +ok {test-number} - x.size() > 0 for: 9 > 0 +# A Template product test case with array signature - std::array<float, 42> +ok {test-number} - x.size() > 0 for: 42 > 0 +# A Template product test case with array signature - std::array<int, 9> +ok {test-number} - x.size() > 0 for: 9 > 0 +# A comparison that uses literals instead of the normal constructor +ok {test-number} - d == 1.23_a for: 1.23 == Approx( 1.23 ) +# A comparison that uses literals instead of the normal constructor +ok {test-number} - d != 1.22_a for: 1.23 != Approx( 1.22 ) +# A comparison that uses literals instead of the normal constructor +ok {test-number} - -d == -1.23_a for: -1.23 == Approx( -1.23 ) +# A comparison that uses literals instead of the normal constructor +ok {test-number} - d == 1.2_a .epsilon(.1) for: 1.23 == Approx( 1.2 ) +# A comparison that uses literals instead of the normal constructor +ok {test-number} - d != 1.2_a .epsilon(.001) for: 1.23 != Approx( 1.2 ) +# A comparison that uses literals instead of the normal constructor +ok {test-number} - d == 1_a .epsilon(.3) for: 1.23 == Approx( 1.0 ) +# A couple of nested sections followed by a failure +ok {test-number} - with 1 message: 'that's not flying - that's failing in style' +# A couple of nested sections followed by a failure +not ok {test-number} - explicitly with 1 message: 'to infinity and beyond' +# A failing expression with a non streamable type is still captured +not ok {test-number} - &o1 == &o2 for: 0x<hex digits> == 0x<hex digits> +# A failing expression with a non streamable type is still captured +not ok {test-number} - o1 == o2 for: {?} == {?} +# Absolute margin +ok {test-number} - 104.0 != Approx(100.0) for: 104.0 != Approx( 100.0 ) +# Absolute margin +ok {test-number} - 104.0 == Approx(100.0).margin(5) for: 104.0 == Approx( 100.0 ) +# Absolute margin +ok {test-number} - 104.0 == Approx(100.0).margin(4) for: 104.0 == Approx( 100.0 ) +# Absolute margin +ok {test-number} - 104.0 != Approx(100.0).margin(3) for: 104.0 != Approx( 100.0 ) +# Absolute margin +ok {test-number} - 100.3 != Approx(100.0) for: 100.3 != Approx( 100.0 ) +# Absolute margin +ok {test-number} - 100.3 == Approx(100.0).margin(0.5) for: 100.3 == Approx( 100.0 ) +# An expression with side-effects should only be evaluated once +ok {test-number} - i++ == 7 for: 7 == 7 +# An expression with side-effects should only be evaluated once +ok {test-number} - i++ == 8 for: 8 == 8 +# An unchecked exception reports the line of the last assertion +ok {test-number} - 1 == 1 +# An unchecked exception reports the line of the last assertion +not ok {test-number} - unexpected exception with message: 'unexpected exception'; expression was: {Unknown expression after the reported line} +# Anonymous test case 1 +ok {test-number} - with 1 message: 'anonymous test case' +# Approx setters validate their arguments +ok {test-number} - Approx(0).margin(0) +# Approx setters validate their arguments +ok {test-number} - Approx(0).margin(1234656) +# Approx setters validate their arguments +ok {test-number} - Approx(0).margin(-2), std::domain_error +# Approx setters validate their arguments +ok {test-number} - Approx(0).epsilon(0) +# Approx setters validate their arguments +ok {test-number} - Approx(0).epsilon(1) +# Approx setters validate their arguments +ok {test-number} - Approx(0).epsilon(-0.001), std::domain_error +# Approx setters validate their arguments +ok {test-number} - Approx(0).epsilon(1.0001), std::domain_error +# Approx with exactly-representable margin +ok {test-number} - 0.25f == Approx(0.0f).margin(0.25f) for: 0.25f == Approx( 0.0 ) +# Approx with exactly-representable margin +ok {test-number} - 0.0f == Approx(0.25f).margin(0.25f) for: 0.0f == Approx( 0.25 ) +# Approx with exactly-representable margin +ok {test-number} - 0.5f == Approx(0.25f).margin(0.25f) for: 0.5f == Approx( 0.25 ) +# Approx with exactly-representable margin +ok {test-number} - 245.0f == Approx(245.25f).margin(0.25f) for: 245.0f == Approx( 245.25 ) +# Approx with exactly-representable margin +ok {test-number} - 245.5f == Approx(245.25f).margin(0.25f) for: 245.5f == Approx( 245.25 ) +# Approximate PI +ok {test-number} - divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) for: 3.1428571429 == Approx( 3.141 ) +# Approximate PI +ok {test-number} - divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.1428571429 != Approx( 3.141 ) +# Approximate comparisons with different epsilons +ok {test-number} - d != Approx( 1.231 ) for: 1.23 != Approx( 1.231 ) +# Approximate comparisons with different epsilons +ok {test-number} - d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.23 == Approx( 1.231 ) +# Approximate comparisons with floats +ok {test-number} - 1.23f == Approx( 1.23f ) for: 1.23f == Approx( 1.2300000191 ) +# Approximate comparisons with floats +ok {test-number} - 0.0f == Approx( 0.0f ) for: 0.0f == Approx( 0.0 ) +# Approximate comparisons with ints +ok {test-number} - 1 == Approx( 1 ) for: 1 == Approx( 1.0 ) +# Approximate comparisons with ints +ok {test-number} - 0 == Approx( 0 ) for: 0 == Approx( 0.0 ) +# Approximate comparisons with mixed numeric types +ok {test-number} - 1.0f == Approx( 1 ) for: 1.0f == Approx( 1.0 ) +# Approximate comparisons with mixed numeric types +ok {test-number} - 0 == Approx( dZero) for: 0 == Approx( 0.0 ) +# Approximate comparisons with mixed numeric types +ok {test-number} - 0 == Approx( dSmall ).margin( 0.001 ) for: 0 == Approx( 0.00001 ) +# Approximate comparisons with mixed numeric types +ok {test-number} - 1.234f == Approx( dMedium ) for: 1.234f == Approx( 1.234 ) +# Approximate comparisons with mixed numeric types +ok {test-number} - dMedium == Approx( 1.234f ) for: 1.234 == Approx( 1.2339999676 ) +# Arbitrary predicate matcher +ok {test-number} - 1, Predicate<int>( alwaysTrue, "always true" ) for: 1 matches predicate: "always true" +# Arbitrary predicate matcher +ok {test-number} - 1, !Predicate<int>( alwaysFalse, "always false" ) for: 1 not matches predicate: "always false" +# Arbitrary predicate matcher +ok {test-number} - "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" +# Arbitrary predicate matcher +ok {test-number} - "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 +# Assertion macros support bit operators and bool conversions +ok {test-number} - lhs | rhs for: Val: 1 | Val: 2 +# Assertion macros support bit operators and bool conversions +ok {test-number} - !(lhs & rhs) for: !(Val: 1 & Val: 2) +# Assertion macros support bit operators and bool conversions +ok {test-number} - HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1 +# Assertion macros support bit operators and bool conversions +ok {test-number} - lhs ^ rhs for: Val: 1 ^ Val: 2 +# Assertion macros support bit operators and bool conversions +ok {test-number} - !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1) +# Assertions then sections +ok {test-number} - true +# Assertions then sections +ok {test-number} - true +# Assertions then sections +ok {test-number} - true +# Assertions then sections +ok {test-number} - true +# Assertions then sections +ok {test-number} - true +# Assertions then sections +ok {test-number} - true +# Basic use of the Contains range matcher +ok {test-number} - a, Contains(1) for: { 1, 2, 3 } contains element 1 +# Basic use of the Contains range matcher +ok {test-number} - b, Contains(1) for: { 0, 1, 2 } contains element 1 +# Basic use of the Contains range matcher +ok {test-number} - c, !Contains(1) for: { 4, 5, 6 } not contains element 1 +# Basic use of the Contains range matcher +ok {test-number} - a, Contains(0, close_enough) for: { 1, 2, 3 } contains element 0 +# Basic use of the Contains range matcher +ok {test-number} - b, Contains(0, close_enough) for: { 0, 1, 2 } contains element 0 +# Basic use of the Contains range matcher +ok {test-number} - c, !Contains(0, close_enough) for: { 4, 5, 6 } not contains element 0 +# Basic use of the Contains range matcher +ok {test-number} - a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 +# Basic use of the Contains range matcher +ok {test-number} - in, Contains(1) for: { 1, 2, 3, 4, 5 } contains element 1 +# Basic use of the Contains range matcher +ok {test-number} - in, !Contains(8) for: { 1, 2, 3, 4, 5 } not contains element 8 +# Basic use of the Contains range matcher +ok {test-number} - in, Contains(MoveOnlyTestElement{ 2 }) for: { 1, 2, 3 } contains element 2 +# Basic use of the Contains range matcher +ok {test-number} - in, !Contains(MoveOnlyTestElement{ 9 }) for: { 1, 2, 3 } not contains element 9 +# Basic use of the Contains range matcher +ok {test-number} - in, Contains(Catch::Matchers::WithinAbs(0.5, 0.5)) for: { 1.0, 2.0, 3.0, 0.0 } contains element matching is within 0.5 of 0.5 +# Basic use of the Empty range matcher +ok {test-number} - empty_array, IsEmpty() for: { } is empty +# Basic use of the Empty range matcher +ok {test-number} - non_empty_array, !IsEmpty() for: { 0.0 } not is empty +# Basic use of the Empty range matcher +ok {test-number} - empty_vec, IsEmpty() for: { } is empty +# Basic use of the Empty range matcher +ok {test-number} - non_empty_vec, !IsEmpty() for: { 'a', 'b', 'c' } not is empty +# Basic use of the Empty range matcher +ok {test-number} - inner_lists_are_empty, !IsEmpty() for: { { } } not is empty +# Basic use of the Empty range matcher +ok {test-number} - inner_lists_are_empty.front(), IsEmpty() for: { } is empty +# Basic use of the Empty range matcher +ok {test-number} - has_empty{}, !IsEmpty() for: {?} not is empty +# Basic use of the Empty range matcher +ok {test-number} - unrelated::ADL_empty{}, IsEmpty() for: {?} is empty +# CAPTURE can deal with complex expressions +ok {test-number} - 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' +# CAPTURE can deal with complex expressions involving commas +ok {test-number} - 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' +# CAPTURE parses string and character constants +ok {test-number} - 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 ''{' := '{'' +# Capture and info messages +ok {test-number} - true with 1 message: 'i := 2' +# Capture and info messages +ok {test-number} - true with 1 message: '3' +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "", "" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - !(eq( "", "a" )) for: !false +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "a", "a" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "a", "A" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "A", "a" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - eq( "A", "A" ) for: true +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - !(eq( "a", "b" )) for: !false +# CaseInsensitiveEqualsTo is case insensitive +ok {test-number} - !(eq( "a", "B" )) for: !false +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "", "a" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - !(lt( "a", "a" )) for: !false +# CaseInsensitiveLess is case insensitive +ok {test-number} - !(lt( "", "" )) for: !false +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "a", "b" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "a", "B" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "A", "b" ) for: true +# CaseInsensitiveLess is case insensitive +ok {test-number} - lt( "A", "B" ) for: true +# Character pretty printing +ok {test-number} - tab == '\t' for: '\t' == '\t' +# Character pretty printing +ok {test-number} - newline == '\n' for: '\n' == '\n' +# Character pretty printing +ok {test-number} - carr_return == '\r' for: '\r' == '\r' +# Character pretty printing +ok {test-number} - form_feed == '\f' for: '\f' == '\f' +# Character pretty printing +ok {test-number} - space == ' ' for: ' ' == ' ' +# Character pretty printing +ok {test-number} - c == chars[i] for: 'a' == 'a' +# Character pretty printing +ok {test-number} - c == chars[i] for: 'z' == 'z' +# Character pretty printing +ok {test-number} - c == chars[i] for: 'A' == 'A' +# Character pretty printing +ok {test-number} - c == chars[i] for: 'Z' == 'Z' +# Character pretty printing +ok {test-number} - null_terminator == '\0' for: 0 == 0 +# Character pretty printing +ok {test-number} - c == i for: 2 == 2 +# Character pretty printing +ok {test-number} - c == i for: 3 == 3 +# Character pretty printing +ok {test-number} - c == i for: 4 == 4 +# Character pretty printing +ok {test-number} - c == i for: 5 == 5 +# Clara::Arg supports single-arg parse the way Opt does +ok {test-number} - name.empty() for: true +# Clara::Arg supports single-arg parse the way Opt does +ok {test-number} - name == "foo" for: "foo" == "foo" +# Clara::Opt supports accept-many lambdas +ok {test-number} - !(parse_result) for: !{?} +# Clara::Opt supports accept-many lambdas +ok {test-number} - parse_result for: {?} +# Clara::Opt supports accept-many lambdas +ok {test-number} - res == std::vector<std::string>{ "aaa", "bbb" } for: { "aaa", "bbb" } == { "aaa", "bbb" } +# ColourGuard behaviour +ok {test-number} - streamWrapper.str().empty() for: true +# ColourGuard behaviour +ok {test-number} - streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" for: "1 Using code: 2 2 Using code: 0 3 " == "1 Using code: 2 2 Using code: 0 3 " +# ColourGuard behaviour +ok {test-number} - streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" for: "Using code: 2 A B Using code: 0 C " == "Using code: 2 A B Using code: 0 C " +# Combining MatchAllOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +# Combining MatchAllOfGeneric does not nest +ok {test-number} - 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) +# Combining MatchAllOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +# Combining MatchAllOfGeneric does not nest +ok {test-number} - 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) +# Combining MatchAllOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' +# Combining MatchAllOfGeneric does not nest +ok {test-number} - 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true ) +# Combining MatchAnyOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +# Combining MatchAnyOfGeneric does not nest +ok {test-number} - 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) +# Combining MatchAnyOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +# Combining MatchAnyOfGeneric does not nest +ok {test-number} - 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) +# Combining MatchAnyOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' +# Combining MatchAnyOfGeneric does not nest +ok {test-number} - 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true ) +# Combining MatchNotOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' +# Combining MatchNotOfGeneric does not nest +ok {test-number} - 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1" +# Combining MatchNotOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value' +# Combining MatchNotOfGeneric does not nest +ok {test-number} - 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1" +# Combining MatchNotOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' +# Combining MatchNotOfGeneric does not nest +ok {test-number} - 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1" +# Combining MatchNotOfGeneric does not nest +ok {test-number} - with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value' +# Combining MatchNotOfGeneric does not nest +ok {test-number} - 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1" +# Combining concrete matchers does not use templated matchers +ok {test-number} - with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value' +# Combining only templated matchers +ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value' +# Combining only templated matchers +ok {test-number} - 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) +# Combining only templated matchers +ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value' +# Combining only templated matchers +ok {test-number} - 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) +# Combining only templated matchers +ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value' +# Combining only templated matchers +ok {test-number} - 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) +# Combining templated and concrete matchers +ok {test-number} - vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) for: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) +# Combining templated and concrete matchers +ok {test-number} - str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) +# Combining templated and concrete matchers +ok {test-number} - str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) +# Combining templated and concrete matchers +ok {test-number} - str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +# Combining templated and concrete matchers +ok {test-number} - str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +# Combining templated and concrete matchers +ok {test-number} - str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) for: "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) +# Combining templated and concrete matchers +ok {test-number} - str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) for: "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) +# Combining templated matchers +ok {test-number} - container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) for: { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) +# Commas in various macros are allowed +ok {test-number} - std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} +# Commas in various macros are allowed +ok {test-number} - std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} +# Commas in various macros are allowed +ok {test-number} - std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} +# Commas in various macros are allowed +ok {test-number} - std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} +# Commas in various macros are allowed +ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } +# Commas in various macros are allowed +ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } +# Commas in various macros are allowed +ok {test-number} - !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) for: !({ 1, 2 } == { 1, 2, 3 }) +# Commas in various macros are allowed +ok {test-number} - !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) for: !({ 1, 2 } == { 1, 2, 3 }) +# Commas in various macros are allowed +ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } +# Commas in various macros are allowed +ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } +# Commas in various macros are allowed +ok {test-number} - true +# Commas in various macros are allowed +ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } +# Comparing function pointers +ok {test-number} - a for: 0x<hex digits> +# Comparing function pointers +ok {test-number} - a == &foo for: 0x<hex digits> == 0x<hex digits> +# Comparison ops +ok {test-number} - SimplePcg32{} == SimplePcg32{} for: {?} == {?} +# Comparison ops +ok {test-number} - SimplePcg32{ 0 } != SimplePcg32{} for: {?} != {?} +# Comparison ops +ok {test-number} - !(SimplePcg32{ 1 } == SimplePcg32{ 2 }) for: !({?} == {?}) +# Comparison ops +ok {test-number} - !(SimplePcg32{ 1 } != SimplePcg32{ 1 }) for: !({?} != {?}) +# Comparison with explicitly convertible types +ok {test-number} - td == Approx(10.0) for: StrongDoubleTypedef(10) == Approx( 10.0 ) +# Comparison with explicitly convertible types +ok {test-number} - Approx(10.0) == td for: Approx( 10.0 ) == StrongDoubleTypedef(10) +# Comparison with explicitly convertible types +ok {test-number} - td != Approx(11.0) for: StrongDoubleTypedef(10) != Approx( 11.0 ) +# Comparison with explicitly convertible types +ok {test-number} - Approx(11.0) != td for: Approx( 11.0 ) != StrongDoubleTypedef(10) +# Comparison with explicitly convertible types +ok {test-number} - td <= Approx(10.0) for: StrongDoubleTypedef(10) <= Approx( 10.0 ) +# Comparison with explicitly convertible types +ok {test-number} - td <= Approx(11.0) for: StrongDoubleTypedef(10) <= Approx( 11.0 ) +# Comparison with explicitly convertible types +ok {test-number} - Approx(10.0) <= td for: Approx( 10.0 ) <= StrongDoubleTypedef(10) +# Comparison with explicitly convertible types +ok {test-number} - Approx(9.0) <= td for: Approx( 9.0 ) <= StrongDoubleTypedef(10) +# Comparison with explicitly convertible types +ok {test-number} - td >= Approx(9.0) for: StrongDoubleTypedef(10) >= Approx( 9.0 ) +# Comparison with explicitly convertible types +ok {test-number} - td >= Approx(td) for: StrongDoubleTypedef(10) >= Approx( 10.0 ) +# Comparison with explicitly convertible types +ok {test-number} - Approx(td) >= td for: Approx( 10.0 ) >= StrongDoubleTypedef(10) +# Comparison with explicitly convertible types +ok {test-number} - Approx(11.0) >= td for: Approx( 11.0 ) >= StrongDoubleTypedef(10) +# Comparisons between ints where one side is computed +ok {test-number} - 54 == 6*9 for: 54 == 54 +# Comparisons between unsigned ints and negative signed ints match c++ standard behaviour +ok {test-number} - ( -1 > 2u ) for: true +# Comparisons between unsigned ints and negative signed ints match c++ standard behaviour +ok {test-number} - -1 > 2u for: -1 > 2 +# Comparisons between unsigned ints and negative signed ints match c++ standard behaviour +ok {test-number} - ( 2u < -1 ) for: true +# Comparisons between unsigned ints and negative signed ints match c++ standard behaviour +ok {test-number} - 2u < -1 for: 2 < -1 +# Comparisons between unsigned ints and negative signed ints match c++ standard behaviour +ok {test-number} - ( minInt > 2u ) for: true +# Comparisons between unsigned ints and negative signed ints match c++ standard behaviour +ok {test-number} - minInt > 2u for: -2147483648 > 2 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - i == 1 for: 1 == 1 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - ui == 2 for: 2 == 2 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - l == 3 for: 3 == 3 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - ul == 4 for: 4 == 4 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - c == 5 for: 5 == 5 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - uc == 6 for: 6 == 6 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - 1 == i for: 1 == 1 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - 2 == ui for: 2 == 2 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - 3 == l for: 3 == 3 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - 4 == ul for: 4 == 4 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - 5 == c for: 5 == 5 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - 6 == uc for: 6 == 6 +# Comparisons with int literals don't warn when mixing signed/ unsigned +ok {test-number} - (std::numeric_limits<uint32_t>::max)() > ul for: 4294967295 (0x<hex digits>) > 4 +# Composed generic matchers shortcircuit +ok {test-number} - !(matcher.match( 1 )) for: !false +# Composed generic matchers shortcircuit +ok {test-number} - first.matchCalled for: true +# Composed generic matchers shortcircuit +ok {test-number} - !second.matchCalled for: true +# Composed generic matchers shortcircuit +ok {test-number} - matcher.match( 1 ) for: true +# Composed generic matchers shortcircuit +ok {test-number} - first.matchCalled for: true +# Composed generic matchers shortcircuit +ok {test-number} - !second.matchCalled for: true +# Composed matchers shortcircuit +ok {test-number} - !(matcher.match( 1 )) for: !false +# Composed matchers shortcircuit +ok {test-number} - first.matchCalled for: true +# Composed matchers shortcircuit +ok {test-number} - !second.matchCalled for: true +# Composed matchers shortcircuit +ok {test-number} - matcher.match( 1 ) for: true +# Composed matchers shortcircuit +ok {test-number} - first.matchCalled for: true +# Composed matchers shortcircuit +ok {test-number} - !second.matchCalled for: true +# Contains string matcher +not ok {test-number} - testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) +# Contains string matcher +not ok {test-number} - testStringForMatching(), ContainsSubstring( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - elem % 2 == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - call_count == 1 for: 1 == 1 +# Copy and then generate a range +ok {test-number} - make_data().size() == test_count for: 6 == 6 +# Cout stream properly declares it writes to stdout +ok {test-number} - Catch::makeStream( "-" )->isConsole() for: true +# Custom exceptions can be translated when testing for nothrow +not ok {test-number} - unexpected exception with message: 'custom exception - not std'; expression was: throwCustom() +# Custom exceptions can be translated when testing for throwing as something else +not ok {test-number} - unexpected exception with message: 'custom exception - not std'; expression was: throwCustom(), std::exception +# Custom std-exceptions can be custom translated +not ok {test-number} - unexpected exception with message: 'custom std exception' +# Default scale is invisible to comparison +ok {test-number} - 101.000001 != Approx(100).epsilon(0.01) for: 101.000001 != Approx( 100.0 ) +# Default scale is invisible to comparison +ok {test-number} - std::pow(10, -5) != Approx(std::pow(10, -7)) for: 0.00001 != Approx( 0.0000001 ) +# Directly creating an EnumInfo +ok {test-number} - enumInfo->lookup(0) == "Value1" for: Value1 == "Value1" +# Directly creating an EnumInfo +ok {test-number} - enumInfo->lookup(1) == "Value2" for: Value2 == "Value2" +# Directly creating an EnumInfo +ok {test-number} - enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **} == "{** unexpected enum value **}" +# Empty stream name opens cout stream +ok {test-number} - Catch::makeStream( "" )->isConsole() for: true +# Empty tag is not allowed +ok {test-number} - Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) +# EndsWith string matcher +not ok {test-number} - testStringForMatching(), EndsWith( "Substring" ) for: "this string contains 'abc' as a substring" ends with: "Substring" +# EndsWith string matcher +not ok {test-number} - testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) +# Enums can quickly have stringification enabled using REGISTER_ENUM +ok {test-number} - stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1" +# Enums can quickly have stringification enabled using REGISTER_ENUM +ok {test-number} - stringify( EnumClass3::Value2 ) == "Value2" for: "Value2" == "Value2" +# Enums can quickly have stringification enabled using REGISTER_ENUM +ok {test-number} - stringify( EnumClass3::Value3 ) == "Value3" for: "Value3" == "Value3" +# Enums can quickly have stringification enabled using REGISTER_ENUM +ok {test-number} - stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}" for: "{** unexpected enum value **}" == "{** unexpected enum value **}" +# Enums can quickly have stringification enabled using REGISTER_ENUM +ok {test-number} - stringify( ec3 ) == "Value2" for: "Value2" == "Value2" +# Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM +ok {test-number} - stringify( Bikeshed::Colours::Red ) == "Red" for: "Red" == "Red" +# Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM +ok {test-number} - stringify( Bikeshed::Colours::Blue ) == "Blue" for: "Blue" == "Blue" +# Epsilon only applies to Approx's value +ok {test-number} - 101.01 != Approx(100).epsilon(0.01) for: 101.01 != Approx( 100.0 ) +# Equality checks that should fail +not ok {test-number} - data.int_seven == 6 for: 7 == 6 +# Equality checks that should fail +not ok {test-number} - data.int_seven == 8 for: 7 == 8 +# Equality checks that should fail +not ok {test-number} - data.int_seven == 0 for: 7 == 0 +# Equality checks that should fail +not ok {test-number} - data.float_nine_point_one == Approx( 9.11f ) for: 9.1f == Approx( 9.1099996567 ) +# Equality checks that should fail +not ok {test-number} - data.float_nine_point_one == Approx( 9.0f ) for: 9.1f == Approx( 9.0 ) +# Equality checks that should fail +not ok {test-number} - data.float_nine_point_one == Approx( 1 ) for: 9.1f == Approx( 1.0 ) +# Equality checks that should fail +not ok {test-number} - data.float_nine_point_one == Approx( 0 ) for: 9.1f == Approx( 0.0 ) +# Equality checks that should fail +not ok {test-number} - data.double_pi == Approx( 3.1415 ) for: 3.1415926535 == Approx( 3.1415 ) +# Equality checks that should fail +not ok {test-number} - data.str_hello == "goodbye" for: "hello" == "goodbye" +# Equality checks that should fail +not ok {test-number} - data.str_hello == "hell" for: "hello" == "hell" +# Equality checks that should fail +not ok {test-number} - data.str_hello == "hello1" for: "hello" == "hello1" +# Equality checks that should fail +not ok {test-number} - data.str_hello.size() == 6 for: 5 == 6 +# Equality checks that should fail +not ok {test-number} - x == Approx( 1.301 ) for: 1.3 == Approx( 1.301 ) +# Equality checks that should succeed +ok {test-number} - data.int_seven == 7 for: 7 == 7 +# Equality checks that should succeed +ok {test-number} - data.float_nine_point_one == Approx( 9.1f ) for: 9.1f == Approx( 9.1000003815 ) +# Equality checks that should succeed +ok {test-number} - data.double_pi == Approx( 3.1415926535 ) for: 3.1415926535 == Approx( 3.1415926535 ) +# Equality checks that should succeed +ok {test-number} - data.str_hello == "hello" for: "hello" == "hello" +# Equality checks that should succeed +ok {test-number} - "hello" == data.str_hello for: "hello" == "hello" +# Equality checks that should succeed +ok {test-number} - data.str_hello.size() == 5 for: 5 == 5 +# Equality checks that should succeed +ok {test-number} - x == Approx( 1.3 ) for: 1.3 == Approx( 1.3 ) +# Equals +ok {test-number} - 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" +# Equals +ok {test-number} - 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) +# Equals string matcher +not ok {test-number} - 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" +# Equals string matcher +not ok {test-number} - testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) for: "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 +ok {test-number} - ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" for: "This exception has overridden what() method" == "This exception has overridden what() method" +# Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified +ok {test-number} - ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" for: "OperatorException" == "OperatorException" +# Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified +ok {test-number} - ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" for: "StringMakerException" == "StringMakerException" +# Exception matchers that fail +not ok {test-number} - expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } +# Exception matchers that fail +not ok {test-number} - expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } +# Exception matchers that fail +not ok {test-number} - unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } +# Exception matchers that fail +not ok {test-number} - unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } +# Exception matchers that fail +not ok {test-number} - throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 +# Exception matchers that fail +not ok {test-number} - throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 +# Exception matchers that succeed +ok {test-number} - throwsSpecialException( 1 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 +# Exception matchers that succeed +ok {test-number} - throwsSpecialException( 2 ), SpecialException, ExceptionMatcher{ 2 } for: SpecialException::what special exception has value of 2 +# Exception messages can be tested for +ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" +# Exception messages can be tested for +ok {test-number} - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive) +# Exception messages can be tested for +ok {test-number} - thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected" +# Exception messages can be tested for +ok {test-number} - thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception" +# Exception messages can be tested for +ok {test-number} - thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except" +# Exception messages can be tested for +ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) +# Exceptions matchers +ok {test-number} - throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what" +# Exceptions matchers +ok {test-number} - throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) for: DerivedException::what not exception message matches "derivedexception::what" +# Exceptions matchers +ok {test-number} - throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) for: SpecialException::what not exception message matches "DerivedException::what" +# Exceptions matchers +ok {test-number} - throwsSpecialException( 2 ), SpecialException, Message( "SpecialException::what" ) for: SpecialException::what exception message matches "SpecialException::what" +# Expected exceptions that don't throw or unexpected exceptions fail the test +not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows(), std::string +# Expected exceptions that don't throw or unexpected exceptions fail the test +not ok {test-number} - expected exception, got none; expression was: thisDoesntThrow(), std::domain_error +# Expected exceptions that don't throw or unexpected exceptions fail the test +not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows() +# FAIL aborts the test +not ok {test-number} - explicitly with 1 message: 'This is a failure' +# FAIL does not require an argument +not ok {test-number} - explicitly +# FAIL_CHECK does not abort the test +not ok {test-number} - explicitly with 1 message: 'This is a failure' +# FAIL_CHECK does not abort the test +warning {test-number} - 'This message appears in the output' +# Factorials are computed +ok {test-number} - Factorial(0) == 1 for: 1 == 1 +# Factorials are computed +ok {test-number} - Factorial(1) == 1 for: 1 == 1 +# Factorials are computed +ok {test-number} - Factorial(2) == 2 for: 2 == 2 +# Factorials are computed +ok {test-number} - Factorial(3) == 6 for: 6 == 6 +# Factorials are computed +ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) +# Floating point matchers: double +ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other +# Floating point matchers: double +ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other +# Floating point matchers: double +ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other +# Floating point matchers: double +ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other +# Floating point matchers: double +ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other +# Floating point matchers: double +ok {test-number} - 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0 +# Floating point matchers: double +ok {test-number} - 0., WithinAbs( 1., 1 ) for: 0.0 is within 1.0 of 1.0 +# Floating point matchers: double +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 +# Floating point matchers: double +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 +# Floating point matchers: double +ok {test-number} - 11., !WithinAbs( 10., 0.5 ) for: 11.0 not is within 0.5 of 10.0 +# Floating point matchers: double +ok {test-number} - 10., !WithinAbs( 11., 0.5 ) for: 10.0 not is within 0.5 of 11.0 +# Floating point matchers: double +ok {test-number} - -10., WithinAbs( -10., 0.5 ) for: -10.0 is within 0.5 of -10.0 +# Floating point matchers: double +ok {test-number} - -10., WithinAbs( -9.6, 0.5 ) for: -10.0 is within 0.5 of -9.6 +# Floating point matchers: double +ok {test-number} - 1., WithinULP( 1., 0 ) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) +# Floating point matchers: double +ok {test-number} - nextafter( 1., 2. ), WithinULP( 1., 1 ) for: 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) +# Floating point matchers: double +ok {test-number} - 0., WithinULP( nextafter( 0., 1. ), 1 ) for: 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324]) +# Floating point matchers: double +ok {test-number} - 1., WithinULP( nextafter( 1., 0. ), 1 ) for: 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00]) +# Floating point matchers: double +ok {test-number} - 1., !WithinULP( nextafter( 1., 2. ), 0 ) for: 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) +# Floating point matchers: double +ok {test-number} - 1., WithinULP( 1., 0 ) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) +# Floating point matchers: double +ok {test-number} - -0., WithinULP( 0., 0 ) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) +# Floating point matchers: double +ok {test-number} - 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]) ) +# Floating point matchers: double +ok {test-number} - 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]) ) +# Floating point matchers: double +ok {test-number} - 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 ) +# Floating point matchers: double +ok {test-number} - WithinAbs( 1., 0. ) +# Floating point matchers: double +ok {test-number} - WithinAbs( 1., -1. ), std::domain_error +# Floating point matchers: double +ok {test-number} - WithinULP( 1., 0 ) +# Floating point matchers: double +ok {test-number} - WithinRel( 1., 0. ) +# Floating point matchers: double +ok {test-number} - WithinRel( 1., -0.2 ), std::domain_error +# Floating point matchers: double +ok {test-number} - WithinRel( 1., 1. ), std::domain_error +# Floating point matchers: float +ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other +# Floating point matchers: float +ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other +# Floating point matchers: float +ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other +# Floating point matchers: float +ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other +# Floating point matchers: float +ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other +# Floating point matchers: float +ok {test-number} - 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0 +# Floating point matchers: float +ok {test-number} - 0.f, WithinAbs( 1.f, 1 ) for: 0.0f is within 1.0 of 1.0 +# Floating point matchers: float +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 +# Floating point matchers: float +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 +# Floating point matchers: float +ok {test-number} - 0.f, WithinAbs( -0.f, 0 ) for: 0.0f is within 0.0 of -0.0 +# Floating point matchers: float +ok {test-number} - 11.f, !WithinAbs( 10.f, 0.5f ) for: 11.0f not is within 0.5 of 10.0 +# Floating point matchers: float +ok {test-number} - 10.f, !WithinAbs( 11.f, 0.5f ) for: 10.0f not is within 0.5 of 11.0 +# Floating point matchers: float +ok {test-number} - -10.f, WithinAbs( -10.f, 0.5f ) for: -10.0f is within 0.5 of -10.0 +# Floating point matchers: float +ok {test-number} - -10.f, WithinAbs( -9.6f, 0.5f ) for: -10.0f is within 0.5 of -9.6000003815 +# Floating point matchers: float +ok {test-number} - 1.f, WithinULP( 1.f, 0 ) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) +# Floating point matchers: float +ok {test-number} - -1.f, WithinULP( -1.f, 0 ) for: -1.0f is within 0 ULPs of -1.00000000e+00f ([-1.00000000e+00, -1.00000000e+00]) +# Floating point matchers: float +ok {test-number} - 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]) +# Floating point matchers: float +ok {test-number} - 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]) +# Floating point matchers: float +ok {test-number} - 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]) +# Floating point matchers: float +ok {test-number} - 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]) +# Floating point matchers: float +ok {test-number} - 1.f, WithinULP( 1.f, 0 ) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) +# Floating point matchers: float +ok {test-number} - -0.f, WithinULP( 0.f, 0 ) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) +# Floating point matchers: float +ok {test-number} - 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]) ) +# Floating point matchers: float +ok {test-number} - 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]) ) +# Floating point matchers: float +ok {test-number} - 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 ) +# Floating point matchers: float +ok {test-number} - WithinAbs( 1.f, 0.f ) +# Floating point matchers: float +ok {test-number} - WithinAbs( 1.f, -1.f ), std::domain_error +# Floating point matchers: float +ok {test-number} - WithinULP( 1.f, 0 ) +# Floating point matchers: float +ok {test-number} - WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error +# Floating point matchers: float +ok {test-number} - WithinRel( 1.f, 0.f ) +# Floating point matchers: float +ok {test-number} - WithinRel( 1.f, -0.2f ), std::domain_error +# Floating point matchers: float +ok {test-number} - WithinRel( 1.f, 1.f ), std::domain_error +# Generators -- adapters +ok {test-number} - i % 2 == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - i % 2 == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - i % 2 == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - filter([] (int) {return false; }, value(1)), Catch::GeneratorException +# Generators -- adapters +ok {test-number} - i < 4 for: 1 < 4 +# Generators -- adapters +ok {test-number} - i < 4 for: 2 < 4 +# Generators -- adapters +ok {test-number} - i < 4 for: 3 < 4 +# Generators -- adapters +ok {test-number} - i % 2 == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - i % 2 == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - i % 2 == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - i.size() == 1 for: 1 == 1 +# Generators -- adapters +ok {test-number} - i.size() == 1 for: 1 == 1 +# Generators -- adapters +ok {test-number} - i.size() == 1 for: 1 == 1 +# Generators -- adapters +ok {test-number} - i.size() == 1 for: 1 == 1 +# Generators -- adapters +ok {test-number} - i.size() == 1 for: 1 == 1 +# Generators -- adapters +ok {test-number} - i.size() == 1 for: 1 == 1 +# Generators -- adapters +ok {test-number} - j > 0 for: 1 > 0 +# Generators -- adapters +ok {test-number} - j > 0 for: 2 > 0 +# Generators -- adapters +ok {test-number} - j > 0 for: 3 > 0 +# Generators -- adapters +ok {test-number} - j > 0 for: 1 > 0 +# Generators -- adapters +ok {test-number} - j > 0 for: 2 > 0 +# Generators -- adapters +ok {test-number} - j > 0 for: 3 > 0 +# Generators -- adapters +ok {test-number} - chunk2.size() == 2 for: 2 == 2 +# Generators -- adapters +ok {test-number} - chunk2.front() == chunk2.back() for: 1 == 1 +# Generators -- adapters +ok {test-number} - chunk2.size() == 2 for: 2 == 2 +# Generators -- adapters +ok {test-number} - chunk2.front() == chunk2.back() for: 2 == 2 +# Generators -- adapters +ok {test-number} - chunk2.size() == 2 for: 2 == 2 +# Generators -- adapters +ok {test-number} - chunk2.front() == chunk2.back() for: 3 == 3 +# Generators -- adapters +ok {test-number} - chunk2.size() == 2 for: 2 == 2 +# Generators -- adapters +ok {test-number} - chunk2.front() == chunk2.back() for: 1 == 1 +# Generators -- adapters +ok {test-number} - chunk2.front() < 3 for: 1 < 3 +# Generators -- adapters +ok {test-number} - chunk2.size() == 2 for: 2 == 2 +# Generators -- adapters +ok {test-number} - chunk2.front() == chunk2.back() for: 2 == 2 +# Generators -- adapters +ok {test-number} - chunk2.front() < 3 for: 2 < 3 +# Generators -- adapters +ok {test-number} - chunk2.size() == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - chunk2.size() == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - chunk2.size() == 0 for: 0 == 0 +# Generators -- adapters +ok {test-number} - chunk(2, value(1)), Catch::GeneratorException +# Generators -- simple +ok {test-number} - j < i for: -3 < 1 +# Generators -- simple +ok {test-number} - j < i for: -2 < 1 +# Generators -- simple +ok {test-number} - j < i for: -1 < 1 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 4 > 1 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 4 > 2 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 4 > 3 +# Generators -- simple +ok {test-number} - j < i for: -3 < 2 +# Generators -- simple +ok {test-number} - j < i for: -2 < 2 +# Generators -- simple +ok {test-number} - j < i for: -1 < 2 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 8 > 1 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 8 > 2 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 8 > 3 +# Generators -- simple +ok {test-number} - j < i for: -3 < 3 +# Generators -- simple +ok {test-number} - j < i for: -2 < 3 +# Generators -- simple +ok {test-number} - j < i for: -1 < 3 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 12 > 1 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 12 > 2 +# Generators -- simple +ok {test-number} - 4u * i > str.size() for: 12 > 3 +# Generators internals +ok {test-number} - gen.get() == 123 for: 123 == 123 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 3 for: 3 == 3 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 5 for: 5 == 5 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 5 for: 5 == 5 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 4 for: 4 == 4 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 0 for: 0 == 0 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get().size() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.get() == "aa" for: "aa" == "aa" +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == "bb" for: "bb" == "bb" +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == "cc" for: "cc" == "cc" +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 3 for: 3 == 3 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 3 for: 3 == 3 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - filter([](int) { return false; }, value(1)), Catch::GeneratorException +# Generators internals +ok {test-number} - filter([](int) { return false; }, values({ 1, 2, 3 })), Catch::GeneratorException +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 2.0 for: 2.0 == 2.0 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 4.0 for: 4.0 == 4.0 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 6.0 for: 6.0 == 6.0 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 2.0 for: 2.0 == 2.0 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 4.0 for: 4.0 == 4.0 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 6.0 for: 6.0 == 6.0 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 3 for: 3 == 3 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 3 for: 3 == 3 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 3 for: 3 == 3 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == -2 for: -2 == -2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 0 for: 0 == 0 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 1 for: 1 == 1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 0 for: 0 == 0 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == -7 for: -7 == -7 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -4 for: -4 == -4 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == -7 for: -7 == -7 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -4 for: -4 == -4 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == -7 for: -7 == -7 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -4 for: -4 == -4 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 5 for: 5 == 5 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -1' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.9 == Approx( -0.9 ) with 1 message: 'Current expected value is -0.9' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.9' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.8 == Approx( -0.8 ) with 1 message: 'Current expected value is -0.8' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.8' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.7' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.6 == Approx( -0.6 ) with 1 message: 'Current expected value is -0.6' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.6' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.5 == Approx( -0.5 ) with 1 message: 'Current expected value is -0.5' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.5' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.4' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.3 == Approx( -0.3 ) with 1 message: 'Current expected value is -0.3' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.3' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.2 == Approx( -0.2 ) with 1 message: 'Current expected value is -0.2' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.2' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.1' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.0 == Approx( -0.0 ) with 1 message: 'Current expected value is -1.38778e-16' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -1.38778e-16' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.1 == Approx( 0.1 ) with 1 message: 'Current expected value is 0.1' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.1' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.2' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.3 == Approx( 0.3 ) with 1 message: 'Current expected value is 0.3' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.3' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.4 == Approx( 0.4 ) with 1 message: 'Current expected value is 0.4' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.4' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.5' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.6 == Approx( 0.6 ) with 1 message: 'Current expected value is 0.6' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.6' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.7 == Approx( 0.7 ) with 1 message: 'Current expected value is 0.7' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.7' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.8 == Approx( 0.8 ) with 1 message: 'Current expected value is 0.8' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.8' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.9 == Approx( 0.9 ) with 1 message: 'Current expected value is 0.9' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.9' +# Generators internals +ok {test-number} - gen.get() == Approx( rangeEnd ) for: 1.0 == Approx( 1.0 ) +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -1' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.7' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.4' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.1' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.2' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.5' +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -1' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.7' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.4' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is -0.1' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.2' +# Generators internals +ok {test-number} - gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5' +# Generators internals +ok {test-number} - gen.next() for: true with 1 message: 'Current expected value is 0.5' +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 5 for: 5 == 5 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -4 for: -4 == -4 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 5 for: 5 == 5 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -4 for: -4 == -4 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Generators internals +ok {test-number} - gen.get() == 5 for: 5 == 5 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == 2 for: 2 == 2 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -1 for: -1 == -1 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -4 for: -4 == -4 +# Generators internals +ok {test-number} - gen.next() for: true +# Generators internals +ok {test-number} - gen.get() == -7 for: -7 == -7 +# Generators internals +ok {test-number} - !(gen.next()) for: !false +# Greater-than inequalities with different epsilons +ok {test-number} - d >= Approx( 1.22 ) for: 1.23 >= Approx( 1.22 ) +# Greater-than inequalities with different epsilons +ok {test-number} - d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) +# Greater-than inequalities with different epsilons +ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) +# Greater-than inequalities with different epsilons +ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +# Hashers with different seed produce different hash with same test case +ok {test-number} - h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) != 130711275 (0x<hex digits>) +# Hashers with same seed produce same hash +ok {test-number} - h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) != 2668622104 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) != 3916075712 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) != 3429949824 (0x<hex digits>) +# Hashing test case produces same hash across multiple calls +ok {test-number} - h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) +# INFO and WARN do not abort tests +warning {test-number} - 'this is a message' with 1 message: 'this is a warning' +# INFO gets logged on failure +not ok {test-number} - a == 1 for: 2 == 1 with 2 messages: 'this message should be logged' and 'so should this' +# INFO gets logged on failure, even if captured before successful assertions +ok {test-number} - a == 2 for: 2 == 2 with 1 message: 'this message may be logged later' +# INFO gets logged on failure, even if captured before successful assertions +not ok {test-number} - a == 1 for: 2 == 1 with 2 messages: 'this message may be logged later' and 'this message should be logged' +# INFO gets logged on failure, even if captured before successful assertions +not ok {test-number} - 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' +# INFO gets logged on failure, even if captured before successful assertions +ok {test-number} - 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' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 0 < 10 with 2 messages: 'current counter 0' and 'i := 0' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 1 < 10 with 2 messages: 'current counter 1' and 'i := 1' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 2 < 10 with 2 messages: 'current counter 2' and 'i := 2' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 3 < 10 with 2 messages: 'current counter 3' and 'i := 3' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 4 < 10 with 2 messages: 'current counter 4' and 'i := 4' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 5 < 10 with 2 messages: 'current counter 5' and 'i := 5' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 6 < 10 with 2 messages: 'current counter 6' and 'i := 6' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 7 < 10 with 2 messages: 'current counter 7' and 'i := 7' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 8 < 10 with 2 messages: 'current counter 8' and 'i := 8' +# INFO is reset for each loop +ok {test-number} - i < 10 for: 9 < 10 with 2 messages: 'current counter 9' and 'i := 9' +# INFO is reset for each loop +not ok {test-number} - i < 10 for: 10 < 10 with 2 messages: 'current counter 10' and 'i := 10' +# Inequality checks that should fail +not ok {test-number} - data.int_seven != 7 for: 7 != 7 +# Inequality checks that should fail +not ok {test-number} - data.float_nine_point_one != Approx( 9.1f ) for: 9.1f != Approx( 9.1000003815 ) +# Inequality checks that should fail +not ok {test-number} - data.double_pi != Approx( 3.1415926535 ) for: 3.1415926535 != Approx( 3.1415926535 ) +# Inequality checks that should fail +not ok {test-number} - data.str_hello != "hello" for: "hello" != "hello" +# Inequality checks that should fail +not ok {test-number} - data.str_hello.size() != 5 for: 5 != 5 +# Inequality checks that should succeed +ok {test-number} - data.int_seven != 6 for: 7 != 6 +# Inequality checks that should succeed +ok {test-number} - data.int_seven != 8 for: 7 != 8 +# Inequality checks that should succeed +ok {test-number} - data.float_nine_point_one != Approx( 9.11f ) for: 9.1f != Approx( 9.1099996567 ) +# Inequality checks that should succeed +ok {test-number} - data.float_nine_point_one != Approx( 9.0f ) for: 9.1f != Approx( 9.0 ) +# Inequality checks that should succeed +ok {test-number} - data.float_nine_point_one != Approx( 1 ) for: 9.1f != Approx( 1.0 ) +# Inequality checks that should succeed +ok {test-number} - data.float_nine_point_one != Approx( 0 ) for: 9.1f != Approx( 0.0 ) +# Inequality checks that should succeed +ok {test-number} - data.double_pi != Approx( 3.1415 ) for: 3.1415926535 != Approx( 3.1415 ) +# Inequality checks that should succeed +ok {test-number} - data.str_hello != "goodbye" for: "hello" != "goodbye" +# Inequality checks that should succeed +ok {test-number} - data.str_hello != "hell" for: "hello" != "hell" +# Inequality checks that should succeed +ok {test-number} - data.str_hello != "hello1" for: "hello" != "hello1" +# Inequality checks that should succeed +ok {test-number} - data.str_hello.size() != 6 for: 5 != 6 +# Lambdas in assertions +ok {test-number} - []() { return true; }() for: true +# Less-than inequalities with different epsilons +ok {test-number} - d <= Approx( 1.24 ) for: 1.23 <= Approx( 1.24 ) +# Less-than inequalities with different epsilons +ok {test-number} - d <= Approx( 1.23 ) for: 1.23 <= Approx( 1.23 ) +# Less-than inequalities with different epsilons +ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.23 <= Approx( 1.22 )) +# Less-than inequalities with different epsilons +ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) +# ManuallyRegistered +ok {test-number} - with 1 message: 'was called' +# Matchers can be (AllOf) composed with the && operator +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "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 +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +# Matchers can be (AnyOf) composed with the || operator +ok {test-number} - testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) +# Matchers can be composed with both && and || +ok {test-number} - testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +# Matchers can be composed with both && and || - failing +not ok {test-number} - testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +# Matchers can be negated (Not) with the ! operator +ok {test-number} - testStringForMatching(), !ContainsSubstring( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" +# Matchers can be negated (Not) with the ! operator - failing +not ok {test-number} - testStringForMatching(), !ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" +# Mayfail test case with nested sections +not ok {test-number} - explicitly +# Mayfail test case with nested sections +not ok {test-number} - explicitly +# Mayfail test case with nested sections +not ok {test-number} - explicitly +# Mayfail test case with nested sections +not ok {test-number} - explicitly +# Mismatching exception messages failing the test +ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" +# Mismatching exception messages failing the test +not ok {test-number} - thisThrows(), "should fail" for: "expected exception" equals: "should fail" +# Multireporter calls reporters and listeners in correct order +ok {test-number} - records == expected for: { "Hello", "world", "Goodbye", "world" } == { "Hello", "world", "Goodbye", "world" } +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == false for: false == false +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldRedirectStdOut == true for: true == true +# Multireporter updates ReporterPreferences properly +ok {test-number} - multiReporter.getPreferences().shouldReportAllAssertions == true for: true == true +# Nested generators and captured variables +ok {test-number} - values > -6 for: 3 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 4 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 5 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 6 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: -5 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: -4 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 90 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 91 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 92 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 93 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 94 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 95 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 96 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 97 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 98 > -6 +# Nested generators and captured variables +ok {test-number} - values > -6 for: 99 > -6 +# Nice descriptive name +warning {test-number} - 'This one ran' +# Non-std exceptions can be translated +not ok {test-number} - unexpected exception with message: 'custom exception' +# Objects that evaluated in boolean contexts can be checked +ok {test-number} - True for: {?} +# Objects that evaluated in boolean contexts can be checked +ok {test-number} - !False for: true +# Objects that evaluated in boolean contexts can be checked +ok {test-number} - !(False) for: !{?} +# Optionally static assertions +ok {test-number} - with 1 message: 'std::is_void<void>::value' +# Optionally static assertions +ok {test-number} - with 1 message: '!(std::is_void<int>::value)' +# Optionally static assertions +ok {test-number} - with 1 message: 'std::is_void<void>::value' +# Optionally static assertions +ok {test-number} - with 1 message: '!(std::is_void<int>::value)' +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven > 7 for: 7 > 7 +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven < 7 for: 7 < 7 +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven > 8 for: 7 > 8 +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven < 6 for: 7 < 6 +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven < 0 for: 7 < 0 +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven < -1 for: 7 < -1 +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven >= 8 for: 7 >= 8 +# Ordering comparison checks that should fail +not ok {test-number} - data.int_seven <= 6 for: 7 <= 6 +# Ordering comparison checks that should fail +not ok {test-number} - data.float_nine_point_one < 9 for: 9.1f < 9 +# Ordering comparison checks that should fail +not ok {test-number} - data.float_nine_point_one > 10 for: 9.1f > 10 +# Ordering comparison checks that should fail +not ok {test-number} - data.float_nine_point_one > 9.2 for: 9.1f > 9.2 +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello > "hello" for: "hello" > "hello" +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello < "hello" for: "hello" < "hello" +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello > "hellp" for: "hello" > "hellp" +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello > "z" for: "hello" > "z" +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello < "hellm" for: "hello" < "hellm" +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello < "a" for: "hello" < "a" +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello >= "z" for: "hello" >= "z" +# Ordering comparison checks that should fail +not ok {test-number} - data.str_hello <= "a" for: "hello" <= "a" +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven < 8 for: 7 < 8 +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven > 6 for: 7 > 6 +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven > 0 for: 7 > 0 +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven > -1 for: 7 > -1 +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven >= 7 for: 7 >= 7 +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven >= 6 for: 7 >= 6 +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven <= 7 for: 7 <= 7 +# Ordering comparison checks that should succeed +ok {test-number} - data.int_seven <= 8 for: 7 <= 8 +# Ordering comparison checks that should succeed +ok {test-number} - data.float_nine_point_one > 9 for: 9.1f > 9 +# Ordering comparison checks that should succeed +ok {test-number} - data.float_nine_point_one < 10 for: 9.1f < 10 +# Ordering comparison checks that should succeed +ok {test-number} - data.float_nine_point_one < 9.2 for: 9.1f < 9.2 +# Ordering comparison checks that should succeed +ok {test-number} - data.str_hello <= "hello" for: "hello" <= "hello" +# Ordering comparison checks that should succeed +ok {test-number} - data.str_hello >= "hello" for: "hello" >= "hello" +# Ordering comparison checks that should succeed +ok {test-number} - data.str_hello < "hellp" for: "hello" < "hellp" +# Ordering comparison checks that should succeed +ok {test-number} - data.str_hello < "zebra" for: "hello" < "zebra" +# Ordering comparison checks that should succeed +ok {test-number} - data.str_hello > "hellm" for: "hello" > "hellm" +# Ordering comparison checks that should succeed +ok {test-number} - data.str_hello > "a" for: "hello" > "a" +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 4242248763 (0x<hex digits>) == 4242248763 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 1867888929 (0x<hex digits>) == 1867888929 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 1276619030 (0x<hex digits>) == 1276619030 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 1911218783 (0x<hex digits>) == 1911218783 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 1827115164 (0x<hex digits>) == 1827115164 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 1472234645 (0x<hex digits>) == 1472234645 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 868832940 (0x<hex digits>) == 868832940 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 570883446 (0x<hex digits>) == 570883446 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 889299803 (0x<hex digits>) == 889299803 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 4261393167 (0x<hex digits>) == 4261393167 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 1472234645 (0x<hex digits>) == 1472234645 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 868832940 (0x<hex digits>) == 868832940 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 570883446 (0x<hex digits>) == 570883446 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 889299803 (0x<hex digits>) == 889299803 (0x<hex digits>) +# Our PCG implementation provides expected results for known seeds +ok {test-number} - rng() == 0x<hex digits> for: 4261393167 (0x<hex digits>) == 4261393167 (0x<hex digits>) +# Output from all sections is reported +not ok {test-number} - explicitly with 1 message: 'Message from section one' +# Output from all sections is reported +not ok {test-number} - explicitly with 1 message: 'Message from section two' +# Overloaded comma or address-of operators are not used +ok {test-number} - ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed +# Overloaded comma or address-of operators are not used +ok {test-number} - &EvilMatcher(), EvilAddressOfOperatorUsed +# Overloaded comma or address-of operators are not used +ok {test-number} - EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) +# Overloaded comma or address-of operators are not used +ok {test-number} - ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() +# Parse test names and tags +ok {test-number} - spec.hasFilters() == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - parseTestSpec( "*a" ).matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - parseTestSpec( "a*" ).matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == true for: true == true +# Parse test names and tags +ok {test-number} - parseTestSpec( "*a*" ).matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.hasFilters() == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *tcA ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcB ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcC ) == false for: false == false +# Parse test names and tags +ok {test-number} - spec.matches( *tcD ) == true for: true == true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( " aardvark " ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( " aardvark" ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( " aardvark " ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( "aardvark " ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( "aardvark" ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( " aardvark " ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( " aardvark" ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( " aardvark " ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( "aardvark " ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches( *fakeTestCase( "aardvark" ) ) for: true +# Parse test names and tags +ok {test-number} - spec.matches(*fakeTestCase("hidden and foo", "[.][foo]")) for: true +# Parse test names and tags +ok {test-number} - !(spec.matches(*fakeTestCase("only foo", "[foo]"))) for: !false +# Parse test names and tags +ok {test-number} - !(spec.matches(*fakeTestCase("hidden and foo", "[.][foo]"))) for: !false +# Parse test names and tags +ok {test-number} - !(spec.matches(*fakeTestCase("only foo", "[foo]"))) for: !false +# Parse test names and tags +ok {test-number} - !(spec.matches(*fakeTestCase("only hidden", "[.]"))) for: !false +# Parse test names and tags +ok {test-number} - spec.matches(*fakeTestCase("neither foo nor hidden", "[bar]")) for: true +# Parsed tags are matched case insensitive +ok {test-number} - spec.hasFilters() for: true +# Parsed tags are matched case insensitive +ok {test-number} - spec.getInvalidSpecs().empty() for: true +# Parsed tags are matched case insensitive +ok {test-number} - spec.matches( testCase ) for: true +# Parsing sharding-related cli flags +ok {test-number} - cli.parse({ "test", "--shard-count=8" }) for: {?} +# Parsing sharding-related cli flags +ok {test-number} - config.shardCount == 8 for: 8 == 8 +# Parsing sharding-related cli flags +ok {test-number} - !(result) for: !{?} +# Parsing sharding-related cli flags +ok {test-number} - result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +# Parsing sharding-related cli flags +ok {test-number} - !(result) for: !{?} +# Parsing sharding-related cli flags +ok {test-number} - result.errorMessage(), ContainsSubstring("Shard count must be a positive number") for: "Shard count must be a positive number" contains: "Shard count must be a positive number" +# Parsing sharding-related cli flags +ok {test-number} - cli.parse({ "test", "--shard-index=2" }) for: {?} +# Parsing sharding-related cli flags +ok {test-number} - config.shardIndex == 2 for: 2 == 2 +# Parsing sharding-related cli flags +ok {test-number} - !(result) for: !{?} +# Parsing sharding-related cli flags +ok {test-number} - result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") for: "Shard index must be a non-negative number" contains: "Shard index must be a non-negative number" +# Parsing sharding-related cli flags +ok {test-number} - cli.parse({ "test", "--shard-index=0" }) for: {?} +# Parsing sharding-related cli flags +ok {test-number} - config.shardIndex == 0 for: 0 == 0 +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.hasFilters() for: true with 1 message: 'tagString := "[tag with spaces]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[tag with spaces]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.matches( testCase ) for: true with 1 message: 'tagString := "[tag with spaces]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.hasFilters() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.getInvalidSpecs().empty() for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +# Parsing tags with non-alphabetical characters is pass-through +ok {test-number} - spec.matches( testCase ) for: true with 1 message: 'tagString := "[I said "good day" sir!]"' +# Parsing warnings +ok {test-number} - cli.parse( { "test", "-w", "NoAssertions" } ) for: {?} +# Parsing warnings +ok {test-number} - config.warnings == WarnAbout::NoAssertions for: 1 == 1 +# Parsing warnings +ok {test-number} - !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?} +# Parsing warnings +ok {test-number} - cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?} +# Parsing warnings +ok {test-number} - config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3 +# Pointers can be compared to null +ok {test-number} - p == 0 for: 0 == 0 +# Pointers can be compared to null +ok {test-number} - p == pNULL for: 0 == 0 +# Pointers can be compared to null +ok {test-number} - p != 0 for: 0x<hex digits> != 0 +# Pointers can be compared to null +ok {test-number} - cp != 0 for: 0x<hex digits> != 0 +# Pointers can be compared to null +ok {test-number} - cpc != 0 for: 0x<hex digits> != 0 +# Pointers can be compared to null +ok {test-number} - returnsNull() == 0 for: {null string} == 0 +# Pointers can be compared to null +ok {test-number} - returnsConstNull() == 0 for: {null string} == 0 +# Pointers can be compared to null +ok {test-number} - 0 != p for: 0 != 0x<hex digits> +# Precision of floating point stringification can be set +ok {test-number} - str1.size() == 3 + 5 for: 8 == 8 +# Precision of floating point stringification can be set +ok {test-number} - str2.size() == 3 + 10 for: 13 == 13 +# Precision of floating point stringification can be set +ok {test-number} - str1.size() == 2 + 5 for: 7 == 7 +# Precision of floating point stringification can be set +ok {test-number} - str2.size() == 2 + 15 for: 17 == 17 +# Predicate matcher can accept const char* +ok {test-number} - "foo", Predicate<const char*>( []( const char* const& ) { return true; } ) for: "foo" matches undescribed predicate +# Process can be configured on command line +ok {test-number} - result for: {?} +# Process can be configured on command line +ok {test-number} - config.processName == "" for: "" == "" +# Process can be configured on command line +ok {test-number} - result for: {?} +# Process can be configured on command line +ok {test-number} - config.processName == "test" for: "test" == "test" +# Process can be configured on command line +ok {test-number} - config.shouldDebugBreak == false for: false == false +# Process can be configured on command line +ok {test-number} - config.abortAfter == -1 for: -1 == -1 +# Process can be configured on command line +ok {test-number} - config.noThrow == false for: false == false +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications.empty() for: true +# Process can be configured on command line +ok {test-number} - !(cfg.hasTestFilters()) for: !false +# Process can be configured on command line +ok {test-number} - cfg.getReporterSpecs().size() == 1 for: 1 == 1 +# Process can be configured on command line +ok {test-number} - cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } for: {?} == {?} +# Process can be configured on command line +ok {test-number} - cfg.getProcessedReporterSpecs().size() == 1 for: 1 == 1 +# Process can be configured on command line +ok {test-number} - cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } for: {?} == {?} +# Process can be configured on command line +ok {test-number} - result for: {?} +# Process can be configured on command line +ok {test-number} - cfg.hasTestFilters() for: true +# Process can be configured on command line +ok {test-number} - cfg.testSpec().matches(*fakeTestCase("notIncluded")) == false for: false == false +# Process can be configured on command line +ok {test-number} - cfg.testSpec().matches(*fakeTestCase("test1")) for: true +# Process can be configured on command line +ok {test-number} - result for: {?} +# Process can be configured on command line +ok {test-number} - cfg.hasTestFilters() for: true +# Process can be configured on command line +ok {test-number} - cfg.testSpec().matches(*fakeTestCase("test1")) == false for: false == false +# Process can be configured on command line +ok {test-number} - cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) for: true +# Process can be configured on command line +ok {test-number} - result for: {?} +# Process can be configured on command line +ok {test-number} - cfg.hasTestFilters() for: true +# Process can be configured on command line +ok {test-number} - cfg.testSpec().matches(*fakeTestCase("test1")) == false for: false == false +# Process can be configured on command line +ok {test-number} - cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) for: true +# Process can be configured on command line +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - !result for: true +# Process can be configured on command line +ok {test-number} - result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" +# Process can be configured on command line +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - result for: {?} with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +# Process can be configured on command line +ok {test-number} - !result for: true +# Process can be configured on command line +ok {test-number} - result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") for: "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "-b"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.shouldDebugBreak == true for: true == true +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--break"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.shouldDebugBreak for: true +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "-a"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.abortAfter == 1 for: 1 == 1 +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "-x", "2"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.abortAfter == 2 for: 2 == 2 +# Process can be configured on command line +ok {test-number} - !result for: true +# Process can be configured on command line +ok {test-number} - result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} +# Process can be configured on command line +ok {test-number} - config.waitForKeypress == std::get<1>(input) for: 0 == 0 +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} +# Process can be configured on command line +ok {test-number} - config.waitForKeypress == std::get<1>(input) for: 1 == 1 +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} +# Process can be configured on command line +ok {test-number} - config.waitForKeypress == std::get<1>(input) for: 2 == 2 +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} +# Process can be configured on command line +ok {test-number} - config.waitForKeypress == std::get<1>(input) for: 3 == 3 +# Process can be configured on command line +ok {test-number} - !result for: true +# Process can be configured on command line +ok {test-number} - result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") for: "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 +ok {test-number} - cli.parse({"test", "-e"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.noThrow for: true +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--nothrow"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.noThrow for: true +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "-o", "filename.ext"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.defaultOutputFilename == "filename.ext" for: "filename.ext" == "filename.ext" +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--out", "filename.ext"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.defaultOutputFilename == "filename.ext" for: "filename.ext" == "filename.ext" +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "-abe"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.abortAfter == 1 for: 1 == 1 +# Process can be configured on command line +ok {test-number} - config.shouldDebugBreak for: true +# Process can be configured on command line +ok {test-number} - config.noThrow == true for: true == true +# Process can be configured on command line +ok {test-number} - cli.parse({"test"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 +# Process can be configured on command line +ok {test-number} - cli.parse( { "test", "--colour-mode", "default" } ) for: {?} +# Process can be configured on command line +ok {test-number} - config.defaultColourMode == ColourMode::PlatformDefault for: 0 == 0 +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--colour-mode", "ansi"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.defaultColourMode == ColourMode::ANSI for: 1 == 1 +# Process can be configured on command line +ok {test-number} - cli.parse({"test", "--colour-mode", "none"}) for: {?} +# Process can be configured on command line +ok {test-number} - config.defaultColourMode == ColourMode::None for: 3 == 3 +# Process can be configured on command line +ok {test-number} - !result for: true +# Process can be configured on command line +ok {test-number} - result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: default, ansi, win32, or none. 'wrong' is not recognised" contains: "colour mode must be one of" +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "--benchmark-samples=200" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.benchmarkSamples == 200 for: 200 == 200 +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "--benchmark-resamples=20000" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.benchmarkResamples == 20000 for: 20000 (0x<hex digits>) == 20000 (0x<hex digits>) +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "--benchmark-confidence-interval=0.99" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.benchmarkConfidenceInterval == Catch::Approx(0.99) for: 0.99 == Approx( 0.99 ) +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "--benchmark-no-analysis" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.benchmarkNoAnalysis for: true +# Process can be configured on command line +ok {test-number} - cli.parse({ "test", "--benchmark-warmup-time=10" }) for: {?} +# Process can be configured on command line +ok {test-number} - config.benchmarkWarmupTime == 10 for: 10 == 10 +# Product with differing arities - std::tuple<int, double, float> +ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 3 >= 1 +# Product with differing arities - std::tuple<int, double> +ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 2 >= 1 +# Product with differing arities - std::tuple<int> +ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 1 >= 1 +# Random seed generation accepts known methods +ok {test-number} - Catch::generateRandomSeed(method) +# Random seed generation accepts known methods +ok {test-number} - Catch::generateRandomSeed(method) +# Random seed generation accepts known methods +ok {test-number} - Catch::generateRandomSeed(method) +# Random seed generation reports unknown methods +ok {test-number} - Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) +# Range type with sentinel +ok {test-number} - Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }" +# Reconstruction should be based on stringification: #914 +not ok {test-number} - truthy(false) for: Hey, its truthy! +# Regex string matcher +not ok {test-number} - 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 +# Regex string matcher +not ok {test-number} - testStringForMatching(), Matches( "contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively +# Regex string matcher +not ok {test-number} - 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 +# Registering reporter with '::' in name fails +ok {test-number} - registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'" +# Regression test #1 +ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: Automake' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: Automake' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: Automake' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: JUnit' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: JUnit' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: JUnit' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: SonarQube' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: SonarQube' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: SonarQube' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: TAP' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: TAP' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TAP' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: TeamCity' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: TeamCity' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: TeamCity' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> <TagsFromMatchingTests> <Tag> <Count>1</Count> <Aliases> <Alias>fakeTag</Alias> </Aliases> </Tag> </TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: XML' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> <AvailableReporters> <Reporter> <Name>fake reporter</Name> <Description>fake description</Description> </Reporter> </AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: XML' +# Reporter's write listings to provided stream +ok {test-number} - !(factories.empty()) for: !false +# Reporter's write listings to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> <MatchingTests> <TestCase> <Name>fake test name</Name> <ClassName/> <Tags>[fakeTestTag]</Tags> <SourceInfo> <File>fake-file.cpp</File> <Line>123456789</Line> </SourceInfo> </TestCase> </MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: XML' +# Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla +ok {test-number} - +# SUCCEED counts as a test pass +ok {test-number} - with 1 message: 'this is a success' +# SUCCEED does not require an argument +ok {test-number} - +# Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods +ok {test-number} - before == 0 for: 0 == 0 +# Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods +ok {test-number} - after > before for: 1 > 0 +# Scenario: Do that thing with the thing +ok {test-number} - itDoesThis() for: true +# Scenario: Do that thing with the thing +ok {test-number} - itDoesThat() for: true +# Scenario: This is a really long scenario name to see how the list command deals with wrapping +ok {test-number} - with 1 message: 'boo!' +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.size() == 0 for: 0 == 0 +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.size() == 10 for: 10 == 10 +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.size() == 5 for: 5 == 5 +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.size() == 0 for: 0 == 0 +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# Scenario: Vector resizing affects size and capacity +ok {test-number} - v.size() == 0 for: 0 == 0 +# Some simple comparisons between doubles +ok {test-number} - d == Approx( 1.23 ) for: 1.23 == Approx( 1.23 ) +# Some simple comparisons between doubles +ok {test-number} - d != Approx( 1.22 ) for: 1.23 != Approx( 1.22 ) +# Some simple comparisons between doubles +ok {test-number} - d != Approx( 1.24 ) for: 1.23 != Approx( 1.24 ) +# Some simple comparisons between doubles +ok {test-number} - d == 1.23_a for: 1.23 == Approx( 1.23 ) +# Some simple comparisons between doubles +ok {test-number} - d != 1.22_a for: 1.23 != Approx( 1.22 ) +# Some simple comparisons between doubles +ok {test-number} - Approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23 +# Some simple comparisons between doubles +ok {test-number} - Approx( d ) != 1.22 for: Approx( 1.23 ) != 1.22 +# Some simple comparisons between doubles +ok {test-number} - Approx( d ) != 1.24 for: Approx( 1.23 ) != 1.24 +# StartsWith string matcher +not ok {test-number} - testStringForMatching(), StartsWith( "This String" ) for: "this string contains 'abc' as a substring" starts with: "This String" +# StartsWith string matcher +not ok {test-number} - testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) +# Static arrays are convertible to string +ok {test-number} - Catch::Detail::stringify(singular) == "{ 1 }" for: "{ 1 }" == "{ 1 }" +# Static arrays are convertible to string +ok {test-number} - Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" for: "{ 3, 2, 1 }" == "{ 3, 2, 1 }" +# Static arrays are convertible to string +ok {test-number} - 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" } }" +# String matchers +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string" +# String matchers +ok {test-number} - testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +# String matchers +ok {test-number} - testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" +# String matchers +ok {test-number} - testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) +# String matchers +ok {test-number} - testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this" +# String matchers +ok {test-number} - testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) +# String matchers +ok {test-number} - testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring" +# String matchers +ok {test-number} - testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) +# StringRef +ok {test-number} - empty.empty() for: true +# StringRef +ok {test-number} - empty.size() == 0 for: 0 == 0 +# StringRef +ok {test-number} - std::strcmp( empty.data(), "" ) == 0 for: 0 == 0 +# StringRef +ok {test-number} - s.empty() == false for: false == false +# StringRef +ok {test-number} - s.size() == 5 for: 5 == 5 +# StringRef +ok {test-number} - std::strcmp( rawChars, "hello" ) == 0 for: 0 == 0 +# StringRef +ok {test-number} - s.data() == rawChars for: "hello" == "hello" +# StringRef +ok {test-number} - original == "original" +# StringRef +ok {test-number} - original.data() +# StringRef +ok {test-number} - original.begin() == copy.begin() for: "original string" == "original string" +# StringRef +ok {test-number} - original.begin() == copy.begin() for: "original string" == "original string" +# StringRef +ok {test-number} - ss.empty() == false for: false == false +# StringRef +ok {test-number} - ss.size() == 5 for: 5 == 5 +# StringRef +ok {test-number} - std::strncmp( ss.data(), "hello", 5 ) == 0 for: 0 == 0 +# StringRef +ok {test-number} - ss == "hello" for: hello == "hello" +# StringRef +ok {test-number} - ss.size() == 6 for: 6 == 6 +# StringRef +ok {test-number} - std::strcmp( ss.data(), "world!" ) == 0 for: 0 == 0 +# StringRef +ok {test-number} - s.data() == s2.data() for: "hello world!" == "hello world!" +# StringRef +ok {test-number} - s.data() == ss.data() for: "hello world!" == "hello world!" +# StringRef +ok {test-number} - s.substr(s.size() + 1, 123).empty() for: true +# StringRef +ok {test-number} - std::strcmp(ss.data(), "world!") == 0 for: 0 == 0 +# StringRef +ok {test-number} - s.substr(1'000'000, 1).empty() for: true +# StringRef +ok {test-number} - reinterpret_cast<char*>(buffer1) != reinterpret_cast<char*>(buffer2) for: "Hello" != "Hello" +# StringRef +ok {test-number} - left == right for: Hello == Hello +# StringRef +ok {test-number} - left != left.substr(0, 3) for: Hello != Hel +# StringRef +ok {test-number} - sr == "a standard string" for: a standard string == "a standard string" +# StringRef +ok {test-number} - sr.size() == stdStr.size() for: 17 == 17 +# StringRef +ok {test-number} - sr == "a standard string" for: a standard string == "a standard string" +# StringRef +ok {test-number} - sr.size() == stdStr.size() for: 17 == 17 +# StringRef +ok {test-number} - sr == "a standard string" for: a standard string == "a standard string" +# StringRef +ok {test-number} - sr.size() == stdStr.size() for: 17 == 17 +# StringRef +ok {test-number} - stdStr == "a stringref" for: "a stringref" == "a stringref" +# StringRef +ok {test-number} - stdStr.size() == sr.size() for: 11 == 11 +# StringRef +ok {test-number} - stdStr == "a stringref" for: "a stringref" == "a stringref" +# StringRef +ok {test-number} - stdStr.size() == sr.size() for: 11 == 11 +# StringRef +ok {test-number} - lhs == "some string += the stringref contents" for: "some string += the stringref contents" == "some string += the stringref contents" +# StringRef +ok {test-number} - together == "abrakadabra" for: "abrakadabra" == "abrakadabra" +# StringRef at compilation time +ok {test-number} - with 1 message: 'empty.size() == 0' +# StringRef at compilation time +ok {test-number} - with 1 message: 'empty.begin() == empty.end()' +# StringRef at compilation time +ok {test-number} - with 1 message: 'stringref.size() == 3' +# StringRef at compilation time +ok {test-number} - with 1 message: 'stringref.data() == abc' +# StringRef at compilation time +ok {test-number} - with 1 message: 'stringref.begin() == abc' +# StringRef at compilation time +ok {test-number} - with 1 message: 'stringref.begin() != stringref.end()' +# StringRef at compilation time +ok {test-number} - with 1 message: 'stringref.substr(10, 0).empty()' +# StringRef at compilation time +ok {test-number} - with 1 message: 'stringref.substr(2, 1).data() == abc + 2' +# StringRef at compilation time +ok {test-number} - with 1 message: 'stringref[1] == 'b'' +# StringRef at compilation time +ok {test-number} - with 1 message: 'shortened.size() == 2' +# StringRef at compilation time +ok {test-number} - with 1 message: 'shortened.data() == abc' +# StringRef at compilation time +ok {test-number} - with 1 message: 'shortened.begin() != shortened.end()' +# StringRef at compilation time +ok {test-number} - with 1 message: '!(sr1.empty())' +# StringRef at compilation time +ok {test-number} - with 1 message: 'sr1.size() == 3' +# StringRef at compilation time +ok {test-number} - with 1 message: 'sr2.empty()' +# StringRef at compilation time +ok {test-number} - with 1 message: 'sr2.size() == 0' +# Stringifying char arrays with statically known sizes - char +ok {test-number} - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - char +ok {test-number} - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - signed char +ok {test-number} - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - signed char +ok {test-number} - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - unsigned char +ok {test-number} - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - unsigned char +ok {test-number} - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying std::chrono::duration helpers +ok {test-number} - minute == seconds for: 1 m == 60 s +# Stringifying std::chrono::duration helpers +ok {test-number} - hour != seconds for: 1 h != 60 s +# Stringifying std::chrono::duration helpers +ok {test-number} - micro != milli for: 1 us != 1 ms +# Stringifying std::chrono::duration helpers +ok {test-number} - nano != micro for: 1 ns != 1 us +# Stringifying std::chrono::duration with weird ratios +ok {test-number} - half_minute != femto_second for: 1 [30/1]s != 1 fs +# Stringifying std::chrono::duration with weird ratios +ok {test-number} - pico_second != atto_second for: 1 ps != 1 as +# Stringifying std::chrono::time_point<system_clock> +ok {test-number} - now != later for: {iso8601-timestamp} != {iso8601-timestamp} +# Tabs and newlines show in output +not ok {test-number} - s1 == s2 for: "if ($b == 10) { $a = 20; }" == "if ($b == 10) { $a = 20; } " +# Tag alias can be registered against tag patterns +ok {test-number} - what, ContainsSubstring( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" +# Tag alias can be registered against tag patterns +ok {test-number} - what, ContainsSubstring( "file" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" +# Tag alias can be registered against tag patterns +ok {test-number} - what, ContainsSubstring( "2" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" +# Tag alias can be registered against tag patterns +ok {test-number} - what, ContainsSubstring( "10" ) for: "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 +ok {test-number} - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) +# Tag alias can be registered against tag patterns +ok {test-number} - registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) +# Tag alias can be registered against tag patterns +ok {test-number} - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) +# Tag alias can be registered against tag patterns +ok {test-number} - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) +# Tags with spaces and non-alphanumerical characters are accepted +ok {test-number} - testCase.tags.size() == 2 for: 2 == 2 +# Tags with spaces and non-alphanumerical characters are accepted +ok {test-number} - testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} ) +# Template test case method with test types specified inside std::tuple - MyTypes - 0 +ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1 +# Template test case method with test types specified inside std::tuple - MyTypes - 1 +ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1 +# Template test case method with test types specified inside std::tuple - MyTypes - 2 +ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1 +# Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0 +ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +# Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1 +ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +# Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0 +ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +# Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1 +ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +# Template test case with test types specified inside std::tuple - MyTypes - 0 +ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +# Template test case with test types specified inside std::tuple - MyTypes - 1 +ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +# Template test case with test types specified inside std::tuple - MyTypes - 2 +ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 10 for: 10 == 10 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - float +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 10 for: 10 == 10 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - int +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 10 for: 10 == 10 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::string +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 10 for: 10 == 10 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.size() == 5 for: 5 == 5 +# TemplateTest: vectors can be sized and resized - std::tuple<int,float> +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == V for: 6 == 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= V for: 6 >= 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == 2 * V for: 12 == 12 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= 2 * V for: 12 >= 12 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == V for: 6 == 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= V for: 6 >= 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= V for: 6 >= 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == V for: 6 == 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= V for: 6 >= 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == V for: 6 == 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= 2 * V for: 12 >= 12 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == V for: 6 == 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= V for: 6 >= 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.size() == V for: 6 == 6 +# TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6 +ok {test-number} - v.capacity() >= V for: 6 >= 6 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == V for: 4 == 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= V for: 4 >= 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == 2 * V for: 8 == 8 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= 2 * V for: 8 >= 8 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == V for: 4 == 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= V for: 4 >= 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= V for: 4 >= 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == V for: 4 == 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= V for: 4 >= 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == V for: 4 == 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= 2 * V for: 8 >= 8 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == V for: 4 == 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= V for: 4 >= 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.size() == V for: 4 == 4 +# TemplateTestSig: vectors can be sized and resized - float,4 +ok {test-number} - v.capacity() >= V for: 4 >= 4 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == V for: 5 == 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= V for: 5 >= 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == 2 * V for: 10 == 10 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= 2 * V for: 10 >= 10 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == V for: 5 == 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= V for: 5 >= 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= V for: 5 >= 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == V for: 5 == 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= V for: 5 >= 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == V for: 5 == 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= 2 * V for: 10 >= 10 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == V for: 5 == 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= V for: 5 >= 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.size() == V for: 5 == 5 +# TemplateTestSig: vectors can be sized and resized - int,5 +ok {test-number} - v.capacity() >= V for: 5 >= 5 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == V for: 15 == 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= V for: 15 >= 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == 2 * V for: 30 == 30 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= 2 * V for: 30 >= 30 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == V for: 15 == 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= V for: 15 >= 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= V for: 15 >= 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == V for: 15 == 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= V for: 15 >= 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == V for: 15 == 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= 2 * V for: 30 >= 30 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == V for: 15 == 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= V for: 15 >= 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.size() == V for: 15 == 15 +# TemplateTestSig: vectors can be sized and resized - std::string,15 +ok {test-number} - v.capacity() >= V for: 15 >= 15 +# Test case with identical tags keeps just one +ok {test-number} - testCase.tags.size() == 1 for: 1 == 1 +# Test case with identical tags keeps just one +ok {test-number} - testCase.tags[0] == Tag( "tag1" ) for: {?} == {?} +# Test case with one argument +ok {test-number} - with 1 message: 'no assertions' +# Test enum bit values +ok {test-number} - 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 +# Test with special, characters "in name +ok {test-number} - +# Testing checked-if +ok {test-number} - true +# Testing checked-if +ok {test-number} - +# Testing checked-if +ok {test-number} - false # TODO +# Testing checked-if +ok {test-number} - true +# Testing checked-if +ok {test-number} - false # TODO +# Testing checked-if +ok {test-number} - +# Testing checked-if 2 +ok {test-number} - true +# Testing checked-if 2 +not ok {test-number} - explicitly +# Testing checked-if 3 +ok {test-number} - false # TODO +# Testing checked-if 3 +not ok {test-number} - explicitly +# The NO_FAIL macro reports a failure but does not fail the test +ok {test-number} - 1 == 2 # TODO +# The default listing implementation write to provided stream +ok {test-number} - listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" +# The default listing implementation write to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: fake reporter: fake description " ( contains: "fake reporter" and contains: "fake description" ) +# The default listing implementation write to provided stream +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) +# The default listing implementation write to provided stream +ok {test-number} - listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) for: "Registered listeners: fakeListener: fake description " ( contains: "fakeListener" and contains: "fake description" ) +# This test 'should' fail but doesn't +ok {test-number} - with 1 message: 'oops!' +# Thrown string literals are translated +not ok {test-number} - unexpected exception with message: 'For some reason someone is throwing a string literal!' +# Tracker +ok {test-number} - testCase.isOpen() for: true +# Tracker +ok {test-number} - s1.isOpen() for: true +# Tracker +ok {test-number} - s1.isSuccessfullyCompleted() for: true +# Tracker +ok {test-number} - testCase.isComplete() == false for: false == false +# Tracker +ok {test-number} - ctx.completedCycle() for: true +# Tracker +ok {test-number} - testCase.isSuccessfullyCompleted() for: true +# Tracker +ok {test-number} - testCase.isOpen() for: true +# Tracker +ok {test-number} - s1.isOpen() for: true +# Tracker +ok {test-number} - s1.isComplete() for: true +# Tracker +ok {test-number} - s1.isSuccessfullyCompleted() == false for: false == false +# Tracker +ok {test-number} - testCase.isComplete() == false for: false == false +# Tracker +ok {test-number} - ctx.completedCycle() for: true +# Tracker +ok {test-number} - testCase.isSuccessfullyCompleted() == false for: false == false +# Tracker +ok {test-number} - testCase2.isOpen() for: true +# Tracker +ok {test-number} - s1b.isOpen() == false for: false == false +# Tracker +ok {test-number} - ctx.completedCycle() for: true +# Tracker +ok {test-number} - testCase.isComplete() for: true +# Tracker +ok {test-number} - testCase.isSuccessfullyCompleted() for: true +# Tracker +ok {test-number} - testCase.isOpen() for: true +# Tracker +ok {test-number} - s1.isOpen() for: true +# Tracker +ok {test-number} - s1.isComplete() for: true +# Tracker +ok {test-number} - s1.isSuccessfullyCompleted() == false for: false == false +# Tracker +ok {test-number} - testCase.isComplete() == false for: false == false +# Tracker +ok {test-number} - ctx.completedCycle() for: true +# Tracker +ok {test-number} - testCase.isSuccessfullyCompleted() == false for: false == false +# Tracker +ok {test-number} - testCase2.isOpen() for: true +# Tracker +ok {test-number} - s1b.isOpen() == false for: false == false +# Tracker +ok {test-number} - s2.isOpen() for: true +# Tracker +ok {test-number} - ctx.completedCycle() for: true +# Tracker +ok {test-number} - testCase.isComplete() for: true +# Tracker +ok {test-number} - testCase.isSuccessfullyCompleted() for: true +# Tracker +ok {test-number} - testCase.isOpen() for: true +# Tracker +ok {test-number} - s1.isOpen() for: true +# Tracker +ok {test-number} - s2.isOpen() == false for: false == false +# Tracker +ok {test-number} - testCase.isComplete() == false for: false == false +# Tracker +ok {test-number} - testCase2.isOpen() for: true +# Tracker +ok {test-number} - s1b.isOpen() == false for: false == false +# Tracker +ok {test-number} - s2b.isOpen() for: true +# Tracker +ok {test-number} - ctx.completedCycle() == false for: false == false +# Tracker +ok {test-number} - ctx.completedCycle() for: true +# Tracker +ok {test-number} - s2b.isSuccessfullyCompleted() for: true +# Tracker +ok {test-number} - testCase2.isComplete() == false for: false == false +# Tracker +ok {test-number} - testCase2.isSuccessfullyCompleted() for: true +# Tracker +ok {test-number} - testCase.isOpen() for: true +# Tracker +ok {test-number} - s1.isOpen() for: true +# Tracker +ok {test-number} - s2.isOpen() == false for: false == false +# Tracker +ok {test-number} - testCase.isComplete() == false for: false == false +# Tracker +ok {test-number} - testCase2.isOpen() for: true +# Tracker +ok {test-number} - s1b.isOpen() == false for: false == false +# Tracker +ok {test-number} - s2b.isOpen() for: true +# Tracker +ok {test-number} - ctx.completedCycle() == false for: false == false +# Tracker +ok {test-number} - ctx.completedCycle() for: true +# Tracker +ok {test-number} - s2b.isComplete() for: true +# Tracker +ok {test-number} - s2b.isSuccessfullyCompleted() == false for: false == false +# Tracker +ok {test-number} - testCase2.isSuccessfullyCompleted() == false for: false == false +# Tracker +ok {test-number} - testCase3.isOpen() for: true +# Tracker +ok {test-number} - s1c.isOpen() == false for: false == false +# Tracker +ok {test-number} - s2c.isOpen() == false for: false == false +# Tracker +ok {test-number} - testCase3.isSuccessfullyCompleted() for: true +# Tracker +ok {test-number} - testCase.isOpen() for: true +# Tracker +ok {test-number} - s1.isOpen() for: true +# Tracker +ok {test-number} - s2.isOpen() for: true +# Tracker +ok {test-number} - s2.isComplete() for: true +# Tracker +ok {test-number} - s1.isComplete() == false for: false == false +# Tracker +ok {test-number} - s1.isComplete() for: true +# Tracker +ok {test-number} - testCase.isComplete() == false for: false == false +# Tracker +ok {test-number} - testCase.isComplete() for: true +# Trim strings +ok {test-number} - trim(std::string(no_whitespace)) == no_whitespace for: "There is no extra whitespace here" == "There is no extra whitespace here" +# Trim strings +ok {test-number} - trim(std::string(leading_whitespace)) == no_whitespace for: "There is no extra whitespace here" == "There is no extra whitespace here" +# Trim strings +ok {test-number} - trim(std::string(trailing_whitespace)) == no_whitespace for: "There is no extra whitespace here" == "There is no extra whitespace here" +# Trim strings +ok {test-number} - trim(std::string(whitespace_at_both_ends)) == no_whitespace for: "There is no extra whitespace here" == "There is no extra whitespace here" +# Trim strings +ok {test-number} - trim(StringRef(no_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here == There is no extra whitespace here +# Trim strings +ok {test-number} - trim(StringRef(leading_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here == There is no extra whitespace here +# Trim strings +ok {test-number} - trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace) for: There is no extra whitespace here == There is no extra whitespace here +# Trim strings +ok {test-number} - trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) for: There is no extra whitespace here == There is no extra whitespace here +# Unexpected exceptions can be translated +not ok {test-number} - unexpected exception with message: '3.14' +# Upcasting special member functions +ok {test-number} - bptr->i == 3 for: 3 == 3 +# Upcasting special member functions +ok {test-number} - bptr->i == 3 for: 3 == 3 +# Usage of AllMatch range matcher +ok {test-number} - data, AllMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5 +# Usage of AllMatch range matcher +ok {test-number} - data, !AllMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) +# Usage of AllMatch range matcher +ok {test-number} - needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate +# Usage of AllMatch range matcher +ok {test-number} - mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of AllMatch range matcher +ok {test-number} - mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AllMatch range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AllMatch range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of AllMatch range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of AllTrue range matcher +ok {test-number} - data, AllTrue() for: { true, true, true, true, true } contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, AllTrue() for: { } contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { true, true, false, true, true } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { false, false, false, false, false } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, AllTrue() for: { true, true, true, true, true } contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { true, true, false, true, true } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - data, !AllTrue() for: { false, false, false, false, false } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - mocked, AllTrue() for: { true, true, true, true, true } contains only true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked, !AllTrue() for: { true, true, false, true, true } not contains only true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AllTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AllTrue range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of AllTrue range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of AnyMatch range matcher +ok {test-number} - data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 +# Usage of AnyMatch range matcher +ok {test-number} - data, !AnyMatch(Contains(0) && Contains(10)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) +# Usage of AnyMatch range matcher +ok {test-number} - needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate +# Usage of AnyMatch range matcher +ok {test-number} - mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate +# Usage of AnyMatch range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AnyMatch range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AnyMatch range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AnyMatch range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of AnyMatch range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of AnyMatch range matcher +ok {test-number} - mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate +# Usage of AnyMatch range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AnyMatch range matcher +ok {test-number} - !(mocked.m_derefed[1]) for: !false +# Usage of AnyMatch range matcher +ok {test-number} - !(mocked.m_derefed[2]) for: !false +# Usage of AnyMatch range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of AnyMatch range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { true, true, true, true, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, !AnyTrue() for: { } not contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { false, false, true, false, false } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { true, true, true, true, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, AnyTrue() for: { false, false, true, false, false } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - data, !AnyTrue() for: { false, false, false, false, false } not contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - mocked, AnyTrue() for: { false, false, false, false, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked, AnyTrue() for: { false, false, true, true, true } contains at least one true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of AnyTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of AnyTrue range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of AnyTrue range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of NoneMatch range matcher +ok {test-number} - data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 +# Usage of NoneMatch range matcher +ok {test-number} - data, !NoneMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) +# Usage of NoneMatch range matcher +ok {test-number} - needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate +# Usage of NoneMatch range matcher +ok {test-number} - mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate +# Usage of NoneMatch range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of NoneMatch range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of NoneMatch range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of NoneMatch range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of NoneMatch range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of NoneMatch range matcher +ok {test-number} - mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate +# Usage of NoneMatch range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of NoneMatch range matcher +ok {test-number} - !(mocked.m_derefed[1]) for: !false +# Usage of NoneMatch range matcher +ok {test-number} - !(mocked.m_derefed[2]) for: !false +# Usage of NoneMatch range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of NoneMatch range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { true, true, true, true, true } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, NoneTrue() for: { } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { false, false, true, false, false } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, NoneTrue() for: { false, false, false, false, false } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { true, true, true, true, true } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, !NoneTrue() for: { false, false, true, false, false } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - data, NoneTrue() for: { false, false, false, false, false } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - mocked, NoneTrue() for: { false, false, false, false, false } contains no true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[3] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[4] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked, !NoneTrue() for: { false, false, true, true, true } not contains no true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[0] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[1] for: true +# Usage of NoneTrue range matcher +ok {test-number} - mocked.m_derefed[2] for: true +# Usage of NoneTrue range matcher +ok {test-number} - !(mocked.m_derefed[3]) for: !false +# Usage of NoneTrue range matcher +ok {test-number} - !(mocked.m_derefed[4]) for: !false +# Usage of the SizeIs range matcher +ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0 +# Usage of the SizeIs range matcher +ok {test-number} - empty_vec, !SizeIs(2) for: { } not has size == 2 +# Usage of the SizeIs range matcher +ok {test-number} - empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2 +# Usage of the SizeIs range matcher +ok {test-number} - arr, SizeIs(2) for: { 0, 0 } has size == 2 +# Usage of the SizeIs range matcher +ok {test-number} - arr, SizeIs( Lt(3)) for: { 0, 0 } size matches is less than 3 +# Usage of the SizeIs range matcher +ok {test-number} - arr, !SizeIs(!Lt(3)) for: { 0, 0 } not size matches not is less than 3 +# Usage of the SizeIs range matcher +ok {test-number} - map, SizeIs(3) for: { {?}, {?}, {?} } has size == 3 +# Usage of the SizeIs range matcher +ok {test-number} - unrelated::ADL_size{}, SizeIs(12) for: {?} has size == 12 +# Usage of the SizeIs range matcher +ok {test-number} - has_size{}, SizeIs(13) for: {?} has size == 13 +# Use a custom approx +ok {test-number} - d == approx( 1.23 ) for: 1.23 == Approx( 1.23 ) +# Use a custom approx +ok {test-number} - d == approx( 1.22 ) for: 1.23 == Approx( 1.22 ) +# Use a custom approx +ok {test-number} - d == approx( 1.24 ) for: 1.23 == Approx( 1.24 ) +# Use a custom approx +ok {test-number} - d != approx( 1.25 ) for: 1.23 != Approx( 1.25 ) +# Use a custom approx +ok {test-number} - approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23 +# Use a custom approx +ok {test-number} - approx( d ) == 1.22 for: Approx( 1.23 ) == 1.22 +# Use a custom approx +ok {test-number} - approx( d ) == 1.24 for: Approx( 1.23 ) == 1.24 +# Use a custom approx +ok {test-number} - approx( d ) != 1.25 for: Approx( 1.23 ) != 1.25 +# Variadic macros +ok {test-number} - with 1 message: 'no assertions' +# Vector Approx matcher +ok {test-number} - empty, Approx( empty ) for: { } is approx: { } +# Vector Approx matcher +ok {test-number} - v1, Approx( v1 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } +# Vector Approx matcher +ok {test-number} - v1, Approx<double>( { 1., 2., 3. } ) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } +# Vector Approx matcher +ok {test-number} - v1, !Approx( temp ) for: { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } +# Vector Approx matcher +ok {test-number} - v1, !Approx( v2 ) for: { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } +# Vector Approx matcher +ok {test-number} - v1, Approx( v2 ).margin( 0.5 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +# Vector Approx matcher +ok {test-number} - v1, Approx( v2 ).epsilon( 0.5 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +# Vector Approx matcher +ok {test-number} - v1, Approx( v2 ).epsilon( 0.1 ).scale( 500 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +# Vector Approx matcher -- failing +not ok {test-number} - empty, Approx( t1 ) for: { } is approx: { 1.0, 2.0 } +# Vector Approx matcher -- failing +not ok {test-number} - v1, Approx( v2 ) for: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } +# Vector matchers +ok {test-number} - v, VectorContains( 1 ) for: { 1, 2, 3 } Contains: 1 +# Vector matchers +ok {test-number} - v, VectorContains( 2 ) for: { 1, 2, 3 } Contains: 2 +# Vector matchers +ok {test-number} - v5, ( VectorContains<int, CustomAllocator<int>>( 2 ) ) for: { 1, 2, 3 } Contains: 2 +# Vector matchers +ok {test-number} - v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2 } +# Vector matchers +ok {test-number} - v, Contains<int>( { 1, 2 } ) for: { 1, 2, 3 } Contains: { 1, 2 } +# Vector matchers +ok {test-number} - v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Contains: { 1, 2 } +# Vector matchers +ok {test-number} - v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v, Contains( empty ) for: { 1, 2, 3 } Contains: { } +# Vector matchers +ok {test-number} - empty, Contains( empty ) for: { } Contains: { } +# Vector matchers +ok {test-number} - v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Contains: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v5, Contains( v6 ) for: { 1, 2, 3 } Contains: { 1, 2 } +# Vector matchers +ok {test-number} - v, VectorContains( 1 ) && VectorContains( 2 ) for: { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) +# Vector matchers +ok {test-number} - v, Equals( v ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - empty, Equals( empty ) for: { } Equals: { } +# Vector matchers +ok {test-number} - v, Equals<int>( { 1, 2, 3 } ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v, Equals( v2 ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v5, Equals( v6 ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v, UnorderedEquals( v ) for: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v, UnorderedEquals<int>( { 3, 2, 1 } ) for: { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } +# Vector matchers +ok {test-number} - empty, UnorderedEquals( empty ) for: { } UnorderedEquals: { } +# Vector matchers +ok {test-number} - permuted, UnorderedEquals( v ) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - permuted, UnorderedEquals( v ) for: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } +# Vector matchers +ok {test-number} - v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) for: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } +# Vector matchers +ok {test-number} - v5_permuted, UnorderedEquals( v5 ) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } +# Vector matchers that fail +not ok {test-number} - v, VectorContains( -1 ) for: { 1, 2, 3 } Contains: -1 +# Vector matchers that fail +not ok {test-number} - empty, VectorContains( 1 ) for: { } Contains: 1 +# Vector matchers that fail +not ok {test-number} - empty, Contains( v ) for: { } Contains: { 1, 2, 3 } +# Vector matchers that fail +not ok {test-number} - v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2, 4 } +# Vector matchers that fail +not ok {test-number} - v, Equals( v2 ) for: { 1, 2, 3 } Equals: { 1, 2 } +# Vector matchers that fail +not ok {test-number} - v2, Equals( v ) for: { 1, 2 } Equals: { 1, 2, 3 } +# Vector matchers that fail +not ok {test-number} - empty, Equals( v ) for: { } Equals: { 1, 2, 3 } +# Vector matchers that fail +not ok {test-number} - v, Equals( empty ) for: { 1, 2, 3 } Equals: { } +# Vector matchers that fail +not ok {test-number} - v, UnorderedEquals( empty ) for: { 1, 2, 3 } UnorderedEquals: { } +# Vector matchers that fail +not ok {test-number} - empty, UnorderedEquals( v ) for: { } UnorderedEquals: { 1, 2, 3 } +# Vector matchers that fail +not ok {test-number} - permuted, UnorderedEquals( v ) for: { 1, 3 } UnorderedEquals: { 1, 2, 3 } +# Vector matchers that fail +not ok {test-number} - permuted, UnorderedEquals( v ) for: { 3, 1 } UnorderedEquals: { 1, 2, 3 } +# When checked exceptions are thrown they can be expected or unexpected +ok {test-number} - thisThrows(), std::domain_error +# When checked exceptions are thrown they can be expected or unexpected +ok {test-number} - thisDoesntThrow() +# When checked exceptions are thrown they can be expected or unexpected +ok {test-number} - thisThrows() +# When unchecked exceptions are thrown directly they are always failures +not ok {test-number} - unexpected exception with message: 'unexpected exception' +# When unchecked exceptions are thrown during a CHECK the test should continue +not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows() == 0 +# When unchecked exceptions are thrown during a REQUIRE the test should abort fail +not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows() == 0 +# When unchecked exceptions are thrown from functions they are always failures +not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows() == 0 +# When unchecked exceptions are thrown from sections they are always failures +not ok {test-number} - unexpected exception with message: 'unexpected exception' +# X/level/0/a +ok {test-number} - +# X/level/0/b +ok {test-number} - +# X/level/1/a +ok {test-number} - +# X/level/1/b +ok {test-number} - +# XmlEncode +ok {test-number} - encode( "normal string" ) == "normal string" for: "normal string" == "normal string" +# XmlEncode +ok {test-number} - encode( "" ) == "" for: "" == "" +# XmlEncode +ok {test-number} - encode( "smith & jones" ) == "smith & jones" for: "smith & jones" == "smith & jones" +# XmlEncode +ok {test-number} - encode( "smith < jones" ) == "smith < jones" for: "smith < jones" == "smith < jones" +# XmlEncode +ok {test-number} - encode( "smith > jones" ) == "smith > jones" for: "smith > jones" == "smith > jones" +# XmlEncode +ok {test-number} - encode( "smith ]]> jones" ) == "smith ]]> jones" for: "smith ]]> jones" == "smith ]]> jones" +# XmlEncode +ok {test-number} - encode( stringWithQuotes ) == stringWithQuotes for: "don't "quote" me on that" == "don't "quote" me on that" +# XmlEncode +ok {test-number} - encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't "quote" me on that" for: "don't "quote" me on that" == "don't "quote" me on that" +# XmlEncode +ok {test-number} - encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" +# XmlEncode +ok {test-number} - encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" +# XmlWriter writes boolean attributes as true/false +ok {test-number} - stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> <Element1 attr1="true" attr2="false"/> " ( contains: "attr1="true"" and contains: "attr2="false"" ) +# analyse no analysis +ok {test-number} - analysis.mean.point.count() == 23 for: 23.0 == 23 +# analyse no analysis +ok {test-number} - analysis.mean.lower_bound.count() == 23 for: 23.0 == 23 +# analyse no analysis +ok {test-number} - analysis.mean.upper_bound.count() == 23 for: 23.0 == 23 +# analyse no analysis +ok {test-number} - analysis.standard_deviation.point.count() == 0 for: 0.0 == 0 +# analyse no analysis +ok {test-number} - analysis.standard_deviation.lower_bound.count() == 0 for: 0.0 == 0 +# analyse no analysis +ok {test-number} - analysis.standard_deviation.upper_bound.count() == 0 for: 0.0 == 0 +# analyse no analysis +ok {test-number} - analysis.outliers.total() == 0 for: 0 == 0 +# analyse no analysis +ok {test-number} - analysis.outliers.low_mild == 0 for: 0 == 0 +# analyse no analysis +ok {test-number} - analysis.outliers.low_severe == 0 for: 0 == 0 +# analyse no analysis +ok {test-number} - analysis.outliers.high_mild == 0 for: 0 == 0 +# analyse no analysis +ok {test-number} - analysis.outliers.high_severe == 0 for: 0 == 0 +# analyse no analysis +ok {test-number} - analysis.outliers.samples_seen == 0 for: 0 == 0 +# analyse no analysis +ok {test-number} - analysis.outlier_variance == 0 for: 0.0 == 0 +# array<int, N> -> toString +ok {test-number} - Catch::Detail::stringify( empty ) == "{ }" for: "{ }" == "{ }" +# array<int, N> -> toString +ok {test-number} - Catch::Detail::stringify( oneValue ) == "{ 42 }" for: "{ 42 }" == "{ 42 }" +# array<int, N> -> toString +ok {test-number} - Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" +# benchmark function call +ok {test-number} - model.started == 1 for: 1 == 1 +# benchmark function call +ok {test-number} - model.finished == 0 for: 0 == 0 +# benchmark function call +ok {test-number} - model.started == 1 for: 1 == 1 +# benchmark function call +ok {test-number} - model.finished == 1 for: 1 == 1 +# benchmark function call +ok {test-number} - called == 1 for: 1 == 1 +# benchmark function call +ok {test-number} - model.started == 0 for: 0 == 0 +# benchmark function call +ok {test-number} - model.finished == 0 for: 0 == 0 +# benchmark function call +ok {test-number} - model.started == 0 for: 0 == 0 +# benchmark function call +ok {test-number} - model.finished == 0 for: 0 == 0 +# benchmark function call +ok {test-number} - called == 1 for: 1 == 1 +# boolean member +ok {test-number} - obj.prop != 0 for: 0x<hex digits> != 0 +# checkedElse +ok {test-number} - flag for: true +# checkedElse +ok {test-number} - testCheckedElse( true ) for: true +# checkedElse, failing +ok {test-number} - flag for: false # TODO +# checkedElse, failing +not ok {test-number} - testCheckedElse( false ) for: false +# checkedIf +ok {test-number} - flag for: true +# checkedIf +ok {test-number} - testCheckedIf( true ) for: true +# checkedIf, failing +ok {test-number} - flag for: false # TODO +# checkedIf, failing +not ok {test-number} - testCheckedIf( false ) for: false +# classify_outliers +ok {test-number} - o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +# classify_outliers +ok {test-number} - o.low_severe == los for: 0 == 0 +# classify_outliers +ok {test-number} - o.low_mild == lom for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_mild == him for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_severe == his for: 0 == 0 +# classify_outliers +ok {test-number} - o.total() == los + lom + him + his for: 0 == 0 +# classify_outliers +ok {test-number} - o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +# classify_outliers +ok {test-number} - o.low_severe == los for: 1 == 1 +# classify_outliers +ok {test-number} - o.low_mild == lom for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_mild == him for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_severe == his for: 0 == 0 +# classify_outliers +ok {test-number} - o.total() == los + lom + him + his for: 1 == 1 +# classify_outliers +ok {test-number} - o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +# classify_outliers +ok {test-number} - o.low_severe == los for: 0 == 0 +# classify_outliers +ok {test-number} - o.low_mild == lom for: 1 == 1 +# classify_outliers +ok {test-number} - o.high_mild == him for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_severe == his for: 0 == 0 +# classify_outliers +ok {test-number} - o.total() == los + lom + him + his for: 1 == 1 +# classify_outliers +ok {test-number} - o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +# classify_outliers +ok {test-number} - o.low_severe == los for: 0 == 0 +# classify_outliers +ok {test-number} - o.low_mild == lom for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_mild == him for: 1 == 1 +# classify_outliers +ok {test-number} - o.high_severe == his for: 0 == 0 +# classify_outliers +ok {test-number} - o.total() == los + lom + him + his for: 1 == 1 +# classify_outliers +ok {test-number} - o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +# classify_outliers +ok {test-number} - o.low_severe == los for: 0 == 0 +# classify_outliers +ok {test-number} - o.low_mild == lom for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_mild == him for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_severe == his for: 1 == 1 +# classify_outliers +ok {test-number} - o.total() == los + lom + him + his for: 1 == 1 +# classify_outliers +ok {test-number} - o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 +# classify_outliers +ok {test-number} - o.low_severe == los for: 1 == 1 +# classify_outliers +ok {test-number} - o.low_mild == lom for: 0 == 0 +# classify_outliers +ok {test-number} - o.high_mild == him for: 1 == 1 +# classify_outliers +ok {test-number} - o.high_severe == his for: 0 == 0 +# classify_outliers +ok {test-number} - o.total() == los + lom + him + his for: 2 == 2 +# comparisons between const int variables +ok {test-number} - unsigned_char_var == 1 for: 1 == 1 +# comparisons between const int variables +ok {test-number} - unsigned_short_var == 1 for: 1 == 1 +# comparisons between const int variables +ok {test-number} - unsigned_int_var == 1 for: 1 == 1 +# comparisons between const int variables +ok {test-number} - unsigned_long_var == 1 for: 1 == 1 +# comparisons between int variables +ok {test-number} - long_var == unsigned_char_var for: 1 == 1 +# comparisons between int variables +ok {test-number} - long_var == unsigned_short_var for: 1 == 1 +# comparisons between int variables +ok {test-number} - long_var == unsigned_int_var for: 1 == 1 +# comparisons between int variables +ok {test-number} - long_var == unsigned_long_var for: 1 == 1 +# convertToBits +ok {test-number} - convertToBits( 0.f ) == 0 for: 0 == 0 +# convertToBits +ok {test-number} - convertToBits( -0.f ) == ( 1ULL << 31 ) for: 2147483648 (0x<hex digits>) == 2147483648 (0x<hex digits>) +# convertToBits +ok {test-number} - convertToBits( 0. ) == 0 for: 0 == 0 +# convertToBits +ok {test-number} - convertToBits( -0. ) == ( 1ULL << 63 ) for: 9223372036854775808 (0x<hex digits>) == 9223372036854775808 (0x<hex digits>) +# convertToBits +ok {test-number} - convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 for: 1 == 1 +# convertToBits +ok {test-number} - convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 for: 1 == 1 +# empty tags are not allowed +ok {test-number} - Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) +# erfc_inv +ok {test-number} - erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.0920368762 == Approx( -0.0920368762 ) +# erfc_inv +ok {test-number} - erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.0598029112 == Approx( -0.0598029112 ) +# erfc_inv +ok {test-number} - erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.3859038243 == Approx( 1.3859038243 ) +# estimate_clock_resolution +ok {test-number} - res.mean.count() == rate for: 2000.0 == 2000 (0x<hex digits>) +# estimate_clock_resolution +ok {test-number} - res.outliers.total() == 0 for: 0 == 0 +# even more nested SECTION tests +ok {test-number} - +# even more nested SECTION tests +ok {test-number} - +# even more nested SECTION tests +ok {test-number} - +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value' +# is_unary_function +ok {test-number} - with 1 message: 'Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<int>::value)' +# is_unary_function +ok {test-number} - with 1 message: '!(Catch::Clara::Detail::is_unary_function<std::string const&>::value)' +# just failure +not ok {test-number} - explicitly with 1 message: 'Previous info should not be seen' +# just failure after unscoped info +not ok {test-number} - explicitly with 1 message: 'previous unscoped info SHOULD not be seen' +# long long +ok {test-number} - l == std::numeric_limits<long long>::max() for: 9223372036854775807 (0x<hex digits>) == 9223372036854775807 (0x<hex digits>) +# looped SECTION tests +not ok {test-number} - b > a for: 0 > 1 +# looped SECTION tests +not ok {test-number} - b > a for: 1 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 2 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 3 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 4 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 5 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 6 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 7 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 8 > 1 +# looped SECTION tests +ok {test-number} - b > a for: 9 > 1 +# looped tests +not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[0] (1) is even' +# looped tests +not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[1] (1) is even' +# looped tests +ok {test-number} - ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[2] (2) is even' +# looped tests +not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[3] (3) is even' +# looped tests +not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[4] (5) is even' +# looped tests +ok {test-number} - ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[5] (8) is even' +# looped tests +not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even' +# looped tests +not ok {test-number} - ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even' +# makeStream recognizes %debug stream name +ok {test-number} - Catch::makeStream( "%debug" ) +# make_unique reimplementation +ok {test-number} - !(lval.has_moved) for: !false +# make_unique reimplementation +ok {test-number} - rval.has_moved for: true +# make_unique reimplementation +ok {test-number} - *ptr == std::tuple<int, double, int>{1, 2., 3} for: {?} == {?} +# mean +ok {test-number} - m == 19. for: 19.0 == 19.0 +# measure +ok {test-number} - x == 17 for: 17 == 17 +# measure +ok {test-number} - x == 23 for: 23 == 23 +# measure +ok {test-number} - r.elapsed.count() == 42 for: 42 == 42 +# measure +ok {test-number} - r.result == 23 for: 23 == 23 +# measure +ok {test-number} - r.iterations == 1 for: 1 == 1 +# measure +ok {test-number} - s.elapsed.count() == 69 for: 69 == 69 +# measure +ok {test-number} - s.result == 17 for: 17 == 17 +# measure +ok {test-number} - s.iterations == 1 for: 1 == 1 +# mix info, unscoped info and warning +warning {test-number} - 'info' with 2 messages: 'unscoped info' and 'and warn may mix' +# mix info, unscoped info and warning +warning {test-number} - 'info' with 2 messages: 'unscoped info' and 'they are not cleared after warnings' +# more nested SECTION tests +not ok {test-number} - a == b for: 1 == 2 +# more nested SECTION tests +ok {test-number} - a != b for: 1 != 2 +# more nested SECTION tests +ok {test-number} - a < b for: 1 < 2 +# nested SECTION tests +ok {test-number} - a != b for: 1 != 2 +# nested SECTION tests +ok {test-number} - b != a for: 2 != 1 +# nested SECTION tests +ok {test-number} - a != b for: 1 != 2 +# non streamable - with conv. op +ok {test-number} - s == "7" for: "7" == "7" +# non-copyable objects +ok {test-number} - ti == typeid(int) for: {?} == {?} +# normal_cdf +ok {test-number} - normal_cdf(0.000000) == Approx(0.50000000000000000) for: 0.5 == Approx( 0.5 ) +# normal_cdf +ok {test-number} - normal_cdf(1.000000) == Approx(0.84134474606854293) for: 0.8413447461 == Approx( 0.8413447461 ) +# normal_cdf +ok {test-number} - normal_cdf(-1.000000) == Approx(0.15865525393145705) for: 0.1586552539 == Approx( 0.1586552539 ) +# normal_cdf +ok {test-number} - normal_cdf(2.809729) == Approx(0.99752083845315409) for: 0.9975208385 == Approx( 0.9975208385 ) +# normal_cdf +ok {test-number} - normal_cdf(-1.352570) == Approx(0.08809652095066035) for: 0.088096521 == Approx( 0.088096521 ) +# normal_quantile +ok {test-number} - normal_quantile(0.551780) == Approx(0.13015979861484198) for: 0.1301597986 == Approx( 0.1301597986 ) +# normal_quantile +ok {test-number} - normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.084574088 == Approx( 0.084574088 ) +# normal_quantile +ok {test-number} - normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.9599639845 == Approx( -1.9599639845 ) +# not allowed +ok {test-number} - +# not prints unscoped info from previous failures +ok {test-number} - true with 1 message: 'this MAY be seen only for the FIRST assertion IF info is printed for passing assertions' +# not prints unscoped info from previous failures +ok {test-number} - true with 1 message: 'this MAY be seen only for the SECOND assertion IF info is printed for passing assertions' +# not prints unscoped info from previous failures +not ok {test-number} - false with 1 message: 'this SHOULD be seen' +# null strings +ok {test-number} - makeString( false ) != static_cast<char*>(0) for: "valid string" != {null string} +# null strings +ok {test-number} - makeString( true ) == static_cast<char*>(0) for: {null string} == {null string} +# null_ptr +ok {test-number} - ptr.get() == 0 for: 0 == 0 +# pair<pair<int,const char *,pair<std::string,int> > -> toString +ok {test-number} - ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }" == "{ { 42, "Arthur" }, { "Ford", 24 } }" +# parseEnums +ok {test-number} - parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) for: { } Equals: { } +# parseEnums +ok {test-number} - parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 } +# parseEnums +ok {test-number} - parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 } +# parseEnums +ok {test-number} - parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 } +# parseEnums +ok {test-number} - parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) for: { Value1, Value2 } Equals: { Value1, Value2 } +# parseEnums +ok {test-number} - 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 } +# parseEnums +ok {test-number} - 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 } +# pointer to class +ok {test-number} - p == 0 for: 0 == 0 +# print unscoped info if passing unscoped info is printed +ok {test-number} - true with 1 message: 'this MAY be seen IF info is printed for passing assertions' +# prints unscoped info on failure +not ok {test-number} - false with 2 messages: 'this SHOULD be seen' and 'this SHOULD also be seen' +# prints unscoped info only for the first assertion +not ok {test-number} - false with 1 message: 'this SHOULD be seen only ONCE' +# prints unscoped info only for the first assertion +ok {test-number} - true +# prints unscoped info only for the first assertion +ok {test-number} - true with 1 message: 'this MAY also be seen only ONCE IF info is printed for passing assertions' +# prints unscoped info only for the first assertion +ok {test-number} - true +# random SECTION tests +ok {test-number} - a != b for: 1 != 2 +# random SECTION tests +ok {test-number} - b != a for: 2 != 1 +# random SECTION tests +ok {test-number} - a != b for: 1 != 2 +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(letters, "b", "z") for: true +# replaceInPlace +ok {test-number} - letters == "azcdefcg" for: "azcdefcg" == "azcdefcg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(letters, "c", "z") for: true +# replaceInPlace +ok {test-number} - letters == "abzdefzg" for: "abzdefzg" == "abzdefzg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(letters, "a", "z") for: true +# replaceInPlace +ok {test-number} - letters == "zbcdefcg" for: "zbcdefcg" == "zbcdefcg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(letters, "g", "z") for: true +# replaceInPlace +ok {test-number} - letters == "abcdefcz" for: "abcdefcz" == "abcdefcz" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(letters, letters, "replaced") for: true +# replaceInPlace +ok {test-number} - letters == "replaced" for: "replaced" == "replaced" +# replaceInPlace +ok {test-number} - !(Catch::replaceInPlace(letters, "x", "z")) for: !false +# replaceInPlace +ok {test-number} - letters == letters for: "abcdefcg" == "abcdefcg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(s, "'", "|'") for: true +# replaceInPlace +ok {test-number} - s == "didn|'t" for: "didn|'t" == "didn|'t" +# request an unknown %-starting stream fails +ok {test-number} - Catch::makeStream( "%somestream" ) +# resolution +ok {test-number} - res.size() == count for: 10 == 10 +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# resolution +ok {test-number} - res[i] == rate for: 1000.0 == 1000 (0x<hex digits>) +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 1 >= 1 +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 2 >= 1 +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 4 >= 2 +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 8 >= 4 +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 16 >= 8 +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 32 >= 16 +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 64 >= 32 +# run_for_at_least, chronometer +ok {test-number} - meter.runs() >= old_runs for: 128 >= 64 +# run_for_at_least, chronometer +ok {test-number} - Timing.elapsed >= time for: 128 ns >= 100 ns +# run_for_at_least, chronometer +ok {test-number} - Timing.result == Timing.iterations + 17 for: 145 == 145 +# run_for_at_least, chronometer +ok {test-number} - Timing.iterations >= time.count() for: 128 >= 100 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 1 >= 1 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 2 >= 1 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 4 >= 2 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 8 >= 4 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 16 >= 8 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 32 >= 16 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 64 >= 32 +# run_for_at_least, int +ok {test-number} - x >= old_x for: 128 >= 64 +# run_for_at_least, int +ok {test-number} - Timing.elapsed >= time for: 128 ns >= 100 ns +# run_for_at_least, int +ok {test-number} - Timing.result == Timing.iterations + 17 for: 145 == 145 +# run_for_at_least, int +ok {test-number} - Timing.iterations >= time.count() for: 128 >= 100 +# send a single char to INFO +not ok {test-number} - false with 1 message: '3' +# sends information to INFO +not ok {test-number} - false with 2 messages: 'hi' and 'i := 7' +# shortened hide tags are split apart +ok {test-number} - testcase.tags, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} ) +# splitString +ok {test-number} - splitStringRef("", ','), Equals(std::vector<StringRef>()) for: { } Equals: { } +# splitString +ok {test-number} - splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}) for: { abc } Equals: { abc } +# splitString +ok {test-number} - splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}) for: { abc, def } Equals: { abc, def } +# stacks unscoped info in loops +not ok {test-number} - false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' +# stacks unscoped info in loops +not ok {test-number} - false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6' +# startsWith +ok {test-number} - !(startsWith("", 'c')) for: !false +# startsWith +ok {test-number} - startsWith(std::string("abc"), 'a') for: true +# startsWith +ok {test-number} - startsWith("def"_catch_sr, 'd') for: true +# std::map is convertible string +ok {test-number} - Catch::Detail::stringify( emptyMap ) == "{ }" for: "{ }" == "{ }" +# std::map is convertible string +ok {test-number} - Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }" +# std::map is convertible string +ok {test-number} - Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" == "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" +# std::pair<int,const std::string> -> toString +ok {test-number} - ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" +# std::pair<int,std::string> -> toString +ok {test-number} - ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" for: "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" +# std::set is convertible string +ok {test-number} - Catch::Detail::stringify( emptySet ) == "{ }" for: "{ }" == "{ }" +# std::set is convertible string +ok {test-number} - Catch::Detail::stringify( set ) == "{ \"one\" }" for: "{ "one" }" == "{ "one" }" +# std::set is convertible string +ok {test-number} - Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" for: "{ "abc", "def", "ghi" }" == "{ "abc", "def", "ghi" }" +# std::vector<std::pair<std::string,int> > -> toString +ok {test-number} - ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" for: "{ { "green", 55 } }" == "{ { "green", 55 } }" +# stdout and stderr streams have %-starting name +ok {test-number} - Catch::makeStream( "%stderr" )->isConsole() for: true +# stdout and stderr streams have %-starting name +ok {test-number} - Catch::makeStream( "%stdout" )->isConsole() for: true +# stringify ranges +ok {test-number} - ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" for: "op<<(streamable_range)" == "op<<(streamable_range)" +# stringify ranges +ok {test-number} - ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" for: "stringmaker(streamable_range)" == "stringmaker(streamable_range)" +# stringify ranges +ok {test-number} - ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" for: "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" +# stringify ranges +ok {test-number} - ::Catch::Detail::stringify(disabled_range{}) == "{?}" for: "{?}" == "{?}" +# stringify( has_maker ) +ok {test-number} - ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" for: "StringMaker<has_maker>" == "StringMaker<has_maker>" +# stringify( has_maker_and_operator ) +ok {test-number} - ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" for: "StringMaker<has_maker_and_operator>" == "StringMaker<has_maker_and_operator>" +# stringify( has_neither ) +ok {test-number} - ::Catch::Detail::stringify(item) == "{?}" for: "{?}" == "{?}" +# stringify( has_operator ) +ok {test-number} - ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" for: "operator<<( has_operator )" == "operator<<( has_operator )" +# stringify( has_template_operator ) +ok {test-number} - ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" for: "operator<<( has_template_operator )" == "operator<<( has_template_operator )" +# stringify( vectors<has_maker> ) +ok {test-number} - ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" for: "{ StringMaker<has_maker> }" == "{ StringMaker<has_maker> }" +# stringify( vectors<has_maker_and_operator> ) +ok {test-number} - ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" for: "{ StringMaker<has_maker_and_operator> }" == "{ StringMaker<has_maker_and_operator> }" +# stringify( vectors<has_operator> ) +ok {test-number} - ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" for: "{ operator<<( has_operator ) }" == "{ operator<<( has_operator ) }" +# strlen3 +ok {test-number} - data.str.size() == data.len for: 3 == 3 +# strlen3 +ok {test-number} - data.str.size() == data.len for: 3 == 3 +# strlen3 +ok {test-number} - data.str.size() == data.len for: 5 == 5 +# strlen3 +ok {test-number} - data.str.size() == data.len for: 4 == 4 +# tables +ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5 +# tables +ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6 +# tables +ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5 +# tables +ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6 +# tags with dots in later positions are not parsed as hidden +ok {test-number} - testcase.tags.size() == 1 for: 1 == 1 +# tags with dots in later positions are not parsed as hidden +ok {test-number} - testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag +# thrown std::strings are translated +not ok {test-number} - unexpected exception with message: 'Why would you throw a std::string?' +# toString on const wchar_t const pointer returns the string contents +ok {test-number} - result == "\"wide load\"" for: ""wide load"" == ""wide load"" +# toString on const wchar_t pointer returns the string contents +ok {test-number} - result == "\"wide load\"" for: ""wide load"" == ""wide load"" +# toString on wchar_t const pointer returns the string contents +ok {test-number} - result == "\"wide load\"" for: ""wide load"" == ""wide load"" +# toString on wchar_t returns the string contents +ok {test-number} - result == "\"wide load\"" for: ""wide load"" == ""wide load"" +# toString(enum class w/operator<<) +ok {test-number} - ::Catch::Detail::stringify(e0) == "E2/V0" for: "E2/V0" == "E2/V0" +# toString(enum class w/operator<<) +ok {test-number} - ::Catch::Detail::stringify(e1) == "E2/V1" for: "E2/V1" == "E2/V1" +# toString(enum class w/operator<<) +ok {test-number} - ::Catch::Detail::stringify(e3) == "Unknown enum value 10" for: "Unknown enum value 10" == "Unknown enum value 10" +# toString(enum class) +ok {test-number} - ::Catch::Detail::stringify(e0) == "0" for: "0" == "0" +# toString(enum class) +ok {test-number} - ::Catch::Detail::stringify(e1) == "1" for: "1" == "1" +# toString(enum w/operator<<) +ok {test-number} - ::Catch::Detail::stringify(e0) == "E2{0}" for: "E2{0}" == "E2{0}" +# toString(enum w/operator<<) +ok {test-number} - ::Catch::Detail::stringify(e1) == "E2{1}" for: "E2{1}" == "E2{1}" +# toString(enum) +ok {test-number} - ::Catch::Detail::stringify(e0) == "0" for: "0" == "0" +# toString(enum) +ok {test-number} - ::Catch::Detail::stringify(e1) == "1" for: "1" == "1" +# tuple<> +ok {test-number} - "{ }" == ::Catch::Detail::stringify(type{}) for: "{ }" == "{ }" +# tuple<> +ok {test-number} - "{ }" == ::Catch::Detail::stringify(value) for: "{ }" == "{ }" +# tuple<float,int> +ok {test-number} - "1.2f" == ::Catch::Detail::stringify(float(1.2)) for: "1.2f" == "1.2f" +# tuple<float,int> +ok {test-number} - "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) for: "{ 1.2f, 0 }" == "{ 1.2f, 0 }" +# tuple<int> +ok {test-number} - "{ 0 }" == ::Catch::Detail::stringify(type{0}) for: "{ 0 }" == "{ 0 }" +# tuple<string,string> +ok {test-number} - "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) for: "{ "hello", "world" }" == "{ "hello", "world" }" +# tuple<tuple<int>,tuple<>,float> +ok {test-number} - "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.2f }" == "{ { 42 }, { }, 1.2f }" +# uniform samples +ok {test-number} - e.point == 23 for: 23.0 == 23 +# uniform samples +ok {test-number} - e.upper_bound == 23 for: 23.0 == 23 +# uniform samples +ok {test-number} - e.lower_bound == 23 for: 23.0 == 23 +# uniform samples +ok {test-number} - e.confidence_interval == 0.95 for: 0.95 == 0.95 +# unique_ptr reimplementation: basic functionality +ok {test-number} - !(ptr) for: !{?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr.get() == 0 for: 0 == 0 +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr for: {?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - *ptr == 0 for: 0 == 0 +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr.get() == naked_ptr for: 0x<hex digits> == 0x<hex digits> +# unique_ptr reimplementation: basic functionality +ok {test-number} - !(ptr) for: !{?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr.get() == 0 for: 0 == 0 +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr for: {?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - *ptr == 0 for: 0 == 0 +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr.get() == naked_ptr for: 0x<hex digits> == 0x<hex digits> +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr for: {?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr.get() != 0 for: 0x<hex digits> != 0 +# unique_ptr reimplementation: basic functionality +ok {test-number} - *ptr == 2 for: 2 == 2 +# unique_ptr reimplementation: basic functionality +ok {test-number} - !(ptr) for: !{?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr.get() == 0 for: 0 == 0 +# unique_ptr reimplementation: basic functionality +ok {test-number} - !(ptr1) for: !{?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr2 for: {?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - *ptr2 == 1 for: 1 == 1 +# unique_ptr reimplementation: basic functionality +ok {test-number} - !(ptr2) for: !{?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - ptr1 for: {?} +# unique_ptr reimplementation: basic functionality +ok {test-number} - *ptr1 == 2 for: 2 == 2 +# unique_ptr reimplementation: basic functionality +ok {test-number} - *ptr1 == 2 for: 2 == 2 +# unique_ptr reimplementation: basic functionality +ok {test-number} - *ptr2 == 1 for: 1 == 1 +# vec<vec<string,alloc>> -> toString +ok {test-number} - ::Catch::Detail::stringify(v) == "{ }" for: "{ }" == "{ }" +# vec<vec<string,alloc>> -> toString +ok {test-number} - ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" for: "{ { "hello" }, { "world" } }" == "{ { "hello" }, { "world" } }" +# vector<bool> -> toString +ok {test-number} - ::Catch::Detail::stringify(bools) == "{ }" for: "{ }" == "{ }" +# vector<bool> -> toString +ok {test-number} - ::Catch::Detail::stringify(bools) == "{ true }" for: "{ true }" == "{ true }" +# vector<bool> -> toString +ok {test-number} - ::Catch::Detail::stringify(bools) == "{ true, false }" for: "{ true, false }" == "{ true, false }" +# vector<int,allocator> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }" +# vector<int,allocator> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ 42 }" for: "{ 42 }" == "{ 42 }" +# vector<int,allocator> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" +# vector<int> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }" +# vector<int> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ 42 }" for: "{ 42 }" == "{ 42 }" +# vector<int> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" +# vector<string> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ }" for: "{ }" == "{ }" +# vector<string> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ \"hello\" }" for: "{ "hello" }" == "{ "hello" }" +# vector<string> -> toString +ok {test-number} - ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" for: "{ "hello", "world" }" == "{ "hello", "world" }" +# vectors can be sized and resized +ok {test-number} - v.size() == 5 for: 5 == 5 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# vectors can be sized and resized +ok {test-number} - v.size() == 10 for: 10 == 10 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# vectors can be sized and resized +ok {test-number} - v.size() == 5 for: 5 == 5 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# vectors can be sized and resized +ok {test-number} - v.size() == 0 for: 0 == 0 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# vectors can be sized and resized +ok {test-number} - v.capacity() == 0 for: 0 == 0 +# vectors can be sized and resized +ok {test-number} - v.size() == 5 for: 5 == 5 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# vectors can be sized and resized +ok {test-number} - v.size() == 5 for: 5 == 5 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 10 for: 10 >= 10 +# vectors can be sized and resized +ok {test-number} - v.size() == 5 for: 5 == 5 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# vectors can be sized and resized +ok {test-number} - v.size() == 5 for: 5 == 5 +# vectors can be sized and resized +ok {test-number} - v.capacity() >= 5 for: 5 >= 5 +# warmup +ok {test-number} - (iterations * rate) > Catch::Benchmark::Detail::warmup_time.count() for: 160000000 (0x<hex digits>) > 100 +# warmup +ok {test-number} - (end - start) > Catch::Benchmark::Detail::warmup_time for: 310016000 ns > 100 ms +# weighted_average_quantile +ok {test-number} - q1 == 14.5 for: 14.5 == 14.5 +# weighted_average_quantile +ok {test-number} - med == 18. for: 18.0 == 18.0 +# weighted_average_quantile +ok {test-number} - q3 == 23. for: 23.0 == 23.0 +# xmlentitycheck +ok {test-number} - +# xmlentitycheck +ok {test-number} - +1..2299 + diff --git a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt index 5291c85d2..526f00a90 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -1,8 +1,6 @@ ##teamcity[testSuiteStarted name='<exe-name>'] ##teamcity[testStarted name='# A test name that starts with a #'] ##teamcity[testFinished name='# A test name that starts with a #' duration="{duration}"] -##teamcity[testStarted name='#1005: Comparing pointer to int and long (NULL can be either on various systems)'] -##teamcity[testFinished name='#1005: Comparing pointer to int and long (NULL can be either on various systems)' duration="{duration}"] ##teamcity[testStarted name='#1027: Bitfields can be captured'] ##teamcity[testFinished name='#1027: Bitfields can be captured' duration="{duration}"] ##teamcity[testStarted name='#1147'] @@ -62,9 +60,9 @@ Exception.tests.cpp:<line number>|nunexpected exception with messages:|n "answe ##teamcity[testFinished name='#809' duration="{duration}"] ##teamcity[testStarted name='#833'] ##teamcity[testFinished name='#833' duration="{duration}"] -##teamcity[testStarted name='#835 -- errno should not be touched by Catch'] +##teamcity[testStarted name='#835 -- errno should not be touched by Catch2'] Misc.tests.cpp:<line number>|nexpression failed|n CHECK( f() == 0 )|nwith expansion:|n 1 == 0|n- failure ignore as test marked as |'ok to fail|'|n'] -##teamcity[testFinished name='#835 -- errno should not be touched by Catch' duration="{duration}"] +##teamcity[testFinished name='#835 -- errno should not be touched by Catch2' duration="{duration}"] ##teamcity[testStarted name='#872'] ##teamcity[testFinished name='#872' duration="{duration}"] ##teamcity[testStarted name='#961 -- Dynamically created sections should all be reported'] @@ -233,10 +231,18 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testFinished name='CAPTURE parses string and character constants' duration="{duration}"] ##teamcity[testStarted name='Capture and info messages'] ##teamcity[testFinished name='Capture and info messages' duration="{duration}"] +##teamcity[testStarted name='CaseInsensitiveEqualsTo is case insensitive'] +##teamcity[testFinished name='CaseInsensitiveEqualsTo is case insensitive' duration="{duration}"] +##teamcity[testStarted name='CaseInsensitiveLess is case insensitive'] +##teamcity[testFinished name='CaseInsensitiveLess is case insensitive' duration="{duration}"] ##teamcity[testStarted name='Character pretty printing'] ##teamcity[testFinished name='Character pretty printing' duration="{duration}"] ##teamcity[testStarted name='Clara::Arg supports single-arg parse the way Opt does'] ##teamcity[testFinished name='Clara::Arg supports single-arg parse the way Opt does' duration="{duration}"] +##teamcity[testStarted name='Clara::Opt supports accept-many lambdas'] +##teamcity[testFinished name='Clara::Opt supports accept-many lambdas' duration="{duration}"] +##teamcity[testStarted name='ColourGuard behaviour'] +##teamcity[testFinished name='ColourGuard behaviour' duration="{duration}"] ##teamcity[testStarted name='Combining MatchAllOfGeneric does not nest'] ##teamcity[testFinished name='Combining MatchAllOfGeneric does not nest' duration="{duration}"] ##teamcity[testStarted name='Combining MatchAnyOfGeneric does not nest'] @@ -270,11 +276,13 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testStarted name='Composed matchers shortcircuit'] ##teamcity[testFinished name='Composed matchers shortcircuit' duration="{duration}"] ##teamcity[testStarted name='Contains string matcher'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] ##teamcity[testFinished name='Contains string matcher' duration="{duration}"] ##teamcity[testStarted name='Copy and then generate a range'] ##teamcity[testFinished name='Copy and then generate a range' duration="{duration}"] +##teamcity[testStarted name='Cout stream properly declares it writes to stdout'] +##teamcity[testFinished name='Cout stream properly declares it writes to stdout' duration="{duration}"] ##teamcity[testStarted name='Custom exceptions can be translated when testing for nothrow'] Exception.tests.cpp:<line number>|nunexpected exception with message:|n "custom exception - not std"|n REQUIRE_NOTHROW( throwCustom() )|nwith expansion:|n throwCustom()|n'] ##teamcity[testFinished name='Custom exceptions can be translated when testing for nothrow' duration="{duration}"] @@ -288,6 +296,10 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "custom ##teamcity[testFinished name='Default scale is invisible to comparison' duration="{duration}"] ##teamcity[testStarted name='Directly creating an EnumInfo'] ##teamcity[testFinished name='Directly creating an EnumInfo' duration="{duration}"] +##teamcity[testStarted name='Empty stream name opens cout stream'] +##teamcity[testFinished name='Empty stream name opens cout stream' duration="{duration}"] +##teamcity[testStarted name='Empty tag is not allowed'] +##teamcity[testFinished name='Empty tag is not allowed' duration="{duration}"] ##teamcity[testStarted name='EndsWith string matcher'] Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "Substring"|n'] Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "this" (case insensitive)|n'] @@ -365,6 +377,14 @@ Message.tests.cpp:<line number>|nexplicit failure with message:|n "This is a fa ##teamcity[testFinished name='Generators internals' duration="{duration}"] ##teamcity[testStarted name='Greater-than inequalities with different epsilons'] ##teamcity[testFinished name='Greater-than inequalities with different epsilons' duration="{duration}"] +##teamcity[testStarted name='Hashers with different seed produce different hash with same test case'] +##teamcity[testFinished name='Hashers with different seed produce different hash with same test case' duration="{duration}"] +##teamcity[testStarted name='Hashers with same seed produce same hash'] +##teamcity[testFinished name='Hashers with same seed produce same hash' duration="{duration}"] +##teamcity[testStarted name='Hashing different test cases produces different result'] +##teamcity[testFinished name='Hashing different test cases produces different result' duration="{duration}"] +##teamcity[testStarted name='Hashing test case produces same hash across multiple calls'] +##teamcity[testFinished name='Hashing test case produces same hash across multiple calls' duration="{duration}"] ##teamcity[testStarted name='INFO and WARN do not abort tests'] ##teamcity[testFinished name='INFO and WARN do not abort tests' duration="{duration}"] ##teamcity[testStarted name='INFO gets logged on failure'] @@ -399,16 +419,26 @@ Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello.si ##teamcity[testStarted name='Matchers can be composed with both && and ||||'] ##teamcity[testFinished name='Matchers can be composed with both && and ||||' duration="{duration}"] ##teamcity[testStarted name='Matchers can be composed with both && and |||| - failing'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ( Contains( "string" ) |||| Contains( "different" ) ) && Contains( "random" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) |||| ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )|n'] ##teamcity[testFinished name='Matchers can be composed with both && and |||| - failing' duration="{duration}"] ##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator'] ##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator' duration="{duration}"] ##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator - failing'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), !Contains( "substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" not contains: "substring"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" not contains: "substring"|n'] ##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator - failing' duration="{duration}"] +##teamcity[testStarted name='Mayfail test case with nested sections'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Mayfail test case with nested sections' duration="{duration}"] ##teamcity[testStarted name='Mismatching exception messages failing the test'] Exception.tests.cpp:<line number>|nexpression failed|n REQUIRE_THROWS_WITH( thisThrows(), "should fail" )|nwith expansion:|n "expected exception" equals: "should fail"|n'] ##teamcity[testFinished name='Mismatching exception messages failing the test' duration="{duration}"] +##teamcity[testStarted name='Multireporter calls reporters and listeners in correct order'] +##teamcity[testFinished name='Multireporter calls reporters and listeners in correct order' duration="{duration}"] +##teamcity[testStarted name='Multireporter updates ReporterPreferences properly'] +##teamcity[testFinished name='Multireporter updates ReporterPreferences properly' duration="{duration}"] ##teamcity[testStarted name='Nested generators and captured variables'] ##teamcity[testFinished name='Nested generators and captured variables' duration="{duration}"] ##teamcity[testStarted name='Nice descriptive name'] @@ -453,6 +483,14 @@ Message.tests.cpp:<line number>|nexplicit failure with message:|n "Message from ##teamcity[testFinished name='Overloaded comma or address-of operators are not used' duration="{duration}"] ##teamcity[testStarted name='Parse test names and tags'] ##teamcity[testFinished name='Parse test names and tags' duration="{duration}"] +##teamcity[testStarted name='Parsed tags are matched case insensitive'] +##teamcity[testFinished name='Parsed tags are matched case insensitive' duration="{duration}"] +##teamcity[testStarted name='Parsing sharding-related cli flags'] +##teamcity[testFinished name='Parsing sharding-related cli flags' duration="{duration}"] +##teamcity[testStarted name='Parsing tags with non-alphabetical characters is pass-through'] +##teamcity[testFinished name='Parsing tags with non-alphabetical characters is pass-through' duration="{duration}"] +##teamcity[testStarted name='Parsing warnings'] +##teamcity[testFinished name='Parsing warnings' duration="{duration}"] ##teamcity[testStarted name='Pointers can be compared to null'] ##teamcity[testFinished name='Pointers can be compared to null' duration="{duration}"] ##teamcity[testStarted name='Precision of floating point stringification can be set'] @@ -467,6 +505,10 @@ Message.tests.cpp:<line number>|nexplicit failure with message:|n "Message from ##teamcity[testFinished name='Product with differing arities - std::tuple<int, double>' duration="{duration}"] ##teamcity[testStarted name='Product with differing arities - std::tuple<int>'] ##teamcity[testFinished name='Product with differing arities - std::tuple<int>' duration="{duration}"] +##teamcity[testStarted name='Random seed generation accepts known methods'] +##teamcity[testFinished name='Random seed generation accepts known methods' duration="{duration}"] +##teamcity[testStarted name='Random seed generation reports unknown methods'] +##teamcity[testFinished name='Random seed generation reports unknown methods' duration="{duration}"] ##teamcity[testStarted name='Range type with sentinel'] ##teamcity[testFinished name='Range type with sentinel' duration="{duration}"] ##teamcity[testStarted name='Reconstruction should be based on stringification: #914'] @@ -477,10 +519,14 @@ Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringFor Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "contains |'abc|' as a substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "contains |'abc|' as a substring" case sensitively|n'] Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "this string contains |'abc|' as a" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "this string contains |'abc|' as a" case sensitively|n'] ##teamcity[testFinished name='Regex string matcher' duration="{duration}"] +##teamcity[testStarted name='Registering reporter with |'::|' in name fails'] +##teamcity[testFinished name='Registering reporter with |'::|' in name fails' duration="{duration}"] ##teamcity[testStarted name='Regression test #1'] ##teamcity[testFinished name='Regression test #1' duration="{duration}"] ##teamcity[testStarted name='Reporter|'s write listings to provided stream'] ##teamcity[testFinished name='Reporter|'s write listings to provided stream' duration="{duration}"] +##teamcity[testStarted name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla'] +##teamcity[testFinished name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla' duration="{duration}"] ##teamcity[testStarted name='SUCCEED counts as a test pass'] ##teamcity[testFinished name='SUCCEED counts as a test pass' duration="{duration}"] ##teamcity[testStarted name='SUCCEED does not require an argument'] @@ -531,6 +577,8 @@ Misc.tests.cpp:<line number>|nexpression failed|n CHECK( s1 == s2 )|nwith expan ##teamcity[testFinished name='Tabs and newlines show in output' duration="{duration}"] ##teamcity[testStarted name='Tag alias can be registered against tag patterns'] ##teamcity[testFinished name='Tag alias can be registered against tag patterns' duration="{duration}"] +##teamcity[testStarted name='Tags with spaces and non-alphanumerical characters are accepted'] +##teamcity[testFinished name='Tags with spaces and non-alphanumerical characters are accepted' duration="{duration}"] ##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 0'] ##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 0' duration="{duration}"] ##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 1'] @@ -567,6 +615,8 @@ Misc.tests.cpp:<line number>|nexpression failed|n CHECK( s1 == s2 )|nwith expan ##teamcity[testFinished name='TemplateTestSig: vectors can be sized and resized - int,5' duration="{duration}"] ##teamcity[testStarted name='TemplateTestSig: vectors can be sized and resized - std::string,15'] ##teamcity[testFinished name='TemplateTestSig: vectors can be sized and resized - std::string,15' duration="{duration}"] +##teamcity[testStarted name='Test case with identical tags keeps just one'] +##teamcity[testFinished name='Test case with identical tags keeps just one' duration="{duration}"] ##teamcity[testStarted name='Test case with one argument'] ##teamcity[testFinished name='Test case with one argument' duration="{duration}"] ##teamcity[testStarted name='Test enum bit values'] @@ -601,10 +651,16 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "3.14"' ##teamcity[testFinished name='Upcasting special member functions' duration="{duration}"] ##teamcity[testStarted name='Usage of AllMatch range matcher'] ##teamcity[testFinished name='Usage of AllMatch range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of AllTrue range matcher'] +##teamcity[testFinished name='Usage of AllTrue range matcher' duration="{duration}"] ##teamcity[testStarted name='Usage of AnyMatch range matcher'] ##teamcity[testFinished name='Usage of AnyMatch range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of AnyTrue range matcher'] +##teamcity[testFinished name='Usage of AnyTrue range matcher' duration="{duration}"] ##teamcity[testStarted name='Usage of NoneMatch range matcher'] ##teamcity[testFinished name='Usage of NoneMatch range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of NoneTrue range matcher'] +##teamcity[testFinished name='Usage of NoneTrue range matcher' duration="{duration}"] ##teamcity[testStarted name='Usage of the SizeIs range matcher'] ##teamcity[testFinished name='Usage of the SizeIs range matcher' duration="{duration}"] ##teamcity[testStarted name='Use a custom approx'] @@ -652,10 +708,6 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testFinished name='When unchecked exceptions are thrown from sections they are always failures' duration="{duration}"] ##teamcity[testStarted name='When unchecked exceptions are thrown, but caught, they do not affect the test'] ##teamcity[testFinished name='When unchecked exceptions are thrown, but caught, they do not affect the test' duration="{duration}"] -##teamcity[testStarted name='Where the LHS is not a simple value'] -##teamcity[testFinished name='Where the LHS is not a simple value' duration="{duration}"] -##teamcity[testStarted name='Where there is more to the expression after the RHS'] -##teamcity[testFinished name='Where there is more to the expression after the RHS' duration="{duration}"] ##teamcity[testStarted name='X/level/0/a'] ##teamcity[testFinished name='X/level/0/a' duration="{duration}"] ##teamcity[testStarted name='X/level/0/b'] @@ -672,8 +724,6 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testFinished name='analyse no analysis' duration="{duration}"] ##teamcity[testStarted name='array<int, N> -> toString'] ##teamcity[testFinished name='array<int, N> -> toString' duration="{duration}"] -##teamcity[testStarted name='atomic if'] -##teamcity[testFinished name='atomic if' duration="{duration}"] ##teamcity[testStarted name='benchmark function call'] ##teamcity[testFinished name='benchmark function call' duration="{duration}"] ##teamcity[testStarted name='boolean member'] @@ -709,6 +759,8 @@ Misc.tests.cpp:<line number>|nexpression failed|n REQUIRE( testCheckedIf( false ##teamcity[testStarted name='has printf'] loose text artifact ##teamcity[testFinished name='has printf' duration="{duration}"] +##teamcity[testStarted name='is_unary_function'] +##teamcity[testFinished name='is_unary_function' duration="{duration}"] ##teamcity[testStarted name='just failure'] Message.tests.cpp:<line number>|nexplicit failure with message:|n "Previous info should not be seen"'] ##teamcity[testFinished name='just failure' duration="{duration}"] @@ -733,6 +785,8 @@ Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[6|] (13) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[7|] (21) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] ##teamcity[testFinished name='looped tests' duration="{duration}"] +##teamcity[testStarted name='makeStream recognizes %debug stream name'] +##teamcity[testFinished name='makeStream recognizes %debug stream name' duration="{duration}"] ##teamcity[testStarted name='make_unique reimplementation'] ##teamcity[testFinished name='make_unique reimplementation' duration="{duration}"] ##teamcity[testStarted name='mean'] @@ -781,6 +835,8 @@ Message.tests.cpp:<line number>|nexpression failed with message:|n "this SHOULD ##teamcity[testFinished name='random SECTION tests' duration="{duration}"] ##teamcity[testStarted name='replaceInPlace'] ##teamcity[testFinished name='replaceInPlace' duration="{duration}"] +##teamcity[testStarted name='request an unknown %-starting stream fails'] +##teamcity[testFinished name='request an unknown %-starting stream fails' duration="{duration}"] ##teamcity[testStarted name='resolution'] ##teamcity[testFinished name='resolution' duration="{duration}"] ##teamcity[testStarted name='run_for_at_least, chronometer'] @@ -803,6 +859,8 @@ Message.tests.cpp:<line number>|nexpression failed with messages:|n "hi"|n "i Message.tests.cpp:<line number>|nexpression failed with messages:|n "Count 1 to 3..."|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] Message.tests.cpp:<line number>|nexpression failed with messages:|n "Count 4 to 6..."|n "4"|n "5"|n "6"|n CHECK( false )|nwith expansion:|n false|n'] ##teamcity[testFinished name='stacks unscoped info in loops' duration="{duration}"] +##teamcity[testStarted name='startsWith'] +##teamcity[testFinished name='startsWith' duration="{duration}"] ##teamcity[testStarted name='std::map is convertible string'] ##teamcity[testFinished name='std::map is convertible string' duration="{duration}"] ##teamcity[testStarted name='std::pair<int,const std::string> -> toString'] @@ -813,9 +871,8 @@ Message.tests.cpp:<line number>|nexpression failed with messages:|n "Count 4 to ##teamcity[testFinished name='std::set is convertible string' duration="{duration}"] ##teamcity[testStarted name='std::vector<std::pair<std::string,int> > -> toString'] ##teamcity[testFinished name='std::vector<std::pair<std::string,int> > -> toString' duration="{duration}"] -##teamcity[testStarted name='string literals of different sizes can be compared'] -Tricky.tests.cpp:<line number>|nexpression failed|n REQUIRE( std::string( "first" ) == "second" )|nwith expansion:|n "first" == "second"|n'] -##teamcity[testFinished name='string literals of different sizes can be compared' duration="{duration}"] +##teamcity[testStarted name='stdout and stderr streams have %-starting name'] +##teamcity[testFinished name='stdout and stderr streams have %-starting name' duration="{duration}"] ##teamcity[testStarted name='stringify ranges'] ##teamcity[testFinished name='stringify ranges' duration="{duration}"] ##teamcity[testStarted name='stringify( has_maker )'] @@ -865,8 +922,6 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "Why wo ##teamcity[testFinished name='tuple<float,int>' duration="{duration}"] ##teamcity[testStarted name='tuple<int>'] ##teamcity[testFinished name='tuple<int>' duration="{duration}"] -##teamcity[testStarted name='tuple<0,int,const char *>'] -##teamcity[testFinished name='tuple<0,int,const char *>' duration="{duration}"] ##teamcity[testStarted name='tuple<string,string>'] ##teamcity[testFinished name='tuple<string,string>' duration="{duration}"] ##teamcity[testStarted name='tuple<tuple<int>,tuple<>,float>'] diff --git a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt new file mode 100644 index 000000000..2b7914464 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt @@ -0,0 +1,950 @@ +##teamcity[testSuiteStarted name='<exe-name>'] +##teamcity[testStarted name='# A test name that starts with a #'] +##teamcity[testFinished name='# A test name that starts with a #' duration="{duration}"] +##teamcity[testStarted name='#1027: Bitfields can be captured'] +##teamcity[testFinished name='#1027: Bitfields can be captured' duration="{duration}"] +##teamcity[testStarted name='#1147'] +##teamcity[testFinished name='#1147' duration="{duration}"] +##teamcity[testStarted name='#1175 - Hidden Test'] +##teamcity[testFinished name='#1175 - Hidden Test' duration="{duration}"] +##teamcity[testStarted name='#1238'] +##teamcity[testFinished name='#1238' duration="{duration}"] +##teamcity[testStarted name='#1245'] +##teamcity[testFinished name='#1245' duration="{duration}"] +##teamcity[testStarted name='#1319: Sections can have description (even if it is not saved'] +##teamcity[testFinished name='#1319: Sections can have description (even if it is not saved' duration="{duration}"] +##teamcity[testStarted name='#1403'] +##teamcity[testFinished name='#1403' duration="{duration}"] +##teamcity[testStarted name='#1455 - INFO and WARN can start with a linebreak'] +##teamcity[testFinished name='#1455 - INFO and WARN can start with a linebreak' duration="{duration}"] +##teamcity[testStarted name='#1514: stderr/stdout is not captured in tests aborted by an exception'] +Tricky.tests.cpp:<line number>|nexplicit failure with message:|n "1514"'] +##teamcity[testStdOut name='#1514: stderr/stdout is not captured in tests aborted by an exception' out='This would not be caught previously|n'] +##teamcity[testStdErr name='#1514: stderr/stdout is not captured in tests aborted by an exception' out='Nor would this|n'] +##teamcity[testFinished name='#1514: stderr/stdout is not captured in tests aborted by an exception' duration="{duration}"] +##teamcity[testStarted name='#1548'] +##teamcity[testFinished name='#1548' duration="{duration}"] +##teamcity[testStarted name='#1905 -- test spec parser properly clears internal state between compound tests'] +##teamcity[testFinished name='#1905 -- test spec parser properly clears internal state between compound tests' duration="{duration}"] +##teamcity[testStarted name='#1912 -- test spec parser handles escaping'] +##teamcity[testFinished name='#1912 -- test spec parser handles escaping' duration="{duration}"] +##teamcity[testStarted name='#1913 - GENERATE inside a for loop should not keep recreating the generator'] +##teamcity[testFinished name='#1913 - GENERATE inside a for loop should not keep recreating the generator' duration="{duration}"] +##teamcity[testStarted name='#1913 - GENERATEs can share a line'] +##teamcity[testFinished name='#1913 - GENERATEs can share a line' duration="{duration}"] +##teamcity[testStarted name='#1938 - GENERATE after a section'] +##teamcity[testFinished name='#1938 - GENERATE after a section' duration="{duration}"] +##teamcity[testStarted name='#1938 - Section followed by flat generate'] +##teamcity[testFinished name='#1938 - Section followed by flat generate' duration="{duration}"] +##teamcity[testStarted name='#1938 - flat generate'] +##teamcity[testFinished name='#1938 - flat generate' duration="{duration}"] +##teamcity[testStarted name='#1938 - mixed sections and generates'] +##teamcity[testFinished name='#1938 - mixed sections and generates' duration="{duration}"] +##teamcity[testStarted name='#1938 - nested generate'] +##teamcity[testFinished name='#1938 - nested generate' duration="{duration}"] +##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0'] +##teamcity[testFinished name='#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0' duration="{duration}"] +##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0'] +##teamcity[testFinished name='#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0' duration="{duration}"] +##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0'] +##teamcity[testFinished name='#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0' duration="{duration}"] +##teamcity[testStarted name='#2152 - ULP checks between differently signed values were wrong - double'] +##teamcity[testFinished name='#2152 - ULP checks between differently signed values were wrong - double' duration="{duration}"] +##teamcity[testStarted name='#2152 - ULP checks between differently signed values were wrong - float'] +##teamcity[testFinished name='#2152 - ULP checks between differently signed values were wrong - float' duration="{duration}"] +##teamcity[testStarted name='#748 - captures with unexpected exceptions'] +Exception.tests.cpp:<line number>|nunexpected exception with messages:|n "answer := 42"|n "expected exception"- failure ignore as test marked as |'ok to fail|'|n'] +Exception.tests.cpp:<line number>|nunexpected exception with messages:|n "answer := 42"|n "expected exception"|n REQUIRE_NOTHROW( thisThrows() )|nwith expansion:|n thisThrows()|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='#748 - captures with unexpected exceptions' duration="{duration}"] +##teamcity[testStarted name='#809'] +##teamcity[testFinished name='#809' duration="{duration}"] +##teamcity[testStarted name='#833'] +##teamcity[testFinished name='#833' duration="{duration}"] +##teamcity[testStarted name='#835 -- errno should not be touched by Catch2'] +Misc.tests.cpp:<line number>|nexpression failed|n CHECK( f() == 0 )|nwith expansion:|n 1 == 0|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='#835 -- errno should not be touched by Catch2' duration="{duration}"] +##teamcity[testStarted name='#872'] +##teamcity[testFinished name='#872' duration="{duration}"] +##teamcity[testStarted name='#961 -- Dynamically created sections should all be reported'] +##teamcity[testFinished name='#961 -- Dynamically created sections should all be reported' duration="{duration}"] +##teamcity[testStarted name='|'Not|' checks that should fail'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( false != false )|nwith expansion:|n false != false|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( true != true )|nwith expansion:|n true != true|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( !true )|nwith expansion:|n false|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK_FALSE( true )|nwith expansion:|n !true|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( !trueValue )|nwith expansion:|n false|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK_FALSE( trueValue )|nwith expansion:|n !true|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( !(1 == 1) )|nwith expansion:|n false|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK_FALSE( 1 == 1 )|nwith expansion:|n !(1 == 1)|n'] +##teamcity[testFinished name='|'Not|' checks that should fail' duration="{duration}"] +##teamcity[testStarted name='|'Not|' checks that should succeed'] +##teamcity[testFinished name='|'Not|' checks that should succeed' duration="{duration}"] +##teamcity[testStarted name='(unimplemented) static bools can be evaluated'] +##teamcity[testFinished name='(unimplemented) static bools can be evaluated' duration="{duration}"] +##teamcity[testStarted name='3x3x3 ints'] +##teamcity[testFinished name='3x3x3 ints' duration="{duration}"] +##teamcity[testStarted name='A METHOD_AS_TEST_CASE based test run that fails'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( s == "world" )|nwith expansion:|n "hello" == "world"|n'] +##teamcity[testFinished name='A METHOD_AS_TEST_CASE based test run that fails' duration="{duration}"] +##teamcity[testStarted name='A METHOD_AS_TEST_CASE based test run that succeeds'] +##teamcity[testFinished name='A METHOD_AS_TEST_CASE based test run that succeeds' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )|nwith expansion:|n 0 == 1|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )|nwith expansion:|n 0 == 1|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )|nwith expansion:|n 0 == 1|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )|nwith expansion:|n 0 == 1|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )|nwith expansion:|n 6 < 2|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<int, 2>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )|nwith expansion:|n 2 < 2|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<int, 2>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )|nwith expansion:|n 6 < 2|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2>'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )|nwith expansion:|n 2 < 2|n'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<float,6>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<float,6>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2>'] +##teamcity[testFinished name='A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2>' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD based test run that fails - double'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture<TestType>::m_a == 2 )|nwith expansion:|n 1.0 == 2|n'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD based test run that fails - double' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD based test run that fails - float'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture<TestType>::m_a == 2 )|nwith expansion:|n 1.0f == 2|n'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD based test run that fails - float' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD based test run that fails - int'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Template_Fixture<TestType>::m_a == 2 )|nwith expansion:|n 1 == 2|n'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD based test run that fails - int' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Nttp_Fixture<V>::value == 0 )|nwith expansion:|n 1 == 0|n'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Nttp_Fixture<V>::value == 0 )|nwith expansion:|n 3 == 0|n'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( Nttp_Fixture<V>::value == 0 )|nwith expansion:|n 6 == 0|n'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3' duration="{duration}"] +##teamcity[testStarted name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6'] +##teamcity[testFinished name='A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6' duration="{duration}"] +##teamcity[testStarted name='A TEST_CASE_METHOD based test run that fails'] +Class.tests.cpp:<line number>|nexpression failed|n REQUIRE( m_a == 2 )|nwith expansion:|n 1 == 2|n'] +##teamcity[testFinished name='A TEST_CASE_METHOD based test run that fails' duration="{duration}"] +##teamcity[testStarted name='A TEST_CASE_METHOD based test run that succeeds'] +##teamcity[testFinished name='A TEST_CASE_METHOD based test run that succeeds' duration="{duration}"] +##teamcity[testStarted name='A Template product test case - Foo<float>'] +##teamcity[testFinished name='A Template product test case - Foo<float>' duration="{duration}"] +##teamcity[testStarted name='A Template product test case - Foo<int>'] +##teamcity[testFinished name='A Template product test case - Foo<int>' duration="{duration}"] +##teamcity[testStarted name='A Template product test case - std::vector<float>'] +##teamcity[testFinished name='A Template product test case - std::vector<float>' duration="{duration}"] +##teamcity[testStarted name='A Template product test case - std::vector<int>'] +##teamcity[testFinished name='A Template product test case - std::vector<int>' duration="{duration}"] +##teamcity[testStarted name='A Template product test case with array signature - Bar<float, 42>'] +##teamcity[testFinished name='A Template product test case with array signature - Bar<float, 42>' duration="{duration}"] +##teamcity[testStarted name='A Template product test case with array signature - Bar<int, 9>'] +##teamcity[testFinished name='A Template product test case with array signature - Bar<int, 9>' duration="{duration}"] +##teamcity[testStarted name='A Template product test case with array signature - std::array<float, 42>'] +##teamcity[testFinished name='A Template product test case with array signature - std::array<float, 42>' duration="{duration}"] +##teamcity[testStarted name='A Template product test case with array signature - std::array<int, 9>'] +##teamcity[testFinished name='A Template product test case with array signature - std::array<int, 9>' duration="{duration}"] +##teamcity[testStarted name='A comparison that uses literals instead of the normal constructor'] +##teamcity[testFinished name='A comparison that uses literals instead of the normal constructor' duration="{duration}"] +##teamcity[testStarted name='A couple of nested sections followed by a failure'] +Misc.tests.cpp:<line number>|nexplicit failure with message:|n "to infinity and beyond"'] +##teamcity[testFinished name='A couple of nested sections followed by a failure' duration="{duration}"] +##teamcity[testStarted name='A failing expression with a non streamable type is still captured'] +Tricky.tests.cpp:<line number>|nexpression failed|n CHECK( &o1 == &o2 )|nwith expansion:|n 0x<hex digits> == 0x<hex digits>|n'] +Tricky.tests.cpp:<line number>|nexpression failed|n CHECK( o1 == o2 )|nwith expansion:|n {?} == {?}|n'] +##teamcity[testFinished name='A failing expression with a non streamable type is still captured' duration="{duration}"] +##teamcity[testStarted name='Absolute margin'] +##teamcity[testFinished name='Absolute margin' duration="{duration}"] +##teamcity[testStarted name='An empty test with no assertions'] +##teamcity[testFinished name='An empty test with no assertions' duration="{duration}"] +##teamcity[testStarted name='An expression with side-effects should only be evaluated once'] +##teamcity[testFinished name='An expression with side-effects should only be evaluated once' duration="{duration}"] +##teamcity[testStarted name='An unchecked exception reports the line of the last assertion'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpected exception"|n {Unknown expression after the reported line}|nwith expansion:|n {Unknown expression after the reported line}|n'] +##teamcity[testFinished name='An unchecked exception reports the line of the last assertion' duration="{duration}"] +##teamcity[testStarted name='Anonymous test case 1'] +##teamcity[testFinished name='Anonymous test case 1' duration="{duration}"] +##teamcity[testStarted name='Approx setters validate their arguments'] +##teamcity[testFinished name='Approx setters validate their arguments' duration="{duration}"] +##teamcity[testStarted name='Approx with exactly-representable margin'] +##teamcity[testFinished name='Approx with exactly-representable margin' duration="{duration}"] +##teamcity[testStarted name='Approximate PI'] +##teamcity[testFinished name='Approximate PI' duration="{duration}"] +##teamcity[testStarted name='Approximate comparisons with different epsilons'] +##teamcity[testFinished name='Approximate comparisons with different epsilons' duration="{duration}"] +##teamcity[testStarted name='Approximate comparisons with floats'] +##teamcity[testFinished name='Approximate comparisons with floats' duration="{duration}"] +##teamcity[testStarted name='Approximate comparisons with ints'] +##teamcity[testFinished name='Approximate comparisons with ints' duration="{duration}"] +##teamcity[testStarted name='Approximate comparisons with mixed numeric types'] +##teamcity[testFinished name='Approximate comparisons with mixed numeric types' duration="{duration}"] +##teamcity[testStarted name='Arbitrary predicate matcher'] +##teamcity[testFinished name='Arbitrary predicate matcher' duration="{duration}"] +##teamcity[testStarted name='Assertion macros support bit operators and bool conversions'] +##teamcity[testFinished name='Assertion macros support bit operators and bool conversions' duration="{duration}"] +##teamcity[testStarted name='Assertions then sections'] +##teamcity[testFinished name='Assertions then sections' duration="{duration}"] +##teamcity[testStarted name='Basic use of the Contains range matcher'] +##teamcity[testFinished name='Basic use of the Contains range matcher' duration="{duration}"] +##teamcity[testStarted name='Basic use of the Empty range matcher'] +##teamcity[testFinished name='Basic use of the Empty range matcher' duration="{duration}"] +##teamcity[testStarted name='CAPTURE can deal with complex expressions'] +##teamcity[testFinished name='CAPTURE can deal with complex expressions' duration="{duration}"] +##teamcity[testStarted name='CAPTURE can deal with complex expressions involving commas'] +##teamcity[testFinished name='CAPTURE can deal with complex expressions involving commas' duration="{duration}"] +##teamcity[testStarted name='CAPTURE parses string and character constants'] +##teamcity[testFinished name='CAPTURE parses string and character constants' duration="{duration}"] +##teamcity[testStarted name='Capture and info messages'] +##teamcity[testFinished name='Capture and info messages' duration="{duration}"] +##teamcity[testStarted name='CaseInsensitiveEqualsTo is case insensitive'] +##teamcity[testFinished name='CaseInsensitiveEqualsTo is case insensitive' duration="{duration}"] +##teamcity[testStarted name='CaseInsensitiveLess is case insensitive'] +##teamcity[testFinished name='CaseInsensitiveLess is case insensitive' duration="{duration}"] +##teamcity[testStarted name='Character pretty printing'] +##teamcity[testFinished name='Character pretty printing' duration="{duration}"] +##teamcity[testStarted name='Clara::Arg supports single-arg parse the way Opt does'] +##teamcity[testFinished name='Clara::Arg supports single-arg parse the way Opt does' duration="{duration}"] +##teamcity[testStarted name='Clara::Opt supports accept-many lambdas'] +##teamcity[testFinished name='Clara::Opt supports accept-many lambdas' duration="{duration}"] +##teamcity[testStarted name='ColourGuard behaviour'] +##teamcity[testFinished name='ColourGuard behaviour' duration="{duration}"] +##teamcity[testStarted name='Combining MatchAllOfGeneric does not nest'] +##teamcity[testFinished name='Combining MatchAllOfGeneric does not nest' duration="{duration}"] +##teamcity[testStarted name='Combining MatchAnyOfGeneric does not nest'] +##teamcity[testFinished name='Combining MatchAnyOfGeneric does not nest' duration="{duration}"] +##teamcity[testStarted name='Combining MatchNotOfGeneric does not nest'] +##teamcity[testFinished name='Combining MatchNotOfGeneric does not nest' duration="{duration}"] +##teamcity[testStarted name='Combining concrete matchers does not use templated matchers'] +##teamcity[testFinished name='Combining concrete matchers does not use templated matchers' duration="{duration}"] +##teamcity[testStarted name='Combining only templated matchers'] +##teamcity[testFinished name='Combining only templated matchers' duration="{duration}"] +##teamcity[testStarted name='Combining templated and concrete matchers'] +##teamcity[testFinished name='Combining templated and concrete matchers' duration="{duration}"] +##teamcity[testStarted name='Combining templated matchers'] +##teamcity[testFinished name='Combining templated matchers' duration="{duration}"] +##teamcity[testStarted name='Commas in various macros are allowed'] +##teamcity[testFinished name='Commas in various macros are allowed' duration="{duration}"] +##teamcity[testStarted name='Comparing function pointers'] +##teamcity[testFinished name='Comparing function pointers' duration="{duration}"] +##teamcity[testStarted name='Comparison ops'] +##teamcity[testFinished name='Comparison ops' duration="{duration}"] +##teamcity[testStarted name='Comparison with explicitly convertible types'] +##teamcity[testFinished name='Comparison with explicitly convertible types' duration="{duration}"] +##teamcity[testStarted name='Comparisons between ints where one side is computed'] +##teamcity[testFinished name='Comparisons between ints where one side is computed' duration="{duration}"] +##teamcity[testStarted name='Comparisons between unsigned ints and negative signed ints match c++ standard behaviour'] +##teamcity[testFinished name='Comparisons between unsigned ints and negative signed ints match c++ standard behaviour' duration="{duration}"] +##teamcity[testStarted name='Comparisons with int literals don|'t warn when mixing signed/ unsigned'] +##teamcity[testFinished name='Comparisons with int literals don|'t warn when mixing signed/ unsigned' duration="{duration}"] +##teamcity[testStarted name='Composed generic matchers shortcircuit'] +##teamcity[testFinished name='Composed generic matchers shortcircuit' duration="{duration}"] +##teamcity[testStarted name='Composed matchers shortcircuit'] +##teamcity[testFinished name='Composed matchers shortcircuit' duration="{duration}"] +##teamcity[testStarted name='Contains string matcher'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] +##teamcity[testFinished name='Contains string matcher' duration="{duration}"] +##teamcity[testStarted name='Copy and then generate a range'] +##teamcity[testFinished name='Copy and then generate a range' duration="{duration}"] +##teamcity[testStarted name='Cout stream properly declares it writes to stdout'] +##teamcity[testFinished name='Cout stream properly declares it writes to stdout' duration="{duration}"] +##teamcity[testStarted name='Custom exceptions can be translated when testing for nothrow'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "custom exception - not std"|n REQUIRE_NOTHROW( throwCustom() )|nwith expansion:|n throwCustom()|n'] +##teamcity[testFinished name='Custom exceptions can be translated when testing for nothrow' duration="{duration}"] +##teamcity[testStarted name='Custom exceptions can be translated when testing for throwing as something else'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "custom exception - not std"|n REQUIRE_THROWS_AS( throwCustom(), std::exception )|nwith expansion:|n throwCustom(), std::exception|n'] +##teamcity[testFinished name='Custom exceptions can be translated when testing for throwing as something else' duration="{duration}"] +##teamcity[testStarted name='Custom std-exceptions can be custom translated'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "custom std exception"'] +##teamcity[testFinished name='Custom std-exceptions can be custom translated' duration="{duration}"] +##teamcity[testStarted name='Default scale is invisible to comparison'] +##teamcity[testFinished name='Default scale is invisible to comparison' duration="{duration}"] +##teamcity[testStarted name='Directly creating an EnumInfo'] +##teamcity[testFinished name='Directly creating an EnumInfo' duration="{duration}"] +##teamcity[testStarted name='Empty stream name opens cout stream'] +##teamcity[testFinished name='Empty stream name opens cout stream' duration="{duration}"] +##teamcity[testStarted name='Empty tag is not allowed'] +##teamcity[testFinished name='Empty tag is not allowed' duration="{duration}"] +##teamcity[testStarted name='EndsWith string matcher'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "Substring"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "this" (case insensitive)|n'] +##teamcity[testFinished name='EndsWith string matcher' duration="{duration}"] +##teamcity[testStarted name='Enums can quickly have stringification enabled using REGISTER_ENUM'] +##teamcity[testFinished name='Enums can quickly have stringification enabled using REGISTER_ENUM' duration="{duration}"] +##teamcity[testStarted name='Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM'] +##teamcity[testFinished name='Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM' duration="{duration}"] +##teamcity[testStarted name='Epsilon only applies to Approx|'s value'] +##teamcity[testFinished name='Epsilon only applies to Approx|'s value' duration="{duration}"] +##teamcity[testStarted name='Equality checks that should fail'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven == 6 )|nwith expansion:|n 7 == 6|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven == 8 )|nwith expansion:|n 7 == 8|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven == 0 )|nwith expansion:|n 7 == 0|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 9.11f ) )|nwith expansion:|n 9.1f == Approx( 9.1099996567 )|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 9.0f ) )|nwith expansion:|n 9.1f == Approx( 9.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 1 ) )|nwith expansion:|n 9.1f == Approx( 1.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 0 ) )|nwith expansion:|n 9.1f == Approx( 0.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.double_pi == Approx( 3.1415 ) )|nwith expansion:|n 3.1415926535 == Approx( 3.1415 )|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello == "goodbye" )|nwith expansion:|n "hello" == "goodbye"|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello == "hell" )|nwith expansion:|n "hello" == "hell"|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello == "hello1" )|nwith expansion:|n "hello" == "hello1"|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello.size() == 6 )|nwith expansion:|n 5 == 6|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( x == Approx( 1.301 ) )|nwith expansion:|n 1.3 == Approx( 1.301 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Equality checks that should fail' duration="{duration}"] +##teamcity[testStarted name='Equality checks that should succeed'] +##teamcity[testFinished name='Equality checks that should succeed' duration="{duration}"] +##teamcity[testStarted name='Equals'] +##teamcity[testFinished name='Equals' duration="{duration}"] +##teamcity[testStarted name='Equals string matcher'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Equals( "this string contains |'ABC|' as a substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" equals: "this string contains |'ABC|' as a substring"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" equals: "something else" (case insensitive)|n'] +##teamcity[testFinished name='Equals string matcher' duration="{duration}"] +##teamcity[testStarted name='Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified'] +##teamcity[testFinished name='Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified' duration="{duration}"] +##teamcity[testStarted name='Exception matchers that fail'] +Matchers.tests.cpp:<line number>|nno exception was thrown where one was expected|n CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nno exception was thrown where one was expected|n REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nunexpected exception with message:|n "Unknown exception"|n CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nunexpected exception with message:|n "Unknown exception"|n REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n SpecialException::what special exception has value of 1|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n SpecialException::what special exception has value of 1|n'] +##teamcity[testFinished name='Exception matchers that fail' duration="{duration}"] +##teamcity[testStarted name='Exception matchers that succeed'] +##teamcity[testFinished name='Exception matchers that succeed' duration="{duration}"] +##teamcity[testStarted name='Exception messages can be tested for'] +##teamcity[testFinished name='Exception messages can be tested for' duration="{duration}"] +##teamcity[testStarted name='Exceptions matchers'] +##teamcity[testFinished name='Exceptions matchers' duration="{duration}"] +##teamcity[testStarted name='Expected exceptions that don|'t throw or unexpected exceptions fail the test'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "expected exception"|n CHECK_THROWS_AS( thisThrows(), std::string )|nwith expansion:|n thisThrows(), std::string|n'] +Exception.tests.cpp:<line number>|nno exception was thrown where one was expected|n CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )|nwith expansion:|n thisDoesntThrow(), std::domain_error|n'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "expected exception"|n CHECK_NOTHROW( thisThrows() )|nwith expansion:|n thisThrows()|n'] +##teamcity[testFinished name='Expected exceptions that don|'t throw or unexpected exceptions fail the test' duration="{duration}"] +##teamcity[testStarted name='FAIL aborts the test'] +Message.tests.cpp:<line number>|nexplicit failure with message:|n "This is a failure"'] +##teamcity[testFinished name='FAIL aborts the test' duration="{duration}"] +##teamcity[testStarted name='FAIL does not require an argument'] +Message.tests.cpp:<line number>|nexplicit failure'] +##teamcity[testFinished name='FAIL does not require an argument' duration="{duration}"] +##teamcity[testStarted name='FAIL_CHECK does not abort the test'] +Message.tests.cpp:<line number>|nexplicit failure with message:|n "This is a failure"'] +##teamcity[testFinished name='FAIL_CHECK does not abort the test' duration="{duration}"] +##teamcity[testStarted name='Factorials are computed'] +##teamcity[testFinished name='Factorials are computed' duration="{duration}"] +##teamcity[testStarted name='Floating point matchers: double'] +##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"] +##teamcity[testStarted name='Floating point matchers: float'] +##teamcity[testFinished name='Floating point matchers: float' duration="{duration}"] +##teamcity[testStarted name='Generators -- adapters'] +##teamcity[testFinished name='Generators -- adapters' duration="{duration}"] +##teamcity[testStarted name='Generators -- simple'] +##teamcity[testFinished name='Generators -- simple' duration="{duration}"] +##teamcity[testStarted name='Generators internals'] +##teamcity[testFinished name='Generators internals' duration="{duration}"] +##teamcity[testStarted name='Greater-than inequalities with different epsilons'] +##teamcity[testFinished name='Greater-than inequalities with different epsilons' duration="{duration}"] +##teamcity[testStarted name='Hashers with different seed produce different hash with same test case'] +##teamcity[testFinished name='Hashers with different seed produce different hash with same test case' duration="{duration}"] +##teamcity[testStarted name='Hashers with same seed produce same hash'] +##teamcity[testFinished name='Hashers with same seed produce same hash' duration="{duration}"] +##teamcity[testStarted name='Hashing different test cases produces different result'] +##teamcity[testFinished name='Hashing different test cases produces different result' duration="{duration}"] +##teamcity[testStarted name='Hashing test case produces same hash across multiple calls'] +##teamcity[testFinished name='Hashing test case produces same hash across multiple calls' duration="{duration}"] +##teamcity[testStarted name='INFO and WARN do not abort tests'] +##teamcity[testFinished name='INFO and WARN do not abort tests' duration="{duration}"] +##teamcity[testStarted name='INFO gets logged on failure'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "this message should be logged"|n "so should this"|n REQUIRE( a == 1 )|nwith expansion:|n 2 == 1|n'] +##teamcity[testFinished name='INFO gets logged on failure' duration="{duration}"] +##teamcity[testStarted name='INFO gets logged on failure, even if captured before successful assertions'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "this message may be logged later"|n "this message should be logged"|n CHECK( a == 1 )|nwith expansion:|n 2 == 1|n'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "this message may be logged later"|n "this message should be logged"|n "and this, but later"|n CHECK( a == 0 )|nwith expansion:|n 2 == 0|n'] +##teamcity[testFinished name='INFO gets logged on failure, even if captured before successful assertions' duration="{duration}"] +##teamcity[testStarted name='INFO is reset for each loop'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "current counter 10"|n "i := 10"|n REQUIRE( i < 10 )|nwith expansion:|n 10 < 10|n'] +##teamcity[testFinished name='INFO is reset for each loop' duration="{duration}"] +##teamcity[testStarted name='Inequality checks that should fail'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven != 7 )|nwith expansion:|n 7 != 7|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one != Approx( 9.1f ) )|nwith expansion:|n 9.1f != Approx( 9.1000003815 )|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.double_pi != Approx( 3.1415926535 ) )|nwith expansion:|n 3.1415926535 != Approx( 3.1415926535 )|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello != "hello" )|nwith expansion:|n "hello" != "hello"|n- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello.size() != 5 )|nwith expansion:|n 5 != 5|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Inequality checks that should fail' duration="{duration}"] +##teamcity[testStarted name='Inequality checks that should succeed'] +##teamcity[testFinished name='Inequality checks that should succeed' duration="{duration}"] +##teamcity[testStarted name='Lambdas in assertions'] +##teamcity[testFinished name='Lambdas in assertions' duration="{duration}"] +##teamcity[testStarted name='Less-than inequalities with different epsilons'] +##teamcity[testFinished name='Less-than inequalities with different epsilons' duration="{duration}"] +##teamcity[testStarted name='ManuallyRegistered'] +##teamcity[testFinished name='ManuallyRegistered' duration="{duration}"] +##teamcity[testStarted name='Matchers can be (AllOf) composed with the && operator'] +##teamcity[testFinished name='Matchers can be (AllOf) composed with the && operator' duration="{duration}"] +##teamcity[testStarted name='Matchers can be (AnyOf) composed with the |||| operator'] +##teamcity[testFinished name='Matchers can be (AnyOf) composed with the |||| operator' duration="{duration}"] +##teamcity[testStarted name='Matchers can be composed with both && and ||||'] +##teamcity[testFinished name='Matchers can be composed with both && and ||||' duration="{duration}"] +##teamcity[testStarted name='Matchers can be composed with both && and |||| - failing'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) |||| ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )|n'] +##teamcity[testFinished name='Matchers can be composed with both && and |||| - failing' duration="{duration}"] +##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator'] +##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator' duration="{duration}"] +##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator - failing'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" not contains: "substring"|n'] +##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator - failing' duration="{duration}"] +##teamcity[testStarted name='Mayfail test case with nested sections'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +Condition.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Mayfail test case with nested sections' duration="{duration}"] +##teamcity[testStarted name='Mismatching exception messages failing the test'] +Exception.tests.cpp:<line number>|nexpression failed|n REQUIRE_THROWS_WITH( thisThrows(), "should fail" )|nwith expansion:|n "expected exception" equals: "should fail"|n'] +##teamcity[testFinished name='Mismatching exception messages failing the test' duration="{duration}"] +##teamcity[testStarted name='Multireporter calls reporters and listeners in correct order'] +##teamcity[testFinished name='Multireporter calls reporters and listeners in correct order' duration="{duration}"] +##teamcity[testStarted name='Multireporter updates ReporterPreferences properly'] +##teamcity[testFinished name='Multireporter updates ReporterPreferences properly' duration="{duration}"] +##teamcity[testStarted name='Nested generators and captured variables'] +##teamcity[testFinished name='Nested generators and captured variables' duration="{duration}"] +##teamcity[testStarted name='Nice descriptive name'] +##teamcity[testFinished name='Nice descriptive name' duration="{duration}"] +##teamcity[testStarted name='Non-std exceptions can be translated'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "custom exception"'] +##teamcity[testFinished name='Non-std exceptions can be translated' duration="{duration}"] +##teamcity[testStarted name='Objects that evaluated in boolean contexts can be checked'] +##teamcity[testFinished name='Objects that evaluated in boolean contexts can be checked' duration="{duration}"] +##teamcity[testStarted name='Optionally static assertions'] +##teamcity[testFinished name='Optionally static assertions' duration="{duration}"] +##teamcity[testStarted name='Ordering comparison checks that should fail'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven > 7 )|nwith expansion:|n 7 > 7|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven < 7 )|nwith expansion:|n 7 < 7|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven > 8 )|nwith expansion:|n 7 > 8|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven < 6 )|nwith expansion:|n 7 < 6|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven < 0 )|nwith expansion:|n 7 < 0|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven < -1 )|nwith expansion:|n 7 < -1|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven >= 8 )|nwith expansion:|n 7 >= 8|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven <= 6 )|nwith expansion:|n 7 <= 6|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one < 9 )|nwith expansion:|n 9.1f < 9|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 10 )|nwith expansion:|n 9.1f > 10|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 9.2 )|nwith expansion:|n 9.1f > 9.2|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello > "hello" )|nwith expansion:|n "hello" > "hello"|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello < "hello" )|nwith expansion:|n "hello" < "hello"|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello > "hellp" )|nwith expansion:|n "hello" > "hellp"|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello > "z" )|nwith expansion:|n "hello" > "z"|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello < "hellm" )|nwith expansion:|n "hello" < "hellm"|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello < "a" )|nwith expansion:|n "hello" < "a"|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello >= "z" )|nwith expansion:|n "hello" >= "z"|n'] +Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello <= "a" )|nwith expansion:|n "hello" <= "a"|n'] +##teamcity[testFinished name='Ordering comparison checks that should fail' duration="{duration}"] +##teamcity[testStarted name='Ordering comparison checks that should succeed'] +##teamcity[testFinished name='Ordering comparison checks that should succeed' duration="{duration}"] +##teamcity[testStarted name='Our PCG implementation provides expected results for known seeds'] +##teamcity[testFinished name='Our PCG implementation provides expected results for known seeds' duration="{duration}"] +##teamcity[testStarted name='Output from all sections is reported'] +Message.tests.cpp:<line number>|nexplicit failure with message:|n "Message from section one"'] +Message.tests.cpp:<line number>|nexplicit failure with message:|n "Message from section two"'] +##teamcity[testFinished name='Output from all sections is reported' duration="{duration}"] +##teamcity[testStarted name='Overloaded comma or address-of operators are not used'] +##teamcity[testFinished name='Overloaded comma or address-of operators are not used' duration="{duration}"] +##teamcity[testStarted name='Parse test names and tags'] +##teamcity[testFinished name='Parse test names and tags' duration="{duration}"] +##teamcity[testStarted name='Parsed tags are matched case insensitive'] +##teamcity[testFinished name='Parsed tags are matched case insensitive' duration="{duration}"] +##teamcity[testStarted name='Parsing sharding-related cli flags'] +##teamcity[testFinished name='Parsing sharding-related cli flags' duration="{duration}"] +##teamcity[testStarted name='Parsing tags with non-alphabetical characters is pass-through'] +##teamcity[testFinished name='Parsing tags with non-alphabetical characters is pass-through' duration="{duration}"] +##teamcity[testStarted name='Parsing warnings'] +##teamcity[testFinished name='Parsing warnings' duration="{duration}"] +##teamcity[testStarted name='Pointers can be compared to null'] +##teamcity[testFinished name='Pointers can be compared to null' duration="{duration}"] +##teamcity[testStarted name='Precision of floating point stringification can be set'] +##teamcity[testFinished name='Precision of floating point stringification can be set' duration="{duration}"] +##teamcity[testStarted name='Predicate matcher can accept const char*'] +##teamcity[testFinished name='Predicate matcher can accept const char*' duration="{duration}"] +##teamcity[testStarted name='Process can be configured on command line'] +##teamcity[testFinished name='Process can be configured on command line' duration="{duration}"] +##teamcity[testStarted name='Product with differing arities - std::tuple<int, double, float>'] +##teamcity[testFinished name='Product with differing arities - std::tuple<int, double, float>' duration="{duration}"] +##teamcity[testStarted name='Product with differing arities - std::tuple<int, double>'] +##teamcity[testFinished name='Product with differing arities - std::tuple<int, double>' duration="{duration}"] +##teamcity[testStarted name='Product with differing arities - std::tuple<int>'] +##teamcity[testFinished name='Product with differing arities - std::tuple<int>' duration="{duration}"] +##teamcity[testStarted name='Random seed generation accepts known methods'] +##teamcity[testFinished name='Random seed generation accepts known methods' duration="{duration}"] +##teamcity[testStarted name='Random seed generation reports unknown methods'] +##teamcity[testFinished name='Random seed generation reports unknown methods' duration="{duration}"] +##teamcity[testStarted name='Range type with sentinel'] +##teamcity[testFinished name='Range type with sentinel' duration="{duration}"] +##teamcity[testStarted name='Reconstruction should be based on stringification: #914'] +Decomposition.tests.cpp:<line number>|nexpression failed|n CHECK( truthy(false) )|nwith expansion:|n Hey, its truthy!|n'] +##teamcity[testFinished name='Reconstruction should be based on stringification: #914' duration="{duration}"] +##teamcity[testStarted name='Regex string matcher'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "this STRING contains |'abc|' as a substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "this STRING contains |'abc|' as a substring" case sensitively|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "contains |'abc|' as a substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "contains |'abc|' as a substring" case sensitively|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "this string contains |'abc|' as a" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "this string contains |'abc|' as a" case sensitively|n'] +##teamcity[testFinished name='Regex string matcher' duration="{duration}"] +##teamcity[testStarted name='Registering reporter with |'::|' in name fails'] +##teamcity[testFinished name='Registering reporter with |'::|' in name fails' duration="{duration}"] +##teamcity[testStarted name='Regression test #1'] +##teamcity[testFinished name='Regression test #1' duration="{duration}"] +##teamcity[testStarted name='Reporter|'s write listings to provided stream'] +##teamcity[testFinished name='Reporter|'s write listings to provided stream' duration="{duration}"] +##teamcity[testStarted name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla'] +##teamcity[testFinished name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla' duration="{duration}"] +##teamcity[testStarted name='SUCCEED counts as a test pass'] +##teamcity[testFinished name='SUCCEED counts as a test pass' duration="{duration}"] +##teamcity[testStarted name='SUCCEED does not require an argument'] +##teamcity[testFinished name='SUCCEED does not require an argument' duration="{duration}"] +##teamcity[testStarted name='Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods'] +##teamcity[testFinished name='Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods' duration="{duration}"] +##teamcity[testStarted name='Scenario: Do that thing with the thing'] +##teamcity[testFinished name='Scenario: Do that thing with the thing' duration="{duration}"] +##teamcity[testStarted name='Scenario: This is a really long scenario name to see how the list command deals with wrapping'] +##teamcity[testFinished name='Scenario: This is a really long scenario name to see how the list command deals with wrapping' duration="{duration}"] +##teamcity[testStarted name='Scenario: Vector resizing affects size and capacity'] +##teamcity[testFinished name='Scenario: Vector resizing affects size and capacity' duration="{duration}"] +##teamcity[testStarted name='Sends stuff to stdout and stderr'] +##teamcity[testStdOut name='Sends stuff to stdout and stderr' out='A string sent directly to stdout|n'] +##teamcity[testStdErr name='Sends stuff to stdout and stderr' out='A string sent directly to stderr|nA string sent to stderr via clog|n'] +##teamcity[testFinished name='Sends stuff to stdout and stderr' duration="{duration}"] +##teamcity[testStarted name='Some simple comparisons between doubles'] +##teamcity[testFinished name='Some simple comparisons between doubles' duration="{duration}"] +##teamcity[testStarted name='Standard output from all sections is reported'] +##teamcity[testStdOut name='Standard output from all sections is reported' out='Message from section one|nMessage from section two|n'] +##teamcity[testFinished name='Standard output from all sections is reported' duration="{duration}"] +##teamcity[testStarted name='StartsWith string matcher'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" starts with: "This String"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" starts with: "string" (case insensitive)|n'] +##teamcity[testFinished name='StartsWith string matcher' duration="{duration}"] +##teamcity[testStarted name='Static arrays are convertible to string'] +##teamcity[testFinished name='Static arrays are convertible to string' duration="{duration}"] +##teamcity[testStarted name='String matchers'] +##teamcity[testFinished name='String matchers' duration="{duration}"] +##teamcity[testStarted name='StringRef'] +##teamcity[testFinished name='StringRef' duration="{duration}"] +##teamcity[testStarted name='StringRef at compilation time'] +##teamcity[testFinished name='StringRef at compilation time' duration="{duration}"] +##teamcity[testStarted name='Stringifying char arrays with statically known sizes - char'] +##teamcity[testFinished name='Stringifying char arrays with statically known sizes - char' duration="{duration}"] +##teamcity[testStarted name='Stringifying char arrays with statically known sizes - signed char'] +##teamcity[testFinished name='Stringifying char arrays with statically known sizes - signed char' duration="{duration}"] +##teamcity[testStarted name='Stringifying char arrays with statically known sizes - unsigned char'] +##teamcity[testFinished name='Stringifying char arrays with statically known sizes - unsigned char' duration="{duration}"] +##teamcity[testStarted name='Stringifying std::chrono::duration helpers'] +##teamcity[testFinished name='Stringifying std::chrono::duration helpers' duration="{duration}"] +##teamcity[testStarted name='Stringifying std::chrono::duration with weird ratios'] +##teamcity[testFinished name='Stringifying std::chrono::duration with weird ratios' duration="{duration}"] +##teamcity[testStarted name='Stringifying std::chrono::time_point<system_clock>'] +##teamcity[testFinished name='Stringifying std::chrono::time_point<system_clock>' duration="{duration}"] +##teamcity[testStarted name='Tabs and newlines show in output'] +Misc.tests.cpp:<line number>|nexpression failed|n CHECK( s1 == s2 )|nwith expansion:|n "if ($b == 10) {|n $a = 20;|n}"|n==|n"if ($b == 10) {|n $a = 20;|n}|n"|n'] +##teamcity[testFinished name='Tabs and newlines show in output' duration="{duration}"] +##teamcity[testStarted name='Tag alias can be registered against tag patterns'] +##teamcity[testFinished name='Tag alias can be registered against tag patterns' duration="{duration}"] +##teamcity[testStarted name='Tags with spaces and non-alphanumerical characters are accepted'] +##teamcity[testFinished name='Tags with spaces and non-alphanumerical characters are accepted' duration="{duration}"] +##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 0'] +##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 0' duration="{duration}"] +##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 1'] +##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 1' duration="{duration}"] +##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 2'] +##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 2' duration="{duration}"] +##teamcity[testStarted name='Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0'] +##teamcity[testFinished name='Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0' duration="{duration}"] +##teamcity[testStarted name='Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1'] +##teamcity[testFinished name='Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1' duration="{duration}"] +##teamcity[testStarted name='Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0'] +##teamcity[testFinished name='Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0' duration="{duration}"] +##teamcity[testStarted name='Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1'] +##teamcity[testFinished name='Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1' duration="{duration}"] +##teamcity[testStarted name='Template test case with test types specified inside std::tuple - MyTypes - 0'] +##teamcity[testFinished name='Template test case with test types specified inside std::tuple - MyTypes - 0' duration="{duration}"] +##teamcity[testStarted name='Template test case with test types specified inside std::tuple - MyTypes - 1'] +##teamcity[testFinished name='Template test case with test types specified inside std::tuple - MyTypes - 1' duration="{duration}"] +##teamcity[testStarted name='Template test case with test types specified inside std::tuple - MyTypes - 2'] +##teamcity[testFinished name='Template test case with test types specified inside std::tuple - MyTypes - 2' duration="{duration}"] +##teamcity[testStarted name='TemplateTest: vectors can be sized and resized - float'] +##teamcity[testFinished name='TemplateTest: vectors can be sized and resized - float' duration="{duration}"] +##teamcity[testStarted name='TemplateTest: vectors can be sized and resized - int'] +##teamcity[testFinished name='TemplateTest: vectors can be sized and resized - int' duration="{duration}"] +##teamcity[testStarted name='TemplateTest: vectors can be sized and resized - std::string'] +##teamcity[testFinished name='TemplateTest: vectors can be sized and resized - std::string' duration="{duration}"] +##teamcity[testStarted name='TemplateTest: vectors can be sized and resized - std::tuple<int,float>'] +##teamcity[testFinished name='TemplateTest: vectors can be sized and resized - std::tuple<int,float>' duration="{duration}"] +##teamcity[testStarted name='TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6'] +##teamcity[testFinished name='TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6' duration="{duration}"] +##teamcity[testStarted name='TemplateTestSig: vectors can be sized and resized - float,4'] +##teamcity[testFinished name='TemplateTestSig: vectors can be sized and resized - float,4' duration="{duration}"] +##teamcity[testStarted name='TemplateTestSig: vectors can be sized and resized - int,5'] +##teamcity[testFinished name='TemplateTestSig: vectors can be sized and resized - int,5' duration="{duration}"] +##teamcity[testStarted name='TemplateTestSig: vectors can be sized and resized - std::string,15'] +##teamcity[testFinished name='TemplateTestSig: vectors can be sized and resized - std::string,15' duration="{duration}"] +##teamcity[testStarted name='Test case with identical tags keeps just one'] +##teamcity[testFinished name='Test case with identical tags keeps just one' duration="{duration}"] +##teamcity[testStarted name='Test case with one argument'] +##teamcity[testFinished name='Test case with one argument' duration="{duration}"] +##teamcity[testStarted name='Test enum bit values'] +##teamcity[testFinished name='Test enum bit values' duration="{duration}"] +##teamcity[testStarted name='Test with special, characters "in name'] +##teamcity[testFinished name='Test with special, characters "in name' duration="{duration}"] +##teamcity[testStarted name='Testing checked-if'] +##teamcity[testFinished name='Testing checked-if' duration="{duration}"] +##teamcity[testStarted name='Testing checked-if 2'] +Misc.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Testing checked-if 2' duration="{duration}"] +##teamcity[testStarted name='Testing checked-if 3'] +Misc.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Testing checked-if 3' duration="{duration}"] +##teamcity[testStarted name='The NO_FAIL macro reports a failure but does not fail the test'] +##teamcity[testFinished name='The NO_FAIL macro reports a failure but does not fail the test' duration="{duration}"] +##teamcity[testStarted name='The default listing implementation write to provided stream'] +##teamcity[testFinished name='The default listing implementation write to provided stream' duration="{duration}"] +##teamcity[testStarted name='This test |'should|' fail but doesn|'t'] +##teamcity[testFinished name='This test |'should|' fail but doesn|'t' duration="{duration}"] +##teamcity[testStarted name='Thrown string literals are translated'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "For some reason someone is throwing a string literal!"'] +##teamcity[testFinished name='Thrown string literals are translated' duration="{duration}"] +##teamcity[testStarted name='Tracker'] +##teamcity[testFinished name='Tracker' duration="{duration}"] +##teamcity[testStarted name='Trim strings'] +##teamcity[testFinished name='Trim strings' duration="{duration}"] +##teamcity[testStarted name='Unexpected exceptions can be translated'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "3.14"'] +##teamcity[testFinished name='Unexpected exceptions can be translated' duration="{duration}"] +##teamcity[testStarted name='Upcasting special member functions'] +##teamcity[testFinished name='Upcasting special member functions' duration="{duration}"] +##teamcity[testStarted name='Usage of AllMatch range matcher'] +##teamcity[testFinished name='Usage of AllMatch range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of AllTrue range matcher'] +##teamcity[testFinished name='Usage of AllTrue range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of AnyMatch range matcher'] +##teamcity[testFinished name='Usage of AnyMatch range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of AnyTrue range matcher'] +##teamcity[testFinished name='Usage of AnyTrue range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of NoneMatch range matcher'] +##teamcity[testFinished name='Usage of NoneMatch range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of NoneTrue range matcher'] +##teamcity[testFinished name='Usage of NoneTrue range matcher' duration="{duration}"] +##teamcity[testStarted name='Usage of the SizeIs range matcher'] +##teamcity[testFinished name='Usage of the SizeIs range matcher' duration="{duration}"] +##teamcity[testStarted name='Use a custom approx'] +##teamcity[testFinished name='Use a custom approx' duration="{duration}"] +##teamcity[testStarted name='Variadic macros'] +##teamcity[testFinished name='Variadic macros' duration="{duration}"] +##teamcity[testStarted name='Vector Approx matcher'] +##teamcity[testFinished name='Vector Approx matcher' duration="{duration}"] +##teamcity[testStarted name='Vector Approx matcher -- failing'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Approx( t1 ) )|nwith expansion:|n { } is approx: { 1.0, 2.0 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v1, Approx( v2 ) )|nwith expansion:|n { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }|n'] +##teamcity[testFinished name='Vector Approx matcher -- failing' duration="{duration}"] +##teamcity[testStarted name='Vector matchers'] +##teamcity[testFinished name='Vector matchers' duration="{duration}"] +##teamcity[testStarted name='Vector matchers that fail'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, VectorContains( -1 ) )|nwith expansion:|n { 1, 2, 3 } Contains: -1|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, VectorContains( 1 ) )|nwith expansion:|n { } Contains: 1|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Contains( v ) )|nwith expansion:|n { } Contains: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Contains( v2 ) )|nwith expansion:|n { 1, 2, 3 } Contains: { 1, 2, 4 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Equals( v2 ) )|nwith expansion:|n { 1, 2, 3 } Equals: { 1, 2 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v2, Equals( v ) )|nwith expansion:|n { 1, 2 } Equals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Equals( v ) )|nwith expansion:|n { } Equals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Equals( empty ) )|nwith expansion:|n { 1, 2, 3 } Equals: { }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, UnorderedEquals( empty ) )|nwith expansion:|n { 1, 2, 3 } UnorderedEquals: { }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, UnorderedEquals( v ) )|nwith expansion:|n { } UnorderedEquals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( permuted, UnorderedEquals( v ) )|nwith expansion:|n { 1, 3 } UnorderedEquals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( permuted, UnorderedEquals( v ) )|nwith expansion:|n { 3, 1 } UnorderedEquals: { 1, 2, 3 }|n'] +##teamcity[testFinished name='Vector matchers that fail' duration="{duration}"] +##teamcity[testStarted name='When checked exceptions are thrown they can be expected or unexpected'] +##teamcity[testFinished name='When checked exceptions are thrown they can be expected or unexpected' duration="{duration}"] +##teamcity[testStarted name='When unchecked exceptions are thrown directly they are always failures'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpected exception"'] +##teamcity[testFinished name='When unchecked exceptions are thrown directly they are always failures' duration="{duration}"] +##teamcity[testStarted name='When unchecked exceptions are thrown during a CHECK the test should continue'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "expected exception"|n CHECK( thisThrows() == 0 )|nwith expansion:|n thisThrows() == 0|n'] +##teamcity[testFinished name='When unchecked exceptions are thrown during a CHECK the test should continue' duration="{duration}"] +##teamcity[testStarted name='When unchecked exceptions are thrown during a REQUIRE the test should abort fail'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "expected exception"|n REQUIRE( thisThrows() == 0 )|nwith expansion:|n thisThrows() == 0|n'] +##teamcity[testFinished name='When unchecked exceptions are thrown during a REQUIRE the test should abort fail' duration="{duration}"] +##teamcity[testStarted name='When unchecked exceptions are thrown from functions they are always failures'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "expected exception"|n CHECK( thisThrows() == 0 )|nwith expansion:|n thisThrows() == 0|n'] +##teamcity[testFinished name='When unchecked exceptions are thrown from functions they are always failures' duration="{duration}"] +##teamcity[testStarted name='When unchecked exceptions are thrown from sections they are always failures'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpected exception"'] +##teamcity[testFinished name='When unchecked exceptions are thrown from sections they are always failures' duration="{duration}"] +##teamcity[testStarted name='When unchecked exceptions are thrown, but caught, they do not affect the test'] +##teamcity[testFinished name='When unchecked exceptions are thrown, but caught, they do not affect the test' duration="{duration}"] +##teamcity[testStarted name='X/level/0/a'] +##teamcity[testFinished name='X/level/0/a' duration="{duration}"] +##teamcity[testStarted name='X/level/0/b'] +##teamcity[testFinished name='X/level/0/b' duration="{duration}"] +##teamcity[testStarted name='X/level/1/a'] +##teamcity[testFinished name='X/level/1/a' duration="{duration}"] +##teamcity[testStarted name='X/level/1/b'] +##teamcity[testFinished name='X/level/1/b' duration="{duration}"] +##teamcity[testStarted name='XmlEncode'] +##teamcity[testFinished name='XmlEncode' duration="{duration}"] +##teamcity[testStarted name='XmlWriter writes boolean attributes as true/false'] +##teamcity[testFinished name='XmlWriter writes boolean attributes as true/false' duration="{duration}"] +##teamcity[testStarted name='analyse no analysis'] +##teamcity[testFinished name='analyse no analysis' duration="{duration}"] +##teamcity[testStarted name='array<int, N> -> toString'] +##teamcity[testFinished name='array<int, N> -> toString' duration="{duration}"] +##teamcity[testStarted name='benchmark function call'] +##teamcity[testFinished name='benchmark function call' duration="{duration}"] +##teamcity[testStarted name='boolean member'] +##teamcity[testFinished name='boolean member' duration="{duration}"] +##teamcity[testStarted name='checkedElse'] +##teamcity[testFinished name='checkedElse' duration="{duration}"] +##teamcity[testStarted name='checkedElse, failing'] +Misc.tests.cpp:<line number>|nexpression failed|n REQUIRE( testCheckedElse( false ) )|nwith expansion:|n false|n'] +##teamcity[testFinished name='checkedElse, failing' duration="{duration}"] +##teamcity[testStarted name='checkedIf'] +##teamcity[testFinished name='checkedIf' duration="{duration}"] +##teamcity[testStarted name='checkedIf, failing'] +Misc.tests.cpp:<line number>|nexpression failed|n REQUIRE( testCheckedIf( false ) )|nwith expansion:|n false|n'] +##teamcity[testFinished name='checkedIf, failing' duration="{duration}"] +##teamcity[testStarted name='classify_outliers'] +##teamcity[testFinished name='classify_outliers' duration="{duration}"] +##teamcity[testStarted name='comparisons between const int variables'] +##teamcity[testFinished name='comparisons between const int variables' duration="{duration}"] +##teamcity[testStarted name='comparisons between int variables'] +##teamcity[testFinished name='comparisons between int variables' duration="{duration}"] +##teamcity[testStarted name='convertToBits'] +##teamcity[testFinished name='convertToBits' duration="{duration}"] +##teamcity[testStarted name='empty tags are not allowed'] +##teamcity[testFinished name='empty tags are not allowed' duration="{duration}"] +##teamcity[testStarted name='erfc_inv'] +##teamcity[testFinished name='erfc_inv' duration="{duration}"] +##teamcity[testStarted name='estimate_clock_resolution'] +##teamcity[testFinished name='estimate_clock_resolution' duration="{duration}"] +##teamcity[testStarted name='even more nested SECTION tests'] +##teamcity[testFinished name='even more nested SECTION tests' duration="{duration}"] +##teamcity[testStarted name='first tag'] +##teamcity[testFinished name='first tag' duration="{duration}"] +##teamcity[testStarted name='has printf'] +##teamcity[testFinished name='has printf' duration="{duration}"] +##teamcity[testStarted name='is_unary_function'] +##teamcity[testFinished name='is_unary_function' duration="{duration}"] +##teamcity[testStarted name='just failure'] +Message.tests.cpp:<line number>|nexplicit failure with message:|n "Previous info should not be seen"'] +##teamcity[testFinished name='just failure' duration="{duration}"] +##teamcity[testStarted name='just failure after unscoped info'] +Message.tests.cpp:<line number>|nexplicit failure with message:|n "previous unscoped info SHOULD not be seen"'] +##teamcity[testFinished name='just failure after unscoped info' duration="{duration}"] +##teamcity[testStarted name='just info'] +##teamcity[testFinished name='just info' duration="{duration}"] +##teamcity[testStarted name='just unscoped info'] +##teamcity[testFinished name='just unscoped info' duration="{duration}"] +##teamcity[testStarted name='long long'] +##teamcity[testFinished name='long long' duration="{duration}"] +##teamcity[testStarted name='looped SECTION tests'] +Misc.tests.cpp:<line number>|nexpression failed|n CHECK( b > a )|nwith expansion:|n 0 > 1|n'] +Misc.tests.cpp:<line number>|nexpression failed|n CHECK( b > a )|nwith expansion:|n 1 > 1|n'] +##teamcity[testFinished name='looped SECTION tests' duration="{duration}"] +##teamcity[testStarted name='looped tests'] +Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[0|] (1) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] +Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[1|] (1) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] +Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[3|] (3) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] +Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[4|] (5) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] +Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[6|] (13) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] +Misc.tests.cpp:<line number>|nexpression failed with message:|n "Testing if fib|[7|] (21) is even"|n CHECK( ( fib|[i|] % 2 ) == 0 )|nwith expansion:|n 1 == 0|n'] +##teamcity[testFinished name='looped tests' duration="{duration}"] +##teamcity[testStarted name='makeStream recognizes %debug stream name'] +##teamcity[testFinished name='makeStream recognizes %debug stream name' duration="{duration}"] +##teamcity[testStarted name='make_unique reimplementation'] +##teamcity[testFinished name='make_unique reimplementation' duration="{duration}"] +##teamcity[testStarted name='mean'] +##teamcity[testFinished name='mean' duration="{duration}"] +##teamcity[testStarted name='measure'] +##teamcity[testFinished name='measure' duration="{duration}"] +##teamcity[testStarted name='mix info, unscoped info and warning'] +##teamcity[testFinished name='mix info, unscoped info and warning' duration="{duration}"] +##teamcity[testStarted name='more nested SECTION tests'] +Misc.tests.cpp:<line number>|nexpression failed|n REQUIRE( a == b )|nwith expansion:|n 1 == 2|n'] +##teamcity[testFinished name='more nested SECTION tests' duration="{duration}"] +##teamcity[testStarted name='nested SECTION tests'] +##teamcity[testFinished name='nested SECTION tests' duration="{duration}"] +##teamcity[testStarted name='non streamable - with conv. op'] +##teamcity[testFinished name='non streamable - with conv. op' duration="{duration}"] +##teamcity[testStarted name='non-copyable objects'] +##teamcity[testFinished name='non-copyable objects' duration="{duration}"] +##teamcity[testStarted name='normal_cdf'] +##teamcity[testFinished name='normal_cdf' duration="{duration}"] +##teamcity[testStarted name='normal_quantile'] +##teamcity[testFinished name='normal_quantile' duration="{duration}"] +##teamcity[testStarted name='not allowed'] +##teamcity[testFinished name='not allowed' duration="{duration}"] +##teamcity[testStarted name='not prints unscoped info from previous failures'] +Message.tests.cpp:<line number>|nexpression failed with message:|n "this SHOULD be seen"|n REQUIRE( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='not prints unscoped info from previous failures' duration="{duration}"] +##teamcity[testStarted name='null strings'] +##teamcity[testFinished name='null strings' duration="{duration}"] +##teamcity[testStarted name='null_ptr'] +##teamcity[testFinished name='null_ptr' duration="{duration}"] +##teamcity[testStarted name='pair<pair<int,const char *,pair<std::string,int> > -> toString'] +##teamcity[testFinished name='pair<pair<int,const char *,pair<std::string,int> > -> toString' duration="{duration}"] +##teamcity[testStarted name='parseEnums'] +##teamcity[testFinished name='parseEnums' duration="{duration}"] +##teamcity[testStarted name='pointer to class'] +##teamcity[testFinished name='pointer to class' duration="{duration}"] +##teamcity[testStarted name='print unscoped info if passing unscoped info is printed'] +##teamcity[testFinished name='print unscoped info if passing unscoped info is printed' duration="{duration}"] +##teamcity[testStarted name='prints unscoped info on failure'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "this SHOULD be seen"|n "this SHOULD also be seen"|n REQUIRE( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='prints unscoped info on failure' duration="{duration}"] +##teamcity[testStarted name='prints unscoped info only for the first assertion'] +Message.tests.cpp:<line number>|nexpression failed with message:|n "this SHOULD be seen only ONCE"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='prints unscoped info only for the first assertion' duration="{duration}"] +##teamcity[testStarted name='random SECTION tests'] +##teamcity[testFinished name='random SECTION tests' duration="{duration}"] +##teamcity[testStarted name='replaceInPlace'] +##teamcity[testFinished name='replaceInPlace' duration="{duration}"] +##teamcity[testStarted name='request an unknown %-starting stream fails'] +##teamcity[testFinished name='request an unknown %-starting stream fails' duration="{duration}"] +##teamcity[testStarted name='resolution'] +##teamcity[testFinished name='resolution' duration="{duration}"] +##teamcity[testStarted name='run_for_at_least, chronometer'] +##teamcity[testFinished name='run_for_at_least, chronometer' duration="{duration}"] +##teamcity[testStarted name='run_for_at_least, int'] +##teamcity[testFinished name='run_for_at_least, int' duration="{duration}"] +##teamcity[testStarted name='second tag'] +##teamcity[testFinished name='second tag' duration="{duration}"] +##teamcity[testStarted name='send a single char to INFO'] +Misc.tests.cpp:<line number>|nexpression failed with message:|n "3"|n REQUIRE( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='send a single char to INFO' duration="{duration}"] +##teamcity[testStarted name='sends information to INFO'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "hi"|n "i := 7"|n REQUIRE( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='sends information to INFO' duration="{duration}"] +##teamcity[testStarted name='shortened hide tags are split apart'] +##teamcity[testFinished name='shortened hide tags are split apart' duration="{duration}"] +##teamcity[testStarted name='splitString'] +##teamcity[testFinished name='splitString' duration="{duration}"] +##teamcity[testStarted name='stacks unscoped info in loops'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "Count 1 to 3..."|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] +Message.tests.cpp:<line number>|nexpression failed with messages:|n "Count 4 to 6..."|n "4"|n "5"|n "6"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='stacks unscoped info in loops' duration="{duration}"] +##teamcity[testStarted name='startsWith'] +##teamcity[testFinished name='startsWith' duration="{duration}"] +##teamcity[testStarted name='std::map is convertible string'] +##teamcity[testFinished name='std::map is convertible string' duration="{duration}"] +##teamcity[testStarted name='std::pair<int,const std::string> -> toString'] +##teamcity[testFinished name='std::pair<int,const std::string> -> toString' duration="{duration}"] +##teamcity[testStarted name='std::pair<int,std::string> -> toString'] +##teamcity[testFinished name='std::pair<int,std::string> -> toString' duration="{duration}"] +##teamcity[testStarted name='std::set is convertible string'] +##teamcity[testFinished name='std::set is convertible string' duration="{duration}"] +##teamcity[testStarted name='std::vector<std::pair<std::string,int> > -> toString'] +##teamcity[testFinished name='std::vector<std::pair<std::string,int> > -> toString' duration="{duration}"] +##teamcity[testStarted name='stdout and stderr streams have %-starting name'] +##teamcity[testFinished name='stdout and stderr streams have %-starting name' duration="{duration}"] +##teamcity[testStarted name='stringify ranges'] +##teamcity[testFinished name='stringify ranges' duration="{duration}"] +##teamcity[testStarted name='stringify( has_maker )'] +##teamcity[testFinished name='stringify( has_maker )' duration="{duration}"] +##teamcity[testStarted name='stringify( has_maker_and_operator )'] +##teamcity[testFinished name='stringify( has_maker_and_operator )' duration="{duration}"] +##teamcity[testStarted name='stringify( has_neither )'] +##teamcity[testFinished name='stringify( has_neither )' duration="{duration}"] +##teamcity[testStarted name='stringify( has_operator )'] +##teamcity[testFinished name='stringify( has_operator )' duration="{duration}"] +##teamcity[testStarted name='stringify( has_template_operator )'] +##teamcity[testFinished name='stringify( has_template_operator )' duration="{duration}"] +##teamcity[testStarted name='stringify( vectors<has_maker> )'] +##teamcity[testFinished name='stringify( vectors<has_maker> )' duration="{duration}"] +##teamcity[testStarted name='stringify( vectors<has_maker_and_operator> )'] +##teamcity[testFinished name='stringify( vectors<has_maker_and_operator> )' duration="{duration}"] +##teamcity[testStarted name='stringify( vectors<has_operator> )'] +##teamcity[testFinished name='stringify( vectors<has_operator> )' duration="{duration}"] +##teamcity[testStarted name='strlen3'] +##teamcity[testFinished name='strlen3' duration="{duration}"] +##teamcity[testStarted name='tables'] +##teamcity[testFinished name='tables' duration="{duration}"] +##teamcity[testStarted name='tags with dots in later positions are not parsed as hidden'] +##teamcity[testFinished name='tags with dots in later positions are not parsed as hidden' duration="{duration}"] +##teamcity[testStarted name='thrown std::strings are translated'] +Exception.tests.cpp:<line number>|nunexpected exception with message:|n "Why would you throw a std::string?"'] +##teamcity[testFinished name='thrown std::strings are translated' duration="{duration}"] +##teamcity[testStarted name='toString on const wchar_t const pointer returns the string contents'] +##teamcity[testFinished name='toString on const wchar_t const pointer returns the string contents' duration="{duration}"] +##teamcity[testStarted name='toString on const wchar_t pointer returns the string contents'] +##teamcity[testFinished name='toString on const wchar_t pointer returns the string contents' duration="{duration}"] +##teamcity[testStarted name='toString on wchar_t const pointer returns the string contents'] +##teamcity[testFinished name='toString on wchar_t const pointer returns the string contents' duration="{duration}"] +##teamcity[testStarted name='toString on wchar_t returns the string contents'] +##teamcity[testFinished name='toString on wchar_t returns the string contents' duration="{duration}"] +##teamcity[testStarted name='toString(enum class w/operator<<)'] +##teamcity[testFinished name='toString(enum class w/operator<<)' duration="{duration}"] +##teamcity[testStarted name='toString(enum class)'] +##teamcity[testFinished name='toString(enum class)' duration="{duration}"] +##teamcity[testStarted name='toString(enum w/operator<<)'] +##teamcity[testFinished name='toString(enum w/operator<<)' duration="{duration}"] +##teamcity[testStarted name='toString(enum)'] +##teamcity[testFinished name='toString(enum)' duration="{duration}"] +##teamcity[testStarted name='tuple<>'] +##teamcity[testFinished name='tuple<>' duration="{duration}"] +##teamcity[testStarted name='tuple<float,int>'] +##teamcity[testFinished name='tuple<float,int>' duration="{duration}"] +##teamcity[testStarted name='tuple<int>'] +##teamcity[testFinished name='tuple<int>' duration="{duration}"] +##teamcity[testStarted name='tuple<string,string>'] +##teamcity[testFinished name='tuple<string,string>' duration="{duration}"] +##teamcity[testStarted name='tuple<tuple<int>,tuple<>,float>'] +##teamcity[testFinished name='tuple<tuple<int>,tuple<>,float>' duration="{duration}"] +##teamcity[testStarted name='uniform samples'] +##teamcity[testFinished name='uniform samples' duration="{duration}"] +##teamcity[testStarted name='unique_ptr reimplementation: basic functionality'] +##teamcity[testFinished name='unique_ptr reimplementation: basic functionality' duration="{duration}"] +##teamcity[testStarted name='vec<vec<string,alloc>> -> toString'] +##teamcity[testFinished name='vec<vec<string,alloc>> -> toString' duration="{duration}"] +##teamcity[testStarted name='vector<bool> -> toString'] +##teamcity[testFinished name='vector<bool> -> toString' duration="{duration}"] +##teamcity[testStarted name='vector<int,allocator> -> toString'] +##teamcity[testFinished name='vector<int,allocator> -> toString' duration="{duration}"] +##teamcity[testStarted name='vector<int> -> toString'] +##teamcity[testFinished name='vector<int> -> toString' duration="{duration}"] +##teamcity[testStarted name='vector<string> -> toString'] +##teamcity[testFinished name='vector<string> -> toString' duration="{duration}"] +##teamcity[testStarted name='vectors can be sized and resized'] +##teamcity[testFinished name='vectors can be sized and resized' duration="{duration}"] +##teamcity[testStarted name='warmup'] +##teamcity[testFinished name='warmup' duration="{duration}"] +##teamcity[testStarted name='weighted_average_quantile'] +##teamcity[testFinished name='weighted_average_quantile' duration="{duration}"] +##teamcity[testStarted name='xmlentitycheck'] +##teamcity[testFinished name='xmlentitycheck' duration="{duration}"] +##teamcity[testSuiteFinished name='<exe-name>'] diff --git a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt index bd12e70a3..0167e59cf 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -1,28 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<Catch2TestRun name="<exe-name>" filters="~[!nonportable]~[!benchmark]~[approvals] *"> - <Randomness seed="1"/> +<Catch2TestRun name="<exe-name>" rng-seed="1" catch2-version="<version>" filters="~[!nonportable]~[!benchmark]~[approvals] *"> <TestCase name="# A test name that starts with a #" filename="tests/<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="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > - <Original> - fptr == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > - <Original> - fptr == 0l - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> <TestCase name="#1027: Bitfields can be captured" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > <Original> @@ -800,7 +780,7 @@ Nor would this </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="#835 -- errno should not be touched by Catch" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="#835 -- errno should not be touched by Catch2" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> f() == 0 @@ -811,7 +791,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - errno == 1 + errno_after == 1 </Original> <Expanded> 1 == 1 @@ -3014,6 +2994,144 @@ Nor would this </Section> <OverallResult success="true"/> </TestCase> + <TestCase name="CaseInsensitiveEqualsTo is case insensitive" tags="[comparisons][string-case]" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Section name="Degenerate cases" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "", "" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(eq( "", "a" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Plain comparisons" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "a", "a" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "a", "A" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "A", "a" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "A", "A" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(eq( "a", "b" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(eq( "a", "B" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="CaseInsensitiveLess is case insensitive" tags="[comparisons][string-case]" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Section name="Degenerate cases" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "", "a" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(lt( "a", "a" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(lt( "", "" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Plain comparisons" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "a", "b" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "a", "B" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "A", "b" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "A", "B" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> <TestCase name="Character pretty printing" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Section name="Specifically escaped" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > @@ -3157,13 +3275,106 @@ Nor would this </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Clara::Opt supports accept-many lambdas" tags="[clara][opt]" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Section name="Parsing fails on multiple options without accept_many" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + !(parse_result) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Parsing succeeds on multiple options with accept_many" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + parse_result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + res == std::vector<std::string>{ "aaa", "bbb" } + </Original> + <Expanded> + { "aaa", "bbb" } == { "aaa", "bbb" } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="ColourGuard behaviour" tags="[console-colours]" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Section name="ColourGuard is disengaged by default" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Original> + streamWrapper.str().empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="ColourGuard is engaged by op<<" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Original> + streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" + </Original> + <Expanded> + "1 +Using code: 2 +2 +Using code: 0 +3 +" +== +"1 +Using code: 2 +2 +Using code: 0 +3 +" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="ColourGuard can be engaged explicitly" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Original> + streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" + </Original> + <Expanded> + "Using code: 2 +A +B +Using code: 0 +C +" +== +"Using code: 2 +A +B +Using code: 0 +C +" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> <TestCase name="Combining MatchAllOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> 1, ( MatcherA() && MatcherB() ) && MatcherC() </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3171,7 +3382,7 @@ Nor would this 1, MatcherA() && ( MatcherB() && MatcherC() ) </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3179,7 +3390,7 @@ Nor would this 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true ) </Expanded> </Expression> <OverallResult success="true"/> @@ -3190,7 +3401,7 @@ Nor would this 1, ( MatcherA() || MatcherB() ) || MatcherC() </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3198,7 +3409,7 @@ Nor would this 1, MatcherA() || ( MatcherB() || MatcherC() ) </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3206,7 +3417,7 @@ Nor would this 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true ) </Expanded> </Expression> <OverallResult success="true"/> @@ -3217,7 +3428,7 @@ Nor would this 0, !MatcherA() </Original> <Expanded> - 0 not equals: (int) 1 or (float) 1.0f + 0 not equals: (int) 1 or (string) "1" </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3225,7 +3436,7 @@ Nor would this 1, !!MatcherA() </Original> <Expanded> - 1 equals: (int) 1 or (float) 1.0f + 1 equals: (int) 1 or (string) "1" </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3233,7 +3444,7 @@ Nor would this 0, !!!MatcherA() </Original> <Expanded> - 0 not equals: (int) 1 or (float) 1.0f + 0 not equals: (int) 1 or (string) "1" </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3241,7 +3452,7 @@ Nor would this 1, !!!!MatcherA() </Original> <Expanded> - 1 equals: (int) 1 or (float) 1.0f + 1 equals: (int) 1 or (string) "1" </Expanded> </Expression> <OverallResult success="true"/> @@ -3255,7 +3466,7 @@ Nor would this 1, MatcherA() || MatcherB() </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3263,7 +3474,7 @@ Nor would this 1, MatcherA() && MatcherB() </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -3271,7 +3482,7 @@ Nor would this 1, MatcherA() || !MatcherB() </Original> <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) + 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) </Expanded> </Expression> <OverallResult success="true"/> @@ -3884,7 +4095,7 @@ Nor would this <TestCase name="Contains string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) + testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) </Original> <Expanded> "this string contains 'abc' as a substring" contains: "not there" (case insensitive) @@ -3892,7 +4103,7 @@ Nor would this </Expression> <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "STRING" ) + testStringForMatching(), ContainsSubstring( "STRING" ) </Original> <Expanded> "this string contains 'abc' as a substring" contains: "STRING" @@ -4054,6 +4265,17 @@ Nor would this </Section> <OverallResult success="true"/> </TestCase> + <TestCase name="Cout stream properly declares it writes to stdout" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "-" )->isConsole() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="Custom exceptions can be translated when testing for nothrow" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Expression success="false" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> @@ -4136,6 +4358,28 @@ Nor would this </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Empty stream name opens cout stream" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "" )->isConsole() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Empty tag is not allowed" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) + </Original> + <Expanded> + Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="EndsWith string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> @@ -4592,7 +4836,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - thisThrows(), Contains( "except" ) + thisThrows(), ContainsSubstring( "except" ) </Original> <Expanded> "expected exception" contains: "except" @@ -4600,7 +4844,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) + thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) </Original> <Expanded> "expected exception" contains: "except" (case insensitive) @@ -6151,50 +6395,7 @@ Nor would this <OverallResults successes="7" failures="0" expectedFailures="0"/> </Section> <Section name="Filter generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Take less" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Simple filtering" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> gen.get() == 1 @@ -6213,10 +6414,10 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - gen.get() == 2 + gen.get() == 3 </Original> <Expanded> - 2 == 2 + 3 == 3 </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -6231,8 +6432,8 @@ Nor would this </Section> <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Section name="Take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Take more" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Filter generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Filter out multiple elements at the start and end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> gen.get() == 1 @@ -6241,23 +6442,121 @@ Nor would this 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - !(gen.next()) + gen.next() </Original> <Expanded> - !false + true </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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2.0 - </Original> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="Filter generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Throws on construction if it can't get initial element" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<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> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + filter([](int) { return false; }, values({ 1, 2, 3 })), Catch::GeneratorException + </Original> + <Expanded> + filter([](int) { return false; }, values({ 1, 2, 3 })), Catch::GeneratorException + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take less" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take more" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2.0 + </Original> <Expanded> 2.0 == 2.0 </Expanded> @@ -7922,6 +8221,87 @@ Nor would this </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Hashers with different seed produce different hash with same test case" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) != h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashers with same seed produce same hash" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) == h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing different test cases produces different result" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Section name="Different test name" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different classname" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different tags" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing test case produces same hash across multiple calls" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy ) == h( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="INFO and WARN do not abort tests" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > <Info> this is a message @@ -8356,7 +8736,7 @@ Nor would this <TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) + testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) </Original> <Expanded> "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) @@ -8367,7 +8747,7 @@ Nor would this <TestCase name="Matchers can be (AnyOf) composed with the || operator" tags="[matchers][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) + testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) </Original> <Expanded> "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) @@ -8375,7 +8755,7 @@ Nor would this </Expression> <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) + testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) </Original> <Expanded> "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) @@ -8386,7 +8766,7 @@ Nor would this <TestCase name="Matchers can be composed with both && and ||" tags="[matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) + testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) </Original> <Expanded> "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) @@ -8397,7 +8777,7 @@ Nor would this <TestCase name="Matchers can be composed with both && and || - failing" tags="[.][failing][matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) + testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) </Original> <Expanded> "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -8408,7 +8788,7 @@ Nor would this <TestCase name="Matchers can be negated (Not) with the ! operator" tags="[matchers][not][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), !Contains( "different" ) + testStringForMatching(), !ContainsSubstring( "different" ) </Original> <Expanded> "this string contains 'abc' as a substring" not contains: "different" @@ -8419,7 +8799,7 @@ Nor would this <TestCase name="Matchers can be negated (Not) with the ! operator - failing" tags="[.][failing][matchers][not][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), !Contains( "substring" ) + testStringForMatching(), !ContainsSubstring( "substring" ) </Original> <Expanded> "this string contains 'abc' as a substring" not contains: "substring" @@ -8427,6 +8807,43 @@ Nor would this </Expression> <OverallResult success="false"/> </TestCase> + <TestCase name="Mayfail test case with nested sections" tags="[!mayfail]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="1" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="A" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="2" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="A" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="0" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="1" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="B" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="2" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="B" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="0" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> <TestCase name="Mismatching exception messages failing the test" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> @@ -8446,76 +8863,226 @@ Nor would this </Expression> <OverallResult success="false"/> </TestCase> - <TestCase name="Nested generators and captured variables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 3 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 4 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 5 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <TestCase name="Multireporter calls reporters and listeners in correct order" tags="[multi-reporter][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - values > -6 + records == expected </Original> <Expanded> - 6 > -6 + { "Hello", "world", "Goodbye", "world" } +== +{ "Hello", "world", "Goodbye", "world" } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Multireporter updates ReporterPreferences properly" tags="[multi-reporter][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - values > -6 + multiReporter.getPreferences().shouldRedirectStdOut == false </Original> <Expanded> - -5 > -6 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - values > -6 + multiReporter.getPreferences().shouldReportAllAssertions == false </Original> <Expanded> - -4 > -6 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Adding listeners" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - values > -6 + multiReporter.getPreferences().shouldRedirectStdOut == false </Original> <Expanded> - 90 > -6 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - values > -6 + multiReporter.getPreferences().shouldReportAllAssertions == false </Original> <Expanded> - 91 > -6 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> + <Section name="Adding reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Nested generators and captured variables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 3 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 4 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 5 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 6 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + -5 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + -4 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 90 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 91 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> 92 > -6 </Expanded> </Expression> @@ -10438,218 +11005,515 @@ Nor would this </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="Pointers can be compared to null" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - p == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - p == pNULL - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <TestCase name="Parsed tags are matched case insensitive" tags="[test-spec][test-spec-parser]" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > <Original> - p != 0 - </Original> - <Expanded> - 0x<hex digits> != 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - cp != 0 - </Original> - <Expanded> - 0x<hex digits> != 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - cpc != 0 - </Original> - <Expanded> - 0x<hex digits> != 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - returnsNull() == 0 + spec.hasFilters() </Original> <Expanded> - {null string} == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > <Original> - returnsConstNull() == 0 + spec.getInvalidSpecs().empty() </Original> <Expanded> - {null string} == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > <Original> - 0 != p + spec.matches( testCase ) </Original> <Expanded> - 0 != 0x<hex digits> + true </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Precision of floating point stringification can be set" tags="[floatingPoint][toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Section name="Floats" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <TestCase name="Parsing sharding-related cli flags" tags="[sharding]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="shard-count" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - str1.size() == 3 + 5 + cli.parse({ "test", "--shard-count=8" }) </Original> <Expanded> - 8 == 8 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - str2.size() == 3 + 10 + config.shardCount == 8 </Original> <Expanded> - 13 == 13 + 8 == 8 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Double" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Negative shard count reports error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - str1.size() == 2 + 5 + !(result) </Original> <Expanded> - 7 == 7 + !{?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - str2.size() == 2 + 15 + result.errorMessage(), ContainsSubstring("Shard count must be a positive number") </Original> <Expanded> - 17 == 17 + "Shard count must be a positive number" contains: "Shard count must be a positive number" </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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - "foo", Predicate<const char*>( []( const char* const& ) { 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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="empty args don't cause a crash" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Zero shard count reports error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - result + !(result) </Original> <Expanded> - {?} + !{?} </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.processName == "" + result.errorMessage(), ContainsSubstring("Shard count must be a positive number") </Original> <Expanded> - "" == "" + "Shard count must be a positive number" contains: "Shard count must be a positive number" </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="default - no arguments" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="shard-index" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - result + cli.parse({ "test", "--shard-index=2" }) </Original> <Expanded> {?} </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.processName == "test" - </Original> - <Expanded> - "test" == "test" - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.shouldDebugBreak == false + config.shardIndex == 2 </Original> <Expanded> - false == false + 2 == 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Negative shard index reports error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.abortAfter == -1 + !(result) </Original> <Expanded> - -1 == -1 + !{?} </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.noThrow == false + result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") </Original> <Expanded> - false == false + "Shard index must be a non-negative number" contains: "Shard index must be a non-negative number" </Expanded> </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shard index 0 is accepted" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.reporterName == "console" + cli.parse({ "test", "--shard-index=0" }) </Original> <Expanded> - "console" == "console" + {?} </Expanded> </Expression> - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - !(cfg.hasTestFilters()) + config.shardIndex == 0 </Original> <Expanded> - !false + 0 == 0 </Expanded> </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Specify one test case using" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.hasTestFilters() - </Original> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Parsing tags with non-alphabetical characters is pass-through" tags="[test-spec][test-spec-parser]" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Info> + tagString := "[tag with spaces]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.hasFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[tag with spaces]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.getInvalidSpecs().empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[tag with spaces]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.matches( testCase ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[I said "good day" sir!]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.hasFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[I said "good day" sir!]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.getInvalidSpecs().empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[I said "good day" sir!]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.matches( testCase ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Parsing warnings" tags="[cli][warnings]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="NoAssertions" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse( { "test", "-w", "NoAssertions" } ) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.warnings == WarnAbout::NoAssertions + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="NoTests is no longer supported" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(cli.parse( { "test", "-w", "NoTests" } )) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Combining multiple warnings" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Pointers can be compared to null" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p == pNULL + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + cp != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + cpc != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + returnsNull() == 0 + </Original> + <Expanded> + {null string} == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + returnsConstNull() == 0 + </Original> + <Expanded> + {null string} == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Floats" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + str1.size() == 3 + 5 + </Original> + <Expanded> + 8 == 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + str1.size() == 2 + 5 + </Original> + <Expanded> + 7 == 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "foo", Predicate<const char*>( []( const char* const& ) { 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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="empty args don't cause a crash" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.processName == "test" + </Original> + <Expanded> + "test" == "test" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.shouldDebugBreak == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.abortAfter == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.noThrow == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications.empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(cfg.hasTestFilters()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getReporterSpecs().size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getProcessedReporterSpecs().size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResults successes="11" failures="0" expectedFailures="0"/> + </Section> + <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Specify one test case using" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.hasTestFilters() + </Original> <Expanded> true </Expanded> @@ -10752,20 +11616,26 @@ Nor would this </Section> <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Section name="-r/console" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - cli.parse({"test", "-r", "console"}) + result </Original> <Expanded> {?} </Expanded> </Expression> + <Info> + result.errorMessage() := "" + </Info> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.reporterName == "console" + config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } </Original> <Expanded> - "console" == "console" + { {?} } == { {?} } </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -10774,20 +11644,26 @@ Nor would this </Section> <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Section name="-r/xml" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - cli.parse({"test", "-r", "xml"}) + result </Original> <Expanded> {?} </Expanded> </Expression> + <Info> + result.errorMessage() := "" + </Info> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.reporterName == "xml" + config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } </Original> <Expanded> - "xml" == "xml" + { {?} } == { {?} } </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -10796,20 +11672,76 @@ Nor would this </Section> <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Section name="--reporter/junit" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } + </Original> + <Expanded> + { {?} } == { {?} } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="must match one of the available ones" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - cli.parse({"test", "--reporter", "junit"}) + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("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="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="With output file" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result </Original> <Expanded> {?} </Expanded> </Expression> + <Info> + result.errorMessage() := "" + </Info> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.reporterName == "junit" + config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } </Original> <Expanded> - "junit" == "junit" + { {?} } == { {?} } </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -10817,37 +11749,104 @@ Nor would this <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Only one reporter is accepted" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="must match one of the available ones" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !result - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<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> + <Section name="With Windows-like absolute path as output file" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } + </Original> + <Expanded> + { {?} } == { {?} } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Multiple reporters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="All with output files" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } + </Original> + <Expanded> + { {?}, {?} } == { {?}, {?} } + </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="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Multiple reporters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Mixed output files and default output" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } + </Original> + <Expanded> + { {?}, {?} } == { {?}, {?} } + </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="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Multiple reporters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="cannot have multiple reporters with default output" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") + </Original> + <Expanded> + "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." + </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"/> @@ -10952,7 +11951,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - result.errorMessage(), Contains("convert") && Contains("oops") + result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") </Original> <Expanded> "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) @@ -11075,7 +12074,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - result.errorMessage(), Contains("never") && Contains("both") + result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") </Original> <Expanded> "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) @@ -11143,7 +12142,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.outputFilename == "filename.ext" + config.defaultOutputFilename == "filename.ext" </Original> <Expanded> "filename.ext" == "filename.ext" @@ -11165,7 +12164,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.outputFilename == "filename.ext" + config.defaultOutputFilename == "filename.ext" </Original> <Expanded> "filename.ext" == "filename.ext" @@ -11225,7 +12224,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.useColour == UseColour::Auto + config.defaultColourMode == ColourMode::PlatformDefault </Original> <Expanded> 0 == 0 @@ -11239,7 +12238,7 @@ Nor would this <Section name="auto" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - cli.parse({"test", "--use-colour", "auto"}) + cli.parse( { "test", "--colour-mode", "default" } ) </Original> <Expanded> {?} @@ -11247,7 +12246,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.useColour == UseColour::Auto + config.defaultColourMode == ColourMode::PlatformDefault </Original> <Expanded> 0 == 0 @@ -11261,7 +12260,7 @@ Nor would this <Section name="yes" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - cli.parse({"test", "--use-colour", "yes"}) + cli.parse({"test", "--colour-mode", "ansi"}) </Original> <Expanded> {?} @@ -11269,7 +12268,7 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.useColour == UseColour::Yes + config.defaultColourMode == ColourMode::ANSI </Original> <Expanded> 1 == 1 @@ -11283,7 +12282,7 @@ Nor would this <Section name="no" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - cli.parse({"test", "--use-colour", "no"}) + cli.parse({"test", "--colour-mode", "none"}) </Original> <Expanded> {?} @@ -11291,10 +12290,10 @@ Nor would this </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - config.useColour == UseColour::No + config.defaultColourMode == ColourMode::None </Original> <Expanded> - 2 == 2 + 3 == 3 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -11313,10 +12312,10 @@ Nor would this </Expression> <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - result.errorMessage(), Contains( "colour mode must be one of" ) + result.errorMessage(), ContainsSubstring( "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" + "colour mode must be one of: default, ansi, win32, or none. 'wrong' is not recognised" contains: "colour mode must be one of" </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -11468,6 +12467,44 @@ Nor would this </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Random seed generation accepts known methods" tags="[rng][seed]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(method) + </Original> + <Expanded> + Catch::generateRandomSeed(method) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(method) + </Original> + <Expanded> + Catch::generateRandomSeed(method) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(method) + </Original> + <Expanded> + Catch::generateRandomSeed(method) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Random seed generation reports unknown methods" tags="[rng][seed]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) + </Original> + <Expanded> + Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="Range type with sentinel" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > <Original> @@ -11517,6 +12554,17 @@ Nor would this </Expression> <OverallResult success="false"/> </TestCase> + <TestCase name="Registering reporter with '::' in name fails" tags="[registration][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" + </Original> + <Expanded> + "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="Regression test #1" tags="[matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> @@ -11537,13 +12585,13 @@ Nor would this !false </Expanded> </Expression> - <Section name="automake reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="Automake reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: automake + Tested reporter: Automake </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "All available tags: @@ -11563,13 +12611,13 @@ Nor would this !false </Expanded> </Expression> - <Section name="automake reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="Automake reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: automake + Tested reporter: Automake </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "Available reporters: @@ -11588,13 +12636,13 @@ Nor would this !false </Expanded> </Expression> - <Section name="automake reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="Automake reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: automake + Tested reporter: Automake </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "All available test cases: @@ -11621,7 +12669,7 @@ Nor would this </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "All available tags: @@ -11647,7 +12695,7 @@ Nor would this </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "Available reporters: @@ -11672,7 +12720,7 @@ Nor would this </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "All available test cases: @@ -11699,7 +12747,7 @@ Nor would this </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "All available tags: @@ -11725,7 +12773,7 @@ Nor would this </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "Available reporters: @@ -11750,7 +12798,7 @@ Nor would this </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "All available test cases: @@ -11771,13 +12819,13 @@ Nor would this !false </Expanded> </Expression> - <Section name="junit reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="JUnit reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: junit + Tested reporter: JUnit </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -11798,13 +12846,13 @@ All available tags: !false </Expanded> </Expression> - <Section name="junit reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="JUnit reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: junit + Tested reporter: JUnit </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -11824,13 +12872,13 @@ Available reporters: !false </Expanded> </Expression> - <Section name="junit reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="JUnit reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: junit + Tested reporter: JUnit </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -11852,13 +12900,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="sonarqube reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="SonarQube reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: sonarqube + Tested reporter: SonarQube </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -11879,13 +12927,13 @@ All available tags: !false </Expanded> </Expression> - <Section name="sonarqube reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="SonarQube reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: sonarqube + Tested reporter: SonarQube </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -11905,13 +12953,13 @@ Available reporters: !false </Expanded> </Expression> - <Section name="sonarqube reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="SonarQube reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: sonarqube + Tested reporter: SonarQube </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -11933,13 +12981,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="tap reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="TAP reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: tap + Tested reporter: TAP </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "All available tags: @@ -11959,13 +13007,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="tap reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="TAP reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: tap + Tested reporter: TAP </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "Available reporters: @@ -11984,13 +13032,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="tap reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="TAP reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: tap + Tested reporter: TAP </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "All available test cases: @@ -12011,13 +13059,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="teamcity reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="TeamCity reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: teamcity + Tested reporter: TeamCity </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "All available tags: @@ -12037,13 +13085,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="teamcity reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="TeamCity reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: teamcity + Tested reporter: TeamCity </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "Available reporters: @@ -12062,13 +13110,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="teamcity reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="TeamCity reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: teamcity + Tested reporter: TeamCity </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "All available test cases: @@ -12089,13 +13137,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="xml reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="XML reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: xml + Tested reporter: XML </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -12119,13 +13167,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="xml reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="XML reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: xml + Tested reporter: XML </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -12147,13 +13195,13 @@ All available test cases: !false </Expanded> </Expression> - <Section name="xml reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="XML reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Info> - Tested reporter: xml + Tested reporter: XML </Info> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -12174,6 +13222,9 @@ All available test cases: </Section> <OverallResult success="true"/> </TestCase> + <TestCase name="Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla" tags="[console-reporter]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <OverallResult success="true"/> + </TestCase> <TestCase name="SUCCEED counts as a test pass" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > <OverallResult success="true"/> </TestCase> @@ -12497,7 +13548,7 @@ Message from section two <TestCase name="String matchers" tags="[matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "string" ) + testStringForMatching(), ContainsSubstring( "string" ) </Original> <Expanded> "this string contains 'abc' as a substring" contains: "string" @@ -12505,7 +13556,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) + testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) </Original> <Expanded> "this string contains 'abc' as a substring" contains: "string" (case insensitive) @@ -12513,7 +13564,7 @@ Message from section two </Expression> <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "abc" ) + testStringForMatching(), ContainsSubstring( "abc" ) </Original> <Expanded> "this string contains 'abc' as a substring" contains: "abc" @@ -12521,7 +13572,7 @@ Message from section two </Expression> <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) + testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) </Original> <Expanded> "this string contains 'abc' as a substring" contains: "abc" (case insensitive) @@ -12627,658 +13678,1161 @@ Message from section two <Section name="From sub-string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - original == "original" + original == "original" + </Original> + <Expanded> + original == "original" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original.data() + </Original> + <Expanded> + original.data() + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Copy construction is shallow" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original.begin() == copy.begin() + </Original> + <Expanded> + "original string" == "original string" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Copy assignment is shallow" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original.begin() == copy.begin() + </Original> + <Expanded> + "original string" == "original string" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + ss.empty() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + ss.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="non-zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + ss.size() == 6 + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + std::strcmp( ss.data(), "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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Pointer values of full refs should match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Pointer values of substring refs should also match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Past the end substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Substring off the end are trimmed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + std::strcmp(ss.data(), "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="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="substring start after the end is empty" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + s.substr(1'000'000, 1).empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Comparisons are deep" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + reinterpret_cast<char*>(buffer1) != reinterpret_cast<char*>(buffer2) + </Original> + <Expanded> + "Hello" != "Hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + left == right </Original> <Expanded> - original == "original" + Hello == Hello </Expanded> </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - original.data() + left != left.substr(0, 3) </Original> <Expanded> - original.data() + Hello != Hel </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="3" failures="0" expectedFailures="0"/> </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="implicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - ss.empty() == false + sr == "a standard string" </Original> <Expanded> - false == false + a standard string == "a standard string" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - ss.size() == 5 + sr.size() == stdStr.size() </Original> <Expanded> - 5 == 5 + 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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - std::strncmp( ss.data(), "hello", 5 ) == 0 + sr == "a standard string" </Original> <Expanded> - 0 == 0 + a standard string == "a standard string" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - ss == "hello" + sr.size() == stdStr.size() </Original> <Expanded> - hello == "hello" + 17 == 17 </Expanded> </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="non-zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - ss.size() == 6 + sr == "a standard string" </Original> <Expanded> - 6 == 6 + a standard string == "a standard string" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - std::strcmp( ss.data(), "world!" ) == 0 + sr.size() == stdStr.size() </Original> <Expanded> - 0 == 0 + 17 == 17 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Pointer values of full refs should match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="to std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - s.data() == s2.data() + stdStr == "a stringref" </Original> <Expanded> - "hello world!" == "hello world!" + "a stringref" == "a stringref" </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Pointer values of substring refs should also match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - s.data() == ss.data() + stdStr.size() == sr.size() </Original> <Expanded> - "hello world!" == "hello world!" + 11 == 11 </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Past the end substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="to std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - s.substr(s.size() + 1, 123).empty() + stdStr == "a stringref" </Original> <Expanded> - true + "a stringref" == "a stringref" </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Substring off the end are trimmed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - std::strcmp(ss.data(), "world!") == 0 + stdStr.size() == sr.size() </Original> <Expanded> - 0 == 0 + 11 == 11 </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="std::string += StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + lhs == "some string += the stringref contents" + </Original> + <Expanded> + "some string += the stringref contents" +== +"some string += the stringref contents" + </Expanded> + </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="substring start after the end is empty" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.substr(1'000'000, 1).empty() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> + <Section name="StringRef + StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + together == "abrakadabra" + </Original> + <Expanded> + "abrakadabra" == "abrakadabra" + </Expanded> + </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="Comparisons are deep" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="StringRef at compilation time" tags="[constexpr][StringRef][Strings]" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Simple constructors" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <OverallResults successes="12" failures="0" expectedFailures="0"/> + </Section> + <Section name="UDL construction" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - signed char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - unsigned char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + minute == seconds + </Original> + <Expanded> + 1 m == 60 s + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + hour != seconds + </Original> + <Expanded> + 1 h != 60 s + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + micro != milli + </Original> + <Expanded> + 1 us != 1 ms + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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<system_clock>" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="[.][failing][whitespace]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Section name="The same tag alias can only be registered once" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - reinterpret_cast<char*>(buffer1) != reinterpret_cast<char*>(buffer2) + what, ContainsSubstring( "[@zzz]" ) </Original> <Expanded> - "Hello" != "Hello" + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "[@zzz]" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - left == right + what, ContainsSubstring( "file" ) </Original> <Expanded> - Hello == Hello + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "file" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - left != left.substr(0, 3) + what, ContainsSubstring( "2" ) </Original> <Expanded> - Hello != Hel + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "2" </Expanded> </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="implicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - stdStr == "a stringref" - </Original> - <Expanded> - "a stringref" == "a stringref" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - stdStr == "a stringref" - </Original> - <Expanded> - "a stringref" == "a stringref" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="std::string += StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - lhs == "some string += the stringref contents" + what, ContainsSubstring( "10" ) </Original> <Expanded> - "some string += the stringref contents" -== -"some string += the stringref contents" + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "10" </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Section name="StringRef + StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Tag aliases must be of the form [@name]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - together == "abrakadabra" + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) </Original> <Expanded> - "abrakadabra" == "abrakadabra" + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <Expression success="true" type="CHECK_THROWS" filename="tests/<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="tests/<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="tests/<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="StringRef at compilation time" tags="[constexpr][StringRef][Strings]" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Simple constructors" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <OverallResults successes="12" failures="0" expectedFailures="0"/> - </Section> - <Section name="UDL construction" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> + <TestCase name="Tags with spaces and non-alphanumerical characters are accepted" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) + </Original> + <Expanded> + { {?}, {?} } ( Contains: {?} and Contains: {?} ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + sizeof(TestType) > 0 + </Original> + <Expanded> + 1 > 0 + </Expanded> + </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Stringifying char arrays with statically known sizes - char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <TestCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + sizeof(TestType) > 0 </Original> <Expanded> - ""abc"" == ""abc"" + 4 > 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + sizeof(TestType) > 0 </Original> <Expanded> - ""abc"" == ""abc"" + 1 > 0 </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Stringifying char arrays with statically known sizes - signed char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <TestCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + sizeof(TestType) > 0 </Original> <Expanded> - ""abc"" == ""abc"" + 4 > 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + sizeof(TestType) > 0 </Original> <Expanded> - ""abc"" == ""abc"" + 4 > 0 </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Stringifying char arrays with statically known sizes - unsigned char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + sizeof(TestType) > 0 </Original> <Expanded> - ""abc"" == ""abc"" + 1 > 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 2" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + sizeof(TestType) > 0 </Original> <Expanded> - ""abc"" == ""abc"" + 4 > 0 </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <TestCase name="TemplateTest: vectors can be sized and resized - float" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - minute == seconds + v.size() == 5 </Original> <Expanded> - 1 m == 60 s + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - hour != seconds + v.capacity() >= 5 </Original> <Expanded> - 1 h != 60 s + 5 >= 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - micro != milli + v.size() == 5 </Original> <Expanded> - 1 us != 1 ms + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - nano != micro + v.capacity() >= 5 </Original> <Expanded> - 1 ns != 1 us + 5 >= 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Stringifying std::chrono::duration with weird ratios" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - half_minute != femto_second + v.size() == 5 </Original> <Expanded> - 1 [30/1]s != 1 fs + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - pico_second != atto_second + v.capacity() >= 5 </Original> <Expanded> - 1 ps != 1 as + 5 >= 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Stringifying std::chrono::time_point<system_clock>" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - now != later + v.size() == 5 </Original> <Expanded> - {iso8601-timestamp} -!= -{iso8601-timestamp} + 5 == 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Tabs and newlines show in output" tags="[.][failing][whitespace]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - s1 == s2 + v.capacity() >= 5 </Original> <Expanded> - "if ($b == 10) { - $a = 20; -}" -== -"if ($b == 10) { - $a = 20; -} -" + 5 >= 5 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Tag alias can be registered against tag patterns" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Section name="The same tag alias can only be registered once" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - what, Contains( "[@zzz]" ) + v.size() == 5 </Original> <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "[@zzz]" + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - what, Contains( "file" ) + v.capacity() >= 5 </Original> <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "file" + 5 >= 5 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - what, Contains( "2" ) + v.size() == 10 </Original> <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "2" + 10 == 10 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - what, Contains( "10" ) + v.capacity() >= 10 </Original> <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "10" + 10 >= 10 </Expanded> </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Tag aliases must be of the form [@name]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + v.size() == 0 </Original> <Expanded> - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + v.capacity() >= 5 </Original> <Expanded> - registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + 5 >= 5 </Expanded> </Expression> - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + v.size() == 5 </Original> <Expanded> - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + v.capacity() >= 10 </Original> <Expanded> - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + 10 >= 10 </Expanded> </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> + <OverallResults successes="2" 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="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + v.size() == 5 </Original> <Expanded> - 1 == 1 + 5 == 5 </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="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + v.capacity() >= 5 </Original> <Expanded> - 1 == 1 + 5 >= 5 </Expanded> </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="Template test case method with test types specified inside std::tuple - MyTypes - 2" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <TestCase name="TemplateTest: vectors can be sized and resized - std::string" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + v.size() == 5 </Original> <Expanded> - 1.0 == 1 + 5 == 5 </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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - sizeof(TestType) > 0 + v.capacity() >= 5 </Original> <Expanded> - 1 > 0 + 5 >= 5 </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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - sizeof(TestType) > 0 + v.size() == 5 </Original> <Expanded> - 4 > 0 + 5 == 5 </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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - sizeof(TestType) > 0 + v.capacity() >= 5 </Original> <Expanded> - 1 > 0 + 5 >= 5 </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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - sizeof(TestType) > 0 + v.size() == 5 </Original> <Expanded> - 4 > 0 + 5 == 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - sizeof(TestType) > 0 + v.capacity() >= 5 </Original> <Expanded> - 4 > 0 + 5 >= 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - sizeof(TestType) > 0 + v.size() == 5 </Original> <Expanded> - 1 > 0 + 5 == 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 2" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - sizeof(TestType) > 0 + v.capacity() >= 5 </Original> <Expanded> - 4 > 0 + 5 >= 5 </Expanded> </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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 - float" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> v.size() == 5 @@ -13432,56 +14986,56 @@ Message from section two </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - int" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 6 == 6 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 6 >= 6 </Expanded> </Expression> <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 10 + v.size() == 2 * V </Original> <Expanded> - 10 == 10 + 12 == 12 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 10 + v.capacity() >= 2 * V </Original> <Expanded> - 10 >= 10 + 12 >= 12 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 6 == 6 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 6 >= 6 </Expanded> </Expression> <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13495,10 +15049,10 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 6 >= 6 </Expanded> </Expression> <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13516,126 +15070,126 @@ Message from section two </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 6 == 6 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 6 >= 6 </Expanded> </Expression> <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 6 == 6 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 10 + v.capacity() >= 2 * V </Original> <Expanded> - 10 >= 10 + 12 >= 12 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 6 == 6 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 6 >= 6 </Expanded> </Expression> <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 6 == 6 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 6 >= 6 </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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTestSig: vectors can be sized and resized - float,4" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 4 == 4 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 4 >= 4 </Expanded> </Expression> <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 10 + v.size() == 2 * V </Original> <Expanded> - 10 == 10 + 8 == 8 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 10 + v.capacity() >= 2 * V </Original> <Expanded> - 10 >= 10 + 8 >= 8 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 4 == 4 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 4 >= 4 </Expanded> </Expression> <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13649,10 +15203,10 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 4 >= 4 </Expanded> </Expression> <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13670,80 +15224,80 @@ Message from section two </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 4 == 4 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 4 >= 4 </Expanded> </Expression> <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 4 == 4 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 10 + v.capacity() >= 2 * V </Original> <Expanded> - 10 >= 10 + 8 >= 8 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 4 == 4 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 4 >= 4 </Expanded> </Expression> <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> - 5 == 5 + 4 == 4 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> - 5 >= 5 + 4 >= 4 </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<int,float>" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTestSig: vectors can be sized and resized - int,5" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> 5 == 5 @@ -13751,7 +15305,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> 5 >= 5 @@ -13760,7 +15314,7 @@ Message from section two <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 10 + v.size() == 2 * V </Original> <Expanded> 10 == 10 @@ -13768,7 +15322,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 10 + v.capacity() >= 2 * V </Original> <Expanded> 10 >= 10 @@ -13778,7 +15332,7 @@ Message from section two </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> 5 == 5 @@ -13786,7 +15340,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> 5 >= 5 @@ -13803,7 +15357,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> 5 >= 5 @@ -13824,7 +15378,7 @@ Message from section two </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> 5 == 5 @@ -13832,7 +15386,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> 5 >= 5 @@ -13841,7 +15395,7 @@ Message from section two <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> 5 == 5 @@ -13849,7 +15403,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 10 + v.capacity() >= 2 * V </Original> <Expanded> 10 >= 10 @@ -13859,7 +15413,7 @@ Message from section two </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> 5 == 5 @@ -13867,7 +15421,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> 5 >= 5 @@ -13876,7 +15430,7 @@ Message from section two <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.size() == V </Original> <Expanded> 5 == 5 @@ -13884,7 +15438,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() >= V </Original> <Expanded> 5 >= 5 @@ -13894,13 +15448,13 @@ Message from section two </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTestSig: vectors can be sized and resized - std::string,15" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> v.size() == V </Original> <Expanded> - 6 == 6 + 15 == 15 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13908,7 +15462,7 @@ Message from section two v.capacity() >= V </Original> <Expanded> - 6 >= 6 + 15 >= 15 </Expanded> </Expression> <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13917,7 +15471,7 @@ Message from section two v.size() == 2 * V </Original> <Expanded> - 12 == 12 + 30 == 30 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13925,7 +15479,7 @@ Message from section two v.capacity() >= 2 * V </Original> <Expanded> - 12 >= 12 + 30 >= 30 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -13935,7 +15489,7 @@ Message from section two v.size() == V </Original> <Expanded> - 6 == 6 + 15 == 15 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13943,7 +15497,7 @@ Message from section two v.capacity() >= V </Original> <Expanded> - 6 >= 6 + 15 >= 15 </Expanded> </Expression> <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13960,7 +15514,7 @@ Message from section two v.capacity() >= V </Original> <Expanded> - 6 >= 6 + 15 >= 15 </Expanded> </Expression> <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13981,7 +15535,7 @@ Message from section two v.size() == V </Original> <Expanded> - 6 == 6 + 15 == 15 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13989,7 +15543,7 @@ Message from section two v.capacity() >= V </Original> <Expanded> - 6 >= 6 + 15 >= 15 </Expanded> </Expression> <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -13998,7 +15552,7 @@ Message from section two v.size() == V </Original> <Expanded> - 6 == 6 + 15 == 15 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -14006,7 +15560,7 @@ Message from section two v.capacity() >= 2 * V </Original> <Expanded> - 12 >= 12 + 30 >= 30 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -14016,7 +15570,7 @@ Message from section two v.size() == V </Original> <Expanded> - 6 == 6 + 15 == 15 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -14024,7 +15578,7 @@ Message from section two v.capacity() >= V </Original> <Expanded> - 6 >= 6 + 15 >= 15 </Expanded> </Expression> <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -14033,7 +15587,7 @@ Message from section two v.size() == V </Original> <Expanded> - 6 == 6 + 15 == 15 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -14041,640 +15595,740 @@ Message from section two v.capacity() >= V </Original> <Expanded> - 6 >= 6 + 15 >= 15 </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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="Test case with identical tags keeps just one" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags[0] == Tag( "tag1" ) + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test case with one argument" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test enum bit values" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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 "in name" tags="[cli][regression]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if" tags="[checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="false" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if 2" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == V + true </Original> <Expanded> - 4 == 4 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if 3" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= V + false </Original> <Expanded> - 4 >= 4 + false </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> + <OverallResult success="true"/> + </TestCase> + <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="false" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + 1 == 2 + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="The default listing implementation write to provided stream" tags="[reporter-helpers][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="Listing tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - v.size() == 2 * V + listingString, ContainsSubstring("[fakeTag]"s) </Original> <Expanded> - 8 == 8 + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "[fakeTag]" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - v.capacity() >= 2 * V + listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) </Original> <Expanded> - 8 >= 8 + "Available reporters: + fake reporter: fake description + +" ( contains: "fake reporter" and contains: "fake description" ) </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Listing tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - v.size() == 0 + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) </Original> <Expanded> - 0 == 0 + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Listing listeners" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - v.capacity() >= V + listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) </Original> <Expanded> - 4 >= 4 + "Registered listeners: + fakeListener: fake description + +" ( contains: "fakeListener" and contains: "fake description" ) </Expanded> </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<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"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + For some reason someone is throwing a string literal! + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Tracker" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + testCase.isOpen() </Original> <Expanded> - 4 == 4 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + s1.isOpen() </Original> <Expanded> - 4 >= 4 + true </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="successfully close one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + s1.isSuccessfullyCompleted() </Original> <Expanded> - 4 == 4 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= 2 * V + testCase.isComplete() == false </Original> <Expanded> - 8 >= 8 + false == false </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + ctx.completedCycle() </Original> <Expanded> - 4 == 4 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + testCase.isSuccessfullyCompleted() </Original> <Expanded> - 4 >= 4 + true </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="4" 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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + testCase.isOpen() </Original> <Expanded> - 5 == 5 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + s1.isOpen() </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == 2 * V + s1.isComplete() </Original> <Expanded> - 10 == 10 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= 2 * V + s1.isSuccessfullyCompleted() == false </Original> <Expanded> - 10 >= 10 + false == false </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == 0 + testCase.isComplete() == false </Original> <Expanded> - 0 == 0 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + ctx.completedCycle() </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="re-enter after failed section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() == 0 + s1b.isOpen() == false </Original> <Expanded> - 0 == 0 + false == false </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <OverallResults successes="10" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + testCase.isOpen() </Original> <Expanded> - 5 == 5 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + s1.isOpen() </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + s1.isComplete() </Original> <Expanded> - 5 == 5 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= 2 * V + s1.isSuccessfullyCompleted() == false </Original> <Expanded> - 10 >= 10 + false == false </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + testCase.isComplete() == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + ctx.completedCycle() </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTestSig: vectors can be sized and resized - std::string,15" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + testCase.isOpen() </Original> <Expanded> - 15 == 15 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + s1.isOpen() </Original> <Expanded> - 15 >= 15 + true </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == 2 * V + s2.isOpen() == false </Original> <Expanded> - 30 == 30 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= 2 * V + testCase.isComplete() == false </Original> <Expanded> - 30 >= 30 + false == false </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <Section name="Re-enter - skips S1 and enters S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="Successfully close S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == V + testCase.isOpen() </Original> <Expanded> - 15 == 15 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + s1.isOpen() </Original> <Expanded> - 15 >= 15 + true </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.size() == 0 + s2.isOpen() == false </Original> <Expanded> - 0 == 0 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() >= V + testCase.isComplete() == false </Original> <Expanded> - 15 >= 15 + false == false </Expanded> </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Re-enter - skips S1 and enters S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - v.capacity() == 0 + testCase2.isOpen() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="fail S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase3.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1c.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2c.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 15 >= 15 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="14" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Test case with one argument" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Test enum bit values" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<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 "in name" tags="[cli][regression]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Testing checked-if" tags="[checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="false" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - false - </Original> - <Expanded> - false - </Expanded> - </Expression> - <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - false - </Original> - <Expanded> - false - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Testing checked-if 2" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - true + testCase.isOpen() </Original> <Expanded> true </Expanded> </Expression> - <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Testing checked-if 3" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - false - </Original> - <Expanded> - false - </Expanded> - </Expression> - <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> - <OverallResult success="true"/> - </TestCase> - <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Expression success="false" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - 1 == 2 + s1.isOpen() </Original> <Expanded> - 1 == 2 + true </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="The default listing implementation write to provided stream" tags="[reporter-helpers][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Section name="Listing tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="open a nested section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - listingString, Contains("[fakeTag]"s) + s2.isOpen() </Original> <Expanded> - "All available tags: - 1 [fakeTag] -1 tag - -" contains: "[fakeTag]" + true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + s2.isComplete() </Original> <Expanded> - "Available reporters: - fake reporter: fake description - -" contains: "fake reporter" + true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Listing tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + s1.isComplete() == false </Original> <Expanded> - "All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) + false == false </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - For some reason someone is throwing a string literal! - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Tracker" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="successfully close one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isSuccessfullyCompleted() + s1.isComplete() </Original> <Expanded> true @@ -14690,703 +16344,733 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isSuccessfullyCompleted() + testCase.isComplete() </Original> <Expanded> true </Expanded> </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Trim strings" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - testCase.isOpen() + trim(std::string(no_whitespace)) == no_whitespace </Original> <Expanded> - true + "There is no extra whitespace here" +== +"There is no extra whitespace here" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - s1.isOpen() + trim(std::string(leading_whitespace)) == no_whitespace </Original> <Expanded> - true + "There is no extra whitespace here" +== +"There is no extra whitespace here" </Expanded> </Expression> - <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + 3.14 + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Upcasting special member functions" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - s1.isComplete() + bptr->i == 3 </Original> <Expanded> - true + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - s1.isSuccessfullyCompleted() == false + bptr->i == 3 </Original> <Expanded> - false == false + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AllMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase.isComplete() == false + data, AllMatch(SizeIs(5)) </Original> <Expanded> - false == false + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ctx.completedCycle() + data, !AllMatch(Contains(0) && Contains(1)) </Original> <Expanded> - true + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() == false + needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) </Original> <Expanded> - false == false + { 1, 2, 3, 4, 5 } all match matches undescribed predicate </Expanded> </Expression> - <Section name="re-enter after failed section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase2.isOpen() + mocked, allMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s1b.isOpen() == false + mocked.m_derefed[1] </Original> <Expanded> - false == false + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ctx.completedCycle() + mocked.m_derefed[2] </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase.isComplete() + mocked.m_derefed[3] </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() + mocked.m_derefed[4] </Original> <Expanded> true </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase2.isOpen() + mocked, !allMatch </Original> <Expanded> - true + { 1, 2, 3, 4, 5 } not all match matches undescribed predicate </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s1b.isOpen() == false + mocked.m_derefed[0] </Original> <Expanded> - false == false + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s2.isOpen() + mocked.m_derefed[1] </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ctx.completedCycle() + mocked.m_derefed[2] </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase.isComplete() + !(mocked.m_derefed[3]) </Original> <Expanded> - true + !false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() + !(mocked.m_derefed[4]) </Original> <Expanded> - true + !false </Expanded> </Expression> <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="11" failures="0" expectedFailures="0"/> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AllTrue range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase2.isOpen() + data, AllTrue() </Original> <Expanded> - true + { true, true, true, true, true } contains only true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Empty evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s1b.isOpen() == false + data, AllTrue() </Original> <Expanded> - false == false + { } contains only true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One false evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s2b.isOpen() + data, !AllTrue() </Original> <Expanded> - true + { true, true, false, true, true } not contains only true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ctx.completedCycle() == false + data, !AllTrue() </Original> <Expanded> - false == false + { false, false, false, false, false } not contains only true </Expanded> </Expression> - <Section name="Successfully close S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AllTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One false evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - testCase2.isOpen() + data, !AllTrue() </Original> <Expanded> - true + { true, true, false, true, true } not contains only true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s1b.isOpen() == false + data, !AllTrue() </Original> <Expanded> - false == false + { false, false, false, false, false } not contains only true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s2b.isOpen() + mocked, AllTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains only true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ctx.completedCycle() == false + mocked.m_derefed[1] </Original> <Expanded> - false == false + true </Expanded> </Expression> - <Section name="fail S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase3.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1c.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2c.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="open a nested section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !AllTrue() + </Original> + <Expanded> + { true, true, false, true, true } not contains only true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="Unexpected exceptions can be translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - 3.14 - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Upcasting special member functions" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <TestCase name="Usage of AnyMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - bptr->i == 3 + data, AnyMatch(SizeIs(5)) </Original> <Expanded> - 3 == 3 + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyMatch(Contains(0) && Contains(10)) + </Original> + <Expanded> + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - bptr->i == 3 + needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) </Original> <Expanded> - 3 == 3 + { 1, 2, 3, 4, 5 } any match matches undescribed predicate </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Usage of AllMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, AllMatch(SizeIs(5)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, !AllMatch(Contains(0) && Contains(1)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !anyMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } not any match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, anyMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } any match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[1]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[2]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AnyTrue range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Empty evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyTrue() + </Original> + <Expanded> + { } not contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { false, false, true, false, false } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyTrue() + </Original> + <Expanded> + { false, false, false, false, false } not contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { false, false, true, false, false } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } all match matches undescribed predicate - </Expanded> - </Expression> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyTrue() + </Original> + <Expanded> + { false, false, false, false, false } not contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked, allMatch + mocked, AnyTrue() </Original> <Expanded> - { 1, 2, 3, 4, 5 } all match matches undescribed predicate + { false, false, false, false, true } contains at least one true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[0] + mocked.m_derefed[0] </Original> <Expanded> true @@ -15394,7 +17078,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[1] + mocked.m_derefed[1] </Original> <Expanded> true @@ -15402,7 +17086,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[2] + mocked.m_derefed[2] </Original> <Expanded> true @@ -15410,7 +17094,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[3] + mocked.m_derefed[3] </Original> <Expanded> true @@ -15418,7 +17102,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[4] + mocked.m_derefed[4] </Original> <Expanded> true @@ -15432,15 +17116,15 @@ There is no extra whitespace here <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked, !allMatch + mocked, AnyTrue() </Original> <Expanded> - { 1, 2, 3, 4, 5 } not all match matches undescribed predicate + { false, false, true, true, true } contains at least one true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[0] + mocked.m_derefed[0] </Original> <Expanded> true @@ -15448,7 +17132,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[1] + mocked.m_derefed[1] </Original> <Expanded> true @@ -15456,7 +17140,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[2] + mocked.m_derefed[2] </Original> <Expanded> true @@ -15464,7 +17148,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[3]) + !(mocked.m_derefed[3]) </Original> <Expanded> !false @@ -15472,7 +17156,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[4]) + !(mocked.m_derefed[4]) </Original> <Expanded> !false @@ -15484,22 +17168,22 @@ There is no extra whitespace here </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="Usage of AnyMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <TestCase name="Usage of NoneMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - data, AnyMatch(SizeIs(5)) + data, NoneMatch(SizeIs(6)) </Original> <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - data, !AnyMatch(Contains(0) && Contains(10)) + data, !NoneMatch(Contains(0) && Contains(1)) </Original> <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> @@ -15507,10 +17191,10 @@ There is no extra whitespace here <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) + needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) </Original> <Expanded> - { 1, 2, 3, 4, 5 } any match matches undescribed predicate + { 1, 2, 3, 4, 5 } none match matches undescribed predicate </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> @@ -15519,15 +17203,15 @@ There is no extra whitespace here <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked, !anyMatch + mocked, noneMatch </Original> <Expanded> - { 1, 2, 3, 4, 5 } not any match matches undescribed predicate + { 1, 2, 3, 4, 5 } none match matches undescribed predicate </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[0] + mocked.m_derefed[0] </Original> <Expanded> true @@ -15535,7 +17219,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[1] + mocked.m_derefed[1] </Original> <Expanded> true @@ -15543,7 +17227,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[2] + mocked.m_derefed[2] </Original> <Expanded> true @@ -15551,7 +17235,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[3] + mocked.m_derefed[3] </Original> <Expanded> true @@ -15559,7 +17243,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[4] + mocked.m_derefed[4] </Original> <Expanded> true @@ -15573,15 +17257,15 @@ There is no extra whitespace here <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked, anyMatch + mocked, !noneMatch </Original> <Expanded> - { 1, 2, 3, 4, 5 } any match matches undescribed predicate + { 1, 2, 3, 4, 5 } not none match matches undescribed predicate </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[0] + mocked.m_derefed[0] </Original> <Expanded> true @@ -15589,7 +17273,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[1]) + !(mocked.m_derefed[1]) </Original> <Expanded> !false @@ -15597,7 +17281,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[2]) + !(mocked.m_derefed[2]) </Original> <Expanded> !false @@ -15605,7 +17289,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[3]) + !(mocked.m_derefed[3]) </Original> <Expanded> !false @@ -15613,7 +17297,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[4]) + !(mocked.m_derefed[4]) </Original> <Expanded> !false @@ -15625,50 +17309,118 @@ There is no extra whitespace here </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="Usage of NoneMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <TestCase name="Usage of NoneTrue range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, NoneMatch(SizeIs(6)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, !NoneMatch(Contains(0) && Contains(1)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <Section name="All true evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { true, true, true, true, true } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } none match matches undescribed predicate - </Expanded> - </Expression> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Empty evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, NoneTrue() + </Original> + <Expanded> + { } contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { false, false, true, false, false } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, NoneTrue() + </Original> + <Expanded> + { false, false, false, false, false } contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { true, true, true, true, true } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { false, false, true, false, false } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, NoneTrue() + </Original> + <Expanded> + { false, false, false, false, false } contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked, noneMatch + mocked, NoneTrue() </Original> <Expanded> - { 1, 2, 3, 4, 5 } none match matches undescribed predicate + { false, false, false, false, false } contains no true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[0] + mocked.m_derefed[0] </Original> <Expanded> true @@ -15676,7 +17428,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[1] + mocked.m_derefed[1] </Original> <Expanded> true @@ -15684,7 +17436,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[2] + mocked.m_derefed[2] </Original> <Expanded> true @@ -15692,7 +17444,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[3] + mocked.m_derefed[3] </Original> <Expanded> true @@ -15700,7 +17452,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[4] + mocked.m_derefed[4] </Original> <Expanded> true @@ -15714,39 +17466,39 @@ There is no extra whitespace here <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked, !noneMatch + mocked, !NoneTrue() </Original> <Expanded> - { 1, 2, 3, 4, 5 } not none match matches undescribed predicate + { false, false, true, true, true } not contains no true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - mocked.derefed[0] + mocked.m_derefed[0] </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[1]) + mocked.m_derefed[1] </Original> <Expanded> - !false + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[2]) + mocked.m_derefed[2] </Original> <Expanded> - !false + true </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[3]) + !(mocked.m_derefed[3]) </Original> <Expanded> !false @@ -15754,7 +17506,7 @@ There is no extra whitespace here </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(mocked.derefed[4]) + !(mocked.m_derefed[4]) </Original> <Expanded> !false @@ -16452,18 +18204,6 @@ There is no extra whitespace here <TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <OverallResult success="false"/> </TestCase> - <TestCase name="Where the LHS is not a simple value" tags="[.][failing][Tricky]" filename="tests/<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="[.][failing][Tricky]" filename="tests/<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="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <OverallResult success="true"/> </TestCase> @@ -16592,7 +18332,7 @@ There is no extra whitespace here <TestCase name="XmlWriter writes boolean attributes as true/false" tags="[XML][XmlWriter]" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") + stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") </Original> <Expanded> "<?xml version="1.0" encoding="UTF-8"?> @@ -16736,17 +18476,6 @@ There is no extra whitespace here </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="atomic if" tags="[0][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - x == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> <TestCase name="benchmark function call" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Section name="without chronometer" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -17439,6 +19168,9 @@ There is no extra whitespace here loose text artifact <OverallResult success="false"/> </TestCase> + <TestCase name="is_unary_function" tags="[clara][compilation]" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <OverallResult success="true"/> + </TestCase> <TestCase name="just failure" tags="[.][fail][isolated info][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > Previous info should not be seen @@ -17674,6 +19406,17 @@ loose text artifact </Expression> <OverallResult success="false"/> </TestCase> + <TestCase name="makeStream recognizes %debug stream name" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "%debug" ) + </Original> + <Expanded> + Catch::makeStream( "%debug" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="make_unique reimplementation" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Section name="From lvalue copies" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > @@ -18381,6 +20124,17 @@ loose text artifact </Section> <OverallResult success="true"/> </TestCase> + <TestCase name="request an unknown %-starting stream fails" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "%somestream" ) + </Original> + <Expanded> + Catch::makeStream( "%somestream" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="resolution" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> @@ -18683,10 +20437,10 @@ loose text artifact <TestCase name="shortened hide tags are split apart" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) + testcase.tags, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) </Original> <Expanded> - { ., magic-tag } ( Contains: magic-tag and Contains: . ) + { {?}, {?} } ( Contains: {?} and Contains: {?} ) </Expanded> </Expression> <OverallResult success="true"/> @@ -18761,6 +20515,33 @@ loose text artifact </Expression> <OverallResult success="false"/> </TestCase> + <TestCase name="startsWith" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + !(startsWith("", 'c')) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + startsWith(std::string("abc"), 'a') + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + startsWith("def"_catch_sr, 'd') + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="std::map is convertible string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Section name="empty" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > @@ -18872,16 +20653,24 @@ loose text artifact </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="string literals of different sizes can be compared" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <TestCase name="stdout and stderr streams have %-starting name" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > <Original> - std::string( "first" ) == "second" + Catch::makeStream( "%stderr" )->isConsole() </Original> <Expanded> - "first" == "second" + true </Expanded> </Expression> - <OverallResult success="false"/> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "%stdout" )->isConsole() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> </TestCase> <TestCase name="stringify ranges" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > @@ -19298,19 +21087,6 @@ loose text artifact </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="tuple<0,int,const char *>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<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<string,string>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > <Original> @@ -19926,6 +21702,6 @@ loose text artifact </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="1951" failures="146" expectedFailures="23"/> - <OverallResultsCases successes="276" failures="86" expectedFailures="6"/> + <OverallResults successes="2129" failures="143" expectedFailures="27"/> + <OverallResultsCases successes="304" failures="83" expectedFailures="7"/> </Catch2TestRun> diff --git a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt new file mode 100644 index 000000000..7a88f7de7 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -0,0 +1,21706 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Catch2TestRun name="<exe-name>" rng-seed="1" catch2-version="<version>" filters="~[!nonportable]~[!benchmark]~[approvals] *"> + <TestCase name="# A test name that starts with a #" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1027: Bitfields can be captured" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + y.v == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + 0 == y.v + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1147" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 == t2 + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 != t2 + </Original> + <Expanded> + {?} != {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 < t2 + </Original> + <Expanded> + {?} < {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 > t2 + </Original> + <Expanded> + {?} > {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 <= t2 + </Original> + <Expanded> + {?} <= {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 >= t2 + </Original> + <Expanded> + {?} >= {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1175 - Hidden Test" tags="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1238" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Info> + uarr := "123" + </Info> + <Info> + sarr := "456" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1319: Sections can have description (even if it is not saved" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Section name="SectionName" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1403" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="[.][messages]" filename="tests/<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="[.][output-capture][regression]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Failure filename="tests/<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="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + std::is_same<TypeList<int>, TypeList<int>>::value + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1905 -- test spec parser properly clears internal state between compound tests" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase("spec . char")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase("spec , char")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(spec.matches(*fakeTestCase(R"(spec \, char)"))) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1912 -- test spec parser handles escaping" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Various parentheses" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase(R"(spec {a} char)")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase(R"(spec [a] char)")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(spec.matches(*fakeTestCase("differs but has similar tag", "[a]"))) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="backslash in test name" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase(R"(spec \ char)")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1913 - GENERATE inside a for loop should not keep recreating the generator" tags="[generators][regression]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + counter < 7 + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + counter < 7 + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1913 - GENERATEs can share a line" tags="[generators][regression]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 1 != 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 1 != 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 2 != 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 2 != 4 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - GENERATE after a section" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - Section followed by flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + 1 + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - mixed sections and generates" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 1 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 5 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 1 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 6 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 1 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 5 + </Info> + <Info> + i := 1 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 6 + </Info> + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 2 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 5 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 2 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 6 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 2 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 5 + </Info> + <Info> + i := 2 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 6 + </Info> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - nested generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#2152 - ULP checks between differently signed values were wrong - double" tags="[floating-point][matchers][ulp]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) + </Original> + <Expanded> + 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, 4.9406564584124654e-324]) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) + </Original> + <Expanded> + 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e-324, -0.0000000000000000e+00]) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#2152 - ULP checks between differently signed values were wrong - float" tags="[floating-point][matchers][ulp]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) + </Original> + <Expanded> + 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) + </Original> + <Expanded> + 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00]) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Section name="outside assertions" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Info> + answer := 42 + </Info> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="inside REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Info> + answer := 42 + </Info> + <Expression success="false" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() + </Original> + <Expanded> + thisThrows() + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="inside REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Info> + answer := 42 + </Info> + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<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="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + 42 == f + </Original> + <Expanded> + 42 == {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#833" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + a == t + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + a == t + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + throws_int(false) + </Original> + <Expanded> + throws_int(false) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + "aaa", Catch::Matchers::EndsWith("aaa") + </Original> + <Expanded> + "aaa" ends with: "aaa" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + templated_tests<int>(3) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#835 -- errno should not be touched by Catch2" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + f() == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + errno_after == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#872" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Info> + dummy := 0 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<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="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Looped section 0" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 1" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 2" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 3" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 4" filename="tests/<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="[.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + false != false + </Original> + <Expanded> + false != false + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + true != true + </Original> + <Expanded> + true != true + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !true + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(true) + </Original> + <Expanded> + !true + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !trueValue + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(trueValue) + </Original> + <Expanded> + !true + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(1 == 1) + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="CHECK_FALSE" filename="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + false == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + true == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !false + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(false) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !falseValue + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(falseValue) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(1 == 2) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Section name="compare to true" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + is_true<true>::value == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true == is_true<true>::value + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="compare to false" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + is_true<false>::value == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + false == is_true<false>::value + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="negation" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !is_true<false>::value + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="double negation" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !!is_true<true>::value + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="direct" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + is_true<true>::value + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !(is_true<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 9 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A METHOD_AS_TEST_CASE based test run that fails" tags="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<float>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<int>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<float>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<int>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<float>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<int>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<float>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<int>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<float, 6>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 6 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<int, 2>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 2 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 6 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 2 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<float,6>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<int,2>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<float,6>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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<int,2>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<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="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<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="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<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="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<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="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<float>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<int>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<float>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<int>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<float, 42>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<int, 9>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<float, 42>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<int, 9>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Outer" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Inner" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Failure filename="tests/<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="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + &o1 == &o2 + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + o1 == o2 + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Absolute margin" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + i++ == 7 + </Original> + <Expanded> + 7 == 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + 1 == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="false" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + {Unknown expression after the reported line} + </Original> + <Expanded> + {Unknown expression after the reported line} + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + unexpected exception + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Anonymous test case 1" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approx setters validate their arguments" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 1 == Approx( 1 ) + </Original> + <Expanded> + 1 == Approx( 1.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0 == Approx( dZero) + </Original> + <Expanded> + 0 == Approx( 0.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Function pointer" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, Predicate<int>( alwaysTrue, "always true" ) + </Original> + <Expanded> + 1 matches predicate: "always true" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, !Predicate<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "Hello olleH", Predicate<std::string>( []( std::string const& 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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "This wouldn't pass", !Predicate<std::string>( []( std::string const& 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="Assertion macros support bit operators and bool conversions" tags="[bitops][compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + lhs | rhs + </Original> + <Expanded> + Val: 1 | Val: 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + !(lhs & rhs) + </Original> + <Expanded> + !(Val: 1 & Val: 2) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + HasBitOperators{ 1 } & HasBitOperators{ 1 } + </Original> + <Expanded> + Val: 1 & Val: 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + lhs ^ rhs + </Original> + <Expanded> + Val: 1 ^ Val: 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + !(lhs ^ lhs) + </Original> + <Expanded> + !(Val: 1 ^ Val: 1) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Assertions then sections" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="A section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="Another section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="A section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="Another other section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="Basic use of the Contains range matcher" tags="[contains][matchers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Different argument ranges, same element type, default comparison" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + a, Contains(1) + </Original> + <Expanded> + { 1, 2, 3 } contains element 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + b, Contains(1) + </Original> + <Expanded> + { 0, 1, 2 } contains element 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + c, !Contains(1) + </Original> + <Expanded> + { 4, 5, 6 } not contains element 1 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different argument ranges, same element type, custom comparison" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + a, Contains(0, close_enough) + </Original> + <Expanded> + { 1, 2, 3 } contains element 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + b, Contains(0, close_enough) + </Original> + <Expanded> + { 0, 1, 2 } contains element 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + c, !Contains(0, close_enough) + </Original> + <Expanded> + { 4, 5, 6 } not contains element 0 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different element type, custom comparisons" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) + </Original> + <Expanded> + { "abc", "abcd", "abcde" } contains element 4 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Can handle type that requires ADL-found free function begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + in, Contains(1) + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } contains element 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + in, !Contains(8) + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } not contains element 8 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Initialization with move only types" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + in, Contains(MoveOnlyTestElement{ 2 }) + </Original> + <Expanded> + { 1, 2, 3 } contains element 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + in, !Contains(MoveOnlyTestElement{ 9 }) + </Original> + <Expanded> + { 1, 2, 3 } not contains element 9 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Matching using matcher" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + in, Contains(Catch::Matchers::WithinAbs(0.5, 0.5)) + </Original> + <Expanded> + { 1.0, 2.0, 3.0, 0.0 } contains element matching is within 0.5 of 0.5 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Basic use of the Empty range matcher" tags="[empty][matchers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Simple, std-provided containers" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + empty_array, IsEmpty() + </Original> + <Expanded> + { } is empty + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + non_empty_array, !IsEmpty() + </Original> + <Expanded> + { 0.0 } not is empty + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + empty_vec, IsEmpty() + </Original> + <Expanded> + { } is empty + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + non_empty_vec, !IsEmpty() + </Original> + <Expanded> + { 'a', 'b', 'c' } not is empty + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + inner_lists_are_empty, !IsEmpty() + </Original> + <Expanded> + { { } } not is empty + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + inner_lists_are_empty.front(), IsEmpty() + </Original> + <Expanded> + { } is empty + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type with empty" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + has_empty{}, !IsEmpty() + </Original> + <Expanded> + {?} not is empty + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found empty free function" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + unrelated::ADL_empty{}, IsEmpty() + </Original> + <Expanded> + {?} is empty + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="CAPTURE can deal with complex expressions" tags="[capture][messages]" filename="tests/<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="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + std::vector<int>{1, 2, 3}[0, 1, 2] := 3 + </Info> + <Info> + std::vector<int>{1, 2, 3}[(0, 1)] := 2 + </Info> + <Info> + std::vector<int>{1, 2, 3}[0] := 1 + </Info> + <Info> + (helper_1436<int, int>{12, -12}) := { 12, -12 } + </Info> + <Info> + (helper_1436<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="tests/<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 {[<" := "some, ), unmatched, } prenheses {[<" + </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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Capture should stringify like assertions" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Info> + i := 2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Info> + 3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<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="CaseInsensitiveEqualsTo is case insensitive" tags="[comparisons][string-case]" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Section name="Degenerate cases" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "", "" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(eq( "", "a" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Plain comparisons" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "a", "a" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "a", "A" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "A", "a" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + eq( "A", "A" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(eq( "a", "b" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(eq( "a", "B" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="CaseInsensitiveLess is case insensitive" tags="[comparisons][string-case]" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Section name="Degenerate cases" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "", "a" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(lt( "a", "a" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + !(lt( "", "" )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Plain comparisons" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "a", "b" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "a", "B" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "A", "b" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Details.tests.cpp" > + <Original> + lt( "A", "B" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Character pretty printing" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Specifically escaped" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + tab == '\t' + </Original> + <Expanded> + '\t' == '\t' + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + newline == '\n' + </Original> + <Expanded> + '\n' == '\n' + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + carr_return == '\r' + </Original> + <Expanded> + '\r' == '\r' + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + space == ' ' + </Original> + <Expanded> + ' ' == ' ' + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + c == chars[i] + </Original> + <Expanded> + 'a' == 'a' + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + c == chars[i] + </Original> + <Expanded> + 'z' == 'z' + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + c == chars[i] + </Original> + <Expanded> + 'A' == 'A' + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + null_terminator == '\0' + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + c == i + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + c == i + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + c == i + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="Clara::Arg supports single-arg parse the way Opt does" tags="[arg][clara][compilation]" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + name.empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + name == "foo" + </Original> + <Expanded> + "foo" == "foo" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Clara::Opt supports accept-many lambdas" tags="[clara][opt]" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Section name="Parsing fails on multiple options without accept_many" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + !(parse_result) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Parsing succeeds on multiple options with accept_many" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + parse_result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + res == std::vector<std::string>{ "aaa", "bbb" } + </Original> + <Expanded> + { "aaa", "bbb" } == { "aaa", "bbb" } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="ColourGuard behaviour" tags="[console-colours]" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Section name="ColourGuard is disengaged by default" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Original> + streamWrapper.str().empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="ColourGuard is engaged by op<<" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Original> + streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" + </Original> + <Expanded> + "1 +Using code: 2 +2 +Using code: 0 +3 +" +== +"1 +Using code: 2 +2 +Using code: 0 +3 +" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="ColourGuard can be engaged explicitly" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp" > + <Original> + streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" + </Original> + <Expanded> + "Using code: 2 +A +B +Using code: 0 +C +" +== +"Using code: 2 +A +B +Using code: 0 +C +" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining MatchAllOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() && MatcherB() ) && MatcherC() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() && ( MatcherB() && MatcherC() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining MatchAnyOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() || MatcherB() ) || MatcherC() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() || ( MatcherB() || MatcherC() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining MatchNotOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 0, !MatcherA() + </Original> + <Expanded> + 0 not equals: (int) 1 or (string) "1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, !!MatcherA() + </Original> + <Expanded> + 1 equals: (int) 1 or (string) "1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 0, !!!MatcherA() + </Original> + <Expanded> + 0 not equals: (int) 1 or (string) "1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, !!!!MatcherA() + </Original> + <Expanded> + 1 equals: (int) 1 or (string) "1" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining concrete matchers does not use templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining only templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() || MatcherB() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() && MatcherB() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() || !MatcherB() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining templated and concrete matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) + </Original> + <Expanded> + { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) + </Original> + <Expanded> + "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) + </Original> + <Expanded> + "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) + </Original> + <Expanded> + { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Commas in various macros are allowed" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Original> + <Expanded> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Original> + <Expanded> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Original> + <Expanded> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Expanded> + </Expression> + <Expression success="true" type="CHECK_NOTHROW" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Original> + <Expanded> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) + </Original> + <Expanded> + !({ 1, 2 } == { 1, 2, 3 }) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) + </Original> + <Expanded> + !({ 1, 2 } == { 1, 2, 3 }) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparing function pointers" tags="[function pointer][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + a + </Original> + <Expanded> + 0x<hex digits> + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + a == &foo + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparison ops" tags="[rng]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + SimplePcg32{} == SimplePcg32{} + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + SimplePcg32{ 0 } != SimplePcg32{} + </Original> + <Expanded> + {?} != {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + !(SimplePcg32{ 1 } == SimplePcg32{ 2 }) + </Original> + <Expanded> + !({?} == {?}) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(9.0) <= td + </Original> + <Expanded> + Approx( 9.0 ) <= StrongDoubleTypedef(10) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ( -1 > 2u ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + -1 > 2u + </Original> + <Expanded> + -1 > 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ( 2u < -1 ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 2u < -1 + </Original> + <Expanded> + 2 < -1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ( minInt > 2u ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + i == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ui == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + l == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ul == 4 + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + c == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + uc == 6 + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 1 == i + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 2 == ui + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 3 == l + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 4 == ul + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 5 == c + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 6 == uc + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + (std::numeric_limits<uint32_t>::max)() > ul + </Original> + <Expanded> + 4294967295 (0x<hex digits>) > 4 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Composed generic matchers shortcircuit" tags="[composed][generic][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="MatchAllOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + !(matcher.match( 1 )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + first.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + !second.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="MatchAnyOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + matcher.match( 1 ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + first.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + !second.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Composed matchers shortcircuit" tags="[composed][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="MatchAllOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + !(matcher.match( 1 )) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + first.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + !second.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="MatchAnyOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + matcher.match( 1 ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + first.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + !second.matchCalled + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Contains string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + call_count == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="Cout stream properly declares it writes to stdout" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "-" )->isConsole() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Custom exceptions can be translated when testing for nothrow" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + throwCustom() + </Original> + <Expanded> + throwCustom() + </Expanded> + <Exception filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + throwCustom(), std::exception + </Original> + <Expanded> + throwCustom(), std::exception + </Expanded> + <Exception filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + enumInfo->lookup(0) == "Value1" + </Original> + <Expanded> + Value1 == "Value1" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + enumInfo->lookup(1) == "Value2" + </Original> + <Expanded> + Value2 == "Value2" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="Empty stream name opens cout stream" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "" )->isConsole() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Empty tag is not allowed" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) + </Original> + <Expanded> + Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="EndsWith string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( EnumClass3::Value1 ) == "Value1" + </Original> + <Expanded> + "Value1" == "Value1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( EnumClass3::Value2 ) == "Value2" + </Original> + <Expanded> + "Value2" == "Value2" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( EnumClass3::Value3 ) == "Value3" + </Original> + <Expanded> + "Value3" == "Value3" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( Bikeshed::Colours::Red ) == "Red" + </Original> + <Expanded> + "Red" == "Red" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="[!mayfail][.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 6 + </Original> + <Expanded> + 7 == 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 8 + </Original> + <Expanded> + 7 == 8 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 0 + </Original> + <Expanded> + 7 == 0 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "goodbye" + </Original> + <Expanded> + "hello" == "goodbye" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "hell" + </Original> + <Expanded> + "hello" == "hell" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "hello1" + </Original> + <Expanded> + "hello" == "hello1" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() == 6 + </Original> + <Expanded> + 5 == 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 7 + </Original> + <Expanded> + 7 == 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "hello" + </Original> + <Expanded> + "hello" == "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + "hello" == data.str_hello + </Original> + <Expanded> + "hello" == "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<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="tests/<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="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" + </Original> + <Expanded> + "OperatorException" == "OperatorException" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="[!throws][.][exceptions][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="No exception" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } + </Original> + <Expanded> + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + Unknown exception + </Exception> + </Expression> + <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } + </Original> + <Expanded> + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + Unknown exception + </Exception> + </Expression> + <OverallResults successes="0" failures="2" expectedFailures="0"/> + </Section> + <Section name="Contents are wrong" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THROWS_MATCHES" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Section name="exact match" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), ContainsSubstring( "except" ) + </Original> + <Expanded> + "expected exception" contains: "except" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), ContainsSubstring( "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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<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="tests/<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="tests/<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="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), std::string + </Original> + <Expanded> + thisThrows(), std::string + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <Expression success="false" type="CHECK_THROWS_AS" filename="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() + </Original> + <Expanded> + thisThrows() + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="FAIL aborts the test" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + This is a failure + </Failure> + <OverallResult success="false"/> + </TestCase> + <TestCase name="FAIL does not require an argument" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" /> + <OverallResult success="false"/> + </TestCase> + <TestCase name="FAIL_CHECK does not abort the test" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(0) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(1) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(2) == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(3) == 6 + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + WithinULP( 1., 0 ) + </Original> + <Expanded> + WithinULP( 1., 0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error + </Original> + <Expanded> + WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Throws if there are no matching values" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i < 4 + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i < 4 + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i < 4 + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is not divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() < 3 + </Original> + <Expanded> + 1 < 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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is not divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() < 3 + </Original> + <Expanded> + 2 < 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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Throws on too small generators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -3 < 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -2 < 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -1 < 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -3 < 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -2 < 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -1 < 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -3 < 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -2 < 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -1 < 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Single value" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 123 + </Original> + <Expanded> + 123 == 123 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 4 + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get().size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == "aa" + </Original> + <Expanded> + "aa" == "aa" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == "bb" + </Original> + <Expanded> + "bb" == "bb" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == "cc" + </Original> + <Expanded> + "cc" == "cc" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Simple filtering" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="Filter generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Filter out multiple elements at the start and end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="Filter generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Throws on construction if it can't get initial element" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<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> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + filter([](int) { return false; }, values({ 1, 2, 3 })), Catch::GeneratorException + </Original> + <Expanded> + filter([](int) { return false; }, values({ 1, 2, 3 })), Catch::GeneratorException + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take less" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take more" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Singular repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Actual repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive auto step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -2 + </Original> + <Expanded> + -2 == -2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative auto step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="Hashers with different seed produce different hash with same test case" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) != h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashers with same seed produce same hash" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) == h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing different test cases produces different result" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Section name="Different test name" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different classname" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different tags" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing test case produces same hash across multiple calls" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy ) == h( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="INFO and WARN do not abort tests" tags="[.][messages]" filename="tests/<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="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this message should be logged + </Info> + <Info> + so should this + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<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="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this message may be logged later + </Info> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<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="tests/<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="tests/<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="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + current counter 0 + </Info> + <Info> + i := 0 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 0 < 10 + </Expanded> + </Expression> + <Info> + current counter 1 + </Info> + <Info> + i := 1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 1 < 10 + </Expanded> + </Expression> + <Info> + current counter 2 + </Info> + <Info> + i := 2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 2 < 10 + </Expanded> + </Expression> + <Info> + current counter 3 + </Info> + <Info> + i := 3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 3 < 10 + </Expanded> + </Expression> + <Info> + current counter 4 + </Info> + <Info> + i := 4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 4 < 10 + </Expanded> + </Expression> + <Info> + current counter 5 + </Info> + <Info> + i := 5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 5 < 10 + </Expanded> + </Expression> + <Info> + current counter 6 + </Info> + <Info> + i := 6 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 6 < 10 + </Expanded> + </Expression> + <Info> + current counter 7 + </Info> + <Info> + i := 7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 7 < 10 + </Expanded> + </Expression> + <Info> + current counter 8 + </Info> + <Info> + i := 8 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 8 < 10 + </Expanded> + </Expression> + <Info> + current counter 9 + </Info> + <Info> + i := 9 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 9 < 10 + </Expanded> + </Expression> + <Info> + current counter 10 + </Info> + <Info> + i := 10 + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 10 < 10 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Inequality checks that should fail" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven != 7 + </Original> + <Expanded> + 7 != 7 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "hello" + </Original> + <Expanded> + "hello" != "hello" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven != 6 + </Original> + <Expanded> + 7 != 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven != 8 + </Original> + <Expanded> + 7 != 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "goodbye" + </Original> + <Expanded> + "hello" != "goodbye" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "hell" + </Original> + <Expanded> + "hello" != "hell" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "hello1" + </Original> + <Expanded> + "hello" != "hello1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() != 6 + </Original> + <Expanded> + 5 != 6 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Lambdas in assertions" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + []() { return true; }() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Less-than inequalities with different epsilons" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d <= Approx( 1.22 ).epsilon(0.1) + </Original> + <Expanded> + 1.23 <= Approx( 1.22 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="ManuallyRegistered" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "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 && and ||" tags="[matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "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 && and || - failing" tags="[.][failing][matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), !ContainsSubstring( "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="[.][failing][matchers][not][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), !ContainsSubstring( "substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" not contains: "substring" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Mayfail test case with nested sections" tags="[!mayfail]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="1" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="A" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="2" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="A" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="0" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="1" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="B" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="2" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="B" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="0" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Mismatching exception messages failing the test" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<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="tests/<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="Multireporter calls reporters and listeners in correct order" tags="[multi-reporter][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + records == expected + </Original> + <Expanded> + { "Hello", "world", "Goodbye", "world" } +== +{ "Hello", "world", "Goodbye", "world" } + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Multireporter updates ReporterPreferences properly" tags="[multi-reporter][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="Adding listeners" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="Adding reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldRedirectStdOut == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + multiReporter.getPreferences().shouldReportAllAssertions == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Nested generators and captured variables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 3 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 4 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 5 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 6 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + -5 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + -4 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 90 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 91 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 92 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 93 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 94 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 95 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 96 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 97 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 98 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="[.][tag1][tag2][tag3]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Warning> + This one ran + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Non-std exceptions can be translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<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="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + True + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !False + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !(False) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Optionally static assertions" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Ordering comparison checks that should fail" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 7 + </Original> + <Expanded> + 7 > 7 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 7 + </Original> + <Expanded> + 7 < 7 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 8 + </Original> + <Expanded> + 7 > 8 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 6 + </Original> + <Expanded> + 7 < 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 0 + </Original> + <Expanded> + 7 < 0 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < -1 + </Original> + <Expanded> + 7 < -1 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven >= 8 + </Original> + <Expanded> + 7 >= 8 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven <= 6 + </Original> + <Expanded> + 7 <= 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one < 9 + </Original> + <Expanded> + 9.1f < 9 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "hello" + </Original> + <Expanded> + "hello" > "hello" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "hello" + </Original> + <Expanded> + "hello" < "hello" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "hellp" + </Original> + <Expanded> + "hello" > "hellp" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "z" + </Original> + <Expanded> + "hello" > "z" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "hellm" + </Original> + <Expanded> + "hello" < "hellm" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "a" + </Original> + <Expanded> + "hello" < "a" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello >= "z" + </Original> + <Expanded> + "hello" >= "z" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello <= "a" + </Original> + <Expanded> + "hello" <= "a" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Ordering comparison checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 8 + </Original> + <Expanded> + 7 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 6 + </Original> + <Expanded> + 7 > 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 0 + </Original> + <Expanded> + 7 > 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > -1 + </Original> + <Expanded> + 7 > -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven >= 7 + </Original> + <Expanded> + 7 >= 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven >= 6 + </Original> + <Expanded> + 7 >= 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven <= 7 + </Original> + <Expanded> + 7 <= 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven <= 8 + </Original> + <Expanded> + 7 <= 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one < 10 + </Original> + <Expanded> + 9.1f < 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one < 9.2 + </Original> + <Expanded> + 9.1f < 9.2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello <= "hello" + </Original> + <Expanded> + "hello" <= "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello >= "hello" + </Original> + <Expanded> + "hello" >= "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "hellp" + </Original> + <Expanded> + "hello" < "hellp" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "zebra" + </Original> + <Expanded> + "hello" < "zebra" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "hellm" + </Original> + <Expanded> + "hello" > "hellm" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Section name="Default seeded" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Section name="one" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + Message from section one + </Failure> + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<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="Overloaded comma or address-of operators are not used" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed + </Original> + <Expanded> + ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + &EvilMatcher(), EvilAddressOfOperatorUsed + </Original> + <Expanded> + &EvilMatcher(), EvilAddressOfOperatorUsed + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) + </Original> + <Expanded> + EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() + </Original> + <Expanded> + ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Parse test names and tags" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Empty test spec should have no filters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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 tag inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( " aardvark " ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( " aardvark" ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( " aardvark " ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( "aardvark " ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( " aardvark " ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( " aardvark" ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( " aardvark " ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *fakeTestCase( "aardvark " ) ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(spec.matches(*fakeTestCase("only hidden", "[.]"))) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="Parsed tags are matched case insensitive" tags="[test-spec][test-spec-parser]" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.hasFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.getInvalidSpecs().empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.matches( testCase ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Parsing sharding-related cli flags" tags="[sharding]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="shard-count" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--shard-count=8" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.shardCount == 8 + </Original> + <Expanded> + 8 == 8 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Negative shard count reports error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(result) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("Shard count must be a positive number") + </Original> + <Expanded> + "Shard count must be a positive number" contains: "Shard count must be a positive number" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Zero shard count reports error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(result) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("Shard count must be a positive number") + </Original> + <Expanded> + "Shard count must be a positive number" contains: "Shard count must be a positive number" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="shard-index" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--shard-index=2" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.shardIndex == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Negative shard index reports error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(result) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number") + </Original> + <Expanded> + "Shard index must be a non-negative number" contains: "Shard index must be a non-negative number" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shard index 0 is accepted" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--shard-index=0" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.shardIndex == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Parsing tags with non-alphabetical characters is pass-through" tags="[test-spec][test-spec-parser]" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Info> + tagString := "[tag with spaces]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.hasFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[tag with spaces]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.getInvalidSpecs().empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[tag with spaces]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.matches( testCase ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[I said "good day" sir!]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.hasFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[I said "good day" sir!]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.getInvalidSpecs().empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + tagString := "[I said "good day" sir!]" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp" > + <Original> + spec.matches( testCase ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Parsing warnings" tags="[cli][warnings]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="NoAssertions" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse( { "test", "-w", "NoAssertions" } ) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.warnings == WarnAbout::NoAssertions + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="NoTests is no longer supported" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(cli.parse( { "test", "-w", "NoTests" } )) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Combining multiple warnings" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Pointers can be compared to null" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p == pNULL + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + cp != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + cpc != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + returnsNull() == 0 + </Original> + <Expanded> + {null string} == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + returnsConstNull() == 0 + </Original> + <Expanded> + {null string} == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Floats" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + str1.size() == 3 + 5 + </Original> + <Expanded> + 8 == 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + str1.size() == 2 + 5 + </Original> + <Expanded> + 7 == 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "foo", Predicate<const char*>( []( const char* const& ) { 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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="empty args don't cause a crash" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.processName == "test" + </Original> + <Expanded> + "test" == "test" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.shouldDebugBreak == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.abortAfter == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.noThrow == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications.empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(cfg.hasTestFilters()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getReporterSpecs().size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getProcessedReporterSpecs().size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.getProcessedReporterSpecs()[0] == Catch::ProcessedReporterSpec{ expectedReporter, std::string{}, Catch::ColourMode::PlatformDefault, {} } + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResults successes="11" failures="0" expectedFailures="0"/> + </Section> + <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Specify one test case using" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.hasTestFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Specify one test case exclusion using exclude:" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.hasTestFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Specify one test case exclusion using ~" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.hasTestFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-r/console" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } + </Original> + <Expanded> + { {?} } == { {?} } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-r/xml" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } + </Original> + <Expanded> + { {?} } == { {?} } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--reporter/junit" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } + </Original> + <Expanded> + { {?} } == { {?} } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="must match one of the available ones" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("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="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="With output file" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } + </Original> + <Expanded> + { {?} } == { {?} } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="With Windows-like absolute path as output file" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Info> + result.errorMessage() := "" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } + </Original> + <Expanded> + { {?} } == { {?} } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Multiple reporters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="All with output files" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } + </Original> + <Expanded> + { {?}, {?} } == { {?}, {?} } + </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="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Multiple reporters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Mixed output files and default output" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } + </Original> + <Expanded> + { {?}, {?} } == { {?}, {?} } + </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="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Multiple reporters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="cannot have multiple reporters with default output" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") + </Original> + <Expanded> + "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." + </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="debugger" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-b" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-b"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--break" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--break"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-a aborts after first failure" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-a"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-x 2 aborts after two failures" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-x", "2"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-x must be numeric" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.waitForKeypress == std::get<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.waitForKeypress == std::get<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.waitForKeypress == std::get<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.waitForKeypress == std::get<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="invalid options are reported" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-e" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-e"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--nothrow" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--nothrow"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-o filename" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-o", "filename.ext"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.defaultOutputFilename == "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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--out" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--out", "filename.ext"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.defaultOutputFilename == "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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Single character flags can be combined" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-abe"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.abortAfter == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.shouldDebugBreak + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="without option" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.defaultColourMode == ColourMode::PlatformDefault + </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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="auto" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse( { "test", "--colour-mode", "default" } ) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.defaultColourMode == ColourMode::PlatformDefault + </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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="yes" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--colour-mode", "ansi"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.defaultColourMode == ColourMode::ANSI + </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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="no" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--colour-mode", "none"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.defaultColourMode == ColourMode::None + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) + </Original> + <Expanded> + "colour mode must be one of: default, ansi, win32, or none. 'wrong' is 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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="samples" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--benchmark-samples=200" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="resamples" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--benchmark-resamples=20000" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="confidence-interval" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.benchmarkConfidenceInterval == Catch::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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="no-analysis" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--benchmark-no-analysis" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="warmup-time" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--benchmark-warmup-time=10" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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<int, double, float>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + std::tuple_size<TestType>::value >= 1 + </Original> + <Expanded> + 3 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Product with differing arities - std::tuple<int, double>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + std::tuple_size<TestType>::value >= 1 + </Original> + <Expanded> + 2 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Product with differing arities - std::tuple<int>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + std::tuple_size<TestType>::value >= 1 + </Original> + <Expanded> + 1 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Random seed generation accepts known methods" tags="[rng][seed]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(method) + </Original> + <Expanded> + Catch::generateRandomSeed(method) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(method) + </Original> + <Expanded> + Catch::generateRandomSeed(method) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(method) + </Original> + <Expanded> + Catch::generateRandomSeed(method) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Random seed generation reports unknown methods" tags="[rng][seed]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) + </Original> + <Expanded> + Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Range type with sentinel" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + Catch::Detail::stringify(UsesSentinel{}) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Reconstruction should be based on stringification: #914" tags="[.][Decomposition][failing]" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<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="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<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="Registering reporter with '::' in name fails" tags="[registration][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" + </Original> + <Expanded> + "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Regression test #1" tags="[matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<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="Reporter's write listings to provided stream" tags="[reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="Automake reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: Automake + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="Automake reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: Automake + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="Automake reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: Automake + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="compact reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: compact + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="compact reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: compact + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="compact reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: compact + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="console reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: console + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="console reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: console + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="console reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: console + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="JUnit reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: JUnit + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="JUnit reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: JUnit + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="JUnit reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: JUnit + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="SonarQube reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: SonarQube + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="SonarQube reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: SonarQube + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="SonarQube reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: SonarQube + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="TAP reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: TAP + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="TAP reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: TAP + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="TAP reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: TAP + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="TeamCity reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: TeamCity + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="TeamCity reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: TeamCity + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="TeamCity reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: TeamCity + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="XML reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: XML + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fakeTag"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<TagsFromMatchingTests> + <Tag> + <Count>1</Count> + <Aliases> + <Alias>fakeTag</Alias> + </Aliases> + </Tag> +</TagsFromMatchingTests>" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="XML reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: XML + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("fake reporter"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<AvailableReporters> + <Reporter> + <Name>fake reporter</Name> + <Description>fake description</Description> + </Reporter> +</AvailableReporters>" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="XML reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: XML + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<MatchingTests> + <TestCase> + <Name>fake test name</Name> + <ClassName/> + <Tags>[fakeTestTag]</Tags> + <SourceInfo> + <File>fake-file.cpp</File> + <Line>123456789</Line> + </SourceInfo> + </TestCase> +</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla" tags="[console-reporter]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="SUCCEED counts as a test pass" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="SUCCEED does not require an argument" tags="[.][messages]" filename="tests/<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="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Given: No operations precede me" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + before == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Section name="When: We get the count" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: Subsequently values are higher" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Given: This stuff exists" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="And given: And some assumption" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="When: I do this" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: it should do this" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + itDoesThis() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="And: do that" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="When: The test headers are printed as part of the normal running of the scenario" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Given: an empty vector" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Section name="When: it is made larger" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: the size and capacity go up" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: the size goes down but the capacity stays the same" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Section name="When: we reserve more space" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: The capacity is increased but the size remains the same" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="[.]" filename="tests/<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="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Section name="one" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<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="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Single item" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "string" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "string" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "abc" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "abc" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ContainsSubstring( "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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Empty string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + empty.empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + empty.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + std::strcmp( empty.data(), "" ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="From string literal" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + s.empty() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + s.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + std::strcmp( rawChars, "hello" ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + s.data() == rawChars + </Original> + <Expanded> + "hello" == "hello" + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="From sub-string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original == "original" + </Original> + <Expanded> + original == "original" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original.data() + </Original> + <Expanded> + original.data() + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Copy construction is shallow" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original.begin() == copy.begin() + </Original> + <Expanded> + "original string" == "original string" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Copy assignment is shallow" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original.begin() == copy.begin() + </Original> + <Expanded> + "original string" == "original string" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + ss.empty() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + ss.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="non-zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + ss.size() == 6 + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + std::strcmp( ss.data(), "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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Pointer values of full refs should match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Pointer values of substring refs should also match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Past the end substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Substring off the end are trimmed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + std::strcmp(ss.data(), "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="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="substring start after the end is empty" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + s.substr(1'000'000, 1).empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Comparisons are deep" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + reinterpret_cast<char*>(buffer1) != reinterpret_cast<char*>(buffer2) + </Original> + <Expanded> + "Hello" != "Hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + left == right + </Original> + <Expanded> + Hello == Hello + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="implicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + stdStr == "a stringref" + </Original> + <Expanded> + "a stringref" == "a stringref" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + stdStr == "a stringref" + </Original> + <Expanded> + "a stringref" == "a stringref" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="std::string += StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + lhs == "some string += the stringref contents" + </Original> + <Expanded> + "some string += the stringref contents" +== +"some string += the stringref contents" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="StringRef + StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + together == "abrakadabra" + </Original> + <Expanded> + "abrakadabra" == "abrakadabra" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="StringRef at compilation time" tags="[constexpr][StringRef][Strings]" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Simple constructors" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <OverallResults successes="12" failures="0" expectedFailures="0"/> + </Section> + <Section name="UDL construction" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - signed char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - unsigned char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + minute == seconds + </Original> + <Expanded> + 1 m == 60 s + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + hour != seconds + </Original> + <Expanded> + 1 h != 60 s + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + micro != milli + </Original> + <Expanded> + 1 us != 1 ms + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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<system_clock>" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="[.][failing][whitespace]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Section name="The same tag alias can only be registered once" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, ContainsSubstring( "[@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="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, ContainsSubstring( "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="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, ContainsSubstring( "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="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, ContainsSubstring( "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="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THROWS" filename="tests/<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="tests/<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="tests/<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="tests/<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="Tags with spaces and non-alphanumerical characters are accepted" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) + </Original> + <Expanded> + { {?}, {?} } ( Contains: {?} and Contains: {?} ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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<int,float>" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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<int, float>), 6" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 2 * V + </Original> + <Expanded> + 12 == 12 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 2 * V + </Original> + <Expanded> + 8 == 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 2 * V + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 2 * V + </Original> + <Expanded> + 30 == 30 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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 identical tags keeps just one" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testCase.tags[0] == Tag( "tag1" ) + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test case with one argument" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test enum bit values" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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 "in name" tags="[cli][regression]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if" tags="[checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="false" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if 2" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if 3" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> + <OverallResult success="true"/> + </TestCase> + <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="false" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + 1 == 2 + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="The default listing implementation write to provided stream" tags="[reporter-helpers][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="Listing tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring("[fakeTag]"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "[fakeTag]" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" ( contains: "fake reporter" and contains: "fake description" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Listing tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Listing listeners" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, ContainsSubstring( "fakeListener"s ) && ContainsSubstring( "fake description"s ) + </Original> + <Expanded> + "Registered listeners: + fakeListener: fake description + +" ( contains: "fakeListener" and contains: "fake description" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + For some reason someone is throwing a string literal! + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Tracker" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="successfully close one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="re-enter after failed section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="Successfully close S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="fail S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase3.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1c.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2c.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="open a nested section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + 3.14 + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Upcasting special member functions" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + bptr->i == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + bptr->i == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AllMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AllMatch(SizeIs(5)) + </Original> + <Expanded> + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AllMatch(Contains(0) && Contains(1)) + </Original> + <Expanded> + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, allMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !allMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } not all match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AllTrue range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AllTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Empty evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AllTrue() + </Original> + <Expanded> + { } contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One false evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AllTrue() + </Original> + <Expanded> + { true, true, false, true, true } not contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AllTrue() + </Original> + <Expanded> + { false, false, false, false, false } not contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AllTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One false evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AllTrue() + </Original> + <Expanded> + { true, true, false, true, true } not contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AllTrue() + </Original> + <Expanded> + { false, false, false, false, false } not contains only true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, AllTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains only true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !AllTrue() + </Original> + <Expanded> + { true, true, false, true, true } not contains only true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AnyMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyMatch(SizeIs(5)) + </Original> + <Expanded> + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyMatch(Contains(0) && Contains(10)) + </Original> + <Expanded> + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } any match matches undescribed predicate + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !anyMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } not any match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, anyMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } any match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[1]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[2]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AnyTrue range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Empty evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyTrue() + </Original> + <Expanded> + { } not contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { false, false, true, false, false } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyTrue() + </Original> + <Expanded> + { false, false, false, false, false } not contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { true, true, true, true, true } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, AnyTrue() + </Original> + <Expanded> + { false, false, true, false, false } contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !AnyTrue() + </Original> + <Expanded> + { false, false, false, false, false } not contains at least one true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, AnyTrue() + </Original> + <Expanded> + { false, false, false, false, true } contains at least one true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, AnyTrue() + </Original> + <Expanded> + { false, false, true, true, true } contains at least one true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of NoneMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, NoneMatch(SizeIs(6)) + </Original> + <Expanded> + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneMatch(Contains(0) && Contains(1)) + </Original> + <Expanded> + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } none match matches undescribed predicate + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, noneMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } none match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !noneMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } not none match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[1]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[2]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of NoneTrue range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { true, true, true, true, true } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Empty evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, NoneTrue() + </Original> + <Expanded> + { } contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { false, false, true, false, false } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, NoneTrue() + </Original> + <Expanded> + { false, false, false, false, false } contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All true evaluates to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { true, true, true, true, true } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="One true evalutes to false" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, !NoneTrue() + </Original> + <Expanded> + { false, false, true, false, false } not contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contained type is convertible to bool" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All false evaluates to true" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + data, NoneTrue() + </Original> + <Expanded> + { false, false, false, false, false } contains no true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, NoneTrue() + </Original> + <Expanded> + { false, false, false, false, false } contains no true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !NoneTrue() + </Original> + <Expanded> + { false, false, true, true, true } not contains no true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.m_derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.m_derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of the SizeIs range matcher" tags="[matchers][size][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Some with stdlib containers" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + empty_vec, SizeIs(0) + </Original> + <Expanded> + { } has size == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + empty_vec, !SizeIs(2) + </Original> + <Expanded> + { } not has size == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + empty_vec, SizeIs(Lt(2)) + </Original> + <Expanded> + { } size matches is less than 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + arr, SizeIs(2) + </Original> + <Expanded> + { 0, 0 } has size == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + arr, SizeIs( Lt(3)) + </Original> + <Expanded> + { 0, 0 } size matches is less than 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + arr, !SizeIs(!Lt(3)) + </Original> + <Expanded> + { 0, 0 } not size matches not is less than 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + map, SizeIs(3) + </Original> + <Expanded> + { {?}, {?}, {?} } has size == 3 + </Expanded> + </Expression> + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found size free function" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + unrelated::ADL_size{}, SizeIs(12) + </Original> + <Expanded> + {?} has size == 12 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type has size member" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + has_size{}, SizeIs(13) + </Original> + <Expanded> + {?} has size == 13 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Use a custom approx" tags="[Approx][custom]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <Section name="Section with one argument" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Empty vector is roughly equal to an empty vector" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="A vector is approx equal to itself" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, Approx<double>( { 1., 2., 3. } ) + </Original> + <Expanded> + { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Vectors with elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Different length" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Same length, different elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="[.][approx][failing][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Empty and non empty vectors are not approx equal" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Contains (element)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v, VectorContains( 2 ) + </Original> + <Expanded> + { 1, 2, 3 } Contains: 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5, ( VectorContains<int, CustomAllocator<int>>( 2 ) ) + </Original> + <Expanded> + { 1, 2, 3 } Contains: 2 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contains (vector)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v, Contains<int>( { 1, 2 } ) + </Original> + <Expanded> + { 1, 2, 3 } Contains: { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) + </Original> + <Expanded> + { 1, 2, 3 } Contains: { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + empty, Contains( empty ) + </Original> + <Expanded> + { } Contains: { } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) + </Original> + <Expanded> + { 1, 2, 3 } Contains: { 1, 2, 3 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5, Contains( v6 ) + </Original> + <Expanded> + { 1, 2, 3 } Contains: { 1, 2 } + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contains (element), composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v, VectorContains( 1 ) && 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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + empty, Equals( empty ) + </Original> + <Expanded> + { } Equals: { } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v, Equals<int>( { 1, 2, 3 } ) + </Original> + <Expanded> + { 1, 2, 3 } Equals: { 1, 2, 3 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v, Equals( v2 ) + </Original> + <Expanded> + { 1, 2, 3 } Equals: { 1, 2, 3 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) + </Original> + <Expanded> + { 1, 2, 3 } Equals: { 1, 2, 3 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5, Equals( v6 ) + </Original> + <Expanded> + { 1, 2, 3 } Equals: { 1, 2, 3 } + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="UnorderedEquals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v, UnorderedEquals<int>( { 3, 2, 1 } ) + </Original> + <Expanded> + { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + empty, UnorderedEquals( empty ) + </Original> + <Expanded> + { } UnorderedEquals: { } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + permuted, UnorderedEquals( v ) + </Original> + <Expanded> + { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) + </Original> + <Expanded> + { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v5_permuted, UnorderedEquals( v5 ) + </Original> + <Expanded> + { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } + </Expanded> + </Expression> + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Vector matchers that fail" tags="[.][failing][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Contains (element)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisDoesntThrow() + </Original> + <Expanded> + thisDoesntThrow() + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() == 0 + </Original> + <Expanded> + thisThrows() == 0 + </Expanded> + <Exception filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() == 0 + </Original> + <Expanded> + thisThrows() == 0 + </Expanded> + <Exception filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() == 0 + </Original> + <Expanded> + thisThrows() == 0 + </Expanded> + <Exception filename="tests/<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="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Section name="section name" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<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="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="X/level/0/a" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="X/level/0/b" tags="[fizz][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="X/level/1/a" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="X/level/1/b" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="XmlEncode" tags="[XML]" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Section name="normal string" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + encode( "smith & jones" ) == "smith &amp; jones" + </Original> + <Expanded> + "smith &amp; jones" == "smith &amp; jones" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with less-than" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + encode( "smith < jones" ) == "smith &lt; jones" + </Original> + <Expanded> + "smith &lt; jones" == "smith &lt; jones" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with greater-than" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + encode( "smith ]]> jones" ) == "smith ]]&gt; jones" + </Original> + <Expanded> + "smith ]]&gt; jones" +== +"smith ]]&gt; jones" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with quotes" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" + </Original> + <Expanded> + "don't &quot;quote&quot; me on that" +== +"don't &quot;quote&quot; me on that" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with control char (1)" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="XmlWriter writes boolean attributes as true/false" tags="[XML][XmlWriter]" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<Element1 attr1="true" attr2="false"/> +" ( contains: "attr1="true"" and contains: "attr2="false"" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="analyse no analysis" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.mean.point.count() == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.mean.lower_bound.count() == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.mean.upper_bound.count() == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.standard_deviation.point.count() == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.standard_deviation.lower_bound.count() == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.standard_deviation.upper_bound.count() == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.total() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.low_mild == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.low_severe == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.high_mild == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.high_severe == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.samples_seen == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outlier_variance == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="array<int, N> -> toString" tags="[array][containers][toString]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + Catch::Detail::stringify( empty ) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + Catch::Detail::stringify( oneValue ) == "{ 42 }" + </Original> + <Expanded> + "{ 42 }" == "{ 42 }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="benchmark function call" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Section name="without chronometer" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.started == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.finished == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.started == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.finished == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + called == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="with chronometer" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.started == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.finished == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.started == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + model.finished == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + called == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="boolean member" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedElse( true ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="checkedElse, failing" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedElse( false ) + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="checkedIf" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedIf( true ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="checkedIf, failing" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedIf( false ) + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="classify_outliers" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Section name="none" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.samples_seen == static_cast<int>(x.size()) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_severe == los + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_mild == lom + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_mild == him + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_severe == his + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.total() == los + lom + him + his + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="low severe" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.samples_seen == static_cast<int>(x.size()) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_severe == los + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_mild == lom + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_mild == him + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_severe == his + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.total() == los + lom + him + his + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="low mild" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.samples_seen == static_cast<int>(x.size()) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_severe == los + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_mild == lom + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_mild == him + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_severe == his + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.total() == los + lom + him + his + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="high mild" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.samples_seen == static_cast<int>(x.size()) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_severe == los + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_mild == lom + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_mild == him + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_severe == his + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.total() == los + lom + him + his + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="high severe" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.samples_seen == static_cast<int>(x.size()) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_severe == los + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_mild == lom + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_mild == him + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_severe == his + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.total() == los + lom + him + his + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="mixed" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.samples_seen == static_cast<int>(x.size()) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_severe == los + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.low_mild == lom + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_mild == him + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_severe == his + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.total() == los + lom + him + his + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="comparisons between const int variables" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + unsigned_char_var == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + unsigned_short_var == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + unsigned_int_var == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_char_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_short_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_int_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_long_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="convertToBits" tags="[conversion][floating-point]" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( 0.f ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( -0.f ) == ( 1ULL << 31 ) + </Original> + <Expanded> + 2147483648 (0x<hex digits>) +== +2147483648 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( 0. ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( -0. ) == ( 1ULL << 63 ) + </Original> + <Expanded> + 9223372036854775808 (0x<hex digits>) +== +9223372036854775808 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="empty tags are not allowed" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) + </Original> + <Expanded> + Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="erfc_inv" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + erfc_inv(1.103560) == Approx(-0.09203687623843015) + </Original> + <Expanded> + -0.0920368762 == Approx( -0.0920368762 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + erfc_inv(1.067400) == Approx(-0.05980291115763361) + </Original> + <Expanded> + -0.0598029112 == Approx( -0.0598029112 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + erfc_inv(0.050000) == Approx(1.38590382434967796) + </Original> + <Expanded> + 1.3859038243 == Approx( 1.3859038243 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="estimate_clock_resolution" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res.mean.count() == rate + </Original> + <Expanded> + 2000.0 == 2000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res.outliers.total() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="even more nested SECTION tests" tags="[sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="c" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="d (leaf)" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="e (leaf)" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="has printf" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="is_unary_function" tags="[clara][compilation]" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="just failure" tags="[.][fail][isolated info][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<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="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<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="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="just unscoped info" tags="[info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="long long" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + l == std::numeric_limits<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="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="b is currently: 0" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Info> + Testing if fib[0] (1) is even + </Info> + <Expression success="false" type="CHECK" filename="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="makeStream recognizes %debug stream name" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "%debug" ) + </Original> + <Expanded> + Catch::makeStream( "%debug" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="make_unique reimplementation" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="From lvalue copies" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(lval.has_moved) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From rvalue moves" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + rval.has_moved + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Variadic constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr == std::tuple<int, double, int>{1, 2., 3} + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="mean" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + m == 19. + </Original> + <Expanded> + 19.0 == 19.0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="measure" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x == 17 + </Original> + <Expanded> + 17 == 17 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x == 23 + </Original> + <Expanded> + 23 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + r.elapsed.count() == 42 + </Original> + <Expanded> + 42 == 42 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + r.result == 23 + </Original> + <Expanded> + 23 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + r.iterations == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + s.elapsed.count() == 69 + </Original> + <Expanded> + 69 == 69 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + s.result == 17 + </Original> + <Expanded> + 17 == 17 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + s.iterations == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="mix info, unscoped info and warning" tags="[info][unscoped]" filename="tests/<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="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="less than" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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> + <OverallResult success="false"/> + </TestCase> + <TestCase name="nested SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + a != b + </Original> + <Expanded> + 1 != 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + b != a + </Original> + <Expanded> + 2 != 1 + </Expanded> + </Expression> + <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="[.][failing]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + ti == typeid(int) + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="normal_cdf" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(0.000000) == Approx(0.50000000000000000) + </Original> + <Expanded> + 0.5 == Approx( 0.5 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(1.000000) == Approx(0.84134474606854293) + </Original> + <Expanded> + 0.8413447461 == Approx( 0.8413447461 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(-1.000000) == Approx(0.15865525393145705) + </Original> + <Expanded> + 0.1586552539 == Approx( 0.1586552539 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(2.809729) == Approx(0.99752083845315409) + </Original> + <Expanded> + 0.9975208385 == Approx( 0.9975208385 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(-1.352570) == Approx(0.08809652095066035) + </Original> + <Expanded> + 0.088096521 == Approx( 0.088096521 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="normal_quantile" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_quantile(0.551780) == Approx(0.13015979861484198) + </Original> + <Expanded> + 0.1301597986 == Approx( 0.1301597986 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_quantile(0.533700) == Approx(0.08457408802851875) + </Original> + <Expanded> + 0.084574088 == Approx( 0.084574088 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_quantile(0.025000) == Approx(-1.95996398454005449) + </Original> + <Expanded> + -1.9599639845 == Approx( -1.9599639845 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="not allowed" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="not prints unscoped info from previous failures" tags="[.][failing][info][unscoped]" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="null strings" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + makeString( false ) != static_cast<char*>(0) + </Original> + <Expanded> + "valid string" != {null string} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + makeString( true ) == static_cast<char*>(0) + </Original> + <Expanded> + {null string} == {null string} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="null_ptr" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + ptr.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="pair<pair<int,const char *,pair<std::string,int> > -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="[enums][Strings]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Section name="No enums" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) + </Original> + <Expanded> + { } Equals: { } + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="One enum value" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) + </Original> + <Expanded> + { Value1 } Equals: { Value1 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) + </Original> + <Expanded> + { Value1 } Equals: { Value1 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) + </Original> + <Expanded> + { Value1 } Equals: { Value1 } + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Multiple enum values" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) + </Original> + <Expanded> + { Value1, Value2 } Equals: { Value1, Value2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) + </Original> + <Expanded> + { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<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="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="[.][failing][info][unscoped]" filename="tests/<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="tests/<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="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this SHOULD be seen only ONCE + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="random SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + a != b + </Original> + <Expanded> + 1 != 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Section name="replace single char" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + Catch::replaceInPlace(letters, "b", "z") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + Catch::replaceInPlace(letters, "c", "z") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + Catch::replaceInPlace(letters, "a", "z") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + Catch::replaceInPlace(letters, "g", "z") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + Catch::replaceInPlace(letters, letters, "replaced") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + !(Catch::replaceInPlace(letters, "x", "z")) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + Catch::replaceInPlace(s, "'", "|'") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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="request an unknown %-starting stream fails" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "%somestream" ) + </Original> + <Expanded> + Catch::makeStream( "%somestream" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="resolution" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res.size() == count + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="run_for_at_least, chronometer" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 1 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 2 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 4 >= 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 8 >= 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 16 >= 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 32 >= 16 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 64 >= 32 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 128 >= 64 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.elapsed >= time + </Original> + <Expanded> + 128 ns >= 100 ns + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.result == Timing.iterations + 17 + </Original> + <Expanded> + 145 == 145 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.iterations >= time.count() + </Original> + <Expanded> + 128 >= 100 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="run_for_at_least, int" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 1 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 2 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 4 >= 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 8 >= 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 16 >= 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 32 >= 16 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 64 >= 32 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 128 >= 64 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.elapsed >= time + </Original> + <Expanded> + 128 ns >= 100 ns + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.result == Timing.iterations + 17 + </Original> + <Expanded> + 145 == 145 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.iterations >= time.count() + </Original> + <Expanded> + 128 >= 100 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="second tag" tags="[tag2]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="send a single char to INFO" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Info> + 3 + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="sends information to INFO" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + hi + </Info> + <Info> + i := 7 + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<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" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testcase.tags, VectorContains( Tag( "magic-tag" ) ) && VectorContains( Tag( "."_catch_sr ) ) + </Original> + <Expanded> + { {?}, {?} } ( Contains: {?} and Contains: {?} ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="splitString" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + splitStringRef("", ','), Equals(std::vector<StringRef>()) + </Original> + <Expanded> + { } Equals: { } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}) + </Original> + <Expanded> + { abc } Equals: { abc } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}) + </Original> + <Expanded> + { abc, def } Equals: { abc, def } + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stacks unscoped info in loops" tags="[.][failing][info][unscoped]" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="startsWith" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + !(startsWith("", 'c')) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + startsWith(std::string("abc"), 'a') + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + startsWith("def"_catch_sr, 'd') + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="std::map is convertible string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="empty" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<int,const std::string> -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<int,std::string> -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="empty" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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<std::pair<std::string,int> > -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="stdout and stderr streams have %-starting name" tags="[streams]" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "%stderr" )->isConsole() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Stream.tests.cpp" > + <Original> + Catch::makeStream( "%stdout" )->isConsole() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify ranges" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" + </Original> + <Expanded> + "op<<(streamable_range)" +== +"op<<(streamable_range)" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" + </Original> + <Expanded> + "StringMaker<has_maker>" +== +"StringMaker<has_maker>" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_maker_and_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" + </Original> + <Expanded> + "StringMaker<has_maker_and_operator>" +== +"StringMaker<has_maker_and_operator>" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_neither )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" + </Original> + <Expanded> + "operator<<( has_operator )" +== +"operator<<( has_operator )" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_template_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" + </Original> + <Expanded> + "operator<<( has_template_operator )" +== +"operator<<( has_template_operator )" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_maker> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" + </Original> + <Expanded> + "{ StringMaker<has_maker> }" +== +"{ StringMaker<has_maker> }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_maker_and_operator> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" + </Original> + <Expanded> + "{ StringMaker<has_maker_and_operator> }" +== +"{ StringMaker<has_maker_and_operator> }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_operator> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" + </Original> + <Expanded> + "{ operator<<( has_operator ) }" +== +"{ operator<<( has_operator ) }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="strlen3" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + data.str.size() == data.len + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + data.str.size() == data.len + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + data.str.size() == data.len + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tags with dots in later positions are not parsed as hidden" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testcase.tags.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testcase.tags[0].original == "magic.tag"_catch_sr + </Original> + <Expanded> + magic.tag == magic.tag + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="thrown std::strings are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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<<)" tags="[enum][enumClass][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<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="tests/<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="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e0) == "0" + </Original> + <Expanded> + "0" == "0" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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<<)" tags="[enum][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<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="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e0) == "0" + </Original> + <Expanded> + "0" == "0" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<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<>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ }" == ::Catch::Detail::stringify(type{}) + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ }" == ::Catch::Detail::stringify(value) + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tuple<float,int>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="tests/<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<int>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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<string,string>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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<tuple<int>,tuple<>,float>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<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="uniform samples" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.point == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.upper_bound == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.lower_bound == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.confidence_interval == 0.95 + </Original> + <Expanded> + 0.95 == 0.95 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="unique_ptr reimplementation: basic functionality" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="Default constructed unique_ptr is empty" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take ownership of allocation" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == naked_ptr + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <Section name="Plain reset deallocates" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take ownership of allocation" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == naked_ptr + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <Section name="Reset replaces ownership" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Release releases ownership" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr1) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr2 + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr2 == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr2) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr1 + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr1 == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="free swap" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr1 == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr2 == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="vec<vec<string,alloc>> -> toString" tags="[toString][vector,allocator]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(v) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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<bool> -> toString" tags="[containers][toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(bools) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(bools) == "{ true }" + </Original> + <Expanded> + "{ true }" == "{ true }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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<int,allocator> -> toString" tags="[toString][vector,allocator]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ 42 }" + </Original> + <Expanded> + "{ 42 }" == "{ 42 }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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<int> -> toString" tags="[toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ 42 }" + </Original> + <Expanded> + "{ 42 }" == "{ 42 }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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<string> -> toString" tags="[toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ \"hello\" }" + </Original> + <Expanded> + "{ "hello" }" == "{ "hello" }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<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="warmup" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + (iterations * rate) > Catch::Benchmark::Detail::warmup_time.count() + </Original> + <Expanded> + 160000000 (0x<hex digits>) > 100 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + (end - start) > Catch::Benchmark::Detail::warmup_time + </Original> + <Expanded> + 310016000 ns > 100 ms + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="weighted_average_quantile" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + q1 == 14.5 + </Original> + <Expanded> + 14.5 == 14.5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + med == 18. + </Original> + <Expanded> + 18.0 == 18.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + q3 == 23. + </Original> + <Expanded> + 23.0 == 23.0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="xmlentitycheck" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="embedded xml: <test>it should be possible to embed xml characters, such as <, " or &, or even whole <xml>documents</xml> within an attribute</test>" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="encoded chars: these should all be encoded: &&&"""<<<&"<<&"" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <OverallResults successes="2129" failures="143" expectedFailures="27"/> + <OverallResultsCases successes="304" failures="83" expectedFailures="7"/> +</Catch2TestRun> diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp index 1259e7ffe..2cbf05b8e 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp @@ -1,22 +1,73 @@ + // Copyright Catch2 Authors // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 - + #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_clara.hpp> #include <string> +TEST_CASE("is_unary_function", "[clara][compilation]") { + auto unary1 = [](int) {}; + auto unary2 = [](std::string const&) {}; + auto const unary3 = [](std::string const&) {}; + auto unary4 = [](int) { return 42; }; + void unary5(char); + double unary6(long); + + double binary1(long, int); + auto binary2 = [](int, char) {}; + auto nullary1 = []() {}; + auto nullary2 = []() {return 42;}; + + STATIC_REQUIRE(Catch::Clara::Detail::is_unary_function<decltype(unary1)>::value); + STATIC_REQUIRE(Catch::Clara::Detail::is_unary_function<decltype(unary2)>::value); + STATIC_REQUIRE(Catch::Clara::Detail::is_unary_function<decltype(unary3)>::value); + STATIC_REQUIRE(Catch::Clara::Detail::is_unary_function<decltype(unary4)>::value); + STATIC_REQUIRE(Catch::Clara::Detail::is_unary_function<decltype(unary5)>::value); + STATIC_REQUIRE(Catch::Clara::Detail::is_unary_function<decltype(unary6)>::value); + + STATIC_REQUIRE_FALSE(Catch::Clara::Detail::is_unary_function<decltype(binary1)>::value); + STATIC_REQUIRE_FALSE(Catch::Clara::Detail::is_unary_function<decltype(binary2)>::value); + STATIC_REQUIRE_FALSE(Catch::Clara::Detail::is_unary_function<decltype(nullary1)>::value); + STATIC_REQUIRE_FALSE(Catch::Clara::Detail::is_unary_function<decltype(nullary2)>::value); + STATIC_REQUIRE_FALSE(Catch::Clara::Detail::is_unary_function<int>::value); + STATIC_REQUIRE_FALSE(Catch::Clara::Detail::is_unary_function<std::string const&>::value); +} + + TEST_CASE("Clara::Arg supports single-arg parse the way Opt does", "[clara][arg][compilation]") { std::string name; auto p = Catch::Clara::Arg(name, "just one arg"); - + CHECK(name.empty()); - + p.parse( Catch::Clara::Args{ "UnitTest", "foo" } ); REQUIRE(name == "foo"); } + +TEST_CASE("Clara::Opt supports accept-many lambdas", "[clara][opt]") { + using namespace Catch::Clara; + std::vector<std::string> res; + const auto push_to_res = [&](std::string const& s) { + res.push_back(s); + return ParserResult::ok( ParseResultType::Matched ); + }; + + SECTION("Parsing fails on multiple options without accept_many") { + auto p = Parser() | Opt(push_to_res, "value")["-o"]; + auto parse_result = p.parse( Args{ "UnitTest", "-o", "aaa", "-o", "bbb" } ); + CHECK_FALSE(parse_result); + } + SECTION("Parsing succeeds on multiple options with accept_many") { + auto p = Parser() | Opt(accept_many, push_to_res, "value")["-o"]; + auto parse_result = p.parse( Args{ "UnitTest", "-o", "aaa", "-o", "bbb" } ); + CHECK(parse_result); + CHECK(res == std::vector<std::string>{ "aaa", "bbb" }); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp index e8bf6e5f6..e7b0c9c16 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp @@ -1,20 +1,22 @@ -/* - * 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) - */ +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_config.hpp> #include <catch2/catch_approx.hpp> #include <catch2/catch_test_macros.hpp> #include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/internal/catch_test_spec_parser.hpp> +#include <catch2/catch_user_config.hpp> #include <catch2/catch_test_case_info.hpp> -#include <catch2/catch_config.hpp> #include <catch2/internal/catch_commandline.hpp> #include <catch2/generators/catch_generators.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> -#ifdef __clang__ -# pragma clang diagnostic ignored "-Wc++98-compat" -#endif namespace { auto fakeTestCase(const char* name, const char* desc = "") { return Catch::makeTestCaseInfo("", { name, desc }, CATCH_INTERNAL_LINEINFO); } @@ -345,10 +347,29 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" CHECK(config.shouldDebugBreak == false); CHECK(config.abortAfter == -1); CHECK(config.noThrow == false); - CHECK(config.reporterName == "console"); + CHECK( config.reporterSpecifications.empty() ); Catch::Config cfg(config); CHECK_FALSE(cfg.hasTestFilters()); + + // The Config is responsible for mixing in the default reporter + auto expectedReporter = +#if defined( CATCH_CONFIG_DEFAULT_REPORTER ) + CATCH_CONFIG_DEFAULT_REPORTER +#else + "console" +#endif + ; + + CHECK( cfg.getReporterSpecs().size() == 1 ); + CHECK( cfg.getReporterSpecs()[0] == + Catch::ReporterSpec{ expectedReporter, {}, {}, {} } ); + CHECK( cfg.getProcessedReporterSpecs().size() == 1 ); + CHECK( cfg.getProcessedReporterSpecs()[0] == + Catch::ProcessedReporterSpec{ expectedReporter, + std::string{}, + Catch::ColourMode::PlatformDefault, + {} } ); } SECTION("test lists") { @@ -384,29 +405,70 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" } SECTION("reporter") { + using vec_Specs = std::vector<Catch::ReporterSpec>; + using namespace std::string_literals; SECTION("-r/console") { - CHECK(cli.parse({"test", "-r", "console"})); + auto result = cli.parse({"test", "-r", "console"}); + CAPTURE(result.errorMessage()); + CHECK(result); - REQUIRE(config.reporterName == "console"); + REQUIRE( config.reporterSpecifications == + vec_Specs{ { "console", {}, {}, {} } } ); } SECTION("-r/xml") { - CHECK(cli.parse({"test", "-r", "xml"})); + auto result = cli.parse({"test", "-r", "xml"}); + CAPTURE(result.errorMessage()); + CHECK(result); - REQUIRE(config.reporterName == "xml"); + REQUIRE( config.reporterSpecifications == + vec_Specs{ { "xml", {}, {}, {} } } ); } SECTION("--reporter/junit") { - CHECK(cli.parse({"test", "--reporter", "junit"})); + auto result = cli.parse({"test", "--reporter", "junit"}); + CAPTURE(result.errorMessage()); + CHECK(result); - REQUIRE(config.reporterName == "junit"); - } - SECTION("Only one reporter is accepted") { - REQUIRE_FALSE(cli.parse({ "test", "-r", "xml", "-r", "junit" })); + REQUIRE( config.reporterSpecifications == + vec_Specs{ { "junit", {}, {}, {} } } ); } SECTION("must match one of the available ones") { auto result = cli.parse({"test", "--reporter", "unsupported"}); CHECK(!result); - REQUIRE_THAT(result.errorMessage(), Contains("Unrecognized reporter")); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("Unrecognized reporter")); + } + SECTION("With output file") { + auto result = cli.parse({ "test", "-r", "console::out=out.txt" }); + CAPTURE(result.errorMessage()); + CHECK(result); + REQUIRE( config.reporterSpecifications == + vec_Specs{ { "console", "out.txt"s, {}, {} } } ); + } + SECTION("With Windows-like absolute path as output file") { + auto result = cli.parse({ "test", "-r", "console::out=C:\\Temp\\out.txt" }); + CAPTURE(result.errorMessage()); + CHECK(result); + REQUIRE( config.reporterSpecifications == + vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } ); + } + SECTION("Multiple reporters") { + SECTION("All with output files") { + CHECK(cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" })); + REQUIRE( config.reporterSpecifications == + vec_Specs{ { "xml", "output.xml"s, {}, {} }, + { "junit", "output-junit.xml"s, {}, {} } } ); + } + SECTION("Mixed output files and default output") { + CHECK(cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" })); + REQUIRE( config.reporterSpecifications == + vec_Specs{ { "xml", "output.xml"s, {}, {} }, + { "console", {}, {}, {} } } ); + } + SECTION("cannot have multiple reporters with default output") { + auto result = cli.parse({ "test", "-r", "console", "-r", "xml::out=output.xml", "-r", "junit" }); + CHECK(!result); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.")); + } } } @@ -438,7 +500,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" SECTION("-x must be numeric") { auto result = cli.parse({"test", "-x", "oops"}); CHECK(!result); - REQUIRE_THAT(result.errorMessage(), Contains("convert") && Contains("oops")); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops")); } SECTION("wait-for-keypress") { @@ -460,7 +522,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" CHECK(!result); #ifndef CATCH_CONFIG_DISABLE_MATCHERS - REQUIRE_THAT(result.errorMessage(), Contains("never") && Contains("both")); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both")); #endif } } @@ -483,12 +545,12 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" SECTION("-o filename") { CHECK(cli.parse({"test", "-o", "filename.ext"})); - REQUIRE(config.outputFilename == "filename.ext"); + REQUIRE(config.defaultOutputFilename == "filename.ext"); } SECTION("--out") { CHECK(cli.parse({"test", "--out", "filename.ext"})); - REQUIRE(config.outputFilename == "filename.ext"); + REQUIRE(config.defaultOutputFilename == "filename.ext"); } } @@ -505,36 +567,36 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" SECTION( "use-colour") { - using Catch::UseColour; + using Catch::ColourMode; SECTION( "without option" ) { CHECK(cli.parse({"test"})); - REQUIRE( config.useColour == UseColour::Auto ); + REQUIRE( config.defaultColourMode == ColourMode::PlatformDefault ); } SECTION( "auto" ) { - CHECK(cli.parse({"test", "--use-colour", "auto"})); + CHECK( cli.parse( { "test", "--colour-mode", "default" } ) ); - REQUIRE( config.useColour == UseColour::Auto ); + REQUIRE( config.defaultColourMode == ColourMode::PlatformDefault ); } SECTION( "yes" ) { - CHECK(cli.parse({"test", "--use-colour", "yes"})); + CHECK(cli.parse({"test", "--colour-mode", "ansi"})); - REQUIRE( config.useColour == UseColour::Yes ); + REQUIRE( config.defaultColourMode == ColourMode::ANSI ); } SECTION( "no" ) { - CHECK(cli.parse({"test", "--use-colour", "no"})); + CHECK(cli.parse({"test", "--colour-mode", "none"})); - REQUIRE( config.useColour == UseColour::No ); + REQUIRE( config.defaultColourMode == ColourMode::None ); } SECTION( "error" ) { - auto result = cli.parse({"test", "--use-colour", "wrong"}); + auto result = cli.parse({"test", "--colour-mode", "wrong"}); CHECK( !result ); - CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ); + CHECK_THAT( result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) ); } } @@ -571,7 +633,107 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" } } +TEST_CASE("Parsing sharding-related cli flags", "[sharding]") { + using namespace Catch::Matchers; + + Catch::ConfigData config; + auto cli = Catch::makeCommandLineParser(config); + + SECTION("shard-count") { + CHECK(cli.parse({ "test", "--shard-count=8" })); + + REQUIRE(config.shardCount == 8); + } + + SECTION("Negative shard count reports error") { + auto result = cli.parse({ "test", "--shard-count=-1" }); + + CHECK_FALSE(result); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("Shard count must be a positive number")); + } + + SECTION("Zero shard count reports error") { + auto result = cli.parse({ "test", "--shard-count=0" }); + + CHECK_FALSE(result); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("Shard count must be a positive number")); + } + + SECTION("shard-index") { + CHECK(cli.parse({ "test", "--shard-index=2" })); + + REQUIRE(config.shardIndex == 2); + } + + SECTION("Negative shard index reports error") { + auto result = cli.parse({ "test", "--shard-index=-12" }); + + CHECK_FALSE(result); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("Shard index must be a non-negative number")); + } + + SECTION("Shard index 0 is accepted") { + CHECK(cli.parse({ "test", "--shard-index=0" })); + + REQUIRE(config.shardIndex == 0); + } + +} + +TEST_CASE( "Parsing warnings", "[cli][warnings]" ) { + using Catch::WarnAbout; + + Catch::ConfigData config; + auto cli = Catch::makeCommandLineParser( config ); + + SECTION( "NoAssertions" ) { + REQUIRE(cli.parse( { "test", "-w", "NoAssertions" } )); + REQUIRE( config.warnings == WarnAbout::NoAssertions ); + } + SECTION( "NoTests is no longer supported" ) { + REQUIRE_FALSE(cli.parse( { "test", "-w", "NoTests" } )); + } + SECTION( "Combining multiple warnings" ) { + REQUIRE( cli.parse( { "test", + "--warn", "NoAssertions", + "--warn", "UnmatchedTestSpec" } ) ); + + REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) ); + } +} + TEST_CASE("Test with special, characters \"in name", "[cli][regression]") { // This test case succeeds if we can invoke it from the CLI SUCCEED(); } + +TEST_CASE("Various suspicious reporter specs are rejected", + "[cli][reporter-spec][approvals]") { + Catch::ConfigData config; + auto cli = Catch::makeCommandLineParser( config ); + + auto spec = GENERATE( as<std::string>{}, + "", + "::console", + "console::", + "console::some-file::", + "::console::some-file::" ); + CAPTURE( spec ); + + auto result = cli.parse( { "test", "--reporter", spec } ); + REQUIRE_FALSE( result ); +} + +TEST_CASE("Win32 colour implementation is compile-time optional", + "[approvals][cli][colours]") { + Catch::ConfigData config; + auto cli = Catch::makeCommandLineParser( config ); + + auto result = cli.parse( { "test", "--colour-mode", "win32" } ); + +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) + REQUIRE( result ); +#else + REQUIRE_FALSE( result ); +#endif +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLineHelpers.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLineHelpers.tests.cpp new file mode 100644 index 000000000..b8a543903 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/CmdLineHelpers.tests.cpp @@ -0,0 +1,111 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_macros.hpp> +#include <catch2/internal/catch_reporter_spec_parser.hpp> +#include <catch2/matchers/catch_matchers_vector.hpp> +#include <catch2/interfaces/catch_interfaces_config.hpp> + +TEST_CASE("Reporter spec splitting", "[reporter-spec][cli][approvals]") { + using Catch::Detail::splitReporterSpec; + using Catch::Matchers::Equals; + using namespace std::string_literals; + + SECTION("Various edge cases") { + REQUIRE_THAT( splitReporterSpec( "" ), + Equals( std::vector<std::string>{ ""s } ) ); + REQUIRE_THAT( splitReporterSpec( "::" ), + Equals( std::vector<std::string>{ "", "" } ) ); + REQUIRE_THAT( splitReporterSpec( "::rep" ), + Equals( std::vector<std::string>{ "", "rep" } ) ); + REQUIRE_THAT( splitReporterSpec( "rep::" ), + Equals( std::vector<std::string>{ "rep", "" } ) ); + + } + + SECTION("Validish specs") { + REQUIRE_THAT( splitReporterSpec( "newReporter" ), + Equals( std::vector<std::string>{ "newReporter"s } ) ); + REQUIRE_THAT( + splitReporterSpec( "foo-reporter::key1=value1::key2=value with " + "space::key with space=some-value" ), + Equals( + std::vector<std::string>{ "foo-reporter"s, + "key1=value1"s, + "key2=value with space"s, + "key with space=some-value"s } ) ); + REQUIRE_THAT( + splitReporterSpec( "spaced reporter name::key:key=value:value" ), + Equals( std::vector<std::string>{ "spaced reporter name"s, + "key:key=value:value"s } ) ); + } +} + +TEST_CASE( "Parsing colour mode", "[cli][colour][approvals]" ) { + using Catch::Detail::stringToColourMode; + using Catch::ColourMode; + SECTION("Valid strings") { + REQUIRE( stringToColourMode( "none" ) == ColourMode::None ); + REQUIRE( stringToColourMode( "ansi" ) == ColourMode::ANSI ); + REQUIRE( stringToColourMode( "win32" ) == ColourMode::Win32 ); + REQUIRE( stringToColourMode( "default" ) == + ColourMode::PlatformDefault ); + } + SECTION("Wrong strings") { + REQUIRE_FALSE( stringToColourMode( "NONE" ) ); + REQUIRE_FALSE( stringToColourMode( "-" ) ); + REQUIRE_FALSE( stringToColourMode( "asdbjsdb kasbd" ) ); + } +} + + +TEST_CASE("Parsing reporter specs", "[cli][reporter-spec][approvals]") { + using Catch::parseReporterSpec; + using Catch::ReporterSpec; + using namespace std::string_literals; + + SECTION( "Correct specs" ) { + REQUIRE( parseReporterSpec( "someReporter" ) == + ReporterSpec( "someReporter"s, {}, {}, {} ) ); + REQUIRE( parseReporterSpec( "otherReporter::Xk=v::out=c:\\blah" ) == + ReporterSpec( + "otherReporter"s, "c:\\blah"s, {}, { { "Xk"s, "v"s } } ) ); + REQUIRE( parseReporterSpec( "diffReporter::Xk1=v1::Xk2==v2" ) == + ReporterSpec( "diffReporter", + {}, + {}, + { { "Xk1"s, "v1"s }, { "Xk2"s, "=v2"s } } ) ); + REQUIRE( parseReporterSpec( + "Foo:bar:reporter::colour-mode=ansi::Xk 1=v 1::Xk2=v:3" ) == + ReporterSpec( "Foo:bar:reporter", + {}, + Catch::ColourMode::ANSI, + { { "Xk 1"s, "v 1"s }, { "Xk2"s, "v:3"s } } ) ); + } + + SECTION( "Bad specs" ) { + REQUIRE_FALSE( parseReporterSpec( "::" ) ); + // Unknown Catch2 arg (should be "out") + REQUIRE_FALSE( parseReporterSpec( "reporter::output=filename" ) ); + // Wrong colour spec + REQUIRE_FALSE( parseReporterSpec( "reporter::colour-mode=custom" ) ); + // Duplicated colour spec + REQUIRE_FALSE( parseReporterSpec( "reporter::colour-mode=ansi::colour-mode=ansi" ) ); + // Duplicated out arg + REQUIRE_FALSE( parseReporterSpec( "reporter::out=f.txt::out=z.txt" ) ); + // Duplicated custom arg + REQUIRE_FALSE( parseReporterSpec( "reporter::Xa=foo::Xa=bar" ) ); + // Empty key + REQUIRE_FALSE( parseReporterSpec( "reporter::X=foo" ) ); + REQUIRE_FALSE( parseReporterSpec( "reporter::=foo" ) ); + // Empty value + REQUIRE_FALSE( parseReporterSpec( "reporter::Xa=" ) ); + // non-key value later field + REQUIRE_FALSE( parseReporterSpec( "reporter::Xab" ) ); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/ColourImpl.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ColourImpl.tests.cpp new file mode 100644 index 000000000..83501cae5 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ColourImpl.tests.cpp @@ -0,0 +1,64 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_macros.hpp> +#include <catch2/internal/catch_console_colour.hpp> +#include <catch2/internal/catch_istream.hpp> + +#include <sstream> + +namespace { + class TestColourImpl : public Catch::ColourImpl { + using Catch::ColourImpl::ColourImpl; + // Inherited via ColourImpl + void use( Catch::Colour::Code colourCode ) const override { + m_stream->stream() << "Using code: " << colourCode << '\n'; + } + }; + + class TestStringStream : public Catch::IStream { + std::stringstream m_stream; + public: + std::ostream& stream() override { + return m_stream; + } + + std::string str() const { return m_stream.str(); } + }; +} + +TEST_CASE("ColourGuard behaviour", "[console-colours]") { + TestStringStream streamWrapper; + TestColourImpl colourImpl( &streamWrapper ); + auto& stream = streamWrapper.stream(); + + SECTION("ColourGuard is disengaged by default") { + { auto guard = colourImpl.guardColour( Catch::Colour::Red ); } + + REQUIRE( streamWrapper.str().empty() ); + } + + SECTION("ColourGuard is engaged by op<<") { + stream << "1\n" << colourImpl.guardColour( Catch::Colour::Red ) << "2\n"; + stream << "3\n"; + + REQUIRE( streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3\n" ); + } + + SECTION("ColourGuard can be engaged explicitly") { + { + auto guard = + colourImpl.guardColour( Catch::Colour::Red ).engage( stream ); + stream << "A\n" + << "B\n"; + } + stream << "C\n"; + REQUIRE( streamWrapper.str() == + "Using code: 2\nA\nB\nUsing code: 0\nC\n" ); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp index bddb0d5b5..987910a94 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp @@ -1,10 +1,15 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_case_insensitive_comparisons.hpp> +#include <catch2/internal/catch_optional.hpp> #if defined(_MSC_VER) #pragma warning(push) @@ -22,3 +27,62 @@ TEST_CASE("Check that our error handling macros throw the right exceptions", "[! #if defined(_MSC_VER) #pragma warning(pop) // unreachable code in the macro expansions #endif + +TEST_CASE("CaseInsensitiveLess is case insensitive", "[comparisons][string-case]") { + Catch::Detail::CaseInsensitiveLess lt; + SECTION( "Degenerate cases" ) { + REQUIRE( lt( "", "a" ) ); + REQUIRE_FALSE( lt( "a", "a" ) ); + REQUIRE_FALSE( lt( "", "" ) ); + } + SECTION("Plain comparisons") { + REQUIRE( lt( "a", "b" ) ); + REQUIRE( lt( "a", "B" ) ); + REQUIRE( lt( "A", "b" ) ); + REQUIRE( lt( "A", "B" ) ); + } +} + +TEST_CASE( "CaseInsensitiveEqualsTo is case insensitive", + "[comparisons][string-case]" ) { + Catch::Detail::CaseInsensitiveEqualTo eq; + SECTION( "Degenerate cases" ) { + REQUIRE( eq( "", "" ) ); + REQUIRE_FALSE( eq( "", "a" ) ); + } + SECTION( "Plain comparisons" ) { + REQUIRE( eq( "a", "a" ) ); + REQUIRE( eq( "a", "A" ) ); + REQUIRE( eq( "A", "a" ) ); + REQUIRE( eq( "A", "A" ) ); + REQUIRE_FALSE( eq( "a", "b" ) ); + REQUIRE_FALSE( eq( "a", "B" ) ); + } +} + +TEST_CASE("Optional comparison ops", "[optional][approvals]") { + using Catch::Optional; + + Optional<int> a, b; + + SECTION( "Empty optionals are equal" ) { + REQUIRE( a == b ); + REQUIRE_FALSE( a != b ); + } + SECTION( "Empty and non-empty optionals are never equal" ) { + a = 1; + REQUIRE_FALSE( a == b ); + REQUIRE( a != b ); + } + SECTION( + "non-empty optionals are equal if the contained elements are equal") { + a = 1; + b = 2; + REQUIRE( a != b ); + REQUIRE_FALSE( a == b ); + + a = 2; + REQUIRE( a == b ); + REQUIRE_FALSE( a != b ); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp index 7a1ca110a..242a89670 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <catch2/catch_template_test_macros.hpp> #include <catch2/internal/catch_floating_point_helpers.hpp> diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp index 848bb1d9e..3ad20453c 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp @@ -1,3 +1,15 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + #include <catch2/catch_approx.hpp> #include <catch2/catch_test_macros.hpp> #include <catch2/generators/catch_generator_exception.hpp> @@ -50,14 +62,27 @@ TEST_CASE("Generators internals", "[generators][internals]") { } 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()); + SECTION("Simple filtering") { + 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()); + } + SECTION("Filter out multiple elements at the start and end") { + auto gen = filter([](int i) { return i != 2; }, values({ 2, 2, 1, 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("Throws on construction if it can't get initial element") { + REQUIRE_THROWS_AS(filter([](int) { return false; }, value(1)), Catch::GeneratorException); + REQUIRE_THROWS_AS( + filter([](int) { return false; }, values({ 1, 2, 3 })), + Catch::GeneratorException); + } } SECTION("Take generator") { SECTION("Take less") { @@ -388,3 +413,124 @@ TEST_CASE("GENERATE decays arrays", "[generators][compilation][approvals]") { auto str = GENERATE("abc", "def", "gh"); STATIC_REQUIRE(std::is_same<decltype(str), const char*>::value); } + +TEST_CASE("Generators count returned elements", "[generators][approvals]") { + auto generator = Catch::Generators::FixedValuesGenerator<int>( { 1, 2, 3 } ); + REQUIRE( generator.currentElementIndex() == 0 ); + REQUIRE( generator.countedNext() ); + REQUIRE( generator.currentElementIndex() == 1 ); + REQUIRE( generator.countedNext() ); + REQUIRE( generator.currentElementIndex() == 2 ); + REQUIRE_FALSE( generator.countedNext() ); + REQUIRE( generator.currentElementIndex() == 2 ); +} + +TEST_CASE( "Generators can stringify their elements", + "[generators][approvals]" ) { + auto generator = + Catch::Generators::FixedValuesGenerator<int>( { 1, 2, 3 } ); + + REQUIRE( generator.currentElementAsString() == "1"_catch_sr ); + REQUIRE( generator.countedNext() ); + REQUIRE( generator.currentElementAsString() == "2"_catch_sr ); + REQUIRE( generator.countedNext() ); + REQUIRE( generator.currentElementAsString() == "3"_catch_sr ); +} + +namespace { + class CustomStringifyGenerator + : public Catch::Generators::IGenerator<bool> { + bool m_first = true; + + std::string stringifyImpl() const override { + return m_first ? "first" : "second"; + } + + bool next() override { + if ( m_first ) { + m_first = false; + return true; + } + return false; + } + + public: + bool const& get() const override; + }; + + // Avoids -Wweak-vtables + bool const& CustomStringifyGenerator::get() const { return m_first; } +} // namespace + +TEST_CASE( "Generators can override element stringification", + "[generators][approvals]" ) { + CustomStringifyGenerator generator; + REQUIRE( generator.currentElementAsString() == "first"_catch_sr ); + REQUIRE( generator.countedNext() ); + REQUIRE( generator.currentElementAsString() == "second"_catch_sr ); +} + +namespace { + class StringifyCountingGenerator + : public Catch::Generators::IGenerator<bool> { + bool m_first = true; + mutable size_t m_stringificationCalls = 0; + + std::string stringifyImpl() const override { + ++m_stringificationCalls; + return m_first ? "first" : "second"; + } + + bool next() override { + if ( m_first ) { + m_first = false; + return true; + } + return false; + } + + public: + + bool const& get() const override; + size_t stringificationCalls() const { return m_stringificationCalls; } + }; + + // Avoids -Wweak-vtables + bool const& StringifyCountingGenerator::get() const { return m_first; } + +} // namespace + +TEST_CASE( "Generator element stringification is cached", + "[generators][approvals]" ) { + StringifyCountingGenerator generator; + REQUIRE( generator.currentElementAsString() == "first"_catch_sr ); + REQUIRE( generator.currentElementAsString() == "first"_catch_sr ); + REQUIRE( generator.currentElementAsString() == "first"_catch_sr ); + REQUIRE( generator.currentElementAsString() == "first"_catch_sr ); + REQUIRE( generator.currentElementAsString() == "first"_catch_sr ); + + REQUIRE( generator.stringificationCalls() == 1 ); +} + +TEST_CASE( "Random generators can be seeded", "[generators][approvals]" ) { + SECTION( "Integer generator" ) { + using Catch::Generators::RandomIntegerGenerator; + RandomIntegerGenerator<int> rng1( 0, 100, 0x1234 ), + rng2( 0, 100, 0x1234 ); + + for ( size_t i = 0; i < 10; ++i ) { + REQUIRE( rng1.get() == rng2.get() ); + rng1.next(); rng2.next(); + } + } + SECTION("Float generator") { + using Catch::Generators::RandomFloatingGenerator; + RandomFloatingGenerator<double> rng1( 0., 100., 0x1234 ), + rng2( 0., 100., 0x1234 ); + for ( size_t i = 0; i < 10; ++i ) { + REQUIRE( rng1.get() == rng2.get() ); + rng1.next(); + rng2.next(); + } + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp index 19fa8f953..f51f7bd9d 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp @@ -1,10 +1,17 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +// Adapted from donated nonius code. + + +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + #include <catch2/catch_test_macros.hpp> #include <catch2/catch_approx.hpp> @@ -282,8 +289,8 @@ TEST_CASE("analyse", "[approvals][benchmark]") { } 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.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); diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/PartTracker.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/PartTracker.tests.cpp index c56adc5e9..025a28604 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/PartTracker.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/PartTracker.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/generators/catch_generators.hpp> diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp index 3d388c66d..b79b372e9 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp @@ -1,10 +1,15 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_random_number_generator.hpp> +#include <catch2/internal/catch_random_seed_generation.hpp> +#include <catch2/generators/catch_generators.hpp> TEST_CASE("Our PCG implementation provides expected results for known seeds", "[rng]") { Catch::SimplePcg32 rng; @@ -40,3 +45,18 @@ TEST_CASE("Comparison ops", "[rng]") { REQUIRE_FALSE(SimplePcg32{ 1 } == SimplePcg32{ 2 }); REQUIRE_FALSE(SimplePcg32{ 1 } != SimplePcg32{ 1 }); } + +TEST_CASE("Random seed generation reports unknown methods", "[rng][seed]") { + REQUIRE_THROWS(Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))); +} + +TEST_CASE("Random seed generation accepts known methods", "[rng][seed]") { + using Catch::GenerateFrom; + const auto method = GENERATE( + GenerateFrom::Time, + GenerateFrom::RandomDevice, + GenerateFrom::Default + ); + + REQUIRE_NOTHROW(Catch::generateRandomSeed(method)); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp index c5c97998b..97d1ad253 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp @@ -13,33 +13,62 @@ #include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> #include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> +#include <catch2/internal/catch_console_colour.hpp> +#include <catch2/internal/catch_enforce.hpp> #include <catch2/internal/catch_list.hpp> +#include <catch2/internal/catch_reporter_registry.hpp> +#include <catch2/internal/catch_istream.hpp> #include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/reporters/catch_reporter_helpers.hpp> +#include <catch2/reporters/catch_reporter_event_listener.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/reporters/catch_reporter_multi.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <sstream> +namespace { + class StringIStream : public Catch::IStream { + public: + std::ostream& stream() override { return sstr; } + std::string str() const { return sstr.str(); } + private: + std::stringstream sstr; + }; + + //! config must outlive the function + Catch::ReporterConfig makeDummyRepConfig( Catch::Config const& config ) { + return Catch::ReporterConfig{ + &config, + Catch::Detail::make_unique<StringIStream>(), + Catch::ColourMode::None, + {} }; + } +} + TEST_CASE( "The default listing implementation write to provided stream", "[reporters][reporter-helpers]" ) { - using Catch::Matchers::Contains; + using Catch::Matchers::ContainsSubstring; using namespace std::string_literals; - std::stringstream sstream; + StringIStream sstream; SECTION( "Listing tags" ) { std::vector<Catch::TagInfo> tags(1); tags[0].add("fakeTag"_catch_sr); - Catch::defaultListTags(sstream, tags, false); + Catch::defaultListTags(sstream.stream(), tags, false); auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("[fakeTag]"s)); + REQUIRE_THAT(listingString, ContainsSubstring("[fakeTag]"s)); } SECTION( "Listing reporters" ) { std::vector<Catch::ReporterDescription> reporters( { { "fake reporter", "fake description" } } ); - Catch::defaultListReporters(sstream, reporters, Catch::Verbosity::Normal); + Catch::defaultListReporters(sstream.stream(), reporters, Catch::Verbosity::Normal); auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("fake reporter"s)); + REQUIRE_THAT( listingString, + ContainsSubstring( "fake reporter"s ) && + ContainsSubstring( "fake description"s ) ); } SECTION( "Listing tests" ) { Catch::TestCaseInfo fakeInfo{ @@ -47,17 +76,28 @@ TEST_CASE( "The default listing implementation write to provided stream", { "fake test name"_catch_sr, "[fakeTestTag]"_catch_sr }, { "fake-file.cpp", 123456789 } }; std::vector<Catch::TestCaseHandle> tests({ {&fakeInfo, nullptr} }); - Catch::defaultListTests(sstream, tests, false, Catch::Verbosity::Normal); + auto colour = Catch::makeColourImpl( Catch::ColourMode::None, &sstream); + Catch::defaultListTests(sstream.stream(), colour.get(), tests, false, Catch::Verbosity::Normal); + + auto listingString = sstream.str(); + REQUIRE_THAT( listingString, + ContainsSubstring( "fake test name"s ) && + ContainsSubstring( "fakeTestTag"s ) ); + } + SECTION( "Listing listeners" ) { + std::vector<Catch::ListenerDescription> listeners( + { { "fakeListener"_catch_sr, "fake description" } } ); + Catch::defaultListListeners( sstream.stream(), listeners ); auto listingString = sstream.str(); REQUIRE_THAT( listingString, - Contains( "fake test name"s ) && - Contains( "fakeTestTag"s ) ); + ContainsSubstring( "fakeListener"s ) && + ContainsSubstring( "fake description"s ) ); } } TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { - using Catch::Matchers::Contains; + using Catch::Matchers::ContainsSubstring; using namespace std::string_literals; auto const& factories = Catch::getRegistryHub().getReporterRegistry().getFactories(); @@ -67,20 +107,20 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { for (auto const& factory : factories) { INFO("Tested reporter: " << factory.first); - std::stringstream sstream; + auto sstream = Catch::Detail::make_unique<StringIStream>(); + auto& sstreamRef = *sstream.get(); - Catch::ConfigData config_data; - Catch::Config config( config_data ); - Catch::ReporterConfig rep_config( &config, sstream ); - auto reporter = factory.second->create( rep_config ); + Catch::Config config( Catch::ConfigData{} ); + auto reporter = factory.second->create( Catch::ReporterConfig{ + &config, CATCH_MOVE( sstream ), Catch::ColourMode::None, {} } ); DYNAMIC_SECTION( factory.first << " reporter lists tags" ) { std::vector<Catch::TagInfo> tags(1); tags[0].add("fakeTag"_catch_sr); reporter->listTags(tags); - auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("fakeTag"s)); + auto listingString = sstreamRef.str(); + REQUIRE_THAT(listingString, ContainsSubstring("fakeTag"s)); } DYNAMIC_SECTION( factory.first << " reporter lists reporters" ) { @@ -88,8 +128,8 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { { { "fake reporter", "fake description" } } ); reporter->listReporters(reporters); - auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("fake reporter"s)); + auto listingString = sstreamRef.str(); + REQUIRE_THAT(listingString, ContainsSubstring("fake reporter"s)); } DYNAMIC_SECTION( factory.first << " reporter lists tests" ) { @@ -100,10 +140,190 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { std::vector<Catch::TestCaseHandle> tests({ {&fakeInfo, nullptr} }); reporter->listTests(tests); - auto listingString = sstream.str(); + auto listingString = sstreamRef.str(); REQUIRE_THAT( listingString, - Contains( "fake test name"s ) && - Contains( "fakeTestTag"s ) ); + ContainsSubstring( "fake test name"s ) && + ContainsSubstring( "fakeTestTag"s ) ); + } + } +} + + +TEST_CASE("Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla", "[console-reporter]") { + SUCCEED(); +} + +namespace { + // A listener that writes provided string into destination, + // to record order of testRunStarting invocation. + class MockListener : public Catch::EventListenerBase { + std::string m_witness; + std::vector<std::string>& m_recorder; + public: + MockListener( std::string witness, + std::vector<std::string>& recorder, + Catch::IConfig const* config ): + EventListenerBase( config ), + m_witness( witness ), + m_recorder( recorder ) + {} + + void testRunStarting( Catch::TestRunInfo const& ) override { + m_recorder.push_back( m_witness ); + } + }; + // A reporter that writes provided string into destination, + // to record order of testRunStarting invocation. + class MockReporter : public Catch::StreamingReporterBase { + std::string m_witness; + std::vector<std::string>& m_recorder; + public: + MockReporter( std::string witness, + std::vector<std::string>& recorder, + Catch::ReporterConfig&& config ): + StreamingReporterBase( CATCH_MOVE(config) ), + m_witness( witness ), + m_recorder( recorder ) + {} + + void testRunStarting( Catch::TestRunInfo const& ) override { + m_recorder.push_back( m_witness ); + } + }; +} // namespace + +TEST_CASE("Multireporter calls reporters and listeners in correct order", + "[reporters][multi-reporter]") { + Catch::Config config( Catch::ConfigData{} ); + + // We add reporters before listeners, to check that internally they + // get sorted properly, and listeners are called first anyway. + Catch::MultiReporter multiReporter( &config ); + std::vector<std::string> records; + multiReporter.addReporter( Catch::Detail::make_unique<MockReporter>( + "Goodbye", records, makeDummyRepConfig(config) ) ); + multiReporter.addListener( + Catch::Detail::make_unique<MockListener>( "Hello", records, &config ) ); + multiReporter.addListener( + Catch::Detail::make_unique<MockListener>( "world", records, &config ) ); + multiReporter.addReporter( Catch::Detail::make_unique<MockReporter>( + "world", records, makeDummyRepConfig(config) ) ); + multiReporter.testRunStarting( { "" } ); + + std::vector<std::string> expected( { "Hello", "world", "Goodbye", "world" } ); + REQUIRE( records == expected ); +} + +namespace { + // A listener that sets it preferences to test that multireporter, + // properly sets up its own preferences + class PreferenceListener : public Catch::EventListenerBase { + public: + PreferenceListener( bool redirectStdout, + bool reportAllAssertions, + Catch::IConfig const* config ): + EventListenerBase( config ) { + m_preferences.shouldRedirectStdOut = redirectStdout; + m_preferences.shouldReportAllAssertions = reportAllAssertions; + } + }; + // A reporter that sets it preferences to test that multireporter, + // properly sets up its own preferences + class PreferenceReporter : public Catch::StreamingReporterBase { + public: + PreferenceReporter( bool redirectStdout, + bool reportAllAssertions, + Catch::ReporterConfig&& config ): + StreamingReporterBase( CATCH_MOVE(config) ) { + m_preferences.shouldRedirectStdOut = redirectStdout; + m_preferences.shouldReportAllAssertions = reportAllAssertions; } + }; +} // namespace + +TEST_CASE("Multireporter updates ReporterPreferences properly", + "[reporters][multi-reporter]") { + + Catch::Config config( Catch::ConfigData{} ); + Catch::MultiReporter multiReporter( &config ); + + // Post init defaults + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == false ); + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ); + + SECTION( "Adding listeners" ) { + multiReporter.addListener( + Catch::Detail::make_unique<PreferenceListener>( + true, false, &config ) ); + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ); + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ); + + multiReporter.addListener( + Catch::Detail::make_unique<PreferenceListener>( + false, true, &config ) ); + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ); + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true); + + multiReporter.addListener( + Catch::Detail::make_unique<PreferenceListener>( + false, false, &config ) ); + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ); + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ); + } + SECTION( "Adding reporters" ) { + multiReporter.addReporter( + Catch::Detail::make_unique<PreferenceReporter>( + true, false, makeDummyRepConfig(config) ) ); + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ); + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == false ); + + multiReporter.addReporter( + Catch::Detail::make_unique<PreferenceReporter>( + false, true, makeDummyRepConfig( config ) ) ); + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ); + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ); + + multiReporter.addReporter( + Catch::Detail::make_unique<PreferenceReporter>( + false, false, makeDummyRepConfig( config ) ) ); + REQUIRE( multiReporter.getPreferences().shouldRedirectStdOut == true ); + REQUIRE( multiReporter.getPreferences().shouldReportAllAssertions == true ); } } + +namespace { + class TestReporterFactory : public Catch::IReporterFactory { + Catch::IEventListenerPtr create( Catch::ReporterConfig&& ) const override { + CATCH_INTERNAL_ERROR( + "This factory should never create a reporter" ); + } + std::string getDescription() const override { + return "Fake test factory"; + } + }; +} + +TEST_CASE("Registering reporter with '::' in name fails", + "[reporters][registration]") { + Catch::ReporterRegistry registry; + + REQUIRE_THROWS_WITH( registry.registerReporter( + "with::doublecolons", + Catch::Detail::make_unique<TestReporterFactory>() ), + "'::' is not allowed in reporter name: 'with::doublecolons'" ); +} + +TEST_CASE("Registering multiple reporters with the same name fails", + "[reporters][registration][approvals]") { + Catch::ReporterRegistry registry; + + registry.registerReporter( + "some-reporter-name", + Catch::Detail::make_unique<TestReporterFactory>() ); + + REQUIRE_THROWS_WITH( + registry.registerReporter( + "some-reporter-name", + Catch::Detail::make_unique<TestReporterFactory>() ), + "reporter using 'some-reporter-name' as name was already registered" ); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp new file mode 100644 index 000000000..78e4858a0 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp @@ -0,0 +1,45 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_macros.hpp> +#include <catch2/generators/catch_generators_all.hpp> + +#include <catch2/internal/catch_sharding.hpp> + +#include <unordered_map> +#include <vector> + +TEST_CASE("Sharding Function", "[approvals]") { + std::vector<int> testContainer = { 0, 1, 2, 3, 4, 5, 6 }; + std::unordered_map<int, std::vector<std::size_t>> expectedShardSizes = { + {1, {7}}, + {2, {4, 3}}, + {3, {3, 2, 2}}, + {4, {2, 2, 2, 1}}, + {5, {2, 2, 1, 1, 1}}, + {6, {2, 1, 1, 1, 1, 1}}, + {7, {1, 1, 1, 1, 1, 1, 1}}, + }; + + auto shardCount = GENERATE(range(1, 7)); + auto shardIndex = GENERATE_COPY(filter([=](int i) { return i < shardCount; }, range(0, 6))); + + std::vector<int> result = Catch::createShard(testContainer, shardCount, shardIndex); + + auto& sizes = expectedShardSizes[shardCount]; + REQUIRE(result.size() == sizes[shardIndex]); + + std::size_t startIndex = 0; + for(int i = 0; i < shardIndex; i++) { + startIndex += sizes[i]; + } + + for(std::size_t i = 0; i < sizes[shardIndex]; i++) { + CHECK(result[i] == testContainer[i + startIndex]); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp new file mode 100644 index 000000000..6b1d377c8 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Stream.tests.cpp @@ -0,0 +1,32 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_macros.hpp> + +#include <catch2/internal/catch_istream.hpp> + +TEST_CASE( "Cout stream properly declares it writes to stdout", "[streams]" ) { + REQUIRE( Catch::makeStream( "-" )->isConsole() ); +} + +TEST_CASE( "Empty stream name opens cout stream", "[streams]" ) { + REQUIRE( Catch::makeStream( "" )->isConsole() ); +} + +TEST_CASE( "stdout and stderr streams have %-starting name", "[streams]" ) { + REQUIRE( Catch::makeStream( "%stderr" )->isConsole() ); + REQUIRE( Catch::makeStream( "%stdout" )->isConsole() ); +} + +TEST_CASE( "request an unknown %-starting stream fails", "[streams]" ) { + REQUIRE_THROWS( Catch::makeStream( "%somestream" ) ); +} + +TEST_CASE( "makeStream recognizes %debug stream name", "[streams]" ) { + REQUIRE_NOTHROW( Catch::makeStream( "%debug" ) ); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp index 4b9cc0e36..08f7dc2c6 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_stringref.hpp> @@ -29,7 +37,17 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) { REQUIRE_NOTHROW(original.data()); } - + SECTION( "Copy construction is shallow" ) { + StringRef original = StringRef( "original string" ); + StringRef copy = original; + REQUIRE(original.begin() == copy.begin()); + } + SECTION( "Copy assignment is shallow" ) { + StringRef original = StringRef( "original string" ); + StringRef copy; + copy = original; + REQUIRE(original.begin() == copy.begin()); + } SECTION( "Substrings" ) { StringRef s = "hello world!"; @@ -165,3 +183,30 @@ TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") { STATIC_REQUIRE(sr2.size() == 0); } } + +TEST_CASE("StringRef::compare", "[Strings][StringRef][approvals]") { + using Catch::StringRef; + + SECTION("Same length on both sides") { + StringRef sr1("abcdc"); + StringRef sr2("abcdd"); + StringRef sr3("abcdc"); + + REQUIRE(sr1.compare(sr2) < 0); + REQUIRE(sr2.compare(sr1) > 0); + REQUIRE(sr1.compare(sr3) == 0); + REQUIRE(sr3.compare(sr1) == 0); + } + SECTION("Different lengths") { + StringRef sr1("def"); + StringRef sr2("deff"); + StringRef sr3("ab"); + + REQUIRE(sr1.compare(sr2) < 0); + REQUIRE(sr2.compare(sr1) > 0); + REQUIRE(sr1.compare(sr3) > 0); + REQUIRE(sr2.compare(sr3) > 0); + REQUIRE(sr3.compare(sr1) < 0); + REQUIRE(sr3.compare(sr2) < 0); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp index d78567ca6..8cd995cce 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <catch2/matchers/catch_matchers_vector.hpp> #include <catch2/internal/catch_string_manip.hpp> @@ -65,3 +73,11 @@ TEST_CASE("splitString", "[string-manip]") { CHECK_THAT(splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"})); CHECK_THAT(splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"})); } + +TEST_CASE("startsWith", "[string-manip]") { + using Catch::startsWith; + + CHECK_FALSE(startsWith("", 'c')); + CHECK(startsWith(std::string("abc"), 'a')); + CHECK(startsWith("def"_catch_sr, 'd')); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp index a74b31599..d87f966bd 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/matchers/catch_matchers_vector.hpp> @@ -24,10 +27,10 @@ TEST_CASE( "Tag alias can be registered against tag patterns" ) { catch( std::exception& ex ) { 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" ) ); + CHECK_THAT( what, ContainsSubstring( "[@zzz]" ) ); + CHECK_THAT( what, ContainsSubstring( "file" ) ); + CHECK_THAT( what, ContainsSubstring( "2" ) ); + CHECK_THAT( what, ContainsSubstring( "10" ) ); } } @@ -40,19 +43,16 @@ TEST_CASE( "Tag alias can be registered against tag patterns" ) { } // Dummy line info for creating dummy test cases below -constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO; +static constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO; TEST_CASE("shortened hide tags are split apart", "[tags]") { using Catch::StringRef; + using Catch::Tag; using Catch::Matchers::VectorContains; - Catch::TestCaseInfo testcase("", {"fake test name", "[.magic-tag]"}, dummySourceLineInfo); - // Extract parsed tags into strings - std::vector<StringRef> tags; - for (auto const& tag : testcase.tags) { - tags.push_back(tag.lowerCased); - } - REQUIRE_THAT(tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr)); + Catch::TestCaseInfo testcase("", {"fake test name", "[.magic-tag]"}, dummySourceLineInfo); + REQUIRE_THAT( testcase.tags, VectorContains( Tag( "magic-tag" ) ) + && VectorContains( Tag( "."_catch_sr ) ) ); } TEST_CASE("tags with dots in later positions are not parsed as hidden", "[tags]") { @@ -69,3 +69,36 @@ TEST_CASE( "empty tags are not allowed", "[tags]" ) { Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) ); } + +TEST_CASE( "Tags with spaces and non-alphanumerical characters are accepted", + "[tags]" ) { + using Catch::Tag; + using Catch::Matchers::VectorContains; + + Catch::TestCaseInfo testCase( + "", + { "fake test name", "[tag with spaces][I said \"good day\" sir!]" }, + dummySourceLineInfo ); + + REQUIRE( testCase.tags.size() == 2 ); + REQUIRE_THAT( testCase.tags, + VectorContains( Tag( "tag with spaces" ) ) && + VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) ); +} + +TEST_CASE( "Test case with identical tags keeps just one", "[tags]" ) { + using Catch::Tag; + + Catch::TestCaseInfo testCase( + "", + { "fake test name", "[TaG1][tAg1][TAG1][tag1]" }, + dummySourceLineInfo ); + + REQUIRE( testCase.tags.size() == 1 ); + REQUIRE( testCase.tags[0] == Tag( "tag1" ) ); +} + +TEST_CASE( "Empty tag is not allowed" ) { + REQUIRE_THROWS( Catch::TestCaseInfo( + "", { "fake test name", "[]" }, dummySourceLineInfo ) ); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp new file mode 100644 index 000000000..93cb70b14 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp @@ -0,0 +1,72 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_macros.hpp> +#include <catch2/catch_test_case_info.hpp> +#include <catch2/internal/catch_test_case_info_hasher.hpp> + +static constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO; + +using Catch::TestCaseInfo; +using Catch::TestCaseInfoHasher; + +TEST_CASE("Hashers with same seed produce same hash", "[test-case-hash]") { + TestCaseInfo dummy( "", { "name", "[a-tag]" }, dummySourceLineInfo ); + + TestCaseInfoHasher h1( 0x12345678 ); + TestCaseInfoHasher h2( 0x12345678 ); + + REQUIRE( h1( dummy ) == h2( dummy ) ); +} + +TEST_CASE( + "Hashers with different seed produce different hash with same test case", + "[test-case-hash]") { + TestCaseInfo dummy( "", { "name", "[a-tag]" }, dummySourceLineInfo ); + + TestCaseInfoHasher h1( 0x12345678 ); + TestCaseInfoHasher h2( 0x87654321 ); + + REQUIRE( h1( dummy ) != h2( dummy ) ); +} + +TEST_CASE("Hashing test case produces same hash across multiple calls", + "[test-case-hash]") { + TestCaseInfo dummy( "", { "name", "[a-tag]" }, dummySourceLineInfo ); + + TestCaseInfoHasher h( 0x12345678 ); + + REQUIRE( h( dummy ) == h( dummy ) ); +} + +TEST_CASE("Hashing different test cases produces different result", "[test-case-hash]") { + TestCaseInfoHasher h( 0x12345678 ); + SECTION("Different test name") { + TestCaseInfo dummy1( "class", { "name-1", "[a-tag]" }, dummySourceLineInfo ); + TestCaseInfo dummy2( + "class", { "name-2", "[a-tag]" }, dummySourceLineInfo ); + + REQUIRE( h( dummy1 ) != h( dummy2 ) ); + } + SECTION("Different classname") { + TestCaseInfo dummy1( + "class-1", { "name", "[a-tag]" }, dummySourceLineInfo ); + TestCaseInfo dummy2( + "class-2", { "name", "[a-tag]" }, dummySourceLineInfo ); + + REQUIRE( h( dummy1 ) != h( dummy2 ) ); + } + SECTION("Different tags") { + TestCaseInfo dummy1( + "class", { "name", "[a-tag]" }, dummySourceLineInfo ); + TestCaseInfo dummy2( + "class", { "name", "[b-tag]" }, dummySourceLineInfo ); + + REQUIRE( h( dummy1 ) != h( dummy2 ) ); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpecParser.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpecParser.tests.cpp new file mode 100644 index 000000000..c8ac77b29 --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpecParser.tests.cpp @@ -0,0 +1,55 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_macros.hpp> +#include <catch2/generators/catch_generators.hpp> +#include <catch2/catch_test_case_info.hpp> +#include <catch2/internal/catch_tag_alias_registry.hpp> +#include <catch2/internal/catch_test_spec_parser.hpp> + +namespace { + static constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO; + + static Catch::TestSpec parseAndCreateSpec(std::string const& str) { + Catch::TagAliasRegistry registry; + Catch::TestSpecParser parser( registry ); + + parser.parse( str ); + auto spec = parser.testSpec(); + REQUIRE( spec.hasFilters() ); + REQUIRE( spec.getInvalidSpecs().empty()); + + return spec; + } + +} + +TEST_CASE( "Parsing tags with non-alphabetical characters is pass-through", + "[test-spec][test-spec-parser]" ) { + auto const& tagString = GENERATE( as<std::string>{}, + "[tag with spaces]", + "[I said \"good day\" sir!]" ); + CAPTURE(tagString); + + auto spec = parseAndCreateSpec( tagString ); + + Catch::TestCaseInfo testCase( + "", { "fake test name", tagString }, dummySourceLineInfo ); + + REQUIRE( spec.matches( testCase ) ); +} + +TEST_CASE("Parsed tags are matched case insensitive", + "[test-spec][test-spec-parser]") { + auto spec = parseAndCreateSpec( "[CASED tag]" ); + + Catch::TestCaseInfo testCase( + "", { "fake test name", "[cased TAG]" }, dummySourceLineInfo ); + + REQUIRE( spec.matches( testCase ) ); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp new file mode 100644 index 000000000..379dc624d --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp @@ -0,0 +1,200 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_test_macros.hpp> +#include <catch2/internal/catch_textflow.hpp> + +#include <sstream> + +using Catch::TextFlow::Column; + +namespace { + static std::string as_written(Column const& c) { + std::stringstream sstr; + sstr << c; + return sstr.str(); + } +} + +TEST_CASE( "TextFlow::Column one simple line", + "[TextFlow][column][approvals]" ) { + Column col( "simple short line" ); + + REQUIRE(as_written(col) == "simple short line"); +} + +TEST_CASE( "TextFlow::Column respects already present newlines", + "[TextFlow][column][approvals]" ) { + Column col( "abc\ndef" ); + REQUIRE( as_written( col ) == "abc\ndef" ); +} + +TEST_CASE( "TextFlow::Column respects width setting", + "[TextFlow][column][approvals]" ) { + Column col( "The quick brown fox jumped over the lazy dog" ); + + SECTION( "width=20" ) { + col.width( 20 ); + REQUIRE( as_written( col ) == "The quick brown fox\n" + "jumped over the lazy\n" + "dog" ); + } + SECTION("width=10") { + col.width( 10 ); + REQUIRE( as_written( col ) == "The quick\n" + "brown fox\n" + "jumped\n" + "over the\n" + "lazy dog" ); + } + SECTION("width=5") { + // This is so small some words will have to be split with hyphen + col.width(5); + REQUIRE( as_written( col ) == "The\n" + "quick\n" + "brown\n" + "fox\n" + "jump-\n" + "ed\n" + "over\n" + "the\n" + "lazy\n" + "dog" ); + } +} + +TEST_CASE( "TextFlow::Column respects indentation setting", + "[TextFlow][column][approvals]" ) { + Column col( "First line\nSecond line\nThird line" ); + + SECTION("Default: no indentation at all") { + REQUIRE(as_written(col) == "First line\nSecond line\nThird line"); + } + SECTION("Indentation on first line only") { + col.initialIndent(3); + REQUIRE(as_written(col) == " First line\nSecond line\nThird line"); + } + SECTION("Indentation on all lines") { + col.indent(3); + REQUIRE(as_written(col) == " First line\n Second line\n Third line"); + } + SECTION("Indentation on later lines only") { + col.indent(5).initialIndent(0); + REQUIRE(as_written(col) == "First line\n Second line\n Third line"); + } + SECTION("Different indentation on first and later lines") { + col.initialIndent(1).indent(2); + REQUIRE(as_written(col) == " First line\n Second line\n Third line"); + } +} + +TEST_CASE("TextFlow::Column indentation respects whitespace", "[TextFlow][column][approvals]") { + Column col(" text with whitespace\n after newlines"); + + SECTION("No extra indentation") { + col.initialIndent(0).indent(0); + REQUIRE(as_written(col) == " text with whitespace\n after newlines"); + } + SECTION("Different indentation on first and later lines") { + col.initialIndent(1).indent(2); + REQUIRE(as_written(col) == " text with whitespace\n after newlines"); + } +} + +TEST_CASE( "TextFlow::Column linebreaking prefers boundary characters", + "[TextFlow][column][approvals]" ) { + SECTION("parentheses") { + Column col("(Hello)aaa(World)"); + SECTION("width=20") { + col.width(20); + REQUIRE(as_written(col) == "(Hello)aaa(World)"); + } + SECTION("width=15") { + col.width(15); + REQUIRE(as_written(col) == "(Hello)aaa\n(World)"); + } + SECTION("width=8") { + col.width(8); + REQUIRE(as_written(col) == "(Hello)\naaa\n(World)"); + } + } + SECTION("commas") { + Column col("Hello, world"); + col.width(8); + + REQUIRE(as_written(col) == "Hello,\nworld"); + } +} + + +TEST_CASE( "TextFlow::Column respects indentation for empty lines", + "[TextFlow][column][approvals][!shouldfail]" ) { + // This is currently bugged and does not do what it should + Column col("\n\nthird line"); + col.indent(2); + + //auto b = col.begin(); + //auto e = col.end(); + + //auto b1 = *b; + //++b; + //auto b2 = *b; + //++b; + //auto b3 = *b; + //++b; + + //REQUIRE(b == e); + + std::string written = as_written(col); + + REQUIRE(as_written(col) == " \n \n third line"); +} + +TEST_CASE( "TextFlow::Column leading/trailing whitespace", + "[TextFlow][column][approvals]" ) { + SECTION("Trailing whitespace") { + Column col("some trailing whitespace: \t"); + REQUIRE(as_written(col) == "some trailing whitespace: \t"); + } + SECTION("Some leading whitespace") { + Column col("\t \t whitespace wooo"); + REQUIRE(as_written(col) == "\t \t whitespace wooo"); + } + SECTION("both") { + Column col(" abc "); + REQUIRE(as_written(col) == " abc "); + } + SECTION("whitespace only") { + Column col("\t \t"); + REQUIRE(as_written(col) == "\t \t"); + } +} + +TEST_CASE( "TextFlow::Column can handle empty string", + "[TextFlow][column][approvals]" ) { + Column col(""); + REQUIRE(as_written(col) == ""); +} + +TEST_CASE( "#1400 - TextFlow::Column wrapping would sometimes duplicate words", + "[TextFlow][column][regression][approvals]" ) { + const auto long_string = std::string( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nisl \n" + "massa, luctus ut ligula vitae, suscipit tempus velit. Vivamus sodales, quam in \n" + "convallis posuere, libero nisi ultricies orci, nec lobortis.\n"); + + auto col = Column(long_string) + .width(79) + .indent(2); + + REQUIRE(as_written(col) == + " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nisl \n" + " massa, luctus ut ligula vitae, suscipit tempus velit. Vivamus sodales, quam\n" + " in \n" + " convallis posuere, libero nisi ultricies orci, nec lobortis."); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp index c0415dc32..63f072dd9 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/internal/catch_enum_values_registry.hpp> #include <catch2/matchers/catch_matchers_vector.hpp> #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp index d461232de..40c9886c3 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/UniquePtr.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_unique_ptr.hpp> diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp index c98d66ef2..9fe9416a1 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp @@ -1,7 +1,15 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_xmlwriter.hpp> -#include <catch2/internal/catch_stream.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <catch2/matchers/catch_matchers_string.hpp> #include <sstream> @@ -44,10 +52,9 @@ TEST_CASE( "XmlEncode", "[XML]" ) { // Thanks to Peter Bindels (dascandy) for some of the tests TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8][approvals]") { -#define ESC(lit) reinterpret_cast<const 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("Here be 👾") == "Here be 👾"); + CHECK(encode("šš") == "šš"); CHECK(encode("\xDF\xBF") == "\xDF\xBF"); // 0x7FF CHECK(encode("\xE0\xA0\x80") == "\xE0\xA0\x80"); // 0x800 @@ -59,10 +66,10 @@ TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8][approvals]") { } 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("Here \xFF be \xF0\x9F\x91\xBE") == "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 + CHECK(encode("\xC5\xC5\xA0") == "\\xC5Š"); + CHECK(encode("\xF4\x90\x80\x80") == "\\xF4\\x90\\x80\\x80"); // 0x110000 -- out of unicode range } SECTION("Overlong encodings") { @@ -113,11 +120,10 @@ TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8][approvals]") { CHECK(encode("\xF4\x80\x80") == "\\xF4\\x80\\x80"); } } -#undef ESC } TEST_CASE("XmlWriter writes boolean attributes as true/false", "[XML][XmlWriter]") { - using Catch::Matchers::Contains; + using Catch::Matchers::ContainsSubstring; std::stringstream stream; { Catch::XmlWriter xml(stream); @@ -128,6 +134,50 @@ TEST_CASE("XmlWriter writes boolean attributes as true/false", "[XML][XmlWriter] } REQUIRE_THAT( stream.str(), - Contains(R"(attr1="true")") && - Contains(R"(attr2="false")") ); + ContainsSubstring(R"(attr1="true")") && + ContainsSubstring(R"(attr2="false")") ); +} + +TEST_CASE("XmlWriter does not escape comments", "[XML][XmlWriter][approvals]") { + using Catch::Matchers::ContainsSubstring; + std::stringstream stream; + { + Catch::XmlWriter xml(stream); + + xml.writeComment(R"(unescaped special chars: < > ' " &)"); + } + REQUIRE_THAT( stream.str(), + ContainsSubstring(R"(<!-- unescaped special chars: < > ' " & -->)")); +} + +TEST_CASE("XmlWriter errors out when writing text without enclosing element", "[XmlWriter][approvals]") { + std::stringstream stream; + Catch::XmlWriter xml(stream); + REQUIRE_THROWS(xml.writeText("some text")); +} + +TEST_CASE("XmlWriter escapes text properly", "[XML][XmlWriter][approvals]") { + using Catch::Matchers::ContainsSubstring; + std::stringstream stream; + { + Catch::XmlWriter xml(stream); + xml.scopedElement("root") + .writeText(R"(Special chars need escaping: < > ' " &)"); + } + + REQUIRE_THAT( stream.str(), + ContainsSubstring(R"(Special chars need escaping: < > ' " &)")); +} + +TEST_CASE("XmlWriter escapes attributes properly", "[XML][XmlWriter][approvals]") { + using Catch::Matchers::ContainsSubstring; + std::stringstream stream; + { + Catch::XmlWriter xml(stream); + xml.scopedElement("root") + .writeAttribute("some-attribute", R"(Special chars need escaping: < > ' " &)"); + } + + REQUIRE_THAT(stream.str(), + ContainsSubstring(R"(some-attribute="Special chars need escaping: < > ' " &")")); } diff --git a/packages/Catch2/tests/SelfTest/TestRegistrations.cpp b/packages/Catch2/tests/SelfTest/TestRegistrations.cpp index 45a01c027..f24c913f5 100644 --- a/packages/Catch2/tests/SelfTest/TestRegistrations.cpp +++ b/packages/Catch2/tests/SelfTest/TestRegistrations.cpp @@ -10,7 +10,7 @@ #include <catch2/reporters/catch_reporter_event_listener.hpp> #include <catch2/internal/catch_enforce.hpp> #include <catch2/catch_test_case_info.hpp> -#include <catch2/catch_reporter_registrars.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> // Some example tag aliases @@ -48,7 +48,11 @@ class ValidatingTestListener : public Catch::EventListenerBase { }; public: - ValidatingTestListener(Catch::ReporterConfig const& config) : + static std::string getDescription() { + return "Validates ordering of Catch2's listener events"; + } + + ValidatingTestListener(Catch::IConfig const* config) : EventListenerBase(config) { m_preferences.shouldReportAllAssertions = true; } @@ -67,7 +71,7 @@ public: ++m_testCaseCounter.starting; // Reset the part tracking for partial test case events - m_lastSeenPartNumber = -1; + m_lastSeenPartNumber = uint64_t(-1); } void testCasePartialStarting(Catch::TestCaseInfo const&, diff --git a/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp b/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp index 1c82e0e91..bfb222d03 100644 --- a/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp +++ b/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp @@ -1,9 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp index 1ae5fe04e..853227a27 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp @@ -1,10 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/catch_approx.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp index eba58d382..b128196c3 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp index b2d41cf23..ffedc9a2f 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp @@ -1,3 +1,12 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +// Adapted from donated nonius code. + #include <catch2/catch_test_macros.hpp> #include <catch2/benchmark/catch_benchmark.hpp> #include <catch2/benchmark/catch_constructor.hpp> @@ -143,3 +152,20 @@ TEST_CASE("Benchmark containers", "[!benchmark]") { }; } } + +TEST_CASE("Skip benchmark macros", "[!benchmark]") { + std::vector<int> v; + BENCHMARK("fill vector") { + v.emplace_back(1); + v.emplace_back(2); + v.emplace_back(3); + }; + REQUIRE(v.size() == 0); + + std::size_t counter{0}; + BENCHMARK_ADVANCED("construct vector")(Catch::Benchmark::Chronometer meter) { + std::vector<Catch::Benchmark::storage_for<std::string>> storage(meter.runs()); + meter.measure([&](int i) { storage[i].construct("thing"); counter++; }); + }; + REQUIRE(counter == 0); +} diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp index 94e83051b..6b2ba4cfe 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp @@ -1,7 +1,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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#if defined( __GNUC__ ) || defined( __clang__ ) +# pragma GCC diagnostic ignored "-Wfloat-equal" +#endif #include <catch2/catch_test_macros.hpp> #include <catch2/catch_template_test_macros.hpp> @@ -107,4 +114,20 @@ namespace Inner { REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2); } +} // namespace + + +// We want a class in nested namespace so we can test JUnit's classname normalization. +namespace { + namespace A { + namespace B { + class TestClass {}; + } + } +} // namespace + +TEST_CASE_METHOD( A::B::TestClass, + "A TEST_CASE_METHOD testing junit classname normalization", + "[class][approvals]" ) { + SUCCEED(); } diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp index c40c09f81..5d9ab3f05 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <type_traits> @@ -23,7 +26,7 @@ namespace bar { #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wmissing-declarations" #endif -std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) { +static std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) { return out << "[1403 helper]"; } /////////////////////////////// @@ -46,7 +49,7 @@ struct logic_t { }; -void throws_int(bool b) { +static void throws_int(bool b) { if (b) { throw 1; } @@ -66,7 +69,7 @@ bool templated_tests(T t) { struct A {}; -std::ostream &operator<<(std::ostream &o, const A &) { return o << 0; } +static std::ostream &operator<<(std::ostream &o, const A &) { return o << 0; } struct B : private A { bool operator==(int) const { return true; } @@ -172,6 +175,8 @@ TEST_CASE("#1403", "[compilation]") { TEST_CASE("Optionally static assertions", "[compilation]") { STATIC_REQUIRE( std::is_void<void>::value ); STATIC_REQUIRE_FALSE( std::is_void<int>::value ); + STATIC_CHECK( std::is_void<void>::value ); + STATIC_CHECK_FALSE( std::is_void<int>::value ); } TEST_CASE("#1548", "[compilation]") { diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp index 167752e18..2e3b624e1 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp @@ -1,7 +1,11 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wpadded" @@ -29,15 +33,6 @@ namespace { double double_pi = 3.1415926535; }; - struct TestDef { - TestDef& operator + (const std::string&) { - return *this; - } - TestDef& operator[](const std::string&) { - return *this; - } - }; - static const char* returnsConstNull() { return nullptr; } static char* returnsNull() { return nullptr; } @@ -49,9 +44,6 @@ namespace { // Equality tests TEST_CASE( "Equality checks that should succeed" ) { - TestDef td; - td + "hello" + "hello"; - TestData data; REQUIRE( data.int_seven == 7 ); @@ -86,6 +78,19 @@ TEST_CASE( "Equality checks that should fail", "[.][failing][!mayfail]" ) CHECK( x == Approx( 1.301 ) ); } +// Needed to test junit reporter's handling of mayfail test cases and sections +TEST_CASE("Mayfail test case with nested sections", "[!mayfail]") { + SECTION("A") { + SECTION("1") { FAIL(); } + SECTION("2") { FAIL(); } + } + SECTION("B") { + SECTION("1") { FAIL(); } + SECTION("2") { FAIL(); } + } +} + + TEST_CASE( "Inequality checks that should succeed" ) { TestData data; diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Decomposition.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Decomposition.tests.cpp index 15feefc26..0a1698317 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Decomposition.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Decomposition.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <iostream> #include <cstdio> @@ -29,7 +32,7 @@ TEST_CASE( "Reconstruction should be based on stringification: #914" , "[Decompo CHECK(truthy(false)); } -TEST_CASE("#1005: Comparing pointer to int and long (NULL can be either on various systems)", "[Decomposition]") { +TEST_CASE("#1005: Comparing pointer to int and long (NULL can be either on various systems)", "[Decomposition][approvals]") { FILE* fptr = nullptr; REQUIRE(fptr == 0); REQUIRE(fptr == 0l); diff --git a/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp index 2a6731cb1..7cf621373 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_enum_values_registry.hpp> @@ -78,7 +86,7 @@ TEST_CASE( "Enums can quickly have stringification enabled using REGISTER_ENUM" REQUIRE( stringify( EnumClass3::Value3 ) == "Value3" ); REQUIRE( stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}" ); - EnumClass3 ec3 = EnumClass3 ::Value2; + EnumClass3 ec3 = EnumClass3::Value2; REQUIRE( stringify( ec3 ) == "Value2" ); } diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp index 206bd9c81..e93cf9193 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/catch_translate_exception.hpp> @@ -36,7 +39,7 @@ namespace { explicit CustomException(const std::string& msg) : m_msg(msg) {} - std::string getMessage() const { + std::string const& getMessage() const { return m_msg; } @@ -48,9 +51,12 @@ namespace { public: explicit CustomStdException(const std::string& msg) : m_msg(msg) {} - ~CustomStdException() noexcept override {} + ~CustomStdException() noexcept override = default; + + CustomStdException( CustomStdException const& ) = default; + CustomStdException& operator=( CustomStdException const& ) = default; - std::string getMessage() const { + std::string const& getMessage() const { return m_msg; } @@ -134,7 +140,7 @@ TEST_CASE("Non-std exceptions can be translated", "[.][failing][!throws]" ) { } TEST_CASE("Custom std-exceptions can be custom translated", "[.][failing][!throws]" ) { - throw CustomException( "custom std exception" ); + throw CustomStdException( "custom std exception" ); } TEST_CASE( "Custom exceptions can be translated when testing for nothrow", "[.][failing][!throws]" ) { @@ -167,8 +173,8 @@ TEST_CASE( "Exception messages can be tested for", "[!throws]" ) { 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 ) ); + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "except" ) ); + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) ); } } diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp index b2154a1a1..5b205c85c 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <catch2/generators/catch_generator_exception.hpp> #include <catch2/generators/catch_generators_adapters.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp index 6f83279f3..5b4e9e033 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/catch_template_test_macros.hpp> @@ -105,12 +108,12 @@ namespace { } // end unnamed namespace TEST_CASE( "String matchers", "[matchers]" ) { - REQUIRE_THAT( testStringForMatching(), Contains( "string" ) ); + REQUIRE_THAT( testStringForMatching(), ContainsSubstring( "string" ) ); REQUIRE_THAT( testStringForMatching(), - Contains( "string", Catch::CaseSensitive::No ) ); - CHECK_THAT( testStringForMatching(), Contains( "abc" ) ); + ContainsSubstring( "string", Catch::CaseSensitive::No ) ); + CHECK_THAT( testStringForMatching(), ContainsSubstring( "abc" ) ); CHECK_THAT( testStringForMatching(), - Contains( "aBC", Catch::CaseSensitive::No ) ); + ContainsSubstring( "aBC", Catch::CaseSensitive::No ) ); CHECK_THAT( testStringForMatching(), StartsWith( "this" ) ); CHECK_THAT( testStringForMatching(), @@ -122,8 +125,8 @@ TEST_CASE( "String matchers", "[matchers]" ) { TEST_CASE( "Contains string matcher", "[.][failing][matchers]" ) { CHECK_THAT( testStringForMatching(), - Contains( "not there", Catch::CaseSensitive::No ) ); - CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ); + ContainsSubstring( "not there", Catch::CaseSensitive::No ) ); + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ); } TEST_CASE( "StartsWith string matcher", "[.][failing][matchers]" ) { @@ -185,42 +188,42 @@ TEST_CASE( "Regex string matcher", "[matchers][.failing]" ) { TEST_CASE( "Matchers can be (AllOf) composed with the && operator", "[matchers][operators][operator&&]" ) { CHECK_THAT( testStringForMatching(), - Contains( "string" ) && Contains( "abc" ) && - Contains( "substring" ) && Contains( "contains" ) ); + ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && + ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) ); } TEST_CASE( "Matchers can be (AnyOf) composed with the || operator", "[matchers][operators][operator||]" ) { CHECK_THAT( testStringForMatching(), - Contains( "string" ) || Contains( "different" ) || - Contains( "random" ) ); + ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || + ContainsSubstring( "random" ) ); CHECK_THAT( testStringForMatching2(), - Contains( "string" ) || Contains( "different" ) || - Contains( "random" ) ); + ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || + ContainsSubstring( "random" ) ); } TEST_CASE( "Matchers can be composed with both && and ||", "[matchers][operators][operator||][operator&&]" ) { CHECK_THAT( testStringForMatching(), - ( Contains( "string" ) || Contains( "different" ) ) && - Contains( "substring" ) ); + ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && + ContainsSubstring( "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" ) ); + ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && + ContainsSubstring( "random" ) ); } TEST_CASE( "Matchers can be negated (Not) with the ! operator", "[matchers][operators][not]" ) { - CHECK_THAT( testStringForMatching(), !Contains( "different" ) ); + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "different" ) ); } TEST_CASE( "Matchers can be negated (Not) with the ! operator - failing", "[matchers][operators][not][.failing]" ) { - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ); + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ); } template <typename T> struct CustomAllocator : private std::allocator<T> { @@ -842,10 +845,10 @@ TEST_CASE( "Combining concrete matchers does not use templated matchers", struct MatcherA : Catch::Matchers::MatcherGenericBase { std::string describe() const override { - return "equals: (int) 1 or (float) 1.0f"; + return "equals: (int) 1 or (string) \"1\""; } bool match( int i ) const { return i == 1; } - bool match( float f ) const { return f == 1.0f; } + bool match( std::string s ) const { return s == "1"; } }; struct MatcherB : Catch::Matchers::MatcherGenericBase { diff --git a/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp index 912b5cdb6..1201581cf 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp @@ -1,5 +1,10 @@ -// 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) + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/matchers/catch_matchers_container_properties.hpp> @@ -9,22 +14,28 @@ #include <catch2/matchers/catch_matchers_predicate.hpp> #include <catch2/matchers/catch_matchers_string.hpp> -#include <array> #include <cmath> +#include <initializer_list> #include <list> #include <map> +#include <type_traits> #include <vector> +#include <memory> namespace { + namespace unrelated { + template <typename T> class needs_ADL_begin { - std::array<int, 5> elements{ {1, 2, 3, 4, 5} }; + std::vector<T> m_elements; public: - using iterator = std::array<int, 5>::iterator; - using const_iterator = std::array<int, 5>::const_iterator; + using iterator = typename std::vector<T>::iterator; + using const_iterator = typename std::vector<T>::const_iterator; + + needs_ADL_begin(std::initializer_list<T> init) : m_elements(init) {} - const_iterator Begin() const { return elements.begin(); } - const_iterator End() const { return elements.end(); } + const_iterator Begin() const { return m_elements.begin(); } + const_iterator End() const { return m_elements.end(); } friend const_iterator begin(needs_ADL_begin const& lhs) { return lhs.Begin(); @@ -40,51 +51,61 @@ namespace unrelated { # pragma clang diagnostic ignored "-Wunused-function" #endif +template <typename T> class has_different_begin_end_types { - std::array<int, 5> elements{ {1, 2, 3, 4, 5} }; + // Using std::vector<T> leads to annoying issues when T is bool + // so we just use list because the perf is not critical and ugh. + std::list<T> m_elements; // Different type for the "end" iterator struct iterator_end {}; - // Just a fake forward iterator, that only compares to a different - // type (so we can test two-type ranges). - struct iterator { - int const* start; - int const* end; + // Fake-ish forward iterator that only compares to a different type + class iterator { + using underlying_iter = typename std::list<T>::const_iterator; + underlying_iter m_start; + underlying_iter m_end; + + public: + iterator( underlying_iter start, underlying_iter end ): + m_start( start ), m_end( end ) {} using iterator_category = std::forward_iterator_tag; using difference_type = std::ptrdiff_t; - using value_type = int; - using reference = int const&; - using pointer = int const*; + using value_type = T; + using const_reference = T const&; + using pointer = T const*; friend bool operator==( iterator iter, iterator_end ) { - return iter.start == iter.end; + return iter.m_start == iter.m_end; } friend bool operator!=( iterator iter, iterator_end ) { - return iter.start != iter.end; + return iter.m_start != iter.m_end; } iterator& operator++() { - ++start; + ++m_start; return *this; } iterator operator++(int) { auto tmp(*this); - ++start; + ++m_start; return tmp; } - reference operator*() const { - return *start; + const_reference operator*() const { + return *m_start; } pointer operator->() const { - return start; + return m_start; } }; public: + explicit has_different_begin_end_types( std::initializer_list<T> init ): + m_elements( init ) {} + iterator begin() const { - return { elements.data(), elements.data() + elements.size() }; + return { m_elements.begin(), m_elements.end() }; } iterator_end end() const { @@ -96,80 +117,91 @@ public: # pragma clang diagnostic pop #endif +template <typename T> struct with_mocked_iterator_access { + std::vector<T> m_elements; -struct with_mocked_iterator_access { - static constexpr size_t data_size = 5; - std::array<int, data_size> elements{ {1, 2, 3, 4, 5} }; - std::array<bool, data_size> touched{}; - std::array<bool, data_size> derefed{}; + // use plain arrays to have nicer printouts with CHECK(...) + mutable std::unique_ptr<bool[]> m_derefed; - // We want to check which elements were touched when iterating, so + // We want to check which elements were dereferenced when iterating, so // we can check whether iterator-using code traverses range correctly - struct iterator { - with_mocked_iterator_access* m_origin; + template <bool is_const> class basic_iterator { + template <typename U> + using constify_t = std::conditional_t<is_const, std::add_const_t<U>, U>; + + constify_t<with_mocked_iterator_access>* m_origin; size_t m_origin_idx; + public: using iterator_category = std::forward_iterator_tag; using difference_type = std::ptrdiff_t; - using value_type = int; - using reference = int const&; - using pointer = int const*; - - friend bool operator==(iterator lhs, iterator rhs) { - return lhs.m_origin == rhs.m_origin - && lhs.m_origin_idx == rhs.m_origin_idx; + using value_type = constify_t<T>; + using const_reference = typename std::vector<T>::const_reference; + using reference = typename std::vector<T>::reference; + using pointer = typename std::vector<T>::pointer; + + basic_iterator( constify_t<with_mocked_iterator_access>* origin, + std::size_t origin_idx ): + m_origin{ origin }, m_origin_idx{ origin_idx } {} + + friend bool operator==( basic_iterator lhs, basic_iterator rhs ) { + return lhs.m_origin == rhs.m_origin && + lhs.m_origin_idx == rhs.m_origin_idx; } - friend bool operator!=(iterator lhs, iterator rhs) { - return !(lhs == rhs); + friend bool operator!=( basic_iterator lhs, basic_iterator rhs ) { + return !( lhs == rhs ); } - iterator& operator++() { + basic_iterator& operator++() { ++m_origin_idx; - assert(m_origin_idx < data_size + 1 && "Outside of valid alloc"); - if (m_origin_idx < data_size) { - m_origin->touched[m_origin_idx] = true; - } return *this; } - iterator operator++(int) { - auto tmp(*this); - ++(*this); + basic_iterator operator++( int ) { + auto tmp( *this ); + ++( *this ); return tmp; } - reference operator*() const { - assert(m_origin_idx < data_size && "Attempted to deref invalid position"); - m_origin->derefed[m_origin_idx] = true; - return m_origin->elements[m_origin_idx]; + const_reference operator*() const { + assert( m_origin_idx < m_origin->m_elements.size() && "Attempted to deref invalid position" ); + m_origin->m_derefed[m_origin_idx] = true; + return m_origin->m_elements[m_origin_idx]; } pointer operator->() const { - assert(m_origin_idx < data_size && "Attempted to deref invalid position"); - return &m_origin->elements[m_origin_idx]; + assert( m_origin_idx < m_origin->m_elements.size() && "Attempted to deref invalid position" ); + return &m_origin->m_elements[m_origin_idx]; } - }; - iterator begin() const { - // Const-cast away to avoid overcomplicating the iterators - // We should actually fix this over time - return { const_cast<with_mocked_iterator_access*>(this), 0 }; - } - iterator end() const { - return { const_cast<with_mocked_iterator_access*>(this), data_size }; - } + using iterator = basic_iterator<false>; + using const_iterator = basic_iterator<true>; + + with_mocked_iterator_access( std::initializer_list<T> init ): + m_elements( init ), + m_derefed( std::make_unique<bool[]>( m_elements.size() ) ) {} + const_iterator begin() const { return { this, 0 }; } + const_iterator end() const { return { this, m_elements.size() }; } + iterator begin() { return { this, 0 }; } + iterator end() { return { this, m_elements.size() }; } }; } // end anon namespace namespace Catch { - template <> - struct StringMaker<with_mocked_iterator_access> { - static std::string convert(with_mocked_iterator_access const& access) { + // make sure with_mocked_iterator_access is not considered a range by Catch, + // so that below StringMaker is used instead of the default one for ranges + template <typename T> + struct is_range<with_mocked_iterator_access<T>> : std::false_type {}; + + template <typename T> + struct StringMaker<with_mocked_iterator_access<T>> { + static std::string + convert( with_mocked_iterator_access<T> const& access ) { // We have to avoid the type's iterators, because we check // their use in tests - return ::Catch::Detail::stringify(access.elements); + return ::Catch::Detail::stringify( access.m_elements ); } }; -} +} // namespace Catch struct MoveOnlyTestElement { int num = 0; @@ -228,7 +260,7 @@ TEST_CASE("Basic use of the Contains range matcher", "[matchers][templated][cont } SECTION("Can handle type that requires ADL-found free function begin and end") { - unrelated::needs_ADL_begin in; + unrelated::needs_ADL_begin<int> in{1, 2, 3, 4, 5}; REQUIRE_THAT(in, Contains(1)); REQUIRE_THAT(in, !Contains(8)); @@ -378,35 +410,35 @@ TEST_CASE("Usage of AllMatch range matcher", "[matchers][templated][quantifiers] } SECTION("Type requires ADL found begin and end") { - unrelated::needs_ADL_begin needs_adl; + unrelated::needs_ADL_begin<int> needs_adl{ 1, 2, 3, 4, 5 }; REQUIRE_THAT( needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) ); } SECTION("Shortcircuiting") { - with_mocked_iterator_access mocked; + with_mocked_iterator_access<int> mocked{ 1, 2, 3, 4, 5 }; SECTION("All are read") { auto allMatch = AllMatch(Predicate<int>([](int elem) { return elem < 10; })); REQUIRE_THAT(mocked, allMatch); - REQUIRE(mocked.derefed[0]); - REQUIRE(mocked.derefed[1]); - REQUIRE(mocked.derefed[2]); - REQUIRE(mocked.derefed[3]); - REQUIRE(mocked.derefed[4]); + REQUIRE(mocked.m_derefed[0]); + REQUIRE(mocked.m_derefed[1]); + REQUIRE(mocked.m_derefed[2]); + REQUIRE(mocked.m_derefed[3]); + REQUIRE(mocked.m_derefed[4]); } SECTION("Short-circuited") { auto allMatch = AllMatch(Predicate<int>([](int elem) { return elem < 3; })); REQUIRE_THAT(mocked, !allMatch); - REQUIRE(mocked.derefed[0]); - REQUIRE(mocked.derefed[1]); - REQUIRE(mocked.derefed[2]); - REQUIRE_FALSE(mocked.derefed[3]); - REQUIRE_FALSE(mocked.derefed[4]); + REQUIRE(mocked.m_derefed[0]); + REQUIRE(mocked.m_derefed[1]); + REQUIRE(mocked.m_derefed[2]); + REQUIRE_FALSE(mocked.m_derefed[3]); + REQUIRE_FALSE(mocked.m_derefed[4]); } } } @@ -431,34 +463,34 @@ TEST_CASE("Usage of AnyMatch range matcher", "[matchers][templated][quantifiers] REQUIRE_THAT(data, !AnyMatch(Contains(0) && Contains(10))); } - SECTION("Type requires ADL found begin and end") { - unrelated::needs_ADL_begin needs_adl; + SECTION( "Type requires ADL found begin and end" ) { + unrelated::needs_ADL_begin<int> needs_adl{ 1, 2, 3, 4, 5 }; REQUIRE_THAT( needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) ); } SECTION("Shortcircuiting") { - with_mocked_iterator_access mocked; + with_mocked_iterator_access<int> mocked{ 1, 2, 3, 4, 5 }; SECTION("All are read") { auto anyMatch = AnyMatch( Predicate<int>( []( int elem ) { return elem > 10; } ) ); REQUIRE_THAT( mocked, !anyMatch ); - REQUIRE( mocked.derefed[0] ); - REQUIRE( mocked.derefed[1] ); - REQUIRE( mocked.derefed[2] ); - REQUIRE( mocked.derefed[3] ); - REQUIRE( mocked.derefed[4] ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE( mocked.m_derefed[1] ); + REQUIRE( mocked.m_derefed[2] ); + REQUIRE( mocked.m_derefed[3] ); + REQUIRE( mocked.m_derefed[4] ); } SECTION("Short-circuited") { auto anyMatch = AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ); REQUIRE_THAT( mocked, anyMatch ); - REQUIRE( mocked.derefed[0] ); - REQUIRE_FALSE( mocked.derefed[1] ); - REQUIRE_FALSE( mocked.derefed[2] ); - REQUIRE_FALSE( mocked.derefed[3] ); - REQUIRE_FALSE( mocked.derefed[4] ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE_FALSE( mocked.m_derefed[1] ); + REQUIRE_FALSE( mocked.m_derefed[2] ); + REQUIRE_FALSE( mocked.m_derefed[3] ); + REQUIRE_FALSE( mocked.m_derefed[4] ); } } } @@ -484,62 +516,319 @@ TEST_CASE("Usage of NoneMatch range matcher", "[matchers][templated][quantifiers } SECTION( "Type requires ADL found begin and end" ) { - unrelated::needs_ADL_begin needs_adl; + unrelated::needs_ADL_begin<int> needs_adl{ 1, 2, 3, 4, 5 }; REQUIRE_THAT( needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) ); } SECTION("Shortcircuiting") { - with_mocked_iterator_access mocked; + with_mocked_iterator_access<int> mocked{ 1, 2, 3, 4, 5 }; SECTION("All are read") { auto noneMatch = NoneMatch( Predicate<int>([](int elem) { return elem > 10; })); REQUIRE_THAT(mocked, noneMatch); - REQUIRE(mocked.derefed[0]); - REQUIRE(mocked.derefed[1]); - REQUIRE(mocked.derefed[2]); - REQUIRE(mocked.derefed[3]); - REQUIRE(mocked.derefed[4]); + REQUIRE(mocked.m_derefed[0]); + REQUIRE(mocked.m_derefed[1]); + REQUIRE(mocked.m_derefed[2]); + REQUIRE(mocked.m_derefed[3]); + REQUIRE(mocked.m_derefed[4]); } SECTION("Short-circuited") { auto noneMatch = NoneMatch( Predicate<int>([](int elem) { return elem < 3; })); REQUIRE_THAT(mocked, !noneMatch); - REQUIRE(mocked.derefed[0]); - REQUIRE_FALSE(mocked.derefed[1]); - REQUIRE_FALSE(mocked.derefed[2]); - REQUIRE_FALSE(mocked.derefed[3]); - REQUIRE_FALSE(mocked.derefed[4]); + REQUIRE(mocked.m_derefed[0]); + REQUIRE_FALSE(mocked.m_derefed[1]); + REQUIRE_FALSE(mocked.m_derefed[2]); + REQUIRE_FALSE(mocked.m_derefed[3]); + REQUIRE_FALSE(mocked.m_derefed[4]); + } + } +} + +namespace { + struct ConvertibleToBool + { + bool v; + + explicit operator bool() const + { + return v; + } + }; +} + +namespace Catch { + template <> + struct StringMaker<ConvertibleToBool> { + static std::string + convert( ConvertibleToBool const& convertible_to_bool ) { + return ::Catch::Detail::stringify( convertible_to_bool.v ); + } + }; +} // namespace Catch + +TEST_CASE("Usage of AllTrue range matcher", "[matchers][templated][quantifiers]") { + using Catch::Matchers::AllTrue; + + SECTION( "Basic usage" ) { + SECTION( "All true evaluates to true" ) { + std::array<bool, 5> const data{ { true, true, true, true, true } }; + REQUIRE_THAT( data, AllTrue() ); + } + SECTION( "Empty evaluates to true" ) { + std::array<bool, 0> const data{}; + REQUIRE_THAT( data, AllTrue() ); + } + SECTION( "One false evalutes to false" ) { + std::array<bool, 5> const data{ { true, true, false, true, true } }; + REQUIRE_THAT( data, !AllTrue() ); + } + SECTION( "All false evaluates to false" ) { + std::array<bool, 5> const data{ + { false, false, false, false, false } }; + REQUIRE_THAT( data, !AllTrue() ); + } + } + + SECTION( "Contained type is convertible to bool" ) { + SECTION( "All true evaluates to true" ) { + std::array<ConvertibleToBool, 5> const data{ + { { true }, { true }, { true }, { true }, { true } } }; + REQUIRE_THAT( data, AllTrue() ); + } + SECTION( "One false evalutes to false" ) { + std::array<ConvertibleToBool, 5> const data{ + { { true }, { true }, { false }, { true }, { true } } }; + REQUIRE_THAT( data, !AllTrue() ); + } + SECTION( "All false evaluates to false" ) { + std::array<ConvertibleToBool, 5> const data{ + { { false }, { false }, { false }, { false }, { false } } }; + REQUIRE_THAT( data, !AllTrue() ); + } + } + + SECTION( "Shortcircuiting" ) { + SECTION( "All are read" ) { + with_mocked_iterator_access<bool> const mocked{ + true, true, true, true, true }; + REQUIRE_THAT( mocked, AllTrue() ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE( mocked.m_derefed[1] ); + REQUIRE( mocked.m_derefed[2] ); + REQUIRE( mocked.m_derefed[3] ); + REQUIRE( mocked.m_derefed[4] ); + } + SECTION( "Short-circuited" ) { + with_mocked_iterator_access<bool> const mocked{ + true, true, false, true, true }; + REQUIRE_THAT( mocked, !AllTrue() ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE( mocked.m_derefed[1] ); + REQUIRE( mocked.m_derefed[2] ); + REQUIRE_FALSE( mocked.m_derefed[3] ); + REQUIRE_FALSE( mocked.m_derefed[4] ); + } + } +} + +TEST_CASE( "Usage of NoneTrue range matcher", "[matchers][templated][quantifiers]" ) { + using Catch::Matchers::NoneTrue; + + SECTION( "Basic usage" ) { + SECTION( "All true evaluates to false" ) { + std::array<bool, 5> const data{ { true, true, true, true, true } }; + REQUIRE_THAT( data, !NoneTrue() ); + } + SECTION( "Empty evaluates to true" ) { + std::array<bool, 0> const data{}; + REQUIRE_THAT( data, NoneTrue() ); + } + SECTION( "One true evalutes to false" ) { + std::array<bool, 5> const data{ + { false, false, true, false, false } }; + REQUIRE_THAT( data, !NoneTrue() ); + } + SECTION( "All false evaluates to true" ) { + std::array<bool, 5> const data{ + { false, false, false, false, false } }; + REQUIRE_THAT( data, NoneTrue() ); + } + } + + SECTION( "Contained type is convertible to bool" ) { + SECTION( "All true evaluates to false" ) { + std::array<ConvertibleToBool, 5> const data{ + { { true }, { true }, { true }, { true }, { true } } }; + REQUIRE_THAT( data, !NoneTrue() ); + } + SECTION( "One true evalutes to false" ) { + std::array<ConvertibleToBool, 5> const data{ + { { false }, { false }, { true }, { false }, { false } } }; + REQUIRE_THAT( data, !NoneTrue() ); + } + SECTION( "All false evaluates to true" ) { + std::array<ConvertibleToBool, 5> const data{ + { { false }, { false }, { false }, { false }, { false } } }; + REQUIRE_THAT( data, NoneTrue() ); + } + } + + SECTION( "Shortcircuiting" ) { + SECTION( "All are read" ) { + with_mocked_iterator_access<bool> const mocked{ + false, false, false, false, false }; + REQUIRE_THAT( mocked, NoneTrue() ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE( mocked.m_derefed[1] ); + REQUIRE( mocked.m_derefed[2] ); + REQUIRE( mocked.m_derefed[3] ); + REQUIRE( mocked.m_derefed[4] ); + } + SECTION( "Short-circuited" ) { + with_mocked_iterator_access<bool> const mocked{ + false, false, true, true, true }; + REQUIRE_THAT( mocked, !NoneTrue() ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE( mocked.m_derefed[1] ); + REQUIRE( mocked.m_derefed[2] ); + REQUIRE_FALSE( mocked.m_derefed[3] ); + REQUIRE_FALSE( mocked.m_derefed[4] ); + } + } +} + +TEST_CASE( "Usage of AnyTrue range matcher", "[matchers][templated][quantifiers]" ) { + using Catch::Matchers::AnyTrue; + + SECTION( "Basic usage" ) { + SECTION( "All true evaluates to true" ) { + std::array<bool, 5> const data{ { true, true, true, true, true } }; + REQUIRE_THAT( data, AnyTrue() ); + } + SECTION( "Empty evaluates to false" ) { + std::array<bool, 0> const data{}; + REQUIRE_THAT( data, !AnyTrue() ); + } + SECTION( "One true evalutes to true" ) { + std::array<bool, 5> const data{ + { false, false, true, false, false } }; + REQUIRE_THAT( data, AnyTrue() ); + } + SECTION( "All false evaluates to false" ) { + std::array<bool, 5> const data{ + { false, false, false, false, false } }; + REQUIRE_THAT( data, !AnyTrue() ); + } + } + + SECTION( "Contained type is convertible to bool" ) { + SECTION( "All true evaluates to true" ) { + std::array<ConvertibleToBool, 5> const data{ + { { true }, { true }, { true }, { true }, { true } } }; + REQUIRE_THAT( data, AnyTrue() ); + } + SECTION( "One true evalutes to true" ) { + std::array<ConvertibleToBool, 5> const data{ + { { false }, { false }, { true }, { false }, { false } } }; + REQUIRE_THAT( data, AnyTrue() ); + } + SECTION( "All false evaluates to false" ) { + std::array<ConvertibleToBool, 5> const data{ + { { false }, { false }, { false }, { false }, { false } } }; + REQUIRE_THAT( data, !AnyTrue() ); + } + } + + SECTION( "Shortcircuiting" ) { + SECTION( "All are read" ) { + with_mocked_iterator_access<bool> const mocked{ + false, false, false, false, true }; + REQUIRE_THAT( mocked, AnyTrue() ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE( mocked.m_derefed[1] ); + REQUIRE( mocked.m_derefed[2] ); + REQUIRE( mocked.m_derefed[3] ); + REQUIRE( mocked.m_derefed[4] ); + } + SECTION( "Short-circuited" ) { + with_mocked_iterator_access<bool> const mocked{ + false, false, true, true, true }; + REQUIRE_THAT( mocked, AnyTrue() ); + REQUIRE( mocked.m_derefed[0] ); + REQUIRE( mocked.m_derefed[1] ); + REQUIRE( mocked.m_derefed[2] ); + REQUIRE_FALSE( mocked.m_derefed[3] ); + REQUIRE_FALSE( mocked.m_derefed[4] ); } } } +TEST_CASE("All/Any/None True matchers support types with ADL begin", + "[approvals][matchers][quantifiers][templated]") { + using Catch::Matchers::AllTrue; + using Catch::Matchers::NoneTrue; + using Catch::Matchers::AnyTrue; + + + SECTION( "Type requires ADL found begin and end" ) { + unrelated::needs_ADL_begin<bool> const needs_adl{ + true, true, true, true, true }; + REQUIRE_THAT( needs_adl, AllTrue() ); + } + + SECTION( "Type requires ADL found begin and end" ) { + unrelated::needs_ADL_begin<bool> const needs_adl{ + false, false, false, false, false }; + REQUIRE_THAT( needs_adl, NoneTrue() ); + } + + SECTION( "Type requires ADL found begin and end" ) { + unrelated::needs_ADL_begin<bool> const needs_adl{ + false, false, true, false, false }; + REQUIRE_THAT( needs_adl, AnyTrue() ); + } +} -// This is a C++17 extension, and GCC refuses to compile such code -// unless it is set to C++17 or later +// Range loop iterating over range with different types for begin and end is a +// C++17 feature, and GCC refuses to compile such code unless the lang mode is +// set to C++17 or later. #if defined(CATCH_CPP17_OR_GREATER) TEST_CASE( "The quantifier range matchers support types with different types returned from begin and end", "[matchers][templated][quantifiers][approvals]" ) { using Catch::Matchers::AllMatch; + using Catch::Matchers::AllTrue; using Catch::Matchers::AnyMatch; + using Catch::Matchers::AnyTrue; using Catch::Matchers::NoneMatch; + using Catch::Matchers::NoneTrue; using Catch::Matchers::Predicate; - has_different_begin_end_types diff_types; - REQUIRE_THAT( diff_types, !AllMatch( Predicate<int>( []( int elem ) { - return elem < 3; - } ) ) ); + SECTION( "AllAnyNoneMatch" ) { + has_different_begin_end_types<int> diff_types{ 1, 2, 3, 4, 5 }; + REQUIRE_THAT( diff_types, !AllMatch( Predicate<int>( []( int elem ) { + return elem < 3; + } ) ) ); - REQUIRE_THAT( diff_types, AnyMatch( Predicate<int>( []( int elem ) { - return elem < 2; - } ) ) ); + REQUIRE_THAT( diff_types, AnyMatch( Predicate<int>( []( int elem ) { + return elem < 2; + } ) ) ); + + REQUIRE_THAT( diff_types, !NoneMatch( Predicate<int>( []( int elem ) { + return elem < 3; + } ) ) ); + } + SECTION( "AllAnyNoneTrue" ) { + has_different_begin_end_types<bool> diff_types{ false, false, true, false, false }; - REQUIRE_THAT( diff_types, !NoneMatch( Predicate<int>( []( int elem ) { - return elem < 3; - } ) ) ); + REQUIRE_THAT( diff_types, !AllTrue() ); + REQUIRE_THAT( diff_types, AnyTrue() ); + REQUIRE_THAT( diff_types, !NoneTrue() ); + } } #endif diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp index a30c2e9ed..2ec71b496 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <iostream> @@ -238,6 +241,20 @@ std::ostream& operator<<(std::ostream& out, helper_1436<T1, T2> const& helper) { return out; } +// Clang and gcc have different names for this warning, and clang also +// warns about an unused value. This warning must be disabled for C++20. +#if defined(__GNUG__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wcomma-subscript" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wdeprecated-comma-subscript" +#pragma clang diagnostic ignored "-Wunused-value" +#endif + 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)], @@ -248,6 +265,10 @@ TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messag SUCCEED(); } +#ifdef __GNUG__ +#pragma GCC diagnostic pop +#endif + 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 {[<"); diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp index e3b9bd3a2..93b5ff1ec 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp @@ -1,11 +1,15 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> #include <catch2/catch_template_test_macros.hpp> #include <catch2/internal/catch_config_wchar.hpp> +#include <catch2/internal/catch_windows_h_proxy.hpp> #ifdef __clang__ # pragma clang diagnostic ignored "-Wc++98-compat" @@ -227,16 +231,6 @@ TEST_CASE( "send a single char to INFO", "[failing][.]" ) { 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 ); @@ -253,16 +247,6 @@ TEST_CASE( "Nice descriptive name", "[tag1][tag2][tag3][.]" ) { 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 ); @@ -442,10 +426,6 @@ TEST_CASE("not allowed", "[!throws]") { 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 @@ -482,7 +462,7 @@ TEST_CASE( "toString on wchar_t returns the string contents", "[toString]" ) { #endif // CATCH_CONFIG_WCHAR TEST_CASE( "long long" ) { - long long l = std::numeric_limits<long long>::max(); + constexpr long long l = std::numeric_limits<long long>::max(); REQUIRE( l == std::numeric_limits<long long>::max() ); } @@ -495,10 +475,15 @@ TEST_CASE( "# A test name that starts with a #" ) { SUCCEED( "yay" ); } -TEST_CASE( "#835 -- errno should not be touched by Catch", "[.][failing][!shouldfail]" ) { +TEST_CASE( "#835 -- errno should not be touched by Catch2", "[.][failing][!shouldfail]" ) { errno = 1; + // Check that reporting failed test doesn't change errno. CHECK(f() == 0); - REQUIRE(errno == 1); // Check that f() doesn't touch errno. + // We want to avoid expanding `errno` macro in assertion, because + // we capture the expression after macro expansion, and would have + // to normalize the ways different platforms spell `errno`. + const auto errno_after = errno; + REQUIRE(errno_after == 1); } TEST_CASE( "#961 -- Dynamically created sections should all be reported", "[.]" ) { @@ -522,3 +507,47 @@ TEMPLATE_TEST_CASE_SIG("#1954 - 7 arg template test case sig compiles", "[regres TEST_CASE("Same test name but with different tags is fine", "[.approvals][some-tag]") {} TEST_CASE("Same test name but with different tags is fine", "[.approvals][other-tag]") {} + +// MinGW doesn't support __try, and Clang has only very partial support +#if defined(_MSC_VER) +void throw_and_catch() +{ + __try { + RaiseException(0xC0000005, 0, 0, NULL); + } + __except (1) + { + + } +} + + +TEST_CASE("Validate SEH behavior - handled", "[approvals][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]") +{ + // Validate that Catch2 framework correctly handles tests raising and handling SEH exceptions. + throw_and_catch(); +} + +void throw_no_catch() +{ + RaiseException(0xC0000005, 0, 0, NULL); +} + +TEST_CASE("Validate SEH behavior - unhandled", "[.approvals][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]") +{ + // Validate that Catch2 framework correctly handles tests raising and not handling SEH exceptions. + throw_no_catch(); +} + +static LONG CALLBACK dummyExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) { + return EXCEPTION_CONTINUE_SEARCH; +} + +TEST_CASE("Validate SEH behavior - no crash for stack unwinding", "[approvals][!throws][!shouldfail][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]") +{ + // Trigger stack unwinding with SEH top-level filter changed and validate the test fails expectedly with no application crash + SetUnhandledExceptionFilter(dummyExceptionFilter); + throw 1; +} + +#endif // _MSC_VER diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringByte.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringByte.tests.cpp index ceb94e22f..e5e12468d 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringByte.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringByte.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #if defined(CATCH_CONFIG_CPP17_BYTE) diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp index 27a3dc3d3..22c31c687 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringChrono.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <chrono> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp index c738b32c5..b8f383b15 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp index 2b7ac3eca..bc2d2561c 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringOptional.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringPair.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringPair.tests.cpp index 3b8608aa4..4bf592a4c 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringPair.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringPair.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp index 1d1a7ab0d..415cbf838 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER #include <catch2/catch_test_macros.hpp> @@ -38,8 +46,7 @@ TEST_CASE( "tuple<tuple<int>,tuple<>,float>", "[toString][tuple]" ) CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) ); } -TEST_CASE( "tuple<nullptr,int,const char *>", "[toString][tuple]" ) -{ +TEST_CASE( "tuple<nullptr,int,const char *>", "[approvals][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/packages/Catch2/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp index de9748cde..e67a7a2cf 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringVariant.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringVector.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringVector.tests.cpp index 96c676725..a5ccbfa70 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringVector.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringVector.tests.cpp @@ -1,3 +1,11 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + #include <catch2/catch_test_macros.hpp> #include <vector> #include <array> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp index 7af8cc5b8..7069734f4 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp @@ -1,7 +1,10 @@ -/* - * Demonstrate which version of toString/StringMaker is being used - * for various types - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp index eed763f20..bcfa7e699 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #ifdef __clang__ #pragma clang diagnostic ignored "-Wpadded" @@ -20,34 +23,6 @@ #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; @@ -73,17 +48,6 @@ TEST_CASE CHECK( o1 == o2 ); } -/////////////////////////////////////////////////////////////////////////////// -TEST_CASE -( - "string literals of different sizes can be compared", - "[Tricky][failing][.]" -) -{ - REQUIRE( std::string( "first" ) == "second" ); - -} - /////////////////////////////////////////////////////////////////////////////// TEST_CASE ( @@ -240,18 +204,6 @@ TEST_CASE( "(unimplemented) static bools can be evaluated", "[Tricky]" ) } } -// 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 ) {} diff --git a/packages/Catch2/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp index c8754deec..7bc3920ec 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/VariadicMacros.tests.cpp @@ -1,7 +1,10 @@ -/* - * 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) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_test_macros.hpp> diff --git a/packages/Catch2/tests/SelfTest/WarnAboutNoTests.cmake b/packages/Catch2/tests/SelfTest/WarnAboutNoTests.cmake deleted file mode 100644 index 4637e3f3c..000000000 --- a/packages/Catch2/tests/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/packages/Catch2/tests/TestScripts/ConfigureTestsCommon.py b/packages/Catch2/tests/TestScripts/ConfigureTestsCommon.py new file mode 100644 index 000000000..ad5b358be --- /dev/null +++ b/packages/Catch2/tests/TestScripts/ConfigureTestsCommon.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +from typing import List, Tuple + +import os +import subprocess + +def configure_and_build(source_path: str, project_path: str, options: List[Tuple[str, str]]): + base_configure_cmd = ['cmake', + '-B{}'.format(project_path), + '-H{}'.format(source_path), + '-DCMAKE_BUILD_TYPE=Debug', + '-DCATCH_DEVELOPMENT_BUILD=ON'] + for option, value in options: + base_configure_cmd.append('-D{}={}'.format(option, value)) + try: + subprocess.run(base_configure_cmd, + stdout = subprocess.PIPE, + stderr = subprocess.STDOUT, + check = True) + except subprocess.SubprocessError as ex: + print("Could not configure build to '{}' from '{}'".format(project_path, source_path)) + print("Return code: {}".format(ex.returncode)) + print("output: {}".format(ex.output)) + raise + print('Configuring {} finished'.format(project_path)) + + build_cmd = ['cmake', + '--build', '{}'.format(project_path), + # For now we assume that we only need Debug config + '--config', 'Debug'] + try: + subprocess.run(build_cmd, + stdout = subprocess.PIPE, + stderr = subprocess.STDOUT, + check = True) + except subprocess.SubprocessError as ex: + print("Could not build project in '{}'".format(project_path)) + print("Return code: {}".format(ex.returncode)) + print("output: {}".format(ex.output)) + raise + print('Building {} finished'.format(project_path)) + +def run_and_return_output(base_path: str, binary_name: str, other_options: List[str]) -> Tuple[str, str]: + # For now we assume that Windows builds are done using MSBuild under + # Debug configuration. This means that we need to add "Debug" folder + # to the path when constructing it. On Linux, we don't add anything. + config_path = "Debug" if os.name == 'nt' else "" + full_path = os.path.join(base_path, config_path, binary_name) + + base_cmd = [full_path] + base_cmd.extend(other_options) + + try: + ret = subprocess.run(base_cmd, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + check = True, + universal_newlines = True) + except subprocess.SubprocessError as ex: + print('Could not run "{}"'.format(base_cmd)) + print('Args: "{}"'.format(other_options)) + print('Return code: {}'.format(ex.returncode)) + print('stdout: {}'.format(ex.stdout)) + print('stderr: {}'.format(ex.stdout)) + raise + + return (ret.stdout, ret.stderr) diff --git a/packages/Catch2/tests/TestScripts/testBazelReporter.py b/packages/Catch2/tests/TestScripts/testBazelReporter.py new file mode 100644 index 000000000..71014ee26 --- /dev/null +++ b/packages/Catch2/tests/TestScripts/testBazelReporter.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python3 + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +import os +import re +import sys +import xml.etree.ElementTree as ET +import subprocess + +""" +Test that Catch2 recognizes `XML_OUTPUT_FILE` env variable and creates +a junit reporter that writes to the provided path. + +Requires 2 arguments, path to Catch2 binary configured with +`CATCH_CONFIG_BAZEL_SUPPORT`, and the output directory for the output file. +""" +if len(sys.argv) != 3: + print("Wrong number of arguments: {}".format(len(sys.argv))) + print("Usage: {} test-bin-path output-dir".format(sys.argv[0])) + exit(1) + + +bin_path = os.path.abspath(sys.argv[1]) +output_dir = os.path.abspath(sys.argv[2]) +xml_out_path = os.path.join(output_dir, '{}.xml'.format(os.path.basename(bin_path))) + +# Ensure no file exists from previous test runs +if os.path.isfile(xml_out_path): + os.remove(xml_out_path) + +print('bin path:', bin_path) +print('xml out path:', xml_out_path) + +env = os.environ.copy() +env["XML_OUTPUT_FILE"] = xml_out_path +test_passing = True + +try: + ret = subprocess.run( + bin_path, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=True, + universal_newlines=True, + env=env + ) + stdout = ret.stdout +except subprocess.SubprocessError as ex: + if ex.returncode == 1: + # The test cases are allowed to fail. + test_passing = False + stdout = ex.stdout + else: + print('Could not run "{}"'.format(args)) + print("Return code: {}".format(ex.returncode)) + print("stdout: {}".format(ex.stdout)) + print("stderr: {}".format(ex.stdout)) + raise + +# Check for valid XML output +try: + tree = ET.parse(xml_out_path) +except ET.ParseError as ex: + print("Invalid XML: '{}'".format(ex)) + raise +except FileNotFoundError as ex: + print("Could not find '{}'".format(xml_out_path)) + raise + +bin_name = os.path.basename(bin_path) +# Check for matching testsuite +if not tree.find('.//testsuite[@name="{}"]'.format(bin_name)): + print("Could not find '{}' testsuite".format(bin_name)) + exit(2) + +# Check that we haven't disabled the default reporter +summary_test_cases = re.findall(r'test cases: \d* \| \d* passed \| \d* failed', stdout) +if len(summary_test_cases) == 0: + print("Could not find test summary in {}".format(stdout)) + exit(2) + +total, passed, failed = [int(s) for s in summary_test_cases[0].split() if s.isdigit()] + +if failed == 0 and not test_passing: + print("Expected at least 1 test failure!") + exit(2) + +if len(tree.findall('.//testcase')) != total: + print("Unexpected number of test cases!") + exit(2) + +if len(tree.findall('.//failure')) != failed: + print("Unexpected number of test failures!") + exit(2) + +if (passed + failed) != total: + print("Something has gone very wrong, ({} + {}) != {}".format(passed, failed, total)) + exit(2) diff --git a/packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py b/packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py new file mode 100644 index 000000000..66c88da02 --- /dev/null +++ b/packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +from ConfigureTestsCommon import configure_and_build, run_and_return_output + +import os +import re +import sys + +""" +Tests the CMake configure option for CATCH_CONFIG_DEFAULT_REPORTER + +Requires 2 arguments, path folder where the Catch2's main CMakeLists.txt +exists, and path to where the output files should be stored. +""" + +if len(sys.argv) != 3: + print('Wrong number of arguments: {}'.format(len(sys.argv))) + print('Usage: {} catch2-top-level-dir base-build-output-dir'.format(sys.argv[0])) + exit(1) + +catch2_source_path = os.path.abspath(sys.argv[1]) +build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests', 'DefaultReporter') + +configure_and_build(catch2_source_path, + build_dir_path, + [("CATCH_CONFIG_DEFAULT_REPORTER", "compact")]) + +stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), 'SelfTest', ['[approx][custom]']) + + +# This matches the summary line made by compact reporter, console reporter's +# summary line does not match the regex. +summary_regex = 'Passed \d+ test case with \d+ assertions.' +if not re.search(summary_regex, stdout): + print("Could not find '{}' in the stdout".format(summary_regex)) + print('stdout: "{}"'.format(stdout)) + exit(2) diff --git a/packages/Catch2/tests/TestScripts/testConfigureDisable.py b/packages/Catch2/tests/TestScripts/testConfigureDisable.py new file mode 100644 index 000000000..92946d8d8 --- /dev/null +++ b/packages/Catch2/tests/TestScripts/testConfigureDisable.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +from ConfigureTestsCommon import configure_and_build, run_and_return_output + +import os +import re +import sys + +""" +Tests the CMake configure option for CATCH_CONFIG_DISABLE + +Requires 2 arguments, path folder where the Catch2's main CMakeLists.txt +exists, and path to where the output files should be stored. +""" + +if len(sys.argv) != 3: + print('Wrong number of arguments: {}'.format(len(sys.argv))) + print('Usage: {} catch2-top-level-dir base-build-output-dir'.format(sys.argv[0])) + exit(1) + +catch2_source_path = os.path.abspath(sys.argv[1]) +build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests', 'Disable') + +configure_and_build(catch2_source_path, + build_dir_path, + [("CATCH_CONFIG_DISABLE", "ON"), + # We need to turn off WERROR, because the compilers + # can see that the various variables inside test cases + # are set but unused. + ("CATCH_ENABLE_WERROR", "OFF")]) + +stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), + 'SelfTest', + ['--allow-running-no-tests']) + + +summary_line = 'No tests ran' +if not summary_line in stdout: + print("Could not find '{}' in the stdout".format(summary_line)) + print('stdout: "{}"'.format(stdout)) + exit(2) diff --git a/packages/Catch2/tests/TestScripts/testConfigureDisableStringification.py b/packages/Catch2/tests/TestScripts/testConfigureDisableStringification.py new file mode 100644 index 000000000..a8a53e4f5 --- /dev/null +++ b/packages/Catch2/tests/TestScripts/testConfigureDisableStringification.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +from ConfigureTestsCommon import configure_and_build, run_and_return_output + +import os +import re +import sys + +""" +Tests the CMake configure option for CATCH_CONFIG_DISABLE_STRINGIFICATION + +Requires 2 arguments, path folder where the Catch2's main CMakeLists.txt +exists, and path to where the output files should be stored. +""" + +if len(sys.argv) != 3: + print('Wrong number of arguments: {}'.format(len(sys.argv))) + print('Usage: {} catch2-top-level-dir base-build-output-dir'.format(sys.argv[0])) + exit(1) + +catch2_source_path = os.path.abspath(sys.argv[1]) +build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests', 'DisableStringification') + +configure_and_build(catch2_source_path, + build_dir_path, + [("CATCH_CONFIG_DISABLE_STRINGIFICATION", "ON")]) + +stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), + 'SelfTest', + ['-s', '[approx][custom]']) + + +required_output = 'Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION' +if not required_output in stdout: + print("Could not find '{}' in the stdout".format(required_output)) + print('stdout: "{}"'.format(stdout)) + exit(2) diff --git a/packages/Catch2/tests/TestScripts/testConfigureExperimentalRedirect.py b/packages/Catch2/tests/TestScripts/testConfigureExperimentalRedirect.py new file mode 100644 index 000000000..b5313fe92 --- /dev/null +++ b/packages/Catch2/tests/TestScripts/testConfigureExperimentalRedirect.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +from ConfigureTestsCommon import configure_and_build, run_and_return_output + +import os +import re +import sys + +""" +Tests the CMake configure option for CATCH_CONFIG_EXPERIMENTAL_REDIRECT + +Requires 2 arguments, path folder where the Catch2's main CMakeLists.txt +exists, and path to where the output files should be stored. +""" + +if len(sys.argv) != 3: + print('Wrong number of arguments: {}'.format(len(sys.argv))) + print('Usage: {} catch2-top-level-dir base-build-output-dir'.format(sys.argv[0])) + exit(1) + +catch2_source_path = os.path.abspath(sys.argv[1]) +build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests', 'ExperimentalRedirect') + +configure_and_build(catch2_source_path, + build_dir_path, + [("CATCH_CONFIG_EXPERIMENTAL_REDIRECT", "ON")]) + +stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), + 'SelfTest', + ['-r', 'xml', '"has printf"']) + + +# The print from printf must be within the XML's reporter stdout tag. +required_output = '''\ + <StdOut> +loose text artifact + </StdOut> +''' +if not required_output in stdout: + print("Could not find '{}' in the stdout".format(required_output)) + print('stdout: "{}"'.format(stdout)) + exit(2) diff --git a/packages/Catch2/tests/TestScripts/testPartialTestCaseEvent.py b/packages/Catch2/tests/TestScripts/testPartialTestCaseEvent.py index d119e6dab..8259d211c 100755 --- a/packages/Catch2/tests/TestScripts/testPartialTestCaseEvent.py +++ b/packages/Catch2/tests/TestScripts/testPartialTestCaseEvent.py @@ -1,5 +1,12 @@ #!/usr/bin/env python3 +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + """ This test script verifies that the testCasePartial{Starting,Ended} reporter events fire properly. This is done by calling a test binary compiled with diff --git a/packages/Catch2/tests/TestScripts/testRandomOrder.py b/packages/Catch2/tests/TestScripts/testRandomOrder.py index e7d7eca19..afab231de 100755 --- a/packages/Catch2/tests/TestScripts/testRandomOrder.py +++ b/packages/Catch2/tests/TestScripts/testRandomOrder.py @@ -1,5 +1,12 @@ #!/usr/bin/env python3 +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + """ This test script verifies that the random ordering of tests inside Catch2 is invariant in regards to subsetting. This is done by running @@ -13,6 +20,12 @@ import sys import random import xml.etree.ElementTree as ET +def none_to_empty_str(e): + if e is None: + return "" + assert type(e) is str + return e + def list_tests(self_test_exe, tags, rng_seed): cmd = [self_test_exe, '--reporter', 'xml', '--list-tests', '--order', 'rand', '--rng-seed', str(rng_seed)] @@ -26,7 +39,9 @@ def list_tests(self_test_exe, tags, rng_seed): raise RuntimeError("Unexpected error output:\n" + process.stderr) root = ET.fromstring(stdout) - result = [elem.text for elem in root.findall('./TestCase/Name')] + result = [(none_to_empty_str(tc.find('Name').text), + none_to_empty_str(tc.find('Tags').text), + none_to_empty_str(tc.find('ClassName').text)) for tc in root.findall('./TestCase')] if len(result) < 2: raise RuntimeError("Unexpectedly few tests listed (got {})".format( diff --git a/packages/Catch2/tests/TestScripts/testSharding.py b/packages/Catch2/tests/TestScripts/testSharding.py new file mode 100755 index 000000000..6902f83c4 --- /dev/null +++ b/packages/Catch2/tests/TestScripts/testSharding.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 + +# Copyright Catch2 Authors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +# SPDX-License-Identifier: BSL-1.0 + +""" +This test script verifies that sharding tests does change which tests are run. +This is done by running the binary multiple times, once to list all the tests, +once per shard to list the tests for that shard, and once again per shard to +execute the tests. The sharded lists are compared to the full list to ensure +none are skipped, duplicated, and that the order remains the same. +""" + +import random +import subprocess +import sys +import xml.etree.ElementTree as ET + +from collections import namedtuple + +from typing import List, Dict + +seed = random.randint(0, 2 ** 32 - 1) +number_of_shards = 5 + +def make_base_commandline(self_test_exe): + return [ + self_test_exe, + '--reporter', 'xml', + '--order', 'rand', + '--rng-seed', str(seed), + "[generators]~[benchmarks]~[.]" + ] + + +def list_tests(self_test_exe: str, extra_args: List[str] = None): + cmd = make_base_commandline(self_test_exe) + ['--list-tests'] + if extra_args: + cmd.extend(extra_args) + + try: + ret = subprocess.run(cmd, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + timeout = 10, + check = True, + universal_newlines = True) + except subprocess.CalledProcessError as ex: + print('Could not list tests:\n{}'.format(ex.stderr)) + + if ret.stderr: + raise RuntimeError("Unexpected error output:\n" + ret.stderr) + + root = ET.fromstring(ret.stdout) + result = [elem.text for elem in root.findall('./TestCase/Name')] + + if len(result) < 2: + raise RuntimeError("Unexpectedly few tests listed (got {})".format( + len(result))) + + + return result + + +def execute_tests(self_test_exe: str, extra_args: List[str] = None): + cmd = make_base_commandline(self_test_exe) + if extra_args: + cmd.extend(extra_args) + + try: + ret = subprocess.run(cmd, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + timeout = 10, + check = True, + universal_newlines = True) + except subprocess.CalledProcessError as ex: + print('Could not list tests:\n{}'.format(ex.stderr)) + + if ret.stderr: + raise RuntimeError("Unexpected error output:\n" + process.stderr) + + root = ET.fromstring(ret.stdout) + result = [elem.attrib["name"] for elem in root.findall('./TestCase')] + + if len(result) < 2: + raise RuntimeError("Unexpectedly few tests listed (got {})".format( + len(result))) + + return result + + +def test_sharded_listing(self_test_exe: str) -> Dict[int, List[str]]: + """ + Asks the test binary for list of all tests, and also for lists of + tests from shards. + + The combination of shards is then checked whether it corresponds to + the full list of all tests. + + Returns the dictionary of shard-index => listed tests for later use. + """ + all_tests = list_tests(self_test_exe) + big_shard_tests = list_tests(self_test_exe, ['--shard-count', '1', '--shard-index', '0']) + + assert all_tests == big_shard_tests, ( + "No-sharding test list does not match the listing of big shard:\nNo shard:\n{}\n\nWith shard:\n{}\n".format( + '\n'.join(all_tests), + '\n'.join(big_shard_tests) + ) + ) + + shard_listings = dict() + for shard_idx in range(number_of_shards): + shard_listings[shard_idx] = list_tests(self_test_exe, ['--shard-count', str(number_of_shards), '--shard-index', str(shard_idx)]) + + shard_sizes = [len(v) for v in shard_listings.values()] + assert len(all_tests) == sum(shard_sizes) + + # Check that the shards have roughly the right sizes (e.g. we don't + # have all tests in single shard and the others are empty) + differences = [abs(x1 - x2) for x1, x2 in zip(shard_sizes, shard_sizes[1:])] + assert all(diff <= 1 for diff in differences), "A shard has weird size: {}".format(shard_sizes) + + combined_shards = [inner for outer in shard_listings.values() for inner in outer] + assert all_tests == combined_shards, ( + "All tests and combined shards disagree.\nNo shard:\n{}\n\nCombined:\n{}\n\n".format( + '\n'.join(all_tests), + '\n'.join(combined_shards) + ) + ) + shard_listings[-1] = all_tests + + return shard_listings + + +def test_sharded_execution(self_test_exe: str, listings: Dict[int, List[str]]): + """ + Runs the test binary and checks that the executed tests match the + previously listed tests. + + Also does this for various shard indices, and that the combination + of all shards matches the full run/listing. + """ + all_tests = execute_tests(self_test_exe) + big_shard_tests = execute_tests(self_test_exe, ['--shard-count', '1', '--shard-index', '0']) + assert all_tests == big_shard_tests + + assert listings[-1] == all_tests + + for shard_idx in range(number_of_shards): + assert listings[shard_idx] == execute_tests(self_test_exe, ['--shard-count', str(number_of_shards), '--shard-index', str(shard_idx)]) + + +def main(): + self_test_exe, = sys.argv[1:] + listings = test_sharded_listing(self_test_exe) + test_sharded_execution(self_test_exe, listings) + +if __name__ == '__main__': + sys.exit(main()) diff --git a/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat b/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat index d9be52eb7..727f829ba 100644 --- a/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat +++ b/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat @@ -10,10 +10,10 @@ if "%CONFIGURATION%"=="Debug" ( @REM # coverage needs to build the special helper as well as the main cmake -Htools/misc -Bbuild-misc -A%PLATFORM% || exit /b !ERRORLEVEL! cmake --build build-misc || exit /b !ERRORLEVEL! - cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! + cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! ) else ( @REM # We know that coverage is 0 - cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_BUILD_SURROGATES=%surrogates% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! + cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_BUILD_SURROGATES=%surrogates% -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% || exit /b !ERRORLEVEL! ) ) if "%CONFIGURATION%"=="Release" ( diff --git a/packages/Catch2/tools/misc/appveyorTestRunScript.bat b/packages/Catch2/tools/misc/appveyorTestRunScript.bat index c491d5076..5982fc929 100644 --- a/packages/Catch2/tools/misc/appveyorTestRunScript.bat +++ b/packages/Catch2/tools/misc/appveyorTestRunScript.bat @@ -1,5 +1,7 @@ SETLOCAL EnableDelayedExpansion +rem Disable launching the JIT debugger for ctest.exe +reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusionList" /v "ctest.ext" /t REG_DWORD /d 1 cd Build if "%CONFIGURATION%"=="Debug" ( if "%coverage%"=="1" ( diff --git a/packages/Catch2/tools/scripts/approvalTests.py b/packages/Catch2/tools/scripts/approvalTests.py index 73e9b8323..098f40e35 100755 --- a/packages/Catch2/tools/scripts/approvalTests.py +++ b/packages/Catch2/tools/scripts/approvalTests.py @@ -28,47 +28,24 @@ filelocParser = re.compile(r''' ''', 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]+["']''') +# Note: junit must serialize time with 3 (or or less) decimal places +# before generalizing this parser, make sure that this is checked +# in other places too. +junitDurationsParser = re.compile(r' time="[0-9]+\.[0-9]{3}"') +durationParser = 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]+(-\w*\.[0-9]+)?') +versionParser = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+(-\w*\.[0-9]+)?') nullParser = re.compile(r'\b(__null|nullptr)\b') exeNameParser = re.compile(r''' \b - (CatchSelfTest|SelfTest) # Expected executable name + 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\s*\(\)\) - | - \(\*__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) # The weird OR is there to always have at least empty string for group 1 tapTestNumParser = re.compile(r'^((?:not ok)|(?:ok)|(?:warning)|(?:info)) (\d+) -') @@ -95,9 +72,15 @@ def diffFiles(fileA, fileB): def normalizeFilepath(line): - if catchPath in line: - # make paths relative to Catch root - line = line.replace(catchPath + os.sep, '') + # Sometimes the path separators used by compiler and Python can differ, + # so we try to match the path with both forward and backward path + # separators, to make the paths relative to Catch2 repo root. + forwardSlashPath = catchPath.replace('\\', '/') + if forwardSlashPath in line: + line = line.replace(forwardSlashPath + '/', '') + backwardSlashPath = catchPath.replace('/', '\\') + if backwardSlashPath in line: + line = line.replace(backwardSlashPath + '\\', '') m = langFilenameParser.match(line) if m: @@ -130,7 +113,7 @@ def filterLine(line, isCompact): # strip out the test order number in TAP to avoid massive diffs for every change line = tapTestNumParser.sub("\g<1> {test-number} -", line) - # strip Catch version number + # strip Catch2 version number line = versionParser.sub("<version>", line) # replace *null* with 0 @@ -143,30 +126,44 @@ def filterLine(line, isCompact): line = hexParser.sub("0x<hex digits>", line) # strip durations and timestamps - line = durationsParser.sub(' time="{duration}"', line) - line = sonarqubeDurationParser.sub(' duration="{duration}"', line) + line = junitDurationsParser.sub(' time="{duration}"', line) + line = durationParser.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 +def get_rawResultsPath(baseName): + return os.path.join(rootPath, '_{0}.tmp'.format(baseName)) + + +def get_baselinesPath(baseName): + return os.path.join(rootPath, '{0}.approved.txt'.format(baseName)) + + +def get_filteredResultsPath(baseName): + return os.path.join(rootPath, '{0}.unapproved.txt'.format(baseName)) + + +def run_test(baseName, args): 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)) + print(args) + rawResultsPath = get_rawResultsPath(baseName) f = open(rawResultsPath, 'w') subprocess.call(args, stdout=f, stderr=f) f.close() + +def check_outputs(baseName): + global overallResult + rawResultsPath = get_rawResultsPath(baseName) + baselinesPath = get_baselinesPath(baseName) + filteredResultsPath = get_filteredResultsPath(baseName) + rawFile = io.open(rawResultsPath, 'r', encoding='utf-8', errors='surrogateescape') filteredFile = io.open(filteredResultsPath, 'w', encoding='utf-8', errors='surrogateescape') for line in rawFile: @@ -194,24 +191,44 @@ def approve(baseName, args): overallResult = 1 +def approve(baseName, args): + run_test(baseName, args) + check_outputs(baseName) + + print("Running approvals against executable:") print(" " + cmdPath) +base_args = ["--order", "lex", "--rng-seed", "1", "--colour-mode", "none"] + ## special cases first: # Standard console reporter -approve("console.std", ["~[!nonportable]~[!benchmark]~[approvals] *", "--order", "lex", "--rng-seed", "1"]) +approve("console.std", ["~[!nonportable]~[!benchmark]~[approvals] *"] + base_args) # 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"]) +approve("console.swa4", ["~[!nonportable]~[!benchmark]~[approvals] *", "-s", "-w", "NoAssertions", "-x", "4"] + base_args) ## Common reporter checks: include passes, warn about No Assertions reporters = ('console', 'junit', 'xml', 'compact', 'sonarqube', 'tap', 'teamcity', 'automake') for reporter in reporters: filename = '{}.sw'.format(reporter) - common_args = ["~[!nonportable]~[!benchmark]~[approvals] *", "-s", "-w", "NoAssertions", "--order", "lex", "--rng-seed", "1"] + common_args = ["~[!nonportable]~[!benchmark]~[approvals] *", "-s", "-w", "NoAssertions"] + base_args reporter_args = ['-r', reporter] approve(filename, common_args + reporter_args) +## All reporters at the same time + +common_args = ["~[!nonportable]~[!benchmark]~[approvals] *", "-s", "-w", "NoAssertions"] + base_args +filenames = ['{}.sw.multi'.format(reporter) for reporter in reporters] +reporter_args = [] +for reporter, filename in zip(reporters, filenames): + reporter_args += ['-r', '{}::out={}'.format(reporter, get_rawResultsPath(filename))] + +run_test("default.sw.multi", common_args + reporter_args) +check_outputs("default.sw.multi") +for reporter, filename in zip(reporters, filenames): + check_outputs(filename) + if overallResult != 0: print("If these differences are expected, run approve.py to approve new baselines.") diff --git a/packages/Catch2/tools/scripts/benchmarkCompile.py b/packages/Catch2/tools/scripts/benchmarkCompile.py deleted file mode 100755 index 34113b9e1..000000000 --- a/packages/Catch2/tools/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/packages/Catch2/tools/scripts/benchmarkRunner.py b/packages/Catch2/tools/scripts/benchmarkRunner.py deleted file mode 100755 index dc753cf00..000000000 --- a/packages/Catch2/tools/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/packages/Catch2/tools/scripts/buildAndTest.cmd b/packages/Catch2/tools/scripts/buildAndTest.cmd new file mode 100644 index 000000000..e5222a01c --- /dev/null +++ b/packages/Catch2/tools/scripts/buildAndTest.cmd @@ -0,0 +1,17 @@ +rem Start at the root of the Catch project directory, for example: +rem cd Catch2 + +rem begin-snippet: catch2-build-and-test-win +rem 1. Regenerate the amalgamated distribution +python tools\scripts\generateAmalgamatedFiles.py + +rem 2. Configure the full test build +cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_ENABLE_CONFIGURE_TESTS=ON + +rem 3. Run the actual build +cmake --build debug-build + +rem 4. Run the tests using CTest +cd debug-build +ctest -j 4 --output-on-failure -C Debug +rem end-snippet diff --git a/packages/Catch2/tools/scripts/buildAndTest.sh b/packages/Catch2/tools/scripts/buildAndTest.sh index b343acad4..4a741598b 100755 --- a/packages/Catch2/tools/scripts/buildAndTest.sh +++ b/packages/Catch2/tools/scripts/buildAndTest.sh @@ -8,7 +8,7 @@ ./tools/scripts/generateAmalgamatedFiles.py # 2. Configure the full test build -cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_DEVELOPMENT_BUILD=ON +cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_ENABLE_CONFIGURE_TESTS=ON # 3. Run the actual build cmake --build debug-build diff --git a/packages/Catch2/tools/scripts/checkLicense.py b/packages/Catch2/tools/scripts/checkLicense.py index 3c2a14f40..634b0bfa9 100755 --- a/packages/Catch2/tools/scripts/checkLicense.py +++ b/packages/Catch2/tools/scripts/checkLicense.py @@ -1,32 +1,45 @@ #!/usr/bin/env python3 -import os -import sys - -def get_license(): - with open("src/catch2/catch_all.hpp", "r") as f: - license = f.readlines()[0:7] +import sys +import glob - return license +correct_licence = """\ +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) -def check_license(license): - failed = 0 - base_dir = "src/catch2/" +// SPDX-License-Identifier: BSL-1.0 +""" - # The _ represents the list of directories in base_dir - for root, _, files in os.walk(base_dir): - for file in files: - with open(root + "/" + file, "r") as f: - file_license = f.readlines()[0:7] +def check_licence_in_file(filename: str) -> bool: + with open(filename, 'r') as f: + file_preamble = ''.join(f.readlines()[:7]) - if file_license != license: - print("File %s does not have license" % file) - failed = 1 + if correct_licence != file_preamble: + print('File {} does not have proper licence'.format(filename)) + return False + return True +def check_licences_in_path(path: str) -> int: + failed = 0 + files_to_check = glob.glob(path + '/**/*.cpp', recursive=True) \ + + glob.glob(path + '/**/*.hpp', recursive=True) + for file in files_to_check: + if not check_licence_in_file(file): + failed += 1 return failed - -license = get_license() -status = check_license(license) -sys.exit(status) +def check_licences(): + failed = 0 + roots = ['src/catch2', 'tests'] + for root in roots: + failed += check_licences_in_path(root) + + if failed: + print('{} files are missing licence'.format(failed)) + sys.exit(1) + +if __name__ == "__main__": + check_licences() diff --git a/packages/Catch2/tools/scripts/embed.py b/packages/Catch2/tools/scripts/embed.py deleted file mode 100644 index 667570331..000000000 --- a/packages/Catch2/tools/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/packages/Catch2/tools/scripts/embedClara.py b/packages/Catch2/tools/scripts/embedClara.py deleted file mode 100755 index d8c1520a9..000000000 --- a/packages/Catch2/tools/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/packages/Catch2/tools/scripts/generateAmalgamatedFiles.py b/packages/Catch2/tools/scripts/generateAmalgamatedFiles.py index eb96d2a94..812712a3a 100755 --- a/packages/Catch2/tools/scripts/generateAmalgamatedFiles.py +++ b/packages/Catch2/tools/scripts/generateAmalgamatedFiles.py @@ -79,6 +79,15 @@ def concatenate_file(out, filename: str, expand_headers: bool) -> int: # hundred thousands lines (~300k as of preview3 :-) ) if next_header in concatenated_headers: continue + + # Skip including the auto-generated user config file, + # because it has not been generated yet at this point. + # The code around it should be written so that just not including + # it is equivalent with all-default user configuration. + if next_header == 'catch2/catch_user_config.hpp': + concatenated_headers.add(next_header) + continue + concatenated_headers.add(next_header) concatenated += concatenate_file(out, os.path.join(root_path, next_header), expand_headers) @@ -103,9 +112,9 @@ def generate_cpp(): concatenate_file(cpp, file, False) print('Concatenated {} cpp files'.format(len(cpp_files))) - -generate_header() -generate_cpp() +if __name__ == "__main__": + generate_header() + generate_cpp() # Notes: diff --git a/packages/Catch2/tools/scripts/releaseCommon.py b/packages/Catch2/tools/scripts/releaseCommon.py index 925e80148..20ef1b0cd 100644 --- a/packages/Catch2/tools/scripts/releaseCommon.py +++ b/packages/Catch2/tools/scripts/releaseCommon.py @@ -78,32 +78,12 @@ class Version: 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 '[]' in line: - line = '[]({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') + replacementRegex = re.compile(b'''VERSION (\\d+.\\d+.\\d+) # CML version placeholder, don't delete''') + replacement = '''VERSION {0} # CML version placeholder, don't delete'''.format(version.getVersionString()).encode('ascii') with open(cmakePath, 'wb') as file: for line in lines: file.write(replacementRegex.sub(replacement, line)) @@ -144,23 +124,12 @@ def updateDocumentationVersionPlaceholders(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) + import generateAmalgamatedFiles + generateAmalgamatedFiles.generate_header() + generateAmalgamatedFiles.generate_cpp() - # updateReadmeFile(version) updateCmakeFile(version) updateDocumentationVersionPlaceholders(version) diff --git a/packages/Catch2/tools/scripts/releaseNotes.py b/packages/Catch2/tools/scripts/releaseNotes.py deleted file mode 100755 index 7f580e983..000000000 --- a/packages/Catch2/tools/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/packages/Catch2/tools/scripts/updateWandbox.py b/packages/Catch2/tools/scripts/updateWandbox.py deleted file mode 100644 index 3668da52a..000000000 --- a/packages/Catch2/tools/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/tests/mpi_test_main.cpp b/tests/mpi_test_main.cpp index 10314a4dc..f2a2fe63a 100644 --- a/tests/mpi_test_main.cpp +++ b/tests/mpi_test_main.cpp @@ -57,13 +57,28 @@ main(int argc, char* argv[]) parallel_output /= output_base_name + stringify(parallel::rank()); Catch::ConfigData data{session.configData()}; - data.outputFilename = parallel_output.string(); + data.defaultOutputFilename = parallel_output.string(); session.useConfigData(data); } std::cout << "Using " << nb_threads << " threads per process [" << nb_threads << "x" << parallel::Messenger::getInstance().size() << "]\n"; + if (parallel::rank() == 0) { + if (parallel::size() > 1) { + std::cout << rang::fgB::green << "Other rank outputs are stored in corresponding files" << rang::style::reset + << '\n'; + + for (size_t i_rank = 1; i_rank < parallel::size(); ++i_rank) { + std::filesystem::path parallel_output = std::filesystem::path{PUGS_BINARY_DIR}.append("tests"); + parallel_output /= output_base_name + stringify(i_rank); + std::cout << " - " << rang::fg::green << parallel_output.parent_path().string() + << parallel_output.preferred_separator << rang::style::reset << rang::fgB::green + << parallel_output.filename().string() << rang::style::reset << '\n'; + } + } + } + // Disable outputs from tested classes to the standard output std::cout.setstate(std::ios::badbit); @@ -76,21 +91,6 @@ main(int argc, char* argv[]) MeshDataBaseForTests::create(); - if (parallel::rank() == 0) { - if (parallel::size() > 1) { - session.config().stream() << rang::fgB::green << "Other rank outputs are stored in corresponding files" - << rang::style::reset << '\n'; - - for (size_t i_rank = 1; i_rank < parallel::size(); ++i_rank) { - std::filesystem::path parallel_output = std::filesystem::path{PUGS_BINARY_DIR}.append("tests"); - parallel_output /= output_base_name + stringify(i_rank); - session.config().stream() << " - " << rang::fg::green << parallel_output.parent_path().string() - << parallel_output.preferred_separator << rang::style::reset << rang::fgB::green - << parallel_output.filename().string() << rang::style::reset << '\n'; - } - } - } - OperatorRepository::create(); result = session.run(); -- GitLab