From d10e19d8277c11520d02722976b353b8ccbcdee8 Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Tue, 25 Feb 2025 01:24:15 +0100 Subject: [PATCH] git subrepo pull packages/Catch2 subrepo: subdir: "packages/Catch2" merged: "914aeecfe" upstream: origin: "git@github.com:catchorg/Catch2.git" branch: "devel" commit: "914aeecfe" git-subrepo: version: "0.4.9" origin: "git@github.com:ingydotnet/git-subrepo.git" commit: "30db3b8" --- packages/Catch2/.bazelrc | 3 + packages/Catch2/.clang-tidy | 82 ++ .../Catch2/.conan/test_package/CMakeLists.txt | 16 +- .../Catch2/.conan/test_package/conanfile.py | 32 +- .../.github/workflows/linux-other-builds.yml | 49 + .../.github/workflows/mac-builds-m1.yml | 44 + .../Catch2/.github/workflows/mac-builds.yml | 15 +- .../workflows/package-manager-builds.yaml | 31 + packages/Catch2/.gitignore | 3 + packages/Catch2/.gitrepo | 6 +- packages/Catch2/BUILD.bazel | 2 + .../Catch2/CMake/CatchConfigOptions.cmake | 1 + .../Catch2/CMake/CatchMiscFunctions.cmake | 1 + packages/Catch2/CMakeLists.txt | 25 +- packages/Catch2/MODULE.bazel | 3 +- packages/Catch2/WORKSPACE.bazel | 16 - packages/Catch2/appveyor.yml | 15 +- packages/Catch2/conanfile.py | 131 +- packages/Catch2/docs/assertions.md | 2 +- packages/Catch2/docs/cmake-integration.md | 39 +- packages/Catch2/docs/command-line.md | 9 +- packages/Catch2/docs/configuration.md | 9 + packages/Catch2/docs/contributing.md | 3 +- packages/Catch2/docs/deprecations.md | 13 + packages/Catch2/docs/generators.md | 26 +- packages/Catch2/docs/limitations.md | 16 + packages/Catch2/docs/list-of-examples.md | 1 + packages/Catch2/docs/logging.md | 4 + packages/Catch2/docs/matchers.md | 36 +- packages/Catch2/docs/other-macros.md | 24 - packages/Catch2/docs/release-notes.md | 144 +++ packages/Catch2/docs/reporters.md | 2 +- .../Catch2/docs/test-cases-and-sections.md | 2 +- packages/Catch2/docs/test-fixtures.md | 137 +- packages/Catch2/docs/tostring.md | 2 +- packages/Catch2/docs/tutorial.md | 2 +- .../examples/111-Fix-PersistentFixture.cpp | 74 ++ .../examples/210-Evt-EventListeners.cpp | 3 +- .../Catch2/examples/231-Cfg-OutputStreams.cpp | 2 +- .../Catch2/examples/232-Cfg-CustomMain.cpp | 2 +- .../Catch2/examples/300-Gen-OwnGenerator.cpp | 2 +- .../examples/301-Gen-MapTypeConversion.cpp | 17 +- packages/Catch2/examples/CMakeLists.txt | 6 +- packages/Catch2/extras/Catch.cmake | 62 +- packages/Catch2/extras/CatchAddTests.cmake | 111 +- .../Catch2/extras/ParseAndAddCatchTests.cmake | 2 +- packages/Catch2/extras/catch_amalgamated.cpp | 968 +++++++++----- packages/Catch2/extras/catch_amalgamated.hpp | 1120 +++++++++++------ packages/Catch2/meson.build | 2 +- packages/Catch2/meson_options.txt | 1 + packages/Catch2/src/CMakeLists.txt | 50 +- .../src/catch2/benchmark/catch_benchmark.hpp | 4 +- .../catch_outlier_classification.hpp | 2 +- .../catch2/benchmark/detail/catch_analyse.cpp | 4 +- .../detail/catch_benchmark_function.cpp | 6 + .../detail/catch_benchmark_function.hpp | 25 +- .../benchmark/detail/catch_estimate_clock.hpp | 12 +- .../catch2/benchmark/detail/catch_measure.hpp | 2 +- .../catch2/benchmark/detail/catch_stats.cpp | 11 +- packages/Catch2/src/catch2/catch_all.hpp | 2 +- packages/Catch2/src/catch2/catch_approx.cpp | 2 +- .../src/catch2/catch_assertion_result.cpp | 2 +- .../{internal => }/catch_case_sensitive.hpp | 0 packages/Catch2/src/catch2/catch_config.cpp | 12 +- packages/Catch2/src/catch2/catch_message.cpp | 2 + packages/Catch2/src/catch2/catch_message.hpp | 2 +- .../Catch2/src/catch2/catch_registry_hub.cpp | 1 - packages/Catch2/src/catch2/catch_session.cpp | 36 +- .../src/catch2/catch_test_case_info.cpp | 20 +- .../src/catch2/catch_test_case_info.hpp | 16 +- .../Catch2/src/catch2/catch_test_macros.hpp | 4 + packages/Catch2/src/catch2/catch_timer.cpp | 4 +- packages/Catch2/src/catch2/catch_tostring.cpp | 19 +- packages/Catch2/src/catch2/catch_tostring.hpp | 10 +- .../src/catch2/catch_translate_exception.hpp | 2 +- .../src/catch2/catch_user_config.hpp.in | 9 + packages/Catch2/src/catch2/catch_version.cpp | 2 +- .../src/catch2/catch_version_macros.hpp | 4 +- .../generators/catch_generators_range.hpp | 2 +- .../interfaces/catch_interfaces_capture.hpp | 3 +- .../catch_interfaces_test_invoker.hpp | 2 + .../internal/catch_assertion_handler.cpp | 4 +- .../internal/catch_assertion_handler.hpp | 4 +- .../src/catch2/internal/catch_clara.cpp | 2 +- .../src/catch2/internal/catch_commandline.cpp | 2 +- .../internal/catch_compiler_capabilities.hpp | 78 +- .../catch2/internal/catch_console_colour.cpp | 14 +- .../src/catch2/internal/catch_context.cpp | 6 - .../src/catch2/internal/catch_context.hpp | 13 +- .../src/catch2/internal/catch_decomposer.cpp | 7 +- .../src/catch2/internal/catch_decomposer.hpp | 211 +++- .../internal/catch_enum_values_registry.hpp | 2 +- .../catch2/internal/catch_is_permutation.hpp | 27 +- .../src/catch2/internal/catch_jsonwriter.cpp | 4 +- .../src/catch2/internal/catch_jsonwriter.hpp | 4 +- .../src/catch2/internal/catch_lazy_expr.hpp | 6 +- .../catch2/internal/catch_output_redirect.cpp | 389 ++++-- .../catch2/internal/catch_output_redirect.hpp | 137 +- .../src/catch2/internal/catch_platform.hpp | 3 + .../internal/catch_random_integer_helpers.hpp | 118 +- .../catch_random_number_generator.cpp | 2 +- .../internal/catch_reporter_spec_parser.cpp | 2 +- .../src/catch2/internal/catch_result_type.cpp | 26 - .../src/catch2/internal/catch_result_type.hpp | 23 +- .../src/catch2/internal/catch_run_context.cpp | 85 +- .../src/catch2/internal/catch_run_context.hpp | 6 +- .../src/catch2/internal/catch_section.hpp | 10 +- .../catch2/internal/catch_string_manip.cpp | 27 +- .../src/catch2/internal/catch_stringref.hpp | 4 +- .../catch_test_case_registry_impl.cpp | 2 + .../catch_test_case_registry_impl.hpp | 2 + .../catch2/internal/catch_test_macro_impl.hpp | 12 +- .../catch2/internal/catch_test_registry.cpp | 4 +- .../catch2/internal/catch_test_registry.hpp | 59 +- .../src/catch2/internal/catch_textflow.cpp | 227 +++- .../src/catch2/internal/catch_textflow.hpp | 131 +- .../catch_uniform_integer_distribution.hpp | 34 +- .../internal/catch_wildcard_pattern.hpp | 2 +- .../src/catch2/internal/catch_xmlwriter.cpp | 24 +- .../src/catch2/internal/catch_xmlwriter.hpp | 19 +- .../catch_matchers_floating_point.cpp | 2 +- .../matchers/catch_matchers_range_equals.hpp | 69 +- .../catch2/matchers/catch_matchers_string.hpp | 4 +- .../matchers/internal/catch_matchers_impl.hpp | 29 +- packages/Catch2/src/catch2/meson.build | 41 +- .../reporters/catch_reporter_console.cpp | 11 +- .../catch_reporter_cumulative_base.cpp | 3 +- .../catch2/reporters/catch_reporter_json.cpp | 4 +- .../catch2/reporters/catch_reporter_junit.cpp | 6 +- .../catch2/reporters/catch_reporter_multi.hpp | 2 +- .../reporters/catch_reporter_sonarqube.cpp | 4 +- .../reporters/catch_reporter_sonarqube.hpp | 4 +- .../reporters/catch_reporter_teamcity.hpp | 4 +- packages/Catch2/tests/BUILD.bazel | 83 ++ packages/Catch2/tests/CMakeLists.txt | 4 +- .../Catch2/tests/ExtraTests/CMakeLists.txt | 18 +- .../tests/ExtraTests/X02-DisabledMacros.cpp | 46 +- .../X22-BenchmarksInCumulativeReporter.cpp | 2 +- .../X29-CustomArgumentsForReporters.cpp | 1 + .../X36-ReportingCrashWithJunitReporter.cpp | 32 + .../tests/ExtraTests/X91-AmalgamatedCatch.cpp | 4 +- .../Baselines/automake.sw.approved.txt | 8 +- .../Baselines/automake.sw.multi.approved.txt | 8 +- .../Baselines/compact.sw.approved.txt | 469 ++++--- .../Baselines/compact.sw.multi.approved.txt | 469 ++++--- .../Baselines/console.std.approved.txt | 50 +- .../Baselines/console.sw.approved.txt | 687 ++++++---- .../Baselines/console.sw.multi.approved.txt | 687 ++++++---- .../SelfTest/Baselines/junit.sw.approved.txt | 220 +++- .../Baselines/junit.sw.multi.approved.txt | 220 +++- .../Baselines/sonarqube.sw.approved.txt | 210 +++- .../Baselines/sonarqube.sw.multi.approved.txt | 210 +++- .../SelfTest/Baselines/tap.sw.approved.txt | 350 +++--- .../Baselines/tap.sw.multi.approved.txt | 350 +++--- .../Baselines/teamcity.sw.approved.txt | 41 +- .../Baselines/teamcity.sw.multi.approved.txt | 41 +- .../SelfTest/Baselines/xml.sw.approved.txt | 756 +++++++---- .../Baselines/xml.sw.multi.approved.txt | 756 +++++++---- .../IntrospectiveTests/Clara.tests.cpp | 15 + .../IntrospectiveTests/Details.tests.cpp | 4 +- .../GeneratorsImpl.tests.cpp | 1 - .../IntrospectiveTests/Integer.tests.cpp | 74 ++ .../InternalBenchmark.tests.cpp | 2 +- .../RandomNumberGeneration.tests.cpp | 23 +- .../IntrospectiveTests/Reporters.tests.cpp | 2 +- .../IntrospectiveTests/StringManip.tests.cpp | 11 + .../IntrospectiveTests/TestSpec.tests.cpp | 2 +- .../IntrospectiveTests/TextFlow.tests.cpp | 202 ++- .../IntrospectiveTests/ToString.tests.cpp | 23 + .../tests/SelfTest/TestRegistrations.cpp | 1 - .../SelfTest/UsageTests/Benchmark.tests.cpp | 14 +- .../tests/SelfTest/UsageTests/Class.tests.cpp | 28 +- .../SelfTest/UsageTests/Compilation.tests.cpp | 174 ++- .../UsageTests/EnumToString.tests.cpp | 4 +- .../SelfTest/UsageTests/Exception.tests.cpp | 4 +- .../SelfTest/UsageTests/Matchers.tests.cpp | 14 +- .../UsageTests/MatchersRanges.tests.cpp | 19 + .../SelfTest/UsageTests/Message.tests.cpp | 10 +- .../tests/SelfTest/UsageTests/Misc.tests.cpp | 17 +- .../UsageTests/ToStringGeneral.tests.cpp | 33 +- .../UsageTests/ToStringTuple.tests.cpp | 8 +- .../SelfTest/UsageTests/Tricky.tests.cpp | 4 +- .../helpers/type_with_lit_0_comparisons.hpp | 29 +- .../TestScripts/DiscoverTests/CMakeLists.txt | 19 +- .../DiscoverTests/VerifyRegistration.py | 88 +- .../DiscoverTests/register-tests.cpp | 7 + .../tests/TestScripts/testBazelReporter.py | 2 +- .../testConfigureDefaultReporter.py | 19 +- packages/Catch2/tools/misc/CMakeLists.txt | 2 +- .../tools/misc/appveyorTestRunScript.bat | 2 +- .../Catch2/tools/scripts/buildAndTest.cmd | 3 +- packages/Catch2/tools/scripts/buildAndTest.sh | 3 +- .../Catch2/tools/scripts/releaseCommon.py | 2 +- 193 files changed, 8552 insertions(+), 3540 deletions(-) create mode 100644 packages/Catch2/.clang-tidy create mode 100644 packages/Catch2/.github/workflows/mac-builds-m1.yml create mode 100644 packages/Catch2/.github/workflows/package-manager-builds.yaml delete mode 100644 packages/Catch2/WORKSPACE.bazel mode change 100644 => 100755 packages/Catch2/conanfile.py create mode 100644 packages/Catch2/examples/111-Fix-PersistentFixture.cpp rename packages/Catch2/src/catch2/{internal => }/catch_case_sensitive.hpp (100%) delete mode 100644 packages/Catch2/src/catch2/internal/catch_result_type.cpp create mode 100644 packages/Catch2/tests/BUILD.bazel create mode 100644 packages/Catch2/tests/ExtraTests/X36-ReportingCrashWithJunitReporter.cpp diff --git a/packages/Catch2/.bazelrc b/packages/Catch2/.bazelrc index 9cb0aa1b8..6084470ee 100644 --- a/packages/Catch2/.bazelrc +++ b/packages/Catch2/.bazelrc @@ -1,3 +1,6 @@ +# Enable Bzlmod for every Bazel command +common --enable_bzlmod + build --enable_platform_specific_config build:gcc9 --cxxopt=-std=c++2a diff --git a/packages/Catch2/.clang-tidy b/packages/Catch2/.clang-tidy new file mode 100644 index 000000000..3488457a9 --- /dev/null +++ b/packages/Catch2/.clang-tidy @@ -0,0 +1,82 @@ +--- +# Note: Alas, `Checks` is a string, not an array. +# Comments in the block string are not parsed and are passed in the value. +# They must thus be delimited by ',' from either side - then they are +# harmless. It's terrible, but it works. +Checks: >- + clang-diagnostic-*, + clang-analyzer-*, + -clang-analyzer-optin.core.EnumCastOutOfRange, + + bugprone-*, + -bugprone-unchecked-optional-access, + ,# This is ridiculous, as it triggers on constants, + -bugprone-implicit-widening-of-multiplication-result, + -bugprone-easily-swappable-parameters, + ,# Is not really useful, has false positives, triggers for no-noexcept move constructors ..., + -bugprone-exception-escape, + -bugprone-narrowing-conversions, + -bugprone-chained-comparison,# RIP decomposers, + + modernize-*, + -modernize-avoid-c-arrays, + -modernize-use-auto, + -modernize-use-emplace, + -modernize-use-nullptr,# it went crazy with three-way comparison operators, + -modernize-use-trailing-return-type, + -modernize-return-braced-init-list, + -modernize-concat-nested-namespaces, + -modernize-use-nodiscard, + -modernize-use-default-member-init, + -modernize-type-traits,# we need to support C++14, + -modernize-deprecated-headers, + ,# There's a lot of these and most of them are probably not useful, + -modernize-pass-by-value, + + performance-*, + performance-enum-size, + + portability-*, + + readability-*, + -readability-braces-around-statements, + -readability-container-size-empty, + -readability-convert-member-functions-to-static, + -readability-else-after-return, + -readability-function-cognitive-complexity, + -readability-function-size, + -readability-identifier-length, + -readability-implicit-bool-conversion, + -readability-isolate-declaration, + -readability-magic-numbers, + -readability-math-missing-parentheses, #no, 'a + B * C' obeying math rules is not confusing, + -readability-named-parameter, + -readability-qualified-auto, + -readability-redundant-access-specifiers, + -readability-simplify-boolean-expr, + -readability-static-definition-in-anonymous-namespace, + -readability-uppercase-literal-suffix, + -readability-use-anyofallof, + -readability-avoid-return-with-void-value, + + ,# time hogs, + -bugprone-throw-keyword-missing, + -modernize-replace-auto-ptr, + -readability-identifier-naming, + + ,# We cannot use this until clang-tidy supports custom unique_ptr, + -bugprone-use-after-move, + ,# Doesn't recognize unevaluated context in CATCH_MOVE and CATCH_FORWARD, + -bugprone-macro-repeated-side-effects, +WarningsAsErrors: >- + clang-analyzer-core.*, + clang-analyzer-cplusplus.*, + clang-analyzer-security.*, + clang-analyzer-unix.*, + performance-move-const-arg, + performance-unnecessary-value-param, + readability-duplicate-include, +HeaderFilterRegex: '.*\.(c|cxx|cpp)$' +FormatStyle: none +CheckOptions: {} +... diff --git a/packages/Catch2/.conan/test_package/CMakeLists.txt b/packages/Catch2/.conan/test_package/CMakeLists.txt index 6ee069c01..f067457f7 100644 --- a/packages/Catch2/.conan/test_package/CMakeLists.txt +++ b/packages/Catch2/.conan/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.2.0) -project(test_package CXX) +cmake_minimum_required(VERSION 3.16) +project(PackageTest CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(Catch2 CONFIG REQUIRED) -find_package(Catch2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) - -target_link_libraries(${PROJECT_NAME} Catch2::Catch2WithMain) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package Catch2::Catch2WithMain) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/packages/Catch2/.conan/test_package/conanfile.py b/packages/Catch2/.conan/test_package/conanfile.py index 069ace61e..dc0387643 100644 --- a/packages/Catch2/.conan/test_package/conanfile.py +++ b/packages/Catch2/.conan/test_package/conanfile.py @@ -1,12 +1,28 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from conans import ConanFile, CMake +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run +from conan.tools.files import save, load import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package_multi", "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + save(self, os.path.join(self.build_folder, "package_folder"), + self.dependencies[self.tested_reference_str].package_folder) + save(self, os.path.join(self.build_folder, "license"), + self.dependencies[self.tested_reference_str].license) def build(self): cmake = CMake(self) @@ -14,7 +30,11 @@ class TestPackageConan(ConanFile): cmake.build() def test(self): - assert os.path.isfile(os.path.join( - self.deps_cpp_info["catch2"].rootpath, "licenses", "LICENSE.txt")) - bin_path = os.path.join("bin", "test_package") - self.run("%s -s" % bin_path, run_environment=True) + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") + + package_folder = load(self, os.path.join(self.build_folder, "package_folder")) + license = load(self, os.path.join(self.build_folder, "license")) + assert os.path.isfile(os.path.join(package_folder, "licenses", "LICENSE.txt")) + assert license == 'BSL-1.0' diff --git a/packages/Catch2/.github/workflows/linux-other-builds.yml b/packages/Catch2/.github/workflows/linux-other-builds.yml index 9afd231af..6993c8159 100644 --- a/packages/Catch2/.github/workflows/linux-other-builds.yml +++ b/packages/Catch2/.github/workflows/linux-other-builds.yml @@ -103,3 +103,52 @@ jobs: CTEST_OUTPUT_ON_FAILURE: 1 working-directory: ${{runner.workspace}}/build run: ctest -C ${{matrix.build_type}} -j `nproc` ${{matrix.other_ctest_args}} + clang-tidy: + name: clang-tidy ${{matrix.version}}, ${{matrix.build_description}}, C++${{matrix.std}} ${{matrix.build_type}} + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - version: "15" + build_description: all + build_type: Debug + std: 17 + other_pkgs: '' + cmake_configurations: -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON + steps: + - uses: actions/checkout@v4 + + - name: Prepare environment + run: | + sudo apt-get update + sudo apt-get install -y ninja-build clang-${{matrix.version}} clang-tidy-${{matrix.version}} ${{matrix.other_pkgs}} + + - name: Configure build + working-directory: ${{runner.workspace}} + env: + CXX: clang++-${{matrix.version}} + CXXFLAGS: ${{matrix.cxxflags}} + # Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}. + # This is important + run: | + clangtidy="clang-tidy-${{matrix.version}};-use-color" + # Use a dummy compiler/linker/ar/ranlib to effectively disable the + # compilation and only run clang-tidy. + cmake -Bbuild -H$GITHUB_WORKSPACE \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCATCH_DEVELOPMENT_BUILD=ON \ + -DCMAKE_CXX_CLANG_TIDY="$clangtidy" \ + -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/true \ + -DCMAKE_AR=/usr/bin/true \ + -DCMAKE_CXX_COMPILER_AR=/usr/bin/true \ + -DCMAKE_RANLIB=/usr/bin/true \ + -DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \ + ${{matrix.cmake_configurations}} \ + -G Ninja + + - name: Run clang-tidy + working-directory: ${{runner.workspace}}/build + run: ninja diff --git a/packages/Catch2/.github/workflows/mac-builds-m1.yml b/packages/Catch2/.github/workflows/mac-builds-m1.yml new file mode 100644 index 000000000..45629cdc7 --- /dev/null +++ b/packages/Catch2/.github/workflows/mac-builds-m1.yml @@ -0,0 +1,44 @@ +name: Arm Mac builds + +on: [push, pull_request] + +jobs: + build: + runs-on: macos-14 + strategy: + matrix: + cxx: + - clang++ + build_type: [Debug, Release] + std: [14, 17] + include: + - build_type: Debug + examples: ON + extra_tests: ON + + steps: + - uses: actions/checkout@v4 + + - name: Configure build + working-directory: ${{runner.workspace}} + env: + CXX: ${{matrix.cxx}} + CXXFLAGS: ${{matrix.cxxflags}} + run: | + cmake -Bbuild -H$GITHUB_WORKSPACE \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCATCH_DEVELOPMENT_BUILD=ON \ + -DCATCH_BUILD_EXAMPLES=${{matrix.examples}} \ + -DCATCH_BUILD_EXTRA_TESTS=${{matrix.examples}} + + - name: Build tests + lib + working-directory: ${{runner.workspace}}/build + run: make -j `sysctl -n hw.ncpu` + + - name: Run tests + env: + CTEST_OUTPUT_ON_FAILURE: 1 + working-directory: ${{runner.workspace}}/build + run: ctest -C ${{matrix.build_type}} -j `sysctl -n hw.ncpu` diff --git a/packages/Catch2/.github/workflows/mac-builds.yml b/packages/Catch2/.github/workflows/mac-builds.yml index 259d8b367..fb41f5d21 100644 --- a/packages/Catch2/.github/workflows/mac-builds.yml +++ b/packages/Catch2/.github/workflows/mac-builds.yml @@ -1,18 +1,17 @@ -name: Mac builds +name: Intel Mac builds on: [push, pull_request] jobs: build: - # macos-12 updated to a toolchain that crashes when linking the - # test binary. This seems to be a known bug in that version, - # and will eventually get fixed in an update. After that, we can go - # back to newer macos images. - runs-on: macos-11 + # From macos-14 forward, the baseline "macos-X" image is Arm based, + # and not Intel based. Thus this is the newest image we can use for + # Intel MacOS CI, and there don't seem to be any plans to keep providing + # the Intel based images for free to OSS projects. + runs-on: macos-13 strategy: matrix: cxx: - - g++-11 - clang++ build_type: [Debug, Release] std: [14, 17] @@ -29,8 +28,6 @@ jobs: env: CXX: ${{matrix.cxx}} CXXFLAGS: ${{matrix.cxxflags}} - # Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}. - # This is important run: | cmake -Bbuild -H$GITHUB_WORKSPACE \ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ diff --git a/packages/Catch2/.github/workflows/package-manager-builds.yaml b/packages/Catch2/.github/workflows/package-manager-builds.yaml new file mode 100644 index 000000000..6d90d1405 --- /dev/null +++ b/packages/Catch2/.github/workflows/package-manager-builds.yaml @@ -0,0 +1,31 @@ +name: Package Manager Builds + +on: [push, pull_request] + +jobs: + conan_builds: + name: Conan ${{matrix.conan_version}} + runs-on: ubuntu-20.04 + strategy: + matrix: + conan_version: + - '1.63' + - '2.1' + + include: + # Conan 1 has default profiles installed + - conan_version: '1.63' + profile_generate: 'false' + + steps: + - uses: actions/checkout@v4 + + - name: Install conan + run: pip install conan==${{matrix.conan_version}} + + - name: Setup conan profiles + if: matrix.profile_generate != 'false' + run: conan profile detect + + - name: Run conan package create + run: conan create . -tf .conan/test_package diff --git a/packages/Catch2/.gitignore b/packages/Catch2/.gitignore index 27f6bc0b3..dbf9f40a9 100644 --- a/packages/Catch2/.gitignore +++ b/packages/Catch2/.gitignore @@ -25,7 +25,9 @@ Build cmake-build-* benchmark-dir .conan/test_package/build +**/CMakeUserPresets.json bazel-* +MODULE.bazel.lock build-fuzzers debug-build .vscode @@ -35,3 +37,4 @@ msvc-sln* docs/doxygen *.cache compile_commands.json +**/*.unapproved.txt diff --git a/packages/Catch2/.gitrepo b/packages/Catch2/.gitrepo index c3d079d0b..0cb12a1db 100644 --- a/packages/Catch2/.gitrepo +++ b/packages/Catch2/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = git@github.com:catchorg/Catch2.git branch = devel - commit = 1078e7e95b3a06d4dadc75188de48bc4afffb955 - parent = a3b573d7e88e70c258be089529fd58ad41a10a64 + commit = 914aeecfe23b1e16af6ea675a4fb5dbd5a5b8d0a + parent = 06d850298c1d3715386008535133437283563c5c method = merge - cmdver = 0.4.6 + cmdver = 0.4.9 diff --git a/packages/Catch2/BUILD.bazel b/packages/Catch2/BUILD.bazel index c51bf57e7..d96c7fa78 100644 --- a/packages/Catch2/BUILD.bazel +++ b/packages/Catch2/BUILD.bazel @@ -56,6 +56,8 @@ expand_template( "#cmakedefine CATCH_CONFIG_WCHAR": "", "#cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG": "", "#cmakedefine CATCH_CONFIG_WINDOWS_SEH": "", + "#cmakedefine CATCH_CONFIG_USE_BUILTIN_CONSTANT_P": "", + "#cmakedefine CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P": "", }, template = "src/catch2/catch_user_config.hpp.in", ) diff --git a/packages/Catch2/CMake/CatchConfigOptions.cmake b/packages/Catch2/CMake/CatchConfigOptions.cmake index 6eae220df..a2f2870bb 100644 --- a/packages/Catch2/CMake/CatchConfigOptions.cmake +++ b/packages/Catch2/CMake/CatchConfigOptions.cmake @@ -44,6 +44,7 @@ set(_OverridableOptions "WINDOWS_SEH" "GETENV" "EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT" + "USE_BUILTIN_CONSTANT_P" ) foreach(OptionName ${_OverridableOptions}) diff --git a/packages/Catch2/CMake/CatchMiscFunctions.cmake b/packages/Catch2/CMake/CatchMiscFunctions.cmake index 84bd7cc79..05bc83c02 100644 --- a/packages/Catch2/CMake/CatchMiscFunctions.cmake +++ b/packages/Catch2/CMake/CatchMiscFunctions.cmake @@ -68,6 +68,7 @@ function(add_warnings_to_targets targets) "-Wmissing-noreturn" "-Wmissing-prototypes" "-Wmissing-variable-declarations" + "-Wnon-virtual-dtor" "-Wnull-dereference" "-Wold-style-cast" "-Woverloaded-virtual" diff --git a/packages/Catch2/CMakeLists.txt b/packages/Catch2/CMakeLists.txt index 78ac4c8ad..9d7652129 100644 --- a/packages/Catch2/CMakeLists.txt +++ b/packages/Catch2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) # detect if Catch is being bundled, # disable testsuite in that case @@ -8,6 +8,8 @@ else() set(NOT_SUBPROJECT OFF) endif() +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + option(CATCH_INSTALL_DOCS "Install documentation 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) @@ -33,15 +35,12 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) endif() project(Catch2 - VERSION 3.5.2 # CML version placeholder, don't delete + VERSION 3.8.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" + HOMEPAGE_URL "https://github.com/catchorg/Catch2" DESCRIPTION "A modern, C++-native, unit test framework." ) - # 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 @@ -76,8 +75,6 @@ endif() set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(SOURCES_DIR ${CATCH_DIR}/src/catch2) set(SELF_TEST_DIR ${CATCH_DIR}/tests/SelfTest) -set(BENCHMARK_DIR ${CATCH_DIR}/tests/Benchmark) -set(EXAMPLES_DIR ${CATCH_DIR}/examples) # We need to bring-in the variables defined there to this scope add_subdirectory(src) @@ -88,18 +85,22 @@ if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT) if (NOT PYTHONINTERP_FOUND) message(FATAL_ERROR "Python not found, but required for tests") endif() + set(CMAKE_FOLDER "tests") add_subdirectory(tests) endif() if(CATCH_BUILD_EXAMPLES) + set(CMAKE_FOLDER "Examples") add_subdirectory(examples) endif() if(CATCH_BUILD_EXTRA_TESTS) + set(CMAKE_FOLDER "tests/ExtraTests") add_subdirectory(tests/ExtraTests) endif() if(CATCH_BUILD_FUZZERS) + set(CMAKE_FOLDER "fuzzing") add_subdirectory(fuzzing) endif() @@ -189,15 +190,9 @@ if (NOT_SUBPROJECT) ${PKGCONFIG_INSTALL_DIR} ) - # CPack/CMake started taking the package version from project version 3.12 - # So we need to set the version manually for older CMake versions - if(${CMAKE_VERSION} VERSION_LESS "3.12.0") - set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) - endif() - set(CPACK_PACKAGE_CONTACT "https://github.com/catchorg/Catch2/") include( CPack ) -endif(NOT_SUBPROJECT) +endif() diff --git a/packages/Catch2/MODULE.bazel b/packages/Catch2/MODULE.bazel index a7846cd60..628d77a03 100644 --- a/packages/Catch2/MODULE.bazel +++ b/packages/Catch2/MODULE.bazel @@ -1,3 +1,4 @@ module(name = "catch2") -bazel_dep(name = "bazel_skylib", version = "1.5.0") +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "rules_cc", version = "0.0.17") diff --git a/packages/Catch2/WORKSPACE.bazel b/packages/Catch2/WORKSPACE.bazel deleted file mode 100644 index 357e6f944..000000000 --- a/packages/Catch2/WORKSPACE.bazel +++ /dev/null @@ -1,16 +0,0 @@ -workspace(name = "catch2") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "bazel_skylib", - sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", - ], -) - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() diff --git a/packages/Catch2/appveyor.yml b/packages/Catch2/appveyor.yml index 7a0ad83ff..ba4556ea6 100644 --- a/packages/Catch2/appveyor.yml +++ b/packages/Catch2/appveyor.yml @@ -5,10 +5,10 @@ version: "{build}-{branch}" clone_depth: 20 # We want to build everything, except for branches that are explicitly -# for messing around with travis. +# for messing around with Github Actions. branches: except: - - /dev-travis.+/ + - /devel-gha.+/ # We need a more up to date pip because Python 2.7 is EOL soon @@ -70,3 +70,14 @@ environment: additional_flags: "/permissive- /std:c++latest" platform: x64 configuration: Debug + + - FLAVOR: VS 2017 x64 Debug + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + platform: x64 + configuration: Debug + + - FLAVOR: VS 2017 x64 Release Coverage + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + coverage: 1 + platform: x64 + configuration: Debug diff --git a/packages/Catch2/conanfile.py b/packages/Catch2/conanfile.py old mode 100644 new mode 100755 index 7aa27ef59..7a3ac7c37 --- a/packages/Catch2/conanfile.py +++ b/packages/Catch2/conanfile.py @@ -1,5 +1,14 @@ #!/usr/bin/env python -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os +import re + +required_conan_version = ">=1.53.0" class CatchConan(ConanFile): name = "catch2" @@ -8,53 +17,113 @@ class CatchConan(ConanFile): url = "https://github.com/catchorg/Catch2" homepage = url license = "BSL-1.0" + version = "latest" + settings = "os", "compiler", "build_type", "arch" + extension_properties = {"compatibility_cppstd": False} - exports = "LICENSE.txt" - exports_sources = ("src/*", "CMakeLists.txt", "CMake/*", "extras/*") + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - settings = "os", "compiler", "build_type", "arch" + @property + def _min_cppstd(self): + return "14" - generators = "cmake" + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "msvc": "191", + "clang": "5", + "apple-clang": "10", + } - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTING"] = "OFF" - cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF" - cmake.definitions["CATCH_INSTALL_EXTRAS"] = "ON" - cmake.configure(build_folder="build") - return cmake + + def set_version(self): + pattern = re.compile(r"\w*VERSION (\d+\.\d+\.\d+) # CML version placeholder, don't delete") + with open("CMakeLists.txt") as file: + for line in file: + result = pattern.search(line) + if result: + self.version = result.group(1) + + self.output.info(f'Using version: {self.version}') + + def export(self): + copy(self, "LICENSE.txt", src=self.recipe_folder, dst=self.export_folder) + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "src/*", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "extras/*", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "CMake/*", src=self.recipe_folder, dst=self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + # INFO: Conan 1.x does not specify cppstd by default, so we need to check the compiler version instead. + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler doesn't support") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["CATCH_INSTALL_DOCS"] = False + tc.cache_variables["CATCH_INSTALL_EXTRAS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - # We need this workaround until the toolchains feature - # to inject stuff like MD/MT - line_to_replace = 'list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")' - tools.replace_in_file("CMakeLists.txt", line_to_replace, - '''{} -include("{}/conanbuildinfo.cmake") -conan_basic_setup()'''.format(line_to_replace, self.install_folder.replace("\\", "/"))) - - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", src=str(self.recipe_folder), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "*.cmake", src=os.path.join(self.export_sources_folder, "extras"), + dst=os.path.join(self.package_folder, "lib", "cmake", "Catch2")) 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" + self.cpp_info.set_property("cmake_file_name", "Catch2") + self.cpp_info.set_property("cmake_target_name", "Catch2::Catch2WithMain") + self.cpp_info.set_property("pkg_config_name", "catch2-with-main") + # 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"].set_property("cmake_file_name", "Catch2::Catch2") + self.cpp_info.components["catch2base"].set_property("cmake_target_name", "Catch2::Catch2") + self.cpp_info.components["catch2base"].set_property("pkg_config_name", "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"].set_property("cmake_file_name", "Catch2::Catch2WithMain") + self.cpp_info.components["catch2main"].set_property("cmake_target_name", "Catch2::Catch2WithMain") + self.cpp_info.components["catch2main"].set_property("pkg_config_name", "catch2-with-main") self.cpp_info.components["catch2main"].libs = ["Catch2Main" + lib_suffix] self.cpp_info.components["catch2main"].requires = ["catch2base"] diff --git a/packages/Catch2/docs/assertions.md b/packages/Catch2/docs/assertions.md index 40faa5ebc..f3dcdd484 100644 --- a/packages/Catch2/docs/assertions.md +++ b/packages/Catch2/docs/assertions.md @@ -110,7 +110,7 @@ Expects that an exception is thrown that, when converted to a string, matches th e.g. ```cpp -REQUIRE_THROWS_WITH( openThePodBayDoors(), Contains( "afraid" ) && Contains( "can't do that" ) ); +REQUIRE_THROWS_WITH( openThePodBayDoors(), ContainsSubstring( "afraid" ) && ContainsSubstring( "can't do that" ) ); REQUIRE_THROWS_WITH( dismantleHal(), "My mind is going" ); ``` diff --git a/packages/Catch2/docs/cmake-integration.md b/packages/Catch2/docs/cmake-integration.md index 86666efe2..cfb9853da 100644 --- a/packages/Catch2/docs/cmake-integration.md +++ b/packages/Catch2/docs/cmake-integration.md @@ -8,6 +8,7 @@ [`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> +[Installing Catch2 from Bazel](#installing-catch2-from-bazel)<br> Because we use CMake to build Catch2, we also provide a couple of integration points for our users. @@ -80,12 +81,11 @@ to your CMake module path. `Catch.cmake` provides function `catch_discover_tests` to get tests from a target. This function works by running the resulting executable with -`--list-test-names-only` flag, and then parsing the output to find all -existing tests. +`--list-test` flag, and then parsing the output to find all existing tests. #### Usage ```cmake -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(baz LANGUAGES CXX VERSION 0.0.1) @@ -127,6 +127,8 @@ catch_discover_tests(target [OUTPUT_PREFIX prefix] [OUTPUT_SUFFIX suffix] [DISCOVERY_MODE <POST_BUILD|PRE_TEST>] + [SKIP_IS_FAILURE] + [ADD_TAGS_AS_LABELS] ) ``` @@ -210,6 +212,15 @@ execution (useful e.g. in cross-compilation environments). calling ``catch_discover_tests``. This provides a mechanism for globally selecting a preferred test discovery behavior. +* `SKIP_IS_FAILURE` + +Skipped tests will be marked as failed instead. + +* `ADD_TAGS_AS_LABELS` + +Add the tags from tests as labels to CTest. + + ### `ParseAndAddCatchTests.cmake` âš This script is [deprecated](https://github.com/catchorg/Catch2/pull/2120) @@ -228,7 +239,7 @@ parsed are *silently ignored*. #### Usage ```cmake -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(baz LANGUAGES CXX VERSION 0.0.1) @@ -384,7 +395,7 @@ install it to the default location, like so: ``` $ git clone https://github.com/catchorg/Catch2.git $ cd Catch2 -$ cmake -Bbuild -H. -DBUILD_TESTING=OFF +$ cmake -B build -S . -DBUILD_TESTING=OFF $ sudo cmake --build build/ --target install ``` @@ -408,6 +419,24 @@ cd vcpkg The catch2 port in vcpkg is kept up to date by microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. +## Installing Catch2 from Bazel + +Catch2 is now a supported module in the Bazel Central Registry. You only need to add one line to your MODULE.bazel file; +please see https://registry.bazel.build/modules/catch2 for the latest supported version. + +You can then add `catch2_main` to each of your C++ test build rules as follows: + +``` +cc_test( + name = "example_test", + srcs = ["example_test.cpp"], + deps = [ + ":example", + "@catch2//:catch2_main", + ], +) +``` + --- [Home](Readme.md#top) diff --git a/packages/Catch2/docs/command-line.md b/packages/Catch2/docs/command-line.md index bb483959d..7e69bf12e 100644 --- a/packages/Catch2/docs/command-line.md +++ b/packages/Catch2/docs/command-line.md @@ -145,7 +145,7 @@ only tests that match the positive filters are included. You can also match test names with special characters by escaping them with a backslash (`"\"`), e.g. a test named `"Do A, then B"` is matched -by "Do A\, then B" test spec. Backslash also escapes itself. +by `"Do A\, then B"` test spec. Backslash also escapes itself. ### Examples @@ -194,7 +194,8 @@ verbose and human-friendly output. 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`. +as many times as you want, e.g. `--reporter xml::out=someFile.xml` or +`--reporter custom::colour-mode=ansi::Xoption=2`. 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 @@ -365,14 +366,14 @@ There are currently two warnings implemented: ## Reporting timings <pre>-d, --durations <yes/no></pre> -When set to ```yes``` Catch will report the duration of each test case, in milliseconds. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not. +When set to ```yes``` Catch will report the duration of each test case, in seconds with millisecond precision. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not. <pre>-D, --min-duration <value></pre> > `--min-duration` was [introduced](https://github.com/catchorg/Catch2/pull/1910) in Catch2 2.13.0 When set, Catch will report the duration of each test case that took more -than <value> seconds, in milliseconds. This option is overridden by both +than <value> seconds, in seconds with millisecond precision. This option is overridden by both `-d yes` and `-d no`, so that either all durations are reported, or none are. diff --git a/packages/Catch2/docs/configuration.md b/packages/Catch2/docs/configuration.md index 8a3ddfab5..f268ba50a 100644 --- a/packages/Catch2/docs/configuration.md +++ b/packages/Catch2/docs/configuration.md @@ -158,11 +158,14 @@ by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`. CATCH_CONFIG_ANDROID_LOGWRITE // Use android's logging system for debug output CATCH_CONFIG_GLOBAL_NEXTAFTER // Use nextafter{,f,l} instead of std::nextafter CATCH_CONFIG_GETENV // System has a working `getenv` + CATCH_CONFIG_USE_BUILTIN_CONSTANT_P // Use __builtin_constant_p to trigger warnings > [`CATCH_CONFIG_ANDROID_LOGWRITE`](https://github.com/catchorg/Catch2/issues/1743) and [`CATCH_CONFIG_GLOBAL_NEXTAFTER`](https://github.com/catchorg/Catch2/pull/1739) were introduced in Catch2 2.10.0 > `CATCH_CONFIG_GETENV` was [introduced](https://github.com/catchorg/Catch2/pull/2562) in Catch2 3.2.0 +> `CATCH_CONFIG_USE_BUILTIN_CONSTANT_P` was introduced in Catch2 vX.Y.Z + Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support. `CATCH_CONFIG_POSIX_SIGNALS` is on by default, except when Catch is compiled under `Cygwin`, where it is disabled by default (but can be force-enabled by defining `CATCH_CONFIG_POSIX_SIGNALS`). @@ -183,6 +186,12 @@ With the exception of `CATCH_CONFIG_EXPERIMENTAL_REDIRECT`, these toggles can be disabled by using `_NO_` form of the toggle, e.g. `CATCH_CONFIG_NO_WINDOWS_SEH`. +`CATCH_CONFIG_USE_BUILTIN_CONSTANT_P` is ON by default for Clang and GCC +(but as far as possible, not for other compilers masquerading for these +two). However, it can cause bugs where the enclosed code is evaluated, even +though it should not be, e.g. in [#2925](https://github.com/catchorg/Catch2/issues/2925). + + ### `CATCH_CONFIG_FAST_COMPILE` This compile-time flag speeds up compilation of assertion macros by ~20%, by disabling the generation of assertion-local try-catch blocks for diff --git a/packages/Catch2/docs/contributing.md b/packages/Catch2/docs/contributing.md index d9f87fc1a..d21323d99 100644 --- a/packages/Catch2/docs/contributing.md +++ b/packages/Catch2/docs/contributing.md @@ -107,8 +107,7 @@ cmake -B debug-build -S . -DCMAKE_BUILD_TYPE=Debug --preset all-tests cmake --build debug-build # 4. Run the tests using CTest -cd debug-build -ctest -j 4 --output-on-failure -C Debug +ctest -j 4 --output-on-failure -C Debug --test-dir debug-build ``` <sup><a href='/tools/scripts/buildAndTest.sh#L6-L19' title='File snippet `catch2-build-and-test` was extracted from'>snippet source</a> | <a href='#snippet-catch2-build-and-test' title='Navigate to start of snippet `catch2-build-and-test`'>anchor</a></sup> <!-- endSnippet --> diff --git a/packages/Catch2/docs/deprecations.md b/packages/Catch2/docs/deprecations.md index 1fb79aaa0..0b5bee135 100644 --- a/packages/Catch2/docs/deprecations.md +++ b/packages/Catch2/docs/deprecations.md @@ -35,6 +35,19 @@ being aborted (when using `--abort` or `--abortx`). It is however **NOT** invoked for test cases that are [explicitly skipped using the `SKIP` macro](skipping-passing-failing.md#top). + +### Non-const function for `TEST_CASE_METHOD` + +> Deprecated in Catch2 vX.Y.Z + +Currently, the member function generated for `TEST_CASE_METHOD` is +not `const` qualified. In the future, the generated member function will +be `const` qualified, just as `TEST_CASE_PERSISTENT_FIXTURE` does. + +If you are mutating the fixture instance from within the test case, and +want to keep doing so in the future, mark the mutated members as `mutable`. + + --- [Home](Readme.md#top) diff --git a/packages/Catch2/docs/generators.md b/packages/Catch2/docs/generators.md index 8bca54c75..eb1a255a6 100644 --- a/packages/Catch2/docs/generators.md +++ b/packages/Catch2/docs/generators.md @@ -206,12 +206,26 @@ or OO ranges. Unlike `std::uniform_int_distribution`, Catch2's generators also support various single-byte integral types, such as `char` or `bool`. -Given the same seed, the output from the integral generators is -reproducible across different platforms. For floating point generators, -we only promise reproducibility on platforms that obey the IEEE 754 -standard, and where `float` is 4 bytes and `double` is 8 bytes. We provide -no guarantees for `long double`, as the internals of `long double` can -vary wildly across different platforms. + +#### Reproducibility + +Given the same seed, the output from the integral generators is fully +reproducible across different platforms. + +For floating point generators, the situation is much more complex. +Generally Catch2 only promises reproducibility (or even just correctness!) +on platforms that obey the IEEE-754 standard. Furthermore, reproducibility +only applies between binaries that perform floating point math in the +same way, e.g. if you compile a binary targetting the x87 FPU and another +one targetting SSE2 for floating point math, their results will vary. +Similarly, binaries compiled with compiler flags that relax the IEEE-754 +adherence, e.g. `-ffast-math`, might provide different results than those +compiled for strict IEEE-754 adherence. + +Finally, we provide zero guarantees on the reproducibility of generating +`long double`s, as the internals of `long double` varies across different +platforms. + ## Generator interface diff --git a/packages/Catch2/docs/limitations.md b/packages/Catch2/docs/limitations.md index 099dd82a5..f5f60ba85 100644 --- a/packages/Catch2/docs/limitations.md +++ b/packages/Catch2/docs/limitations.md @@ -173,3 +173,19 @@ TEST_CASE("b") { If you are seeing a problem like this, i.e. 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. + +### Visual Studio 2022 -- can't compile assertion with the spaceship operator + +[The C++ standard requires that `std::foo_ordering` is only comparable with +a literal 0](https://eel.is/c++draft/cmp#categories.pre-3). There are +multiple strategies a stdlib implementation can take to achieve this, and +MSVC's STL has changed the strategy they use between two releases of VS 2022. + +With the new strategy, `REQUIRE((a <=> b) == 0)` no longer compiles under +MSVC. Note that Catch2 can compile code using MSVC STL's new strategy, +but only when compiled with a C++20 conforming compiler. MSVC is currently +not conformant enough, but `clang-cl` will compile the assertion above +using MSVC STL without problem. + +This change got in with MSVC v19.37](https://godbolt.org/z/KG9obzdvE). + diff --git a/packages/Catch2/docs/list-of-examples.md b/packages/Catch2/docs/list-of-examples.md index a919408ad..40d3f7117 100644 --- a/packages/Catch2/docs/list-of-examples.md +++ b/packages/Catch2/docs/list-of-examples.md @@ -8,6 +8,7 @@ - Assertion: [REQUIRE, CHECK](../examples/030-Asn-Require-Check.cpp) - Fixture: [Sections](../examples/100-Fix-Section.cpp) - Fixture: [Class-based fixtures](../examples/110-Fix-ClassFixture.cpp) +- Fixture: [Persistent fixtures](../examples/111-Fix-PersistentFixture.cpp) - BDD: [SCENARIO, GIVEN, WHEN, THEN](../examples/120-Bdd-ScenarioGivenWhenThen.cpp) - Listener: [Listeners](../examples/210-Evt-EventListeners.cpp) - Configuration: [Provide your own output streams](../examples/231-Cfg-OutputStreams.cpp) diff --git a/packages/Catch2/docs/logging.md b/packages/Catch2/docs/logging.md index dbd4f912a..797093869 100644 --- a/packages/Catch2/docs/logging.md +++ b/packages/Catch2/docs/logging.md @@ -114,6 +114,10 @@ Similar to `INFO`, but messages are not limited to their own scope: They are rem The message is always reported but does not fail the test. +**SUCCEED(** _message expression_ **)** + +The message is reported and the test case succeeds. + **FAIL(** _message expression_ **)** The message is reported and the test case fails. diff --git a/packages/Catch2/docs/matchers.md b/packages/Catch2/docs/matchers.md index d5be1f5a3..4b9445ae6 100644 --- a/packages/Catch2/docs/matchers.md +++ b/packages/Catch2/docs/matchers.md @@ -210,15 +210,36 @@ The other miscellaneous matcher utility is exception matching. #### Matching exceptions -Catch2 provides a utility macro for asserting that an expression -throws exception of specific type, and that the exception has desired -properties. The macro is `REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher)`. +Because exceptions are a bit special, Catch2 has a separate macro for them. + + +The basic form is + +``` +REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher) +``` + +and it checks that the `expr` throws an exception, that exception is derived +from the `ExceptionType` type, and then `Matcher::match` is called on +the caught exception. > `REQUIRE_THROWS_MATCHES` macro lives in `catch2/matchers/catch_matchers.hpp` +For one-off checks you can use the `Predicate` matcher above, e.g. -Catch2 currently provides two matchers for exceptions. -These are: +```cpp +REQUIRE_THROWS_MATCHES(parse(...), + parse_error, + Predicate<parse_error>([] (parse_error const& err) -> bool { return err.line() == 1; }) +); +``` + +but if you intend to thoroughly test your error reporting, I recommend +defining a specialized matcher. + + +Catch2 also provides 2 built-in matchers for checking the error message +inside an exception (it must be derived from `std::exception`): * `Message(std::string message)`. * `MessageMatches(Matcher matcher)`. @@ -236,10 +257,7 @@ REQUIRE_THROWS_MATCHES(throwsDerivedException(), DerivedException, Message("De REQUIRE_THROWS_MATCHES(throwsDerivedException(), DerivedException, MessageMatches(StartsWith("DerivedException"))); ``` -Note that `DerivedException` in the example above has to derive from -`std::exception` for the example to work. - -> the exception message matcher lives in `catch2/matchers/catch_matchers_exception.hpp` +> the exception message matchers live in `catch2/matchers/catch_matchers_exception.hpp` ### Generic range Matchers diff --git a/packages/Catch2/docs/other-macros.md b/packages/Catch2/docs/other-macros.md index 24a0fb6e6..79990a6a5 100644 --- a/packages/Catch2/docs/other-macros.md +++ b/packages/Catch2/docs/other-macros.md @@ -93,30 +93,6 @@ TEST_CASE("STATIC_CHECK showcase", "[traits]") { ## Test case related macros -* `METHOD_AS_TEST_CASE` - -`METHOD_AS_TEST_CASE( member-function-pointer, description )` lets you -register a member function of a class as a Catch2 test case. The class -will be separately instantiated for each method registered in this way. - -```cpp -class TestClass { - std::string s; - -public: - TestClass() - :s( "hello" ) - {} - - void testCase() { - REQUIRE( s == "hello" ); - } -}; - - -METHOD_AS_TEST_CASE( TestClass::testCase, "Use class's method as a test case", "[class]" ) -``` - * `REGISTER_TEST_CASE` `REGISTER_TEST_CASE( function, description )` let's you register diff --git a/packages/Catch2/docs/release-notes.md b/packages/Catch2/docs/release-notes.md index ac78866f6..4fe2789b3 100644 --- a/packages/Catch2/docs/release-notes.md +++ b/packages/Catch2/docs/release-notes.md @@ -2,6 +2,12 @@ # Release notes **Contents**<br> +[3.8.0](#380)<br> +[3.7.1](#371)<br> +[3.7.0](#370)<br> +[3.6.0](#360)<br> +[3.5.4](#354)<br> +[3.5.3](#353)<br> [3.5.2](#352)<br> [3.5.1](#351)<br> [3.5.0](#350)<br> @@ -60,6 +66,144 @@ [Even Older versions](#even-older-versions)<br> +## 3.8.0 + +### Improvements +* Added `std::initializer_list` overloads for `(Unordered)RangeEquals` matcher (#2915, #2919) +* Added explicit casts to silence GCC's `Wconversion` (#2875) +* Made the use of `builtin_constant_p` tricks in assertion macros configurable (#2925) + * It is used to prod GCC-like compilers into providing warnings for the asserted expressions, but the compilers miscompile it annoyingly often. +* Cleaned out Clang-Tidy's `performance-enum-size` warnings +* Added support for using `from_range` generator with iterators with `value_type = const T` (#2926) + * This is not correct `value_type` typedef, but it is used in the wild and the change does not make the code meaningfully worse. + +### Fixes +* Fixed crash when stringifying pre-1970 (epoch) dates on Windows (#2944) + +### Miscellaneous +* Fixes and improvements for `catch_discover_tests` CMake helper + * Removed redundant `CTEST_FILE` param when creating the indirection file for `PRE_TEST` discovery mode (#2936) + * Rewrote the test discovery logic to use output from the JSON reporter + * This means that `catch_discover_tests` now requires CMake 3.19 or newer + * Added `ADD_TAGS_AS_LABELS` option. If specified, each CTest test will be labeled with corrensponding Catch2's test tag +* Bumped up the minimum required CMake version to build Catch2 to 3.16 +* Meson build now provides option to avoid installing Catch2 +* Bazel build is moved to Bzlmod. + + +## 3.7.1 + +### Improvements +* Applied the JUnit reporter's optimization from last release to the SonarQube reporter +* Suppressed `-Wuseless-cast` in `CHECK_THROWS_MATCHES` (#2904) +* Standardize exit codes for various failures + * Running no tests is now guaranteed to exit with 2 (without the `--allow-running-no-tests` flag) + * All tests skipped is now always 4 (...) + * Assertion failures are now always 42 + * and so on + +### Fixes +* Fixed out-of-bounds access when the arg parser encounters single `-` as an argument (#2905) + +### Miscellaneous +* Added `catch_config_prefix_messages.hpp` to meson build (#2903) +* `catch_discover_tests` now supports skipped tests (#2873) + * You can get the old behaviour by calling `catch_discover_tests` with `SKIP_IS_FAILURE` option. + + +## 3.7.0 + +### Improvements +* Slightly improved compile times of benchmarks +* Made the resolution estimation in benchmarks slightly more precise +* Added new test case macro, `TEST_CASE_PERSISTENT_FIXTURE` (#2885, #1602) + * Unlike `TEST_CASE_METHOD`, the same underlying instance is used for all partial runs of that test case +* **MASSIVELY** improved performance of the JUnit reporter when handling successful assertions (#2897) + * For 1 test case and 10M assertions, the new reporter runs 3x faster and uses up only 8 MB of memory, while the old one needs 7 GB of memory. +* Reworked how output redirects works. + * Combining a reporter writing to stdout with capturing reporter no longer leads to the capturing reporter seeing all of the other reporter's output. + * The file based redirect no longer opens up a new temporary file for each partial test case run, so it will not run out of temporary files when running many tests in single process. + +### Miscellaneous +* Better documentation for matchers on thrown exceptions (`REQUIRE_THROWS_MATCHES`) +* Improved `catch_discover_tests`'s handling of environment paths (#2878) + * It won't reorder paths in `DL_PATHS` or `DYLD_FRAMEWORK_PATHS` args + * It won't overwrite the environment paths for test discovery + + +## 3.6.0 + +### Fixes +* Fixed Windows ARM64 build by fixing the preprocessor condition guarding use `_umul128` intrinsic. +* Fixed Windows ARM64EC build by removing intrinsic pragma it does not understand. (#2858) + * Why doesn't the x64-emulation build mode understand x64 pragmas? Don't ask me, ask the MSVC guys. +* Fixed the JUnit reporter sometimes crashing when reporting a fatal error. (#1210, #2855) + * The binary will still exit, but through the original error, rather than secondary error inside the reporter. + * The underlying fix applies to all reporters, not just the JUnit one, but only JUnit was currently causing troubles. + +### Improvements +* Disable `-Wnon-virtual-dtor` in Decomposer and Matchers (#2854) +* `precision` in floating point stringmakers defaults to `max_digits10`. + * This means that floating point values will be printed with enough precision to disambiguate any two floats. +* Column wrapping ignores ansi colour codes when calculating string width (#2833, #2849) + * This makes the output much more readable when the provided messages contain colour codes. + +### Miscellaneous +* Conan support improvements + * `compatibility_cppstr` is set to False. (#2860) + * This means that Conan won't let you mix library and project with different C++ standard settings. + * The implementation library CMake target name through Conan is properly set to `Catch2::Catch2` (#2861) +* `SelfTest` target can be built through Bazel (#2857) + + +## 3.5.4 + +### Fixes +* Fixed potential compilation error when asked to generate random integers whose type did not match `std::(u)int*_t`. + * This manifested itself when generating random `size_t`s on MacOS +* Added missing outlined destructor causing `Wdelete-incomplete` when compiling against libstdc++ in C++23 mode (#2852) +* Fixed regression where decomposing assertion with const instance of `std::foo_ordering` would not compile + +### Improvements +* Reintroduced support for GCC 5 and 6 (#2836) + * As with VS2017, if they start causing trouble again, they will be dropped again. +* Added workaround for targetting newest MacOS (Sonoma) using GCC (#2837, #2839) +* `CATCH_CONFIG_DEFAULT_REPORTER` can now be an arbitrary reporter spec + * Previously it could only be a plain reporter name, so it was impossible to compile in custom arguments to the reporter. +* Improved performance of generating 64bit random integers by 20+% + +### Miscellaneous +* Significantly improved Conan in-tree recipe (#2831) +* `DL_PATHS` in `catch_discover_tests` now supports multiple arguments (#2852, #2736) +* Fixed preprocessor logic for checking whether we expect reproducible floating point results in tests. +* Improved the floating point tests structure to avoid `Wunused` when the reproducibility tests are disabled (#2845) + + +## 3.5.3 + +### Fixes +* Fixed OOB access when computing filename tag (from the `-#` flag) for file without extension (#2798) +* Fixed the linking against `log` on Android to be `PRIVATE` (#2815) +* Fixed `Wuseless-cast` in benchmarking internals (#2823) + +### Improvements +* Restored compatibility with VS2017 (#2792, #2822) + * The baseline for Catch2 is still C++14 with some reasonable workarounds for specific compilers, so if VS2017 starts acting up again, the support will be dropped again. +* Suppressed clang-tidy's `bugprone-chained-comparison` in assertions (#2801) +* Improved the static analysis mode to evaluate arguments to `TEST_CASE` and `SECTION` (#2817) + * Clang-tidy should no longer warn about runtime arguments to these macros being unused in static analysis mode. + * Clang-tidy can warn on issues involved arguments to these macros. +* Added support for literal-zero detectors based on `consteval` constructors + * This is required for compiling `REQUIRE((a <=> b) == 0)` against MSVC's stdlib. + * Sadly, MSVC still cannot compile this assertion as it does not implement C++20 correctly. + * You can use `clang-cl` with MSVC's stdlib instead. + * If for some godforsaken reasons you want to understand this better, read the two relevant commits: [`dc51386b9fd61f99ea9c660d01867e6ad489b403`](https://github.com/catchorg/Catch2/commit/dc51386b9fd61f99ea9c660d01867e6ad489b403), and [`0787132fc82a75e3fb255aa9484ca1dc1eff2a30`](https://github.com/catchorg/Catch2/commit/0787132fc82a75e3fb255aa9484ca1dc1eff2a30). + +### Miscellaneous +* Disabled tests for FP random generator reproducibility on non-SSE2 x86 targets (#2796) +* Modified the in-tree Conan recipe to support Conan 2 (#2805) + + ## 3.5.2 ### Fixes diff --git a/packages/Catch2/docs/reporters.md b/packages/Catch2/docs/reporters.md index e2abfe34d..20ef5e552 100644 --- a/packages/Catch2/docs/reporters.md +++ b/packages/Catch2/docs/reporters.md @@ -5,7 +5,7 @@ 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 +Catch2 comes with a bunch of reporters by default (currently 9), 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. diff --git a/packages/Catch2/docs/test-cases-and-sections.md b/packages/Catch2/docs/test-cases-and-sections.md index 01c898bb6..14db55aee 100644 --- a/packages/Catch2/docs/test-cases-and-sections.md +++ b/packages/Catch2/docs/test-cases-and-sections.md @@ -48,7 +48,7 @@ For more detail on command line selection see [the command line docs](command-li 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. +supported 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 diff --git a/packages/Catch2/docs/test-fixtures.md b/packages/Catch2/docs/test-fixtures.md index 9c9eaa18c..653b50e02 100644 --- a/packages/Catch2/docs/test-fixtures.md +++ b/packages/Catch2/docs/test-fixtures.md @@ -1,9 +1,30 @@ <a id="top"></a> # Test fixtures -## Defining test fixtures +**Contents**<br> +[Non-Templated test fixtures](#non-templated-test-fixtures)<br> +[Templated test fixtures](#templated-test-fixtures)<br> +[Signature-based parameterised test fixtures](#signature-based-parametrised-test-fixtures)<br> +[Template fixtures with types specified in template type lists](#template-fixtures-with-types-specified-in-template-type-lists)<br> -Although Catch allows you to group tests together as [sections within a test case](test-cases-and-sections.md), it can still be convenient, sometimes, to group them using a more traditional test fixture. Catch fully supports this too. You define the test fixture as a simple structure: +## Non-Templated test fixtures + +Although Catch2 allows you to group tests together as +[sections within a test case](test-cases-and-sections.md), it can still +be convenient, sometimes, to group them using a more traditional test. +Catch2 fully supports this too with 3 different macros for +non-templated test fixtures. They are: + +| Macro | Description | +|----------|-------------| +|1. `TEST_CASE_METHOD(className, ...)`| Creates a uniquely named class which inherits from the class specified by `className`. The test function will be a member of this derived class. An instance of the derived class will be created for every partial run of the test case. | +|2. `METHOD_AS_TEST_CASE(member-function, ...)`| Uses `member-function` as the test function. An instance of the class will be created for each partial run of the test case. | +|3. `TEST_CASE_PERSISTENT_FIXTURE(className, ...)`| Creates a uniquely named class which inherits from the class specified by `className`. The test function will be a member of this derived class. An instance of the derived class will be created at the start of the test run. That instance will be destroyed once the entire test case has ended. | + +### 1. `TEST_CASE_METHOD` + + +You define a `TEST_CASE_METHOD` test fixture as a simple structure: ```c++ class UniqueTestsFixture { @@ -30,8 +51,116 @@ class UniqueTestsFixture { } ``` -The two test cases here will create uniquely-named derived classes of UniqueTestsFixture and thus can access the `getID()` protected method and `conn` member variables. This ensures that both the test cases are able to create a DBConnection using the same method (DRY principle) and that any ID's created are unique such that the order that tests are executed does not matter. +The two test cases here will create uniquely-named derived classes of +UniqueTestsFixture and thus can access the `getID()` protected method +and `conn` member variables. This ensures that both the test cases +are able to create a DBConnection using the same method +(DRY principle) and that any ID's created are unique such that the +order that tests are executed does not matter. + +### 2. `METHOD_AS_TEST_CASE` + +`METHOD_AS_TEST_CASE` lets you register a member function of a class +as a Catch2 test case. The class will be separately instantiated +for each method registered in this way. + +```cpp +class TestClass { + std::string s; + +public: + TestClass() + :s( "hello" ) + {} + + void testCase() { + REQUIRE( s == "hello" ); + } +}; + + +METHOD_AS_TEST_CASE( TestClass::testCase, "Use class's method as a test case", "[class]" ) +``` + +This type of fixture is similar to [TEST_CASE_METHOD](#1-test_case_method) except in this +case it will directly use the provided class to create an object rather than a derived +class. + +### 3. `TEST_CASE_PERSISTENT_FIXTURE` + +> [Introduced](https://github.com/catchorg/Catch2/pull/2885) in Catch2 3.7.0 + +`TEST_CASE_PERSISTENT_FIXTURE` behaves in the same way as +[TEST_CASE_METHOD](#1-test_case_method) except that there will only be +one instance created throughout the entire run of a test case. To +demonstrate this have a look at the following example: + +```cpp +class ClassWithExpensiveSetup { +public: + ClassWithExpensiveSetup() { + // expensive construction + std::this_thread::sleep_for( std::chrono::seconds( 2 ) ); + } + + ~ClassWithExpensiveSetup() noexcept { + // expensive destruction + std::this_thread::sleep_for( std::chrono::seconds( 1 ) ); + } + + int getInt() const { return 42; } +}; + +struct MyFixture { + mutable int myInt = 0; + ClassWithExpensiveSetup expensive; +}; + +TEST_CASE_PERSISTENT_FIXTURE( MyFixture, "Tests with MyFixture" ) { + + const int val = myInt++; + + SECTION( "First partial run" ) { + const auto otherValue = expensive.getInt(); + REQUIRE( val == 0 ); + REQUIRE( otherValue == 42 ); + } + + SECTION( "Second partial run" ) { REQUIRE( val == 1 ); } +} +``` + +This example demonstates two possible use-cases of this fixture type: +1. Improve test run times by reducing the amount of expensive and +redundant setup and tear-down required. +2. Reusing results from the previous partial run, in the current +partial run. + +This test case will be executed twice as there are two leaf sections. +On the first run `val` will be `0` and on the second run `val` will be +`1`. This demonstrates that we were able to use the results of the +previous partial run in subsequent partial runs. + +Additionally, we are simulating an expensive object using +`std::this_thread::sleep_for`, but real world use-cases could be: +1. Creating a D3D12/Vulkan device +2. Connecting to a database +3. Loading a file. + +The fixture object (`MyFixture`) will be constructed just before the +test case begins, and it will be destroyed just after the test case +ends. Therefore, this expensive object will only be created and +destroyed once during the execution of this test case. If we had used +`TEST_CASE_METHOD`, `MyFixture` would have been created and destroyed +twice during the execution of this test case. + +NOTE: The member function which runs the test case is `const`. Therefore +if you want to mutate any member of the fixture it must be marked as +`mutable` as shown in this example. This is to make it clear that +the initial state of the fixture is intended to mutate during the +execution of the test case. +## Templated test fixtures Catch2 also provides `TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD` that can be used together @@ -93,7 +222,7 @@ _While there is an upper limit on the number of types you can specify in single `TEMPLATE_TEST_CASE_METHOD` or `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, the limit is very high and should not be encountered in practice._ -## Signature-based parametrised test fixtures +## Signature-based parameterised test fixtures > [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch2 2.8.0. diff --git a/packages/Catch2/docs/tostring.md b/packages/Catch2/docs/tostring.md index b99b67426..513c1b44a 100644 --- a/packages/Catch2/docs/tostring.md +++ b/packages/Catch2/docs/tostring.md @@ -75,7 +75,7 @@ CATCH_TRANSLATE_EXCEPTION( MyType const& ex ) { Enums that already have a `<<` overload for `std::ostream` will convert to strings as expected. If you only need to convert enums to strings for test reporting purposes you can provide a `StringMaker` specialisations as any other type. -However, as a convenience, Catch provides the `REGISTER_ENUM` helper macro that will generate the `StringMaker` specialisation for you with minimal code. +However, as a convenience, Catch provides the `CATCH_REGISTER_ENUM` helper macro that will generate the `StringMaker` specialisation for you with minimal code. Simply provide it the (qualified) enum name, followed by all the enum values, and you're done! E.g. diff --git a/packages/Catch2/docs/tutorial.md b/packages/Catch2/docs/tutorial.md index dfccac888..fb5a5b37c 100644 --- a/packages/Catch2/docs/tutorial.md +++ b/packages/Catch2/docs/tutorial.md @@ -16,7 +16,7 @@ Ideally you should be using Catch2 through its [CMake integration](cmake-integra Catch2 also provides pkg-config files and two file (header + cpp) distribution, but this documentation will assume you are using CMake. If you are using the two file distribution instead, remember to replace -the included header with `catch_amalgamated.hpp`. +the included header with `catch_amalgamated.hpp` ([step by step instructions](migrate-v2-to-v3.md#how-to-migrate-projects-from-v2-to-v3)). ## Writing tests diff --git a/packages/Catch2/examples/111-Fix-PersistentFixture.cpp b/packages/Catch2/examples/111-Fix-PersistentFixture.cpp new file mode 100644 index 000000000..2bef90ff7 --- /dev/null +++ b/packages/Catch2/examples/111-Fix-PersistentFixture.cpp @@ -0,0 +1,74 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +// Fixture.cpp + +// Catch2 has three ways to express fixtures: +// - Sections +// - Traditional class-based fixtures that are created and destroyed on every +// partial run +// - Traditional class-based fixtures that are created at the start of a test +// case and destroyed at the end of a test case (this file) + +// main() provided by linkage to Catch2WithMain + +#include <catch2/catch_test_macros.hpp> + +#include <thread> + +class ClassWithExpensiveSetup { +public: + ClassWithExpensiveSetup() { + // Imagine some really expensive set up here. + // e.g. + // setting up a D3D12/Vulkan Device, + // connecting to a database, + // loading a file + // etc etc etc + std::this_thread::sleep_for( std::chrono::seconds( 2 ) ); + } + + ~ClassWithExpensiveSetup() noexcept { + // We can do any clean up of the expensive class in the destructor + // e.g. + // destroy D3D12/Vulkan Device, + // disconnecting from a database, + // release file handle + // etc etc etc + std::this_thread::sleep_for( std::chrono::seconds( 1 ) ); + } + + int getInt() const { return 42; } +}; + +struct MyFixture { + + // The test case member function is const. + // Therefore we need to mark any member of the fixture + // that needs to mutate as mutable. + mutable int myInt = 0; + ClassWithExpensiveSetup expensive; +}; + +// Only one object of type MyFixture will be instantiated for the run +// of this test case even though there are two leaf sections. +// This is useful if your test case requires an object that is +// expensive to create and could be reused for each partial run of the +// test case. +TEST_CASE_PERSISTENT_FIXTURE( MyFixture, "Tests with MyFixture" ) { + + const int val = myInt++; + + SECTION( "First partial run" ) { + const auto otherValue = expensive.getInt(); + REQUIRE( val == 0 ); + REQUIRE( otherValue == 42 ); + } + + SECTION( "Second partial run" ) { REQUIRE( val == 1 ); } +} \ No newline at end of file diff --git a/packages/Catch2/examples/210-Evt-EventListeners.cpp b/packages/Catch2/examples/210-Evt-EventListeners.cpp index 56b050d41..d05dfaaa5 100644 --- a/packages/Catch2/examples/210-Evt-EventListeners.cpp +++ b/packages/Catch2/examples/210-Evt-EventListeners.cpp @@ -385,8 +385,7 @@ struct MyListener : Catch::EventListenerBase { CATCH_REGISTER_LISTENER( MyListener ) // Get rid of Wweak-tables -MyListener::~MyListener() {} - +MyListener::~MyListener() = default; // ----------------------------------------------------------------------- // 3. Test cases: diff --git a/packages/Catch2/examples/231-Cfg-OutputStreams.cpp b/packages/Catch2/examples/231-Cfg-OutputStreams.cpp index da1713cf8..5aee38bc2 100644 --- a/packages/Catch2/examples/231-Cfg-OutputStreams.cpp +++ b/packages/Catch2/examples/231-Cfg-OutputStreams.cpp @@ -22,7 +22,7 @@ class out_buff : public std::stringbuf { std::FILE* m_stream; public: out_buff(std::FILE* stream):m_stream(stream) {} - ~out_buff(); + ~out_buff() override; int sync() override { int ret = 0; for (unsigned char c : str()) { diff --git a/packages/Catch2/examples/232-Cfg-CustomMain.cpp b/packages/Catch2/examples/232-Cfg-CustomMain.cpp index 69fba7f16..270409937 100644 --- a/packages/Catch2/examples/232-Cfg-CustomMain.cpp +++ b/packages/Catch2/examples/232-Cfg-CustomMain.cpp @@ -35,7 +35,7 @@ int main(int argc, char** argv) { return returnCode; // if set on the command line then 'height' is now set at this point - std::cout << "height: " << height << std::endl; + std::cout << "height: " << height << '\n'; return session.run(); } diff --git a/packages/Catch2/examples/300-Gen-OwnGenerator.cpp b/packages/Catch2/examples/300-Gen-OwnGenerator.cpp index b5d951ac4..9cb02e396 100644 --- a/packages/Catch2/examples/300-Gen-OwnGenerator.cpp +++ b/packages/Catch2/examples/300-Gen-OwnGenerator.cpp @@ -21,7 +21,7 @@ namespace { // This class shows how to implement a simple generator for Catch tests -class RandomIntGenerator : public Catch::Generators::IGenerator<int> { +class RandomIntGenerator final : public Catch::Generators::IGenerator<int> { std::minstd_rand m_rand; std::uniform_int_distribution<> m_dist; int current_number; diff --git a/packages/Catch2/examples/301-Gen-MapTypeConversion.cpp b/packages/Catch2/examples/301-Gen-MapTypeConversion.cpp index a065d87ae..0a2844836 100644 --- a/packages/Catch2/examples/301-Gen-MapTypeConversion.cpp +++ b/packages/Catch2/examples/301-Gen-MapTypeConversion.cpp @@ -24,12 +24,12 @@ namespace { // Returns a line from a stream. You could have it e.g. read lines from // a file, but to avoid problems with paths in examples, we will use // a fixed stringstream. -class LineGenerator : public Catch::Generators::IGenerator<std::string> { +class LineGenerator final : public Catch::Generators::IGenerator<std::string> { std::string m_line; std::stringstream m_stream; public: - LineGenerator() { - m_stream.str("1\n2\n3\n4\n"); + explicit LineGenerator( std::string const& lines ) { + m_stream.str( lines ); if (!next()) { Catch::Generators::Detail::throw_generator_exception("Couldn't read a single line"); } @@ -49,18 +49,19 @@ std::string const& LineGenerator::get() const { // This helper function provides a nicer UX when instantiating the generator // Notice that it returns an instance of GeneratorWrapper<std::string>, which // is a value-wrapper around std::unique_ptr<IGenerator<std::string>>. -Catch::Generators::GeneratorWrapper<std::string> lines(std::string /* ignored for example */) { +Catch::Generators::GeneratorWrapper<std::string> +lines( std::string const& lines ) { return Catch::Generators::GeneratorWrapper<std::string>( - new LineGenerator() - ); + new LineGenerator( lines ) ); } } // end anonymous namespace TEST_CASE("filter can convert types inside the generator expression", "[example][generator]") { - auto num = GENERATE(map<int>([](std::string const& line) { return std::stoi(line); }, - lines("fake-file"))); + auto num = GENERATE( + map<int>( []( std::string const& line ) { return std::stoi( line ); }, + lines( "1\n2\n3\n4\n" ) ) ); REQUIRE(num > 0); } diff --git a/packages/Catch2/examples/CMakeLists.txt b/packages/Catch2/examples/CMakeLists.txt index 82734adab..d45ddfcb6 100644 --- a/packages/Catch2/examples/CMakeLists.txt +++ b/packages/Catch2/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required( VERSION 3.10 ) +cmake_minimum_required( VERSION 3.16 ) project( Catch2Examples LANGUAGES CXX ) @@ -28,6 +28,7 @@ set( SOURCES_IDIOMATIC_EXAMPLES 030-Asn-Require-Check.cpp 100-Fix-Section.cpp 110-Fix-ClassFixture.cpp + 111-Fix-PersistentFixture.cpp 120-Bdd-ScenarioGivenWhenThen.cpp 210-Evt-EventListeners.cpp 232-Cfg-CustomMain.cpp @@ -43,8 +44,7 @@ set( TARGETS_IDIOMATIC_EXAMPLES ${BASENAMES_IDIOMATIC_EXAMPLES} ) foreach( name ${TARGETS_IDIOMATIC_EXAMPLES} ) - add_executable( ${name} - ${EXAMPLES_DIR}/${name}.cpp ) + add_executable( ${name} ${name}.cpp ) endforeach() set(ALL_EXAMPLE_TARGETS diff --git a/packages/Catch2/extras/Catch.cmake b/packages/Catch2/extras/Catch.cmake index 8f30688c5..3d93fe20a 100644 --- a/packages/Catch2/extras/Catch.cmake +++ b/packages/Catch2/extras/Catch.cmake @@ -38,6 +38,8 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``. [OUTPUT_PREFIX prefix] [OUTPUT_SUFFIX suffix] [DISCOVERY_MODE <POST_BUILD|PRE_TEST>] + [SKIP_IS_FAILURE] + [ADD_TAGS_AS_LABELS] ) ``catch_discover_tests`` sets up a post-build command on the test executable @@ -124,7 +126,14 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``. test executable and when the tests are executed themselves. This requires cmake/ctest >= 3.22. - `DISCOVERY_MODE mode`` + ``DL_FRAMEWORK_PATHS path...`` + Specifies paths that need to be set for the dynamic linker to find libraries + packaged as frameworks on Apple platforms when running the test executable + (DYLD_FRAMEWORK_PATH). 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. + + ``DISCOVERY_MODE mode`` Provides control over when ``catch_discover_tests`` performs test discovery. By default, ``POST_BUILD`` sets up a post-build command to perform test discovery at build time. In certain scenarios, like cross-compiling, this ``POST_BUILD`` @@ -137,6 +146,12 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``. calling ``catch_discover_tests``. This provides a mechanism for globally selecting a preferred test discovery behavior without having to modify each call site. + ``SKIP_IS_FAILURE`` + Disables skipped test detection. + + ``ADD_TAGS_AS_LABELS`` + Adds all test tags as CTest labels. + #]=======================================================================] #------------------------------------------------------------------------------ @@ -144,22 +159,27 @@ function(catch_discover_tests TARGET) cmake_parse_arguments( "" - "" + "SKIP_IS_FAILURE;ADD_TAGS_AS_LABELS" "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX;DISCOVERY_MODE" - "TEST_SPEC;EXTRA_ARGS;PROPERTIES;DL_PATHS" + "TEST_SPEC;EXTRA_ARGS;PROPERTIES;DL_PATHS;DL_FRAMEWORK_PATHS" ${ARGN} ) + if (${CMAKE_VERSION} VERSION_LESS "3.19") + message(FATAL_ERROR "This script requires JSON support from CMake version 3.19 or greater.") + endif() + if(NOT _WORKING_DIRECTORY) set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") endif() if(NOT _TEST_LIST) 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() + if(_DL_PATHS AND ${CMAKE_VERSION} VERSION_LESS "3.22.0") + message(FATAL_ERROR "The DL_PATHS option requires at least cmake 3.22") + endif() + if(_DL_FRAMEWORK_PATHS AND ${CMAKE_VERSION} VERSION_LESS "3.22.0") + message(FATAL_ERROR "The DL_FRAMEWORK_PATHS option requires at least cmake 3.22") endif() if(NOT _DISCOVERY_MODE) if(NOT CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE) @@ -184,6 +204,9 @@ function(catch_discover_tests TARGET) TARGET ${TARGET} PROPERTY CROSSCOMPILING_EMULATOR ) + if (NOT _SKIP_IS_FAILURE) + set(_PROPERTIES ${_PROPERTIES} SKIP_RETURN_CODE 4) + endif() if(_DISCOVERY_MODE STREQUAL "POST_BUILD") add_custom_command( @@ -205,7 +228,9 @@ function(catch_discover_tests TARGET) -D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}" -D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}" -D "TEST_DL_PATHS=${_DL_PATHS}" + -D "TEST_DL_FRAMEWORK_PATHS=${_DL_FRAMEWORK_PATHS}" -D "CTEST_FILE=${ctest_tests_file}" + -D "ADD_TAGS_AS_LABELS=${_ADD_TAGS_AS_LABELS}" -P "${_CATCH_DISCOVER_TESTS_SCRIPT}" VERBATIM ) @@ -250,7 +275,8 @@ function(catch_discover_tests TARGET) " TEST_OUTPUT_SUFFIX" " [==[" "${_OUTPUT_SUFFIX}" "]==]" "\n" " CTEST_FILE" " [==[" "${ctest_tests_file}" "]==]" "\n" " TEST_DL_PATHS" " [==[" "${_DL_PATHS}" "]==]" "\n" - " CTEST_FILE" " [==[" "${CTEST_FILE}" "]==]" "\n" + " TEST_DL_FRAMEWORK_PATHS" " [==[" "${_DL_FRAMEWORK_PATHS}" "]==]" "\n" + " ADD_TAGS_AS_LABELS" " [==[" "${_ADD_TAGS_AS_LABELS}" "]==]" "\n" " )" "\n" " endif()" "\n" " include(\"${ctest_tests_file}\")" "\n" @@ -277,22 +303,10 @@ function(catch_discover_tests TARGET) endif() endif() - if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") - # Add discovered tests to directory TEST_INCLUDE_FILES - set_property(DIRECTORY - APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}" - ) - else() - # Add discovered tests as directory TEST_INCLUDE_FILE if possible - get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET) - if (NOT ${test_include_file_set}) - set_property(DIRECTORY - PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}" - ) - else() - message(FATAL_ERROR "Cannot set more than one TEST_INCLUDE_FILE") - endif() - endif() + # Add discovered tests to directory TEST_INCLUDE_FILES + set_property(DIRECTORY + APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}" + ) endfunction() diff --git a/packages/Catch2/extras/CatchAddTests.cmake b/packages/Catch2/extras/CatchAddTests.cmake index 692e34056..ceaf86523 100644 --- a/packages/Catch2/extras/CatchAddTests.cmake +++ b/packages/Catch2/extras/CatchAddTests.cmake @@ -21,11 +21,12 @@ function(catch_discover_tests_impl) cmake_parse_arguments( "" "" - "TEST_EXECUTABLE;TEST_WORKING_DIR;TEST_DL_PATHS;TEST_OUTPUT_DIR;TEST_OUTPUT_PREFIX;TEST_OUTPUT_SUFFIX;TEST_PREFIX;TEST_REPORTER;TEST_SPEC;TEST_SUFFIX;TEST_LIST;CTEST_FILE" - "TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR" + "TEST_EXECUTABLE;TEST_WORKING_DIR;TEST_OUTPUT_DIR;TEST_OUTPUT_PREFIX;TEST_OUTPUT_SUFFIX;TEST_PREFIX;TEST_REPORTER;TEST_SPEC;TEST_SUFFIX;TEST_LIST;CTEST_FILE" + "TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR;TEST_DL_PATHS;TEST_DL_FRAMEWORK_PATHS;ADD_TAGS_AS_LABELS" ${ARGN} ) + set(add_tags "${_ADD_TAGS_AS_LABELS}") set(prefix "${_TEST_PREFIX}") set(suffix "${_TEST_SUFFIX}") set(spec ${_TEST_SPEC}) @@ -36,6 +37,8 @@ function(catch_discover_tests_impl) set(output_prefix ${_TEST_OUTPUT_PREFIX}) set(output_suffix ${_TEST_OUTPUT_SUFFIX}) set(dl_paths ${_TEST_DL_PATHS}) + set(dl_framework_paths ${_TEST_DL_FRAMEWORK_PATHS}) + set(environment_modifications "") set(script) set(suite) set(tests) @@ -56,30 +59,33 @@ function(catch_discover_tests_impl) endif() if(dl_paths) - cmake_path(CONVERT "${dl_paths}" TO_NATIVE_PATH_LIST paths) + cmake_path(CONVERT "$ENV{${dl_paths_variable_name}}" TO_NATIVE_PATH_LIST env_dl_paths) + list(PREPEND env_dl_paths "${dl_paths}") + cmake_path(CONVERT "${env_dl_paths}" TO_NATIVE_PATH_LIST paths) set(ENV{${dl_paths_variable_name}} "${paths}") endif() + if(APPLE AND dl_framework_paths) + cmake_path(CONVERT "$ENV{DYLD_FRAMEWORK_PATH}" TO_NATIVE_PATH_LIST env_dl_framework_paths) + list(PREPEND env_dl_framework_paths "${dl_framework_paths}") + cmake_path(CONVERT "${env_dl_framework_paths}" TO_NATIVE_PATH_LIST paths) + set(ENV{DYLD_FRAMEWORK_PATH} "${paths}") + endif() + execute_process( - COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" ${spec} --list-tests --verbosity quiet - OUTPUT_VARIABLE output + COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" ${spec} --list-tests --reporter json + OUTPUT_VARIABLE listing_output RESULT_VARIABLE result WORKING_DIRECTORY "${_TEST_WORKING_DIR}" ) if(NOT ${result} EQUAL 0) message(FATAL_ERROR - "Error running test executable '${_TEST_EXECUTABLE}':\n" + "Error listing tests from executable '${_TEST_EXECUTABLE}':\n" " Result: ${result}\n" - " Output: ${output}\n" + " Output: ${listing_output}\n" ) endif() - # Make sure to escape ; (semicolons) in test names first, because - # that'd break the foreach loop for "Parse output" later and create - # wrongly splitted and thus failing test cases (false positives) - string(REPLACE ";" "\;" output "${output}") - string(REPLACE "\n" ";" output "${output}") - # Prepare reporter if(reporter) set(reporter_arg "--reporter ${reporter}") @@ -99,7 +105,7 @@ function(catch_discover_tests_impl) ) elseif(NOT ${reporter_check_result} EQUAL 0) message(FATAL_ERROR - "Error running test executable '${_TEST_EXECUTABLE}':\n" + "Error checking for reporter in test executable '${_TEST_EXECUTABLE}':\n" " Result: ${reporter_check_result}\n" " Output: ${reporter_check_output}\n" ) @@ -117,50 +123,97 @@ function(catch_discover_tests_impl) 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}") + list(PREPEND environment_modifications "${dl_paths_variable_name}=path_list_prepend:${native_path}") + endforeach() + endif() + + if(APPLE AND dl_framework_paths) + foreach(path ${dl_framework_paths}) + cmake_path(NATIVE_PATH path native_path) + list(PREPEND environment_modifications "DYLD_FRAMEWORK_PATH=path_list_prepend:${native_path}") endforeach() endif() - # Parse output - foreach(line ${output}) - set(test "${line}") + # Parse JSON output for list of tests/class names/tags + string(JSON version GET "${listing_output}" "version") + if (NOT version STREQUAL "1") + message(FATAL_ERROR "Unsupported catch output version: '${version}'") + endif() + + # Speed-up reparsing by cutting away unneeded parts of JSON. + string(JSON test_listing GET "${listing_output}" "listings" "tests") + string(JSON num_tests LENGTH "${test_listing}") + # CMake's foreach-RANGE is inclusive, so we have to subtract 1 + math(EXPR num_tests "${num_tests} - 1") + + foreach(idx RANGE ${num_tests}) + string(JSON single_test GET ${test_listing} ${idx}) + string(JSON test_tags GET "${single_test}" "tags") + string(JSON plain_name GET "${single_test}" "name") + # Escape characters in test case names that would be parsed by Catch2 # Note that the \ escaping must happen FIRST! Do not change the order. - set(test_name "${test}") - foreach(char \\ , [ ]) - string(REPLACE ${char} "\\${char}" test_name "${test_name}") + set(escaped_name "${plain_name}") + foreach(char \\ , [ ] ;) + string(REPLACE ${char} "\\${char}" escaped_name "${escaped_name}") endforeach(char) # ...add output dir if(output_dir) - string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean "${test_name}") - set(output_dir_arg "--out ${output_dir}/${output_prefix}${test_name_clean}${output_suffix}") + string(REGEX REPLACE "[^A-Za-z0-9_]" "_" escaped_name_clean "${escaped_name}") + set(output_dir_arg "--out ${output_dir}/${output_prefix}${escaped_name_clean}${output_suffix}") endif() # ...and add to script add_command(add_test - "${prefix}${test}${suffix}" + "${prefix}${plain_name}${suffix}" ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" - "${test_name}" + "${escaped_name}" ${extra_args} "${reporter_arg}" "${output_dir_arg}" ) add_command(set_tests_properties - "${prefix}${test}${suffix}" + "${prefix}${plain_name}${suffix}" PROPERTIES WORKING_DIRECTORY "${_TEST_WORKING_DIR}" ${properties} ) + if (add_tags) + string(JSON num_tags LENGTH "${test_tags}") + math(EXPR num_tags "${num_tags} - 1") + set(tag_list "") + if (num_tags GREATER_EQUAL "0") + foreach(tag_idx RANGE ${num_tags}) + string(JSON a_tag GET "${test_tags}" "${tag_idx}") + # Catch2's tags can contain semicolons, which are list element separators + # in CMake, so we have to escape them. Ideally we could use the [=[...]=] + # syntax for this, but CTest currently keeps the square quotes in the label + # name. So we add 2 backslashes to escape it instead. + # **IMPORTANT**: The number of backslashes depends on how many layers + # of CMake the tag goes. If this script is changed, the + # number of backslashes to escape may change as well. + string(REPLACE ";" "\\;" a_tag "${a_tag}") + list(APPEND tag_list "${a_tag}") + endforeach() + + add_command(set_tests_properties + "${prefix}${plain_name}${suffix}" + PROPERTIES + LABELS "${tag_list}" + ) + endif() + endif(add_tags) + if(environment_modifications) add_command(set_tests_properties - "${prefix}${test}${suffix}" + "${prefix}${plain_name}${suffix}" PROPERTIES ENVIRONMENT_MODIFICATION "${environment_modifications}") endif() - list(APPEND tests "${prefix}${test}${suffix}") + list(APPEND tests "${prefix}${plain_name}${suffix}") endforeach() # Create a list of all discovered tests, which users may use to e.g. set @@ -187,6 +240,8 @@ if(CMAKE_SCRIPT_MODE_FILE) TEST_OUTPUT_PREFIX ${TEST_OUTPUT_PREFIX} TEST_OUTPUT_SUFFIX ${TEST_OUTPUT_SUFFIX} TEST_DL_PATHS ${TEST_DL_PATHS} + TEST_DL_FRAMEWORK_PATHS ${TEST_DL_FRAMEWORK_PATHS} CTEST_FILE ${CTEST_FILE} + ADD_TAGS_AS_LABELS ${ADD_TAGS_AS_LABELS} ) endif() diff --git a/packages/Catch2/extras/ParseAndAddCatchTests.cmake b/packages/Catch2/extras/ParseAndAddCatchTests.cmake index 4771e0299..31fc193a1 100644 --- a/packages/Catch2/extras/ParseAndAddCatchTests.cmake +++ b/packages/Catch2/extras/ParseAndAddCatchTests.cmake @@ -187,7 +187,7 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) if(result) set(HiddenTagFound ON) break() - endif(result) + endif() endforeach(label) if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9") ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label") diff --git a/packages/Catch2/extras/catch_amalgamated.cpp b/packages/Catch2/extras/catch_amalgamated.cpp index f68c9005b..5b9d73842 100644 --- a/packages/Catch2/extras/catch_amalgamated.cpp +++ b/packages/Catch2/extras/catch_amalgamated.cpp @@ -6,8 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.5.2 -// Generated: 2024-01-15 14:06:36.675713 +// Catch v3.8.0 +// Generated: 2025-01-06 00:39:54.679994 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -101,8 +101,8 @@ namespace Catch { FDuration mean = FDuration(0); int i = 0; for (auto it = first; it < last; ++it, ++i) { - samples.push_back(FDuration(*it)); - mean += FDuration(*it); + samples.push_back(*it); + mean += *it; } mean /= i; @@ -128,7 +128,13 @@ namespace Catch { namespace Catch { namespace Benchmark { namespace Detail { + struct do_nothing { + void operator()() const {} + }; + BenchmarkFunction::callable::~callable() = default; + BenchmarkFunction::BenchmarkFunction(): + f( new model<do_nothing>{ {} } ){} } // namespace Detail } // namespace Benchmark } // namespace Catch @@ -187,7 +193,7 @@ namespace Catch { double const* last, Estimator& estimator ) { auto n = static_cast<size_t>( last - first ); - std::uniform_int_distribution<size_t> dist( 0, n - 1 ); + Catch::uniform_integer_distribution<size_t> dist( 0, n - 1 ); sample out; out.reserve( resamples ); @@ -326,7 +332,7 @@ namespace Catch { double diff = b - m; return a + diff * diff; } ) / - ( last - first ); + static_cast<double>( last - first ); return std::sqrt( variance ); } @@ -361,7 +367,7 @@ namespace Catch { double* first, double* last ) { auto count = last - first; - double idx = (count - 1) * k / static_cast<double>(q); + double idx = static_cast<double>((count - 1) * k) / static_cast<double>(q); int j = static_cast<int>(idx); double g = idx - j; std::nth_element(first, first + j, last); @@ -464,10 +470,10 @@ namespace Catch { double accel = sum_cubes / ( 6 * std::pow( sum_squares, 1.5 ) ); long n = static_cast<long>( resample.size() ); - double prob_n = + double prob_n = static_cast<double>( std::count_if( resample.begin(), resample.end(), - [point]( double x ) { return x < point; } ) / + [point]( double x ) { return x < point; } )) / static_cast<double>( n ); // degenerate case with uniform samples if ( Catch::Detail::directCompare( prob_n, 0. ) ) { @@ -558,7 +564,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( static_cast<double>(std::numeric_limits<float>::epsilon())*100. ), m_margin( 0.0 ), m_scale( 0.0 ), m_value( value ) @@ -621,7 +627,7 @@ std::string StringMaker<Catch::Approx>::convert(Catch::Approx const& value) { namespace Catch { - AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const & _lazyExpression): + AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const& _lazyExpression): lazyExpression(_lazyExpression), resultType(_resultType) {} @@ -807,14 +813,16 @@ namespace Catch { // Insert the default reporter if user hasn't asked for a specific one if ( m_data.reporterSpecifications.empty() ) { - m_data.reporterSpecifications.push_back( { #if defined( CATCH_CONFIG_DEFAULT_REPORTER ) - CATCH_CONFIG_DEFAULT_REPORTER, + const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; #else - "console", + const auto default_spec = "console"; #endif - {}, {}, {} - } ); + auto parsed = parseReporterSpec(default_spec); + CATCH_ENFORCE( parsed, + "Cannot parse the provided default reporter spec: '" + << default_spec << '\'' ); + m_data.reporterSpecifications.push_back( std::move( *parsed ) ); } if ( enableBazelEnvSupport() ) { @@ -1038,6 +1046,8 @@ namespace Catch { m_messages.back().message += " := "; start = pos; } + break; + default:; // noop } } assert(openings.empty() && "Mismatched openings"); @@ -1160,7 +1170,13 @@ namespace Catch { namespace Catch { namespace { - const int MaxExitCode = 255; + static constexpr int TestFailureExitCode = 42; + static constexpr int UnspecifiedErrorExitCode = 1; + static constexpr int AllTestsSkippedExitCode = 4; + static constexpr int NoTestsRunExitCode = 2; + static constexpr int UnmatchedTestSpecExitCode = 3; + static constexpr int InvalidTestSpecExitCode = 5; + IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) { auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config)); @@ -1324,8 +1340,7 @@ namespace Catch { } int Session::applyCommandLine( int argc, char const * const * argv ) { - if( m_startupExceptions ) - return 1; + if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; } auto result = m_cli.parse( Clara::Args( argc, argv ) ); @@ -1341,7 +1356,7 @@ namespace Catch { << TextFlow::Column( result.errorMessage() ).indent( 2 ) << "\n\n"; errStream->stream() << "Run with -? for usage\n\n" << std::flush; - return MaxExitCode; + return UnspecifiedErrorExitCode; } if( m_configData.showHelp ) @@ -1411,8 +1426,7 @@ namespace Catch { } int Session::runInternal() { - if( m_startupExceptions ) - return 1; + if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; } if (m_configData.showHelp || m_configData.libIdentify) { return 0; @@ -1423,7 +1437,7 @@ namespace Catch { << ") must be greater than the shard index (" << m_configData.shardIndex << ")\n" << std::flush; - return 1; + return UnspecifiedErrorExitCode; } CATCH_TRY { @@ -1446,7 +1460,7 @@ namespace Catch { for ( auto const& spec : invalidSpecs ) { reporter->reportInvalidTestSpec( spec ); } - return 1; + return InvalidTestSpecExitCode; } @@ -1460,29 +1474,29 @@ namespace Catch { if ( tests.hadUnmatchedTestSpecs() && m_config->warnAboutUnmatchedTestSpecs() ) { - return 3; + // UnmatchedTestSpecExitCode + return UnmatchedTestSpecExitCode; } if ( totals.testCases.total() == 0 && !m_config->zeroTestsCountAsSuccess() ) { - return 2; + return NoTestsRunExitCode; } if ( totals.testCases.total() > 0 && totals.testCases.total() == totals.testCases.skipped && !m_config->zeroTestsCountAsSuccess() ) { - return 4; + return AllTestsSkippedExitCode; } - // 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, static_cast<int>(totals.assertions.failed)); + if ( totals.assertions.failed ) { return TestFailureExitCode; } + return 0; + } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch( std::exception& ex ) { Catch::cerr() << ex.what() << '\n' << std::flush; - return MaxExitCode; + return UnspecifiedErrorExitCode; } #endif } @@ -1518,26 +1532,26 @@ namespace Catch { static_assert(sizeof(TestCaseProperties) == sizeof(TCP_underlying_type), "The size of the TestCaseProperties is different from the assumed size"); - TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) { return static_cast<TestCaseProperties>( static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs) ); } - TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) { lhs = static_cast<TestCaseProperties>( static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs) ); return lhs; } - TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) { return static_cast<TestCaseProperties>( static_cast<TCP_underlying_type>(lhs) & static_cast<TCP_underlying_type>(rhs) ); } - bool applies(TestCaseProperties tcp) { + constexpr bool applies(TestCaseProperties tcp) { static_assert(static_cast<TCP_underlying_type>(TestCaseProperties::None) == 0, "TestCaseProperties::None must be equal to 0"); return tcp != TestCaseProperties::None; @@ -1576,13 +1590,15 @@ namespace Catch { return "Anonymous test case " + std::to_string(++counter); } - StringRef extractFilenamePart(StringRef filename) { + constexpr StringRef extractFilenamePart(StringRef filename) { size_t lastDot = filename.size(); while (lastDot > 0 && filename[lastDot - 1] != '.') { --lastDot; } - --lastDot; + // In theory we could have filename without any extension in it + if ( lastDot == 0 ) { return StringRef(); } + --lastDot; size_t nameStart = lastDot; while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') { --nameStart; @@ -1592,7 +1608,7 @@ namespace Catch { } // Returns the upper bound on size of extra tags ([#file]+[.]) - size_t sizeOfExtraTags(StringRef filepath) { + constexpr size_t sizeOfExtraTags(StringRef filepath) { // [.] is 3, [#] is another 3 const size_t extras = 3 + 3; return extractFilenamePart(filepath).size() + extras; @@ -1753,10 +1769,6 @@ namespace Catch { return lhs.tags < rhs.tags; } - TestCaseInfo const& TestCaseHandle::getTestCaseInfo() const { - return *m_info; - } - } // end namespace Catch @@ -1897,7 +1909,7 @@ namespace Catch { namespace { static auto getCurrentNanosecondsSinceEpoch() -> uint64_t { - return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); + return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now().time_since_epoch()).count(); } } // end unnamed namespace @@ -1914,7 +1926,7 @@ namespace Catch { return static_cast<unsigned int>(getElapsedMicroseconds()/1000); } auto Timer::getElapsedSeconds() const -> double { - return getElapsedMicroseconds()/1000000.0; + return static_cast<double>(getElapsedMicroseconds())/1000000.0; } @@ -1934,7 +1946,10 @@ namespace Detail { const int hexThreshold = 255; struct Endianness { - enum Arch { Big, Little }; + enum Arch : uint8_t { + Big, + Little + }; static Arch which() { int one = 1; @@ -1966,13 +1981,13 @@ namespace Detail { } } // end unnamed namespace - std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string convertIntoString(StringRef string, bool escapeInvisibles) { 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) { + if (!escapeInvisibles) { ret += '"'; ret += string; ret += '"'; @@ -2050,7 +2065,7 @@ std::string StringMaker<char const*>::convert(char const* str) { return{ "{null string}" }; } } -std::string StringMaker<char*>::convert(char* str) { +std::string StringMaker<char*>::convert(char* str) { // NOLINT(readability-non-const-parameter) if (str) { return Detail::convertIntoString( str ); } else { @@ -2147,17 +2162,17 @@ std::string StringMaker<signed char>::convert(signed char value) { std::string StringMaker<char>::convert(char c) { return ::Catch::Detail::stringify(static_cast<signed char>(c)); } -std::string StringMaker<unsigned char>::convert(unsigned char c) { - return ::Catch::Detail::stringify(static_cast<char>(c)); +std::string StringMaker<unsigned char>::convert(unsigned char value) { + return ::Catch::Detail::stringify(static_cast<char>(value)); } -int StringMaker<float>::precision = 5; +int StringMaker<float>::precision = std::numeric_limits<float>::max_digits10; std::string StringMaker<float>::convert(float value) { return Detail::fpToString(value, precision) + 'f'; } -int StringMaker<double>::precision = 10; +int StringMaker<double>::precision = std::numeric_limits<double>::max_digits10; std::string StringMaker<double>::convert(double value) { return Detail::fpToString(value, precision); @@ -2268,7 +2283,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 3, 5, 2, "", 0 ); + static Version version( 3, 8, 0, "", 0 ); return version; } @@ -2524,8 +2539,8 @@ namespace Catch { void AssertionHandler::handleExpr( ITransientExpression const& expr ) { m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction ); } - void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef message) { - m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction ); + void AssertionHandler::handleMessage(ResultWas::OfType resultType, std::string&& message) { + m_resultCapture.handleMessage( m_assertionInfo, resultType, CATCH_MOVE(message), m_reaction ); } auto AssertionHandler::allowThrows() const -> bool { @@ -2671,7 +2686,7 @@ namespace Catch { { TokenType::Argument, next.substr( delimiterPos + 1, next.size() ) } ); } else { - if ( next[1] != '-' && next.size() > 2 ) { + if ( next.size() > 1 && next[1] != '-' && next.size() > 2 ) { // Combined short args, e.g. "-ab" for "-a -b" for ( size_t i = 1; i < next.size(); ++i ) { m_tokenBuffer.push_back( @@ -3092,7 +3107,7 @@ namespace Catch { line = trim(line); if( !line.empty() && !startsWith( line, '#' ) ) { if( !startsWith( line, '"' ) ) - line = '"' + line + '"'; + line = '"' + CATCH_MOVE(line) + '"'; config.testsOrTags.push_back( line ); config.testsOrTags.emplace_back( "," ); } @@ -3504,7 +3519,7 @@ namespace { #endif // Windows/ ANSI/ None -#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) +#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) || defined( __GLIBC__ ) # define CATCH_INTERNAL_HAS_ISATTY # include <unistd.h> #endif @@ -3573,21 +3588,21 @@ namespace { namespace Catch { - Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection, + Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode colourSelection, IStream* stream ) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) - if ( implSelection == ColourMode::Win32 ) { + if ( colourSelection == ColourMode::Win32 ) { return Detail::make_unique<Win32ColourImpl>( stream ); } #endif - if ( implSelection == ColourMode::ANSI ) { + if ( colourSelection == ColourMode::ANSI ) { return Detail::make_unique<ANSIColourImpl>( stream ); } - if ( implSelection == ColourMode::None ) { + if ( colourSelection == ColourMode::None ) { return Detail::make_unique<NoColourImpl>( stream ); } - if ( implSelection == ColourMode::PlatformDefault) { + if ( colourSelection == ColourMode::PlatformDefault) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { return Detail::make_unique<Win32ColourImpl>( stream ); @@ -3599,7 +3614,7 @@ namespace Catch { return Detail::make_unique<NoColourImpl>( stream ); } - CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(implSelection) ); + CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(colourSelection) ); } bool isColourImplAvailable( ColourMode colourSelection ) { @@ -3644,12 +3659,6 @@ namespace Catch { return *Context::currentContext; } - void Context::setResultCapture( IResultCapture* resultCapture ) { - m_resultCapture = resultCapture; - } - - void Context::setConfig( IConfig const* config ) { m_config = config; } - SimplePcg32& sharedRng() { static SimplePcg32 s_rng; return s_rng; @@ -3807,7 +3816,12 @@ namespace Catch { namespace Catch { - ITransientExpression::~ITransientExpression() = default; + void ITransientExpression::streamReconstructedExpression( + std::ostream& os ) const { + // We can't make this function pure virtual to keep ITransientExpression + // constexpr, so we write error message instead + os << "Some class derived from ITransientExpression without overriding streamReconstructedExpression"; + } void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) { if( lhs.size() + rhs.size() < 40 && @@ -4473,7 +4487,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '{'; } - JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ): + JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, @@ -4504,7 +4518,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '['; } - JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ): + JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, @@ -4798,138 +4812,328 @@ namespace Catch { #include <cstdio> #include <cstring> +#include <iosfwd> #include <sstream> -#if defined(CATCH_CONFIG_NEW_CAPTURE) - #if defined(_MSC_VER) - #include <io.h> //_dup and _dup2 - #define dup _dup - #define dup2 _dup2 - #define fileno _fileno - #else - #include <unistd.h> // dup and dup2 - #endif +#if defined( CATCH_CONFIG_NEW_CAPTURE ) +# if defined( _MSC_VER ) +# include <io.h> //_dup and _dup2 +# define dup _dup +# define dup2 _dup2 +# define fileno _fileno +# else +# include <unistd.h> // dup and dup2 +# endif #endif - namespace Catch { - RedirectedStream::RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream ) - : m_originalStream( originalStream ), - m_redirectionStream( redirectionStream ), - m_prevBuf( m_originalStream.rdbuf() ) - { - m_originalStream.rdbuf( m_redirectionStream.rdbuf() ); - } + namespace { + //! A no-op implementation, used if no reporter wants output + //! redirection. + class NoopRedirect : public OutputRedirect { + void activateImpl() override {} + void deactivateImpl() override {} + std::string getStdout() override { return {}; } + std::string getStderr() override { return {}; } + void clearBuffers() override {} + }; - RedirectedStream::~RedirectedStream() { - m_originalStream.rdbuf( m_prevBuf ); - } + /** + * Redirects specific stream's rdbuf with another's. + * + * Redirection can be stopped and started on-demand, assumes + * that the underlying stream's rdbuf aren't changed by other + * users. + */ + class RedirectedStreamNew { + std::ostream& m_originalStream; + std::ostream& m_redirectionStream; + std::streambuf* m_prevBuf; - RedirectedStdOut::RedirectedStdOut() : m_cout( Catch::cout(), m_rss.get() ) {} - auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); } + public: + RedirectedStreamNew( std::ostream& originalStream, + std::ostream& redirectionStream ): + m_originalStream( originalStream ), + m_redirectionStream( redirectionStream ), + m_prevBuf( m_originalStream.rdbuf() ) {} - RedirectedStdErr::RedirectedStdErr() - : m_cerr( Catch::cerr(), m_rss.get() ), - m_clog( Catch::clog(), m_rss.get() ) - {} - auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); } + void startRedirect() { + m_originalStream.rdbuf( m_redirectionStream.rdbuf() ); + } + void stopRedirect() { m_originalStream.rdbuf( m_prevBuf ); } + }; - RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr) - : m_redirectedCout(redirectedCout), - m_redirectedCerr(redirectedCerr) - {} + /** + * Redirects the `std::cout`, `std::cerr`, `std::clog` streams, + * but does not touch the actual `stdout`/`stderr` file descriptors. + */ + class StreamRedirect : public OutputRedirect { + ReusableStringStream m_redirectedOut, m_redirectedErr; + RedirectedStreamNew m_cout, m_cerr, m_clog; - RedirectedStreams::~RedirectedStreams() { - m_redirectedCout += m_redirectedStdOut.str(); - m_redirectedCerr += m_redirectedStdErr.str(); - } + public: + StreamRedirect(): + m_cout( Catch::cout(), m_redirectedOut.get() ), + m_cerr( Catch::cerr(), m_redirectedErr.get() ), + m_clog( Catch::clog(), m_redirectedErr.get() ) {} + + void activateImpl() override { + m_cout.startRedirect(); + m_cerr.startRedirect(); + m_clog.startRedirect(); + } + void deactivateImpl() override { + m_cout.stopRedirect(); + m_cerr.stopRedirect(); + m_clog.stopRedirect(); + } + std::string getStdout() override { return m_redirectedOut.str(); } + std::string getStderr() override { return m_redirectedErr.str(); } + void clearBuffers() override { + m_redirectedOut.str( "" ); + m_redirectedErr.str( "" ); + } + }; -#if defined(CATCH_CONFIG_NEW_CAPTURE) +#if defined( CATCH_CONFIG_NEW_CAPTURE ) -#if defined(_MSC_VER) - TempFile::TempFile() { - if (tmpnam_s(m_buffer)) { - CATCH_RUNTIME_ERROR("Could not get a temp filename"); - } - if (fopen_s(&m_file, m_buffer, "w+")) { - char buffer[100]; - if (strerror_s(buffer, errno)) { - CATCH_RUNTIME_ERROR("Could not translate errno to a string"); + // Windows's implementation of std::tmpfile is terrible (it tries + // to create a file inside system folder, thus requiring elevated + // privileges for the binary), so we have to use tmpnam(_s) and + // create the file ourselves there. + class TempFile { + public: + TempFile( TempFile const& ) = delete; + TempFile& operator=( TempFile const& ) = delete; + TempFile( TempFile&& ) = delete; + TempFile& operator=( TempFile&& ) = delete; + +# if defined( _MSC_VER ) + TempFile() { + if ( tmpnam_s( m_buffer ) ) { + CATCH_RUNTIME_ERROR( "Could not get a temp filename" ); + } + if ( fopen_s( &m_file, m_buffer, "wb+" ) ) { + char buffer[100]; + if ( strerror_s( buffer, errno ) ) { + CATCH_RUNTIME_ERROR( + "Could not translate errno to a string" ); + } + CATCH_RUNTIME_ERROR( "Could not open the temp file: '" + << m_buffer + << "' because: " << buffer ); + } + } +# else + TempFile() { + m_file = std::tmpfile(); + if ( !m_file ) { + CATCH_RUNTIME_ERROR( "Could not create a temp file." ); + } } - CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer); +# endif + + ~TempFile() { + // TBD: What to do about errors here? + std::fclose( m_file ); + // We manually create the file on Windows only, on Linux + // it will be autodeleted +# if defined( _MSC_VER ) + std::remove( m_buffer ); +# endif + } + + std::FILE* getFile() { return m_file; } + std::string getContents() { + ReusableStringStream sstr; + constexpr long buffer_size = 100; + char buffer[buffer_size + 1] = {}; + long current_pos = ftell( m_file ); + CATCH_ENFORCE( current_pos >= 0, + "ftell failed, errno: " << errno ); + std::rewind( m_file ); + while ( current_pos > 0 ) { + auto read_characters = + std::fread( buffer, + 1, + std::min( buffer_size, current_pos ), + m_file ); + buffer[read_characters] = '\0'; + sstr << buffer; + current_pos -= static_cast<long>( read_characters ); + } + return sstr.str(); + } + + void clear() { std::rewind( m_file ); } + + private: + std::FILE* m_file = nullptr; + char m_buffer[L_tmpnam] = { 0 }; + }; + + /** + * Redirects the actual `stdout`/`stderr` file descriptors. + * + * Works by replacing the file descriptors numbered 1 and 2 + * with an open temporary file. + */ + class FileRedirect : public OutputRedirect { + TempFile m_outFile, m_errFile; + int m_originalOut = -1; + int m_originalErr = -1; + + // Flushes cout/cerr/clog streams and stdout/stderr FDs + void flushEverything() { + Catch::cout() << std::flush; + fflush( stdout ); + // Since we support overriding these streams, we flush cerr + // even though std::cerr is unbuffered + Catch::cerr() << std::flush; + Catch::clog() << std::flush; + fflush( stderr ); + } + + public: + FileRedirect(): + m_originalOut( dup( fileno( stdout ) ) ), + m_originalErr( dup( fileno( stderr ) ) ) { + CATCH_ENFORCE( m_originalOut >= 0, "Could not dup stdout" ); + CATCH_ENFORCE( m_originalErr >= 0, "Could not dup stderr" ); + } + + std::string getStdout() override { return m_outFile.getContents(); } + std::string getStderr() override { return m_errFile.getContents(); } + void clearBuffers() override { + m_outFile.clear(); + m_errFile.clear(); + } + + void activateImpl() override { + // We flush before starting redirect, to ensure that we do + // not capture the end of message sent before activation. + flushEverything(); + + int ret; + ret = dup2( fileno( m_outFile.getFile() ), fileno( stdout ) ); + CATCH_ENFORCE( ret >= 0, + "dup2 to stdout has failed, errno: " << errno ); + ret = dup2( fileno( m_errFile.getFile() ), fileno( stderr ) ); + CATCH_ENFORCE( ret >= 0, + "dup2 to stderr has failed, errno: " << errno ); + } + void deactivateImpl() override { + // We flush before ending redirect, to ensure that we + // capture all messages sent while the redirect was active. + flushEverything(); + + int ret; + ret = dup2( m_originalOut, fileno( stdout ) ); + CATCH_ENFORCE( + ret >= 0, + "dup2 of original stdout has failed, errno: " << errno ); + ret = dup2( m_originalErr, fileno( stderr ) ); + CATCH_ENFORCE( + ret >= 0, + "dup2 of original stderr has failed, errno: " << errno ); + } + }; + +#endif // CATCH_CONFIG_NEW_CAPTURE + + } // end namespace + + bool isRedirectAvailable( OutputRedirect::Kind kind ) { + switch ( kind ) { + // These two are always available + case OutputRedirect::None: + case OutputRedirect::Streams: + return true; +#if defined( CATCH_CONFIG_NEW_CAPTURE ) + case OutputRedirect::FileDescriptors: + return true; +#endif + default: + return false; } } + + Detail::unique_ptr<OutputRedirect> makeOutputRedirect( bool actual ) { + if ( actual ) { + // TODO: Clean this up later +#if defined( CATCH_CONFIG_NEW_CAPTURE ) + return Detail::make_unique<FileRedirect>(); #else - TempFile::TempFile() { - m_file = std::tmpfile(); - if (!m_file) { - CATCH_RUNTIME_ERROR("Could not create a temp file."); + return Detail::make_unique<StreamRedirect>(); +#endif + } else { + return Detail::make_unique<NoopRedirect>(); } } -#endif + RedirectGuard scopedActivate( OutputRedirect& redirectImpl ) { + return RedirectGuard( true, redirectImpl ); + } - TempFile::~TempFile() { - // TBD: What to do about errors here? - std::fclose(m_file); - // We manually create the file on Windows only, on Linux - // it will be autodeleted -#if defined(_MSC_VER) - std::remove(m_buffer); -#endif + RedirectGuard scopedDeactivate( OutputRedirect& redirectImpl ) { + return RedirectGuard( false, redirectImpl ); } + OutputRedirect::~OutputRedirect() = default; - FILE* TempFile::getFile() { - return m_file; - } + RedirectGuard::RedirectGuard( bool activate, OutputRedirect& redirectImpl ): + m_redirect( &redirectImpl ), + m_activate( activate ), + m_previouslyActive( redirectImpl.isActive() ) { - std::string TempFile::getContents() { - std::stringstream sstr; - char buffer[100] = {}; - std::rewind(m_file); - while (std::fgets(buffer, sizeof(buffer), m_file)) { - sstr << buffer; - } - return sstr.str(); - } + // Skip cases where there is no actual state change. + if ( m_activate == m_previouslyActive ) { return; } - OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) : - m_originalStdout(dup(1)), - m_originalStderr(dup(2)), - m_stdoutDest(stdout_dest), - m_stderrDest(stderr_dest) { - dup2(fileno(m_stdoutFile.getFile()), 1); - dup2(fileno(m_stderrFile.getFile()), 2); + if ( m_activate ) { + m_redirect->activate(); + } else { + m_redirect->deactivate(); + } } - OutputRedirect::~OutputRedirect() { - Catch::cout() << std::flush; - fflush(stdout); - // Since we support overriding these streams, we flush cerr - // even though std::cerr is unbuffered - Catch::cerr() << std::flush; - Catch::clog() << std::flush; - fflush(stderr); + RedirectGuard::~RedirectGuard() noexcept( false ) { + if ( m_moved ) { return; } + // Skip cases where there is no actual state change. + if ( m_activate == m_previouslyActive ) { return; } - dup2(m_originalStdout, 1); - dup2(m_originalStderr, 2); + if ( m_activate ) { + m_redirect->deactivate(); + } else { + m_redirect->activate(); + } + } - m_stdoutDest += m_stdoutFile.getContents(); - m_stderrDest += m_stderrFile.getContents(); + RedirectGuard::RedirectGuard( RedirectGuard&& rhs ) noexcept: + m_redirect( rhs.m_redirect ), + m_activate( rhs.m_activate ), + m_previouslyActive( rhs.m_previouslyActive ), + m_moved( false ) { + rhs.m_moved = true; } -#endif // CATCH_CONFIG_NEW_CAPTURE + RedirectGuard& RedirectGuard::operator=( RedirectGuard&& rhs ) noexcept { + m_redirect = rhs.m_redirect; + m_activate = rhs.m_activate; + m_previouslyActive = rhs.m_previouslyActive; + m_moved = false; + rhs.m_moved = true; + return *this; + } } // namespace Catch -#if defined(CATCH_CONFIG_NEW_CAPTURE) - #if defined(_MSC_VER) - #undef dup - #undef dup2 - #undef fileno - #endif +#if defined( CATCH_CONFIG_NEW_CAPTURE ) +# if defined( _MSC_VER ) +# undef dup +# undef dup2 +# undef fileno +# endif #endif @@ -5057,7 +5261,7 @@ namespace { SimplePcg32::result_type SimplePcg32::operator()() { // prepare the output value const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u); - const auto output = rotate_right(xorshifted, m_state >> 59u); + const auto output = rotate_right(xorshifted, static_cast<uint32_t>(m_state >> 59u)); // advance state m_state = m_state * 6364136223846793005ULL + s_inc; @@ -5283,7 +5487,7 @@ namespace Catch { auto kv = splitKVPair( parts[i] ); auto key = kv.key, value = kv.value; - if ( key.empty() || value.empty() ) { + if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) return {}; } else if ( key[0] == 'X' ) { // This is a reporter-specific option, we don't check these @@ -5340,26 +5544,6 @@ ReporterSpec::ReporterSpec( -namespace Catch { - - bool isOk( ResultWas::OfType resultType ) { - return ( resultType & ResultWas::FailureBit ) == 0; - } - bool isJustInfo( int flags ) { - return flags == ResultWas::Info; - } - - ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { - return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) ); - } - - bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } - bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } - -} // end namespace Catch - - - #include <cstdio> #include <sstream> #include <vector> @@ -5563,6 +5747,7 @@ namespace Catch { m_config(_config), m_reporter(CATCH_MOVE(reporter)), m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal }, + m_outputRedirect( makeOutputRedirect( m_reporter->getPreferences().shouldRedirectStdOut ) ), m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions ) { getCurrentMutableContext().setResultCapture( this ); @@ -5578,6 +5763,7 @@ namespace Catch { auto const& testInfo = testCase.getTestCaseInfo(); m_reporter->testCaseStarting(testInfo); + testCase.prepareTestCase(); m_activeTestCase = &testCase; @@ -5628,15 +5814,17 @@ namespace Catch { m_reporter->testCasePartialStarting(testInfo, testRuns); const auto beforeRunTotals = m_totals; - std::string oneRunCout, oneRunCerr; - runCurrentTest(oneRunCout, oneRunCerr); + runCurrentTest(); + std::string oneRunCout = m_outputRedirect->getStdout(); + std::string oneRunCerr = m_outputRedirect->getStderr(); + m_outputRedirect->clearBuffers(); redirectedCout += oneRunCout; redirectedCerr += oneRunCerr; const auto singleRunTotals = m_totals.delta(beforeRunTotals); auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, CATCH_MOVE(oneRunCout), CATCH_MOVE(oneRunCerr), aborting()); - m_reporter->testCasePartialEnded(statsForOneRun, testRuns); + ++testRuns; } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); @@ -5647,6 +5835,7 @@ namespace Catch { deltaTotals.testCases.failed++; } m_totals.testCases += deltaTotals.testCases; + testCase.tearDownTestCase(); m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, CATCH_MOVE(redirectedCout), @@ -5680,7 +5869,10 @@ namespace Catch { m_lastAssertionPassed = true; } - m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ); + } if ( result.getResultType() != ResultWas::Warning ) { m_messageScopes.clear(); @@ -5697,6 +5889,7 @@ namespace Catch { } void RunContext::notifyAssertionStarted( AssertionInfo const& info ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->assertionStarting( info ); } @@ -5715,7 +5908,10 @@ namespace Catch { SectionInfo sectionInfo( sectionLineInfo, static_cast<std::string>(sectionName) ); m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - m_reporter->sectionStarting(sectionInfo); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->sectionStarting( sectionInfo ); + } assertions = m_totals.assertions; @@ -5775,7 +5971,15 @@ namespace Catch { m_activeSections.pop_back(); } - m_reporter->sectionEnded(SectionStats(CATCH_MOVE(endInfo.sectionInfo), assertions, endInfo.durationInSeconds, missingAssertions)); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->sectionEnded( + SectionStats( CATCH_MOVE( endInfo.sectionInfo ), + assertions, + endInfo.durationInSeconds, + missingAssertions ) ); + } + m_messages.clear(); m_messageScopes.clear(); } @@ -5792,15 +5996,19 @@ namespace Catch { } void RunContext::benchmarkPreparing( StringRef name ) { - m_reporter->benchmarkPreparing(name); + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->benchmarkPreparing( name ); } void RunContext::benchmarkStarting( BenchmarkInfo const& info ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkStarting( info ); } void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkEnded( stats ); } void RunContext::benchmarkFailed( StringRef error ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkFailed( error ); } @@ -5831,8 +6039,13 @@ namespace Catch { } void RunContext::handleFatalErrorCondition( StringRef message ) { + // TODO: scoped deactivate here? Just give up and do best effort? + // the deactivation can break things further, OTOH so can the + // capture + auto _ = scopedDeactivate( *m_outputRedirect ); + // First notify reporter that bad things happened - m_reporter->fatalErrorEncountered(message); + m_reporter->fatalErrorEncountered( message ); // Don't rebuild the result -- the stringification itself can cause more fatal errors // Instead, fake a result data. @@ -5843,6 +6056,13 @@ namespace Catch { assertionEnded(CATCH_MOVE(result) ); resetAssertionInfo(); + // Best effort cleanup for sections that have not been destructed yet + // Since this is a fatal error, we have not had and won't have the opportunity to destruct them properly + while (!m_activeSections.empty()) { + auto nl = m_activeSections.back()->nameAndLocation(); + SectionEndInfo endInfo{ SectionInfo(CATCH_MOVE(nl.location), CATCH_MOVE(nl.name)), {}, 0.0 }; + sectionEndedEarly(CATCH_MOVE(endInfo)); + } handleUnfinishedSections(); // Recreate section for test case (as we will lose the one that was in scope) @@ -5852,7 +6072,7 @@ namespace Catch { Counts assertions; assertions.failed = 1; SectionStats testCaseSectionStats(CATCH_MOVE(testCaseSection), assertions, 0, false); - m_reporter->sectionEnded(testCaseSectionStats); + m_reporter->sectionEnded( testCaseSectionStats ); auto const& testInfo = m_activeTestCase->getTestCaseInfo(); @@ -5883,7 +6103,7 @@ namespace Catch { return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter()); } - void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) { + void RunContext::runCurrentTest() { auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); m_reporter->sectionStarting(testCaseSection); @@ -5894,18 +6114,8 @@ namespace Catch { Timer timer; CATCH_TRY { - if (m_reporter->getPreferences().shouldRedirectStdOut) { -#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) - RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr); - - timer.start(); - invokeActiveTestCase(); -#else - OutputRedirect r(redirectedCout, redirectedCerr); - timer.start(); - invokeActiveTestCase(); -#endif - } else { + { + auto _ = scopedActivate( *m_outputRedirect ); timer.start(); invokeActiveTestCase(); } @@ -5950,11 +6160,12 @@ namespace Catch { void RunContext::handleUnfinishedSections() { // If sections ended prematurely due to an exception we stored their // infos here so we can tear them down outside the unwind process. - for (auto it = m_unfinishedSections.rbegin(), - itEnd = m_unfinishedSections.rend(); - it != itEnd; - ++it) - sectionEnded(CATCH_MOVE(*it)); + for ( auto it = m_unfinishedSections.rbegin(), + itEnd = m_unfinishedSections.rend(); + it != itEnd; + ++it ) { + sectionEnded( CATCH_MOVE( *it ) ); + } m_unfinishedSections.clear(); } @@ -5998,13 +6209,13 @@ namespace Catch { void RunContext::handleMessage( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) { m_lastAssertionInfo = info; AssertionResultData data( resultType, LazyExpression( false ) ); - data.message = static_cast<std::string>(message); + data.message = CATCH_MOVE( message ); AssertionResult assertionResult{ m_lastAssertionInfo, CATCH_MOVE( data ) }; @@ -6297,17 +6508,29 @@ namespace Catch { } bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { - bool replaced = false; std::size_t i = str.find( replaceThis ); - while( i != std::string::npos ) { - replaced = true; - str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); - if( i < str.size()-withThis.size() ) - i = str.find( replaceThis, i+withThis.size() ); + if (i == std::string::npos) { + return false; + } + std::size_t copyBegin = 0; + std::string origStr = CATCH_MOVE(str); + str.clear(); + // There is at least one replacement, so reserve with the best guess + // we can make without actually counting the number of occurences. + str.reserve(origStr.size() - replaceThis.size() + withThis.size()); + do { + str.append(origStr, copyBegin, i-copyBegin ); + str += withThis; + copyBegin = i + replaceThis.size(); + if( copyBegin < origStr.size() ) + i = origStr.find( replaceThis, copyBegin ); else i = std::string::npos; + } while( i != std::string::npos ); + if ( copyBegin < origStr.size() ) { + str.append(origStr, copyBegin, origStr.size() ); } - return replaced; + return true; } std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) { @@ -6581,6 +6804,8 @@ namespace Catch { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); } + TestRegistry::~TestRegistry() = default; + 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()); @@ -6867,6 +7092,8 @@ namespace Catch { #include <iterator> namespace Catch { + void ITestInvoker::prepareTestCase() {} + void ITestInvoker::tearDownTestCase() {} ITestInvoker::~ITestInvoker() = default; namespace { @@ -6903,7 +7130,7 @@ namespace Catch { TestType m_testAsFunction; public: - TestInvokerAsFunction( TestType testAsFunction ) noexcept: + constexpr TestInvokerAsFunction( TestType testAsFunction ) noexcept: m_testAsFunction( testAsFunction ) {} void invoke() const override { m_testAsFunction(); } @@ -7183,117 +7410,228 @@ namespace { return std::memchr( chars, c, sizeof( chars ) - 1 ) != nullptr; } - bool isBoundary( std::string const& line, size_t at ) { - assert( at > 0 ); - assert( at <= line.size() ); - - return at == line.size() || - ( isWhitespace( line[at] ) && !isWhitespace( line[at - 1] ) ) || - isBreakableBefore( line[at] ) || - isBreakableAfter( line[at - 1] ); - } - } // namespace namespace Catch { namespace TextFlow { + void AnsiSkippingString::preprocessString() { + for ( auto it = m_string.begin(); it != m_string.end(); ) { + // try to read through an ansi sequence + while ( it != m_string.end() && *it == '\033' && + it + 1 != m_string.end() && *( it + 1 ) == '[' ) { + auto cursor = it + 2; + while ( cursor != m_string.end() && + ( isdigit( *cursor ) || *cursor == ';' ) ) { + ++cursor; + } + if ( cursor == m_string.end() || *cursor != 'm' ) { + break; + } + // 'm' -> 0xff + *cursor = AnsiSkippingString::sentinel; + // if we've read an ansi sequence, set the iterator and + // return to the top of the loop + it = cursor + 1; + } + if ( it != m_string.end() ) { + ++m_size; + ++it; + } + } + } + + AnsiSkippingString::AnsiSkippingString( std::string const& text ): + m_string( text ) { + preprocessString(); + } + + AnsiSkippingString::AnsiSkippingString( std::string&& text ): + m_string( CATCH_MOVE( text ) ) { + preprocessString(); + } + + AnsiSkippingString::const_iterator AnsiSkippingString::begin() const { + return const_iterator( m_string ); + } + + AnsiSkippingString::const_iterator AnsiSkippingString::end() const { + return const_iterator( m_string, const_iterator::EndTag{} ); + } + + std::string AnsiSkippingString::substring( const_iterator begin, + const_iterator end ) const { + // There's one caveat here to an otherwise simple substring: when + // making a begin iterator we might have skipped ansi sequences at + // the start. If `begin` here is a begin iterator, skipped over + // initial ansi sequences, we'll use the true beginning of the + // string. Lastly: We need to transform any chars we replaced with + // 0xff back to 'm' + auto str = std::string( begin == this->begin() ? m_string.begin() + : begin.m_it, + end.m_it ); + std::transform( str.begin(), str.end(), str.begin(), []( char c ) { + return c == AnsiSkippingString::sentinel ? 'm' : c; + } ); + return str; + } + + void AnsiSkippingString::const_iterator::tryParseAnsiEscapes() { + // check if we've landed on an ansi sequence, and if so read through + // it + while ( m_it != m_string->end() && *m_it == '\033' && + m_it + 1 != m_string->end() && *( m_it + 1 ) == '[' ) { + auto cursor = m_it + 2; + while ( cursor != m_string->end() && + ( isdigit( *cursor ) || *cursor == ';' ) ) { + ++cursor; + } + if ( cursor == m_string->end() || + *cursor != AnsiSkippingString::sentinel ) { + break; + } + // if we've read an ansi sequence, set the iterator and + // return to the top of the loop + m_it = cursor + 1; + } + } + + void AnsiSkippingString::const_iterator::advance() { + assert( m_it != m_string->end() ); + m_it++; + tryParseAnsiEscapes(); + } + + void AnsiSkippingString::const_iterator::unadvance() { + assert( m_it != m_string->begin() ); + m_it--; + // if *m_it is 0xff, scan back to the \033 and then m_it-- once more + // (and repeat check) + while ( *m_it == AnsiSkippingString::sentinel ) { + while ( *m_it != '\033' ) { + assert( m_it != m_string->begin() ); + m_it--; + } + // if this happens, we must have been a begin iterator that had + // skipped over ansi sequences at the start of a string + assert( m_it != m_string->begin() ); + assert( *m_it == '\033' ); + m_it--; + } + } + + static bool isBoundary( AnsiSkippingString const& line, + AnsiSkippingString::const_iterator it ) { + return it == line.end() || + ( isWhitespace( *it ) && + !isWhitespace( *it.oneBefore() ) ) || + isBreakableBefore( *it ) || + isBreakableAfter( *it.oneBefore() ); + } void Column::const_iterator::calcLength() { m_addHyphen = false; m_parsedTo = m_lineStart; + AnsiSkippingString const& current_line = m_column.m_string; - std::string const& current_line = m_column.m_string; - if ( current_line[m_lineStart] == '\n' ) { - ++m_parsedTo; + if ( m_parsedTo == current_line.end() ) { + m_lineEnd = m_parsedTo; + return; } + assert( m_lineStart != current_line.end() ); + if ( *m_lineStart == '\n' ) { ++m_parsedTo; } + 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' ) { + std::size_t lineLength = 0; + while ( m_parsedTo != current_line.end() && + lineLength < maxLineLength && *m_parsedTo != '\n' ) { ++m_parsedTo; + ++lineLength; } // 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; + if ( lineLength < maxLineLength ) { + m_lineEnd = m_parsedTo; } else { // 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; + m_lineEnd = m_parsedTo; + while ( lineLength > 0 && + !isBoundary( current_line, m_lineEnd ) ) { + --lineLength; + --m_lineEnd; } - while ( newLineLength > 0 && - isWhitespace( current_line[m_lineStart + newLineLength - 1] ) ) { - --newLineLength; + while ( lineLength > 0 && + isWhitespace( *m_lineEnd.oneBefore() ) ) { + --lineLength; + --m_lineEnd; } - // If we found one, then that is where we linebreak - if ( newLineLength > 0 ) { - m_lineLength = newLineLength; - } else { - // Otherwise we have to split text with a hyphen + // If we found one, then that is where we linebreak, otherwise + // we have to split text with a hyphen + if ( lineLength == 0 ) { m_addHyphen = true; - m_lineLength = maxLineLength - 1; + m_lineEnd = m_parsedTo.oneBefore(); } } } size_t Column::const_iterator::indentSize() const { - auto initial = - m_lineStart == 0 ? m_column.m_initialIndent : std::string::npos; + auto initial = m_lineStart == m_column.m_string.begin() + ? m_column.m_initialIndent + : std::string::npos; return initial == std::string::npos ? m_column.m_indent : initial; } - std::string - Column::const_iterator::addIndentAndSuffix( size_t position, - size_t length ) const { + std::string Column::const_iterator::addIndentAndSuffix( + AnsiSkippingString::const_iterator start, + AnsiSkippingString::const_iterator end ) const { std::string ret; const auto desired_indent = indentSize(); - ret.reserve( desired_indent + length + m_addHyphen ); + // ret.reserve( desired_indent + (end - start) + m_addHyphen ); ret.append( desired_indent, ' ' ); - ret.append( m_column.m_string, position, length ); - if ( m_addHyphen ) { - ret.push_back( '-' ); - } + // ret.append( start, end ); + ret += m_column.m_string.substring( start, end ); + if ( m_addHyphen ) { ret.push_back( '-' ); } return ret; } - Column::const_iterator::const_iterator( Column const& column ): m_column( column ) { + Column::const_iterator::const_iterator( Column const& column ): + m_column( column ), + m_lineStart( column.m_string.begin() ), + m_lineEnd( column.m_string.begin() ), + m_parsedTo( column.m_string.begin() ) { 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_lineLength == 0 ) { - m_lineStart = m_column.m_string.size(); + if ( m_lineStart == m_lineEnd ) { + m_lineStart = m_column.m_string.end(); } } std::string Column::const_iterator::operator*() const { assert( m_lineStart <= m_parsedTo ); - return addIndentAndSuffix( m_lineStart, m_lineLength ); + return addIndentAndSuffix( m_lineStart, m_lineEnd ); } Column::const_iterator& Column::const_iterator::operator++() { - m_lineStart += m_lineLength; - std::string const& current_line = m_column.m_string; - if ( m_lineStart < current_line.size() && current_line[m_lineStart] == '\n' ) { - m_lineStart += 1; + m_lineStart = m_lineEnd; + AnsiSkippingString const& current_line = m_column.m_string; + if ( m_lineStart != current_line.end() && *m_lineStart == '\n' ) { + m_lineStart++; } else { - while ( m_lineStart < current_line.size() && - isWhitespace( current_line[m_lineStart] ) ) { + while ( m_lineStart != current_line.end() && + isWhitespace( *m_lineStart ) ) { ++m_lineStart; } } - if ( m_lineStart != current_line.size() ) { - calcLength(); - } + if ( m_lineStart != current_line.end() ) { calcLength(); } return *this; } @@ -7390,25 +7728,25 @@ namespace Catch { return os; } - Columns operator+(Column const& lhs, Column const& rhs) { + Columns operator+( Column const& lhs, Column const& rhs ) { Columns cols; cols += lhs; cols += rhs; return cols; } - Columns operator+(Column&& lhs, Column&& rhs) { + Columns operator+( Column&& lhs, Column&& rhs ) { Columns cols; cols += CATCH_MOVE( lhs ); cols += CATCH_MOVE( rhs ); return cols; } - Columns& operator+=(Columns& lhs, Column const& rhs) { + Columns& operator+=( Columns& lhs, Column const& rhs ) { lhs.m_columns.push_back( rhs ); return lhs; } - Columns& operator+=(Columns& lhs, Column&& rhs) { - lhs.m_columns.push_back( CATCH_MOVE(rhs) ); + Columns& operator+=( Columns& lhs, Column&& rhs ) { + lhs.m_columns.push_back( CATCH_MOVE( rhs ) ); return lhs; } Columns operator+( Columns const& lhs, Column const& rhs ) { @@ -7527,36 +7865,16 @@ namespace { os.flags(f); } - bool shouldNewline(XmlFormatting fmt) { + constexpr bool shouldNewline(XmlFormatting fmt) { return !!(static_cast<std::underlying_type_t<XmlFormatting>>(fmt & XmlFormatting::Newline)); } - bool shouldIndent(XmlFormatting fmt) { + constexpr bool shouldIndent(XmlFormatting fmt) { return !!(static_cast<std::underlying_type_t<XmlFormatting>>(fmt & XmlFormatting::Indent)); } } // anonymous namespace - XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) { - return static_cast<XmlFormatting>( - static_cast<std::underlying_type_t<XmlFormatting>>(lhs) | - static_cast<std::underlying_type_t<XmlFormatting>>(rhs) - ); - } - - XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) { - return static_cast<XmlFormatting>( - static_cast<std::underlying_type_t<XmlFormatting>>(lhs) & - static_cast<std::underlying_type_t<XmlFormatting>>(rhs) - ); - } - - - XmlEncode::XmlEncode( StringRef str, ForWhat forWhat ) - : m_str( str ), - m_forWhat( forWhat ) - {} - void XmlEncode::encodeTo( std::ostream& os ) const { // Apostrophe escaping not necessary if we always use " to write attributes // (see: http://www.w3.org/TR/xml/#syntax) @@ -8053,7 +8371,7 @@ namespace Detail { std::string WithinRelMatcher::describe() const { Catch::ReusableStringStream sstr; - sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other"; + sstr << "and " << ::Catch::Detail::stringify(m_target) << " are within " << m_epsilon * 100. << "% of each other"; return sstr.str(); } @@ -8793,7 +9111,7 @@ struct RowBreak {}; struct OutputFlush {}; class Duration { - enum class Unit { + enum class Unit : uint8_t { Auto, Nanoseconds, Microseconds, @@ -8865,7 +9183,10 @@ public: }; } // end anon namespace -enum class Justification { Left, Right }; +enum class Justification : uint8_t { + Left, + Right +}; struct ColumnInfo { std::string name; @@ -9099,8 +9420,8 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { m_stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } -void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { - StreamingReporterBase::testRunStarting(_testInfo); +void ConsoleReporter::testRunStarting(TestRunInfo const& _testRunInfo) { + StreamingReporterBase::testRunStarting(_testRunInfo); if ( m_config->testSpec().hasFilters() ) { m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " << m_config->testSpec() << '\n'; @@ -9253,8 +9574,7 @@ namespace Catch { namespace { struct BySectionInfo { BySectionInfo( SectionInfo const& other ): m_other( other ) {} - BySectionInfo( BySectionInfo const& other ): - m_other( other.m_other ) {} + BySectionInfo( BySectionInfo const& other ) = default; bool operator()( Detail::unique_ptr<CumulativeReporterBase::SectionNode> const& node ) const { @@ -9879,8 +10199,8 @@ namespace Catch { return "Outputs listings as JSON. Test listing is Work-in-Progress!"; } - void JsonReporter::testRunStarting( TestRunInfo const& testInfo ) { - StreamingReporterBase::testRunStarting( testInfo ); + void JsonReporter::testRunStarting( TestRunInfo const& runInfo ) { + StreamingReporterBase::testRunStarting( runInfo ); endListing(); assert( isInside( Writer::Object ) ); @@ -10178,7 +10498,7 @@ namespace Catch { static void normalizeNamespaceMarkers(std::string& str) { std::size_t pos = str.find( "::" ); - while ( pos != str.npos ) { + while ( pos != std::string::npos ) { str.replace( pos, 2, "." ); pos += 1; pos = str.find( "::", pos ); @@ -10192,7 +10512,7 @@ namespace Catch { xml( m_stream ) { m_preferences.shouldRedirectStdOut = true; - m_preferences.shouldReportAllAssertions = true; + m_preferences.shouldReportAllAssertions = false; m_shouldStoreSuccesfulAssertions = false; } @@ -10302,7 +10622,7 @@ namespace Catch { if( !rootName.empty() ) name = rootName + '/' + name; - if( sectionNode.hasAnyAssertions() + if ( sectionNode.stats.assertions.total() > 0 || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); @@ -10690,9 +11010,9 @@ namespace Catch { if (!rootName.empty()) name = rootName + '/' + name; - if ( sectionNode.hasAnyAssertions() + if ( sectionNode.stats.assertions.total() > 0 || !sectionNode.stdOut.empty() - || !sectionNode.stdErr.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)); diff --git a/packages/Catch2/extras/catch_amalgamated.hpp b/packages/Catch2/extras/catch_amalgamated.hpp index fdba759a7..b77bbb61a 100644 --- a/packages/Catch2/extras/catch_amalgamated.hpp +++ b/packages/Catch2/extras/catch_amalgamated.hpp @@ -6,8 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.5.2 -// Generated: 2024-01-15 14:06:34.036475 +// Catch v3.8.0 +// Generated: 2025-01-06 00:39:54.340018 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -87,6 +87,9 @@ // See e.g.: // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ +# ifndef __has_extension +# define __has_extension(x) 0 +# endif # include <TargetConditionals.h> # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) @@ -114,14 +117,14 @@ #ifdef __cplusplus -# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) -# define CATCH_CPP14_OR_GREATER -# endif - # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) # define CATCH_CPP17_OR_GREATER # endif +# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +# define CATCH_CPP20_OR_GREATER +# endif + #endif // Only GCC compiler should be used in this block, so other compilers trying to @@ -147,7 +150,7 @@ # define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ _Pragma( "GCC diagnostic ignored \"-Wshadow\"" ) -# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) +# define CATCH_INTERNAL_CONFIG_USE_BUILTIN_CONSTANT_P #endif @@ -171,35 +174,13 @@ // 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_CONFIG_USE_BUILTIN_CONSTANT_P # 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 -// like `std::string::~string` being called on an uninitialized value. -// -// For example, this code will likely segfault under IBM XL: -// ``` -// 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__) && !defined( __NVCOMPILER ) -# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ -# endif - - # define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") @@ -224,6 +205,27 @@ #endif // __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 +// like `std::string::~string` being called on an uninitialized value. +// +// For example, this code will likely segfault under IBM XL: +// ``` +// 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__ ) || defined( __NVCOMPILER ) +# define CATCH_INTERNAL_CONFIG_NO_USE_BUILTIN_CONSTANT_P +#endif + + //////////////////////////////////////////////////////////////////////////////// // We know some environments not to support full POSIX signals @@ -447,6 +449,22 @@ #endif +// The goal of this macro is to avoid evaluation of the arguments, but +// still have the compiler warn on problems inside... +#if defined( CATCH_INTERNAL_CONFIG_USE_BUILTIN_CONSTANT_P ) && \ + !defined( CATCH_INTERNAL_CONFIG_NO_USE_BUILTIN_CONSTANT_P ) && !defined(CATCH_CONFIG_USE_BUILTIN_CONSTANT_P) +#define CATCH_CONFIG_USE_BUILTIN_CONSTANT_P +#endif + +#if defined( CATCH_CONFIG_USE_BUILTIN_CONSTANT_P ) && \ + !defined( CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P ) +# define CATCH_INTERNAL_IGNORE_BUT_WARN( ... ) \ + (void)__builtin_constant_p( __VA_ARGS__ ) /* NOLINT(cppcoreguidelines-pro-type-vararg, \ + hicpp-vararg) */ +#else +# define CATCH_INTERNAL_IGNORE_BUT_WARN( ... ) +#endif + // Even if we do not think the compiler has that warning, we still have // to provide a macro that can be used by the code. #if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) @@ -483,13 +501,6 @@ # define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS #endif - -// The goal of this macro is to avoid evaluation of the arguments, but -// still have the compiler warn on problems inside... -#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) -# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) -#endif - #if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) # undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #elif defined(__clang__) && (__clang_major__ < 5) @@ -552,10 +563,15 @@ namespace Catch { friend void cleanUpContext(); public: - IResultCapture* getResultCapture() const { return m_resultCapture; } - IConfig const* getConfig() const { return m_config; } - void setResultCapture( IResultCapture* resultCapture ); - void setConfig( IConfig const* config ); + constexpr IResultCapture* getResultCapture() const { + return m_resultCapture; + } + constexpr IConfig const* getConfig() const { return m_config; } + constexpr void setResultCapture( IResultCapture* resultCapture ) { + m_resultCapture = resultCapture; + } + constexpr void setConfig( IConfig const* config ) { m_config = config; } + }; Context& getCurrentMutableContext(); @@ -666,7 +682,6 @@ namespace Catch { #define CATCH_INTERFACES_CAPTURE_HPP_INCLUDED #include <string> -#include <chrono> @@ -762,8 +777,8 @@ namespace Catch { 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 += (std::string& lhs, StringRef rhs); + friend std::ostream& operator << (std::ostream& os, StringRef str); friend std::string operator+(StringRef lhs, StringRef rhs); /** @@ -816,8 +831,10 @@ namespace Catch { }; }; - bool isOk( ResultWas::OfType resultType ); - bool isJustInfo( int flags ); + constexpr bool isOk( ResultWas::OfType resultType ) { + return ( resultType & ResultWas::FailureBit ) == 0; + } + constexpr bool isJustInfo( int flags ) { return flags == ResultWas::Info; } // ResultDisposition::Flags enum @@ -829,11 +846,18 @@ namespace Catch { SuppressFail = 0x08 // Failures are reported but do not fail the test }; }; - ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ); + constexpr 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 ); - inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } - bool shouldSuppressFailure( int flags ); + constexpr bool isFalseTest( int flags ) { + return ( flags & ResultDisposition::FalseTest ) != 0; + } + constexpr bool shouldSuppressFailure( int flags ) { + return ( flags & ResultDisposition::SuppressFail ) != 0; + } } // end namespace Catch @@ -1051,7 +1075,7 @@ namespace Catch { virtual void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) = 0; virtual void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, @@ -1299,7 +1323,7 @@ namespace Catch { int high_mild = 0; // 1.5 to 3 times IQR above Q3 int high_severe = 0; // more than 3 times IQR above Q3 - int total() const { + constexpr int total() const { return low_severe + low_mild + high_mild + high_severe; } }; @@ -1581,22 +1605,17 @@ namespace Catch { private: struct callable { virtual void call(Chronometer meter) const = 0; - virtual Catch::Detail::unique_ptr<callable> clone() const = 0; virtual ~callable(); // = default; callable() = default; - callable(callable const&) = default; - callable& operator=(callable const&) = default; + callable(callable&&) = default; + callable& operator=(callable&&) = default; }; template <typename Fun> struct model : public callable { model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {} model(Fun const& fun_) : fun(fun_) {} - 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)>()); } @@ -1610,14 +1629,8 @@ namespace Catch { Fun fun; }; - struct do_nothing { void operator()() const {} }; - - template <typename T> - BenchmarkFunction(model<T>* c) : f(c) {} - public: - BenchmarkFunction() - : f(new model<do_nothing>{ {} }) {} + BenchmarkFunction(); template <typename Fun, std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0> @@ -1627,20 +1640,12 @@ namespace Catch { BenchmarkFunction( BenchmarkFunction&& that ) noexcept: f( CATCH_MOVE( that.f ) ) {} - BenchmarkFunction(BenchmarkFunction const& that) - : f(that.f->clone()) {} - BenchmarkFunction& operator=( BenchmarkFunction&& that ) noexcept { f = CATCH_MOVE( that.f ); return *this; } - BenchmarkFunction& operator=(BenchmarkFunction const& that) { - f = that.f->clone(); - return *this; - } - void operator()(Chronometer meter) const { f->call(meter); } private: @@ -1777,7 +1782,7 @@ namespace Catch { template <typename Clock, typename Fun, typename... Args> TimingOf<Fun, Args...> measure(Fun&& fun, Args&&... args) { auto start = Clock::now(); - auto&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...); + auto&& r = Detail::complete_invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...); auto end = Clock::now(); auto delta = end - start; return { delta, CATCH_FORWARD(r), 1 }; @@ -1943,15 +1948,17 @@ namespace Catch { namespace Detail { template <typename Clock> std::vector<double> resolution(int k) { - std::vector<TimePoint<Clock>> times; - times.reserve(static_cast<size_t>(k + 1)); - for ( int i = 0; i < k + 1; ++i ) { - times.push_back( Clock::now() ); + const size_t points = static_cast<size_t>( k + 1 ); + // To avoid overhead from the branch inside vector::push_back, + // we allocate them all and then overwrite. + std::vector<TimePoint<Clock>> times(points); + for ( auto& time : times ) { + time = Clock::now(); } std::vector<double> deltas; deltas.reserve(static_cast<size_t>(k)); - for ( size_t idx = 1; idx < times.size(); ++idx ) { + for ( size_t idx = 1; idx < points; ++idx ) { deltas.push_back( static_cast<double>( ( times[idx] - times[idx - 1] ).count() ) ); } @@ -2100,12 +2107,12 @@ namespace Catch { : fun(CATCH_MOVE(func)), name(CATCH_MOVE(benchmarkName)) {} template <typename Clock> - ExecutionPlan prepare(const IConfig &cfg, Environment env) const { + ExecutionPlan prepare(const IConfig &cfg, Environment env) { auto min_time = env.clock_resolution.mean * Detail::minimum_ticks; auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(cfg.benchmarkWarmupTime())); auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<IDuration>(run_time), 1, fun); int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed)); - return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FDuration>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations }; + return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), CATCH_MOVE(fun), std::chrono::duration_cast<FDuration>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations }; } template <typename Clock = default_clock> @@ -2696,11 +2703,11 @@ namespace Catch { }; template<> struct StringMaker<signed char> { - static std::string convert(signed char c); + static std::string convert(signed char value); }; template<> struct StringMaker<unsigned char> { - static std::string convert(unsigned char c); + static std::string convert(unsigned char value); }; template<> @@ -3051,7 +3058,11 @@ struct ratio_string<std::milli> { #ifdef _MSC_VER std::tm timeInfo = {}; - gmtime_s(&timeInfo, &converted); + const auto err = gmtime_s(&timeInfo, &converted); + if ( err ) { + return "gmtime from provided timepoint has failed. This " + "happens e.g. with pre-1970 dates using Microsoft libc"; + } #else std::tm* timeInfo = std::gmtime(&converted); #endif @@ -3281,13 +3292,13 @@ namespace Catch { ITransientExpression const* m_transientExpression = nullptr; bool m_isNegated; public: - LazyExpression( bool isNegated ): + constexpr LazyExpression( bool isNegated ): m_isNegated(isNegated) {} - LazyExpression(LazyExpression const& other) = default; + constexpr LazyExpression(LazyExpression const& other) = default; LazyExpression& operator = ( LazyExpression const& ) = delete; - explicit operator bool() const { + constexpr explicit operator bool() const { return m_transientExpression != nullptr; } @@ -3344,6 +3355,18 @@ namespace Catch { #endif // CATCH_ASSERTION_RESULT_HPP_INCLUDED +#ifndef CATCH_CASE_SENSITIVE_HPP_INCLUDED +#define CATCH_CASE_SENSITIVE_HPP_INCLUDED + +namespace Catch { + + enum class CaseSensitive { Yes, No }; + +} // namespace Catch + +#endif // CATCH_CASE_SENSITIVE_HPP_INCLUDED + + #ifndef CATCH_CONFIG_HPP_INCLUDED #define CATCH_CONFIG_HPP_INCLUDED @@ -3363,18 +3386,6 @@ namespace Catch { #define CATCH_WILDCARD_PATTERN_HPP_INCLUDED - -#ifndef CATCH_CASE_SENSITIVE_HPP_INCLUDED -#define CATCH_CASE_SENSITIVE_HPP_INCLUDED - -namespace Catch { - - enum class CaseSensitive { Yes, No }; - -} // namespace Catch - -#endif // CATCH_CASE_SENSITIVE_HPP_INCLUDED - #include <string> namespace Catch @@ -4026,7 +4037,7 @@ namespace Catch { do { \ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \ catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -5147,6 +5158,86 @@ namespace Detail { #include <type_traits> #include <iosfwd> +/** \file + * Why does decomposing look the way it does: + * + * Conceptually, decomposing is simple. We change `REQUIRE( a == b )` into + * `Decomposer{} <= a == b`, so that `Decomposer{} <= a` is evaluated first, + * and our custom operator is used for `a == b`, because `a` is transformed + * into `ExprLhs<T&>` and then into `BinaryExpr<T&, U&>`. + * + * In practice, decomposing ends up a mess, because we have to support + * various fun things. + * + * 1) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with pointer constructor and deleted + * other constructors. Example: `REQUIRE((a <=> b) == 0)` in libstdc++ + * + * 2) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with consteval integer constructor. + * Example: `REQUIRE((a <=> b) == 0)` in current MSVC STL. + * + * 3) Types that have no linkage, and so we cannot form a reference to + * them. Example: some implementations of traits. + * + * 4) Starting with C++20, when the compiler sees `a == b`, it also uses + * `b == a` when constructing the overload set. For us this means that + * when the compiler handles `ExprLhs<T> == b`, it also tries to resolve + * the overload set for `b == ExprLhs<T>`. + * + * To accomodate these use cases, decomposer ended up rather complex. + * + * 1) These types are handled by adding SFINAE overloads to our comparison + * operators, checking whether `T == U` are comparable with the given + * operator, and if not, whether T (or U) are comparable with literal 0. + * If yes, the overload compares T (or U) with 0 literal inline in the + * definition. + * + * Note that for extra correctness, we check that the other type is + * either an `int` (literal 0 is captured as `int` by templates), or + * a `long` (some platforms use 0L for `NULL` and we want to support + * that for pointer comparisons). + * + * 2) For these types, `is_foo_comparable<T, int>` is true, but letting + * them fall into the overload that actually does `T == int` causes + * compilation error. Handling them requires that the decomposition + * is `constexpr`, so that P2564R3 applies and the `consteval` from + * their accompanying magic type is propagated through the `constexpr` + * call stack. + * + * However this is not enough to handle these types automatically, + * because our default is to capture types by reference, to avoid + * runtime copies. While these references cannot become dangling, + * they outlive the constexpr context and thus the default capture + * path cannot be actually constexpr. + * + * The solution is to capture these types by value, by explicitly + * specializing `Catch::capture_by_value` for them. Catch2 provides + * specialization for `std::foo_ordering`s, but users can specialize + * the trait for their own types as well. + * + * 3) If a type has no linkage, we also cannot capture it by reference. + * The solution is once again to capture them by value. We handle + * the common cases by using `std::is_arithmetic` as the default + * for `Catch::capture_by_value`, but that is only a some-effort + * heuristic. But as with 2), users can specialize `capture_by_value` + * for their own types as needed. + * + * 4) To support C++20 and make the SFINAE on our decomposing operators + * work, the SFINAE has to happen in return type, rather than in + * a template type. This is due to our use of logical type traits + * (`conjunction`/`disjunction`/`negation`), that we use to workaround + * an issue in older (9-) versions of GCC. I still blame C++20 for + * this, because without the comparison order switching, the logical + * traits could still be used in template type. + * + * There are also other side concerns, e.g. supporting both `REQUIRE(a)` + * and `REQUIRE(a == b)`, or making `REQUIRE_THAT(a, IsEqual(b))` slot + * nicely into the same expression handling logic, but these are rather + * straightforward and add only a bit of complexity (e.g. common base + * class for decomposed expressions). + */ + #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4389) // '==' : signed/unsigned mismatch @@ -5159,13 +5250,46 @@ namespace Detail { #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wsign-compare" +# pragma clang diagnostic ignored "-Wnon-virtual-dtor" #elif defined __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wsign-compare" +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#if defined(CATCH_CPP20_OR_GREATER) && __has_include(<compare>) +# include <compare> +# if defined( __cpp_lib_three_way_comparison ) && \ + __cpp_lib_three_way_comparison >= 201907L +# define CATCH_CONFIG_CPP20_COMPARE_OVERLOADS +# endif #endif namespace Catch { + namespace Detail { + // This was added in C++20, but we require only C++14 for now. + template <typename T> + using RemoveCVRef_t = std::remove_cv_t<std::remove_reference_t<T>>; + } + + // Note: There is nothing that stops us from extending this, + // e.g. to `std::is_scalar`, but the more encompassing + // traits are usually also more expensive. For now we + // keep this as it used to be and it can be changed later. + template <typename T> + struct capture_by_value + : std::integral_constant<bool, std::is_arithmetic<T>{}> {}; + +#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS ) + template <> + struct capture_by_value<std::strong_ordering> : std::true_type {}; + template <> + struct capture_by_value<std::weak_ordering> : std::true_type {}; + template <> + struct capture_by_value<std::partial_ordering> : std::true_type {}; +#endif + template <typename T> struct always_false : std::false_type {}; @@ -5173,23 +5297,22 @@ namespace Catch { bool m_isBinaryExpression; bool m_result; + protected: + ~ITransientExpression() = default; + public: - auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } - auto getResult() const -> bool { return m_result; } - virtual void streamReconstructedExpression( std::ostream &os ) const = 0; + constexpr auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } + constexpr auto getResult() const -> bool { return m_result; } + //! This function **has** to be overriden by the derived class. + virtual void streamReconstructedExpression( std::ostream& os ) const; - ITransientExpression( bool isBinaryExpression, bool result ) + constexpr ITransientExpression( bool isBinaryExpression, bool result ) : m_isBinaryExpression( isBinaryExpression ), m_result( result ) {} - ITransientExpression() = default; - ITransientExpression(ITransientExpression const&) = default; - ITransientExpression& operator=(ITransientExpression const&) = default; - - // We don't actually need a virtual destructor, but many static analysers - // complain if it's not here :-( - virtual ~ITransientExpression(); // = default; + constexpr ITransientExpression( ITransientExpression const& ) = default; + constexpr ITransientExpression& operator=( ITransientExpression const& ) = default; friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); @@ -5211,7 +5334,7 @@ namespace Catch { } public: - BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) + constexpr BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) : ITransientExpression{ true, comparisonResult }, m_lhs( lhs ), m_op( op ), @@ -5284,7 +5407,7 @@ namespace Catch { } public: - explicit UnaryExpr( LhsT lhs ) + explicit constexpr UnaryExpr( LhsT lhs ) : ITransientExpression{ false, static_cast<bool>(lhs) }, m_lhs( lhs ) {} @@ -5295,31 +5418,31 @@ namespace Catch { class ExprLhs { LhsT m_lhs; public: - explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} + explicit constexpr ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} #define CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( id, op ) \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - Detail::negation<std::is_arithmetic< \ - std::remove_reference_t<RhsT>>>>::value, \ + Detail::negation<capture_by_value< \ + Detail::RemoveCVRef_t<RhsT>>>>::value, \ BinaryExpr<LhsT, RhsT const&>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - std::is_arithmetic<RhsT>>::value, \ + capture_by_value<RhsT>>::value, \ BinaryExpr<LhsT, RhsT>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_eq_0_comparable<LhsT>, \ @@ -5332,8 +5455,8 @@ namespace Catch { static_cast<bool>( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_eq_0_comparable<RhsT>, \ @@ -5350,29 +5473,30 @@ namespace Catch { #undef CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR + #define CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( id, op ) \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - Detail::negation<std::is_arithmetic< \ - std::remove_reference_t<RhsT>>>>::value, \ + Detail::negation<capture_by_value< \ + Detail::RemoveCVRef_t<RhsT>>>>::value, \ BinaryExpr<LhsT, RhsT const&>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - std::is_arithmetic<RhsT>>::value, \ + capture_by_value<RhsT>>::value, \ BinaryExpr<LhsT, RhsT>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_##id##_0_comparable<LhsT>, \ @@ -5383,8 +5507,8 @@ namespace Catch { static_cast<bool>( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_##id##_0_comparable<RhsT>, \ @@ -5404,17 +5528,17 @@ namespace Catch { #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR( op ) \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ - !std::is_arithmetic<std::remove_reference_t<RhsT>>::value, \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ + !capture_by_value<Detail::RemoveCVRef_t<RhsT>>::value, \ BinaryExpr<LhsT, RhsT const&>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t<std::is_arithmetic<RhsT>::value, \ - BinaryExpr<LhsT, RhsT>> { \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t<capture_by_value<RhsT>::value, \ + BinaryExpr<LhsT, RhsT>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } @@ -5439,19 +5563,22 @@ namespace Catch { "wrap the expression inside parentheses, or decompose it"); } - auto makeUnaryExpr() const -> UnaryExpr<LhsT> { + constexpr auto makeUnaryExpr() const -> UnaryExpr<LhsT> { return UnaryExpr<LhsT>{ m_lhs }; } }; struct Decomposer { - 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&> { + template <typename T, + std::enable_if_t<!capture_by_value<Detail::RemoveCVRef_t<T>>::value, + int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs<T const&> { return ExprLhs<const T&>{ lhs }; } - template<typename T, std::enable_if_t<std::is_arithmetic<T>::value, int> = 0> - friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs<T> { + template <typename T, + std::enable_if_t<capture_by_value<T>::value, int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs<T> { return ExprLhs<T>{ value }; } }; @@ -5499,12 +5626,12 @@ namespace Catch { template<typename T> - void handleExpr( ExprLhs<T> const& expr ) { + constexpr void handleExpr( ExprLhs<T> const& expr ) { handleExpr( expr.makeUnaryExpr() ); } void handleExpr( ITransientExpression const& expr ); - void handleMessage(ResultWas::OfType resultType, StringRef message); + void handleMessage(ResultWas::OfType resultType, std::string&& message); void handleExceptionThrownAsExpected(); void handleUnexpectedExceptionNotThrown(); @@ -5560,8 +5687,6 @@ namespace Catch { #endif -#define INTERNAL_CATCH_REACT( handler ) handler.complete(); - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \ do { /* NOLINT(bugprone-infinite-loop) */ \ @@ -5571,10 +5696,10 @@ namespace Catch { INTERNAL_CATCH_TRY { \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \ + catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } 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 &&. @@ -5602,7 +5727,7 @@ namespace Catch { catch( ... ) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -5623,7 +5748,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -5647,7 +5772,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -5671,7 +5796,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) #endif // CATCH_CONFIG_DISABLE @@ -5786,7 +5911,9 @@ namespace Catch { namespace Detail { // Intentionally without linkage, as it should only be used as a dummy // symbol for static analysis. - int GetNewSectionHint(); + // The arguments are used as a dummy for checking warnings in the passed + // expressions. + int GetNewSectionHint( StringRef, const char* const = nullptr ); } // namespace Detail } // namespace Catch @@ -5797,7 +5924,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = \ + Catch::Detail::GetNewSectionHint(__VA_ARGS__); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION @@ -5807,7 +5935,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = Catch::Detail::GetNewSectionHint( \ + ( Catch::ReusableStringStream() << __VA_ARGS__ ).str()); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION @@ -5829,6 +5958,8 @@ namespace Catch { class ITestInvoker { public: + virtual void prepareTestCase(); + virtual void tearDownTestCase(); virtual void invoke() const = 0; virtual ~ITestInvoker(); // = default }; @@ -5866,7 +5997,8 @@ template<typename C> class TestInvokerAsMethod : public ITestInvoker { void (C::*m_testAsMethod)(); public: - TestInvokerAsMethod( void (C::*testAsMethod)() ) noexcept : m_testAsMethod( testAsMethod ) {} + constexpr TestInvokerAsMethod( void ( C::*testAsMethod )() ) noexcept: + m_testAsMethod( testAsMethod ) {} void invoke() const override { C obj; @@ -5881,6 +6013,34 @@ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) { return Detail::make_unique<TestInvokerAsMethod<C>>( testAsMethod ); } +template <typename C> +class TestInvokerFixture : public ITestInvoker { + void ( C::*m_testAsMethod )() const; + Detail::unique_ptr<C> m_fixture = nullptr; + +public: + constexpr TestInvokerFixture( void ( C::*testAsMethod )() const ) noexcept: + m_testAsMethod( testAsMethod ) {} + + void prepareTestCase() override { + m_fixture = Detail::make_unique<C>(); + } + + void tearDownTestCase() override { + m_fixture.reset(); + } + + void invoke() const override { + auto* f = m_fixture.get(); + ( f->*m_testAsMethod )(); + } +}; + +template<typename C> +Detail::unique_ptr<ITestInvoker> makeTestInvokerFixture( void ( C::*testAsMethod )() const ) { + return Detail::make_unique<TestInvokerFixture<C>>( testAsMethod ); +} + struct NameAndTags { constexpr NameAndTags( StringRef name_ = StringRef(), StringRef tags_ = StringRef() ) noexcept: @@ -5929,7 +6089,7 @@ struct AutoReg : Detail::NonCopyable { namespace Catch { namespace Detail { struct DummyUse { - DummyUse( void ( * )( int ) ); + DummyUse( void ( * )( int ), Catch::NameAndTags const& ); }; } // namespace Detail } // namespace Catch @@ -5941,18 +6101,18 @@ namespace Catch { // tests can compile. The redefined `TEST_CASE` shadows this with param. static int catchInternalSectionHint = 0; -# define INTERNAL_CATCH_TESTCASE2( fname ) \ +# define INTERNAL_CATCH_TESTCASE2( fname, ... ) \ static void fname( int ); \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ static const Catch::Detail::DummyUse INTERNAL_CATCH_UNIQUE_NAME( \ - dummyUser )( &(fname) ); \ + dummyUser )( &(fname), Catch::NameAndTags{ __VA_ARGS__ } ); \ CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ static void fname( [[maybe_unused]] int catchInternalSectionHint ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION # define INTERNAL_CATCH_TESTCASE( ... ) \ - INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ) ) + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ), __VA_ARGS__ ) #endif // CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT @@ -5977,6 +6137,26 @@ static int catchInternalSectionHint = 0; #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \ INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( 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() const; \ + }; \ + const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \ + Catch::makeTestInvokerFixture( &TestName::test ), \ + CATCH_INTERNAL_LINEINFO, \ + #ClassName##_catch_sr, \ + Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ + } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ + void TestName::test() const + #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( ClassName, ... ) \ + INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) + /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ @@ -6034,6 +6214,7 @@ static int catchInternalSectionHint = 0; #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ ) #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ ) @@ -6088,6 +6269,7 @@ static int catchInternalSectionHint = 0; #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_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0) #define CATCH_SECTION( ... ) #define CATCH_DYNAMIC_SECTION( ... ) @@ -6133,6 +6315,7 @@ static int catchInternalSectionHint = 0; #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ ) #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ ) @@ -6186,6 +6369,7 @@ static int catchInternalSectionHint = 0; #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 TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__) #define REGISTER_TEST_CASE( Function, ... ) (void)(0) #define SECTION( ... ) #define DYNAMIC_SECTION( ... ) @@ -6935,7 +7119,7 @@ namespace Catch { struct TestCaseInfo : Detail::NonCopyable { TestCaseInfo(StringRef _className, - NameAndTags const& _tags, + NameAndTags const& _nameAndTags, SourceLineInfo const& _lineInfo); bool isHidden() const; @@ -6976,14 +7160,24 @@ namespace Catch { TestCaseInfo* m_info; ITestInvoker* m_invoker; public: - TestCaseHandle(TestCaseInfo* info, ITestInvoker* invoker) : + constexpr TestCaseHandle(TestCaseInfo* info, ITestInvoker* invoker) : m_info(info), m_invoker(invoker) {} + void prepareTestCase() const { + m_invoker->prepareTestCase(); + } + + void tearDownTestCase() const { + m_invoker->tearDownTestCase(); + } + void invoke() const { m_invoker->invoke(); } - TestCaseInfo const& getTestCaseInfo() const; + constexpr TestCaseInfo const& getTestCaseInfo() const { + return *m_info; + } }; Detail::unique_ptr<TestCaseInfo> @@ -7046,7 +7240,7 @@ namespace Catch { class ExceptionTranslator : public IExceptionTranslator { public: - ExceptionTranslator( std::string(*translateFunction)( T const& ) ) + constexpr ExceptionTranslator( std::string(*translateFunction)( T const& ) ) : m_translateFunction( translateFunction ) {} @@ -7147,8 +7341,8 @@ namespace Catch { #define CATCH_VERSION_MACROS_HPP_INCLUDED #define CATCH_VERSION_MAJOR 3 -#define CATCH_VERSION_MINOR 5 -#define CATCH_VERSION_PATCH 2 +#define CATCH_VERSION_MINOR 8 +#define CATCH_VERSION_PATCH 0 #endif // CATCH_VERSION_MACROS_HPP_INCLUDED @@ -7820,6 +8014,34 @@ namespace Catch { #include <cstdint> #include <type_traits> +// Note: We use the usual enable-disable-autodetect dance here even though +// we do not support these in CMake configuration options (yet?). +// It is highly unlikely that we will need to make these actually +// user-configurable, but this will make it simpler if weend up needing +// it, and it provides an escape hatch to the users who need it. +#if defined( __SIZEOF_INT128__ ) +# define CATCH_CONFIG_INTERNAL_UINT128 +// Unlike GCC, MSVC does not polyfill umul as mulh + mul pair on ARM machines. +// Currently we do not bother doing this ourselves, but we could if it became +// important for perf. +#elif defined( _MSC_VER ) && defined( _M_X64 ) +# define CATCH_CONFIG_INTERNAL_MSVC_UMUL128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_UINT128 ) && \ + !defined( CATCH_CONFIG_NO_UINT128 ) && \ + !defined( CATCH_CONFIG_UINT128 ) +#define CATCH_CONFIG_UINT128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_NO_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_MSVC_UMUL128 ) +# define CATCH_CONFIG_MSVC_UMUL128 +# include <intrin.h> +#endif + + namespace Catch { namespace Detail { @@ -7847,65 +8069,57 @@ namespace Catch { struct ExtendedMultResult { T upper; T lower; - friend bool operator==( ExtendedMultResult const& lhs, - ExtendedMultResult const& rhs ) { - return lhs.upper == rhs.upper && lhs.lower == rhs.lower; + constexpr bool operator==( ExtendedMultResult const& rhs ) const { + return upper == rhs.upper && lower == rhs.lower; } }; - // Returns 128 bit result of multiplying lhs and rhs + /** + * Returns 128 bit result of lhs * rhs using portable C++ code + * + * This implementation is almost twice as fast as naive long multiplication, + * and unlike intrinsic-based approach, it supports constexpr evaluation. + */ constexpr ExtendedMultResult<std::uint64_t> - extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { - // We use the simple long multiplication approach for - // correctness, we can use platform specific builtins - // for performance later. - - // Split the lhs and rhs into two 32bit "digits", so that we can - // do 64 bit arithmetic to handle carry bits. - // 32b 32b 32b 32b - // lhs L1 L2 - // * rhs R1 R2 - // ------------------------ - // | R2 * L2 | - // | R2 * L1 | - // | R1 * L2 | - // | R1 * L1 | - // ------------------------- - // | a | b | c | d | - + extendedMultPortable(std::uint64_t lhs, std::uint64_t rhs) { #define CarryBits( x ) ( x >> 32 ) #define Digits( x ) ( x & 0xFF'FF'FF'FF ) - - auto r2l2 = Digits( rhs ) * Digits( lhs ); - auto r2l1 = Digits( rhs ) * CarryBits( lhs ); - auto r1l2 = CarryBits( rhs ) * Digits( lhs ); - auto r1l1 = CarryBits( rhs ) * CarryBits( lhs ); - - // Sum to columns first - auto d = Digits( r2l2 ); - auto c = CarryBits( r2l2 ) + Digits( r2l1 ) + Digits( r1l2 ); - auto b = CarryBits( r2l1 ) + CarryBits( r1l2 ) + Digits( r1l1 ); - auto a = CarryBits( r1l1 ); - - // Propagate carries between columns - c += CarryBits( d ); - b += CarryBits( c ); - a += CarryBits( b ); - - // Remove the used carries - c = Digits( c ); - b = Digits( b ); - a = Digits( a ); - + std::uint64_t lhs_low = Digits( lhs ); + std::uint64_t rhs_low = Digits( rhs ); + std::uint64_t low_low = ( lhs_low * rhs_low ); + std::uint64_t high_high = CarryBits( lhs ) * CarryBits( rhs ); + + // We add in carry bits from low-low already + std::uint64_t high_low = + ( CarryBits( lhs ) * rhs_low ) + CarryBits( low_low ); + // Note that we can add only low bits from high_low, to avoid + // overflow with large inputs + std::uint64_t low_high = + ( lhs_low * CarryBits( rhs ) ) + Digits( high_low ); + + return { high_high + CarryBits( high_low ) + CarryBits( low_high ), + ( low_high << 32 ) | Digits( low_low ) }; #undef CarryBits #undef Digits + } - return { - a << 32 | b, // upper 64 bits - c << 32 | d // lower 64 bits - }; + //! Returns 128 bit result of lhs * rhs + inline ExtendedMultResult<std::uint64_t> + extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { +#if defined( CATCH_CONFIG_UINT128 ) + auto result = __uint128_t( lhs ) * __uint128_t( rhs ); + return { static_cast<std::uint64_t>( result >> 64 ), + static_cast<std::uint64_t>( result ) }; +#elif defined( CATCH_CONFIG_MSVC_UMUL128 ) + std::uint64_t high; + std::uint64_t low = _umul128( lhs, rhs, &high ); + return { high, low }; +#else + return extendedMultPortable( lhs, rhs ); +#endif } + template <typename UInt> constexpr ExtendedMultResult<UInt> extendedMult( UInt lhs, UInt rhs ) { static_assert( std::is_unsigned<UInt>::value, @@ -7973,6 +8187,7 @@ namespace Catch { * get by simple casting ([0, ..., INT_MAX, INT_MIN, ..., -1]) */ template <typename OriginalType, typename UnsignedType> + constexpr std::enable_if_t<std::is_signed<OriginalType>::value, UnsignedType> transposeToNaturalOrder( UnsignedType in ) { static_assert( @@ -7993,6 +8208,7 @@ namespace Catch { template <typename OriginalType, typename UnsignedType> + constexpr std::enable_if_t<std::is_unsigned<OriginalType>::value, UnsignedType> transposeToNaturalOrder(UnsignedType in) { static_assert( @@ -8009,22 +8225,6 @@ namespace Catch { namespace Catch { - namespace Detail { - // Indirection to enable make_unsigned<bool> behaviour. - template <typename T> - struct make_unsigned { - using type = std::make_unsigned_t<T>; - }; - - template <> - struct make_unsigned<bool> { - using type = uint8_t; - }; - - template <typename T> - using make_unsigned_t = typename make_unsigned<T>::type; - } - /** * Implementation of uniform distribution on integers. * @@ -8040,7 +8240,7 @@ template <typename IntegerType> class uniform_integer_distribution { static_assert(std::is_integral<IntegerType>::value, "..."); - using UnsignedIntegerType = Detail::make_unsigned_t<IntegerType>; + using UnsignedIntegerType = Detail::SizedUnsignedType_t<sizeof(IntegerType)>; // Only the left bound is stored, and we store it converted to its // unsigned image. This avoids having to do the conversions inside @@ -8060,24 +8260,24 @@ class uniform_integer_distribution { // distribution will be reused many times and this is an optimization. UnsignedIntegerType m_rejection_threshold = 0; - UnsignedIntegerType computeDistance(IntegerType a, IntegerType b) const { + static constexpr UnsignedIntegerType computeDistance(IntegerType a, IntegerType b) { // This overflows and returns 0 if a == 0 and b == TYPE_MAX. // We handle that later when generating the number. return transposeTo(b) - transposeTo(a) + 1; } - static UnsignedIntegerType computeRejectionThreshold(UnsignedIntegerType ab_distance) { + static constexpr UnsignedIntegerType computeRejectionThreshold(UnsignedIntegerType ab_distance) { // distance == 0 means that we will return all possible values from // the type's range, and that we shouldn't reject anything. if ( ab_distance == 0 ) { return 0; } return ( ~ab_distance + 1 ) % ab_distance; } - static UnsignedIntegerType transposeTo(IntegerType in) { + static constexpr UnsignedIntegerType transposeTo(IntegerType in) { return Detail::transposeToNaturalOrder<IntegerType>( static_cast<UnsignedIntegerType>( in ) ); } - static IntegerType transposeBack(UnsignedIntegerType in) { + static constexpr IntegerType transposeBack(UnsignedIntegerType in) { return static_cast<IntegerType>( Detail::transposeToNaturalOrder<IntegerType>(in) ); } @@ -8085,7 +8285,7 @@ class uniform_integer_distribution { public: using result_type = IntegerType; - uniform_integer_distribution( IntegerType a, IntegerType b ): + constexpr uniform_integer_distribution( IntegerType a, IntegerType b ): m_a( transposeTo(a) ), m_ab_distance( computeDistance(a, b) ), m_rejection_threshold( computeRejectionThreshold(m_ab_distance) ) { @@ -8093,7 +8293,7 @@ public: } template <typename Generator> - result_type operator()( Generator& g ) { + constexpr result_type operator()( Generator& g ) { // All possible values of result_type are valid. if ( m_ab_distance == 0 ) { return transposeBack( Detail::fillBitsFrom<UnsignedIntegerType>( g ) ); @@ -8111,8 +8311,8 @@ public: return transposeBack(m_a + emul.upper); } - result_type a() const { return transposeBack(m_a); } - result_type b() const { return transposeBack(m_ab_distance + m_a - 1); } + constexpr result_type a() const { return transposeBack(m_a); } + constexpr result_type b() const { return transposeBack(m_ab_distance + m_a - 1); } }; } // end namespace Catch @@ -8525,7 +8725,7 @@ public: template <typename InputIterator, typename InputSentinel, - typename ResultType = typename std::iterator_traits<InputIterator>::value_type> + typename ResultType = std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type>> GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) { return GeneratorWrapper<ResultType>(Catch::Detail::make_unique<IteratorGenerator<ResultType>>(from, to)); } @@ -9322,7 +9522,7 @@ namespace Catch { std::vector<Catch::Detail::unique_ptr<EnumInfo>> m_enumInfos; - EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values) override; + EnumInfo const& registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values) override; }; std::vector<StringRef> parseEnums( StringRef enums ); @@ -9570,6 +9770,7 @@ namespace Catch { typename Sentinel, typename T, typename Comparator> + constexpr ForwardIter find_sentinel( ForwardIter start, Sentinel sentinel, T const& value, @@ -9585,6 +9786,7 @@ namespace Catch { typename Sentinel, typename T, typename Comparator> + constexpr std::ptrdiff_t count_sentinel( ForwardIter start, Sentinel sentinel, T const& value, @@ -9598,6 +9800,7 @@ namespace Catch { } template <typename ForwardIter, typename Sentinel> + constexpr std::enable_if_t<!std::is_same<ForwardIter, Sentinel>::value, std::ptrdiff_t> sentinel_distance( ForwardIter iter, const Sentinel sentinel ) { @@ -9610,8 +9813,8 @@ namespace Catch { } template <typename ForwardIter> - std::ptrdiff_t sentinel_distance( ForwardIter first, - ForwardIter last ) { + constexpr std::ptrdiff_t sentinel_distance( ForwardIter first, + ForwardIter last ) { return std::distance( first, last ); } @@ -9620,11 +9823,11 @@ namespace Catch { typename ForwardIter2, typename Sentinel2, typename Comparator> - bool check_element_counts( ForwardIter1 first_1, - const Sentinel1 end_1, - ForwardIter2 first_2, - const Sentinel2 end_2, - Comparator cmp ) { + constexpr bool check_element_counts( ForwardIter1 first_1, + const Sentinel1 end_1, + ForwardIter2 first_2, + const Sentinel2 end_2, + Comparator cmp ) { auto cursor = first_1; while ( cursor != end_1 ) { if ( find_sentinel( first_1, cursor, *cursor, cmp ) == @@ -9654,11 +9857,11 @@ namespace Catch { typename ForwardIter2, typename Sentinel2, typename Comparator> - bool is_permutation( ForwardIter1 first_1, - const Sentinel1 end_1, - ForwardIter2 first_2, - const Sentinel2 end_2, - Comparator cmp ) { + constexpr bool is_permutation( ForwardIter1 first_1, + const Sentinel1 end_1, + ForwardIter2 first_2, + const Sentinel2 end_2, + Comparator cmp ) { // TODO: no optimization for stronger iterators, because we would also have to constrain on sentinel vs not sentinel types // TODO: Comparator has to be "both sides", e.g. a == b => b == a // This skips shared prefix of the two ranges @@ -9795,7 +9998,7 @@ namespace Catch { JsonObjectWriter( std::ostream& os ); JsonObjectWriter( std::ostream& os, std::uint64_t indent_level ); - JsonObjectWriter( JsonObjectWriter&& source ); + JsonObjectWriter( JsonObjectWriter&& source ) noexcept; JsonObjectWriter& operator=( JsonObjectWriter&& source ) = delete; ~JsonObjectWriter(); @@ -9814,7 +10017,7 @@ namespace Catch { JsonArrayWriter( std::ostream& os ); JsonArrayWriter( std::ostream& os, std::uint64_t indent_level ); - JsonArrayWriter( JsonArrayWriter&& source ); + JsonArrayWriter( JsonArrayWriter&& source ) noexcept; JsonArrayWriter& operator=( JsonArrayWriter&& source ) = delete; ~JsonArrayWriter(); @@ -9905,106 +10108,67 @@ namespace Catch { #define CATCH_OUTPUT_REDIRECT_HPP_INCLUDED -#include <cstdio> -#include <iosfwd> +#include <cassert> #include <string> namespace Catch { - class RedirectedStream { - std::ostream& m_originalStream; - std::ostream& m_redirectionStream; - std::streambuf* m_prevBuf; - - public: - RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream ); - ~RedirectedStream(); - }; - - class RedirectedStdOut { - ReusableStringStream m_rss; - RedirectedStream m_cout; - public: - RedirectedStdOut(); - auto str() const -> std::string; - }; - - // StdErr has two constituent streams in C++, std::cerr and std::clog - // This means that we need to redirect 2 streams into 1 to keep proper - // order of writes - class RedirectedStdErr { - ReusableStringStream m_rss; - RedirectedStream m_cerr; - RedirectedStream m_clog; + class OutputRedirect { + bool m_redirectActive = false; + virtual void activateImpl() = 0; + virtual void deactivateImpl() = 0; public: - RedirectedStdErr(); - auto str() const -> std::string; - }; + enum Kind { + //! No redirect (noop implementation) + None, + //! Redirect std::cout/std::cerr/std::clog streams internally + Streams, + //! Redirect the stdout/stderr file descriptors into files + FileDescriptors, + }; - class RedirectedStreams { - public: - RedirectedStreams(RedirectedStreams const&) = delete; - RedirectedStreams& operator=(RedirectedStreams const&) = delete; - RedirectedStreams(RedirectedStreams&&) = delete; - RedirectedStreams& operator=(RedirectedStreams&&) = delete; + virtual ~OutputRedirect(); // = default; - RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr); - ~RedirectedStreams(); - private: - std::string& m_redirectedCout; - std::string& m_redirectedCerr; - RedirectedStdOut m_redirectedStdOut; - RedirectedStdErr m_redirectedStdErr; + // TODO: Do we want to check that redirect is not active before retrieving the output? + virtual std::string getStdout() = 0; + virtual std::string getStderr() = 0; + virtual void clearBuffers() = 0; + bool isActive() const { return m_redirectActive; } + void activate() { + assert( !m_redirectActive && "redirect is already active" ); + activateImpl(); + m_redirectActive = true; + } + void deactivate() { + assert( m_redirectActive && "redirect is not active" ); + deactivateImpl(); + m_redirectActive = false; + } }; -#if defined(CATCH_CONFIG_NEW_CAPTURE) - - // Windows's implementation of std::tmpfile is terrible (it tries - // to create a file inside system folder, thus requiring elevated - // privileges for the binary), so we have to use tmpnam(_s) and - // create the file ourselves there. - class TempFile { - public: - TempFile(TempFile const&) = delete; - TempFile& operator=(TempFile const&) = delete; - TempFile(TempFile&&) = delete; - TempFile& operator=(TempFile&&) = delete; - - TempFile(); - ~TempFile(); - - std::FILE* getFile(); - std::string getContents(); - - private: - std::FILE* m_file = nullptr; - #if defined(_MSC_VER) - char m_buffer[L_tmpnam] = { 0 }; - #endif - }; + bool isRedirectAvailable( OutputRedirect::Kind kind); + Detail::unique_ptr<OutputRedirect> makeOutputRedirect( bool actual ); + class RedirectGuard { + OutputRedirect* m_redirect; + bool m_activate; + bool m_previouslyActive; + bool m_moved = false; - class OutputRedirect { public: - OutputRedirect(OutputRedirect const&) = delete; - OutputRedirect& operator=(OutputRedirect const&) = delete; - OutputRedirect(OutputRedirect&&) = delete; - OutputRedirect& operator=(OutputRedirect&&) = delete; - + RedirectGuard( bool activate, OutputRedirect& redirectImpl ); + ~RedirectGuard() noexcept( false ); - OutputRedirect(std::string& stdout_dest, std::string& stderr_dest); - ~OutputRedirect(); + RedirectGuard( RedirectGuard const& ) = delete; + RedirectGuard& operator=( RedirectGuard const& ) = delete; - private: - int m_originalStdout = -1; - int m_originalStderr = -1; - TempFile m_stdoutFile; - TempFile m_stderrFile; - std::string& m_stdoutDest; - std::string& m_stderrDest; + // C++14 needs move-able guards to return them from functions + RedirectGuard( RedirectGuard&& rhs ) noexcept; + RedirectGuard& operator=( RedirectGuard&& rhs ) noexcept; }; -#endif + RedirectGuard scopedActivate( OutputRedirect& redirectImpl ); + RedirectGuard scopedDeactivate( OutputRedirect& redirectImpl ); } // end namespace Catch @@ -10327,6 +10491,7 @@ namespace Catch { class IConfig; class IEventListener; using IEventListenerPtr = Detail::unique_ptr<IEventListener>; + class OutputRedirect; /////////////////////////////////////////////////////////////////////////// @@ -10352,7 +10517,7 @@ namespace Catch { void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) override; void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, @@ -10413,7 +10578,7 @@ namespace Catch { private: - void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ); + void runCurrentTest(); void invokeActiveTestCase(); void resetAssertionInfo(); @@ -10446,6 +10611,7 @@ namespace Catch { std::vector<SectionEndInfo> m_unfinishedSections; std::vector<ITracker*> m_activeSections; TrackerContext m_trackerContext; + Detail::unique_ptr<OutputRedirect> m_outputRedirect; FatalConditionHandler m_fatalConditionhandler; bool m_lastAssertionPassed = false; bool m_shouldReportUnexpected = true; @@ -10709,6 +10875,8 @@ namespace Catch { std::vector<TestCaseHandle> const& getAllTests() const override; std::vector<TestCaseHandle> const& getAllTestsSorted( IConfig const& config ) const override; + ~TestRegistry() override; // = default + private: std::vector<Detail::unique_ptr<TestCaseInfo>> m_owned_test_infos; // Keeps a materialized vector for `getAllInfos`. @@ -10818,6 +10986,107 @@ namespace Catch { class Columns; + /** + * Abstraction for a string with ansi escape sequences that + * automatically skips over escapes when iterating. Only graphical + * escape sequences are considered. + * + * Internal representation: + * An escape sequence looks like \033[39;49m + * We need bidirectional iteration and the unbound length of escape + * sequences poses a problem for operator-- To make this work we'll + * replace the last `m` with a 0xff (this is a codepoint that won't have + * any utf-8 meaning). + */ + class AnsiSkippingString { + std::string m_string; + std::size_t m_size = 0; + + // perform 0xff replacement and calculate m_size + void preprocessString(); + + public: + class const_iterator; + using iterator = const_iterator; + // note: must be u-suffixed or this will cause a "truncation of + // constant value" warning on MSVC + static constexpr char sentinel = static_cast<char>( 0xffu ); + + explicit AnsiSkippingString( std::string const& text ); + explicit AnsiSkippingString( std::string&& text ); + + const_iterator begin() const; + const_iterator end() const; + + size_t size() const { return m_size; } + + std::string substring( const_iterator begin, + const_iterator end ) const; + }; + + class AnsiSkippingString::const_iterator { + friend AnsiSkippingString; + struct EndTag {}; + + const std::string* m_string; + std::string::const_iterator m_it; + + explicit const_iterator( const std::string& string, EndTag ): + m_string( &string ), m_it( string.end() ) {} + + void tryParseAnsiEscapes(); + void advance(); + void unadvance(); + + public: + using difference_type = std::ptrdiff_t; + using value_type = char; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::bidirectional_iterator_tag; + + explicit const_iterator( const std::string& string ): + m_string( &string ), m_it( string.begin() ) { + tryParseAnsiEscapes(); + } + + char operator*() const { return *m_it; } + + const_iterator& operator++() { + advance(); + return *this; + } + const_iterator operator++( int ) { + iterator prev( *this ); + operator++(); + return prev; + } + const_iterator& operator--() { + unadvance(); + return *this; + } + const_iterator operator--( int ) { + iterator prev( *this ); + operator--(); + return prev; + } + + bool operator==( const_iterator const& other ) const { + return m_it == other.m_it; + } + bool operator!=( const_iterator const& other ) const { + return !operator==( other ); + } + bool operator<=( const_iterator const& other ) const { + return m_it <= other.m_it; + } + + const_iterator oneBefore() const { + auto it = *this; + return --it; + } + }; + /** * Represents a column of text with specific width and indentation * @@ -10827,10 +11096,11 @@ namespace Catch { */ class Column { // String to be written out - std::string m_string; + AnsiSkippingString 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) + // 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; @@ -10845,16 +11115,19 @@ namespace Catch { Column const& m_column; // Where does the current line start? - size_t m_lineStart = 0; + AnsiSkippingString::const_iterator m_lineStart; // How long should the current line be? - size_t m_lineLength = 0; + AnsiSkippingString::const_iterator m_lineEnd; // How far have we checked the string to iterate? - size_t m_parsedTo = 0; + AnsiSkippingString::const_iterator m_parsedTo; // 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() ) {} + m_column( column ), + m_lineStart( m_column.m_string.end() ), + m_lineEnd( column.m_string.end() ), + m_parsedTo( column.m_string.end() ) {} // Calculates the length of the current line void calcLength(); @@ -10864,8 +11137,9 @@ namespace Catch { // Creates an indented and (optionally) suffixed string from // current iterator position, indentation and length. - std::string addIndentAndSuffix( size_t position, - size_t length ) const; + std::string addIndentAndSuffix( + AnsiSkippingString::const_iterator start, + AnsiSkippingString::const_iterator end ) const; public: using difference_type = std::ptrdiff_t; @@ -10882,7 +11156,8 @@ namespace Catch { const_iterator operator++( int ); bool operator==( const_iterator const& other ) const { - return m_lineStart == other.m_lineStart && &m_column == &other.m_column; + return m_lineStart == other.m_lineStart && + &m_column == &other.m_column; } bool operator!=( const_iterator const& other ) const { return !operator==( other ); @@ -10892,7 +11167,7 @@ namespace Catch { explicit Column( std::string const& text ): m_string( text ) {} explicit Column( std::string&& text ): - m_string( CATCH_MOVE(text)) {} + m_string( CATCH_MOVE( text ) ) {} Column& width( size_t newWidth ) & { assert( newWidth > 0 ); @@ -10923,7 +11198,9 @@ namespace Catch { size_t width() const { return m_width; } const_iterator begin() const { return const_iterator( *this ); } - const_iterator end() const { return { *this, const_iterator::EndTag{} }; } + const_iterator end() const { + return { *this, const_iterator::EndTag{} }; + } friend std::ostream& operator<<( std::ostream& os, Column const& col ); @@ -11025,16 +11302,25 @@ namespace Catch { #include <iosfwd> #include <vector> +#include <cstdint> namespace Catch { - enum class XmlFormatting { + enum class XmlFormatting : std::uint8_t { None = 0x00, Indent = 0x01, Newline = 0x02, }; - XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs); - XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs); + constexpr XmlFormatting operator|( XmlFormatting lhs, XmlFormatting rhs ) { + return static_cast<XmlFormatting>( static_cast<std::uint8_t>( lhs ) | + static_cast<std::uint8_t>( rhs ) ); + } + + constexpr XmlFormatting operator&( XmlFormatting lhs, XmlFormatting rhs ) { + return static_cast<XmlFormatting>( static_cast<std::uint8_t>( lhs ) & + static_cast<std::uint8_t>( rhs ) ); + } + /** * Helper for XML-encoding text (escaping angle brackets, quotes, etc) @@ -11046,7 +11332,9 @@ namespace Catch { public: enum ForWhat { ForTextNodes, ForAttributes }; - XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ); + constexpr XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ): + m_str( str ), m_forWhat( forWhat ) {} + void encodeTo( std::ostream& os ) const; @@ -11194,12 +11482,22 @@ namespace Catch { namespace Catch { +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wsign-compare" +# pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#elif defined __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsign-compare" +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + template<typename ArgT, typename MatcherT> class MatchExpr : public ITransientExpression { ArgT && m_arg; MatcherT const& m_matcher; public: - MatchExpr( ArgT && arg, MatcherT const& matcher ) + constexpr MatchExpr( ArgT && arg, MatcherT const& matcher ) : ITransientExpression{ true, matcher.match( arg ) }, // not forwarding arg here on purpose m_arg( CATCH_FORWARD(arg) ), m_matcher( matcher ) @@ -11212,6 +11510,13 @@ namespace Catch { } }; +#ifdef __clang__ +# pragma clang diagnostic pop +#elif defined __GNUC__ +# pragma GCC diagnostic pop +#endif + + namespace Matchers { template <typename ArgT> class MatcherBase; @@ -11222,7 +11527,8 @@ namespace Catch { void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher ); template<typename ArgT, typename MatcherT> - auto makeMatchExpr( ArgT && arg, MatcherT const& matcher ) -> MatchExpr<ArgT, MatcherT> { + constexpr MatchExpr<ArgT, MatcherT> + makeMatchExpr( ArgT&& arg, MatcherT const& matcher ) { return MatchExpr<ArgT, MatcherT>( CATCH_FORWARD(arg), matcher ); } @@ -11236,7 +11542,7 @@ namespace Catch { INTERNAL_CATCH_TRY { \ catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher ) ); \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -11246,7 +11552,10 @@ namespace Catch { Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \ if( catchAssertionHandler.allowThrows() ) \ try { \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ static_cast<void>(__VA_ARGS__ ); \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } \ catch( exceptionType const& ex ) { \ @@ -11257,7 +11566,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -12326,12 +12635,14 @@ namespace Catch { public: template <typename TargetRangeLike2, typename Equality2> + constexpr RangeEqualsMatcher( TargetRangeLike2&& range, Equality2&& predicate ): m_desired( CATCH_FORWARD( range ) ), m_predicate( CATCH_FORWARD( predicate ) ) {} template <typename RangeLike> + constexpr bool match( RangeLike&& rng ) const { auto rng_start = begin( rng ); const auto rng_end = end( rng ); @@ -12364,12 +12675,14 @@ namespace Catch { public: template <typename TargetRangeLike2, typename Equality2> + constexpr UnorderedRangeEqualsMatcher( TargetRangeLike2&& range, Equality2&& predicate ): m_desired( CATCH_FORWARD( range ) ), m_predicate( CATCH_FORWARD( predicate ) ) {} template <typename RangeLike> + constexpr bool match( RangeLike&& rng ) const { using std::begin; using std::end; @@ -12390,51 +12703,64 @@ namespace Catch { * Creates a matcher that checks if all elements in a range are equal * to all elements in another range. * - * Uses `std::equal_to` to do the comparison + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike> - std::enable_if_t<!Detail::is_matcher<RangeLike>::value, - RangeEqualsMatcher<RangeLike, std::equal_to<>>> - RangeEquals( RangeLike&& range ) { - return { CATCH_FORWARD( range ), std::equal_to<>{} }; + template <typename RangeLike, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + RangeEqualsMatcher<RangeLike, Equality> + RangeEquals( RangeLike&& range, + Equality&& predicate = std::equal_to<>{} ) { + return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; } /** * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range. + * to all elements in an initializer list. * - * Uses to provided predicate `predicate` to do the comparisons + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike, typename Equality> - RangeEqualsMatcher<RangeLike, Equality> - RangeEquals( RangeLike&& range, Equality&& predicate ) { - return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; + template <typename T, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + RangeEqualsMatcher<std::initializer_list<T>, Equality> + RangeEquals( std::initializer_list<T> range, + Equality&& predicate = std::equal_to<>{} ) { + return { range, CATCH_FORWARD( predicate ) }; } /** * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range, in some permutation + * to all elements in another range, in some permutation. * - * Uses `std::equal_to` to do the comparison + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike> - std::enable_if_t< - !Detail::is_matcher<RangeLike>::value, - UnorderedRangeEqualsMatcher<RangeLike, std::equal_to<>>> - UnorderedRangeEquals( RangeLike&& range ) { - return { CATCH_FORWARD( range ), std::equal_to<>{} }; + template <typename RangeLike, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + UnorderedRangeEqualsMatcher<RangeLike, Equality> + UnorderedRangeEquals( RangeLike&& range, + Equality&& predicate = std::equal_to<>{} ) { + return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; } /** * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range, in some permutation. + * to all elements in an initializer list, in some permutation. * - * Uses to provided predicate `predicate` to do the comparisons + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike, typename Equality> - UnorderedRangeEqualsMatcher<RangeLike, Equality> - UnorderedRangeEquals( RangeLike&& range, Equality&& predicate ) { - return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; + template <typename T, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + UnorderedRangeEqualsMatcher<std::initializer_list<T>, Equality> + UnorderedRangeEquals( std::initializer_list<T> range, + Equality&& predicate = std::equal_to<>{} ) { + return { range, CATCH_FORWARD( predicate ) }; } } // namespace Matchers } // namespace Catch @@ -13454,7 +13780,7 @@ namespace Catch { void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; - void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override; + void testCasePartialEnded(TestCaseStats const& testStats, uint64_t partNumber) override; void testCaseEnded( TestCaseStats const& testCaseStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; @@ -13606,7 +13932,7 @@ namespace Catch { : CumulativeReporterBase(CATCH_MOVE(config)) , xml(m_stream) { m_preferences.shouldRedirectStdOut = true; - m_preferences.shouldReportAllAssertions = true; + m_preferences.shouldReportAllAssertions = false; m_shouldStoreSuccesfulAssertions = false; } @@ -13622,7 +13948,7 @@ namespace Catch { xml.endElement(); } - void writeRun( TestRunNode const& groupNode ); + void writeRun( TestRunNode const& runNode ); void writeTestFile(StringRef filename, std::vector<TestCaseNode const*> const& testCaseNodes); @@ -13707,8 +14033,8 @@ namespace Catch { return "Reports test results as TeamCity service messages"s; } - void testRunStarting( TestRunInfo const& groupInfo ) override; - void testRunEnded( TestRunStats const& testGroupStats ) override; + void testRunStarting( TestRunInfo const& runInfo ) override; + void testRunEnded( TestRunStats const& runStats ) override; void assertionEnded(AssertionStats const& assertionStats) override; diff --git a/packages/Catch2/meson.build b/packages/Catch2/meson.build index 0a897520d..e8e681c47 100644 --- a/packages/Catch2/meson.build +++ b/packages/Catch2/meson.build @@ -8,7 +8,7 @@ project( 'catch2', 'cpp', - version: '3.5.2', # CML version placeholder, don't delete + version: '3.8.0', # CML version placeholder, don't delete license: 'BSL-1.0', meson_version: '>=0.54.1', ) diff --git a/packages/Catch2/meson_options.txt b/packages/Catch2/meson_options.txt index 769048735..b460f2de9 100644 --- a/packages/Catch2/meson_options.txt +++ b/packages/Catch2/meson_options.txt @@ -1 +1,2 @@ option('tests', type: 'boolean', value: true, description: 'Build the unit tests') +option('install', type: 'boolean', value: true, description: 'Install the library') diff --git a/packages/Catch2/src/CMakeLists.txt b/packages/Catch2/src/CMakeLists.txt index eb805ddd0..c40de040e 100644 --- a/packages/Catch2/src/CMakeLists.txt +++ b/packages/Catch2/src/CMakeLists.txt @@ -48,6 +48,7 @@ set(IMPL_HEADERS ${SOURCES_DIR}/catch_approx.hpp ${SOURCES_DIR}/catch_assertion_info.hpp ${SOURCES_DIR}/catch_assertion_result.hpp + ${SOURCES_DIR}/catch_case_sensitive.hpp ${SOURCES_DIR}/catch_config.hpp ${SOURCES_DIR}/catch_get_random_seed.hpp ${SOURCES_DIR}/catch_message.hpp @@ -67,13 +68,13 @@ set(IMPL_HEADERS ${SOURCES_DIR}/catch_version_macros.hpp ${SOURCES_DIR}/internal/catch_assertion_handler.hpp ${SOURCES_DIR}/internal/catch_case_insensitive_comparisons.hpp - ${SOURCES_DIR}/internal/catch_case_sensitive.hpp ${SOURCES_DIR}/internal/catch_clara.hpp ${SOURCES_DIR}/internal/catch_commandline.hpp ${SOURCES_DIR}/internal/catch_compare_traits.hpp ${SOURCES_DIR}/internal/catch_compiler_capabilities.hpp ${SOURCES_DIR}/internal/catch_config_android_logwrite.hpp ${SOURCES_DIR}/internal/catch_config_counter.hpp + ${SOURCES_DIR}/internal/catch_config_prefix_messages.hpp ${SOURCES_DIR}/internal/catch_config_static_analysis_support.hpp ${SOURCES_DIR}/internal/catch_config_uncaught_exceptions.hpp ${SOURCES_DIR}/internal/catch_config_wchar.hpp @@ -194,7 +195,6 @@ set(IMPL_SOURCES ${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_reusable_string_stream.cpp ${SOURCES_DIR}/internal/catch_run_context.cpp ${SOURCES_DIR}/internal/catch_section.cpp @@ -354,7 +354,7 @@ endif() add_library(Catch2::Catch2 ALIAS Catch2) if (ANDROID) - target_link_libraries(Catch2 INTERFACE log) + target_link_libraries(Catch2 PRIVATE log) endif() set_target_properties(Catch2 PROPERTIES @@ -362,29 +362,10 @@ set_target_properties(Catch2 PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION}) -# depend on bunch of C++11 and C++14 features to have C++14 enabled by default +# require C++14 target_compile_features(Catch2 PUBLIC - cxx_alignas - cxx_alignof - cxx_attributes - cxx_auto_type - cxx_constexpr - cxx_defaulted_functions - cxx_deleted_functions - cxx_final - cxx_lambdas - cxx_noexcept - cxx_override - cxx_range_for - cxx_rvalue_references - cxx_static_assert - cxx_strong_enums - cxx_trailing_return_types - cxx_unicode_literals - cxx_user_literals - cxx_variable_templates - cxx_variadic_macros + cxx_std_14 ) configure_file( @@ -475,26 +456,7 @@ if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS) ) target_compile_features(Catch2_buildall_interface INTERFACE - cxx_alignas - cxx_alignof - cxx_attributes - cxx_auto_type - cxx_constexpr - cxx_defaulted_functions - cxx_deleted_functions - cxx_final - cxx_lambdas - cxx_noexcept - cxx_override - cxx_range_for - cxx_rvalue_references - cxx_static_assert - cxx_strong_enums - cxx_trailing_return_types - cxx_unicode_literals - cxx_user_literals - cxx_variable_templates - cxx_variadic_macros + cxx_std_14 ) endif() diff --git a/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp b/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp index 3db40bb04..d0f88cfc2 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp @@ -45,12 +45,12 @@ namespace Catch { : fun(CATCH_MOVE(func)), name(CATCH_MOVE(benchmarkName)) {} template <typename Clock> - ExecutionPlan prepare(const IConfig &cfg, Environment env) const { + ExecutionPlan prepare(const IConfig &cfg, Environment env) { auto min_time = env.clock_resolution.mean * Detail::minimum_ticks; auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(cfg.benchmarkWarmupTime())); auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<IDuration>(run_time), 1, fun); int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed)); - return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FDuration>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations }; + return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), CATCH_MOVE(fun), std::chrono::duration_cast<FDuration>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations }; } template <typename Clock = default_clock> diff --git a/packages/Catch2/src/catch2/benchmark/catch_outlier_classification.hpp b/packages/Catch2/src/catch2/benchmark/catch_outlier_classification.hpp index e31d65d4a..b9a11782a 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_outlier_classification.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_outlier_classification.hpp @@ -19,7 +19,7 @@ namespace Catch { int high_mild = 0; // 1.5 to 3 times IQR above Q3 int high_severe = 0; // more than 3 times IQR above Q3 - int total() const { + constexpr int total() const { return low_severe + low_mild + high_mild + high_severe; } }; diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp b/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp index 7d27daf19..14d7f4506 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp @@ -63,8 +63,8 @@ namespace Catch { FDuration mean = FDuration(0); int i = 0; for (auto it = first; it < last; ++it, ++i) { - samples.push_back(FDuration(*it)); - mean += FDuration(*it); + samples.push_back(*it); + mean += *it; } mean /= i; diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp index b437d0492..66d4e619b 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp @@ -11,7 +11,13 @@ namespace Catch { namespace Benchmark { namespace Detail { + struct do_nothing { + void operator()() const {} + }; + BenchmarkFunction::callable::~callable() = default; + BenchmarkFunction::BenchmarkFunction(): + f( new model<do_nothing>{ {} } ){} } // namespace Detail } // namespace Benchmark } // namespace Catch diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp index 144e4b6e4..a03cb112f 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp @@ -35,22 +35,17 @@ namespace Catch { private: struct callable { virtual void call(Chronometer meter) const = 0; - virtual Catch::Detail::unique_ptr<callable> clone() const = 0; virtual ~callable(); // = default; callable() = default; - callable(callable const&) = default; - callable& operator=(callable const&) = default; + callable(callable&&) = default; + callable& operator=(callable&&) = default; }; template <typename Fun> struct model : public callable { model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {} model(Fun const& fun_) : fun(fun_) {} - 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)>()); } @@ -64,14 +59,8 @@ namespace Catch { Fun fun; }; - struct do_nothing { void operator()() const {} }; - - template <typename T> - BenchmarkFunction(model<T>* c) : f(c) {} - public: - BenchmarkFunction() - : f(new model<do_nothing>{ {} }) {} + BenchmarkFunction(); template <typename Fun, std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0> @@ -81,20 +70,12 @@ namespace Catch { BenchmarkFunction( BenchmarkFunction&& that ) noexcept: f( CATCH_MOVE( that.f ) ) {} - BenchmarkFunction(BenchmarkFunction const& that) - : f(that.f->clone()) {} - BenchmarkFunction& operator=( BenchmarkFunction&& that ) noexcept { f = CATCH_MOVE( that.f ); return *this; } - BenchmarkFunction& operator=(BenchmarkFunction const& that) { - f = that.f->clone(); - return *this; - } - void operator()(Chronometer meter) const { f->call(meter); } private: 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 8e3552796..6da24ce53 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp @@ -27,15 +27,17 @@ namespace Catch { namespace Detail { template <typename Clock> std::vector<double> resolution(int k) { - std::vector<TimePoint<Clock>> times; - times.reserve(static_cast<size_t>(k + 1)); - for ( int i = 0; i < k + 1; ++i ) { - times.push_back( Clock::now() ); + const size_t points = static_cast<size_t>( k + 1 ); + // To avoid overhead from the branch inside vector::push_back, + // we allocate them all and then overwrite. + std::vector<TimePoint<Clock>> times(points); + for ( auto& time : times ) { + time = Clock::now(); } std::vector<double> deltas; deltas.reserve(static_cast<size_t>(k)); - for ( size_t idx = 1; idx < times.size(); ++idx ) { + for ( size_t idx = 1; idx < points; ++idx ) { deltas.push_back( static_cast<double>( ( times[idx] - times[idx - 1] ).count() ) ); } diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp index 37494a68f..a8049072a 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp @@ -20,7 +20,7 @@ namespace Catch { template <typename Clock, typename Fun, typename... Args> TimingOf<Fun, Args...> measure(Fun&& fun, Args&&... args) { auto start = Clock::now(); - auto&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...); + auto&& r = Detail::complete_invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...); auto end = Clock::now(); auto delta = end - start; return { delta, CATCH_FORWARD(r), 1 }; diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp index 52cee4eea..2a5a2e038 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 <catch2/internal/catch_floating_point_helpers.hpp> #include <catch2/internal/catch_random_number_generator.hpp> +#include <catch2/internal/catch_uniform_integer_distribution.hpp> #include <algorithm> #include <cassert> @@ -38,7 +39,7 @@ namespace Catch { double const* last, Estimator& estimator ) { auto n = static_cast<size_t>( last - first ); - std::uniform_int_distribution<size_t> dist( 0, n - 1 ); + Catch::uniform_integer_distribution<size_t> dist( 0, n - 1 ); sample out; out.reserve( resamples ); @@ -177,7 +178,7 @@ namespace Catch { double diff = b - m; return a + diff * diff; } ) / - ( last - first ); + static_cast<double>( last - first ); return std::sqrt( variance ); } @@ -212,7 +213,7 @@ namespace Catch { double* first, double* last ) { auto count = last - first; - double idx = (count - 1) * k / static_cast<double>(q); + double idx = static_cast<double>((count - 1) * k) / static_cast<double>(q); int j = static_cast<int>(idx); double g = idx - j; std::nth_element(first, first + j, last); @@ -315,10 +316,10 @@ namespace Catch { double accel = sum_cubes / ( 6 * std::pow( sum_squares, 1.5 ) ); long n = static_cast<long>( resample.size() ); - double prob_n = + double prob_n = static_cast<double>( std::count_if( resample.begin(), resample.end(), - [point]( double x ) { return x < point; } ) / + [point]( double x ) { return x < point; } )) / static_cast<double>( n ); // degenerate case with uniform samples if ( Catch::Detail::directCompare( prob_n, 0. ) ) { diff --git a/packages/Catch2/src/catch2/catch_all.hpp b/packages/Catch2/src/catch2/catch_all.hpp index f2cc85365..571599550 100644 --- a/packages/Catch2/src/catch2/catch_all.hpp +++ b/packages/Catch2/src/catch2/catch_all.hpp @@ -26,6 +26,7 @@ #include <catch2/catch_approx.hpp> #include <catch2/catch_assertion_info.hpp> #include <catch2/catch_assertion_result.hpp> +#include <catch2/catch_case_sensitive.hpp> #include <catch2/catch_config.hpp> #include <catch2/catch_get_random_seed.hpp> #include <catch2/catch_message.hpp> @@ -47,7 +48,6 @@ #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> #include <catch2/internal/catch_compare_traits.hpp> diff --git a/packages/Catch2/src/catch2/catch_approx.cpp b/packages/Catch2/src/catch2/catch_approx.cpp index 9ad4ce3ee..08c6799b1 100644 --- a/packages/Catch2/src/catch2/catch_approx.cpp +++ b/packages/Catch2/src/catch2/catch_approx.cpp @@ -25,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( static_cast<double>(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_assertion_result.cpp b/packages/Catch2/src/catch2/catch_assertion_result.cpp index 61d4fd068..dba86229f 100644 --- a/packages/Catch2/src/catch2/catch_assertion_result.cpp +++ b/packages/Catch2/src/catch2/catch_assertion_result.cpp @@ -11,7 +11,7 @@ namespace Catch { - AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const & _lazyExpression): + AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const& _lazyExpression): lazyExpression(_lazyExpression), resultType(_resultType) {} diff --git a/packages/Catch2/src/catch2/internal/catch_case_sensitive.hpp b/packages/Catch2/src/catch2/catch_case_sensitive.hpp similarity index 100% rename from packages/Catch2/src/catch2/internal/catch_case_sensitive.hpp rename to packages/Catch2/src/catch2/catch_case_sensitive.hpp diff --git a/packages/Catch2/src/catch2/catch_config.cpp b/packages/Catch2/src/catch2/catch_config.cpp index 34f50f175..352c1f424 100644 --- a/packages/Catch2/src/catch2/catch_config.cpp +++ b/packages/Catch2/src/catch2/catch_config.cpp @@ -107,14 +107,16 @@ namespace Catch { // Insert the default reporter if user hasn't asked for a specific one if ( m_data.reporterSpecifications.empty() ) { - m_data.reporterSpecifications.push_back( { #if defined( CATCH_CONFIG_DEFAULT_REPORTER ) - CATCH_CONFIG_DEFAULT_REPORTER, + const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; #else - "console", + const auto default_spec = "console"; #endif - {}, {}, {} - } ); + auto parsed = parseReporterSpec(default_spec); + CATCH_ENFORCE( parsed, + "Cannot parse the provided default reporter spec: '" + << default_spec << '\'' ); + m_data.reporterSpecifications.push_back( std::move( *parsed ) ); } if ( enableBazelEnvSupport() ) { diff --git a/packages/Catch2/src/catch2/catch_message.cpp b/packages/Catch2/src/catch2/catch_message.cpp index 384f180e5..7b09ab874 100644 --- a/packages/Catch2/src/catch2/catch_message.cpp +++ b/packages/Catch2/src/catch2/catch_message.cpp @@ -91,6 +91,8 @@ namespace Catch { m_messages.back().message += " := "; start = pos; } + break; + default:; // noop } } assert(openings.empty() && "Mismatched openings"); diff --git a/packages/Catch2/src/catch2/catch_message.hpp b/packages/Catch2/src/catch2/catch_message.hpp index 05325ee8f..0a738341c 100644 --- a/packages/Catch2/src/catch2/catch_message.hpp +++ b/packages/Catch2/src/catch2/catch_message.hpp @@ -94,7 +94,7 @@ namespace Catch { do { \ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \ catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// diff --git a/packages/Catch2/src/catch2/catch_registry_hub.cpp b/packages/Catch2/src/catch2/catch_registry_hub.cpp index 8716db3a7..3a594678b 100644 --- a/packages/Catch2/src/catch2/catch_registry_hub.cpp +++ b/packages/Catch2/src/catch2/catch_registry_hub.cpp @@ -20,7 +20,6 @@ #include <catch2/internal/catch_noncopyable.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> #include <catch2/internal/catch_move_and_forward.hpp> -#include <catch2/internal/catch_reporter_registry.hpp> #include <exception> diff --git a/packages/Catch2/src/catch2/catch_session.cpp b/packages/Catch2/src/catch2/catch_session.cpp index f1ed5f9cc..a4a410c96 100644 --- a/packages/Catch2/src/catch2/catch_session.cpp +++ b/packages/Catch2/src/catch2/catch_session.cpp @@ -34,7 +34,13 @@ namespace Catch { namespace { - const int MaxExitCode = 255; + static constexpr int TestFailureExitCode = 42; + static constexpr int UnspecifiedErrorExitCode = 1; + static constexpr int AllTestsSkippedExitCode = 4; + static constexpr int NoTestsRunExitCode = 2; + static constexpr int UnmatchedTestSpecExitCode = 3; + static constexpr int InvalidTestSpecExitCode = 5; + IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) { auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config)); @@ -198,8 +204,7 @@ namespace Catch { } int Session::applyCommandLine( int argc, char const * const * argv ) { - if( m_startupExceptions ) - return 1; + if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; } auto result = m_cli.parse( Clara::Args( argc, argv ) ); @@ -215,7 +220,7 @@ namespace Catch { << TextFlow::Column( result.errorMessage() ).indent( 2 ) << "\n\n"; errStream->stream() << "Run with -? for usage\n\n" << std::flush; - return MaxExitCode; + return UnspecifiedErrorExitCode; } if( m_configData.showHelp ) @@ -285,8 +290,7 @@ namespace Catch { } int Session::runInternal() { - if( m_startupExceptions ) - return 1; + if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; } if (m_configData.showHelp || m_configData.libIdentify) { return 0; @@ -297,7 +301,7 @@ namespace Catch { << ") must be greater than the shard index (" << m_configData.shardIndex << ")\n" << std::flush; - return 1; + return UnspecifiedErrorExitCode; } CATCH_TRY { @@ -320,7 +324,7 @@ namespace Catch { for ( auto const& spec : invalidSpecs ) { reporter->reportInvalidTestSpec( spec ); } - return 1; + return InvalidTestSpecExitCode; } @@ -334,29 +338,29 @@ namespace Catch { if ( tests.hadUnmatchedTestSpecs() && m_config->warnAboutUnmatchedTestSpecs() ) { - return 3; + // UnmatchedTestSpecExitCode + return UnmatchedTestSpecExitCode; } if ( totals.testCases.total() == 0 && !m_config->zeroTestsCountAsSuccess() ) { - return 2; + return NoTestsRunExitCode; } if ( totals.testCases.total() > 0 && totals.testCases.total() == totals.testCases.skipped && !m_config->zeroTestsCountAsSuccess() ) { - return 4; + return AllTestsSkippedExitCode; } - // 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, static_cast<int>(totals.assertions.failed)); + if ( totals.assertions.failed ) { return TestFailureExitCode; } + return 0; + } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch( std::exception& ex ) { Catch::cerr() << ex.what() << '\n' << std::flush; - return MaxExitCode; + return UnspecifiedErrorExitCode; } #endif } diff --git a/packages/Catch2/src/catch2/catch_test_case_info.cpp b/packages/Catch2/src/catch2/catch_test_case_info.cpp index c38ee55ac..9d64e532a 100644 --- a/packages/Catch2/src/catch2/catch_test_case_info.cpp +++ b/packages/Catch2/src/catch2/catch_test_case_info.cpp @@ -22,26 +22,26 @@ namespace Catch { static_assert(sizeof(TestCaseProperties) == sizeof(TCP_underlying_type), "The size of the TestCaseProperties is different from the assumed size"); - TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) { return static_cast<TestCaseProperties>( static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs) ); } - TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) { lhs = static_cast<TestCaseProperties>( static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs) ); return lhs; } - TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) { + constexpr TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) { return static_cast<TestCaseProperties>( static_cast<TCP_underlying_type>(lhs) & static_cast<TCP_underlying_type>(rhs) ); } - bool applies(TestCaseProperties tcp) { + constexpr bool applies(TestCaseProperties tcp) { static_assert(static_cast<TCP_underlying_type>(TestCaseProperties::None) == 0, "TestCaseProperties::None must be equal to 0"); return tcp != TestCaseProperties::None; @@ -80,13 +80,15 @@ namespace Catch { return "Anonymous test case " + std::to_string(++counter); } - StringRef extractFilenamePart(StringRef filename) { + constexpr StringRef extractFilenamePart(StringRef filename) { size_t lastDot = filename.size(); while (lastDot > 0 && filename[lastDot - 1] != '.') { --lastDot; } - --lastDot; + // In theory we could have filename without any extension in it + if ( lastDot == 0 ) { return StringRef(); } + --lastDot; size_t nameStart = lastDot; while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') { --nameStart; @@ -96,7 +98,7 @@ namespace Catch { } // Returns the upper bound on size of extra tags ([#file]+[.]) - size_t sizeOfExtraTags(StringRef filepath) { + constexpr size_t sizeOfExtraTags(StringRef filepath) { // [.] is 3, [#] is another 3 const size_t extras = 3 + 3; return extractFilenamePart(filepath).size() + extras; @@ -257,8 +259,4 @@ namespace Catch { return lhs.tags < rhs.tags; } - TestCaseInfo const& TestCaseHandle::getTestCaseInfo() const { - return *m_info; - } - } // end namespace Catch diff --git a/packages/Catch2/src/catch2/catch_test_case_info.hpp b/packages/Catch2/src/catch2/catch_test_case_info.hpp index a2f4b43ec..3466660c0 100644 --- a/packages/Catch2/src/catch2/catch_test_case_info.hpp +++ b/packages/Catch2/src/catch2/catch_test_case_info.hpp @@ -68,7 +68,7 @@ namespace Catch { struct TestCaseInfo : Detail::NonCopyable { TestCaseInfo(StringRef _className, - NameAndTags const& _tags, + NameAndTags const& _nameAndTags, SourceLineInfo const& _lineInfo); bool isHidden() const; @@ -109,14 +109,24 @@ namespace Catch { TestCaseInfo* m_info; ITestInvoker* m_invoker; public: - TestCaseHandle(TestCaseInfo* info, ITestInvoker* invoker) : + constexpr TestCaseHandle(TestCaseInfo* info, ITestInvoker* invoker) : m_info(info), m_invoker(invoker) {} + void prepareTestCase() const { + m_invoker->prepareTestCase(); + } + + void tearDownTestCase() const { + m_invoker->tearDownTestCase(); + } + void invoke() const { m_invoker->invoke(); } - TestCaseInfo const& getTestCaseInfo() const; + constexpr TestCaseInfo const& getTestCaseInfo() const { + return *m_info; + } }; Detail::unique_ptr<TestCaseInfo> diff --git a/packages/Catch2/src/catch2/catch_test_macros.hpp b/packages/Catch2/src/catch2/catch_test_macros.hpp index 1088afbed..6ee2129f8 100644 --- a/packages/Catch2/src/catch2/catch_test_macros.hpp +++ b/packages/Catch2/src/catch2/catch_test_macros.hpp @@ -43,6 +43,7 @@ #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ ) #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ ) @@ -97,6 +98,7 @@ #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_TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0) #define CATCH_SECTION( ... ) #define CATCH_DYNAMIC_SECTION( ... ) @@ -142,6 +144,7 @@ #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( className, __VA_ARGS__ ) #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) #define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ ) @@ -195,6 +198,7 @@ #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 TEST_CASE_PERSISTENT_FIXTURE( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__) #define REGISTER_TEST_CASE( Function, ... ) (void)(0) #define SECTION( ... ) #define DYNAMIC_SECTION( ... ) diff --git a/packages/Catch2/src/catch2/catch_timer.cpp b/packages/Catch2/src/catch2/catch_timer.cpp index d75ea70c8..efdd8b7d0 100644 --- a/packages/Catch2/src/catch2/catch_timer.cpp +++ b/packages/Catch2/src/catch2/catch_timer.cpp @@ -13,7 +13,7 @@ namespace Catch { namespace { static auto getCurrentNanosecondsSinceEpoch() -> uint64_t { - return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); + return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now().time_since_epoch()).count(); } } // end unnamed namespace @@ -30,7 +30,7 @@ namespace Catch { return static_cast<unsigned int>(getElapsedMicroseconds()/1000); } auto Timer::getElapsedSeconds() const -> double { - return getElapsedMicroseconds()/1000000.0; + return static_cast<double>(getElapsedMicroseconds())/1000000.0; } diff --git a/packages/Catch2/src/catch2/catch_tostring.cpp b/packages/Catch2/src/catch2/catch_tostring.cpp index b97cf560d..83327cfb5 100644 --- a/packages/Catch2/src/catch2/catch_tostring.cpp +++ b/packages/Catch2/src/catch2/catch_tostring.cpp @@ -22,7 +22,10 @@ namespace Detail { const int hexThreshold = 255; struct Endianness { - enum Arch { Big, Little }; + enum Arch : uint8_t { + Big, + Little + }; static Arch which() { int one = 1; @@ -54,13 +57,13 @@ namespace Detail { } } // end unnamed namespace - std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string convertIntoString(StringRef string, bool escapeInvisibles) { 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) { + if (!escapeInvisibles) { ret += '"'; ret += string; ret += '"'; @@ -138,7 +141,7 @@ std::string StringMaker<char const*>::convert(char const* str) { return{ "{null string}" }; } } -std::string StringMaker<char*>::convert(char* str) { +std::string StringMaker<char*>::convert(char* str) { // NOLINT(readability-non-const-parameter) if (str) { return Detail::convertIntoString( str ); } else { @@ -235,17 +238,17 @@ std::string StringMaker<signed char>::convert(signed char value) { std::string StringMaker<char>::convert(char c) { return ::Catch::Detail::stringify(static_cast<signed char>(c)); } -std::string StringMaker<unsigned char>::convert(unsigned char c) { - return ::Catch::Detail::stringify(static_cast<char>(c)); +std::string StringMaker<unsigned char>::convert(unsigned char value) { + return ::Catch::Detail::stringify(static_cast<char>(value)); } -int StringMaker<float>::precision = 5; +int StringMaker<float>::precision = std::numeric_limits<float>::max_digits10; std::string StringMaker<float>::convert(float value) { return Detail::fpToString(value, precision) + 'f'; } -int StringMaker<double>::precision = 10; +int StringMaker<double>::precision = std::numeric_limits<double>::max_digits10; std::string StringMaker<double>::convert(double value) { return Detail::fpToString(value, precision); diff --git a/packages/Catch2/src/catch2/catch_tostring.hpp b/packages/Catch2/src/catch2/catch_tostring.hpp index f3fb0beb7..5f84196fd 100644 --- a/packages/Catch2/src/catch2/catch_tostring.hpp +++ b/packages/Catch2/src/catch2/catch_tostring.hpp @@ -279,11 +279,11 @@ namespace Catch { }; template<> struct StringMaker<signed char> { - static std::string convert(signed char c); + static std::string convert(signed char value); }; template<> struct StringMaker<unsigned char> { - static std::string convert(unsigned char c); + static std::string convert(unsigned char value); }; template<> @@ -634,7 +634,11 @@ struct ratio_string<std::milli> { #ifdef _MSC_VER std::tm timeInfo = {}; - gmtime_s(&timeInfo, &converted); + const auto err = gmtime_s(&timeInfo, &converted); + if ( err ) { + return "gmtime from provided timepoint has failed. This " + "happens e.g. with pre-1970 dates using Microsoft libc"; + } #else std::tm* timeInfo = std::gmtime(&converted); #endif diff --git a/packages/Catch2/src/catch2/catch_translate_exception.hpp b/packages/Catch2/src/catch2/catch_translate_exception.hpp index 5a4dc5e37..2bf8d3607 100644 --- a/packages/Catch2/src/catch2/catch_translate_exception.hpp +++ b/packages/Catch2/src/catch2/catch_translate_exception.hpp @@ -25,7 +25,7 @@ namespace Catch { class ExceptionTranslator : public IExceptionTranslator { public: - ExceptionTranslator( std::string(*translateFunction)( T const& ) ) + constexpr ExceptionTranslator( std::string(*translateFunction)( T const& ) ) : m_translateFunction( translateFunction ) {} diff --git a/packages/Catch2/src/catch2/catch_user_config.hpp.in b/packages/Catch2/src/catch2/catch_user_config.hpp.in index 10d61937f..3acda6884 100644 --- a/packages/Catch2/src/catch2/catch_user_config.hpp.in +++ b/packages/Catch2/src/catch2/catch_user_config.hpp.in @@ -178,6 +178,15 @@ #endif +#cmakedefine CATCH_CONFIG_USE_BUILTIN_CONSTANT_P +#cmakedefine CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P + +#if defined( CATCH_CONFIG_USE_BUILTIN_CONSTANT_P ) && \ + defined( CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P ) +# error Cannot force USE_BUILTIN_CONSTANT_P to both ON and OFF +#endif + + // ------ // Simple toggle defines // their value is never used and they cannot be overridden diff --git a/packages/Catch2/src/catch2/catch_version.cpp b/packages/Catch2/src/catch2/catch_version.cpp index 4e67d968c..9b34969e0 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, 5, 2, "", 0 ); + static Version version( 3, 8, 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 be2a04d2f..b77a455a0 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 5 -#define CATCH_VERSION_PATCH 2 +#define CATCH_VERSION_MINOR 8 +#define CATCH_VERSION_PATCH 0 #endif // CATCH_VERSION_MACROS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/generators/catch_generators_range.hpp b/packages/Catch2/src/catch2/generators/catch_generators_range.hpp index b67c1590e..55d673c23 100644 --- a/packages/Catch2/src/catch2/generators/catch_generators_range.hpp +++ b/packages/Catch2/src/catch2/generators/catch_generators_range.hpp @@ -91,7 +91,7 @@ public: template <typename InputIterator, typename InputSentinel, - typename ResultType = typename std::iterator_traits<InputIterator>::value_type> + typename ResultType = std::remove_const_t<typename std::iterator_traits<InputIterator>::value_type>> GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) { return GeneratorWrapper<ResultType>(Catch::Detail::make_unique<IteratorGenerator<ResultType>>(from, to)); } diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp index a1876a4ca..9e5431d24 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp @@ -9,7 +9,6 @@ #define CATCH_INTERFACES_CAPTURE_HPP_INCLUDED #include <string> -#include <chrono> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_result_type.hpp> @@ -77,7 +76,7 @@ namespace Catch { virtual void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) = 0; virtual void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_test_invoker.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_test_invoker.hpp index 3caeff9a3..124a7f7d4 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_test_invoker.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_test_invoker.hpp @@ -12,6 +12,8 @@ namespace Catch { class ITestInvoker { public: + virtual void prepareTestCase(); + virtual void tearDownTestCase(); virtual void invoke() const = 0; virtual ~ITestInvoker(); // = default }; diff --git a/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp b/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp index f650a7073..9a28e79c2 100644 --- a/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp +++ b/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp @@ -28,8 +28,8 @@ namespace Catch { void AssertionHandler::handleExpr( ITransientExpression const& expr ) { m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction ); } - void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef message) { - m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction ); + void AssertionHandler::handleMessage(ResultWas::OfType resultType, std::string&& message) { + m_resultCapture.handleMessage( m_assertionInfo, resultType, CATCH_MOVE(message), m_reaction ); } auto AssertionHandler::allowThrows() const -> bool { diff --git a/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp b/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp index 01dd7801d..c71c6898f 100644 --- a/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp +++ b/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp @@ -42,12 +42,12 @@ namespace Catch { template<typename T> - void handleExpr( ExprLhs<T> const& expr ) { + constexpr void handleExpr( ExprLhs<T> const& expr ) { handleExpr( expr.makeUnaryExpr() ); } void handleExpr( ITransientExpression const& expr ); - void handleMessage(ResultWas::OfType resultType, StringRef message); + void handleMessage(ResultWas::OfType resultType, std::string&& message); void handleExceptionThrownAsExpected(); void handleUnexpectedExceptionNotThrown(); diff --git a/packages/Catch2/src/catch2/internal/catch_clara.cpp b/packages/Catch2/src/catch2/internal/catch_clara.cpp index c76089eea..f9dd91385 100644 --- a/packages/Catch2/src/catch2/internal/catch_clara.cpp +++ b/packages/Catch2/src/catch2/internal/catch_clara.cpp @@ -76,7 +76,7 @@ namespace Catch { { TokenType::Argument, next.substr( delimiterPos + 1, next.size() ) } ); } else { - if ( next[1] != '-' && next.size() > 2 ) { + if ( next.size() > 1 && next[1] != '-' && next.size() > 2 ) { // Combined short args, e.g. "-ab" for "-a -b" for ( size_t i = 1; i < next.size(); ++i ) { m_tokenBuffer.push_back( diff --git a/packages/Catch2/src/catch2/internal/catch_commandline.cpp b/packages/Catch2/src/catch2/internal/catch_commandline.cpp index c29a801d3..212f17745 100644 --- a/packages/Catch2/src/catch2/internal/catch_commandline.cpp +++ b/packages/Catch2/src/catch2/internal/catch_commandline.cpp @@ -47,7 +47,7 @@ namespace Catch { line = trim(line); if( !line.empty() && !startsWith( line, '#' ) ) { if( !startsWith( line, '"' ) ) - line = '"' + line + '"'; + line = '"' + CATCH_MOVE(line) + '"'; config.testsOrTags.push_back( line ); config.testsOrTags.emplace_back( "," ); } diff --git a/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp b/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp index dacae01b7..d544b00c0 100644 --- a/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp +++ b/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp @@ -29,14 +29,14 @@ #ifdef __cplusplus -# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) -# define CATCH_CPP14_OR_GREATER -# endif - # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) # define CATCH_CPP17_OR_GREATER # endif +# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +# define CATCH_CPP20_OR_GREATER +# endif + #endif // Only GCC compiler should be used in this block, so other compilers trying to @@ -62,7 +62,7 @@ # define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ _Pragma( "GCC diagnostic ignored \"-Wshadow\"" ) -# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) +# define CATCH_INTERNAL_CONFIG_USE_BUILTIN_CONSTANT_P #endif @@ -86,35 +86,13 @@ // 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_CONFIG_USE_BUILTIN_CONSTANT_P # 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 -// like `std::string::~string` being called on an uninitialized value. -// -// For example, this code will likely segfault under IBM XL: -// ``` -// 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__) && !defined( __NVCOMPILER ) -# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ -# endif - - # define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") @@ -139,6 +117,27 @@ #endif // __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 +// like `std::string::~string` being called on an uninitialized value. +// +// For example, this code will likely segfault under IBM XL: +// ``` +// 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__ ) || defined( __NVCOMPILER ) +# define CATCH_INTERNAL_CONFIG_NO_USE_BUILTIN_CONSTANT_P +#endif + + //////////////////////////////////////////////////////////////////////////////// // We know some environments not to support full POSIX signals @@ -362,6 +361,22 @@ #endif +// The goal of this macro is to avoid evaluation of the arguments, but +// still have the compiler warn on problems inside... +#if defined( CATCH_INTERNAL_CONFIG_USE_BUILTIN_CONSTANT_P ) && \ + !defined( CATCH_INTERNAL_CONFIG_NO_USE_BUILTIN_CONSTANT_P ) && !defined(CATCH_CONFIG_USE_BUILTIN_CONSTANT_P) +#define CATCH_CONFIG_USE_BUILTIN_CONSTANT_P +#endif + +#if defined( CATCH_CONFIG_USE_BUILTIN_CONSTANT_P ) && \ + !defined( CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P ) +# define CATCH_INTERNAL_IGNORE_BUT_WARN( ... ) \ + (void)__builtin_constant_p( __VA_ARGS__ ) /* NOLINT(cppcoreguidelines-pro-type-vararg, \ + hicpp-vararg) */ +#else +# define CATCH_INTERNAL_IGNORE_BUT_WARN( ... ) +#endif + // Even if we do not think the compiler has that warning, we still have // to provide a macro that can be used by the code. #if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) @@ -398,13 +413,6 @@ # define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS #endif - -// The goal of this macro is to avoid evaluation of the arguments, but -// still have the compiler warn on problems inside... -#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) -# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) -#endif - #if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) # undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #elif defined(__clang__) && (__clang_major__ < 5) diff --git a/packages/Catch2/src/catch2/internal/catch_console_colour.cpp b/packages/Catch2/src/catch2/internal/catch_console_colour.cpp index e1238816a..142de9e65 100644 --- a/packages/Catch2/src/catch2/internal/catch_console_colour.cpp +++ b/packages/Catch2/src/catch2/internal/catch_console_colour.cpp @@ -161,7 +161,7 @@ namespace { #endif // Windows/ ANSI/ None -#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) +#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) || defined( __GLIBC__ ) # define CATCH_INTERNAL_HAS_ISATTY # include <unistd.h> #endif @@ -230,21 +230,21 @@ namespace { namespace Catch { - Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection, + Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode colourSelection, IStream* stream ) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) - if ( implSelection == ColourMode::Win32 ) { + if ( colourSelection == ColourMode::Win32 ) { return Detail::make_unique<Win32ColourImpl>( stream ); } #endif - if ( implSelection == ColourMode::ANSI ) { + if ( colourSelection == ColourMode::ANSI ) { return Detail::make_unique<ANSIColourImpl>( stream ); } - if ( implSelection == ColourMode::None ) { + if ( colourSelection == ColourMode::None ) { return Detail::make_unique<NoColourImpl>( stream ); } - if ( implSelection == ColourMode::PlatformDefault) { + if ( colourSelection == ColourMode::PlatformDefault) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { return Detail::make_unique<Win32ColourImpl>( stream ); @@ -256,7 +256,7 @@ namespace Catch { return Detail::make_unique<NoColourImpl>( stream ); } - CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(implSelection) ); + CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(colourSelection) ); } bool isColourImplAvailable( ColourMode colourSelection ) { diff --git a/packages/Catch2/src/catch2/internal/catch_context.cpp b/packages/Catch2/src/catch2/internal/catch_context.cpp index 3b1cc2774..8acf1eda6 100644 --- a/packages/Catch2/src/catch2/internal/catch_context.cpp +++ b/packages/Catch2/src/catch2/internal/catch_context.cpp @@ -27,12 +27,6 @@ namespace Catch { return *Context::currentContext; } - void Context::setResultCapture( IResultCapture* resultCapture ) { - m_resultCapture = resultCapture; - } - - void Context::setConfig( IConfig const* config ) { m_config = config; } - 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 6ccb3b318..4d8a5da1b 100644 --- a/packages/Catch2/src/catch2/internal/catch_context.hpp +++ b/packages/Catch2/src/catch2/internal/catch_context.hpp @@ -26,10 +26,15 @@ namespace Catch { friend void cleanUpContext(); public: - IResultCapture* getResultCapture() const { return m_resultCapture; } - IConfig const* getConfig() const { return m_config; } - void setResultCapture( IResultCapture* resultCapture ); - void setConfig( IConfig const* config ); + constexpr IResultCapture* getResultCapture() const { + return m_resultCapture; + } + constexpr IConfig const* getConfig() const { return m_config; } + constexpr void setResultCapture( IResultCapture* resultCapture ) { + m_resultCapture = resultCapture; + } + constexpr void setConfig( IConfig const* config ) { m_config = config; } + }; Context& getCurrentMutableContext(); diff --git a/packages/Catch2/src/catch2/internal/catch_decomposer.cpp b/packages/Catch2/src/catch2/internal/catch_decomposer.cpp index 3f398fcc2..17a7bc955 100644 --- a/packages/Catch2/src/catch2/internal/catch_decomposer.cpp +++ b/packages/Catch2/src/catch2/internal/catch_decomposer.cpp @@ -10,7 +10,12 @@ namespace Catch { - ITransientExpression::~ITransientExpression() = default; + void ITransientExpression::streamReconstructedExpression( + std::ostream& os ) const { + // We can't make this function pure virtual to keep ITransientExpression + // constexpr, so we write error message instead + os << "Some class derived from ITransientExpression without overriding streamReconstructedExpression"; + } void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) { if( lhs.size() + rhs.size() < 40 && diff --git a/packages/Catch2/src/catch2/internal/catch_decomposer.hpp b/packages/Catch2/src/catch2/internal/catch_decomposer.hpp index e0e46c1de..adce89f2a 100644 --- a/packages/Catch2/src/catch2/internal/catch_decomposer.hpp +++ b/packages/Catch2/src/catch2/internal/catch_decomposer.hpp @@ -13,10 +13,91 @@ #include <catch2/internal/catch_compare_traits.hpp> #include <catch2/internal/catch_test_failure_exception.hpp> #include <catch2/internal/catch_logical_traits.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> #include <type_traits> #include <iosfwd> +/** \file + * Why does decomposing look the way it does: + * + * Conceptually, decomposing is simple. We change `REQUIRE( a == b )` into + * `Decomposer{} <= a == b`, so that `Decomposer{} <= a` is evaluated first, + * and our custom operator is used for `a == b`, because `a` is transformed + * into `ExprLhs<T&>` and then into `BinaryExpr<T&, U&>`. + * + * In practice, decomposing ends up a mess, because we have to support + * various fun things. + * + * 1) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with pointer constructor and deleted + * other constructors. Example: `REQUIRE((a <=> b) == 0)` in libstdc++ + * + * 2) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with consteval integer constructor. + * Example: `REQUIRE((a <=> b) == 0)` in current MSVC STL. + * + * 3) Types that have no linkage, and so we cannot form a reference to + * them. Example: some implementations of traits. + * + * 4) Starting with C++20, when the compiler sees `a == b`, it also uses + * `b == a` when constructing the overload set. For us this means that + * when the compiler handles `ExprLhs<T> == b`, it also tries to resolve + * the overload set for `b == ExprLhs<T>`. + * + * To accomodate these use cases, decomposer ended up rather complex. + * + * 1) These types are handled by adding SFINAE overloads to our comparison + * operators, checking whether `T == U` are comparable with the given + * operator, and if not, whether T (or U) are comparable with literal 0. + * If yes, the overload compares T (or U) with 0 literal inline in the + * definition. + * + * Note that for extra correctness, we check that the other type is + * either an `int` (literal 0 is captured as `int` by templates), or + * a `long` (some platforms use 0L for `NULL` and we want to support + * that for pointer comparisons). + * + * 2) For these types, `is_foo_comparable<T, int>` is true, but letting + * them fall into the overload that actually does `T == int` causes + * compilation error. Handling them requires that the decomposition + * is `constexpr`, so that P2564R3 applies and the `consteval` from + * their accompanying magic type is propagated through the `constexpr` + * call stack. + * + * However this is not enough to handle these types automatically, + * because our default is to capture types by reference, to avoid + * runtime copies. While these references cannot become dangling, + * they outlive the constexpr context and thus the default capture + * path cannot be actually constexpr. + * + * The solution is to capture these types by value, by explicitly + * specializing `Catch::capture_by_value` for them. Catch2 provides + * specialization for `std::foo_ordering`s, but users can specialize + * the trait for their own types as well. + * + * 3) If a type has no linkage, we also cannot capture it by reference. + * The solution is once again to capture them by value. We handle + * the common cases by using `std::is_arithmetic` as the default + * for `Catch::capture_by_value`, but that is only a some-effort + * heuristic. But as with 2), users can specialize `capture_by_value` + * for their own types as needed. + * + * 4) To support C++20 and make the SFINAE on our decomposing operators + * work, the SFINAE has to happen in return type, rather than in + * a template type. This is due to our use of logical type traits + * (`conjunction`/`disjunction`/`negation`), that we use to workaround + * an issue in older (9-) versions of GCC. I still blame C++20 for + * this, because without the comparison order switching, the logical + * traits could still be used in template type. + * + * There are also other side concerns, e.g. supporting both `REQUIRE(a)` + * and `REQUIRE(a == b)`, or making `REQUIRE_THAT(a, IsEqual(b))` slot + * nicely into the same expression handling logic, but these are rather + * straightforward and add only a bit of complexity (e.g. common base + * class for decomposed expressions). + */ + #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4389) // '==' : signed/unsigned mismatch @@ -29,13 +110,46 @@ #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wsign-compare" +# pragma clang diagnostic ignored "-Wnon-virtual-dtor" #elif defined __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wsign-compare" +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#if defined(CATCH_CPP20_OR_GREATER) && __has_include(<compare>) +# include <compare> +# if defined( __cpp_lib_three_way_comparison ) && \ + __cpp_lib_three_way_comparison >= 201907L +# define CATCH_CONFIG_CPP20_COMPARE_OVERLOADS +# endif #endif namespace Catch { + namespace Detail { + // This was added in C++20, but we require only C++14 for now. + template <typename T> + using RemoveCVRef_t = std::remove_cv_t<std::remove_reference_t<T>>; + } + + // Note: There is nothing that stops us from extending this, + // e.g. to `std::is_scalar`, but the more encompassing + // traits are usually also more expensive. For now we + // keep this as it used to be and it can be changed later. + template <typename T> + struct capture_by_value + : std::integral_constant<bool, std::is_arithmetic<T>{}> {}; + +#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS ) + template <> + struct capture_by_value<std::strong_ordering> : std::true_type {}; + template <> + struct capture_by_value<std::weak_ordering> : std::true_type {}; + template <> + struct capture_by_value<std::partial_ordering> : std::true_type {}; +#endif + template <typename T> struct always_false : std::false_type {}; @@ -43,23 +157,22 @@ namespace Catch { bool m_isBinaryExpression; bool m_result; + protected: + ~ITransientExpression() = default; + public: - auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } - auto getResult() const -> bool { return m_result; } - virtual void streamReconstructedExpression( std::ostream &os ) const = 0; + constexpr auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } + constexpr auto getResult() const -> bool { return m_result; } + //! This function **has** to be overriden by the derived class. + virtual void streamReconstructedExpression( std::ostream& os ) const; - ITransientExpression( bool isBinaryExpression, bool result ) + constexpr ITransientExpression( bool isBinaryExpression, bool result ) : m_isBinaryExpression( isBinaryExpression ), m_result( result ) {} - ITransientExpression() = default; - ITransientExpression(ITransientExpression const&) = default; - ITransientExpression& operator=(ITransientExpression const&) = default; - - // We don't actually need a virtual destructor, but many static analysers - // complain if it's not here :-( - virtual ~ITransientExpression(); // = default; + constexpr ITransientExpression( ITransientExpression const& ) = default; + constexpr ITransientExpression& operator=( ITransientExpression const& ) = default; friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); @@ -81,7 +194,7 @@ namespace Catch { } public: - BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) + constexpr BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) : ITransientExpression{ true, comparisonResult }, m_lhs( lhs ), m_op( op ), @@ -154,7 +267,7 @@ namespace Catch { } public: - explicit UnaryExpr( LhsT lhs ) + explicit constexpr UnaryExpr( LhsT lhs ) : ITransientExpression{ false, static_cast<bool>(lhs) }, m_lhs( lhs ) {} @@ -165,31 +278,31 @@ namespace Catch { class ExprLhs { LhsT m_lhs; public: - explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} + explicit constexpr ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} #define CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( id, op ) \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - Detail::negation<std::is_arithmetic< \ - std::remove_reference_t<RhsT>>>>::value, \ + Detail::negation<capture_by_value< \ + Detail::RemoveCVRef_t<RhsT>>>>::value, \ BinaryExpr<LhsT, RhsT const&>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - std::is_arithmetic<RhsT>>::value, \ + capture_by_value<RhsT>>::value, \ BinaryExpr<LhsT, RhsT>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_eq_0_comparable<LhsT>, \ @@ -202,8 +315,8 @@ namespace Catch { static_cast<bool>( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_eq_0_comparable<RhsT>, \ @@ -220,29 +333,30 @@ namespace Catch { #undef CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR + #define CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( id, op ) \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - Detail::negation<std::is_arithmetic< \ - std::remove_reference_t<RhsT>>>>::value, \ + Detail::negation<capture_by_value< \ + Detail::RemoveCVRef_t<RhsT>>>>::value, \ BinaryExpr<LhsT, RhsT const&>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \ - std::is_arithmetic<RhsT>>::value, \ + capture_by_value<RhsT>>::value, \ BinaryExpr<LhsT, RhsT>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_##id##_0_comparable<LhsT>, \ @@ -253,8 +367,8 @@ namespace Catch { static_cast<bool>( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \ Detail::is_##id##_0_comparable<RhsT>, \ @@ -274,17 +388,17 @@ namespace Catch { #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR( op ) \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ - !std::is_arithmetic<std::remove_reference_t<RhsT>>::value, \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ + !capture_by_value<Detail::RemoveCVRef_t<RhsT>>::value, \ BinaryExpr<LhsT, RhsT const&>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template <typename RhsT> \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t<std::is_arithmetic<RhsT>::value, \ - BinaryExpr<LhsT, RhsT>> { \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t<capture_by_value<RhsT>::value, \ + BinaryExpr<LhsT, RhsT>> { \ return { \ static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } @@ -309,19 +423,22 @@ namespace Catch { "wrap the expression inside parentheses, or decompose it"); } - auto makeUnaryExpr() const -> UnaryExpr<LhsT> { + constexpr auto makeUnaryExpr() const -> UnaryExpr<LhsT> { return UnaryExpr<LhsT>{ m_lhs }; } }; struct Decomposer { - 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&> { + template <typename T, + std::enable_if_t<!capture_by_value<Detail::RemoveCVRef_t<T>>::value, + int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs<T const&> { return ExprLhs<const T&>{ lhs }; } - template<typename T, std::enable_if_t<std::is_arithmetic<T>::value, int> = 0> - friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs<T> { + template <typename T, + std::enable_if_t<capture_by_value<T>::value, int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs<T> { return ExprLhs<T>{ value }; } }; diff --git a/packages/Catch2/src/catch2/internal/catch_enum_values_registry.hpp b/packages/Catch2/src/catch2/internal/catch_enum_values_registry.hpp index 999059ae8..de994c359 100644 --- a/packages/Catch2/src/catch2/internal/catch_enum_values_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_enum_values_registry.hpp @@ -24,7 +24,7 @@ namespace Catch { std::vector<Catch::Detail::unique_ptr<EnumInfo>> m_enumInfos; - EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values) override; + EnumInfo const& registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values) override; }; std::vector<StringRef> parseEnums( StringRef enums ); diff --git a/packages/Catch2/src/catch2/internal/catch_is_permutation.hpp b/packages/Catch2/src/catch2/internal/catch_is_permutation.hpp index 708053d35..c77a6d3b4 100644 --- a/packages/Catch2/src/catch2/internal/catch_is_permutation.hpp +++ b/packages/Catch2/src/catch2/internal/catch_is_permutation.hpp @@ -18,6 +18,7 @@ namespace Catch { typename Sentinel, typename T, typename Comparator> + constexpr ForwardIter find_sentinel( ForwardIter start, Sentinel sentinel, T const& value, @@ -33,6 +34,7 @@ namespace Catch { typename Sentinel, typename T, typename Comparator> + constexpr std::ptrdiff_t count_sentinel( ForwardIter start, Sentinel sentinel, T const& value, @@ -46,6 +48,7 @@ namespace Catch { } template <typename ForwardIter, typename Sentinel> + constexpr std::enable_if_t<!std::is_same<ForwardIter, Sentinel>::value, std::ptrdiff_t> sentinel_distance( ForwardIter iter, const Sentinel sentinel ) { @@ -58,8 +61,8 @@ namespace Catch { } template <typename ForwardIter> - std::ptrdiff_t sentinel_distance( ForwardIter first, - ForwardIter last ) { + constexpr std::ptrdiff_t sentinel_distance( ForwardIter first, + ForwardIter last ) { return std::distance( first, last ); } @@ -68,11 +71,11 @@ namespace Catch { typename ForwardIter2, typename Sentinel2, typename Comparator> - bool check_element_counts( ForwardIter1 first_1, - const Sentinel1 end_1, - ForwardIter2 first_2, - const Sentinel2 end_2, - Comparator cmp ) { + constexpr bool check_element_counts( ForwardIter1 first_1, + const Sentinel1 end_1, + ForwardIter2 first_2, + const Sentinel2 end_2, + Comparator cmp ) { auto cursor = first_1; while ( cursor != end_1 ) { if ( find_sentinel( first_1, cursor, *cursor, cmp ) == @@ -102,11 +105,11 @@ namespace Catch { typename ForwardIter2, typename Sentinel2, typename Comparator> - bool is_permutation( ForwardIter1 first_1, - const Sentinel1 end_1, - ForwardIter2 first_2, - const Sentinel2 end_2, - Comparator cmp ) { + constexpr bool is_permutation( ForwardIter1 first_1, + const Sentinel1 end_1, + ForwardIter2 first_2, + const Sentinel2 end_2, + Comparator cmp ) { // TODO: no optimization for stronger iterators, because we would also have to constrain on sentinel vs not sentinel types // TODO: Comparator has to be "both sides", e.g. a == b => b == a // This skips shared prefix of the two ranges diff --git a/packages/Catch2/src/catch2/internal/catch_jsonwriter.cpp b/packages/Catch2/src/catch2/internal/catch_jsonwriter.cpp index ff65a9d34..1a96e3489 100644 --- a/packages/Catch2/src/catch2/internal/catch_jsonwriter.cpp +++ b/packages/Catch2/src/catch2/internal/catch_jsonwriter.cpp @@ -31,7 +31,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '{'; } - JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ): + JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, @@ -62,7 +62,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '['; } - JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ): + JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, diff --git a/packages/Catch2/src/catch2/internal/catch_jsonwriter.hpp b/packages/Catch2/src/catch2/internal/catch_jsonwriter.hpp index 59c044e45..23b56d13a 100644 --- a/packages/Catch2/src/catch2/internal/catch_jsonwriter.hpp +++ b/packages/Catch2/src/catch2/internal/catch_jsonwriter.hpp @@ -65,7 +65,7 @@ namespace Catch { JsonObjectWriter( std::ostream& os ); JsonObjectWriter( std::ostream& os, std::uint64_t indent_level ); - JsonObjectWriter( JsonObjectWriter&& source ); + JsonObjectWriter( JsonObjectWriter&& source ) noexcept; JsonObjectWriter& operator=( JsonObjectWriter&& source ) = delete; ~JsonObjectWriter(); @@ -84,7 +84,7 @@ namespace Catch { JsonArrayWriter( std::ostream& os ); JsonArrayWriter( std::ostream& os, std::uint64_t indent_level ); - JsonArrayWriter( JsonArrayWriter&& source ); + JsonArrayWriter( JsonArrayWriter&& source ) noexcept; JsonArrayWriter& operator=( JsonArrayWriter&& source ) = delete; ~JsonArrayWriter(); diff --git a/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp b/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp index 36e0ac500..c6ff22411 100644 --- a/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp +++ b/packages/Catch2/src/catch2/internal/catch_lazy_expr.hpp @@ -22,13 +22,13 @@ namespace Catch { ITransientExpression const* m_transientExpression = nullptr; bool m_isNegated; public: - LazyExpression( bool isNegated ): + constexpr LazyExpression( bool isNegated ): m_isNegated(isNegated) {} - LazyExpression(LazyExpression const& other) = default; + constexpr LazyExpression(LazyExpression const& other) = default; LazyExpression& operator = ( LazyExpression const& ) = delete; - explicit operator bool() const { + constexpr explicit operator bool() const { return m_transientExpression != nullptr; } diff --git a/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp b/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp index 02f7c9826..245e1376c 100644 --- a/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp +++ b/packages/Catch2/src/catch2/internal/catch_output_redirect.cpp @@ -5,142 +5,335 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#include <catch2/internal/catch_output_redirect.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_output_redirect.hpp> +#include <catch2/internal/catch_platform.hpp> +#include <catch2/internal/catch_reusable_string_stream.hpp> #include <catch2/internal/catch_stdstreams.hpp> #include <cstdio> #include <cstring> +#include <iosfwd> #include <sstream> -#if defined(CATCH_CONFIG_NEW_CAPTURE) - #if defined(_MSC_VER) - #include <io.h> //_dup and _dup2 - #define dup _dup - #define dup2 _dup2 - #define fileno _fileno - #else - #include <unistd.h> // dup and dup2 - #endif +#if defined( CATCH_CONFIG_NEW_CAPTURE ) +# if defined( _MSC_VER ) +# include <io.h> //_dup and _dup2 +# define dup _dup +# define dup2 _dup2 +# define fileno _fileno +# else +# include <unistd.h> // dup and dup2 +# endif #endif - namespace Catch { - RedirectedStream::RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream ) - : m_originalStream( originalStream ), - m_redirectionStream( redirectionStream ), - m_prevBuf( m_originalStream.rdbuf() ) - { - m_originalStream.rdbuf( m_redirectionStream.rdbuf() ); - } + namespace { + //! A no-op implementation, used if no reporter wants output + //! redirection. + class NoopRedirect : public OutputRedirect { + void activateImpl() override {} + void deactivateImpl() override {} + std::string getStdout() override { return {}; } + std::string getStderr() override { return {}; } + void clearBuffers() override {} + }; - RedirectedStream::~RedirectedStream() { - m_originalStream.rdbuf( m_prevBuf ); - } + /** + * Redirects specific stream's rdbuf with another's. + * + * Redirection can be stopped and started on-demand, assumes + * that the underlying stream's rdbuf aren't changed by other + * users. + */ + class RedirectedStreamNew { + std::ostream& m_originalStream; + std::ostream& m_redirectionStream; + std::streambuf* m_prevBuf; - RedirectedStdOut::RedirectedStdOut() : m_cout( Catch::cout(), m_rss.get() ) {} - auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); } + public: + RedirectedStreamNew( std::ostream& originalStream, + std::ostream& redirectionStream ): + m_originalStream( originalStream ), + m_redirectionStream( redirectionStream ), + m_prevBuf( m_originalStream.rdbuf() ) {} - RedirectedStdErr::RedirectedStdErr() - : m_cerr( Catch::cerr(), m_rss.get() ), - m_clog( Catch::clog(), m_rss.get() ) - {} - auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); } + void startRedirect() { + m_originalStream.rdbuf( m_redirectionStream.rdbuf() ); + } + void stopRedirect() { m_originalStream.rdbuf( m_prevBuf ); } + }; - RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr) - : m_redirectedCout(redirectedCout), - m_redirectedCerr(redirectedCerr) - {} + /** + * Redirects the `std::cout`, `std::cerr`, `std::clog` streams, + * but does not touch the actual `stdout`/`stderr` file descriptors. + */ + class StreamRedirect : public OutputRedirect { + ReusableStringStream m_redirectedOut, m_redirectedErr; + RedirectedStreamNew m_cout, m_cerr, m_clog; - RedirectedStreams::~RedirectedStreams() { - m_redirectedCout += m_redirectedStdOut.str(); - m_redirectedCerr += m_redirectedStdErr.str(); - } + public: + StreamRedirect(): + m_cout( Catch::cout(), m_redirectedOut.get() ), + m_cerr( Catch::cerr(), m_redirectedErr.get() ), + m_clog( Catch::clog(), m_redirectedErr.get() ) {} -#if defined(CATCH_CONFIG_NEW_CAPTURE) + void activateImpl() override { + m_cout.startRedirect(); + m_cerr.startRedirect(); + m_clog.startRedirect(); + } + void deactivateImpl() override { + m_cout.stopRedirect(); + m_cerr.stopRedirect(); + m_clog.stopRedirect(); + } + std::string getStdout() override { return m_redirectedOut.str(); } + std::string getStderr() override { return m_redirectedErr.str(); } + void clearBuffers() override { + m_redirectedOut.str( "" ); + m_redirectedErr.str( "" ); + } + }; -#if defined(_MSC_VER) - TempFile::TempFile() { - if (tmpnam_s(m_buffer)) { - CATCH_RUNTIME_ERROR("Could not get a temp filename"); - } - if (fopen_s(&m_file, m_buffer, "w+")) { - char buffer[100]; - if (strerror_s(buffer, errno)) { - CATCH_RUNTIME_ERROR("Could not translate errno to a string"); +#if defined( CATCH_CONFIG_NEW_CAPTURE ) + + // Windows's implementation of std::tmpfile is terrible (it tries + // to create a file inside system folder, thus requiring elevated + // privileges for the binary), so we have to use tmpnam(_s) and + // create the file ourselves there. + class TempFile { + public: + TempFile( TempFile const& ) = delete; + TempFile& operator=( TempFile const& ) = delete; + TempFile( TempFile&& ) = delete; + TempFile& operator=( TempFile&& ) = delete; + +# if defined( _MSC_VER ) + TempFile() { + if ( tmpnam_s( m_buffer ) ) { + CATCH_RUNTIME_ERROR( "Could not get a temp filename" ); + } + if ( fopen_s( &m_file, m_buffer, "wb+" ) ) { + char buffer[100]; + if ( strerror_s( buffer, errno ) ) { + CATCH_RUNTIME_ERROR( + "Could not translate errno to a string" ); + } + CATCH_RUNTIME_ERROR( "Could not open the temp file: '" + << m_buffer + << "' because: " << buffer ); + } + } +# else + TempFile() { + m_file = std::tmpfile(); + if ( !m_file ) { + CATCH_RUNTIME_ERROR( "Could not create a temp file." ); + } + } +# endif + + ~TempFile() { + // TBD: What to do about errors here? + std::fclose( m_file ); + // We manually create the file on Windows only, on Linux + // it will be autodeleted +# if defined( _MSC_VER ) + std::remove( m_buffer ); +# endif + } + + std::FILE* getFile() { return m_file; } + std::string getContents() { + ReusableStringStream sstr; + constexpr long buffer_size = 100; + char buffer[buffer_size + 1] = {}; + long current_pos = ftell( m_file ); + CATCH_ENFORCE( current_pos >= 0, + "ftell failed, errno: " << errno ); + std::rewind( m_file ); + while ( current_pos > 0 ) { + auto read_characters = + std::fread( buffer, + 1, + std::min( buffer_size, current_pos ), + m_file ); + buffer[read_characters] = '\0'; + sstr << buffer; + current_pos -= static_cast<long>( read_characters ); + } + return sstr.str(); + } + + void clear() { std::rewind( m_file ); } + + private: + std::FILE* m_file = nullptr; + char m_buffer[L_tmpnam] = { 0 }; + }; + + /** + * Redirects the actual `stdout`/`stderr` file descriptors. + * + * Works by replacing the file descriptors numbered 1 and 2 + * with an open temporary file. + */ + class FileRedirect : public OutputRedirect { + TempFile m_outFile, m_errFile; + int m_originalOut = -1; + int m_originalErr = -1; + + // Flushes cout/cerr/clog streams and stdout/stderr FDs + void flushEverything() { + Catch::cout() << std::flush; + fflush( stdout ); + // Since we support overriding these streams, we flush cerr + // even though std::cerr is unbuffered + Catch::cerr() << std::flush; + Catch::clog() << std::flush; + fflush( stderr ); + } + + public: + FileRedirect(): + m_originalOut( dup( fileno( stdout ) ) ), + m_originalErr( dup( fileno( stderr ) ) ) { + CATCH_ENFORCE( m_originalOut >= 0, "Could not dup stdout" ); + CATCH_ENFORCE( m_originalErr >= 0, "Could not dup stderr" ); } - CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer); + + std::string getStdout() override { return m_outFile.getContents(); } + std::string getStderr() override { return m_errFile.getContents(); } + void clearBuffers() override { + m_outFile.clear(); + m_errFile.clear(); + } + + void activateImpl() override { + // We flush before starting redirect, to ensure that we do + // not capture the end of message sent before activation. + flushEverything(); + + int ret; + ret = dup2( fileno( m_outFile.getFile() ), fileno( stdout ) ); + CATCH_ENFORCE( ret >= 0, + "dup2 to stdout has failed, errno: " << errno ); + ret = dup2( fileno( m_errFile.getFile() ), fileno( stderr ) ); + CATCH_ENFORCE( ret >= 0, + "dup2 to stderr has failed, errno: " << errno ); + } + void deactivateImpl() override { + // We flush before ending redirect, to ensure that we + // capture all messages sent while the redirect was active. + flushEverything(); + + int ret; + ret = dup2( m_originalOut, fileno( stdout ) ); + CATCH_ENFORCE( + ret >= 0, + "dup2 of original stdout has failed, errno: " << errno ); + ret = dup2( m_originalErr, fileno( stderr ) ); + CATCH_ENFORCE( + ret >= 0, + "dup2 of original stderr has failed, errno: " << errno ); + } + }; + +#endif // CATCH_CONFIG_NEW_CAPTURE + + } // end namespace + + bool isRedirectAvailable( OutputRedirect::Kind kind ) { + switch ( kind ) { + // These two are always available + case OutputRedirect::None: + case OutputRedirect::Streams: + return true; +#if defined( CATCH_CONFIG_NEW_CAPTURE ) + case OutputRedirect::FileDescriptors: + return true; +#endif + default: + return false; } } + + Detail::unique_ptr<OutputRedirect> makeOutputRedirect( bool actual ) { + if ( actual ) { + // TODO: Clean this up later +#if defined( CATCH_CONFIG_NEW_CAPTURE ) + return Detail::make_unique<FileRedirect>(); #else - TempFile::TempFile() { - m_file = std::tmpfile(); - if (!m_file) { - CATCH_RUNTIME_ERROR("Could not create a temp file."); + return Detail::make_unique<StreamRedirect>(); +#endif + } else { + return Detail::make_unique<NoopRedirect>(); } } -#endif + RedirectGuard scopedActivate( OutputRedirect& redirectImpl ) { + return RedirectGuard( true, redirectImpl ); + } - TempFile::~TempFile() { - // TBD: What to do about errors here? - std::fclose(m_file); - // We manually create the file on Windows only, on Linux - // it will be autodeleted -#if defined(_MSC_VER) - std::remove(m_buffer); -#endif + RedirectGuard scopedDeactivate( OutputRedirect& redirectImpl ) { + return RedirectGuard( false, redirectImpl ); } + OutputRedirect::~OutputRedirect() = default; - FILE* TempFile::getFile() { - return m_file; - } + RedirectGuard::RedirectGuard( bool activate, OutputRedirect& redirectImpl ): + m_redirect( &redirectImpl ), + m_activate( activate ), + m_previouslyActive( redirectImpl.isActive() ) { - std::string TempFile::getContents() { - std::stringstream sstr; - char buffer[100] = {}; - std::rewind(m_file); - while (std::fgets(buffer, sizeof(buffer), m_file)) { - sstr << buffer; - } - return sstr.str(); - } + // Skip cases where there is no actual state change. + if ( m_activate == m_previouslyActive ) { return; } - OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) : - m_originalStdout(dup(1)), - m_originalStderr(dup(2)), - m_stdoutDest(stdout_dest), - m_stderrDest(stderr_dest) { - dup2(fileno(m_stdoutFile.getFile()), 1); - dup2(fileno(m_stderrFile.getFile()), 2); + if ( m_activate ) { + m_redirect->activate(); + } else { + m_redirect->deactivate(); + } } - OutputRedirect::~OutputRedirect() { - Catch::cout() << std::flush; - fflush(stdout); - // Since we support overriding these streams, we flush cerr - // even though std::cerr is unbuffered - Catch::cerr() << std::flush; - Catch::clog() << std::flush; - fflush(stderr); + RedirectGuard::~RedirectGuard() noexcept( false ) { + if ( m_moved ) { return; } + // Skip cases where there is no actual state change. + if ( m_activate == m_previouslyActive ) { return; } - dup2(m_originalStdout, 1); - dup2(m_originalStderr, 2); + if ( m_activate ) { + m_redirect->deactivate(); + } else { + m_redirect->activate(); + } + } - m_stdoutDest += m_stdoutFile.getContents(); - m_stderrDest += m_stderrFile.getContents(); + RedirectGuard::RedirectGuard( RedirectGuard&& rhs ) noexcept: + m_redirect( rhs.m_redirect ), + m_activate( rhs.m_activate ), + m_previouslyActive( rhs.m_previouslyActive ), + m_moved( false ) { + rhs.m_moved = true; } -#endif // CATCH_CONFIG_NEW_CAPTURE + RedirectGuard& RedirectGuard::operator=( RedirectGuard&& rhs ) noexcept { + m_redirect = rhs.m_redirect; + m_activate = rhs.m_activate; + m_previouslyActive = rhs.m_previouslyActive; + m_moved = false; + rhs.m_moved = true; + return *this; + } } // namespace Catch -#if defined(CATCH_CONFIG_NEW_CAPTURE) - #if defined(_MSC_VER) - #undef dup - #undef dup2 - #undef fileno - #endif +#if defined( CATCH_CONFIG_NEW_CAPTURE ) +# if defined( _MSC_VER ) +# undef dup +# undef dup2 +# undef fileno +# endif #endif diff --git a/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp b/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp index dc89223b9..51b796baa 100644 --- a/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp +++ b/packages/Catch2/src/catch2/internal/catch_output_redirect.hpp @@ -8,110 +8,69 @@ #ifndef CATCH_OUTPUT_REDIRECT_HPP_INCLUDED #define CATCH_OUTPUT_REDIRECT_HPP_INCLUDED -#include <catch2/internal/catch_platform.hpp> -#include <catch2/internal/catch_reusable_string_stream.hpp> -#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> -#include <cstdio> -#include <iosfwd> +#include <cassert> #include <string> namespace Catch { - class RedirectedStream { - std::ostream& m_originalStream; - std::ostream& m_redirectionStream; - std::streambuf* m_prevBuf; - - public: - RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream ); - ~RedirectedStream(); - }; - - class RedirectedStdOut { - ReusableStringStream m_rss; - RedirectedStream m_cout; - public: - RedirectedStdOut(); - auto str() const -> std::string; - }; - - // StdErr has two constituent streams in C++, std::cerr and std::clog - // This means that we need to redirect 2 streams into 1 to keep proper - // order of writes - class RedirectedStdErr { - ReusableStringStream m_rss; - RedirectedStream m_cerr; - RedirectedStream m_clog; + class OutputRedirect { + bool m_redirectActive = false; + virtual void activateImpl() = 0; + virtual void deactivateImpl() = 0; public: - RedirectedStdErr(); - auto str() const -> std::string; + enum Kind { + //! No redirect (noop implementation) + None, + //! Redirect std::cout/std::cerr/std::clog streams internally + Streams, + //! Redirect the stdout/stderr file descriptors into files + FileDescriptors, + }; + + virtual ~OutputRedirect(); // = default; + + // TODO: Do we want to check that redirect is not active before retrieving the output? + virtual std::string getStdout() = 0; + virtual std::string getStderr() = 0; + virtual void clearBuffers() = 0; + bool isActive() const { return m_redirectActive; } + void activate() { + assert( !m_redirectActive && "redirect is already active" ); + activateImpl(); + m_redirectActive = true; + } + void deactivate() { + assert( m_redirectActive && "redirect is not active" ); + deactivateImpl(); + m_redirectActive = false; + } }; - class RedirectedStreams { - public: - RedirectedStreams(RedirectedStreams const&) = delete; - RedirectedStreams& operator=(RedirectedStreams const&) = delete; - RedirectedStreams(RedirectedStreams&&) = delete; - RedirectedStreams& operator=(RedirectedStreams&&) = delete; - - RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr); - ~RedirectedStreams(); - private: - std::string& m_redirectedCout; - std::string& m_redirectedCerr; - RedirectedStdOut m_redirectedStdOut; - RedirectedStdErr m_redirectedStdErr; - }; + bool isRedirectAvailable( OutputRedirect::Kind kind); + Detail::unique_ptr<OutputRedirect> makeOutputRedirect( bool actual ); -#if defined(CATCH_CONFIG_NEW_CAPTURE) + class RedirectGuard { + OutputRedirect* m_redirect; + bool m_activate; + bool m_previouslyActive; + bool m_moved = false; - // Windows's implementation of std::tmpfile is terrible (it tries - // to create a file inside system folder, thus requiring elevated - // privileges for the binary), so we have to use tmpnam(_s) and - // create the file ourselves there. - class TempFile { public: - TempFile(TempFile const&) = delete; - TempFile& operator=(TempFile const&) = delete; - TempFile(TempFile&&) = delete; - TempFile& operator=(TempFile&&) = delete; - - TempFile(); - ~TempFile(); - - std::FILE* getFile(); - std::string getContents(); - - private: - std::FILE* m_file = nullptr; - #if defined(_MSC_VER) - char m_buffer[L_tmpnam] = { 0 }; - #endif - }; + RedirectGuard( bool activate, OutputRedirect& redirectImpl ); + ~RedirectGuard() noexcept( false ); + RedirectGuard( RedirectGuard const& ) = delete; + RedirectGuard& operator=( RedirectGuard const& ) = delete; - class OutputRedirect { - public: - OutputRedirect(OutputRedirect const&) = delete; - OutputRedirect& operator=(OutputRedirect const&) = delete; - OutputRedirect(OutputRedirect&&) = delete; - OutputRedirect& operator=(OutputRedirect&&) = delete; - - - OutputRedirect(std::string& stdout_dest, std::string& stderr_dest); - ~OutputRedirect(); - - private: - int m_originalStdout = -1; - int m_originalStderr = -1; - TempFile m_stdoutFile; - TempFile m_stderrFile; - std::string& m_stdoutDest; - std::string& m_stderrDest; + // C++14 needs move-able guards to return them from functions + RedirectGuard( RedirectGuard&& rhs ) noexcept; + RedirectGuard& operator=( RedirectGuard&& rhs ) noexcept; }; -#endif + RedirectGuard scopedActivate( OutputRedirect& redirectImpl ); + RedirectGuard scopedDeactivate( OutputRedirect& redirectImpl ); } // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_platform.hpp b/packages/Catch2/src/catch2/internal/catch_platform.hpp index b11d9ccde..b653a58c5 100644 --- a/packages/Catch2/src/catch2/internal/catch_platform.hpp +++ b/packages/Catch2/src/catch2/internal/catch_platform.hpp @@ -11,6 +11,9 @@ // See e.g.: // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ +# ifndef __has_extension +# define __has_extension(x) 0 +# endif # include <TargetConditionals.h> # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) diff --git a/packages/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp b/packages/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp index 1c450f05c..be4bbe920 100644 --- a/packages/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp +++ b/packages/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp @@ -14,6 +14,34 @@ #include <cstdint> #include <type_traits> +// Note: We use the usual enable-disable-autodetect dance here even though +// we do not support these in CMake configuration options (yet?). +// It is highly unlikely that we will need to make these actually +// user-configurable, but this will make it simpler if weend up needing +// it, and it provides an escape hatch to the users who need it. +#if defined( __SIZEOF_INT128__ ) +# define CATCH_CONFIG_INTERNAL_UINT128 +// Unlike GCC, MSVC does not polyfill umul as mulh + mul pair on ARM machines. +// Currently we do not bother doing this ourselves, but we could if it became +// important for perf. +#elif defined( _MSC_VER ) && defined( _M_X64 ) +# define CATCH_CONFIG_INTERNAL_MSVC_UMUL128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_UINT128 ) && \ + !defined( CATCH_CONFIG_NO_UINT128 ) && \ + !defined( CATCH_CONFIG_UINT128 ) +#define CATCH_CONFIG_UINT128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_NO_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_MSVC_UMUL128 ) +# define CATCH_CONFIG_MSVC_UMUL128 +# include <intrin.h> +#endif + + namespace Catch { namespace Detail { @@ -41,65 +69,57 @@ namespace Catch { struct ExtendedMultResult { T upper; T lower; - friend bool operator==( ExtendedMultResult const& lhs, - ExtendedMultResult const& rhs ) { - return lhs.upper == rhs.upper && lhs.lower == rhs.lower; + constexpr bool operator==( ExtendedMultResult const& rhs ) const { + return upper == rhs.upper && lower == rhs.lower; } }; - // Returns 128 bit result of multiplying lhs and rhs + /** + * Returns 128 bit result of lhs * rhs using portable C++ code + * + * This implementation is almost twice as fast as naive long multiplication, + * and unlike intrinsic-based approach, it supports constexpr evaluation. + */ constexpr ExtendedMultResult<std::uint64_t> - extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { - // We use the simple long multiplication approach for - // correctness, we can use platform specific builtins - // for performance later. - - // Split the lhs and rhs into two 32bit "digits", so that we can - // do 64 bit arithmetic to handle carry bits. - // 32b 32b 32b 32b - // lhs L1 L2 - // * rhs R1 R2 - // ------------------------ - // | R2 * L2 | - // | R2 * L1 | - // | R1 * L2 | - // | R1 * L1 | - // ------------------------- - // | a | b | c | d | - + extendedMultPortable(std::uint64_t lhs, std::uint64_t rhs) { #define CarryBits( x ) ( x >> 32 ) #define Digits( x ) ( x & 0xFF'FF'FF'FF ) - - auto r2l2 = Digits( rhs ) * Digits( lhs ); - auto r2l1 = Digits( rhs ) * CarryBits( lhs ); - auto r1l2 = CarryBits( rhs ) * Digits( lhs ); - auto r1l1 = CarryBits( rhs ) * CarryBits( lhs ); - - // Sum to columns first - auto d = Digits( r2l2 ); - auto c = CarryBits( r2l2 ) + Digits( r2l1 ) + Digits( r1l2 ); - auto b = CarryBits( r2l1 ) + CarryBits( r1l2 ) + Digits( r1l1 ); - auto a = CarryBits( r1l1 ); - - // Propagate carries between columns - c += CarryBits( d ); - b += CarryBits( c ); - a += CarryBits( b ); - - // Remove the used carries - c = Digits( c ); - b = Digits( b ); - a = Digits( a ); - + std::uint64_t lhs_low = Digits( lhs ); + std::uint64_t rhs_low = Digits( rhs ); + std::uint64_t low_low = ( lhs_low * rhs_low ); + std::uint64_t high_high = CarryBits( lhs ) * CarryBits( rhs ); + + // We add in carry bits from low-low already + std::uint64_t high_low = + ( CarryBits( lhs ) * rhs_low ) + CarryBits( low_low ); + // Note that we can add only low bits from high_low, to avoid + // overflow with large inputs + std::uint64_t low_high = + ( lhs_low * CarryBits( rhs ) ) + Digits( high_low ); + + return { high_high + CarryBits( high_low ) + CarryBits( low_high ), + ( low_high << 32 ) | Digits( low_low ) }; #undef CarryBits #undef Digits + } - return { - a << 32 | b, // upper 64 bits - c << 32 | d // lower 64 bits - }; + //! Returns 128 bit result of lhs * rhs + inline ExtendedMultResult<std::uint64_t> + extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { +#if defined( CATCH_CONFIG_UINT128 ) + auto result = __uint128_t( lhs ) * __uint128_t( rhs ); + return { static_cast<std::uint64_t>( result >> 64 ), + static_cast<std::uint64_t>( result ) }; +#elif defined( CATCH_CONFIG_MSVC_UMUL128 ) + std::uint64_t high; + std::uint64_t low = _umul128( lhs, rhs, &high ); + return { high, low }; +#else + return extendedMultPortable( lhs, rhs ); +#endif } + template <typename UInt> constexpr ExtendedMultResult<UInt> extendedMult( UInt lhs, UInt rhs ) { static_assert( std::is_unsigned<UInt>::value, @@ -167,6 +187,7 @@ namespace Catch { * get by simple casting ([0, ..., INT_MAX, INT_MIN, ..., -1]) */ template <typename OriginalType, typename UnsignedType> + constexpr std::enable_if_t<std::is_signed<OriginalType>::value, UnsignedType> transposeToNaturalOrder( UnsignedType in ) { static_assert( @@ -187,6 +208,7 @@ namespace Catch { template <typename OriginalType, typename UnsignedType> + constexpr std::enable_if_t<std::is_unsigned<OriginalType>::value, UnsignedType> transposeToNaturalOrder(UnsignedType in) { static_assert( diff --git a/packages/Catch2/src/catch2/internal/catch_random_number_generator.cpp b/packages/Catch2/src/catch2/internal/catch_random_number_generator.cpp index 6a79dff39..c88cd8f2d 100644 --- a/packages/Catch2/src/catch2/internal/catch_random_number_generator.cpp +++ b/packages/Catch2/src/catch2/internal/catch_random_number_generator.cpp @@ -52,7 +52,7 @@ namespace { SimplePcg32::result_type SimplePcg32::operator()() { // prepare the output value const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u); - const auto output = rotate_right(xorshifted, m_state >> 59u); + const auto output = rotate_right(xorshifted, static_cast<uint32_t>(m_state >> 59u)); // advance state m_state = m_state * 6364136223846793005ULL + s_inc; diff --git a/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp b/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp index 8b88b170a..2b08758a0 100644 --- a/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp +++ b/packages/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp @@ -117,7 +117,7 @@ namespace Catch { auto kv = splitKVPair( parts[i] ); auto key = kv.key, value = kv.value; - if ( key.empty() || value.empty() ) { + if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) return {}; } else if ( key[0] == 'X' ) { // This is a reporter-specific option, we don't check these diff --git a/packages/Catch2/src/catch2/internal/catch_result_type.cpp b/packages/Catch2/src/catch2/internal/catch_result_type.cpp deleted file mode 100644 index 6cedce716..000000000 --- a/packages/Catch2/src/catch2/internal/catch_result_type.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -#include <catch2/internal/catch_result_type.hpp> - -namespace Catch { - - bool isOk( ResultWas::OfType resultType ) { - return ( resultType & ResultWas::FailureBit ) == 0; - } - bool isJustInfo( int flags ) { - return flags == ResultWas::Info; - } - - ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { - return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) ); - } - - bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } - bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } - -} // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_result_type.hpp b/packages/Catch2/src/catch2/internal/catch_result_type.hpp index e66afaff0..69a6ef141 100644 --- a/packages/Catch2/src/catch2/internal/catch_result_type.hpp +++ b/packages/Catch2/src/catch2/internal/catch_result_type.hpp @@ -33,8 +33,10 @@ namespace Catch { }; }; - bool isOk( ResultWas::OfType resultType ); - bool isJustInfo( int flags ); + constexpr bool isOk( ResultWas::OfType resultType ) { + return ( resultType & ResultWas::FailureBit ) == 0; + } + constexpr bool isJustInfo( int flags ) { return flags == ResultWas::Info; } // ResultDisposition::Flags enum @@ -46,11 +48,18 @@ namespace Catch { SuppressFail = 0x08 // Failures are reported but do not fail the test }; }; - ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ); - - bool shouldContinueOnFailure( int flags ); - inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } - bool shouldSuppressFailure( int flags ); + constexpr ResultDisposition::Flags operator|( ResultDisposition::Flags lhs, + ResultDisposition::Flags rhs ) { + return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | + static_cast<int>( rhs ) ); + } + + constexpr bool isFalseTest( int flags ) { + return ( flags & ResultDisposition::FalseTest ) != 0; + } + constexpr bool shouldSuppressFailure( int flags ) { + return ( flags & ResultDisposition::SuppressFail ) != 0; + } } // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_run_context.cpp b/packages/Catch2/src/catch2/internal/catch_run_context.cpp index 77b476d82..2a102fbee 100644 --- a/packages/Catch2/src/catch2/internal/catch_run_context.cpp +++ b/packages/Catch2/src/catch2/internal/catch_run_context.cpp @@ -170,6 +170,7 @@ namespace Catch { m_config(_config), m_reporter(CATCH_MOVE(reporter)), m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal }, + m_outputRedirect( makeOutputRedirect( m_reporter->getPreferences().shouldRedirectStdOut ) ), m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions ) { getCurrentMutableContext().setResultCapture( this ); @@ -185,6 +186,7 @@ namespace Catch { auto const& testInfo = testCase.getTestCaseInfo(); m_reporter->testCaseStarting(testInfo); + testCase.prepareTestCase(); m_activeTestCase = &testCase; @@ -235,15 +237,17 @@ namespace Catch { m_reporter->testCasePartialStarting(testInfo, testRuns); const auto beforeRunTotals = m_totals; - std::string oneRunCout, oneRunCerr; - runCurrentTest(oneRunCout, oneRunCerr); + runCurrentTest(); + std::string oneRunCout = m_outputRedirect->getStdout(); + std::string oneRunCerr = m_outputRedirect->getStderr(); + m_outputRedirect->clearBuffers(); redirectedCout += oneRunCout; redirectedCerr += oneRunCerr; const auto singleRunTotals = m_totals.delta(beforeRunTotals); auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, CATCH_MOVE(oneRunCout), CATCH_MOVE(oneRunCerr), aborting()); - m_reporter->testCasePartialEnded(statsForOneRun, testRuns); + ++testRuns; } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); @@ -254,6 +258,7 @@ namespace Catch { deltaTotals.testCases.failed++; } m_totals.testCases += deltaTotals.testCases; + testCase.tearDownTestCase(); m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, CATCH_MOVE(redirectedCout), @@ -287,7 +292,10 @@ namespace Catch { m_lastAssertionPassed = true; } - m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ); + } if ( result.getResultType() != ResultWas::Warning ) { m_messageScopes.clear(); @@ -304,6 +312,7 @@ namespace Catch { } void RunContext::notifyAssertionStarted( AssertionInfo const& info ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->assertionStarting( info ); } @@ -322,7 +331,10 @@ namespace Catch { SectionInfo sectionInfo( sectionLineInfo, static_cast<std::string>(sectionName) ); m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - m_reporter->sectionStarting(sectionInfo); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->sectionStarting( sectionInfo ); + } assertions = m_totals.assertions; @@ -382,7 +394,15 @@ namespace Catch { m_activeSections.pop_back(); } - m_reporter->sectionEnded(SectionStats(CATCH_MOVE(endInfo.sectionInfo), assertions, endInfo.durationInSeconds, missingAssertions)); + { + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->sectionEnded( + SectionStats( CATCH_MOVE( endInfo.sectionInfo ), + assertions, + endInfo.durationInSeconds, + missingAssertions ) ); + } + m_messages.clear(); m_messageScopes.clear(); } @@ -399,15 +419,19 @@ namespace Catch { } void RunContext::benchmarkPreparing( StringRef name ) { - m_reporter->benchmarkPreparing(name); + auto _ = scopedDeactivate( *m_outputRedirect ); + m_reporter->benchmarkPreparing( name ); } void RunContext::benchmarkStarting( BenchmarkInfo const& info ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkStarting( info ); } void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkEnded( stats ); } void RunContext::benchmarkFailed( StringRef error ) { + auto _ = scopedDeactivate( *m_outputRedirect ); m_reporter->benchmarkFailed( error ); } @@ -438,8 +462,13 @@ namespace Catch { } void RunContext::handleFatalErrorCondition( StringRef message ) { + // TODO: scoped deactivate here? Just give up and do best effort? + // the deactivation can break things further, OTOH so can the + // capture + auto _ = scopedDeactivate( *m_outputRedirect ); + // First notify reporter that bad things happened - m_reporter->fatalErrorEncountered(message); + m_reporter->fatalErrorEncountered( message ); // Don't rebuild the result -- the stringification itself can cause more fatal errors // Instead, fake a result data. @@ -450,6 +479,13 @@ namespace Catch { assertionEnded(CATCH_MOVE(result) ); resetAssertionInfo(); + // Best effort cleanup for sections that have not been destructed yet + // Since this is a fatal error, we have not had and won't have the opportunity to destruct them properly + while (!m_activeSections.empty()) { + auto nl = m_activeSections.back()->nameAndLocation(); + SectionEndInfo endInfo{ SectionInfo(CATCH_MOVE(nl.location), CATCH_MOVE(nl.name)), {}, 0.0 }; + sectionEndedEarly(CATCH_MOVE(endInfo)); + } handleUnfinishedSections(); // Recreate section for test case (as we will lose the one that was in scope) @@ -459,7 +495,7 @@ namespace Catch { Counts assertions; assertions.failed = 1; SectionStats testCaseSectionStats(CATCH_MOVE(testCaseSection), assertions, 0, false); - m_reporter->sectionEnded(testCaseSectionStats); + m_reporter->sectionEnded( testCaseSectionStats ); auto const& testInfo = m_activeTestCase->getTestCaseInfo(); @@ -490,7 +526,7 @@ namespace Catch { return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter()); } - void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) { + void RunContext::runCurrentTest() { auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); m_reporter->sectionStarting(testCaseSection); @@ -501,18 +537,8 @@ namespace Catch { Timer timer; CATCH_TRY { - if (m_reporter->getPreferences().shouldRedirectStdOut) { -#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) - RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr); - - timer.start(); - invokeActiveTestCase(); -#else - OutputRedirect r(redirectedCout, redirectedCerr); - timer.start(); - invokeActiveTestCase(); -#endif - } else { + { + auto _ = scopedActivate( *m_outputRedirect ); timer.start(); invokeActiveTestCase(); } @@ -557,11 +583,12 @@ namespace Catch { void RunContext::handleUnfinishedSections() { // If sections ended prematurely due to an exception we stored their // infos here so we can tear them down outside the unwind process. - for (auto it = m_unfinishedSections.rbegin(), - itEnd = m_unfinishedSections.rend(); - it != itEnd; - ++it) - sectionEnded(CATCH_MOVE(*it)); + for ( auto it = m_unfinishedSections.rbegin(), + itEnd = m_unfinishedSections.rend(); + it != itEnd; + ++it ) { + sectionEnded( CATCH_MOVE( *it ) ); + } m_unfinishedSections.clear(); } @@ -605,13 +632,13 @@ namespace Catch { void RunContext::handleMessage( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) { m_lastAssertionInfo = info; AssertionResultData data( resultType, LazyExpression( false ) ); - data.message = static_cast<std::string>(message); + data.message = CATCH_MOVE( message ); AssertionResult assertionResult{ m_lastAssertionInfo, CATCH_MOVE( data ) }; diff --git a/packages/Catch2/src/catch2/internal/catch_run_context.hpp b/packages/Catch2/src/catch2/internal/catch_run_context.hpp index c749304d3..c66fec0ce 100644 --- a/packages/Catch2/src/catch2/internal/catch_run_context.hpp +++ b/packages/Catch2/src/catch2/internal/catch_run_context.hpp @@ -29,6 +29,7 @@ namespace Catch { class IConfig; class IEventListener; using IEventListenerPtr = Detail::unique_ptr<IEventListener>; + class OutputRedirect; /////////////////////////////////////////////////////////////////////////// @@ -54,7 +55,7 @@ namespace Catch { void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef message, + std::string&& message, AssertionReaction& reaction ) override; void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, @@ -115,7 +116,7 @@ namespace Catch { private: - void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ); + void runCurrentTest(); void invokeActiveTestCase(); void resetAssertionInfo(); @@ -148,6 +149,7 @@ namespace Catch { std::vector<SectionEndInfo> m_unfinishedSections; std::vector<ITracker*> m_activeSections; TrackerContext m_trackerContext; + Detail::unique_ptr<OutputRedirect> m_outputRedirect; FatalConditionHandler m_fatalConditionhandler; bool m_lastAssertionPassed = false; bool m_shouldReportUnexpected = true; diff --git a/packages/Catch2/src/catch2/internal/catch_section.hpp b/packages/Catch2/src/catch2/internal/catch_section.hpp index 8c894eeb8..e56c79f32 100644 --- a/packages/Catch2/src/catch2/internal/catch_section.hpp +++ b/packages/Catch2/src/catch2/internal/catch_section.hpp @@ -69,7 +69,9 @@ namespace Catch { namespace Detail { // Intentionally without linkage, as it should only be used as a dummy // symbol for static analysis. - int GetNewSectionHint(); + // The arguments are used as a dummy for checking warnings in the passed + // expressions. + int GetNewSectionHint( StringRef, const char* const = nullptr ); } // namespace Detail } // namespace Catch @@ -80,7 +82,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = \ + Catch::Detail::GetNewSectionHint(__VA_ARGS__); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION @@ -90,7 +93,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = Catch::Detail::GetNewSectionHint( \ + ( Catch::ReusableStringStream() << __VA_ARGS__ ).str()); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION diff --git a/packages/Catch2/src/catch2/internal/catch_string_manip.cpp b/packages/Catch2/src/catch2/internal/catch_string_manip.cpp index 0c889ca18..ce1abaa04 100644 --- a/packages/Catch2/src/catch2/internal/catch_string_manip.cpp +++ b/packages/Catch2/src/catch2/internal/catch_string_manip.cpp @@ -5,6 +5,7 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_stringref.hpp> @@ -65,17 +66,29 @@ namespace Catch { } bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { - bool replaced = false; std::size_t i = str.find( replaceThis ); - while( i != std::string::npos ) { - replaced = true; - str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); - if( i < str.size()-withThis.size() ) - i = str.find( replaceThis, i+withThis.size() ); + if (i == std::string::npos) { + return false; + } + std::size_t copyBegin = 0; + std::string origStr = CATCH_MOVE(str); + str.clear(); + // There is at least one replacement, so reserve with the best guess + // we can make without actually counting the number of occurences. + str.reserve(origStr.size() - replaceThis.size() + withThis.size()); + do { + str.append(origStr, copyBegin, i-copyBegin ); + str += withThis; + copyBegin = i + replaceThis.size(); + if( copyBegin < origStr.size() ) + i = origStr.find( replaceThis, copyBegin ); else i = std::string::npos; + } while( i != std::string::npos ); + if ( copyBegin < origStr.size() ) { + str.append(origStr, copyBegin, origStr.size() ); } - return replaced; + return true; } std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) { diff --git a/packages/Catch2/src/catch2/internal/catch_stringref.hpp b/packages/Catch2/src/catch2/internal/catch_stringref.hpp index 4b9212bfa..421ce7129 100644 --- a/packages/Catch2/src/catch2/internal/catch_stringref.hpp +++ b/packages/Catch2/src/catch2/internal/catch_stringref.hpp @@ -97,8 +97,8 @@ namespace Catch { 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 += (std::string& lhs, StringRef rhs); + friend std::ostream& operator << (std::ostream& os, StringRef str); friend std::string operator+(StringRef lhs, StringRef rhs); /** 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 c2b052daf..e77e7bcee 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 @@ -123,6 +123,8 @@ namespace Catch { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); } + TestRegistry::~TestRegistry() = default; + 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()); 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 99a38498f..fbca89f90 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 @@ -36,6 +36,8 @@ namespace Catch { std::vector<TestCaseHandle> const& getAllTests() const override; std::vector<TestCaseHandle> const& getAllTestsSorted( IConfig const& config ) const override; + ~TestRegistry() override; // = default + private: std::vector<Detail::unique_ptr<TestCaseInfo>> m_owned_test_infos; // Keeps a materialized vector for `getAllInfos`. 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 0d95650fb..ccd5bb357 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp @@ -38,8 +38,6 @@ #endif -#define INTERNAL_CATCH_REACT( handler ) handler.complete(); - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \ do { /* NOLINT(bugprone-infinite-loop) */ \ @@ -52,7 +50,7 @@ catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } 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 &&. @@ -80,7 +78,7 @@ catch( ... ) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -101,7 +99,7 @@ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -125,7 +123,7 @@ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -149,7 +147,7 @@ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) #endif // CATCH_CONFIG_DISABLE diff --git a/packages/Catch2/src/catch2/internal/catch_test_registry.cpp b/packages/Catch2/src/catch2/internal/catch_test_registry.cpp index e9c999fec..d017c50e7 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_registry.cpp @@ -16,6 +16,8 @@ #include <iterator> namespace Catch { + void ITestInvoker::prepareTestCase() {} + void ITestInvoker::tearDownTestCase() {} ITestInvoker::~ITestInvoker() = default; namespace { @@ -52,7 +54,7 @@ namespace Catch { TestType m_testAsFunction; public: - TestInvokerAsFunction( TestType testAsFunction ) noexcept: + constexpr TestInvokerAsFunction( TestType testAsFunction ) noexcept: m_testAsFunction( testAsFunction ) {} void invoke() const override { m_testAsFunction(); } diff --git a/packages/Catch2/src/catch2/internal/catch_test_registry.hpp b/packages/Catch2/src/catch2/internal/catch_test_registry.hpp index 7766fe111..5c3a226d6 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_registry.hpp @@ -32,7 +32,8 @@ template<typename C> class TestInvokerAsMethod : public ITestInvoker { void (C::*m_testAsMethod)(); public: - TestInvokerAsMethod( void (C::*testAsMethod)() ) noexcept : m_testAsMethod( testAsMethod ) {} + constexpr TestInvokerAsMethod( void ( C::*testAsMethod )() ) noexcept: + m_testAsMethod( testAsMethod ) {} void invoke() const override { C obj; @@ -47,6 +48,34 @@ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) { return Detail::make_unique<TestInvokerAsMethod<C>>( testAsMethod ); } +template <typename C> +class TestInvokerFixture : public ITestInvoker { + void ( C::*m_testAsMethod )() const; + Detail::unique_ptr<C> m_fixture = nullptr; + +public: + constexpr TestInvokerFixture( void ( C::*testAsMethod )() const ) noexcept: + m_testAsMethod( testAsMethod ) {} + + void prepareTestCase() override { + m_fixture = Detail::make_unique<C>(); + } + + void tearDownTestCase() override { + m_fixture.reset(); + } + + void invoke() const override { + auto* f = m_fixture.get(); + ( f->*m_testAsMethod )(); + } +}; + +template<typename C> +Detail::unique_ptr<ITestInvoker> makeTestInvokerFixture( void ( C::*testAsMethod )() const ) { + return Detail::make_unique<TestInvokerFixture<C>>( testAsMethod ); +} + struct NameAndTags { constexpr NameAndTags( StringRef name_ = StringRef(), StringRef tags_ = StringRef() ) noexcept: @@ -95,7 +124,7 @@ struct AutoReg : Detail::NonCopyable { namespace Catch { namespace Detail { struct DummyUse { - DummyUse( void ( * )( int ) ); + DummyUse( void ( * )( int ), Catch::NameAndTags const& ); }; } // namespace Detail } // namespace Catch @@ -107,18 +136,18 @@ namespace Catch { // tests can compile. The redefined `TEST_CASE` shadows this with param. static int catchInternalSectionHint = 0; -# define INTERNAL_CATCH_TESTCASE2( fname ) \ +# define INTERNAL_CATCH_TESTCASE2( fname, ... ) \ static void fname( int ); \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ static const Catch::Detail::DummyUse INTERNAL_CATCH_UNIQUE_NAME( \ - dummyUser )( &(fname) ); \ + dummyUser )( &(fname), Catch::NameAndTags{ __VA_ARGS__ } ); \ CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ static void fname( [[maybe_unused]] int catchInternalSectionHint ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION # define INTERNAL_CATCH_TESTCASE( ... ) \ - INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ) ) + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ), __VA_ARGS__ ) #endif // CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT @@ -143,6 +172,26 @@ static int catchInternalSectionHint = 0; #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \ INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( 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() const; \ + }; \ + const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( \ + Catch::makeTestInvokerFixture( &TestName::test ), \ + CATCH_INTERNAL_LINEINFO, \ + #ClassName##_catch_sr, \ + Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ + } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ + void TestName::test() const + #define INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE( ClassName, ... ) \ + INTERNAL_CATCH_TEST_CASE_PERSISTENT_FIXTURE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) + /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ diff --git a/packages/Catch2/src/catch2/internal/catch_textflow.cpp b/packages/Catch2/src/catch2/internal/catch_textflow.cpp index 857fd2b9f..1c21d20e5 100644 --- a/packages/Catch2/src/catch2/internal/catch_textflow.cpp +++ b/packages/Catch2/src/catch2/internal/catch_textflow.cpp @@ -26,117 +26,228 @@ namespace { return std::memchr( chars, c, sizeof( chars ) - 1 ) != nullptr; } - bool isBoundary( std::string const& line, size_t at ) { - assert( at > 0 ); - assert( at <= line.size() ); - - return at == line.size() || - ( isWhitespace( line[at] ) && !isWhitespace( line[at - 1] ) ) || - isBreakableBefore( line[at] ) || - isBreakableAfter( line[at - 1] ); - } - } // namespace namespace Catch { namespace TextFlow { + void AnsiSkippingString::preprocessString() { + for ( auto it = m_string.begin(); it != m_string.end(); ) { + // try to read through an ansi sequence + while ( it != m_string.end() && *it == '\033' && + it + 1 != m_string.end() && *( it + 1 ) == '[' ) { + auto cursor = it + 2; + while ( cursor != m_string.end() && + ( isdigit( *cursor ) || *cursor == ';' ) ) { + ++cursor; + } + if ( cursor == m_string.end() || *cursor != 'm' ) { + break; + } + // 'm' -> 0xff + *cursor = AnsiSkippingString::sentinel; + // if we've read an ansi sequence, set the iterator and + // return to the top of the loop + it = cursor + 1; + } + if ( it != m_string.end() ) { + ++m_size; + ++it; + } + } + } + + AnsiSkippingString::AnsiSkippingString( std::string const& text ): + m_string( text ) { + preprocessString(); + } + + AnsiSkippingString::AnsiSkippingString( std::string&& text ): + m_string( CATCH_MOVE( text ) ) { + preprocessString(); + } + + AnsiSkippingString::const_iterator AnsiSkippingString::begin() const { + return const_iterator( m_string ); + } + + AnsiSkippingString::const_iterator AnsiSkippingString::end() const { + return const_iterator( m_string, const_iterator::EndTag{} ); + } + + std::string AnsiSkippingString::substring( const_iterator begin, + const_iterator end ) const { + // There's one caveat here to an otherwise simple substring: when + // making a begin iterator we might have skipped ansi sequences at + // the start. If `begin` here is a begin iterator, skipped over + // initial ansi sequences, we'll use the true beginning of the + // string. Lastly: We need to transform any chars we replaced with + // 0xff back to 'm' + auto str = std::string( begin == this->begin() ? m_string.begin() + : begin.m_it, + end.m_it ); + std::transform( str.begin(), str.end(), str.begin(), []( char c ) { + return c == AnsiSkippingString::sentinel ? 'm' : c; + } ); + return str; + } + + void AnsiSkippingString::const_iterator::tryParseAnsiEscapes() { + // check if we've landed on an ansi sequence, and if so read through + // it + while ( m_it != m_string->end() && *m_it == '\033' && + m_it + 1 != m_string->end() && *( m_it + 1 ) == '[' ) { + auto cursor = m_it + 2; + while ( cursor != m_string->end() && + ( isdigit( *cursor ) || *cursor == ';' ) ) { + ++cursor; + } + if ( cursor == m_string->end() || + *cursor != AnsiSkippingString::sentinel ) { + break; + } + // if we've read an ansi sequence, set the iterator and + // return to the top of the loop + m_it = cursor + 1; + } + } + + void AnsiSkippingString::const_iterator::advance() { + assert( m_it != m_string->end() ); + m_it++; + tryParseAnsiEscapes(); + } + + void AnsiSkippingString::const_iterator::unadvance() { + assert( m_it != m_string->begin() ); + m_it--; + // if *m_it is 0xff, scan back to the \033 and then m_it-- once more + // (and repeat check) + while ( *m_it == AnsiSkippingString::sentinel ) { + while ( *m_it != '\033' ) { + assert( m_it != m_string->begin() ); + m_it--; + } + // if this happens, we must have been a begin iterator that had + // skipped over ansi sequences at the start of a string + assert( m_it != m_string->begin() ); + assert( *m_it == '\033' ); + m_it--; + } + } + + static bool isBoundary( AnsiSkippingString const& line, + AnsiSkippingString::const_iterator it ) { + return it == line.end() || + ( isWhitespace( *it ) && + !isWhitespace( *it.oneBefore() ) ) || + isBreakableBefore( *it ) || + isBreakableAfter( *it.oneBefore() ); + } void Column::const_iterator::calcLength() { m_addHyphen = false; m_parsedTo = m_lineStart; + AnsiSkippingString const& current_line = m_column.m_string; - std::string const& current_line = m_column.m_string; - if ( current_line[m_lineStart] == '\n' ) { - ++m_parsedTo; + if ( m_parsedTo == current_line.end() ) { + m_lineEnd = m_parsedTo; + return; } + assert( m_lineStart != current_line.end() ); + if ( *m_lineStart == '\n' ) { ++m_parsedTo; } + 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' ) { + std::size_t lineLength = 0; + while ( m_parsedTo != current_line.end() && + lineLength < maxLineLength && *m_parsedTo != '\n' ) { ++m_parsedTo; + ++lineLength; } // 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; + if ( lineLength < maxLineLength ) { + m_lineEnd = m_parsedTo; } else { // 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; + m_lineEnd = m_parsedTo; + while ( lineLength > 0 && + !isBoundary( current_line, m_lineEnd ) ) { + --lineLength; + --m_lineEnd; } - while ( newLineLength > 0 && - isWhitespace( current_line[m_lineStart + newLineLength - 1] ) ) { - --newLineLength; + while ( lineLength > 0 && + isWhitespace( *m_lineEnd.oneBefore() ) ) { + --lineLength; + --m_lineEnd; } - // If we found one, then that is where we linebreak - if ( newLineLength > 0 ) { - m_lineLength = newLineLength; - } else { - // Otherwise we have to split text with a hyphen + // If we found one, then that is where we linebreak, otherwise + // we have to split text with a hyphen + if ( lineLength == 0 ) { m_addHyphen = true; - m_lineLength = maxLineLength - 1; + m_lineEnd = m_parsedTo.oneBefore(); } } } size_t Column::const_iterator::indentSize() const { - auto initial = - m_lineStart == 0 ? m_column.m_initialIndent : std::string::npos; + auto initial = m_lineStart == m_column.m_string.begin() + ? m_column.m_initialIndent + : std::string::npos; return initial == std::string::npos ? m_column.m_indent : initial; } - std::string - Column::const_iterator::addIndentAndSuffix( size_t position, - size_t length ) const { + std::string Column::const_iterator::addIndentAndSuffix( + AnsiSkippingString::const_iterator start, + AnsiSkippingString::const_iterator end ) const { std::string ret; const auto desired_indent = indentSize(); - ret.reserve( desired_indent + length + m_addHyphen ); + // ret.reserve( desired_indent + (end - start) + m_addHyphen ); ret.append( desired_indent, ' ' ); - ret.append( m_column.m_string, position, length ); - if ( m_addHyphen ) { - ret.push_back( '-' ); - } + // ret.append( start, end ); + ret += m_column.m_string.substring( start, end ); + if ( m_addHyphen ) { ret.push_back( '-' ); } return ret; } - Column::const_iterator::const_iterator( Column const& column ): m_column( column ) { + Column::const_iterator::const_iterator( Column const& column ): + m_column( column ), + m_lineStart( column.m_string.begin() ), + m_lineEnd( column.m_string.begin() ), + m_parsedTo( column.m_string.begin() ) { 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_lineLength == 0 ) { - m_lineStart = m_column.m_string.size(); + if ( m_lineStart == m_lineEnd ) { + m_lineStart = m_column.m_string.end(); } } std::string Column::const_iterator::operator*() const { assert( m_lineStart <= m_parsedTo ); - return addIndentAndSuffix( m_lineStart, m_lineLength ); + return addIndentAndSuffix( m_lineStart, m_lineEnd ); } Column::const_iterator& Column::const_iterator::operator++() { - m_lineStart += m_lineLength; - std::string const& current_line = m_column.m_string; - if ( m_lineStart < current_line.size() && current_line[m_lineStart] == '\n' ) { - m_lineStart += 1; + m_lineStart = m_lineEnd; + AnsiSkippingString const& current_line = m_column.m_string; + if ( m_lineStart != current_line.end() && *m_lineStart == '\n' ) { + m_lineStart++; } else { - while ( m_lineStart < current_line.size() && - isWhitespace( current_line[m_lineStart] ) ) { + while ( m_lineStart != current_line.end() && + isWhitespace( *m_lineStart ) ) { ++m_lineStart; } } - if ( m_lineStart != current_line.size() ) { - calcLength(); - } + if ( m_lineStart != current_line.end() ) { calcLength(); } return *this; } @@ -233,25 +344,25 @@ namespace Catch { return os; } - Columns operator+(Column const& lhs, Column const& rhs) { + Columns operator+( Column const& lhs, Column const& rhs ) { Columns cols; cols += lhs; cols += rhs; return cols; } - Columns operator+(Column&& lhs, Column&& rhs) { + Columns operator+( Column&& lhs, Column&& rhs ) { Columns cols; cols += CATCH_MOVE( lhs ); cols += CATCH_MOVE( rhs ); return cols; } - Columns& operator+=(Columns& lhs, Column const& rhs) { + Columns& operator+=( Columns& lhs, Column const& rhs ) { lhs.m_columns.push_back( rhs ); return lhs; } - Columns& operator+=(Columns& lhs, Column&& rhs) { - lhs.m_columns.push_back( CATCH_MOVE(rhs) ); + Columns& operator+=( Columns& lhs, Column&& rhs ) { + lhs.m_columns.push_back( CATCH_MOVE( rhs ) ); return lhs; } Columns operator+( Columns const& lhs, Column const& rhs ) { diff --git a/packages/Catch2/src/catch2/internal/catch_textflow.hpp b/packages/Catch2/src/catch2/internal/catch_textflow.hpp index a78451d55..2d9d78a50 100644 --- a/packages/Catch2/src/catch2/internal/catch_textflow.hpp +++ b/packages/Catch2/src/catch2/internal/catch_textflow.hpp @@ -20,6 +20,107 @@ namespace Catch { class Columns; + /** + * Abstraction for a string with ansi escape sequences that + * automatically skips over escapes when iterating. Only graphical + * escape sequences are considered. + * + * Internal representation: + * An escape sequence looks like \033[39;49m + * We need bidirectional iteration and the unbound length of escape + * sequences poses a problem for operator-- To make this work we'll + * replace the last `m` with a 0xff (this is a codepoint that won't have + * any utf-8 meaning). + */ + class AnsiSkippingString { + std::string m_string; + std::size_t m_size = 0; + + // perform 0xff replacement and calculate m_size + void preprocessString(); + + public: + class const_iterator; + using iterator = const_iterator; + // note: must be u-suffixed or this will cause a "truncation of + // constant value" warning on MSVC + static constexpr char sentinel = static_cast<char>( 0xffu ); + + explicit AnsiSkippingString( std::string const& text ); + explicit AnsiSkippingString( std::string&& text ); + + const_iterator begin() const; + const_iterator end() const; + + size_t size() const { return m_size; } + + std::string substring( const_iterator begin, + const_iterator end ) const; + }; + + class AnsiSkippingString::const_iterator { + friend AnsiSkippingString; + struct EndTag {}; + + const std::string* m_string; + std::string::const_iterator m_it; + + explicit const_iterator( const std::string& string, EndTag ): + m_string( &string ), m_it( string.end() ) {} + + void tryParseAnsiEscapes(); + void advance(); + void unadvance(); + + public: + using difference_type = std::ptrdiff_t; + using value_type = char; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::bidirectional_iterator_tag; + + explicit const_iterator( const std::string& string ): + m_string( &string ), m_it( string.begin() ) { + tryParseAnsiEscapes(); + } + + char operator*() const { return *m_it; } + + const_iterator& operator++() { + advance(); + return *this; + } + const_iterator operator++( int ) { + iterator prev( *this ); + operator++(); + return prev; + } + const_iterator& operator--() { + unadvance(); + return *this; + } + const_iterator operator--( int ) { + iterator prev( *this ); + operator--(); + return prev; + } + + bool operator==( const_iterator const& other ) const { + return m_it == other.m_it; + } + bool operator!=( const_iterator const& other ) const { + return !operator==( other ); + } + bool operator<=( const_iterator const& other ) const { + return m_it <= other.m_it; + } + + const_iterator oneBefore() const { + auto it = *this; + return --it; + } + }; + /** * Represents a column of text with specific width and indentation * @@ -29,10 +130,11 @@ namespace Catch { */ class Column { // String to be written out - std::string m_string; + AnsiSkippingString 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) + // 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; @@ -47,16 +149,19 @@ namespace Catch { Column const& m_column; // Where does the current line start? - size_t m_lineStart = 0; + AnsiSkippingString::const_iterator m_lineStart; // How long should the current line be? - size_t m_lineLength = 0; + AnsiSkippingString::const_iterator m_lineEnd; // How far have we checked the string to iterate? - size_t m_parsedTo = 0; + AnsiSkippingString::const_iterator m_parsedTo; // 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() ) {} + m_column( column ), + m_lineStart( m_column.m_string.end() ), + m_lineEnd( column.m_string.end() ), + m_parsedTo( column.m_string.end() ) {} // Calculates the length of the current line void calcLength(); @@ -66,8 +171,9 @@ namespace Catch { // Creates an indented and (optionally) suffixed string from // current iterator position, indentation and length. - std::string addIndentAndSuffix( size_t position, - size_t length ) const; + std::string addIndentAndSuffix( + AnsiSkippingString::const_iterator start, + AnsiSkippingString::const_iterator end ) const; public: using difference_type = std::ptrdiff_t; @@ -84,7 +190,8 @@ namespace Catch { const_iterator operator++( int ); bool operator==( const_iterator const& other ) const { - return m_lineStart == other.m_lineStart && &m_column == &other.m_column; + return m_lineStart == other.m_lineStart && + &m_column == &other.m_column; } bool operator!=( const_iterator const& other ) const { return !operator==( other ); @@ -94,7 +201,7 @@ namespace Catch { explicit Column( std::string const& text ): m_string( text ) {} explicit Column( std::string&& text ): - m_string( CATCH_MOVE(text)) {} + m_string( CATCH_MOVE( text ) ) {} Column& width( size_t newWidth ) & { assert( newWidth > 0 ); @@ -125,7 +232,9 @@ namespace Catch { size_t width() const { return m_width; } const_iterator begin() const { return const_iterator( *this ); } - const_iterator end() const { return { *this, const_iterator::EndTag{} }; } + const_iterator end() const { + return { *this, const_iterator::EndTag{} }; + } friend std::ostream& operator<<( std::ostream& os, Column const& col ); diff --git a/packages/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp b/packages/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp index afa2015d9..799a93e26 100644 --- a/packages/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp +++ b/packages/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp @@ -13,22 +13,6 @@ namespace Catch { - namespace Detail { - // Indirection to enable make_unsigned<bool> behaviour. - template <typename T> - struct make_unsigned { - using type = std::make_unsigned_t<T>; - }; - - template <> - struct make_unsigned<bool> { - using type = uint8_t; - }; - - template <typename T> - using make_unsigned_t = typename make_unsigned<T>::type; - } - /** * Implementation of uniform distribution on integers. * @@ -44,7 +28,7 @@ template <typename IntegerType> class uniform_integer_distribution { static_assert(std::is_integral<IntegerType>::value, "..."); - using UnsignedIntegerType = Detail::make_unsigned_t<IntegerType>; + using UnsignedIntegerType = Detail::SizedUnsignedType_t<sizeof(IntegerType)>; // Only the left bound is stored, and we store it converted to its // unsigned image. This avoids having to do the conversions inside @@ -64,24 +48,24 @@ class uniform_integer_distribution { // distribution will be reused many times and this is an optimization. UnsignedIntegerType m_rejection_threshold = 0; - UnsignedIntegerType computeDistance(IntegerType a, IntegerType b) const { + static constexpr UnsignedIntegerType computeDistance(IntegerType a, IntegerType b) { // This overflows and returns 0 if a == 0 and b == TYPE_MAX. // We handle that later when generating the number. return transposeTo(b) - transposeTo(a) + 1; } - static UnsignedIntegerType computeRejectionThreshold(UnsignedIntegerType ab_distance) { + static constexpr UnsignedIntegerType computeRejectionThreshold(UnsignedIntegerType ab_distance) { // distance == 0 means that we will return all possible values from // the type's range, and that we shouldn't reject anything. if ( ab_distance == 0 ) { return 0; } return ( ~ab_distance + 1 ) % ab_distance; } - static UnsignedIntegerType transposeTo(IntegerType in) { + static constexpr UnsignedIntegerType transposeTo(IntegerType in) { return Detail::transposeToNaturalOrder<IntegerType>( static_cast<UnsignedIntegerType>( in ) ); } - static IntegerType transposeBack(UnsignedIntegerType in) { + static constexpr IntegerType transposeBack(UnsignedIntegerType in) { return static_cast<IntegerType>( Detail::transposeToNaturalOrder<IntegerType>(in) ); } @@ -89,7 +73,7 @@ class uniform_integer_distribution { public: using result_type = IntegerType; - uniform_integer_distribution( IntegerType a, IntegerType b ): + constexpr uniform_integer_distribution( IntegerType a, IntegerType b ): m_a( transposeTo(a) ), m_ab_distance( computeDistance(a, b) ), m_rejection_threshold( computeRejectionThreshold(m_ab_distance) ) { @@ -97,7 +81,7 @@ public: } template <typename Generator> - result_type operator()( Generator& g ) { + constexpr result_type operator()( Generator& g ) { // All possible values of result_type are valid. if ( m_ab_distance == 0 ) { return transposeBack( Detail::fillBitsFrom<UnsignedIntegerType>( g ) ); @@ -115,8 +99,8 @@ public: return transposeBack(m_a + emul.upper); } - result_type a() const { return transposeBack(m_a); } - result_type b() const { return transposeBack(m_ab_distance + m_a - 1); } + constexpr result_type a() const { return transposeBack(m_a); } + constexpr result_type b() const { return transposeBack(m_ab_distance + m_a - 1); } }; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_wildcard_pattern.hpp b/packages/Catch2/src/catch2/internal/catch_wildcard_pattern.hpp index 72479ba87..4f4108597 100644 --- a/packages/Catch2/src/catch2/internal/catch_wildcard_pattern.hpp +++ b/packages/Catch2/src/catch2/internal/catch_wildcard_pattern.hpp @@ -8,7 +8,7 @@ #ifndef CATCH_WILDCARD_PATTERN_HPP_INCLUDED #define CATCH_WILDCARD_PATTERN_HPP_INCLUDED -#include <catch2/internal/catch_case_sensitive.hpp> +#include <catch2/catch_case_sensitive.hpp> #include <string> diff --git a/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp b/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp index 6c1d45df4..ccf63a56e 100644 --- a/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp +++ b/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp @@ -53,36 +53,16 @@ namespace { os.flags(f); } - bool shouldNewline(XmlFormatting fmt) { + constexpr bool shouldNewline(XmlFormatting fmt) { return !!(static_cast<std::underlying_type_t<XmlFormatting>>(fmt & XmlFormatting::Newline)); } - bool shouldIndent(XmlFormatting fmt) { + constexpr bool shouldIndent(XmlFormatting fmt) { return !!(static_cast<std::underlying_type_t<XmlFormatting>>(fmt & XmlFormatting::Indent)); } } // anonymous namespace - XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) { - return static_cast<XmlFormatting>( - static_cast<std::underlying_type_t<XmlFormatting>>(lhs) | - static_cast<std::underlying_type_t<XmlFormatting>>(rhs) - ); - } - - XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) { - return static_cast<XmlFormatting>( - static_cast<std::underlying_type_t<XmlFormatting>>(lhs) & - static_cast<std::underlying_type_t<XmlFormatting>>(rhs) - ); - } - - - XmlEncode::XmlEncode( StringRef str, ForWhat forWhat ) - : m_str( str ), - m_forWhat( forWhat ) - {} - void XmlEncode::encodeTo( std::ostream& os ) const { // Apostrophe escaping not necessary if we always use " to write attributes // (see: http://www.w3.org/TR/xml/#syntax) diff --git a/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp b/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp index ec55f3c46..22b42c5c8 100644 --- a/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp +++ b/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp @@ -13,16 +13,25 @@ #include <iosfwd> #include <vector> +#include <cstdint> namespace Catch { - enum class XmlFormatting { + enum class XmlFormatting : std::uint8_t { None = 0x00, Indent = 0x01, Newline = 0x02, }; - XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs); - XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs); + constexpr XmlFormatting operator|( XmlFormatting lhs, XmlFormatting rhs ) { + return static_cast<XmlFormatting>( static_cast<std::uint8_t>( lhs ) | + static_cast<std::uint8_t>( rhs ) ); + } + + constexpr XmlFormatting operator&( XmlFormatting lhs, XmlFormatting rhs ) { + return static_cast<XmlFormatting>( static_cast<std::uint8_t>( lhs ) & + static_cast<std::uint8_t>( rhs ) ); + } + /** * Helper for XML-encoding text (escaping angle brackets, quotes, etc) @@ -34,7 +43,9 @@ namespace Catch { public: enum ForWhat { ForTextNodes, ForAttributes }; - XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ); + constexpr XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ): + m_str( str ), m_forWhat( forWhat ) {} + void encodeTo( std::ostream& os ) const; 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 206332ef7..fc7b444e4 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp @@ -176,7 +176,7 @@ namespace Detail { std::string WithinRelMatcher::describe() const { Catch::ReusableStringStream sstr; - sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other"; + sstr << "and " << ::Catch::Detail::stringify(m_target) << " are within " << m_epsilon * 100. << "% of each other"; return sstr.str(); } diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_range_equals.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_range_equals.hpp index 95b781a43..8130f604f 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_range_equals.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_range_equals.hpp @@ -28,12 +28,14 @@ namespace Catch { public: template <typename TargetRangeLike2, typename Equality2> + constexpr RangeEqualsMatcher( TargetRangeLike2&& range, Equality2&& predicate ): m_desired( CATCH_FORWARD( range ) ), m_predicate( CATCH_FORWARD( predicate ) ) {} template <typename RangeLike> + constexpr bool match( RangeLike&& rng ) const { auto rng_start = begin( rng ); const auto rng_end = end( rng ); @@ -66,12 +68,14 @@ namespace Catch { public: template <typename TargetRangeLike2, typename Equality2> + constexpr UnorderedRangeEqualsMatcher( TargetRangeLike2&& range, Equality2&& predicate ): m_desired( CATCH_FORWARD( range ) ), m_predicate( CATCH_FORWARD( predicate ) ) {} template <typename RangeLike> + constexpr bool match( RangeLike&& rng ) const { using std::begin; using std::end; @@ -92,51 +96,64 @@ namespace Catch { * Creates a matcher that checks if all elements in a range are equal * to all elements in another range. * - * Uses `std::equal_to` to do the comparison + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike> - std::enable_if_t<!Detail::is_matcher<RangeLike>::value, - RangeEqualsMatcher<RangeLike, std::equal_to<>>> - RangeEquals( RangeLike&& range ) { - return { CATCH_FORWARD( range ), std::equal_to<>{} }; + template <typename RangeLike, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + RangeEqualsMatcher<RangeLike, Equality> + RangeEquals( RangeLike&& range, + Equality&& predicate = std::equal_to<>{} ) { + return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; } /** * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range. + * to all elements in an initializer list. * - * Uses to provided predicate `predicate` to do the comparisons + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike, typename Equality> - RangeEqualsMatcher<RangeLike, Equality> - RangeEquals( RangeLike&& range, Equality&& predicate ) { - return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; + template <typename T, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + RangeEqualsMatcher<std::initializer_list<T>, Equality> + RangeEquals( std::initializer_list<T> range, + Equality&& predicate = std::equal_to<>{} ) { + return { range, CATCH_FORWARD( predicate ) }; } /** * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range, in some permutation + * to all elements in another range, in some permutation. * - * Uses `std::equal_to` to do the comparison + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike> - std::enable_if_t< - !Detail::is_matcher<RangeLike>::value, - UnorderedRangeEqualsMatcher<RangeLike, std::equal_to<>>> - UnorderedRangeEquals( RangeLike&& range ) { - return { CATCH_FORWARD( range ), std::equal_to<>{} }; + template <typename RangeLike, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + UnorderedRangeEqualsMatcher<RangeLike, Equality> + UnorderedRangeEquals( RangeLike&& range, + Equality&& predicate = std::equal_to<>{} ) { + return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; } /** * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range, in some permutation. + * to all elements in an initializer list, in some permutation. * - * Uses to provided predicate `predicate` to do the comparisons + * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template <typename RangeLike, typename Equality> - UnorderedRangeEqualsMatcher<RangeLike, Equality> - UnorderedRangeEquals( RangeLike&& range, Equality&& predicate ) { - return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; + template <typename T, + typename Equality = decltype( std::equal_to<>{} )> + constexpr + UnorderedRangeEqualsMatcher<std::initializer_list<T>, Equality> + UnorderedRangeEquals( std::initializer_list<T> range, + Equality&& predicate = std::equal_to<>{} ) { + return { range, CATCH_FORWARD( predicate ) }; } } // namespace Matchers } // namespace Catch diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp index 718022e31..61a385d0a 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_string.hpp @@ -8,9 +8,9 @@ #ifndef CATCH_MATCHERS_STRING_HPP_INCLUDED #define CATCH_MATCHERS_STRING_HPP_INCLUDED -#include <catch2/matchers/catch_matchers.hpp> -#include <catch2/internal/catch_case_sensitive.hpp> #include <catch2/internal/catch_stringref.hpp> +#include <catch2/matchers/catch_matchers.hpp> +#include <catch2/catch_case_sensitive.hpp> #include <string> 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 2ee9f0c09..24a3f8b69 100644 --- a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp +++ b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp @@ -18,12 +18,22 @@ namespace Catch { +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wsign-compare" +# pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#elif defined __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsign-compare" +# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + template<typename ArgT, typename MatcherT> class MatchExpr : public ITransientExpression { ArgT && m_arg; MatcherT const& m_matcher; public: - MatchExpr( ArgT && arg, MatcherT const& matcher ) + constexpr MatchExpr( ArgT && arg, MatcherT const& matcher ) : ITransientExpression{ true, matcher.match( arg ) }, // not forwarding arg here on purpose m_arg( CATCH_FORWARD(arg) ), m_matcher( matcher ) @@ -36,6 +46,13 @@ namespace Catch { } }; +#ifdef __clang__ +# pragma clang diagnostic pop +#elif defined __GNUC__ +# pragma GCC diagnostic pop +#endif + + namespace Matchers { template <typename ArgT> class MatcherBase; @@ -46,7 +63,8 @@ namespace Catch { void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher ); template<typename ArgT, typename MatcherT> - auto makeMatchExpr( ArgT && arg, MatcherT const& matcher ) -> MatchExpr<ArgT, MatcherT> { + constexpr MatchExpr<ArgT, MatcherT> + makeMatchExpr( ArgT&& arg, MatcherT const& matcher ) { return MatchExpr<ArgT, MatcherT>( CATCH_FORWARD(arg), matcher ); } @@ -60,7 +78,7 @@ namespace Catch { INTERNAL_CATCH_TRY { \ catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher ) ); \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -70,7 +88,10 @@ namespace Catch { Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \ if( catchAssertionHandler.allowThrows() ) \ try { \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \ static_cast<void>(__VA_ARGS__ ); \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ } \ catch( exceptionType const& ex ) { \ @@ -81,7 +102,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) diff --git a/packages/Catch2/src/catch2/meson.build b/packages/Catch2/src/catch2/meson.build index cc45e6419..2eb539913 100644 --- a/packages/Catch2/src/catch2/meson.build +++ b/packages/Catch2/src/catch2/meson.build @@ -16,6 +16,7 @@ configure_file( format: 'cmake@', install_dir: get_option('includedir') / 'catch2', configuration: conf_data, + install: get_option('install') ) fs = import('fs') @@ -74,13 +75,13 @@ internal_headers = [ 'interfaces/catch_interfaces_testcase.hpp', 'internal/catch_assertion_handler.hpp', 'internal/catch_case_insensitive_comparisons.hpp', - 'internal/catch_case_sensitive.hpp', 'internal/catch_clara.hpp', 'internal/catch_commandline.hpp', 'internal/catch_compare_traits.hpp', 'internal/catch_compiler_capabilities.hpp', 'internal/catch_config_android_logwrite.hpp', 'internal/catch_config_counter.hpp', + 'internal/catch_config_prefix_messages.hpp', 'internal/catch_config_static_analysis_support.hpp', 'internal/catch_config_uncaught_exceptions.hpp', 'internal/catch_config_wchar.hpp', @@ -173,6 +174,7 @@ internal_headers = [ 'catch_approx.hpp', 'catch_assertion_info.hpp', 'catch_assertion_result.hpp', + 'catch_case_sensitive.hpp', 'catch_config.hpp', 'catch_get_random_seed.hpp', 'catch_message.hpp', @@ -233,7 +235,6 @@ internal_sources = files( 'internal/catch_random_seed_generation.cpp', 'internal/catch_reporter_registry.cpp', 'internal/catch_reporter_spec_parser.cpp', - 'internal/catch_result_type.cpp', 'internal/catch_reusable_string_stream.cpp', 'internal/catch_run_context.cpp', 'internal/catch_section.cpp', @@ -339,7 +340,9 @@ foreach file : headers endif endforeach - install_headers(file, subdir: join_paths(include_subdir, folder)) + if get_option('install') + install_headers(file, subdir: join_paths(include_subdir, folder)) + endif endforeach catch2_dependencies = [] @@ -356,7 +359,7 @@ catch2 = static_library( sources, dependencies: catch2_dependencies, include_directories: '..', - install: true, + install: get_option('install'), ) catch2_dep = declare_dependency( @@ -364,19 +367,21 @@ catch2_dep = declare_dependency( include_directories: '..', ) -pkg.generate( - catch2, - filebase: 'catch2', - description: 'A modern, C++-native, test framework for C++14 and above', - url: 'https://github.com/catchorg/Catch2', -) +if get_option('install') + pkg.generate( + catch2, + filebase: 'catch2', + description: 'A modern, C++-native, test framework for C++14 and above', + url: 'https://github.com/catchorg/Catch2', + ) +endif catch2_with_main = static_library( 'Catch2Main', 'internal/catch_main.cpp', link_with: catch2, include_directories: '..', - install: true, + install: get_option('install'), ) catch2_with_main_dep = declare_dependency( @@ -384,9 +389,11 @@ catch2_with_main_dep = declare_dependency( include_directories: '..', ) -pkg.generate( - catch2_with_main, - filebase: 'catch2-with-main', - description: 'A modern, C++-native, test framework for C++14 and above (links in default main)', - requires: 'catch2 = ' + meson.project_version(), -) +if get_option('install') + pkg.generate( + catch2_with_main, + filebase: 'catch2-with-main', + description: 'A modern, C++-native, test framework for C++14 and above (links in default main)', + requires: 'catch2 = ' + meson.project_version(), + ) +endif diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp index f3b8b5b14..9529f39aa 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp @@ -214,7 +214,7 @@ struct RowBreak {}; struct OutputFlush {}; class Duration { - enum class Unit { + enum class Unit : uint8_t { Auto, Nanoseconds, Microseconds, @@ -286,7 +286,10 @@ public: }; } // end anon namespace -enum class Justification { Left, Right }; +enum class Justification : uint8_t { + Left, + Right +}; struct ColumnInfo { std::string name; @@ -520,8 +523,8 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { m_stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } -void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { - StreamingReporterBase::testRunStarting(_testInfo); +void ConsoleReporter::testRunStarting(TestRunInfo const& _testRunInfo) { + StreamingReporterBase::testRunStarting(_testRunInfo); if ( m_config->testSpec().hasFilters() ) { m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " << m_config->testSpec() << '\n'; 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 5e1063262..09169632b 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -16,8 +16,7 @@ namespace Catch { namespace { struct BySectionInfo { BySectionInfo( SectionInfo const& other ): m_other( other ) {} - BySectionInfo( BySectionInfo const& other ): - m_other( other.m_other ) {} + BySectionInfo( BySectionInfo const& other ) = default; bool operator()( Detail::unique_ptr<CumulativeReporterBase::SectionNode> const& node ) const { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_json.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_json.cpp index 1f0db8b0d..6a8e655f0 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_json.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_json.cpp @@ -133,8 +133,8 @@ namespace Catch { return "Outputs listings as JSON. Test listing is Work-in-Progress!"; } - void JsonReporter::testRunStarting( TestRunInfo const& testInfo ) { - StreamingReporterBase::testRunStarting( testInfo ); + void JsonReporter::testRunStarting( TestRunInfo const& runInfo ) { + StreamingReporterBase::testRunStarting( runInfo ); endListing(); assert( isInside( Writer::Object ) ); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp index fc5cae34a..27bdfe28f 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp @@ -74,7 +74,7 @@ namespace Catch { static void normalizeNamespaceMarkers(std::string& str) { std::size_t pos = str.find( "::" ); - while ( pos != str.npos ) { + while ( pos != std::string::npos ) { str.replace( pos, 2, "." ); pos += 1; pos = str.find( "::", pos ); @@ -88,7 +88,7 @@ namespace Catch { xml( m_stream ) { m_preferences.shouldRedirectStdOut = true; - m_preferences.shouldReportAllAssertions = true; + m_preferences.shouldReportAllAssertions = false; m_shouldStoreSuccesfulAssertions = false; } @@ -198,7 +198,7 @@ namespace Catch { if( !rootName.empty() ) name = rootName + '/' + name; - if( sectionNode.hasAnyAssertions() + if ( sectionNode.stats.assertions.total() > 0 || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_multi.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_multi.hpp index c43f511f8..661138371 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_multi.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_multi.hpp @@ -53,7 +53,7 @@ namespace Catch { void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; - void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override; + void testCasePartialEnded(TestCaseStats const& testStats, uint64_t partNumber) override; void testCaseEnded( TestCaseStats const& testCaseStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp index 9c391b1f4..2c3eb1cd7 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp @@ -73,9 +73,9 @@ namespace Catch { if (!rootName.empty()) name = rootName + '/' + name; - if ( sectionNode.hasAnyAssertions() + if ( sectionNode.stats.assertions.total() > 0 || !sectionNode.stdOut.empty() - || !sectionNode.stdErr.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)); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp index d26af62e8..509f411e3 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp @@ -21,7 +21,7 @@ namespace Catch { : CumulativeReporterBase(CATCH_MOVE(config)) , xml(m_stream) { m_preferences.shouldRedirectStdOut = true; - m_preferences.shouldReportAllAssertions = true; + m_preferences.shouldReportAllAssertions = false; m_shouldStoreSuccesfulAssertions = false; } @@ -37,7 +37,7 @@ namespace Catch { xml.endElement(); } - void writeRun( TestRunNode const& groupNode ); + void writeRun( TestRunNode const& runNode ); void writeTestFile(StringRef filename, std::vector<TestCaseNode const*> const& testCaseNodes); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp index 04feb2e6d..662e98926 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp @@ -35,8 +35,8 @@ namespace Catch { return "Reports test results as TeamCity service messages"s; } - void testRunStarting( TestRunInfo const& groupInfo ) override; - void testRunEnded( TestRunStats const& testGroupStats ) override; + void testRunStarting( TestRunInfo const& runInfo ) override; + void testRunEnded( TestRunStats const& runStats ) override; void assertionEnded(AssertionStats const& assertionStats) override; diff --git a/packages/Catch2/tests/BUILD.bazel b/packages/Catch2/tests/BUILD.bazel new file mode 100644 index 000000000..5f0362fb6 --- /dev/null +++ b/packages/Catch2/tests/BUILD.bazel @@ -0,0 +1,83 @@ +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "catch2_self_test_helper", + srcs = ["SelfTest/helpers/parse_test_spec.cpp"], + hdrs = [ + "SelfTest/helpers/parse_test_spec.hpp", + "SelfTest/helpers/range_test_helpers.hpp", + "SelfTest/helpers/type_with_lit_0_comparisons.hpp", + ], + includes = ["SelfTest"], + deps = [ + "//:catch2", + ], +) + +cc_test( + name = "catch2_self_test", + size = "small", + srcs = [ + "SelfTest/IntrospectiveTests/Algorithms.tests.cpp", + "SelfTest/IntrospectiveTests/Clara.tests.cpp", + "SelfTest/IntrospectiveTests/CmdLine.tests.cpp", + "SelfTest/IntrospectiveTests/CmdLineHelpers.tests.cpp", + "SelfTest/IntrospectiveTests/ColourImpl.tests.cpp", + "SelfTest/IntrospectiveTests/Details.tests.cpp", + "SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp", + "SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp", + "SelfTest/IntrospectiveTests/Integer.tests.cpp", + "SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp", + "SelfTest/IntrospectiveTests/Parse.tests.cpp", + "SelfTest/IntrospectiveTests/PartTracker.tests.cpp", + "SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp", + "SelfTest/IntrospectiveTests/Reporters.tests.cpp", + "SelfTest/IntrospectiveTests/Sharding.tests.cpp", + "SelfTest/IntrospectiveTests/Stream.tests.cpp", + "SelfTest/IntrospectiveTests/String.tests.cpp", + "SelfTest/IntrospectiveTests/StringManip.tests.cpp", + "SelfTest/IntrospectiveTests/Tag.tests.cpp", + "SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp", + "SelfTest/IntrospectiveTests/TestSpec.tests.cpp", + "SelfTest/IntrospectiveTests/TestSpecParser.tests.cpp", + "SelfTest/IntrospectiveTests/TextFlow.tests.cpp", + "SelfTest/IntrospectiveTests/ToString.tests.cpp", + "SelfTest/IntrospectiveTests/Traits.tests.cpp", + "SelfTest/IntrospectiveTests/UniquePtr.tests.cpp", + "SelfTest/IntrospectiveTests/Xml.tests.cpp", + "SelfTest/TestRegistrations.cpp", + "SelfTest/TimingTests/Sleep.tests.cpp", + "SelfTest/UsageTests/Approx.tests.cpp", + "SelfTest/UsageTests/BDD.tests.cpp", + "SelfTest/UsageTests/Benchmark.tests.cpp", + "SelfTest/UsageTests/Class.tests.cpp", + "SelfTest/UsageTests/Compilation.tests.cpp", + "SelfTest/UsageTests/Condition.tests.cpp", + "SelfTest/UsageTests/Decomposition.tests.cpp", + "SelfTest/UsageTests/EnumToString.tests.cpp", + "SelfTest/UsageTests/Exception.tests.cpp", + "SelfTest/UsageTests/Generators.tests.cpp", + "SelfTest/UsageTests/Matchers.tests.cpp", + "SelfTest/UsageTests/MatchersRanges.tests.cpp", + "SelfTest/UsageTests/Message.tests.cpp", + "SelfTest/UsageTests/Misc.tests.cpp", + "SelfTest/UsageTests/ToStringByte.tests.cpp", + "SelfTest/UsageTests/ToStringChrono.tests.cpp", + "SelfTest/UsageTests/ToStringGeneral.tests.cpp", + "SelfTest/UsageTests/ToStringOptional.tests.cpp", + "SelfTest/UsageTests/ToStringPair.tests.cpp", + "SelfTest/UsageTests/ToStringTuple.tests.cpp", + "SelfTest/UsageTests/ToStringVariant.tests.cpp", + "SelfTest/UsageTests/ToStringVector.tests.cpp", + "SelfTest/UsageTests/ToStringWhich.tests.cpp", + "SelfTest/UsageTests/Tricky.tests.cpp", + "SelfTest/UsageTests/VariadicMacros.tests.cpp", + ], + deps = [ + ":catch2_self_test_helper", + "//:catch2", + "//:catch2_main", + ], +) diff --git a/packages/Catch2/tests/CMakeLists.txt b/packages/Catch2/tests/CMakeLists.txt index d3ab14a7f..37a5977e0 100644 --- a/packages/Catch2/tests/CMakeLists.txt +++ b/packages/Catch2/tests/CMakeLists.txt @@ -59,7 +59,7 @@ if (CATCH_BUILD_SURROGATES) ) target_link_libraries(Catch2SurrogateTarget PRIVATE Catch2WithMain) -endif(CATCH_BUILD_SURROGATES) +endif() #### # Temporary workaround for VS toolset changes in 2017 @@ -70,7 +70,7 @@ if (MSVC) configure_file(${CATCH_DIR}/tools/misc/SelfTest.vcxproj.user ${CMAKE_BINARY_DIR}/tests COPYONLY) -endif(MSVC) #Temporary workaround +endif() #Temporary workaround # define the sources of the self test diff --git a/packages/Catch2/tests/ExtraTests/CMakeLists.txt b/packages/Catch2/tests/ExtraTests/CMakeLists.txt index 2a810e258..3c38d6757 100644 --- a/packages/Catch2/tests/ExtraTests/CMakeLists.txt +++ b/packages/Catch2/tests/ExtraTests/CMakeLists.txt @@ -2,13 +2,12 @@ # Build extra tests. # -cmake_minimum_required( VERSION 3.10 ) +cmake_minimum_required( VERSION 3.16 ) 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> @@ -183,7 +182,7 @@ if (NOT WIN32) PROPERTIES PASS_REGULAR_EXPRESSION "Catch will terminate" ) -endif(NOT WIN32) +endif() add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-3 COMMAND DisabledExceptions-CustomHandler "Tests that run") @@ -467,6 +466,18 @@ set_tests_properties( PASS_REGULAR_EXPRESSION "Errors occurred during startup!" ) +add_executable(ReportingCrashWithJunitReporter ${TESTS_DIR}/X36-ReportingCrashWithJunitReporter.cpp) +target_link_libraries(ReportingCrashWithJunitReporter PRIVATE Catch2::Catch2WithMain) +add_test( + NAME Reporters::CrashInJunitReporter + COMMAND ${CMAKE_COMMAND} -E env $<TARGET_FILE:ReportingCrashWithJunitReporter> --reporter JUnit +) +set_tests_properties( + Reporters::CrashInJunitReporter + PROPERTIES + PASS_REGULAR_EXPRESSION "</testsuites>" + LABELS "uses-signals" +) add_executable(AssertionStartingEventGoesBeforeAssertionIsEvaluated X20-AssertionStartingEventGoesBeforeAssertionIsEvaluated.cpp @@ -556,6 +567,7 @@ add_executable(AmalgamatedTestCompilation ${CATCH_DIR}/extras/catch_amalgamated.cpp ) target_include_directories(AmalgamatedTestCompilation PRIVATE ${CATCH_DIR}/extras) +target_compile_features(AmalgamatedTestCompilation PRIVATE cxx_std_14) add_test(NAME AmalgamatedFileTest COMMAND AmalgamatedTestCompilation) set_tests_properties( diff --git a/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp b/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp index 68bc2add6..231adfb05 100644 --- a/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp +++ b/packages/Catch2/tests/ExtraTests/X02-DisabledMacros.cpp @@ -11,34 +11,28 @@ * and expressions in assertion macros are not run. */ - -#include <catch2/catch_test_macros.hpp> #include <catch2/benchmark/catch_benchmark.hpp> +#include <catch2/catch_test_macros.hpp> #include <catch2/matchers/catch_matchers.hpp> #include <catch2/matchers/catch_matchers_predicate.hpp> #include <iostream> struct foo { - foo(){ - REQUIRE_NOTHROW( print() ); - } - void print() const { - std::cout << "This should not happen\n"; - } + foo() { REQUIRE_NOTHROW( print() ); } + void print() const { std::cout << "This should not happen\n"; } }; -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wglobal-constructors" +#if defined( __clang__ ) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wglobal-constructors" #endif // Construct foo, but `foo::print` should not be run static foo f; - -#if defined(__clang__) +#if defined( __clang__ ) // The test is unused since the registration is disabled -#pragma clang diagnostic ignored "-Wunused-function" +# pragma clang diagnostic ignored "-Wunused-function" #endif // This test should not be run, because it won't be registered @@ -60,6 +54,26 @@ TEST_CASE( "Disabled Macros" ) { BENCHMARK( "Disabled benchmark" ) { REQUIRE( 1 == 2 ); }; } -#if defined(__clang__) -#pragma clang diagnostic pop +struct DisabledFixture {}; + +TEST_CASE_PERSISTENT_FIXTURE( DisabledFixture, "Disabled Persistent Fixture" ) { + 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__ ) +# pragma clang diagnostic pop #endif diff --git a/packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp b/packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp index af03ce30a..33399a686 100644 --- a/packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp +++ b/packages/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp @@ -34,7 +34,7 @@ public: return "Custom reporter for testing cumulative reporter base"; } - virtual void testRunEndedCumulative() override; + void testRunEndedCumulative() override; }; CATCH_REGISTER_REPORTER("testReporter", CumulativeBenchmarkReporter) diff --git a/packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp b/packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp index 9bd816efc..13d9fc186 100644 --- a/packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp +++ b/packages/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp @@ -36,6 +36,7 @@ public: void testRunStarting( Catch::TestRunInfo const& ) override { std::vector<std::pair<std::string, std::string>> options; + options.reserve( m_customOptions.size() ); for ( auto const& kv : m_customOptions ) { options.push_back( kv ); } diff --git a/packages/Catch2/tests/ExtraTests/X36-ReportingCrashWithJunitReporter.cpp b/packages/Catch2/tests/ExtraTests/X36-ReportingCrashWithJunitReporter.cpp new file mode 100644 index 000000000..34f4cd854 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X36-ReportingCrashWithJunitReporter.cpp @@ -0,0 +1,32 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Checks that signals/SEH within open section does not hard crash JUnit + * (or similar reporter) while we are trying to report fatal error. + */ + +#include <catch2/catch_test_macros.hpp> + +#include <csignal> + +// On Windows we need to send SEH and not signal to test the +// RunContext::handleFatalErrorCondition code path +#if defined( _MSC_VER ) +# include <windows.h> +#endif + +TEST_CASE( "raises signal" ) { + SECTION( "section" ) { +#if defined( _MSC_VER ) + RaiseException( 0xC0000005, 0, 0, NULL ); +#else + std::raise( SIGILL ); +#endif + } +} diff --git a/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp b/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp index c00462be7..78d45a2c1 100644 --- a/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp +++ b/packages/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp @@ -16,10 +16,10 @@ TEST_CASE("Just a dummy test") { auto i = GENERATE(1, 2, 3); SECTION("a") { - REQUIRE(1 != 4); + REQUIRE(i != 4); } SECTION("b") { - CHECK(1 != 5); + CHECK(i != 5); } REQUIRE_THAT(1, Catch::Matchers::Predicate<int>([](int i) { diff --git a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt index 88c23e173..7be343a1d 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -68,6 +68,8 @@ Nor would this :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: FAIL A TEST_CASE_PERSISTENT_FIXTURE based test run that fails +:test-result: PASS A TEST_CASE_PERSISTENT_FIXTURE 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> @@ -103,6 +105,7 @@ Nor would this :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 does not crash on incomplete input :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 @@ -133,8 +136,8 @@ Nor would this :test-result: SKIP Empty generators can SKIP in constructor :test-result: PASS Empty stream name opens cout stream :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 Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM +:test-result: PASS Enums in namespaces can quickly have stringification enabled using CATCH_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 @@ -354,7 +357,6 @@ b1! :test-result: FAIL nested sections can be skipped dynamically at runtime :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 diff --git a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt index a37b1a2b5..0cd24e411 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.multi.approved.txt @@ -66,6 +66,8 @@ :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: FAIL A TEST_CASE_PERSISTENT_FIXTURE based test run that fails +:test-result: PASS A TEST_CASE_PERSISTENT_FIXTURE 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> @@ -101,6 +103,7 @@ :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 does not crash on incomplete input :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 @@ -131,8 +134,8 @@ :test-result: SKIP Empty generators can SKIP in constructor :test-result: PASS Empty stream name opens cout stream :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 Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM +:test-result: PASS Enums in namespaces can quickly have stringification enabled using CATCH_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 @@ -343,7 +346,6 @@ :test-result: FAIL nested sections can be skipped dynamically at runtime :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 diff --git a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt index 0669fdbbb..b7f48cbca 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -241,6 +241,10 @@ 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 +Class.tests.cpp:<line number>: passed: m_a++ == 0 for: 0 == 0 +Class.tests.cpp:<line number>: failed: m_a == 0 for: 1 == 0 +Class.tests.cpp:<line number>: passed: m_a++ == 0 for: 0 == 0 +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 @@ -249,12 +253,22 @@ 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 ) +Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: -d == -1.23_a for: -1.22999999999999998 +== +Approx( -1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d == 1.2_a .epsilon(.1) for: 1.22999999999999998 +== +Approx( 1.19999999999999996 ) +Approx.tests.cpp:<line number>: passed: d != 1.2_a .epsilon(.001) for: 1.22999999999999998 +!= +Approx( 1.19999999999999996 ) +Approx.tests.cpp:<line number>: passed: d == 1_a .epsilon(.3) for: 1.22999999999999998 == 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> @@ -263,8 +277,8 @@ Approx.tests.cpp:<line number>: passed: 104.0 != Approx(100.0) for: 104.0 != App 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 ) +Approx.tests.cpp:<line number>: passed: 100.3 != Approx(100.0) for: 100.29999999999999716 != Approx( 100.0 ) +Approx.tests.cpp:<line number>: passed: 100.3 == Approx(100.0).margin(0.5) for: 100.29999999999999716 == 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 @@ -282,19 +296,33 @@ Approx.tests.cpp:<line number>: passed: 0.0f == Approx(0.25f).margin(0.25f) for: 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: divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) for: 3.14285714285714279 +== +Approx( 3.14100000000000001 ) +Approx.tests.cpp:<line number>: passed: divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.14285714285714279 +!= +Approx( 3.14100000000000001 ) +Approx.tests.cpp:<line number>: passed: d != Approx( 1.231 ) for: 1.22999999999999998 +!= +Approx( 1.23100000000000009 ) +Approx.tests.cpp:<line number>: passed: d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.22999999999999998 +== +Approx( 1.23100000000000009 ) +Approx.tests.cpp:<line number>: passed: 1.23f == Approx( 1.23f ) for: 1.230000019f +== +Approx( 1.23000001907348633 ) 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 ) +Approx.tests.cpp:<line number>: passed: 1.234f == Approx( dMedium ) for: 1.233999968f +== +Approx( 1.23399999999999999 ) +Approx.tests.cpp:<line number>: passed: dMedium == Approx( 1.234f ) for: 1.23399999999999999 +== +Approx( 1.23399996757507324 ) 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" @@ -350,20 +378,22 @@ 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 +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" for: "2" == "2" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" for: "5" == "5" +Clara.tests.cpp:<line number>: passed: name.empty() for: true +Clara.tests.cpp:<line number>: passed: result for: {?} +Clara.tests.cpp:<line number>: passed: result.type() == Catch::Clara::Detail::ResultType::Ok for: 0 == 0 +Clara.tests.cpp:<line number>: passed: parsed.type() == Catch::Clara::ParseResultType::NoMatch for: 1 == 1 +Clara.tests.cpp:<line number>: passed: parsed.remainingTokens().count() == 2 for: 2 == 2 +Clara.tests.cpp:<line number>: passed: name.empty() for: true 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: !{?} @@ -513,7 +543,7 @@ Stream.tests.cpp:<line number>: passed: Catch::makeStream( "-" )->isConsole() fo 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: 101.000001 != Approx(100).epsilon(0.01) for: 101.00000099999999748 != 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" @@ -533,27 +563,39 @@ EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value4 ) == 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 ) +Approx.tests.cpp:<line number>: passed: 101.01 != Approx(100).epsilon(0.01) for: 101.01000000000000512 != 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.float_nine_point_one == Approx( 9.11f ) for: 9.100000381f +== +Approx( 9.10999965667724609 ) +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 9.0f ) for: 9.100000381f == Approx( 9.0 ) +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 1 ) for: 9.100000381f == Approx( 1.0 ) +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 0 ) for: 9.100000381f == Approx( 0.0 ) +Condition.tests.cpp:<line number>: failed: data.double_pi == Approx( 3.1415 ) for: 3.14159265350000005 +== +Approx( 3.14150000000000018 ) 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>: failed: x == Approx( 1.301 ) for: 1.30000000000000027 +== +Approx( 1.30099999999999993 ) 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.float_nine_point_one == Approx( 9.1f ) for: 9.100000381f +== +Approx( 9.10000038146972656 ) +Condition.tests.cpp:<line number>: passed: data.double_pi == Approx( 3.1415926535 ) for: 3.14159265350000005 +== +Approx( 3.14159265350000005 ) 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 ) +Condition.tests.cpp:<line number>: passed: x == Approx( 1.3 ) for: 1.30000000000000027 +== +Approx( 1.30000000000000004 ) 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" @@ -600,21 +642,21 @@ 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>) GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException -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: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other +Matchers.tests.cpp:<line number>: passed: -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other +Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0 and 0.0 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: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 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: -10., WithinAbs( -9.6, 0.5 ) for: -10.0 is within 0.5 of -9.59999999999999964 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: nextafter( 1., 2. ), WithinULP( 1., 1 ) for: 1.00000000000000022 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]) @@ -622,7 +664,7 @@ Matchers.tests.cpp:<line number>: passed: 1., WithinULP( 1., 0 ) for: 1.0 is wit 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: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.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 ) @@ -630,23 +672,23 @@ 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: 1., !IsNaN() for: 1.0 not is NaN -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: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.10000038146972656 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.19999980926513672 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.0 are within 99% of each other +Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other +Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0f and 0.0 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( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 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: -10.f, WithinAbs( -9.6f, 0.5f ) for: -10.0f is within 0.5 of -9.60000038146972656 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: nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) for: 1.000000119f 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]) @@ -654,7 +696,7 @@ Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is 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: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.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 ) @@ -834,68 +876,122 @@ 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.get() == Approx(expected) for: -0.90000000000000002 +== +Approx( -0.90000000000000002 ) 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.get() == Approx(expected) for: -0.80000000000000004 +== +Approx( -0.80000000000000004 ) 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.get() == Approx(expected) for: -0.70000000000000007 +== +Approx( -0.70000000000000007 ) 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.get() == Approx(expected) for: -0.60000000000000009 +== +Approx( -0.60000000000000009 ) 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.get() == Approx(expected) for: -0.50000000000000011 +== +Approx( -0.50000000000000011 ) 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.get() == Approx(expected) for: -0.40000000000000013 +== +Approx( -0.40000000000000013 ) 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.get() == Approx(expected) for: -0.30000000000000016 +== +Approx( -0.30000000000000016 ) 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.get() == Approx(expected) for: -0.20000000000000015 +== +Approx( -0.20000000000000015 ) 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.get() == Approx(expected) for: -0.10000000000000014 +== +Approx( -0.10000000000000014 ) 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.get() == Approx(expected) for: -0.00000000000000014 +== +Approx( -0.00000000000000014 ) 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.get() == Approx(expected) for: 0.09999999999999987 +== +Approx( 0.09999999999999987 ) 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.get() == Approx(expected) for: 0.19999999999999987 +== +Approx( 0.19999999999999987 ) 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.get() == Approx(expected) for: 0.29999999999999988 +== +Approx( 0.29999999999999988 ) 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.get() == Approx(expected) for: 0.39999999999999991 +== +Approx( 0.39999999999999991 ) 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.get() == Approx(expected) for: 0.49999999999999989 +== +Approx( 0.49999999999999989 ) 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.get() == Approx(expected) for: 0.59999999999999987 +== +Approx( 0.59999999999999987 ) 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.get() == Approx(expected) for: 0.69999999999999984 +== +Approx( 0.69999999999999984 ) 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.get() == Approx(expected) for: 0.79999999999999982 +== +Approx( 0.79999999999999982 ) 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.get() == Approx(expected) for: 0.8999999999999998 +== +Approx( 0.8999999999999998 ) 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.get() == Approx( rangeEnd ) for: 0.99999999999999978 == 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.get() == Approx(expected) for: -0.69999999999999996 +== +Approx( -0.69999999999999996 ) 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.get() == Approx(expected) for: -0.39999999999999997 +== +Approx( -0.39999999999999997 ) 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.get() == Approx(expected) for: -0.09999999999999998 +== +Approx( -0.09999999999999998 ) 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.get() == Approx(expected) for: 0.20000000000000001 +== +Approx( 0.20000000000000001 ) 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.get() == Approx(expected) for: -0.69999999999999996 +== +Approx( -0.69999999999999996 ) 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.get() == Approx(expected) for: -0.39999999999999997 +== +Approx( -0.39999999999999997 ) 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.get() == Approx(expected) for: -0.09999999999999998 +== +Approx( -0.09999999999999998 ) 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.get() == Approx(expected) for: 0.20000000000000001 +== +Approx( 0.20000000000000001 ) 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' @@ -926,10 +1022,18 @@ 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 ) +Approx.tests.cpp:<line number>: passed: d >= Approx( 1.22 ) for: 1.22999999999999998 +>= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: d >= Approx( 1.23 ) for: 1.22999999999999998 +>= +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: !(d >= Approx( 1.24 )) for: !(1.22999999999999998 +>= +Approx( 1.23999999999999999 )) +Approx.tests.cpp:<line number>: passed: d >= Approx( 1.24 ).epsilon(0.1) for: 1.22999999999999998 +>= +Approx( 1.23999999999999999 ) TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) != 130711275 (0x<hex digits>) @@ -968,17 +1072,25 @@ Message.tests.cpp:<line number>: passed: i < 10 for: 9 < 10 with 2 messages: 'cu Message.tests.cpp:<line number>: failed: i < 10 for: 10 < 10 with 2 messages: 'current counter 10' and 'i := 10' AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: 'Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE'; expression was: Dummy 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.float_nine_point_one != Approx( 9.1f ) for: 9.100000381f +!= +Approx( 9.10000038146972656 ) +Condition.tests.cpp:<line number>: failed: data.double_pi != Approx( 3.1415926535 ) for: 3.14159265350000005 +!= +Approx( 3.14159265350000005 ) 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.float_nine_point_one != Approx( 9.11f ) for: 9.100000381f +!= +Approx( 9.10999965667724609 ) +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 9.0f ) for: 9.100000381f != Approx( 9.0 ) +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 1 ) for: 9.100000381f != Approx( 1.0 ) +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 0 ) for: 9.100000381f != Approx( 0.0 ) +Condition.tests.cpp:<line number>: passed: data.double_pi != Approx( 3.1415 ) for: 3.14159265350000005 +!= +Approx( 3.14150000000000018 ) 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" @@ -1069,10 +1181,18 @@ Json.tests.cpp:<line number>: passed: sstream.str() == "\"\\r\"" for: ""\r"" == Json.tests.cpp:<line number>: passed: sstream.str() == "\"\\t\"" for: ""\t"" == ""\t"" Json.tests.cpp:<line number>: passed: sstream.str() == "\"\\\\/\\t\\r\\n\"" for: ""\\/\t\r\n"" == ""\\/\t\r\n"" 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 ) +Approx.tests.cpp:<line number>: passed: d <= Approx( 1.24 ) for: 1.22999999999999998 +<= +Approx( 1.23999999999999999 ) +Approx.tests.cpp:<line number>: passed: d <= Approx( 1.23 ) for: 1.22999999999999998 +<= +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: !(d <= Approx( 1.22 )) for: !(1.22999999999999998 +<= +Approx( 1.21999999999999997 )) +Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 +<= +Approx( 1.21999999999999997 ) 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" ) @@ -1139,9 +1259,9 @@ 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.float_nine_point_one < 9 for: 9.100000381f < 9 +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one > 10 for: 9.100000381f > 10 +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one > 9.2 for: 9.100000381f > 9.19999999999999929 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" @@ -1158,9 +1278,9 @@ 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.float_nine_point_one > 9 for: 9.100000381f > 9 +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one < 10 for: 9.100000381f < 10 +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one < 9.2 for: 9.100000381f < 9.19999999999999929 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" @@ -1358,7 +1478,9 @@ CmdLine.tests.cpp:<line number>: passed: config.benchmarkSamples == 200 for: 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: config.benchmarkConfidenceInterval == Catch::Approx(0.99) for: 0.98999999999999999 +== +Approx( 0.98999999999999999 ) 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: {?} @@ -1613,14 +1735,30 @@ BDD.tests.cpp:<line number>: passed: v.size() == 0 for: 0 == 0 A string sent directly to stdout A string sent directly to stderr A string sent to stderr via clog -Approx.tests.cpp:<line number>: passed: d == Approx( 1.23 ) for: 1.23 == Approx( 1.23 ) -Approx.tests.cpp:<line number>: passed: d != Approx( 1.22 ) for: 1.23 != Approx( 1.22 ) -Approx.tests.cpp:<line number>: passed: d != Approx( 1.24 ) for: 1.23 != Approx( 1.24 ) -Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.23 == Approx( 1.23 ) -Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.23 != Approx( 1.22 ) -Approx.tests.cpp:<line number>: passed: Approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23 -Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.22 for: Approx( 1.23 ) != 1.22 -Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.24 for: Approx( 1.23 ) != 1.24 +Approx.tests.cpp:<line number>: passed: d == Approx( 1.23 ) for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d != Approx( 1.22 ) for: 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: d != Approx( 1.24 ) for: 1.22999999999999998 +!= +Approx( 1.23999999999999999 ) +Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: Approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) +== +1.22999999999999998 +Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.22 for: Approx( 1.22999999999999998 ) +!= +1.21999999999999997 +Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.24 for: Approx( 1.22999999999999998 ) +!= +1.23999999999999999 Message from section one Message from section two Matchers.tests.cpp:<line number>: failed: testStringForMatching(), StartsWith( "This String" ) for: "this string contains 'abc' as a substring" starts with: "This String" @@ -1737,13 +1875,13 @@ Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag wi 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: std::is_default_constructible<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_default_constructible<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true 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 @@ -2029,7 +2167,7 @@ MatchersRanges.tests.cpp:<line number>: passed: a, !RangeEquals( b ) for: { 1, 2 MatchersRanges.tests.cpp:<line number>: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 } MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } -Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14' +Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14000000000000012' 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 @@ -2146,6 +2284,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( vector_a_ MatchersRanges.tests.cpp:<line number>: passed: vector_a, !RangeEquals( vector_b, close_enough ) for: { 1, 2, 3 } not elements are { 3, 3, 4 } MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } elements are { 1, 2, 3, 4, 5 } MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl3, []( int l, int r ) { return l + 1 == r; } ) for: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 1, 2, 3 } ) for: { 1, 2, 3 } elements are { 1, 2, 3 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) for: { 1, 2, 3 } elements are { 2, 4, 6 } MatchersRanges.tests.cpp:<line number>: passed: mocked1, !RangeEquals( arr ) for: { 1, 2, 3, 4 } not elements are { 1, 2, 4, 4 } MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[1] for: true @@ -2166,6 +2306,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals( MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( vector_a_plus_1, close_enough ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 } MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals( vector_b, close_enough ) for: { 1, 10, 21 } not unordered elements are { 11, 21, 3 } MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, UnorderedRangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 10, 20, 1 } ) for: { 1, 10, 20 } unordered elements are { 10, 20, 1 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 } 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 @@ -2175,14 +2317,26 @@ MatchersRanges.tests.cpp:<line number>: passed: arr, !SizeIs(!Lt(3)) for: { 0, 0 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 +Approx.tests.cpp:<line number>: passed: d == approx( 1.23 ) for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d == approx( 1.22 ) for: 1.22999999999999998 +== +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: d == approx( 1.24 ) for: 1.22999999999999998 +== +Approx( 1.23999999999999999 ) +Approx.tests.cpp:<line number>: passed: d != approx( 1.25 ) for: 1.22999999999999998 != Approx( 1.25 ) +Approx.tests.cpp:<line number>: passed: approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) +== +1.22999999999999998 +Approx.tests.cpp:<line number>: passed: approx( d ) == 1.22 for: Approx( 1.22999999999999998 ) +== +1.21999999999999997 +Approx.tests.cpp:<line number>: passed: approx( d ) == 1.24 for: Approx( 1.22999999999999998 ) +== +1.23999999999999999 +Approx.tests.cpp:<line number>: passed: approx( d ) != 1.25 for: Approx( 1.22999999999999998 ) != 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 } @@ -2357,9 +2511,15 @@ Skip.tests.cpp:<line number>: skipped: 'skipping because answer = 41' Skip.tests.cpp:<line number>: passed: Skip.tests.cpp:<line number>: skipped: 'skipping because answer = 43' 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: erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.09203687623843014 +== +Approx( -0.09203687623843015 ) +InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.05980291115763361 +== +Approx( -0.05980291115763361 ) +InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.38590382434967774 +== +Approx( 1.38590382434967796 ) 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: @@ -2436,14 +2596,15 @@ Skip.tests.cpp:<line number>: skipped: ! 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 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.551780) == Approx(0.13015979861484198) for: 0.13015979861484195 +== +Approx( 0.13015979861484198 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.08457408802851875 +== +Approx( 0.08457408802851875 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.95996398454005405 +== +Approx( -1.95996398454005449 ) 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' @@ -2483,6 +2644,10 @@ StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(letters, lett 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(letters, "c", "cc") for: true +StringManip.tests.cpp:<line number>: passed: letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(s, "--", "-") for: true +StringManip.tests.cpp:<line number>: passed: s == "--" for: "--" == "--" 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" ) @@ -2609,19 +2774,19 @@ EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == 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: "1.5f" == ::Catch::Detail::stringify(float(1.5)) for: "1.5f" == "1.5f" +ToStringTuple.tests.cpp:<line number>: passed: "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) for: "{ 1.5f, 0 }" == "{ 1.5f, 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 }" +ToStringTuple.tests.cpp:<line number>: passed: "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.5f }" == -"{ { 42 }, { }, 1.2f }" +"{ { 42 }, { }, 1.5f }" 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 +InternalBenchmark.tests.cpp:<line number>: passed: e.confidence_interval == 0.95 for: 0.94999999999999996 == 0.94999999999999996 RandomNumberGeneration.tests.cpp:<line number>: passed: dist.a() == -10 for: -10 == -10 RandomNumberGeneration.tests.cpp:<line number>: passed: dist.b() == 10 for: 10 == 10 UniquePtr.tests.cpp:<line number>: passed: !(ptr) for: !{?} @@ -2689,7 +2854,7 @@ 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: -test cases: 417 | 312 passed | 85 failed | 6 skipped | 14 failed as expected -assertions: 2260 | 2079 passed | 146 failed | 35 failed as expected +test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected +assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index 214fef74b..9e3e53723 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -239,6 +239,10 @@ 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 +Class.tests.cpp:<line number>: passed: m_a++ == 0 for: 0 == 0 +Class.tests.cpp:<line number>: failed: m_a == 0 for: 1 == 0 +Class.tests.cpp:<line number>: passed: m_a++ == 0 for: 0 == 0 +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 @@ -247,12 +251,22 @@ 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 ) +Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: -d == -1.23_a for: -1.22999999999999998 +== +Approx( -1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d == 1.2_a .epsilon(.1) for: 1.22999999999999998 +== +Approx( 1.19999999999999996 ) +Approx.tests.cpp:<line number>: passed: d != 1.2_a .epsilon(.001) for: 1.22999999999999998 +!= +Approx( 1.19999999999999996 ) +Approx.tests.cpp:<line number>: passed: d == 1_a .epsilon(.3) for: 1.22999999999999998 == 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> @@ -261,8 +275,8 @@ Approx.tests.cpp:<line number>: passed: 104.0 != Approx(100.0) for: 104.0 != App 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 ) +Approx.tests.cpp:<line number>: passed: 100.3 != Approx(100.0) for: 100.29999999999999716 != Approx( 100.0 ) +Approx.tests.cpp:<line number>: passed: 100.3 == Approx(100.0).margin(0.5) for: 100.29999999999999716 == 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 @@ -280,19 +294,33 @@ Approx.tests.cpp:<line number>: passed: 0.0f == Approx(0.25f).margin(0.25f) for: 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: divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) for: 3.14285714285714279 +== +Approx( 3.14100000000000001 ) +Approx.tests.cpp:<line number>: passed: divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.14285714285714279 +!= +Approx( 3.14100000000000001 ) +Approx.tests.cpp:<line number>: passed: d != Approx( 1.231 ) for: 1.22999999999999998 +!= +Approx( 1.23100000000000009 ) +Approx.tests.cpp:<line number>: passed: d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.22999999999999998 +== +Approx( 1.23100000000000009 ) +Approx.tests.cpp:<line number>: passed: 1.23f == Approx( 1.23f ) for: 1.230000019f +== +Approx( 1.23000001907348633 ) 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 ) +Approx.tests.cpp:<line number>: passed: 1.234f == Approx( dMedium ) for: 1.233999968f +== +Approx( 1.23399999999999999 ) +Approx.tests.cpp:<line number>: passed: dMedium == Approx( 1.234f ) for: 1.23399999999999999 +== +Approx( 1.23399996757507324 ) 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" @@ -348,20 +376,22 @@ 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 +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" for: "2" == "2" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" for: "5" == "5" +Clara.tests.cpp:<line number>: passed: name.empty() for: true +Clara.tests.cpp:<line number>: passed: result for: {?} +Clara.tests.cpp:<line number>: passed: result.type() == Catch::Clara::Detail::ResultType::Ok for: 0 == 0 +Clara.tests.cpp:<line number>: passed: parsed.type() == Catch::Clara::ParseResultType::NoMatch for: 1 == 1 +Clara.tests.cpp:<line number>: passed: parsed.remainingTokens().count() == 2 for: 2 == 2 +Clara.tests.cpp:<line number>: passed: name.empty() for: true 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: !{?} @@ -511,7 +541,7 @@ Stream.tests.cpp:<line number>: passed: Catch::makeStream( "-" )->isConsole() fo 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: 101.000001 != Approx(100).epsilon(0.01) for: 101.00000099999999748 != 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" @@ -531,27 +561,39 @@ EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value4 ) == 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 ) +Approx.tests.cpp:<line number>: passed: 101.01 != Approx(100).epsilon(0.01) for: 101.01000000000000512 != 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.float_nine_point_one == Approx( 9.11f ) for: 9.100000381f +== +Approx( 9.10999965667724609 ) +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 9.0f ) for: 9.100000381f == Approx( 9.0 ) +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 1 ) for: 9.100000381f == Approx( 1.0 ) +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one == Approx( 0 ) for: 9.100000381f == Approx( 0.0 ) +Condition.tests.cpp:<line number>: failed: data.double_pi == Approx( 3.1415 ) for: 3.14159265350000005 +== +Approx( 3.14150000000000018 ) 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>: failed: x == Approx( 1.301 ) for: 1.30000000000000027 +== +Approx( 1.30099999999999993 ) 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.float_nine_point_one == Approx( 9.1f ) for: 9.100000381f +== +Approx( 9.10000038146972656 ) +Condition.tests.cpp:<line number>: passed: data.double_pi == Approx( 3.1415926535 ) for: 3.14159265350000005 +== +Approx( 3.14159265350000005 ) 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 ) +Condition.tests.cpp:<line number>: passed: x == Approx( 1.3 ) for: 1.30000000000000027 +== +Approx( 1.30000000000000004 ) 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" @@ -598,21 +640,21 @@ 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>) GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException -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: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other +Matchers.tests.cpp:<line number>: passed: -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other +Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0 and 0.0 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: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 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: -10., WithinAbs( -9.6, 0.5 ) for: -10.0 is within 0.5 of -9.59999999999999964 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: nextafter( 1., 2. ), WithinULP( 1., 1 ) for: 1.00000000000000022 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]) @@ -620,7 +662,7 @@ Matchers.tests.cpp:<line number>: passed: 1., WithinULP( 1., 0 ) for: 1.0 is wit 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: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.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 ) @@ -628,23 +670,23 @@ 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: 1., !IsNaN() for: 1.0 not is NaN -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: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.10000038146972656 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.19999980926513672 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.0 are within 99% of each other +Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other +Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0f and 0.0 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( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 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: -10.f, WithinAbs( -9.6f, 0.5f ) for: -10.0f is within 0.5 of -9.60000038146972656 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: nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) for: 1.000000119f 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]) @@ -652,7 +694,7 @@ Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is 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: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.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 ) @@ -832,68 +874,122 @@ 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.get() == Approx(expected) for: -0.90000000000000002 +== +Approx( -0.90000000000000002 ) 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.get() == Approx(expected) for: -0.80000000000000004 +== +Approx( -0.80000000000000004 ) 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.get() == Approx(expected) for: -0.70000000000000007 +== +Approx( -0.70000000000000007 ) 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.get() == Approx(expected) for: -0.60000000000000009 +== +Approx( -0.60000000000000009 ) 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.get() == Approx(expected) for: -0.50000000000000011 +== +Approx( -0.50000000000000011 ) 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.get() == Approx(expected) for: -0.40000000000000013 +== +Approx( -0.40000000000000013 ) 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.get() == Approx(expected) for: -0.30000000000000016 +== +Approx( -0.30000000000000016 ) 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.get() == Approx(expected) for: -0.20000000000000015 +== +Approx( -0.20000000000000015 ) 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.get() == Approx(expected) for: -0.10000000000000014 +== +Approx( -0.10000000000000014 ) 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.get() == Approx(expected) for: -0.00000000000000014 +== +Approx( -0.00000000000000014 ) 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.get() == Approx(expected) for: 0.09999999999999987 +== +Approx( 0.09999999999999987 ) 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.get() == Approx(expected) for: 0.19999999999999987 +== +Approx( 0.19999999999999987 ) 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.get() == Approx(expected) for: 0.29999999999999988 +== +Approx( 0.29999999999999988 ) 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.get() == Approx(expected) for: 0.39999999999999991 +== +Approx( 0.39999999999999991 ) 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.get() == Approx(expected) for: 0.49999999999999989 +== +Approx( 0.49999999999999989 ) 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.get() == Approx(expected) for: 0.59999999999999987 +== +Approx( 0.59999999999999987 ) 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.get() == Approx(expected) for: 0.69999999999999984 +== +Approx( 0.69999999999999984 ) 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.get() == Approx(expected) for: 0.79999999999999982 +== +Approx( 0.79999999999999982 ) 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.get() == Approx(expected) for: 0.8999999999999998 +== +Approx( 0.8999999999999998 ) 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.get() == Approx( rangeEnd ) for: 0.99999999999999978 == 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.get() == Approx(expected) for: -0.69999999999999996 +== +Approx( -0.69999999999999996 ) 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.get() == Approx(expected) for: -0.39999999999999997 +== +Approx( -0.39999999999999997 ) 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.get() == Approx(expected) for: -0.09999999999999998 +== +Approx( -0.09999999999999998 ) 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.get() == Approx(expected) for: 0.20000000000000001 +== +Approx( 0.20000000000000001 ) 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.get() == Approx(expected) for: -0.69999999999999996 +== +Approx( -0.69999999999999996 ) 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.get() == Approx(expected) for: -0.39999999999999997 +== +Approx( -0.39999999999999997 ) 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.get() == Approx(expected) for: -0.09999999999999998 +== +Approx( -0.09999999999999998 ) 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.get() == Approx(expected) for: 0.20000000000000001 +== +Approx( 0.20000000000000001 ) 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' @@ -924,10 +1020,18 @@ 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 ) +Approx.tests.cpp:<line number>: passed: d >= Approx( 1.22 ) for: 1.22999999999999998 +>= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: d >= Approx( 1.23 ) for: 1.22999999999999998 +>= +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: !(d >= Approx( 1.24 )) for: !(1.22999999999999998 +>= +Approx( 1.23999999999999999 )) +Approx.tests.cpp:<line number>: passed: d >= Approx( 1.24 ).epsilon(0.1) for: 1.22999999999999998 +>= +Approx( 1.23999999999999999 ) TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) != 130711275 (0x<hex digits>) @@ -966,17 +1070,25 @@ Message.tests.cpp:<line number>: passed: i < 10 for: 9 < 10 with 2 messages: 'cu Message.tests.cpp:<line number>: failed: i < 10 for: 10 < 10 with 2 messages: 'current counter 10' and 'i := 10' AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: 'Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE'; expression was: Dummy 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.float_nine_point_one != Approx( 9.1f ) for: 9.100000381f +!= +Approx( 9.10000038146972656 ) +Condition.tests.cpp:<line number>: failed: data.double_pi != Approx( 3.1415926535 ) for: 3.14159265350000005 +!= +Approx( 3.14159265350000005 ) 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.float_nine_point_one != Approx( 9.11f ) for: 9.100000381f +!= +Approx( 9.10999965667724609 ) +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 9.0f ) for: 9.100000381f != Approx( 9.0 ) +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 1 ) for: 9.100000381f != Approx( 1.0 ) +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one != Approx( 0 ) for: 9.100000381f != Approx( 0.0 ) +Condition.tests.cpp:<line number>: passed: data.double_pi != Approx( 3.1415 ) for: 3.14159265350000005 +!= +Approx( 3.14150000000000018 ) 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" @@ -1067,10 +1179,18 @@ Json.tests.cpp:<line number>: passed: sstream.str() == "\"\\r\"" for: ""\r"" == Json.tests.cpp:<line number>: passed: sstream.str() == "\"\\t\"" for: ""\t"" == ""\t"" Json.tests.cpp:<line number>: passed: sstream.str() == "\"\\\\/\\t\\r\\n\"" for: ""\\/\t\r\n"" == ""\\/\t\r\n"" 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 ) +Approx.tests.cpp:<line number>: passed: d <= Approx( 1.24 ) for: 1.22999999999999998 +<= +Approx( 1.23999999999999999 ) +Approx.tests.cpp:<line number>: passed: d <= Approx( 1.23 ) for: 1.22999999999999998 +<= +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: !(d <= Approx( 1.22 )) for: !(1.22999999999999998 +<= +Approx( 1.21999999999999997 )) +Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 +<= +Approx( 1.21999999999999997 ) 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" ) @@ -1137,9 +1257,9 @@ 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.float_nine_point_one < 9 for: 9.100000381f < 9 +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one > 10 for: 9.100000381f > 10 +Condition.tests.cpp:<line number>: failed: data.float_nine_point_one > 9.2 for: 9.100000381f > 9.19999999999999929 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" @@ -1156,9 +1276,9 @@ 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.float_nine_point_one > 9 for: 9.100000381f > 9 +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one < 10 for: 9.100000381f < 10 +Condition.tests.cpp:<line number>: passed: data.float_nine_point_one < 9.2 for: 9.100000381f < 9.19999999999999929 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" @@ -1356,7 +1476,9 @@ CmdLine.tests.cpp:<line number>: passed: config.benchmarkSamples == 200 for: 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: config.benchmarkConfidenceInterval == Catch::Approx(0.99) for: 0.98999999999999999 +== +Approx( 0.98999999999999999 ) 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: {?} @@ -1608,14 +1730,30 @@ 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 +Approx.tests.cpp:<line number>: passed: d == Approx( 1.23 ) for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d != Approx( 1.22 ) for: 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: d != Approx( 1.24 ) for: 1.22999999999999998 +!= +Approx( 1.23999999999999999 ) +Approx.tests.cpp:<line number>: passed: d == 1.23_a for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d != 1.22_a for: 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: Approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) +== +1.22999999999999998 +Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.22 for: Approx( 1.22999999999999998 ) +!= +1.21999999999999997 +Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.24 for: Approx( 1.22999999999999998 ) +!= +1.23999999999999999 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 }" @@ -1730,13 +1868,13 @@ Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag wi 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: std::is_default_constructible<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_default_constructible<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true +Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true 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 @@ -2022,7 +2160,7 @@ MatchersRanges.tests.cpp:<line number>: passed: a, !RangeEquals( b ) for: { 1, 2 MatchersRanges.tests.cpp:<line number>: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 } MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } -Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14' +Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14000000000000012' 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 @@ -2139,6 +2277,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( vector_a_ MatchersRanges.tests.cpp:<line number>: passed: vector_a, !RangeEquals( vector_b, close_enough ) for: { 1, 2, 3 } not elements are { 3, 3, 4 } MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } elements are { 1, 2, 3, 4, 5 } MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl3, []( int l, int r ) { return l + 1 == r; } ) for: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 1, 2, 3 } ) for: { 1, 2, 3 } elements are { 1, 2, 3 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) for: { 1, 2, 3 } elements are { 2, 4, 6 } MatchersRanges.tests.cpp:<line number>: passed: mocked1, !RangeEquals( arr ) for: { 1, 2, 3, 4 } not elements are { 1, 2, 4, 4 } MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[1] for: true @@ -2159,6 +2299,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals( MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( vector_a_plus_1, close_enough ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 } MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals( vector_b, close_enough ) for: { 1, 10, 21 } not unordered elements are { 11, 21, 3 } MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, UnorderedRangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 10, 20, 1 } ) for: { 1, 10, 20 } unordered elements are { 10, 20, 1 } +MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 } 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 @@ -2168,14 +2310,26 @@ MatchersRanges.tests.cpp:<line number>: passed: arr, !SizeIs(!Lt(3)) for: { 0, 0 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 +Approx.tests.cpp:<line number>: passed: d == approx( 1.23 ) for: 1.22999999999999998 +== +Approx( 1.22999999999999998 ) +Approx.tests.cpp:<line number>: passed: d == approx( 1.22 ) for: 1.22999999999999998 +== +Approx( 1.21999999999999997 ) +Approx.tests.cpp:<line number>: passed: d == approx( 1.24 ) for: 1.22999999999999998 +== +Approx( 1.23999999999999999 ) +Approx.tests.cpp:<line number>: passed: d != approx( 1.25 ) for: 1.22999999999999998 != Approx( 1.25 ) +Approx.tests.cpp:<line number>: passed: approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) +== +1.22999999999999998 +Approx.tests.cpp:<line number>: passed: approx( d ) == 1.22 for: Approx( 1.22999999999999998 ) +== +1.21999999999999997 +Approx.tests.cpp:<line number>: passed: approx( d ) == 1.24 for: Approx( 1.22999999999999998 ) +== +1.23999999999999999 +Approx.tests.cpp:<line number>: passed: approx( d ) != 1.25 for: Approx( 1.22999999999999998 ) != 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 } @@ -2350,9 +2504,15 @@ Skip.tests.cpp:<line number>: skipped: 'skipping because answer = 41' Skip.tests.cpp:<line number>: passed: Skip.tests.cpp:<line number>: skipped: 'skipping because answer = 43' 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: erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.09203687623843014 +== +Approx( -0.09203687623843015 ) +InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.05980291115763361 +== +Approx( -0.05980291115763361 ) +InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.38590382434967774 +== +Approx( 1.38590382434967796 ) 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: @@ -2425,14 +2585,15 @@ Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2 Skip.tests.cpp:<line number>: skipped: 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 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.551780) == Approx(0.13015979861484198) for: 0.13015979861484195 +== +Approx( 0.13015979861484198 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.08457408802851875 +== +Approx( 0.08457408802851875 ) +InternalBenchmark.tests.cpp:<line number>: passed: normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.95996398454005405 +== +Approx( -1.95996398454005449 ) 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' @@ -2472,6 +2633,10 @@ StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(letters, lett 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(letters, "c", "cc") for: true +StringManip.tests.cpp:<line number>: passed: letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +StringManip.tests.cpp:<line number>: passed: Catch::replaceInPlace(s, "--", "-") for: true +StringManip.tests.cpp:<line number>: passed: s == "--" for: "--" == "--" 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" ) @@ -2598,19 +2763,19 @@ EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == 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: "1.5f" == ::Catch::Detail::stringify(float(1.5)) for: "1.5f" == "1.5f" +ToStringTuple.tests.cpp:<line number>: passed: "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) for: "{ 1.5f, 0 }" == "{ 1.5f, 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 }" +ToStringTuple.tests.cpp:<line number>: passed: "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.5f }" == -"{ { 42 }, { }, 1.2f }" +"{ { 42 }, { }, 1.5f }" 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 +InternalBenchmark.tests.cpp:<line number>: passed: e.confidence_interval == 0.95 for: 0.94999999999999996 == 0.94999999999999996 RandomNumberGeneration.tests.cpp:<line number>: passed: dist.a() == -10 for: -10 == -10 RandomNumberGeneration.tests.cpp:<line number>: passed: dist.b() == 10 for: 10 == 10 UniquePtr.tests.cpp:<line number>: passed: !(ptr) for: !{?} @@ -2678,7 +2843,7 @@ 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: -test cases: 417 | 312 passed | 85 failed | 6 skipped | 14 failed as expected -assertions: 2260 | 2079 passed | 146 failed | 35 failed as expected +test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected +assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt index 254262565..495264b4d 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt @@ -297,6 +297,18 @@ Class.tests.cpp:<line number>: FAILED: with expansion: 1 == 2 +------------------------------------------------------------------------------- +A TEST_CASE_PERSISTENT_FIXTURE based test run that fails + Second partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( m_a == 0 ) +with expansion: + 1 == 0 + ------------------------------------------------------------------------------- A couple of nested sections followed by a failure ------------------------------------------------------------------------------- @@ -434,27 +446,31 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 9.100000381f + == + Approx( 9.10999965667724609 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) with expansion: - 9.1f == Approx( 9.0 ) + 9.100000381f == Approx( 9.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) with expansion: - 9.1f == Approx( 1.0 ) + 9.100000381f == Approx( 1.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: - 9.1f == Approx( 0.0 ) + 9.100000381f == Approx( 0.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: - 3.1415926535 == Approx( 3.1415 ) + 3.14159265350000005 + == + Approx( 3.14150000000000018 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello == "goodbye" ) @@ -479,7 +495,9 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: - 1.3 == Approx( 1.301 ) + 1.30000000000000027 + == + Approx( 1.30099999999999993 ) ------------------------------------------------------------------------------- Equals string matcher @@ -696,12 +714,16 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: - 9.1f != Approx( 9.1000003815 ) + 9.100000381f + != + Approx( 9.10000038146972656 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) with expansion: - 3.1415926535 != Approx( 3.1415926535 ) + 3.14159265350000005 + != + Approx( 3.14159265350000005 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello != "hello" ) @@ -855,17 +877,17 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: - 9.1f < 9 + 9.100000381f < 9 Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one > 10 ) with expansion: - 9.1f > 10 + 9.100000381f > 10 Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one > 9.2 ) with expansion: - 9.1f > 9.2 + 9.100000381f > 9.19999999999999929 Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello > "hello" ) @@ -1060,7 +1082,7 @@ Exception.tests.cpp:<line number> Exception.tests.cpp:<line number>: FAILED: due to unexpected exception with message: - 3.14 + 3.14000000000000012 ------------------------------------------------------------------------------- Vector Approx matcher -- failing @@ -1588,6 +1610,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 417 | 326 passed | 70 failed | 7 skipped | 14 failed as expected -assertions: 2243 | 2079 passed | 129 failed | 35 failed as expected +test cases: 419 | 327 passed | 71 failed | 7 skipped | 14 failed as expected +assertions: 2252 | 2087 passed | 130 failed | 35 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 077b7bf75..a53f40d10 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt @@ -2023,6 +2023,54 @@ 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 TEST_CASE_PERSISTENT_FIXTURE based test run that fails + First partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( m_a++ == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEST_CASE_PERSISTENT_FIXTURE based test run that fails + Second partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( m_a == 0 ) +with expansion: + 1 == 0 + +------------------------------------------------------------------------------- +A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds + First partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( m_a++ == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds + Second partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + Class.tests.cpp:<line number>: PASSED: REQUIRE( m_a == 1 ) with expansion: @@ -2125,32 +2173,42 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.23_a ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.22_a ) with expansion: - 1.23 != Approx( 1.22 ) + 1.22999999999999998 + != + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( -d == -1.23_a ) with expansion: - -1.23 == Approx( -1.23 ) + -1.22999999999999998 + == + Approx( -1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.2_a .epsilon(.1) ) with expansion: - 1.23 == Approx( 1.2 ) + 1.22999999999999998 + == + Approx( 1.19999999999999996 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.2_a .epsilon(.001) ) with expansion: - 1.23 != Approx( 1.2 ) + 1.22999999999999998 + != + Approx( 1.19999999999999996 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1_a .epsilon(.3) ) with expansion: - 1.23 == Approx( 1.0 ) + 1.22999999999999998 == Approx( 1.0 ) ------------------------------------------------------------------------------- A couple of nested sections followed by a failure @@ -2219,12 +2277,12 @@ with expansion: Approx.tests.cpp:<line number>: PASSED: REQUIRE( 100.3 != Approx(100.0) ) with expansion: - 100.3 != Approx( 100.0 ) + 100.29999999999999716 != 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 ) + 100.29999999999999716 == Approx( 100.0 ) ------------------------------------------------------------------------------- An empty test with no assertions @@ -2342,12 +2400,16 @@ 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 ) + 3.14285714285714279 + == + Approx( 3.14100000000000001 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) with expansion: - 3.1428571429 != Approx( 3.141 ) + 3.14285714285714279 + != + Approx( 3.14100000000000001 ) ------------------------------------------------------------------------------- Approximate comparisons with different epsilons @@ -2358,12 +2420,16 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.231 ) ) with expansion: - 1.23 != Approx( 1.231 ) + 1.22999999999999998 + != + Approx( 1.23100000000000009 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: - 1.23 == Approx( 1.231 ) + 1.22999999999999998 + == + Approx( 1.23100000000000009 ) ------------------------------------------------------------------------------- Approximate comparisons with floats @@ -2374,7 +2440,9 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) with expansion: - 1.23f == Approx( 1.2300000191 ) + 1.230000019f + == + Approx( 1.23000001907348633 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) @@ -2421,12 +2489,16 @@ with expansion: Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: - 1.234f == Approx( 1.234 ) + 1.233999968f + == + Approx( 1.23399999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: - 1.234 == Approx( 1.2339999676 ) + 1.23399999999999999 + == + Approx( 1.23399996757507324 ) ------------------------------------------------------------------------------- Arbitrary predicate matcher @@ -2904,24 +2976,24 @@ ToStringGeneral.tests.cpp:<line number> ............................................................................... ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( tab == '\t' ) + CHECK( ::Catch::Detail::stringify('\t') == "'\\t'" ) with expansion: - '\t' == '\t' + "'\t'" == "'\t'" ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( newline == '\n' ) + CHECK( ::Catch::Detail::stringify('\n') == "'\\n'" ) with expansion: - '\n' == '\n' + "'\n'" == "'\n'" ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( carr_return == '\r' ) + CHECK( ::Catch::Detail::stringify('\r') == "'\\r'" ) with expansion: - '\r' == '\r' + "'\r'" == "'\r'" ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( form_feed == '\f' ) + CHECK( ::Catch::Detail::stringify('\f') == "'\\f'" ) with expansion: - '\f' == '\f' + "'\f'" == "'\f'" ------------------------------------------------------------------------------- Character pretty printing @@ -2931,29 +3003,19 @@ 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] ) + CHECK( ::Catch::Detail::stringify( ' ' ) == "' '" ) with expansion: - 'a' == 'a' + "' '" == "' '" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'A' ) == "'A'" ) with expansion: - 'z' == 'z' + "'A'" == "'A'" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'z' ) == "'z'" ) with expansion: - 'A' == 'A' - -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) -with expansion: - 'Z' == 'Z' + "'z'" == "'z'" ------------------------------------------------------------------------------- Character pretty printing @@ -2963,29 +3025,55 @@ ToStringGeneral.tests.cpp:<line number> ............................................................................... ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( null_terminator == '\0' ) + CHECK( ::Catch::Detail::stringify( '\0' ) == "0" ) with expansion: - 0 == 0 + "0" == "0" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" ) with expansion: - 2 == 2 + "2" == "2" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" ) with expansion: - 3 == 3 + "5" == "5" -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) +------------------------------------------------------------------------------- +Clara::Arg does not crash on incomplete input +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: + CHECK( name.empty() ) with expansion: - 4 == 4 + true -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) +Clara.tests.cpp:<line number>: PASSED: + CHECK( result ) with expansion: - 5 == 5 + {?} + +Clara.tests.cpp:<line number>: PASSED: + CHECK( result.type() == Catch::Clara::Detail::ResultType::Ok ) +with expansion: + 0 == 0 + +Clara.tests.cpp:<line number>: PASSED: + CHECK( parsed.type() == Catch::Clara::ParseResultType::NoMatch ) +with expansion: + 1 == 1 + +Clara.tests.cpp:<line number>: PASSED: + CHECK( parsed.remainingTokens().count() == 2 ) +with expansion: + 2 == 2 + +Clara.tests.cpp:<line number>: PASSED: + CHECK( name.empty() ) +with expansion: + true ------------------------------------------------------------------------------- Clara::Arg supports single-arg parse the way Opt does @@ -3926,7 +4014,7 @@ 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 ) + 101.00000099999999748 != Approx( 100.0 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( std::pow(10, -5) != Approx(std::pow(10, -7)) ) @@ -3995,7 +4083,7 @@ with expansion: insensitive) ------------------------------------------------------------------------------- -Enums can quickly have stringification enabled using REGISTER_ENUM +Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ------------------------------------------------------------------------------- EnumToString.tests.cpp:<line number> ............................................................................... @@ -4029,7 +4117,7 @@ with expansion: ------------------------------------------------------------------------------- Enums in namespaces can quickly have stringification enabled using -REGISTER_ENUM +CATCH_REGISTER_ENUM ------------------------------------------------------------------------------- EnumToString.tests.cpp:<line number> ............................................................................... @@ -4053,7 +4141,7 @@ 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 ) + 101.01000000000000512 != Approx( 100.0 ) ------------------------------------------------------------------------------- Equality checks that should fail @@ -4079,27 +4167,31 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 9.100000381f + == + Approx( 9.10999965667724609 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) with expansion: - 9.1f == Approx( 9.0 ) + 9.100000381f == Approx( 9.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) with expansion: - 9.1f == Approx( 1.0 ) + 9.100000381f == Approx( 1.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: - 9.1f == Approx( 0.0 ) + 9.100000381f == Approx( 0.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: - 3.1415926535 == Approx( 3.1415 ) + 3.14159265350000005 + == + Approx( 3.14150000000000018 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello == "goodbye" ) @@ -4124,7 +4216,9 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: - 1.3 == Approx( 1.301 ) + 1.30000000000000027 + == + Approx( 1.30099999999999993 ) ------------------------------------------------------------------------------- Equality checks that should succeed @@ -4140,12 +4234,16 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: - 9.1f == Approx( 9.1000003815 ) + 9.100000381f + == + Approx( 9.10000038146972656 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: - 3.1415926535 == Approx( 3.1415926535 ) + 3.14159265350000005 + == + Approx( 3.14159265350000005 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello == "hello" ) @@ -4165,7 +4263,9 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( x == Approx( 1.3 ) ) with expansion: - 1.3 == Approx( 1.3 ) + 1.30000000000000027 + == + Approx( 1.30000000000000004 ) ------------------------------------------------------------------------------- Equals @@ -4497,22 +4597,22 @@ 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 + 10.0 and 11.09999999999999964 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 + 10.0 not and 11.19999999999999929 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 + 1.0 not and 0.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 + -0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4525,7 +4625,7 @@ 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 + 0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4547,12 +4647,12 @@ with expansion: 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 + 0.0 not is within 0.98999999999999999 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 + 0.0 not is within 0.98999999999999999 of 1.0 Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 11., !WithinAbs( 10., 0.5 ) ) @@ -4572,7 +4672,7 @@ with expansion: 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 + -10.0 is within 0.5 of -9.59999999999999964 ------------------------------------------------------------------------------- Floating point matchers: double @@ -4590,8 +4690,8 @@ with expansion: 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]) + 1.00000000000000022 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 ) ) @@ -4645,7 +4745,7 @@ with expansion: 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 ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) ------------------------------------------------------------------------------- Floating point matchers: double @@ -4694,22 +4794,22 @@ 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 + 10.0f and 11.10000038146972656 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 + 10.0f not and 11.19999980926513672 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 + 1.0f not and 0.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 + -0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4722,7 +4822,7 @@ 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 + 0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4744,12 +4844,12 @@ with expansion: 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 + 0.0f not is within 0.99000000953674316 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 + 0.0f not is within 0.99000000953674316 of 1.0 Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0.f, WithinAbs( -0.f, 0 ) ) @@ -4774,7 +4874,7 @@ with expansion: 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 + -10.0f is within 0.5 of -9.60000038146972656 ------------------------------------------------------------------------------- Floating point matchers: float @@ -4797,7 +4897,8 @@ with expansion: 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]) + 1.000000119f 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 ) ) @@ -4847,7 +4948,8 @@ with expansion: 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 ) + 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.0 are within 10% of + each other ) ------------------------------------------------------------------------------- Floating point matchers: float @@ -6288,7 +6390,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.9 == Approx( -0.9 ) + -0.90000000000000002 + == + Approx( -0.90000000000000002 ) with message: Current expected value is -0.9 @@ -6302,7 +6406,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.8 == Approx( -0.8 ) + -0.80000000000000004 + == + Approx( -0.80000000000000004 ) with message: Current expected value is -0.8 @@ -6316,7 +6422,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.7 == Approx( -0.7 ) + -0.70000000000000007 + == + Approx( -0.70000000000000007 ) with message: Current expected value is -0.7 @@ -6330,7 +6438,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.6 == Approx( -0.6 ) + -0.60000000000000009 + == + Approx( -0.60000000000000009 ) with message: Current expected value is -0.6 @@ -6344,7 +6454,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.5 == Approx( -0.5 ) + -0.50000000000000011 + == + Approx( -0.50000000000000011 ) with message: Current expected value is -0.5 @@ -6358,7 +6470,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.4 == Approx( -0.4 ) + -0.40000000000000013 + == + Approx( -0.40000000000000013 ) with message: Current expected value is -0.4 @@ -6372,7 +6486,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.3 == Approx( -0.3 ) + -0.30000000000000016 + == + Approx( -0.30000000000000016 ) with message: Current expected value is -0.3 @@ -6386,7 +6502,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.2 == Approx( -0.2 ) + -0.20000000000000015 + == + Approx( -0.20000000000000015 ) with message: Current expected value is -0.2 @@ -6400,7 +6518,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.1 == Approx( -0.1 ) + -0.10000000000000014 + == + Approx( -0.10000000000000014 ) with message: Current expected value is -0.1 @@ -6414,7 +6534,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.0 == Approx( -0.0 ) + -0.00000000000000014 + == + Approx( -0.00000000000000014 ) with message: Current expected value is -1.38778e-16 @@ -6428,7 +6550,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.1 == Approx( 0.1 ) + 0.09999999999999987 + == + Approx( 0.09999999999999987 ) with message: Current expected value is 0.1 @@ -6442,7 +6566,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.2 == Approx( 0.2 ) + 0.19999999999999987 + == + Approx( 0.19999999999999987 ) with message: Current expected value is 0.2 @@ -6456,7 +6582,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.3 == Approx( 0.3 ) + 0.29999999999999988 + == + Approx( 0.29999999999999988 ) with message: Current expected value is 0.3 @@ -6470,7 +6598,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.4 == Approx( 0.4 ) + 0.39999999999999991 + == + Approx( 0.39999999999999991 ) with message: Current expected value is 0.4 @@ -6484,7 +6614,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.5 == Approx( 0.5 ) + 0.49999999999999989 + == + Approx( 0.49999999999999989 ) with message: Current expected value is 0.5 @@ -6498,7 +6630,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.6 == Approx( 0.6 ) + 0.59999999999999987 + == + Approx( 0.59999999999999987 ) with message: Current expected value is 0.6 @@ -6512,7 +6646,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.7 == Approx( 0.7 ) + 0.69999999999999984 + == + Approx( 0.69999999999999984 ) with message: Current expected value is 0.7 @@ -6526,7 +6662,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.8 == Approx( 0.8 ) + 0.79999999999999982 + == + Approx( 0.79999999999999982 ) with message: Current expected value is 0.8 @@ -6540,7 +6678,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.9 == Approx( 0.9 ) + 0.8999999999999998 + == + Approx( 0.8999999999999998 ) with message: Current expected value is 0.9 @@ -6554,7 +6694,7 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx( rangeEnd ) ) with expansion: - 1.0 == Approx( 1.0 ) + 0.99999999999999978 == Approx( 1.0 ) GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( gen.next() ) @@ -6588,7 +6728,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.7 == Approx( -0.7 ) + -0.69999999999999996 + == + Approx( -0.69999999999999996 ) with message: Current expected value is -0.7 @@ -6602,7 +6744,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.4 == Approx( -0.4 ) + -0.39999999999999997 + == + Approx( -0.39999999999999997 ) with message: Current expected value is -0.4 @@ -6616,7 +6760,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.1 == Approx( -0.1 ) + -0.09999999999999998 + == + Approx( -0.09999999999999998 ) with message: Current expected value is -0.1 @@ -6630,7 +6776,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.2 == Approx( 0.2 ) + 0.20000000000000001 + == + Approx( 0.20000000000000001 ) with message: Current expected value is 0.2 @@ -6687,7 +6835,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.7 == Approx( -0.7 ) + -0.69999999999999996 + == + Approx( -0.69999999999999996 ) with message: Current expected value is -0.7 @@ -6701,7 +6851,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.4 == Approx( -0.4 ) + -0.39999999999999997 + == + Approx( -0.39999999999999997 ) with message: Current expected value is -0.4 @@ -6715,7 +6867,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.1 == Approx( -0.1 ) + -0.09999999999999998 + == + Approx( -0.09999999999999998 ) with message: Current expected value is -0.1 @@ -6729,7 +6883,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.2 == Approx( 0.2 ) + 0.20000000000000001 + == + Approx( 0.20000000000000001 ) with message: Current expected value is 0.2 @@ -6928,22 +7084,30 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.22 ) ) with expansion: - 1.23 >= Approx( 1.22 ) + 1.22999999999999998 + >= + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.23 ) ) with expansion: - 1.23 >= Approx( 1.23 ) + 1.22999999999999998 + >= + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( d >= Approx( 1.24 ) ) with expansion: - !(1.23 >= Approx( 1.24 )) + !(1.22999999999999998 + >= + Approx( 1.23999999999999999 )) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.24 ).epsilon(0.1) ) with expansion: - 1.23 >= Approx( 1.24 ) + 1.22999999999999998 + >= + Approx( 1.23999999999999999 ) ------------------------------------------------------------------------------- Hashers with different seed produce different hash with same test case @@ -7224,12 +7388,16 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: - 9.1f != Approx( 9.1000003815 ) + 9.100000381f + != + Approx( 9.10000038146972656 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) with expansion: - 3.1415926535 != Approx( 3.1415926535 ) + 3.14159265350000005 + != + Approx( 3.14159265350000005 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello != "hello" ) @@ -7260,27 +7428,31 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) with expansion: - 9.1f != Approx( 9.1099996567 ) + 9.100000381f + != + Approx( 9.10999965667724609 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) with expansion: - 9.1f != Approx( 9.0 ) + 9.100000381f != Approx( 9.0 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) with expansion: - 9.1f != Approx( 1.0 ) + 9.100000381f != Approx( 1.0 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) with expansion: - 9.1f != Approx( 0.0 ) + 9.100000381f != Approx( 0.0 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) with expansion: - 3.1415926535 != Approx( 3.1415 ) + 3.14159265350000005 + != + Approx( 3.14150000000000018 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello != "goodbye" ) @@ -7607,22 +7779,30 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.24 ) ) with expansion: - 1.23 <= Approx( 1.24 ) + 1.22999999999999998 + <= + Approx( 1.23999999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.23 ) ) with expansion: - 1.23 <= Approx( 1.23 ) + 1.22999999999999998 + <= + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( d <= Approx( 1.22 ) ) with expansion: - !(1.23 <= Approx( 1.22 )) + !(1.22999999999999998 + <= + Approx( 1.21999999999999997 )) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.22 ).epsilon(0.1) ) with expansion: - 1.23 <= Approx( 1.22 ) + 1.22999999999999998 + <= + Approx( 1.21999999999999997 ) ------------------------------------------------------------------------------- ManuallyRegistered @@ -8175,17 +8355,17 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: - 9.1f < 9 + 9.100000381f < 9 Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one > 10 ) with expansion: - 9.1f > 10 + 9.100000381f > 10 Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one > 9.2 ) with expansion: - 9.1f > 9.2 + 9.100000381f > 9.19999999999999929 Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello > "hello" ) @@ -8276,17 +8456,17 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one > 9 ) with expansion: - 9.1f > 9 + 9.100000381f > 9 Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one < 10 ) with expansion: - 9.1f < 10 + 9.100000381f < 10 Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) with expansion: - 9.1f < 9.2 + 9.100000381f < 9.19999999999999929 Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello <= "hello" ) @@ -9642,7 +9822,9 @@ with expansion: CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.benchmarkConfidenceInterval == Catch::Approx(0.99) ) with expansion: - 0.99 == Approx( 0.99 ) + 0.98999999999999999 + == + Approx( 0.98999999999999999 ) ------------------------------------------------------------------------------- Process can be configured on command line @@ -10863,42 +11045,58 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == Approx( 1.23 ) ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: - 1.23 != Approx( 1.22 ) + 1.22999999999999998 + != + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: - 1.23 != Approx( 1.24 ) + 1.22999999999999998 + != + Approx( 1.23999999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.23_a ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.22_a ) with expansion: - 1.23 != Approx( 1.22 ) + 1.22999999999999998 + != + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) + == + 1.22999999999999998 Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: - Approx( 1.23 ) != 1.22 + Approx( 1.22999999999999998 ) + != + 1.21999999999999997 Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) != 1.24 ) with expansion: - Approx( 1.23 ) != 1.24 + Approx( 1.22999999999999998 ) + != + 1.23999999999999999 Message from section one ------------------------------------------------------------------------------- @@ -11675,9 +11873,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible<TestType>::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-copyable and non- @@ -11687,9 +11885,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11699,9 +11897,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable<TestType>::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11711,9 +11909,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 0 @@ -11722,9 +11920,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 1 @@ -11733,9 +11931,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic<TestType>::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 2 @@ -11744,9 +11942,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- TemplateTest: vectors can be sized and resized - float @@ -13801,7 +13999,7 @@ Exception.tests.cpp:<line number> Exception.tests.cpp:<line number>: FAILED: due to unexpected exception with message: - 3.14 + 3.14000000000000012 ------------------------------------------------------------------------------- Upcasting special member functions @@ -14783,6 +14981,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED: with expansion: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 } +------------------------------------------------------------------------------- +Usage of RangeEquals range matcher + Compare against std::initializer_list +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, RangeEquals( { 1, 2, 3 } ) ) +with expansion: + { 1, 2, 3 } elements are { 1, 2, 3 } + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) ) +with expansion: + { 1, 2, 3 } elements are { 2, 4, 6 } + ------------------------------------------------------------------------------- Usage of RangeEquals range matcher Check short-circuiting behaviour @@ -14970,6 +15185,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED: with expansion: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 } +------------------------------------------------------------------------------- +Usage of UnorderedRangeEquals range matcher + Compare against std::initializer_list +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, UnorderedRangeEquals( { 10, 20, 1 } ) ) +with expansion: + { 1, 10, 20 } unordered elements are { 10, 20, 1 } + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) ) +with expansion: + { 1, 10, 20 } unordered elements are { 11, 21, 2 } + ------------------------------------------------------------------------------- Usage of the SizeIs range matcher Some with stdlib containers @@ -15045,42 +15277,54 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.23 ) ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: - 1.23 == Approx( 1.22 ) + 1.22999999999999998 + == + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: - 1.23 == Approx( 1.24 ) + 1.22999999999999998 + == + Approx( 1.23999999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: - 1.23 != Approx( 1.25 ) + 1.22999999999999998 != Approx( 1.25 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) + == + 1.22999999999999998 Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: - Approx( 1.23 ) == 1.22 + Approx( 1.22999999999999998 ) + == + 1.21999999999999997 Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: - Approx( 1.23 ) == 1.24 + Approx( 1.22999999999999998 ) + == + 1.23999999999999999 Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) != 1.25 ) with expansion: - Approx( 1.23 ) != 1.25 + Approx( 1.22999999999999998 ) != 1.25 ------------------------------------------------------------------------------- Variadic macros @@ -16273,17 +16517,23 @@ 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 ) + -0.09203687623843014 + == + Approx( -0.09203687623843015 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( erfc_inv(1.067400) == Approx(-0.05980291115763361) ) with expansion: - -0.0598029112 == Approx( -0.0598029112 ) + -0.05980291115763361 + == + Approx( -0.05980291115763361 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( erfc_inv(0.050000) == Approx(1.38590382434967796) ) with expansion: - 1.3859038243 == Approx( 1.3859038243 ) + 1.38590382434967774 + == + Approx( 1.38590382434967796 ) ------------------------------------------------------------------------------- estimate_clock_resolution @@ -16943,37 +17193,6 @@ Tricky.tests.cpp:<line number>: PASSED: 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 ------------------------------------------------------------------------------- @@ -16983,17 +17202,23 @@ 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 ) + 0.13015979861484195 + == + Approx( 0.13015979861484198 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( normal_quantile(0.533700) == Approx(0.08457408802851875) ) with expansion: - 0.084574088 == Approx( 0.084574088 ) + 0.08457408802851875 + == + Approx( 0.08457408802851875 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( normal_quantile(0.025000) == Approx(-1.95996398454005449) ) with expansion: - -1.9599639845 == Approx( -1.9599639845 ) + -1.95996398454005405 + == + Approx( -1.95996398454005449 ) ------------------------------------------------------------------------------- not allowed @@ -17309,6 +17534,42 @@ StringManip.tests.cpp:<line number>: PASSED: with expansion: "abcdefcg" == "abcdefcg" +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + lengthening +------------------------------------------------------------------------------- +StringManip.tests.cpp:<line number> +............................................................................... + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( Catch::replaceInPlace(letters, "c", "cc") ) +with expansion: + true + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( letters == "abccdefccg" ) +with expansion: + "abccdefccg" == "abccdefccg" + +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + shortening +------------------------------------------------------------------------------- +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 == "--" ) +with expansion: + "--" == "--" + ------------------------------------------------------------------------------- replaceInPlace escape ' @@ -18176,14 +18437,14 @@ ToStringTuple.tests.cpp:<line number> ............................................................................... ToStringTuple.tests.cpp:<line number>: PASSED: - CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) ) + CHECK( "1.5f" == ::Catch::Detail::stringify(float(1.5)) ) with expansion: - "1.2f" == "1.2f" + "1.5f" == "1.5f" ToStringTuple.tests.cpp:<line number>: PASSED: - CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) ) + CHECK( "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) ) with expansion: - "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + "{ 1.5f, 0 }" == "{ 1.5f, 0 }" ------------------------------------------------------------------------------- tuple<int> @@ -18216,11 +18477,11 @@ ToStringTuple.tests.cpp:<line number> ............................................................................... ToStringTuple.tests.cpp:<line number>: PASSED: - CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) ) + CHECK( "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) ) with expansion: - "{ { 42 }, { }, 1.2f }" + "{ { 42 }, { }, 1.5f }" == - "{ { 42 }, { }, 1.2f }" + "{ { 42 }, { }, 1.5f }" ------------------------------------------------------------------------------- uniform samples @@ -18246,7 +18507,7 @@ with expansion: InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( e.confidence_interval == 0.95 ) with expansion: - 0.95 == 0.95 + 0.94999999999999996 == 0.94999999999999996 ------------------------------------------------------------------------------- uniform_integer_distribution can return the bounds @@ -18751,6 +19012,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 417 | 312 passed | 85 failed | 6 skipped | 14 failed as expected -assertions: 2260 | 2079 passed | 146 failed | 35 failed as expected +test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected +assertions: 2269 | 2087 passed | 147 failed | 35 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 index 5d204990c..418ccf7e9 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -2021,6 +2021,54 @@ 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 TEST_CASE_PERSISTENT_FIXTURE based test run that fails + First partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( m_a++ == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEST_CASE_PERSISTENT_FIXTURE based test run that fails + Second partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: FAILED: + REQUIRE( m_a == 0 ) +with expansion: + 1 == 0 + +------------------------------------------------------------------------------- +A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds + First partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + +Class.tests.cpp:<line number>: PASSED: + REQUIRE( m_a++ == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds + Second partial run +------------------------------------------------------------------------------- +Class.tests.cpp:<line number> +............................................................................... + Class.tests.cpp:<line number>: PASSED: REQUIRE( m_a == 1 ) with expansion: @@ -2123,32 +2171,42 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.23_a ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.22_a ) with expansion: - 1.23 != Approx( 1.22 ) + 1.22999999999999998 + != + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( -d == -1.23_a ) with expansion: - -1.23 == Approx( -1.23 ) + -1.22999999999999998 + == + Approx( -1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.2_a .epsilon(.1) ) with expansion: - 1.23 == Approx( 1.2 ) + 1.22999999999999998 + == + Approx( 1.19999999999999996 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.2_a .epsilon(.001) ) with expansion: - 1.23 != Approx( 1.2 ) + 1.22999999999999998 + != + Approx( 1.19999999999999996 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1_a .epsilon(.3) ) with expansion: - 1.23 == Approx( 1.0 ) + 1.22999999999999998 == Approx( 1.0 ) ------------------------------------------------------------------------------- A couple of nested sections followed by a failure @@ -2217,12 +2275,12 @@ with expansion: Approx.tests.cpp:<line number>: PASSED: REQUIRE( 100.3 != Approx(100.0) ) with expansion: - 100.3 != Approx( 100.0 ) + 100.29999999999999716 != 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 ) + 100.29999999999999716 == Approx( 100.0 ) ------------------------------------------------------------------------------- An empty test with no assertions @@ -2340,12 +2398,16 @@ 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 ) + 3.14285714285714279 + == + Approx( 3.14100000000000001 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) with expansion: - 3.1428571429 != Approx( 3.141 ) + 3.14285714285714279 + != + Approx( 3.14100000000000001 ) ------------------------------------------------------------------------------- Approximate comparisons with different epsilons @@ -2356,12 +2418,16 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.231 ) ) with expansion: - 1.23 != Approx( 1.231 ) + 1.22999999999999998 + != + Approx( 1.23100000000000009 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: - 1.23 == Approx( 1.231 ) + 1.22999999999999998 + == + Approx( 1.23100000000000009 ) ------------------------------------------------------------------------------- Approximate comparisons with floats @@ -2372,7 +2438,9 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) with expansion: - 1.23f == Approx( 1.2300000191 ) + 1.230000019f + == + Approx( 1.23000001907348633 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( 0.0f == Approx( 0.0f ) ) @@ -2419,12 +2487,16 @@ with expansion: Approx.tests.cpp:<line number>: PASSED: REQUIRE( 1.234f == Approx( dMedium ) ) with expansion: - 1.234f == Approx( 1.234 ) + 1.233999968f + == + Approx( 1.23399999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: - 1.234 == Approx( 1.2339999676 ) + 1.23399999999999999 + == + Approx( 1.23399996757507324 ) ------------------------------------------------------------------------------- Arbitrary predicate matcher @@ -2902,24 +2974,24 @@ ToStringGeneral.tests.cpp:<line number> ............................................................................... ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( tab == '\t' ) + CHECK( ::Catch::Detail::stringify('\t') == "'\\t'" ) with expansion: - '\t' == '\t' + "'\t'" == "'\t'" ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( newline == '\n' ) + CHECK( ::Catch::Detail::stringify('\n') == "'\\n'" ) with expansion: - '\n' == '\n' + "'\n'" == "'\n'" ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( carr_return == '\r' ) + CHECK( ::Catch::Detail::stringify('\r') == "'\\r'" ) with expansion: - '\r' == '\r' + "'\r'" == "'\r'" ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( form_feed == '\f' ) + CHECK( ::Catch::Detail::stringify('\f') == "'\\f'" ) with expansion: - '\f' == '\f' + "'\f'" == "'\f'" ------------------------------------------------------------------------------- Character pretty printing @@ -2929,29 +3001,19 @@ 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] ) + CHECK( ::Catch::Detail::stringify( ' ' ) == "' '" ) with expansion: - 'a' == 'a' + "' '" == "' '" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'A' ) == "'A'" ) with expansion: - 'z' == 'z' + "'A'" == "'A'" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'z' ) == "'z'" ) with expansion: - 'A' == 'A' - -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) -with expansion: - 'Z' == 'Z' + "'z'" == "'z'" ------------------------------------------------------------------------------- Character pretty printing @@ -2961,29 +3023,55 @@ ToStringGeneral.tests.cpp:<line number> ............................................................................... ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( null_terminator == '\0' ) + CHECK( ::Catch::Detail::stringify( '\0' ) == "0" ) with expansion: - 0 == 0 + "0" == "0" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" ) with expansion: - 2 == 2 + "2" == "2" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" ) with expansion: - 3 == 3 + "5" == "5" -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) +------------------------------------------------------------------------------- +Clara::Arg does not crash on incomplete input +------------------------------------------------------------------------------- +Clara.tests.cpp:<line number> +............................................................................... + +Clara.tests.cpp:<line number>: PASSED: + CHECK( name.empty() ) with expansion: - 4 == 4 + true -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) +Clara.tests.cpp:<line number>: PASSED: + CHECK( result ) with expansion: - 5 == 5 + {?} + +Clara.tests.cpp:<line number>: PASSED: + CHECK( result.type() == Catch::Clara::Detail::ResultType::Ok ) +with expansion: + 0 == 0 + +Clara.tests.cpp:<line number>: PASSED: + CHECK( parsed.type() == Catch::Clara::ParseResultType::NoMatch ) +with expansion: + 1 == 1 + +Clara.tests.cpp:<line number>: PASSED: + CHECK( parsed.remainingTokens().count() == 2 ) +with expansion: + 2 == 2 + +Clara.tests.cpp:<line number>: PASSED: + CHECK( name.empty() ) +with expansion: + true ------------------------------------------------------------------------------- Clara::Arg supports single-arg parse the way Opt does @@ -3924,7 +4012,7 @@ 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 ) + 101.00000099999999748 != Approx( 100.0 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( std::pow(10, -5) != Approx(std::pow(10, -7)) ) @@ -3993,7 +4081,7 @@ with expansion: insensitive) ------------------------------------------------------------------------------- -Enums can quickly have stringification enabled using REGISTER_ENUM +Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ------------------------------------------------------------------------------- EnumToString.tests.cpp:<line number> ............................................................................... @@ -4027,7 +4115,7 @@ with expansion: ------------------------------------------------------------------------------- Enums in namespaces can quickly have stringification enabled using -REGISTER_ENUM +CATCH_REGISTER_ENUM ------------------------------------------------------------------------------- EnumToString.tests.cpp:<line number> ............................................................................... @@ -4051,7 +4139,7 @@ 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 ) + 101.01000000000000512 != Approx( 100.0 ) ------------------------------------------------------------------------------- Equality checks that should fail @@ -4077,27 +4165,31 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 9.100000381f + == + Approx( 9.10999965667724609 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 9.0f ) ) with expansion: - 9.1f == Approx( 9.0 ) + 9.100000381f == Approx( 9.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 1 ) ) with expansion: - 9.1f == Approx( 1.0 ) + 9.100000381f == Approx( 1.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: - 9.1f == Approx( 0.0 ) + 9.100000381f == Approx( 0.0 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: - 3.1415926535 == Approx( 3.1415 ) + 3.14159265350000005 + == + Approx( 3.14150000000000018 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello == "goodbye" ) @@ -4122,7 +4214,9 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: - 1.3 == Approx( 1.301 ) + 1.30000000000000027 + == + Approx( 1.30099999999999993 ) ------------------------------------------------------------------------------- Equality checks that should succeed @@ -4138,12 +4232,16 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: - 9.1f == Approx( 9.1000003815 ) + 9.100000381f + == + Approx( 9.10000038146972656 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: - 3.1415926535 == Approx( 3.1415926535 ) + 3.14159265350000005 + == + Approx( 3.14159265350000005 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello == "hello" ) @@ -4163,7 +4261,9 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( x == Approx( 1.3 ) ) with expansion: - 1.3 == Approx( 1.3 ) + 1.30000000000000027 + == + Approx( 1.30000000000000004 ) ------------------------------------------------------------------------------- Equals @@ -4495,22 +4595,22 @@ 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 + 10.0 and 11.09999999999999964 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 + 10.0 not and 11.19999999999999929 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 + 1.0 not and 0.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 + -0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4523,7 +4623,7 @@ 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 + 0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4545,12 +4645,12 @@ with expansion: 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 + 0.0 not is within 0.98999999999999999 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 + 0.0 not is within 0.98999999999999999 of 1.0 Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 11., !WithinAbs( 10., 0.5 ) ) @@ -4570,7 +4670,7 @@ with expansion: 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 + -10.0 is within 0.5 of -9.59999999999999964 ------------------------------------------------------------------------------- Floating point matchers: double @@ -4588,8 +4688,8 @@ with expansion: 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]) + 1.00000000000000022 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 ) ) @@ -4643,7 +4743,7 @@ with expansion: 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 ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) ------------------------------------------------------------------------------- Floating point matchers: double @@ -4692,22 +4792,22 @@ 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 + 10.0f and 11.10000038146972656 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 + 10.0f not and 11.19999980926513672 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 + 1.0f not and 0.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 + -0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4720,7 +4820,7 @@ 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 + 0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4742,12 +4842,12 @@ with expansion: 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 + 0.0f not is within 0.99000000953674316 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 + 0.0f not is within 0.99000000953674316 of 1.0 Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0.f, WithinAbs( -0.f, 0 ) ) @@ -4772,7 +4872,7 @@ with expansion: 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 + -10.0f is within 0.5 of -9.60000038146972656 ------------------------------------------------------------------------------- Floating point matchers: float @@ -4795,7 +4895,8 @@ with expansion: 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]) + 1.000000119f 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 ) ) @@ -4845,7 +4946,8 @@ with expansion: 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 ) + 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.0 are within 10% of + each other ) ------------------------------------------------------------------------------- Floating point matchers: float @@ -6286,7 +6388,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.9 == Approx( -0.9 ) + -0.90000000000000002 + == + Approx( -0.90000000000000002 ) with message: Current expected value is -0.9 @@ -6300,7 +6404,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.8 == Approx( -0.8 ) + -0.80000000000000004 + == + Approx( -0.80000000000000004 ) with message: Current expected value is -0.8 @@ -6314,7 +6420,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.7 == Approx( -0.7 ) + -0.70000000000000007 + == + Approx( -0.70000000000000007 ) with message: Current expected value is -0.7 @@ -6328,7 +6436,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.6 == Approx( -0.6 ) + -0.60000000000000009 + == + Approx( -0.60000000000000009 ) with message: Current expected value is -0.6 @@ -6342,7 +6452,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.5 == Approx( -0.5 ) + -0.50000000000000011 + == + Approx( -0.50000000000000011 ) with message: Current expected value is -0.5 @@ -6356,7 +6468,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.4 == Approx( -0.4 ) + -0.40000000000000013 + == + Approx( -0.40000000000000013 ) with message: Current expected value is -0.4 @@ -6370,7 +6484,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.3 == Approx( -0.3 ) + -0.30000000000000016 + == + Approx( -0.30000000000000016 ) with message: Current expected value is -0.3 @@ -6384,7 +6500,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.2 == Approx( -0.2 ) + -0.20000000000000015 + == + Approx( -0.20000000000000015 ) with message: Current expected value is -0.2 @@ -6398,7 +6516,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.1 == Approx( -0.1 ) + -0.10000000000000014 + == + Approx( -0.10000000000000014 ) with message: Current expected value is -0.1 @@ -6412,7 +6532,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.0 == Approx( -0.0 ) + -0.00000000000000014 + == + Approx( -0.00000000000000014 ) with message: Current expected value is -1.38778e-16 @@ -6426,7 +6548,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.1 == Approx( 0.1 ) + 0.09999999999999987 + == + Approx( 0.09999999999999987 ) with message: Current expected value is 0.1 @@ -6440,7 +6564,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.2 == Approx( 0.2 ) + 0.19999999999999987 + == + Approx( 0.19999999999999987 ) with message: Current expected value is 0.2 @@ -6454,7 +6580,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.3 == Approx( 0.3 ) + 0.29999999999999988 + == + Approx( 0.29999999999999988 ) with message: Current expected value is 0.3 @@ -6468,7 +6596,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.4 == Approx( 0.4 ) + 0.39999999999999991 + == + Approx( 0.39999999999999991 ) with message: Current expected value is 0.4 @@ -6482,7 +6612,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.5 == Approx( 0.5 ) + 0.49999999999999989 + == + Approx( 0.49999999999999989 ) with message: Current expected value is 0.5 @@ -6496,7 +6628,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.6 == Approx( 0.6 ) + 0.59999999999999987 + == + Approx( 0.59999999999999987 ) with message: Current expected value is 0.6 @@ -6510,7 +6644,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.7 == Approx( 0.7 ) + 0.69999999999999984 + == + Approx( 0.69999999999999984 ) with message: Current expected value is 0.7 @@ -6524,7 +6660,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.8 == Approx( 0.8 ) + 0.79999999999999982 + == + Approx( 0.79999999999999982 ) with message: Current expected value is 0.8 @@ -6538,7 +6676,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.9 == Approx( 0.9 ) + 0.8999999999999998 + == + Approx( 0.8999999999999998 ) with message: Current expected value is 0.9 @@ -6552,7 +6692,7 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx( rangeEnd ) ) with expansion: - 1.0 == Approx( 1.0 ) + 0.99999999999999978 == Approx( 1.0 ) GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( gen.next() ) @@ -6586,7 +6726,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.7 == Approx( -0.7 ) + -0.69999999999999996 + == + Approx( -0.69999999999999996 ) with message: Current expected value is -0.7 @@ -6600,7 +6742,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.4 == Approx( -0.4 ) + -0.39999999999999997 + == + Approx( -0.39999999999999997 ) with message: Current expected value is -0.4 @@ -6614,7 +6758,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.1 == Approx( -0.1 ) + -0.09999999999999998 + == + Approx( -0.09999999999999998 ) with message: Current expected value is -0.1 @@ -6628,7 +6774,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.2 == Approx( 0.2 ) + 0.20000000000000001 + == + Approx( 0.20000000000000001 ) with message: Current expected value is 0.2 @@ -6685,7 +6833,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.7 == Approx( -0.7 ) + -0.69999999999999996 + == + Approx( -0.69999999999999996 ) with message: Current expected value is -0.7 @@ -6699,7 +6849,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.4 == Approx( -0.4 ) + -0.39999999999999997 + == + Approx( -0.39999999999999997 ) with message: Current expected value is -0.4 @@ -6713,7 +6865,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - -0.1 == Approx( -0.1 ) + -0.09999999999999998 + == + Approx( -0.09999999999999998 ) with message: Current expected value is -0.1 @@ -6727,7 +6881,9 @@ with message: GeneratorsImpl.tests.cpp:<line number>: PASSED: REQUIRE( gen.get() == Approx(expected) ) with expansion: - 0.2 == Approx( 0.2 ) + 0.20000000000000001 + == + Approx( 0.20000000000000001 ) with message: Current expected value is 0.2 @@ -6926,22 +7082,30 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.22 ) ) with expansion: - 1.23 >= Approx( 1.22 ) + 1.22999999999999998 + >= + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.23 ) ) with expansion: - 1.23 >= Approx( 1.23 ) + 1.22999999999999998 + >= + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( d >= Approx( 1.24 ) ) with expansion: - !(1.23 >= Approx( 1.24 )) + !(1.22999999999999998 + >= + Approx( 1.23999999999999999 )) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d >= Approx( 1.24 ).epsilon(0.1) ) with expansion: - 1.23 >= Approx( 1.24 ) + 1.22999999999999998 + >= + Approx( 1.23999999999999999 ) ------------------------------------------------------------------------------- Hashers with different seed produce different hash with same test case @@ -7222,12 +7386,16 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: - 9.1f != Approx( 9.1000003815 ) + 9.100000381f + != + Approx( 9.10000038146972656 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.double_pi != Approx( 3.1415926535 ) ) with expansion: - 3.1415926535 != Approx( 3.1415926535 ) + 3.14159265350000005 + != + Approx( 3.14159265350000005 ) Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello != "hello" ) @@ -7258,27 +7426,31 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.11f ) ) with expansion: - 9.1f != Approx( 9.1099996567 ) + 9.100000381f + != + Approx( 9.10999965667724609 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 9.0f ) ) with expansion: - 9.1f != Approx( 9.0 ) + 9.100000381f != Approx( 9.0 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 1 ) ) with expansion: - 9.1f != Approx( 1.0 ) + 9.100000381f != Approx( 1.0 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one != Approx( 0 ) ) with expansion: - 9.1f != Approx( 0.0 ) + 9.100000381f != Approx( 0.0 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.double_pi != Approx( 3.1415 ) ) with expansion: - 3.1415926535 != Approx( 3.1415 ) + 3.14159265350000005 + != + Approx( 3.14150000000000018 ) Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello != "goodbye" ) @@ -7605,22 +7777,30 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.24 ) ) with expansion: - 1.23 <= Approx( 1.24 ) + 1.22999999999999998 + <= + Approx( 1.23999999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.23 ) ) with expansion: - 1.23 <= Approx( 1.23 ) + 1.22999999999999998 + <= + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE_FALSE( d <= Approx( 1.22 ) ) with expansion: - !(1.23 <= Approx( 1.22 )) + !(1.22999999999999998 + <= + Approx( 1.21999999999999997 )) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d <= Approx( 1.22 ).epsilon(0.1) ) with expansion: - 1.23 <= Approx( 1.22 ) + 1.22999999999999998 + <= + Approx( 1.21999999999999997 ) ------------------------------------------------------------------------------- ManuallyRegistered @@ -8173,17 +8353,17 @@ with expansion: Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: - 9.1f < 9 + 9.100000381f < 9 Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one > 10 ) with expansion: - 9.1f > 10 + 9.100000381f > 10 Condition.tests.cpp:<line number>: FAILED: CHECK( data.float_nine_point_one > 9.2 ) with expansion: - 9.1f > 9.2 + 9.100000381f > 9.19999999999999929 Condition.tests.cpp:<line number>: FAILED: CHECK( data.str_hello > "hello" ) @@ -8274,17 +8454,17 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one > 9 ) with expansion: - 9.1f > 9 + 9.100000381f > 9 Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one < 10 ) with expansion: - 9.1f < 10 + 9.100000381f < 10 Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.float_nine_point_one < 9.2 ) with expansion: - 9.1f < 9.2 + 9.100000381f < 9.19999999999999929 Condition.tests.cpp:<line number>: PASSED: REQUIRE( data.str_hello <= "hello" ) @@ -9640,7 +9820,9 @@ with expansion: CmdLine.tests.cpp:<line number>: PASSED: REQUIRE( config.benchmarkConfidenceInterval == Catch::Approx(0.99) ) with expansion: - 0.99 == Approx( 0.99 ) + 0.98999999999999999 + == + Approx( 0.98999999999999999 ) ------------------------------------------------------------------------------- Process can be configured on command line @@ -10858,42 +11040,58 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == Approx( 1.23 ) ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.22 ) ) with expansion: - 1.23 != Approx( 1.22 ) + 1.22999999999999998 + != + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != Approx( 1.24 ) ) with expansion: - 1.23 != Approx( 1.24 ) + 1.22999999999999998 + != + Approx( 1.23999999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == 1.23_a ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != 1.22_a ) with expansion: - 1.23 != Approx( 1.22 ) + 1.22999999999999998 + != + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) == 1.23 ) with expansion: - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) + == + 1.22999999999999998 Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) != 1.22 ) with expansion: - Approx( 1.23 ) != 1.22 + Approx( 1.22999999999999998 ) + != + 1.21999999999999997 Approx.tests.cpp:<line number>: PASSED: REQUIRE( Approx( d ) != 1.24 ) with expansion: - Approx( 1.23 ) != 1.24 + Approx( 1.22999999999999998 ) + != + 1.23999999999999999 ------------------------------------------------------------------------------- Standard output from all sections is reported @@ -11668,9 +11866,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible<TestType>::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-copyable and non- @@ -11680,9 +11878,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11692,9 +11890,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable<TestType>::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11704,9 +11902,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 0 @@ -11715,9 +11913,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 1 @@ -11726,9 +11924,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic<TestType>::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 2 @@ -11737,9 +11935,9 @@ Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic<TestType>::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- TemplateTest: vectors can be sized and resized - float @@ -13794,7 +13992,7 @@ Exception.tests.cpp:<line number> Exception.tests.cpp:<line number>: FAILED: due to unexpected exception with message: - 3.14 + 3.14000000000000012 ------------------------------------------------------------------------------- Upcasting special member functions @@ -14776,6 +14974,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED: with expansion: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 } +------------------------------------------------------------------------------- +Usage of RangeEquals range matcher + Compare against std::initializer_list +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, RangeEquals( { 1, 2, 3 } ) ) +with expansion: + { 1, 2, 3 } elements are { 1, 2, 3 } + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) ) +with expansion: + { 1, 2, 3 } elements are { 2, 4, 6 } + ------------------------------------------------------------------------------- Usage of RangeEquals range matcher Check short-circuiting behaviour @@ -14963,6 +15178,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED: with expansion: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 } +------------------------------------------------------------------------------- +Usage of UnorderedRangeEquals range matcher + Compare against std::initializer_list +------------------------------------------------------------------------------- +MatchersRanges.tests.cpp:<line number> +............................................................................... + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, UnorderedRangeEquals( { 10, 20, 1 } ) ) +with expansion: + { 1, 10, 20 } unordered elements are { 10, 20, 1 } + +MatchersRanges.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) ) +with expansion: + { 1, 10, 20 } unordered elements are { 11, 21, 2 } + ------------------------------------------------------------------------------- Usage of the SizeIs range matcher Some with stdlib containers @@ -15038,42 +15270,54 @@ Approx.tests.cpp:<line number> Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.23 ) ) with expansion: - 1.23 == Approx( 1.23 ) + 1.22999999999999998 + == + Approx( 1.22999999999999998 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.22 ) ) with expansion: - 1.23 == Approx( 1.22 ) + 1.22999999999999998 + == + Approx( 1.21999999999999997 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d == approx( 1.24 ) ) with expansion: - 1.23 == Approx( 1.24 ) + 1.22999999999999998 + == + Approx( 1.23999999999999999 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( d != approx( 1.25 ) ) with expansion: - 1.23 != Approx( 1.25 ) + 1.22999999999999998 != Approx( 1.25 ) Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.23 ) with expansion: - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) + == + 1.22999999999999998 Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.22 ) with expansion: - Approx( 1.23 ) == 1.22 + Approx( 1.22999999999999998 ) + == + 1.21999999999999997 Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) == 1.24 ) with expansion: - Approx( 1.23 ) == 1.24 + Approx( 1.22999999999999998 ) + == + 1.23999999999999999 Approx.tests.cpp:<line number>: PASSED: REQUIRE( approx( d ) != 1.25 ) with expansion: - Approx( 1.23 ) != 1.25 + Approx( 1.22999999999999998 ) != 1.25 ------------------------------------------------------------------------------- Variadic macros @@ -16266,17 +16510,23 @@ 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 ) + -0.09203687623843014 + == + Approx( -0.09203687623843015 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( erfc_inv(1.067400) == Approx(-0.05980291115763361) ) with expansion: - -0.0598029112 == Approx( -0.0598029112 ) + -0.05980291115763361 + == + Approx( -0.05980291115763361 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( erfc_inv(0.050000) == Approx(1.38590382434967796) ) with expansion: - 1.3859038243 == Approx( 1.3859038243 ) + 1.38590382434967774 + == + Approx( 1.38590382434967796 ) ------------------------------------------------------------------------------- estimate_clock_resolution @@ -16932,37 +17182,6 @@ Tricky.tests.cpp:<line number>: PASSED: 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 ------------------------------------------------------------------------------- @@ -16972,17 +17191,23 @@ 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 ) + 0.13015979861484195 + == + Approx( 0.13015979861484198 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( normal_quantile(0.533700) == Approx(0.08457408802851875) ) with expansion: - 0.084574088 == Approx( 0.084574088 ) + 0.08457408802851875 + == + Approx( 0.08457408802851875 ) InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( normal_quantile(0.025000) == Approx(-1.95996398454005449) ) with expansion: - -1.9599639845 == Approx( -1.9599639845 ) + -1.95996398454005405 + == + Approx( -1.95996398454005449 ) ------------------------------------------------------------------------------- not allowed @@ -17298,6 +17523,42 @@ StringManip.tests.cpp:<line number>: PASSED: with expansion: "abcdefcg" == "abcdefcg" +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + lengthening +------------------------------------------------------------------------------- +StringManip.tests.cpp:<line number> +............................................................................... + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( Catch::replaceInPlace(letters, "c", "cc") ) +with expansion: + true + +StringManip.tests.cpp:<line number>: PASSED: + CHECK( letters == "abccdefccg" ) +with expansion: + "abccdefccg" == "abccdefccg" + +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + shortening +------------------------------------------------------------------------------- +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 == "--" ) +with expansion: + "--" == "--" + ------------------------------------------------------------------------------- replaceInPlace escape ' @@ -18165,14 +18426,14 @@ ToStringTuple.tests.cpp:<line number> ............................................................................... ToStringTuple.tests.cpp:<line number>: PASSED: - CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) ) + CHECK( "1.5f" == ::Catch::Detail::stringify(float(1.5)) ) with expansion: - "1.2f" == "1.2f" + "1.5f" == "1.5f" ToStringTuple.tests.cpp:<line number>: PASSED: - CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) ) + CHECK( "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) ) with expansion: - "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + "{ 1.5f, 0 }" == "{ 1.5f, 0 }" ------------------------------------------------------------------------------- tuple<int> @@ -18205,11 +18466,11 @@ ToStringTuple.tests.cpp:<line number> ............................................................................... ToStringTuple.tests.cpp:<line number>: PASSED: - CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) ) + CHECK( "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) ) with expansion: - "{ { 42 }, { }, 1.2f }" + "{ { 42 }, { }, 1.5f }" == - "{ { 42 }, { }, 1.2f }" + "{ { 42 }, { }, 1.5f }" ------------------------------------------------------------------------------- uniform samples @@ -18235,7 +18496,7 @@ with expansion: InternalBenchmark.tests.cpp:<line number>: PASSED: CHECK( e.confidence_interval == 0.95 ) with expansion: - 0.95 == 0.95 + 0.94999999999999996 == 0.94999999999999996 ------------------------------------------------------------------------------- uniform_integer_distribution can return the bounds @@ -18740,6 +19001,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 417 | 312 passed | 85 failed | 6 skipped | 14 failed as expected -assertions: 2260 | 2079 passed | 146 failed | 35 failed as expected +test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected +assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt index 48eccfc3d..c3571f3e5 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="129" skipped="12" tests="2272" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="130" skipped="12" tests="2281" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="random-seed" value="1"/> <property name="filters" value=""*" ~[!nonportable] ~[!benchmark] ~[approvals]"/> @@ -12,6 +12,7 @@ <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" 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"/> @@ -30,10 +31,12 @@ Nor would this </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" 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" 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"/> @@ -56,6 +59,7 @@ failure to init at Generators.tests.cpp:<line number> </error> </testcase> + <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions" 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"> @@ -89,6 +93,7 @@ at 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" 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"/> @@ -147,6 +152,7 @@ at 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" 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"/> @@ -313,6 +319,19 @@ at 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>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/First partial run" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/Second partial run" time="{duration}" status="run"> + <failure message="m_a == 0" type="REQUIRE"> +FAILED: + REQUIRE( m_a == 0 ) +with expansion: + 1 == 0 +at Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/First partial run" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/Second partial run" 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"/> @@ -329,6 +348,7 @@ to infinity and beyond at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="A couple of nested sections followed by a failure/Outer" time="{duration}" status="run"/> <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"> @@ -347,6 +367,7 @@ at 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 empty test with no assertions" 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}"> @@ -364,6 +385,7 @@ at Exception.tests.cpp:<line number> <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" 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"/> @@ -371,30 +393,39 @@ at Exception.tests.cpp:<line number> <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" 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" 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" 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" 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" 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" 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 does not crash on incomplete input" 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" 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" 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"/> @@ -412,8 +443,10 @@ at Exception.tests.cpp:<line number> <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" 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" 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"> @@ -433,6 +466,7 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Copy and then generate a range" time="{duration}" status="run"/> <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"/> @@ -487,8 +521,8 @@ with expansion: at 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="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using CATCH_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"/> @@ -517,35 +551,39 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 9.100000381f + == + Approx( 9.10999965667724609 ) at 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 ) + 9.100000381f == Approx( 9.0 ) at 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 ) + 9.100000381f == Approx( 1.0 ) at 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 ) + 9.100000381f == Approx( 0.0 ) at 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 ) + 3.14159265350000005 + == + Approx( 3.14150000000000018 ) at Condition.tests.cpp:<line number> </failure> <failure message="data.str_hello == "goodbye"" type="CHECK"> @@ -580,7 +618,9 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: - 1.3 == Approx( 1.301 ) + 1.30000000000000027 + == + Approx( 1.30099999999999993 ) at Condition.tests.cpp:<line number> </failure> </testcase> @@ -649,6 +689,7 @@ at Matchers.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Exception matchers that succeed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Exception message can be matched" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Exception messages can be tested for" 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"/> @@ -694,6 +735,7 @@ at Message.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Filter generator throws exception for empty generator" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double" 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"/> @@ -701,6 +743,7 @@ at Message.tests.cpp:<line number> <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: double/IsNaN" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float" 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"/> @@ -709,46 +752,64 @@ at Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate" 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" 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" 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" 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" 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" 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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive auto step" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer" 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" 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"/> @@ -828,14 +889,18 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: - 9.1f != Approx( 9.1000003815 ) + 9.100000381f + != + Approx( 9.10000038146972656 ) at 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 ) + 3.14159265350000005 + != + Approx( 3.14159265350000005 ) at Condition.tests.cpp:<line number> </failure> <failure message="data.str_hello != "hello"" type="CHECK"> @@ -854,6 +919,7 @@ at 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="JsonWriter" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Newly constructed JsonWriter does nothing" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Calling writeObject will create an empty pair of braces" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Calling writeObject with key will create an object to write the value" time="{duration}" status="run"/> @@ -863,6 +929,7 @@ at Condition.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Custom class shall be quoted" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" time="{duration}" status="run"/> @@ -898,6 +965,9 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -905,6 +975,9 @@ FAILED: at Condition.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -912,6 +985,9 @@ FAILED: at Condition.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -919,6 +995,9 @@ FAILED: at Condition.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -1011,21 +1090,21 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: - 9.1f < 9 + 9.100000381f < 9 at 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 + 9.100000381f > 10 at 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 + 9.100000381f > 9.19999999999999929 at Condition.tests.cpp:<line number> </failure> <failure message="data.str_hello > "hello"" type="CHECK"> @@ -1086,6 +1165,7 @@ at 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" 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"> @@ -1103,9 +1183,11 @@ at 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 uints" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Parse uints/proper inputs" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Parse uints/Bad inputs" 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" 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"/> @@ -1113,44 +1195,58 @@ at Message.tests.cpp:<line number> <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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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"/> @@ -1230,14 +1326,27 @@ at Matchers.tests.cpp:<line number> <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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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> @@ -1249,6 +1358,8 @@ 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Standard output from all sections is reported/one" 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 @@ -1272,15 +1383,18 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Static arrays are convertible to string" time="{duration}" status="run"/> <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" 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" 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"/> @@ -1289,13 +1403,16 @@ at Matchers.tests.cpp:<line number> <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" 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" 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" 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"/> @@ -1320,6 +1437,7 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns" time="{duration}" status="run"/> <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"/> @@ -1419,6 +1537,7 @@ at Misc.tests.cpp:<line number> </error> </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" 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"/> @@ -1442,91 +1561,128 @@ at Exception.tests.cpp:<line number> <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="Type conversions of RangeEquals and similar" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types (differ in array N)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types and value types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Custom predicate" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" 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 +3.14000000000000012 at Exception.tests.cpp:<line number> </error> </testcase> + <testcase classname="<exe-name>.global" name="Upcasting special member functions" time="{duration}" status="run"/> <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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage" 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 evaluates 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" 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 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 false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Shortcircuiting" 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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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 RangeEquals range matcher" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Empty container matches empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Empty container does not match non-empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers (with same first elements)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Custom predicate" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Ranges that need ADL begin/end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Compare against std::initializer_list" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Check short-circuiting behaviour" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/Check short-circuits on failure" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/All elements are checked on success" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container matches empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container does not match non-empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Custom predicate" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Ranges that need ADL begin/end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Compare against std::initializer_list" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher" 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" 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" 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" 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" 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: @@ -1545,11 +1701,13 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Vector matchers" time="{duration}" status="run"/> <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" 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: @@ -1681,10 +1839,12 @@ unexpected exception at Exception.tests.cpp:<line number> </error> </testcase> + <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown, but caught, they do not affect the test" 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"/> <testcase classname="<exe-name>.global" name="X/level/1/b" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode" 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"/> @@ -1702,6 +1862,7 @@ at Skip.tests.cpp:<line number> </testcase> <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" 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"/> @@ -1725,6 +1886,7 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="classify_outliers" time="{duration}" status="run"/> <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"/> @@ -1749,6 +1911,8 @@ at Skip.tests.cpp:<line number> <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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c" 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"/> @@ -1795,6 +1959,8 @@ FAILED: at Skip.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="first tag" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="has printf" 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"> @@ -1810,7 +1976,10 @@ previous unscoped info SHOULD not be seen at Message.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="just info" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="just unscoped info" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="long long" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests" 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: @@ -1888,12 +2057,15 @@ at 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="more nested SECTION tests/equal" 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: @@ -1903,10 +2075,15 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="more nested SECTION tests/doesn't equal" time="{duration}" status="run"/> <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" 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="nested sections can be skipped dynamically at runtime/A" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="nested sections can be skipped dynamically at runtime/B2" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="nested sections can be skipped dynamically at runtime/B2/B1" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="nested sections can be skipped dynamically at runtime/B2/B" time="{duration}" status="run"> <skipped type="SKIP"> SKIPPED @@ -1922,7 +2099,6 @@ b1! </testcase> <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"> @@ -1936,6 +2112,7 @@ at Message.tests.cpp:<line number> <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" 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"/> @@ -1958,19 +2135,26 @@ this SHOULD be seen only ONCE at Message.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="random SECTION tests" time="{duration}" status="run"/> <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" 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/no replace in already-replaced string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/no replace in already-replaced string/lengthening" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/no replace in already-replaced string/shortening" 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="second tag" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="sections can be skipped dynamically at runtime" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="sections can be skipped dynamically at runtime/not skipped" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="sections can be skipped dynamically at runtime/skipped" time="{duration}" status="run"> <skipped type="SKIP"> @@ -2026,11 +2210,13 @@ at 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" 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" 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"/> @@ -2076,6 +2262,7 @@ at Exception.tests.cpp:<line number> <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="uniform_integer_distribution can return the bounds" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality" 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"/> @@ -2097,6 +2284,7 @@ at Exception.tests.cpp:<line number> <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" 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> diff --git a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt index d270c88fb..55f5520d5 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuites> - <testsuite name="<exe-name>" errors="17" failures="129" skipped="12" tests="2272" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="130" skipped="12" tests="2281" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="random-seed" value="1"/> <property name="filters" value=""*" ~[!nonportable] ~[!benchmark] ~[approvals]"/> @@ -11,6 +11,7 @@ <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" 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"/> @@ -29,10 +30,12 @@ Nor would this </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" 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" 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"/> @@ -55,6 +58,7 @@ failure to init at Generators.tests.cpp:<line number> </error> </testcase> + <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions" 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"> @@ -88,6 +92,7 @@ at 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" 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"/> @@ -146,6 +151,7 @@ at 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" 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"/> @@ -312,6 +318,19 @@ at 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>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/First partial run" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/Second partial run" time="{duration}" status="run"> + <failure message="m_a == 0" type="REQUIRE"> +FAILED: + REQUIRE( m_a == 0 ) +with expansion: + 1 == 0 +at Class.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/First partial run" time="{duration}" status="run"/> + <testcase classname="<exe-name>.Persistent_Fixture" name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/Second partial run" 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"/> @@ -328,6 +347,7 @@ to infinity and beyond at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="A couple of nested sections followed by a failure/Outer" time="{duration}" status="run"/> <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"> @@ -346,6 +366,7 @@ at 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 empty test with no assertions" 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}"> @@ -363,6 +384,7 @@ at Exception.tests.cpp:<line number> <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" 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"/> @@ -370,30 +392,39 @@ at Exception.tests.cpp:<line number> <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" 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" 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" 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" 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" 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" 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 does not crash on incomplete input" 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" 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" 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"/> @@ -411,8 +442,10 @@ at Exception.tests.cpp:<line number> <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" 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" 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"> @@ -432,6 +465,7 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Copy and then generate a range" time="{duration}" status="run"/> <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"/> @@ -486,8 +520,8 @@ with expansion: at 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="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using CATCH_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"/> @@ -516,35 +550,39 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 9.100000381f + == + Approx( 9.10999965667724609 ) at 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 ) + 9.100000381f == Approx( 9.0 ) at 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 ) + 9.100000381f == Approx( 1.0 ) at 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 ) + 9.100000381f == Approx( 0.0 ) at 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 ) + 3.14159265350000005 + == + Approx( 3.14150000000000018 ) at Condition.tests.cpp:<line number> </failure> <failure message="data.str_hello == "goodbye"" type="CHECK"> @@ -579,7 +617,9 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: - 1.3 == Approx( 1.301 ) + 1.30000000000000027 + == + Approx( 1.30099999999999993 ) at Condition.tests.cpp:<line number> </failure> </testcase> @@ -648,6 +688,7 @@ at Matchers.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Exception matchers that succeed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Exception message can be matched" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Exception messages can be tested for" 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"/> @@ -693,6 +734,7 @@ at Message.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Filter generator throws exception for empty generator" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: double" 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"/> @@ -700,6 +742,7 @@ at Message.tests.cpp:<line number> <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: double/IsNaN" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Floating point matchers: float" 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"/> @@ -708,46 +751,64 @@ at Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate" 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" 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" 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" 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" 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" 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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive auto step" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer" 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" 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"/> @@ -827,14 +888,18 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: - 9.1f != Approx( 9.1000003815 ) + 9.100000381f + != + Approx( 9.10000038146972656 ) at 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 ) + 3.14159265350000005 + != + Approx( 3.14159265350000005 ) at Condition.tests.cpp:<line number> </failure> <failure message="data.str_hello != "hello"" type="CHECK"> @@ -853,6 +918,7 @@ at 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="JsonWriter" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Newly constructed JsonWriter does nothing" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Calling writeObject will create an empty pair of braces" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Calling writeObject with key will create an object to write the value" time="{duration}" status="run"/> @@ -862,6 +928,7 @@ at Condition.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter/Custom class shall be quoted" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" time="{duration}" status="run"/> @@ -897,6 +964,9 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -904,6 +974,9 @@ FAILED: at Condition.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -911,6 +984,9 @@ FAILED: at Condition.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -918,6 +994,9 @@ FAILED: at Condition.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + </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"> @@ -1010,21 +1089,21 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: - 9.1f < 9 + 9.100000381f < 9 at 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 + 9.100000381f > 10 at 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 + 9.100000381f > 9.19999999999999929 at Condition.tests.cpp:<line number> </failure> <failure message="data.str_hello > "hello"" type="CHECK"> @@ -1085,6 +1164,7 @@ at 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" 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"> @@ -1102,9 +1182,11 @@ at 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 uints" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Parse uints/proper inputs" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Parse uints/Bad inputs" 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" 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"/> @@ -1112,44 +1194,58 @@ at Message.tests.cpp:<line number> <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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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"/> @@ -1229,14 +1325,27 @@ at Matchers.tests.cpp:<line number> <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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Scenario: Do that thing with the thing/Given: This stuff exists" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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> @@ -1248,6 +1357,8 @@ 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Standard output from all sections is reported/one" 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 @@ -1271,15 +1382,18 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Static arrays are convertible to string" time="{duration}" status="run"/> <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" 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" 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"/> @@ -1288,13 +1402,16 @@ at Matchers.tests.cpp:<line number> <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" 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" 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" 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"/> @@ -1319,6 +1436,7 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns" time="{duration}" status="run"/> <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"/> @@ -1418,6 +1536,7 @@ at Misc.tests.cpp:<line number> </error> </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" 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"/> @@ -1441,91 +1560,128 @@ at Exception.tests.cpp:<line number> <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="Type conversions of RangeEquals and similar" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types (differ in array N)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types and value types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Custom predicate" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" 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 +3.14000000000000012 at Exception.tests.cpp:<line number> </error> </testcase> + <testcase classname="<exe-name>.global" name="Upcasting special member functions" time="{duration}" status="run"/> <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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Basic usage" 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 evaluates 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" 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 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 false evaluates to false" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AllTrue range matcher/Shortcircuiting" 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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of AnyTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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" 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of NoneTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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 RangeEquals range matcher" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Empty container matches empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Empty container does not match non-empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers (with same first elements)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Custom predicate" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Ranges that need ADL begin/end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Compare against std::initializer_list" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Check short-circuiting behaviour" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/Check short-circuits on failure" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/All elements are checked on success" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container matches empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container does not match non-empty container" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Custom predicate" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Ranges that need ADL begin/end" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of UnorderedRangeEquals range matcher/Compare against std::initializer_list" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Usage of the SizeIs range matcher" 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" 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" 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" 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" 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: @@ -1544,11 +1700,13 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Vector matchers" time="{duration}" status="run"/> <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" 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: @@ -1680,10 +1838,12 @@ unexpected exception at Exception.tests.cpp:<line number> </error> </testcase> + <testcase classname="<exe-name>.global" name="When unchecked exceptions are thrown, but caught, they do not affect the test" 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"/> <testcase classname="<exe-name>.global" name="X/level/1/b" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlEncode" 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"/> @@ -1701,6 +1861,7 @@ at Skip.tests.cpp:<line number> </testcase> <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" 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"/> @@ -1724,6 +1885,7 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="classify_outliers" time="{duration}" status="run"/> <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"/> @@ -1748,6 +1910,8 @@ at Skip.tests.cpp:<line number> <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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c" 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"/> @@ -1794,6 +1958,8 @@ FAILED: at Skip.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="first tag" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="has printf" 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"> @@ -1809,7 +1975,10 @@ previous unscoped info SHOULD not be seen at Message.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="just info" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="just unscoped info" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="long long" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="looped SECTION tests" 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: @@ -1887,12 +2056,15 @@ at 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" 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" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="more nested SECTION tests/equal" 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: @@ -1902,10 +2074,15 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="more nested SECTION tests/doesn't equal" time="{duration}" status="run"/> <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" 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="nested sections can be skipped dynamically at runtime/A" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="nested sections can be skipped dynamically at runtime/B2" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="nested sections can be skipped dynamically at runtime/B2/B1" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="nested sections can be skipped dynamically at runtime/B2/B" time="{duration}" status="run"> <skipped type="SKIP"> SKIPPED @@ -1921,7 +2098,6 @@ b1! </testcase> <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"> @@ -1935,6 +2111,7 @@ at Message.tests.cpp:<line number> <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" 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"/> @@ -1957,19 +2134,26 @@ this SHOULD be seen only ONCE at Message.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="random SECTION tests" time="{duration}" status="run"/> <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" 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/no replace in already-replaced string" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/no replace in already-replaced string/lengthening" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="replaceInPlace/no replace in already-replaced string/shortening" 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="second tag" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="sections can be skipped dynamically at runtime" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="sections can be skipped dynamically at runtime/not skipped" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="sections can be skipped dynamically at runtime/skipped" time="{duration}" status="run"> <skipped type="SKIP"> @@ -2025,11 +2209,13 @@ at 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" 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" 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"/> @@ -2075,6 +2261,7 @@ at Exception.tests.cpp:<line number> <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="uniform_integer_distribution can return the bounds" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="unique_ptr reimplementation: basic functionality" 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"/> @@ -2096,6 +2283,7 @@ at Exception.tests.cpp:<line number> <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" 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> diff --git a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index 36b05e54d..af06793e9 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -13,52 +13,68 @@ at AssertionHandler.tests.cpp:<line number> </testCase> </file> <file path="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp"> + <testCase name="Clara::Arg does not crash on incomplete input" duration="{duration}"/> <testCase name="Clara::Arg supports single-arg parse the way Opt does" duration="{duration}"/> + <testCase name="Clara::Opt supports accept-many lambdas" 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="Parsing sharding-related cli flags" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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}"/> @@ -67,13 +83,16 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="Test with special, characters "in name" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp"> + <testCase name="ColourGuard behaviour" duration="{duration}"/> <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" duration="{duration}"/> <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" duration="{duration}"/> <testCase name="CaseInsensitiveLess is case insensitive/Degenerate cases" duration="{duration}"/> <testCase name="CaseInsensitiveLess is case insensitive/Plain comparisons" duration="{duration}"/> </file> @@ -82,35 +101,49 @@ at AssertionHandler.tests.cpp:<line number> </file> <file path="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp"> <testCase name="Filter generator throws exception for empty generator" duration="{duration}"/> + <testCase name="Generators internals" duration="{duration}"/> <testCase name="Generators internals/Single value" duration="{duration}"/> <testCase name="Generators internals/Preset values" duration="{duration}"/> <testCase name="Generators internals/Generator combinator" duration="{duration}"/> <testCase name="Generators internals/Explicitly typed generator sequence" duration="{duration}"/> + <testCase name="Generators internals/Filter generator" duration="{duration}"/> <testCase name="Generators internals/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" 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" 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" duration="{duration}"/> + <testCase name="Generators internals/Range/Positive auto step" duration="{duration}"/> <testCase name="Generators internals/Range/Positive auto step/Integer" duration="{duration}"/> + <testCase name="Generators internals/Range/Negative auto step" duration="{duration}"/> <testCase name="Generators internals/Range/Negative auto step/Integer" duration="{duration}"/> + <testCase name="Generators internals/Range/Positive manual step" duration="{duration}"/> + <testCase name="Generators internals/Range/Positive manual 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" 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" duration="{duration}"/> + <testCase name="Generators internals/Range/Negative manual step/Integer" 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" duration="{duration}"/> <testCase name="benchmark function call/without chronometer" duration="{duration}"/> <testCase name="benchmark function call/with chronometer" duration="{duration}"/> + <testCase name="classify_outliers" 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}"/> @@ -121,7 +154,6 @@ at AssertionHandler.tests.cpp:<line number> <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}"/> @@ -131,6 +163,7 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="weighted_average_quantile" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp"> + <testCase name="JsonWriter" duration="{duration}"/> <testCase name="JsonWriter/Newly constructed JsonWriter does nothing" duration="{duration}"/> <testCase name="JsonWriter/Calling writeObject will create an empty pair of braces" duration="{duration}"/> <testCase name="JsonWriter/Calling writeObject with key will create an object to write the value" duration="{duration}"/> @@ -140,6 +173,7 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" duration="{duration}"/> <testCase name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" duration="{duration}"/> <testCase name="JsonWriter/Custom class shall be quoted" duration="{duration}"/> + <testCase name="JsonWriter escapes charaters in strings properly" duration="{duration}"/> <testCase name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" duration="{duration}"/> <testCase name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" duration="{duration}"/> <testCase name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" duration="{duration}"/> @@ -151,10 +185,12 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="JsonWriter escapes charaters in strings properly/combination of characters is escaped" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Parse.tests.cpp"> + <testCase name="Parse uints" duration="{duration}"/> <testCase name="Parse uints/proper inputs" duration="{duration}"/> <testCase name="Parse uints/Bad inputs" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp"> + <testCase name="#1938 - GENERATE after a section" duration="{duration}"/> <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}"/> @@ -177,6 +213,7 @@ at AssertionHandler.tests.cpp:<line number> </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" 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}"/> @@ -218,6 +255,7 @@ at AssertionHandler.tests.cpp:<line number> <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" 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}"/> @@ -231,11 +269,13 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="stdout and stderr streams have %-starting name" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/String.tests.cpp"> + <testCase name="StringRef" duration="{duration}"/> <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" 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}"/> @@ -244,29 +284,37 @@ at AssertionHandler.tests.cpp:<line number> <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" 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" 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" 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" 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/no replace in already-replaced string" duration="{duration}"/> + <testCase name="replaceInPlace/no replace in already-replaced string/lengthening" duration="{duration}"/> + <testCase name="replaceInPlace/no replace in already-replaced string/shortening" 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="Tag alias can be registered against tag patterns" 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}"/> @@ -278,6 +326,7 @@ at AssertionHandler.tests.cpp:<line number> <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" 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}"/> @@ -285,6 +334,7 @@ at AssertionHandler.tests.cpp:<line number> </file> <file path="tests/<exe-name>/IntrospectiveTests/TestSpec.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" 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}"/> </file> @@ -298,16 +348,20 @@ at AssertionHandler.tests.cpp:<line number> <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" 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" duration="{duration}"/> <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" 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" 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}"/> @@ -318,6 +372,7 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="unique_ptr reimplementation: basic functionality/free swap" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp"> + <testCase name="XmlEncode" duration="{duration}"/> <testCase name="XmlEncode/normal string" duration="{duration}"/> <testCase name="XmlEncode/empty string" duration="{duration}"/> <testCase name="XmlEncode/string with ampersand" duration="{duration}"/> @@ -347,14 +402,27 @@ at AssertionHandler.tests.cpp:<line number> <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" duration="{duration}"/> <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" 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" duration="{duration}"/> + <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists" duration="{duration}"/> + <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption" duration="{duration}"/> + <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I 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" 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" 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" 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" 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" 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" 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" 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" 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"> @@ -518,6 +586,19 @@ at Class.tests.cpp:<line number> </failure> </testCase> <testCase name="A TEST_CASE_METHOD based test run that succeeds" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/First partial run" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/Second partial run" duration="{duration}"> + <failure message="REQUIRE(m_a == 0)"> +FAILED: + REQUIRE( m_a == 0 ) +with expansion: + 1 == 0 +at Class.tests.cpp:<line number> + </failure> + </testCase> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/First partial run" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/Second partial run" 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}"/> @@ -527,6 +608,7 @@ at Class.tests.cpp:<line number> <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" 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}"/> @@ -620,35 +702,39 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 9.100000381f +== +Approx( 9.10999965667724609 ) at 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 ) + 9.100000381f == Approx( 9.0 ) at 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 ) + 9.100000381f == Approx( 1.0 ) at 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 ) + 9.100000381f == Approx( 0.0 ) at 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 ) + 3.14159265350000005 +== +Approx( 3.14150000000000018 ) at Condition.tests.cpp:<line number> </skipped> <skipped message="CHECK(data.str_hello == "goodbye")"> @@ -683,7 +769,9 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: - 1.3 == Approx( 1.301 ) + 1.30000000000000027 +== +Approx( 1.30099999999999993 ) at Condition.tests.cpp:<line number> </skipped> </testCase> @@ -700,14 +788,18 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: - 9.1f != Approx( 9.1000003815 ) + 9.100000381f +!= +Approx( 9.10000038146972656 ) at 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 ) + 3.14159265350000005 +!= +Approx( 3.14159265350000005 ) at Condition.tests.cpp:<line number> </skipped> <skipped message="CHECK(data.str_hello != "hello")"> @@ -726,24 +818,28 @@ at 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" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/1/A" duration="{duration}"> <skipped message="FAIL()"> FAILED: at Condition.tests.cpp:<line number> </skipped> </testCase> + <testCase name="Mayfail test case with nested sections/2" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/2/A" duration="{duration}"> <skipped message="FAIL()"> FAILED: at Condition.tests.cpp:<line number> </skipped> </testCase> + <testCase name="Mayfail test case with nested sections/1" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/1/B" duration="{duration}"> <skipped message="FAIL()"> FAILED: at Condition.tests.cpp:<line number> </skipped> </testCase> + <testCase name="Mayfail test case with nested sections/2" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/2/B" duration="{duration}"> <skipped message="FAIL()"> FAILED: @@ -811,21 +907,21 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: - 9.1f < 9 + 9.100000381f < 9 at 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 + 9.100000381f > 10 at 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 + 9.100000381f > 9.19999999999999929 at Condition.tests.cpp:<line number> </failure> <failure message="CHECK(data.str_hello > "hello")"> @@ -902,14 +998,15 @@ at Decomposition.tests.cpp:<line number> </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="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" duration="{duration}"/> + <testCase name="Enums in namespaces can quickly have stringification enabled using CATCH_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" duration="{duration}"/> <testCase name="#748 - captures with unexpected exceptions/outside assertions" duration="{duration}"> <skipped message="TEST_CASE()"> FAILED: @@ -959,6 +1056,7 @@ custom std exception at Exception.tests.cpp:<line number> </error> </testCase> + <testCase name="Exception messages can be tested for" duration="{duration}"/> <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}"/> @@ -1007,7 +1105,7 @@ at Exception.tests.cpp:<line number> <testCase name="Unexpected exceptions can be translated" duration="{duration}"> <error message="TEST_CASE()"> FAILED: -3.14 +3.14000000000000012 at Exception.tests.cpp:<line number> </error> </testCase> @@ -1050,6 +1148,7 @@ unexpected exception at Exception.tests.cpp:<line number> </error> </testCase> + <testCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" duration="{duration}"/> <testCase name="thrown std::strings are translated" duration="{duration}"> <error message="TEST_CASE()"> FAILED: @@ -1069,21 +1168,27 @@ at Generators.tests.cpp:<line number> </skipped> </testCase> <testCase name="3x3x3 ints" duration="{duration}"/> + <testCase name="Copy and then generate a range" 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="GENERATE can combine literals and generators" duration="{duration}"/> + <testCase name="Generators -- adapters" duration="{duration}"/> + <testCase name="Generators -- adapters/Filtering by predicate" 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" 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" 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" 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}"/> @@ -1093,6 +1198,7 @@ at Generators.tests.cpp:<line number> <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" 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}"/> @@ -1102,8 +1208,10 @@ at Generators.tests.cpp:<line number> <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" 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" 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}"> @@ -1200,6 +1308,7 @@ at Matchers.tests.cpp:<line number> <testCase name="Exception matchers that succeed" duration="{duration}"/> <testCase name="Exception message can be matched" duration="{duration}"/> <testCase name="Exceptions matchers" duration="{duration}"/> + <testCase name="Floating point matchers: double" 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}"/> @@ -1207,6 +1316,7 @@ at Matchers.tests.cpp:<line number> <testCase name="Floating point matchers: double/Composed" duration="{duration}"/> <testCase name="Floating point matchers: double/Constructor validation" duration="{duration}"/> <testCase name="Floating point matchers: double/IsNaN" duration="{duration}"/> + <testCase name="Floating point matchers: float" 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}"/> @@ -1279,10 +1389,13 @@ at Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="String matchers" duration="{duration}"/> + <testCase name="Vector Approx matcher" 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" 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" 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: @@ -1301,11 +1414,13 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testCase> + <testCase name="Vector matchers" duration="{duration}"/> <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" duration="{duration}"/> <testCase name="Vector matchers that fail/Contains (element)" duration="{duration}"> <failure message="CHECK_THAT(v, VectorContains( -1 ))"> FAILED: @@ -1400,82 +1515,116 @@ at Matchers.tests.cpp:<line number> </testCase> </file> <file path="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp"> + <testCase name="Basic use of the Contains range matcher" duration="{duration}"/> <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" 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="Type conversions of RangeEquals and similar" duration="{duration}"/> + <testCase name="Type conversions of RangeEquals and similar/Container conversions" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types (differ in array N)" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types and value types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" duration="{duration}"/> + <testCase name="Type conversions of RangeEquals and similar/Value type" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" duration="{duration}"/> + <testCase name="Type conversions of RangeEquals and similar/Custom predicate" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/> + <testCase name="Usage of AllMatch range matcher" 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" 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" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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" 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" 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" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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" 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" 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" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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 RangeEquals range matcher" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Basic usage" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Empty container matches empty container" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Empty container does not match non-empty container" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers (with same first elements)" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Custom predicate" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Ranges that need ADL begin/end" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Compare against std::initializer_list" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Check short-circuiting behaviour" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/Check short-circuits on failure" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/All elements are checked on success" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container matches empty container" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container does not match non-empty container" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher/Custom predicate" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Ranges that need ADL begin/end" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher/Compare against std::initializer_list" duration="{duration}"/> + <testCase name="Usage of the SizeIs range matcher" 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}"/> @@ -1574,6 +1723,8 @@ at Message.tests.cpp:<line number> </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" duration="{duration}"/> + <testCase name="Standard output from all sections is reported/one" 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}"> @@ -1590,6 +1741,8 @@ previous unscoped info SHOULD not be seen at Message.tests.cpp:<line number> </failure> </testCase> + <testCase name="just info" duration="{duration}"/> + <testCase name="just unscoped info" duration="{duration}"/> <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)"> @@ -1662,6 +1815,7 @@ with expansion: at Misc.tests.cpp:<line number> </skipped> </testCase> + <testCase name="#961 -- Dynamically created sections should all be reported" duration="{duration}"/> <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}"/> @@ -1682,7 +1836,9 @@ to infinity and beyond at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="A couple of nested sections followed by a failure/Outer" duration="{duration}"/> <testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/> + <testCase name="An empty test with no assertions" duration="{duration}"/> <testCase name="Factorials are computed" duration="{duration}"/> <testCase name="ManuallyRegistered" duration="{duration}"/> <testCase name="Nice descriptive name" duration="{duration}"/> @@ -1811,10 +1967,14 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="even more nested SECTION tests" duration="{duration}"/> + <testCase name="even more nested SECTION tests/c" duration="{duration}"/> <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="first tag" duration="{duration}"/> <testCase name="long long" duration="{duration}"/> + <testCase name="looped SECTION tests" duration="{duration}"/> <testCase name="looped SECTION tests/b is currently: 0" duration="{duration}"> <failure message="CHECK(b > a)"> FAILED: @@ -1891,6 +2051,8 @@ Testing if fib[7] (21) is even at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="more nested SECTION tests" duration="{duration}"/> + <testCase name="more nested SECTION tests/equal" duration="{duration}"/> <testCase name="more nested SECTION tests/equal/doesn't equal" duration="{duration}"> <failure message="REQUIRE(a == b)"> FAILED: @@ -1900,14 +2062,18 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="more nested SECTION tests/doesn't equal" duration="{duration}"/> <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" 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" duration="{duration}"/> <testCase name="random SECTION tests/doesn't equal" duration="{duration}"/> <testCase name="random SECTION tests/not equal" duration="{duration}"/> + <testCase name="second tag" duration="{duration}"/> <testCase name="send a single char to INFO" duration="{duration}"> <failure message="REQUIRE(false)"> FAILED: @@ -1926,6 +2092,7 @@ at Misc.tests.cpp:<line number> <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" 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> @@ -1996,6 +2163,9 @@ FAILED: at Skip.tests.cpp:<line number> </skipped> </testCase> + <testCase name="nested sections can be skipped dynamically at runtime/A" duration="{duration}"/> + <testCase name="nested sections can be skipped dynamically at runtime/B2" duration="{duration}"/> + <testCase name="nested sections can be skipped dynamically at runtime/B2/B1" duration="{duration}"/> <testCase name="nested sections can be skipped dynamically at runtime/B2/B" duration="{duration}"> <skipped message="SKIP()"> SKIPPED @@ -2003,6 +2173,7 @@ at Skip.tests.cpp:<line number> </skipped> </testCase> <testCase name="nested sections can be skipped dynamically at runtime/B" duration="{duration}"/> + <testCase name="sections can be skipped dynamically at runtime" duration="{duration}"/> <testCase name="sections can be skipped dynamically at runtime/not skipped" duration="{duration}"/> <testCase name="sections can be skipped dynamically at runtime/skipped" duration="{duration}"> <skipped message="SKIP()"> @@ -2031,20 +2202,26 @@ at Skip.tests.cpp:<line number> <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" duration="{duration}"/> <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" 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" 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" 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" 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" 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}"/> @@ -2089,6 +2266,7 @@ FAILED: at Tricky.tests.cpp:<line number> </failure> </testCase> + <testCase name="(unimplemented) static bools can be evaluated" duration="{duration}"/> <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}"/> @@ -2124,6 +2302,7 @@ at Tricky.tests.cpp:<line number> <testCase name="X/level/1/a" duration="{duration}"/> <testCase name="X/level/1/b" duration="{duration}"/> <testCase name="boolean member" duration="{duration}"/> + <testCase name="has printf" duration="{duration}"/> <testCase name="non streamable - with conv. op" duration="{duration}"/> <testCase name="non-copyable objects" duration="{duration}"/> <testCase name="null_ptr" duration="{duration}"/> @@ -2132,6 +2311,7 @@ at Tricky.tests.cpp:<line number> <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" duration="{duration}"/> <testCase name="Variadic macros/Section with one argument" duration="{duration}"/> </file> </testExecutions> diff --git a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt index c9d3d205b..2d8d51053 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -12,52 +12,68 @@ at AssertionHandler.tests.cpp:<line number> </testCase> </file> <file path="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp"> + <testCase name="Clara::Arg does not crash on incomplete input" duration="{duration}"/> <testCase name="Clara::Arg supports single-arg parse the way Opt does" duration="{duration}"/> + <testCase name="Clara::Opt supports accept-many lambdas" 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="Parsing sharding-related cli flags" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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}"/> @@ -66,13 +82,16 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="Test with special, characters "in name" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/ColourImpl.tests.cpp"> + <testCase name="ColourGuard behaviour" duration="{duration}"/> <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" duration="{duration}"/> <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" duration="{duration}"/> <testCase name="CaseInsensitiveLess is case insensitive/Degenerate cases" duration="{duration}"/> <testCase name="CaseInsensitiveLess is case insensitive/Plain comparisons" duration="{duration}"/> </file> @@ -81,35 +100,49 @@ at AssertionHandler.tests.cpp:<line number> </file> <file path="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp"> <testCase name="Filter generator throws exception for empty generator" duration="{duration}"/> + <testCase name="Generators internals" duration="{duration}"/> <testCase name="Generators internals/Single value" duration="{duration}"/> <testCase name="Generators internals/Preset values" duration="{duration}"/> <testCase name="Generators internals/Generator combinator" duration="{duration}"/> <testCase name="Generators internals/Explicitly typed generator sequence" duration="{duration}"/> + <testCase name="Generators internals/Filter generator" duration="{duration}"/> <testCase name="Generators internals/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" 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" 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" duration="{duration}"/> + <testCase name="Generators internals/Range/Positive auto step" duration="{duration}"/> <testCase name="Generators internals/Range/Positive auto step/Integer" duration="{duration}"/> + <testCase name="Generators internals/Range/Negative auto step" duration="{duration}"/> <testCase name="Generators internals/Range/Negative auto step/Integer" duration="{duration}"/> + <testCase name="Generators internals/Range/Positive manual step" duration="{duration}"/> + <testCase name="Generators internals/Range/Positive manual 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" 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" duration="{duration}"/> + <testCase name="Generators internals/Range/Negative manual step/Integer" 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" duration="{duration}"/> <testCase name="benchmark function call/without chronometer" duration="{duration}"/> <testCase name="benchmark function call/with chronometer" duration="{duration}"/> + <testCase name="classify_outliers" 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}"/> @@ -120,7 +153,6 @@ at AssertionHandler.tests.cpp:<line number> <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}"/> @@ -130,6 +162,7 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="weighted_average_quantile" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Json.tests.cpp"> + <testCase name="JsonWriter" duration="{duration}"/> <testCase name="JsonWriter/Newly constructed JsonWriter does nothing" duration="{duration}"/> <testCase name="JsonWriter/Calling writeObject will create an empty pair of braces" duration="{duration}"/> <testCase name="JsonWriter/Calling writeObject with key will create an object to write the value" duration="{duration}"/> @@ -139,6 +172,7 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="JsonWriter/Moved from JsonObjectWriter shall not insert superfluous brace" duration="{duration}"/> <testCase name="JsonWriter/Moved from JsonArrayWriter shall not insert superfluous bracket" duration="{duration}"/> <testCase name="JsonWriter/Custom class shall be quoted" duration="{duration}"/> + <testCase name="JsonWriter escapes charaters in strings properly" duration="{duration}"/> <testCase name="JsonWriter escapes charaters in strings properly/Quote in a string is escaped" duration="{duration}"/> <testCase name="JsonWriter escapes charaters in strings properly/Backslash in a string is escaped" duration="{duration}"/> <testCase name="JsonWriter escapes charaters in strings properly/Forward slash in a string is **not** escaped" duration="{duration}"/> @@ -150,10 +184,12 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="JsonWriter escapes charaters in strings properly/combination of characters is escaped" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Parse.tests.cpp"> + <testCase name="Parse uints" duration="{duration}"/> <testCase name="Parse uints/proper inputs" duration="{duration}"/> <testCase name="Parse uints/Bad inputs" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp"> + <testCase name="#1938 - GENERATE after a section" duration="{duration}"/> <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}"/> @@ -176,6 +212,7 @@ at AssertionHandler.tests.cpp:<line number> </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" 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}"/> @@ -217,6 +254,7 @@ at AssertionHandler.tests.cpp:<line number> <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" 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}"/> @@ -230,11 +268,13 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="stdout and stderr streams have %-starting name" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/String.tests.cpp"> + <testCase name="StringRef" duration="{duration}"/> <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" 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}"/> @@ -243,29 +283,37 @@ at AssertionHandler.tests.cpp:<line number> <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" 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" 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" 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" 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/no replace in already-replaced string" duration="{duration}"/> + <testCase name="replaceInPlace/no replace in already-replaced string/lengthening" duration="{duration}"/> + <testCase name="replaceInPlace/no replace in already-replaced string/shortening" 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="Tag alias can be registered against tag patterns" 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}"/> @@ -277,6 +325,7 @@ at AssertionHandler.tests.cpp:<line number> <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" 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}"/> @@ -284,6 +333,7 @@ at AssertionHandler.tests.cpp:<line number> </file> <file path="tests/<exe-name>/IntrospectiveTests/TestSpec.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" 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}"/> </file> @@ -297,16 +347,20 @@ at AssertionHandler.tests.cpp:<line number> <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" 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" duration="{duration}"/> <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" 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" 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}"/> @@ -317,6 +371,7 @@ at AssertionHandler.tests.cpp:<line number> <testCase name="unique_ptr reimplementation: basic functionality/free swap" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp"> + <testCase name="XmlEncode" duration="{duration}"/> <testCase name="XmlEncode/normal string" duration="{duration}"/> <testCase name="XmlEncode/empty string" duration="{duration}"/> <testCase name="XmlEncode/string with ampersand" duration="{duration}"/> @@ -346,14 +401,27 @@ at AssertionHandler.tests.cpp:<line number> <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" duration="{duration}"/> <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" 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" duration="{duration}"/> + <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists" duration="{duration}"/> + <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption" duration="{duration}"/> + <testCase name="Scenario: Do that thing with the thing/Given: This stuff exists/And given: And some assumption/When: I 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" 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" 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" 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" 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" 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" 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" 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" 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"> @@ -517,6 +585,19 @@ at Class.tests.cpp:<line number> </failure> </testCase> <testCase name="A TEST_CASE_METHOD based test run that succeeds" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/First partial run" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails/Second partial run" duration="{duration}"> + <failure message="REQUIRE(m_a == 0)"> +FAILED: + REQUIRE( m_a == 0 ) +with expansion: + 1 == 0 +at Class.tests.cpp:<line number> + </failure> + </testCase> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/First partial run" duration="{duration}"/> + <testCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds/Second partial run" 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}"/> @@ -526,6 +607,7 @@ at Class.tests.cpp:<line number> <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" 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}"/> @@ -619,35 +701,39 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one == Approx( 9.11f ) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 9.100000381f +== +Approx( 9.10999965667724609 ) at 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 ) + 9.100000381f == Approx( 9.0 ) at 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 ) + 9.100000381f == Approx( 1.0 ) at 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 ) + 9.100000381f == Approx( 0.0 ) at 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 ) + 3.14159265350000005 +== +Approx( 3.14150000000000018 ) at Condition.tests.cpp:<line number> </skipped> <skipped message="CHECK(data.str_hello == "goodbye")"> @@ -682,7 +768,9 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( x == Approx( 1.301 ) ) with expansion: - 1.3 == Approx( 1.301 ) + 1.30000000000000027 +== +Approx( 1.30099999999999993 ) at Condition.tests.cpp:<line number> </skipped> </testCase> @@ -699,14 +787,18 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one != Approx( 9.1f ) ) with expansion: - 9.1f != Approx( 9.1000003815 ) + 9.100000381f +!= +Approx( 9.10000038146972656 ) at 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 ) + 3.14159265350000005 +!= +Approx( 3.14159265350000005 ) at Condition.tests.cpp:<line number> </skipped> <skipped message="CHECK(data.str_hello != "hello")"> @@ -725,24 +817,28 @@ at 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" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/1/A" duration="{duration}"> <skipped message="FAIL()"> FAILED: at Condition.tests.cpp:<line number> </skipped> </testCase> + <testCase name="Mayfail test case with nested sections/2" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/2/A" duration="{duration}"> <skipped message="FAIL()"> FAILED: at Condition.tests.cpp:<line number> </skipped> </testCase> + <testCase name="Mayfail test case with nested sections/1" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/1/B" duration="{duration}"> <skipped message="FAIL()"> FAILED: at Condition.tests.cpp:<line number> </skipped> </testCase> + <testCase name="Mayfail test case with nested sections/2" duration="{duration}"/> <testCase name="Mayfail test case with nested sections/2/B" duration="{duration}"> <skipped message="FAIL()"> FAILED: @@ -810,21 +906,21 @@ at Condition.tests.cpp:<line number> FAILED: CHECK( data.float_nine_point_one < 9 ) with expansion: - 9.1f < 9 + 9.100000381f < 9 at 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 + 9.100000381f > 10 at 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 + 9.100000381f > 9.19999999999999929 at Condition.tests.cpp:<line number> </failure> <failure message="CHECK(data.str_hello > "hello")"> @@ -901,14 +997,15 @@ at Decomposition.tests.cpp:<line number> </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="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" duration="{duration}"/> + <testCase name="Enums in namespaces can quickly have stringification enabled using CATCH_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" duration="{duration}"/> <testCase name="#748 - captures with unexpected exceptions/outside assertions" duration="{duration}"> <skipped message="TEST_CASE()"> FAILED: @@ -958,6 +1055,7 @@ custom std exception at Exception.tests.cpp:<line number> </error> </testCase> + <testCase name="Exception messages can be tested for" duration="{duration}"/> <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}"/> @@ -1006,7 +1104,7 @@ at Exception.tests.cpp:<line number> <testCase name="Unexpected exceptions can be translated" duration="{duration}"> <error message="TEST_CASE()"> FAILED: -3.14 +3.14000000000000012 at Exception.tests.cpp:<line number> </error> </testCase> @@ -1049,6 +1147,7 @@ unexpected exception at Exception.tests.cpp:<line number> </error> </testCase> + <testCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" duration="{duration}"/> <testCase name="thrown std::strings are translated" duration="{duration}"> <error message="TEST_CASE()"> FAILED: @@ -1068,21 +1167,27 @@ at Generators.tests.cpp:<line number> </skipped> </testCase> <testCase name="3x3x3 ints" duration="{duration}"/> + <testCase name="Copy and then generate a range" 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="GENERATE can combine literals and generators" duration="{duration}"/> + <testCase name="Generators -- adapters" duration="{duration}"/> + <testCase name="Generators -- adapters/Filtering by predicate" 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" 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" 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" 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}"/> @@ -1092,6 +1197,7 @@ at Generators.tests.cpp:<line number> <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" 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}"/> @@ -1101,8 +1207,10 @@ at Generators.tests.cpp:<line number> <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" 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" 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}"> @@ -1199,6 +1307,7 @@ at Matchers.tests.cpp:<line number> <testCase name="Exception matchers that succeed" duration="{duration}"/> <testCase name="Exception message can be matched" duration="{duration}"/> <testCase name="Exceptions matchers" duration="{duration}"/> + <testCase name="Floating point matchers: double" 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}"/> @@ -1206,6 +1315,7 @@ at Matchers.tests.cpp:<line number> <testCase name="Floating point matchers: double/Composed" duration="{duration}"/> <testCase name="Floating point matchers: double/Constructor validation" duration="{duration}"/> <testCase name="Floating point matchers: double/IsNaN" duration="{duration}"/> + <testCase name="Floating point matchers: float" 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}"/> @@ -1278,10 +1388,13 @@ at Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="String matchers" duration="{duration}"/> + <testCase name="Vector Approx matcher" 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" 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" 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: @@ -1300,11 +1413,13 @@ with expansion: at Matchers.tests.cpp:<line number> </failure> </testCase> + <testCase name="Vector matchers" duration="{duration}"/> <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" duration="{duration}"/> <testCase name="Vector matchers that fail/Contains (element)" duration="{duration}"> <failure message="CHECK_THAT(v, VectorContains( -1 ))"> FAILED: @@ -1399,82 +1514,116 @@ at Matchers.tests.cpp:<line number> </testCase> </file> <file path="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp"> + <testCase name="Basic use of the Contains range matcher" duration="{duration}"/> <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" 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="Type conversions of RangeEquals and similar" duration="{duration}"/> + <testCase name="Type conversions of RangeEquals and similar/Container conversions" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types (differ in array N)" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers of different container types and value types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" duration="{duration}"/> + <testCase name="Type conversions of RangeEquals and similar/Value type" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" duration="{duration}"/> + <testCase name="Type conversions of RangeEquals and similar/Custom predicate" duration="{duration}"/> <testCase name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/> + <testCase name="Usage of AllMatch range matcher" 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" 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" duration="{duration}"/> + <testCase name="Usage of AllTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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" 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" 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" duration="{duration}"/> + <testCase name="Usage of AnyTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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" 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" 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" duration="{duration}"/> + <testCase name="Usage of NoneTrue range matcher/Basic usage" 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 evaluates 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" 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 evaluates 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" 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 RangeEquals range matcher" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Basic usage" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Empty container matches empty container" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Empty container does not match non-empty container" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers (with same first elements)" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Custom predicate" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Ranges that need ADL begin/end" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Compare against std::initializer_list" duration="{duration}"/> + <testCase name="Usage of RangeEquals range matcher/Check short-circuiting behaviour" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/Check short-circuits on failure" duration="{duration}"/> <testCase name="Usage of RangeEquals range matcher/Check short-circuiting behaviour/All elements are checked on success" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container matches empty container" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Empty container does not match non-empty container" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal 1-length non-empty containers" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two equal-sized, non-equal, non-empty containers" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Basic usage/Two non-equal-sized, non-empty containers" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher/Custom predicate" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Custom predicate/Two non-equal non-empty containers (close enough)" duration="{duration}"/> <testCase name="Usage of UnorderedRangeEquals range matcher/Ranges that need ADL begin/end" duration="{duration}"/> + <testCase name="Usage of UnorderedRangeEquals range matcher/Compare against std::initializer_list" duration="{duration}"/> + <testCase name="Usage of the SizeIs range matcher" 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}"/> @@ -1573,6 +1722,8 @@ at Message.tests.cpp:<line number> </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" duration="{duration}"/> + <testCase name="Standard output from all sections is reported/one" 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}"> @@ -1589,6 +1740,8 @@ previous unscoped info SHOULD not be seen at Message.tests.cpp:<line number> </failure> </testCase> + <testCase name="just info" duration="{duration}"/> + <testCase name="just unscoped info" duration="{duration}"/> <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)"> @@ -1661,6 +1814,7 @@ with expansion: at Misc.tests.cpp:<line number> </skipped> </testCase> + <testCase name="#961 -- Dynamically created sections should all be reported" duration="{duration}"/> <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}"/> @@ -1681,7 +1835,9 @@ to infinity and beyond at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="A couple of nested sections followed by a failure/Outer" duration="{duration}"/> <testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/> + <testCase name="An empty test with no assertions" duration="{duration}"/> <testCase name="Factorials are computed" duration="{duration}"/> <testCase name="ManuallyRegistered" duration="{duration}"/> <testCase name="Nice descriptive name" duration="{duration}"/> @@ -1810,10 +1966,14 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="even more nested SECTION tests" duration="{duration}"/> + <testCase name="even more nested SECTION tests/c" duration="{duration}"/> <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="first tag" duration="{duration}"/> <testCase name="long long" duration="{duration}"/> + <testCase name="looped SECTION tests" duration="{duration}"/> <testCase name="looped SECTION tests/b is currently: 0" duration="{duration}"> <failure message="CHECK(b > a)"> FAILED: @@ -1890,6 +2050,8 @@ Testing if fib[7] (21) is even at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="more nested SECTION tests" duration="{duration}"/> + <testCase name="more nested SECTION tests/equal" duration="{duration}"/> <testCase name="more nested SECTION tests/equal/doesn't equal" duration="{duration}"> <failure message="REQUIRE(a == b)"> FAILED: @@ -1899,14 +2061,18 @@ with expansion: at Misc.tests.cpp:<line number> </failure> </testCase> + <testCase name="more nested SECTION tests/doesn't equal" duration="{duration}"/> <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" 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" duration="{duration}"/> <testCase name="random SECTION tests/doesn't equal" duration="{duration}"/> <testCase name="random SECTION tests/not equal" duration="{duration}"/> + <testCase name="second tag" duration="{duration}"/> <testCase name="send a single char to INFO" duration="{duration}"> <failure message="REQUIRE(false)"> FAILED: @@ -1925,6 +2091,7 @@ at Misc.tests.cpp:<line number> <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" 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> @@ -1995,6 +2162,9 @@ FAILED: at Skip.tests.cpp:<line number> </skipped> </testCase> + <testCase name="nested sections can be skipped dynamically at runtime/A" duration="{duration}"/> + <testCase name="nested sections can be skipped dynamically at runtime/B2" duration="{duration}"/> + <testCase name="nested sections can be skipped dynamically at runtime/B2/B1" duration="{duration}"/> <testCase name="nested sections can be skipped dynamically at runtime/B2/B" duration="{duration}"> <skipped message="SKIP()"> SKIPPED @@ -2002,6 +2172,7 @@ at Skip.tests.cpp:<line number> </skipped> </testCase> <testCase name="nested sections can be skipped dynamically at runtime/B" duration="{duration}"/> + <testCase name="sections can be skipped dynamically at runtime" duration="{duration}"/> <testCase name="sections can be skipped dynamically at runtime/not skipped" duration="{duration}"/> <testCase name="sections can be skipped dynamically at runtime/skipped" duration="{duration}"> <skipped message="SKIP()"> @@ -2030,20 +2201,26 @@ at Skip.tests.cpp:<line number> <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" duration="{duration}"/> <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" 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" 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" 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" 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" 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}"/> @@ -2088,6 +2265,7 @@ FAILED: at Tricky.tests.cpp:<line number> </failure> </testCase> + <testCase name="(unimplemented) static bools can be evaluated" duration="{duration}"/> <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}"/> @@ -2123,6 +2301,7 @@ at Tricky.tests.cpp:<line number> <testCase name="X/level/1/a" duration="{duration}"/> <testCase name="X/level/1/b" duration="{duration}"/> <testCase name="boolean member" duration="{duration}"/> + <testCase name="has printf" duration="{duration}"/> <testCase name="non streamable - with conv. op" duration="{duration}"/> <testCase name="non-copyable objects" duration="{duration}"/> <testCase name="null_ptr" duration="{duration}"/> @@ -2131,6 +2310,7 @@ at Tricky.tests.cpp:<line number> <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" 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 a02dbd954..801946d39 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -478,6 +478,14 @@ ok {test-number} - Nttp_Fixture<V>::value > 0 for: 6 > 0 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 TEST_CASE_PERSISTENT_FIXTURE based test run that fails +ok {test-number} - m_a++ == 0 for: 0 == 0 +# A TEST_CASE_PERSISTENT_FIXTURE based test run that fails +not ok {test-number} - m_a == 0 for: 1 == 0 +# A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds +ok {test-number} - m_a++ == 0 for: 0 == 0 +# A TEST_CASE_PERSISTENT_FIXTURE 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> @@ -495,17 +503,17 @@ 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 ) +ok {test-number} - d == 1.23_a for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # A comparison that uses literals instead of the normal constructor -ok {test-number} - d != 1.22_a for: 1.23 != Approx( 1.22 ) +ok {test-number} - d != 1.22_a for: 1.22999999999999998 != Approx( 1.21999999999999997 ) # A comparison that uses literals instead of the normal constructor -ok {test-number} - -d == -1.23_a for: -1.23 == Approx( -1.23 ) +ok {test-number} - -d == -1.23_a for: -1.22999999999999998 == Approx( -1.22999999999999998 ) # 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 ) +ok {test-number} - d == 1.2_a .epsilon(.1) for: 1.22999999999999998 == Approx( 1.19999999999999996 ) # 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 ) +ok {test-number} - d != 1.2_a .epsilon(.001) for: 1.22999999999999998 != Approx( 1.19999999999999996 ) # A comparison that uses literals instead of the normal constructor -ok {test-number} - d == 1_a .epsilon(.3) for: 1.23 == Approx( 1.0 ) +ok {test-number} - d == 1_a .epsilon(.3) for: 1.22999999999999998 == 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 @@ -523,9 +531,9 @@ 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 ) +ok {test-number} - 100.3 != Approx(100.0) for: 100.29999999999999716 != Approx( 100.0 ) # Absolute margin -ok {test-number} - 100.3 == Approx(100.0).margin(0.5) for: 100.3 == Approx( 100.0 ) +ok {test-number} - 100.3 == Approx(100.0).margin(0.5) for: 100.29999999999999716 == 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 @@ -561,15 +569,15 @@ ok {test-number} - 245.0f == Approx(245.25f).margin(0.25f) for: 245.0f == Approx # 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 ) +ok {test-number} - divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) for: 3.14285714285714279 == Approx( 3.14100000000000001 ) # Approximate PI -ok {test-number} - divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.1428571429 != Approx( 3.141 ) +ok {test-number} - divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.14285714285714279 != Approx( 3.14100000000000001 ) # Approximate comparisons with different epsilons -ok {test-number} - d != Approx( 1.231 ) for: 1.23 != Approx( 1.231 ) +ok {test-number} - d != Approx( 1.231 ) for: 1.22999999999999998 != Approx( 1.23100000000000009 ) # Approximate comparisons with different epsilons -ok {test-number} - d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.23 == Approx( 1.231 ) +ok {test-number} - d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.22999999999999998 == Approx( 1.23100000000000009 ) # Approximate comparisons with floats -ok {test-number} - 1.23f == Approx( 1.23f ) for: 1.23f == Approx( 1.2300000191 ) +ok {test-number} - 1.23f == Approx( 1.23f ) for: 1.230000019f == Approx( 1.23000001907348633 ) # Approximate comparisons with floats ok {test-number} - 0.0f == Approx( 0.0f ) for: 0.0f == Approx( 0.0 ) # Approximate comparisons with ints @@ -583,9 +591,9 @@ 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 ) +ok {test-number} - 1.234f == Approx( dMedium ) for: 1.233999968f == Approx( 1.23399999999999999 ) # Approximate comparisons with mixed numeric types -ok {test-number} - dMedium == Approx( 1.234f ) for: 1.234 == Approx( 1.2339999676 ) +ok {test-number} - dMedium == Approx( 1.234f ) for: 1.23399999999999999 == Approx( 1.23399996757507324 ) # Arbitrary predicate matcher ok {test-number} - 1, Predicate<int>( alwaysTrue, "always true" ) for: 1 matches predicate: "always true" # Arbitrary predicate matcher @@ -697,33 +705,37 @@ 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: ' ' == ' ' +ok {test-number} - ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'a' == 'a' +ok {test-number} - ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'z' == 'z' +ok {test-number} - ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'A' == 'A' +ok {test-number} - ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'Z' == 'Z' +ok {test-number} - ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" # Character pretty printing -ok {test-number} - null_terminator == '\0' for: 0 == 0 +ok {test-number} - ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" # Character pretty printing -ok {test-number} - c == i for: 2 == 2 +ok {test-number} - ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" # Character pretty printing -ok {test-number} - c == i for: 3 == 3 +ok {test-number} - ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" # Character pretty printing -ok {test-number} - c == i for: 4 == 4 +ok {test-number} - ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" for: "2" == "2" # Character pretty printing -ok {test-number} - c == i for: 5 == 5 +ok {test-number} - ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" for: "5" == "5" +# Clara::Arg does not crash on incomplete input +ok {test-number} - name.empty() for: true +# Clara::Arg does not crash on incomplete input +ok {test-number} - result for: {?} +# Clara::Arg does not crash on incomplete input +ok {test-number} - result.type() == Catch::Clara::Detail::ResultType::Ok for: 0 == 0 +# Clara::Arg does not crash on incomplete input +ok {test-number} - parsed.type() == Catch::Clara::ParseResultType::NoMatch for: 1 == 1 +# Clara::Arg does not crash on incomplete input +ok {test-number} - parsed.remainingTokens().count() == 2 for: 2 == 2 +# Clara::Arg does not crash on incomplete input +ok {test-number} - name.empty() for: true # 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 @@ -975,7 +987,7 @@ not ok {test-number} - unexpected exception with message: 'custom exception - no # 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 ) +ok {test-number} - 101.000001 != Approx(100).epsilon(0.01) for: 101.00000099999999748 != 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 @@ -992,22 +1004,22 @@ ok {test-number} - Catch::makeStream( "" )->isConsole() for: true 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 +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1" -# Enums can quickly have stringification enabled using REGISTER_ENUM +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( EnumClass3::Value2 ) == "Value2" for: "Value2" == "Value2" -# Enums can quickly have stringification enabled using REGISTER_ENUM +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( EnumClass3::Value3 ) == "Value3" for: "Value3" == "Value3" -# Enums can quickly have stringification enabled using REGISTER_ENUM +# Enums can quickly have stringification enabled using CATCH_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 +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( ec3 ) == "Value2" for: "Value2" == "Value2" -# Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM +# Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( Bikeshed::Colours::Red ) == "Red" for: "Red" == "Red" -# Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM +# Enums in namespaces can quickly have stringification enabled using CATCH_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 ) +ok {test-number} - 101.01 != Approx(100).epsilon(0.01) for: 101.01000000000000512 != Approx( 100.0 ) # Equality checks that should fail not ok {test-number} - data.int_seven == 6 for: 7 == 6 # Equality checks that should fail @@ -1015,15 +1027,15 @@ 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 ) +not ok {test-number} - data.float_nine_point_one == Approx( 9.11f ) for: 9.100000381f == Approx( 9.10999965667724609 ) # Equality checks that should fail -not ok {test-number} - data.float_nine_point_one == Approx( 9.0f ) for: 9.1f == Approx( 9.0 ) +not ok {test-number} - data.float_nine_point_one == Approx( 9.0f ) for: 9.100000381f == 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 ) +not ok {test-number} - data.float_nine_point_one == Approx( 1 ) for: 9.100000381f == 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 ) +not ok {test-number} - data.float_nine_point_one == Approx( 0 ) for: 9.100000381f == Approx( 0.0 ) # Equality checks that should fail -not ok {test-number} - data.double_pi == Approx( 3.1415 ) for: 3.1415926535 == Approx( 3.1415 ) +not ok {test-number} - data.double_pi == Approx( 3.1415 ) for: 3.14159265350000005 == Approx( 3.14150000000000018 ) # Equality checks that should fail not ok {test-number} - data.str_hello == "goodbye" for: "hello" == "goodbye" # Equality checks that should fail @@ -1033,13 +1045,13 @@ 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 ) +not ok {test-number} - x == Approx( 1.301 ) for: 1.30000000000000027 == Approx( 1.30099999999999993 ) # 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 ) +ok {test-number} - data.float_nine_point_one == Approx( 9.1f ) for: 9.100000381f == Approx( 9.10000038146972656 ) # Equality checks that should succeed -ok {test-number} - data.double_pi == Approx( 3.1415926535 ) for: 3.1415926535 == Approx( 3.1415926535 ) +ok {test-number} - data.double_pi == Approx( 3.1415926535 ) for: 3.14159265350000005 == Approx( 3.14159265350000005 ) # Equality checks that should succeed ok {test-number} - data.str_hello == "hello" for: "hello" == "hello" # Equality checks that should succeed @@ -1047,7 +1059,7 @@ 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 ) +ok {test-number} - x == Approx( 1.3 ) for: 1.30000000000000027 == Approx( 1.30000000000000004 ) # 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 @@ -1133,23 +1145,23 @@ ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 362 # Filter generator throws exception for empty generator ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException # 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 +ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 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 +ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 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 +ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.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 +ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0.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 +ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 0.0 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 +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 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 +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 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 @@ -1157,11 +1169,11 @@ ok {test-number} - 10., !WithinAbs( 11., 0.5 ) for: 10.0 not is within 0.5 of 11 # 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 +ok {test-number} - -10., WithinAbs( -9.6, 0.5 ) for: -10.0 is within 0.5 of -9.59999999999999964 # 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]) +ok {test-number} - nextafter( 1., 2. ), WithinULP( 1., 1 ) for: 1.00000000000000022 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 @@ -1177,7 +1189,7 @@ ok {test-number} - 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is # 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 ) +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.0 are within 10% of each other ) # Floating point matchers: double ok {test-number} - WithinAbs( 1., 0. ) # Floating point matchers: double @@ -1193,23 +1205,23 @@ ok {test-number} - WithinRel( 1., 1. ), std::domain_error # Floating point matchers: double ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN # 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 +ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.10000038146972656 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 +ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.19999980926513672 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 +ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.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 +ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0.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 +ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 0.0 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 +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 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 +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 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 @@ -1219,13 +1231,13 @@ ok {test-number} - 10.f, !WithinAbs( 11.f, 0.5f ) for: 10.0f not is within 0.5 o # 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 +ok {test-number} - -10.f, WithinAbs( -9.6f, 0.5f ) for: -10.0f is within 0.5 of -9.60000038146972656 # 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]) +ok {test-number} - nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) for: 1.000000119f 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 @@ -1241,7 +1253,7 @@ ok {test-number} - 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( # 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 ) +ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.0 are within 10% of each other ) # Floating point matchers: float ok {test-number} - WithinAbs( 1.f, 0.f ) # Floating point matchers: float @@ -1601,83 +1613,83 @@ ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) wit # 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.90000000000000002 == Approx( -0.90000000000000002 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.80000000000000004 == Approx( -0.80000000000000004 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.70000000000000007 == Approx( -0.70000000000000007 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.60000000000000009 == Approx( -0.60000000000000009 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.50000000000000011 == Approx( -0.50000000000000011 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.40000000000000013 == Approx( -0.40000000000000013 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.30000000000000016 == Approx( -0.30000000000000016 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.20000000000000015 == Approx( -0.20000000000000015 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.10000000000000014 == Approx( -0.10000000000000014 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.00000000000000014 == Approx( -0.00000000000000014 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.09999999999999987 == Approx( 0.09999999999999987 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.19999999999999987 == Approx( 0.19999999999999987 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.29999999999999988 == Approx( 0.29999999999999988 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.39999999999999991 == Approx( 0.39999999999999991 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.49999999999999989 == Approx( 0.49999999999999989 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.59999999999999987 == Approx( 0.59999999999999987 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.69999999999999984 == Approx( 0.69999999999999984 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.79999999999999982 == Approx( 0.79999999999999982 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.8999999999999998 == Approx( 0.8999999999999998 ) 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 ) +ok {test-number} - gen.get() == Approx( rangeEnd ) for: 0.99999999999999978 == Approx( 1.0 ) # Generators internals ok {test-number} - !(gen.next()) for: !false # Generators internals @@ -1685,19 +1697,19 @@ ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) wit # 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.69999999999999996 == Approx( -0.69999999999999996 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.39999999999999997 == Approx( -0.39999999999999997 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.09999999999999998 == Approx( -0.09999999999999998 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.20000000000000001 == Approx( 0.20000000000000001 ) 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 @@ -1711,19 +1723,19 @@ ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) wit # 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.69999999999999996 == Approx( -0.69999999999999996 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.39999999999999997 == Approx( -0.39999999999999997 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.09999999999999998 == Approx( -0.09999999999999998 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.20000000000000001 == Approx( 0.20000000000000001 ) 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 @@ -1785,13 +1797,13 @@ 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 ) +ok {test-number} - d >= Approx( 1.22 ) for: 1.22999999999999998 >= Approx( 1.21999999999999997 ) # Greater-than inequalities with different epsilons -ok {test-number} - d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) +ok {test-number} - d >= Approx( 1.23 ) for: 1.22999999999999998 >= Approx( 1.22999999999999998 ) # Greater-than inequalities with different epsilons -ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) +ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.22999999999999998 >= Approx( 1.23999999999999999 )) # Greater-than inequalities with different epsilons -ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.22999999999999998 >= Approx( 1.23999999999999999 ) # 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 @@ -1845,9 +1857,9 @@ not ok {test-number} - unexpected exception with message: 'Exception translation # 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 ) +not ok {test-number} - data.float_nine_point_one != Approx( 9.1f ) for: 9.100000381f != Approx( 9.10000038146972656 ) # Inequality checks that should fail -not ok {test-number} - data.double_pi != Approx( 3.1415926535 ) for: 3.1415926535 != Approx( 3.1415926535 ) +not ok {test-number} - data.double_pi != Approx( 3.1415926535 ) for: 3.14159265350000005 != Approx( 3.14159265350000005 ) # Inequality checks that should fail not ok {test-number} - data.str_hello != "hello" for: "hello" != "hello" # Inequality checks that should fail @@ -1857,15 +1869,15 @@ 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 ) +ok {test-number} - data.float_nine_point_one != Approx( 9.11f ) for: 9.100000381f != Approx( 9.10999965667724609 ) # Inequality checks that should succeed -ok {test-number} - data.float_nine_point_one != Approx( 9.0f ) for: 9.1f != Approx( 9.0 ) +ok {test-number} - data.float_nine_point_one != Approx( 9.0f ) for: 9.100000381f != Approx( 9.0 ) # Inequality checks that should succeed -ok {test-number} - data.float_nine_point_one != Approx( 1 ) for: 9.1f != Approx( 1.0 ) +ok {test-number} - data.float_nine_point_one != Approx( 1 ) for: 9.100000381f != Approx( 1.0 ) # Inequality checks that should succeed -ok {test-number} - data.float_nine_point_one != Approx( 0 ) for: 9.1f != Approx( 0.0 ) +ok {test-number} - data.float_nine_point_one != Approx( 0 ) for: 9.100000381f != Approx( 0.0 ) # Inequality checks that should succeed -ok {test-number} - data.double_pi != Approx( 3.1415 ) for: 3.1415926535 != Approx( 3.1415 ) +ok {test-number} - data.double_pi != Approx( 3.1415 ) for: 3.14159265350000005 != Approx( 3.14150000000000018 ) # Inequality checks that should succeed ok {test-number} - data.str_hello != "goodbye" for: "hello" != "goodbye" # Inequality checks that should succeed @@ -1913,13 +1925,13 @@ ok {test-number} - sstream.str() == "\"\\\\/\\t\\r\\n\"" for: ""\\/\t\r\n"" == " # 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 ) +ok {test-number} - d <= Approx( 1.24 ) for: 1.22999999999999998 <= Approx( 1.23999999999999999 ) # Less-than inequalities with different epsilons -ok {test-number} - d <= Approx( 1.23 ) for: 1.23 <= Approx( 1.23 ) +ok {test-number} - d <= Approx( 1.23 ) for: 1.22999999999999998 <= Approx( 1.22999999999999998 ) # Less-than inequalities with different epsilons -ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.23 <= Approx( 1.22 )) +ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.22999999999999998 <= Approx( 1.21999999999999997 )) # Less-than inequalities with different epsilons -ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) +ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 <= Approx( 1.21999999999999997 ) # ManuallyRegistered ok {test-number} - with 1 message: 'was called' # Matchers can be (AllOf) composed with the && operator @@ -2049,11 +2061,11 @@ 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 +not ok {test-number} - data.float_nine_point_one < 9 for: 9.100000381f < 9 # Ordering comparison checks that should fail -not ok {test-number} - data.float_nine_point_one > 10 for: 9.1f > 10 +not ok {test-number} - data.float_nine_point_one > 10 for: 9.100000381f > 10 # Ordering comparison checks that should fail -not ok {test-number} - data.float_nine_point_one > 9.2 for: 9.1f > 9.2 +not ok {test-number} - data.float_nine_point_one > 9.2 for: 9.100000381f > 9.19999999999999929 # Ordering comparison checks that should fail not ok {test-number} - data.str_hello > "hello" for: "hello" > "hello" # Ordering comparison checks that should fail @@ -2087,11 +2099,11 @@ 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 +ok {test-number} - data.float_nine_point_one > 9 for: 9.100000381f > 9 # Ordering comparison checks that should succeed -ok {test-number} - data.float_nine_point_one < 10 for: 9.1f < 10 +ok {test-number} - data.float_nine_point_one < 10 for: 9.100000381f < 10 # Ordering comparison checks that should succeed -ok {test-number} - data.float_nine_point_one < 9.2 for: 9.1f < 9.2 +ok {test-number} - data.float_nine_point_one < 9.2 for: 9.100000381f < 9.19999999999999929 # Ordering comparison checks that should succeed ok {test-number} - data.str_hello <= "hello" for: "hello" <= "hello" # Ordering comparison checks that should succeed @@ -2427,7 +2439,7 @@ ok {test-number} - config.benchmarkResamples == 20000 for: 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 ) +ok {test-number} - config.benchmarkConfidenceInterval == Catch::Approx(0.99) for: 0.98999999999999999 == Approx( 0.98999999999999999 ) # Process can be configured on command line ok {test-number} - cli.parse({ "test", "--benchmark-no-analysis" }) for: {?} # Process can be configured on command line @@ -2608,21 +2620,21 @@ A string sent directly to stdout A string sent directly to stderr A string sent to stderr via clog # Some simple comparisons between doubles -ok {test-number} - d == Approx( 1.23 ) for: 1.23 == Approx( 1.23 ) +ok {test-number} - d == Approx( 1.23 ) for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # Some simple comparisons between doubles -ok {test-number} - d != Approx( 1.22 ) for: 1.23 != Approx( 1.22 ) +ok {test-number} - d != Approx( 1.22 ) for: 1.22999999999999998 != Approx( 1.21999999999999997 ) # Some simple comparisons between doubles -ok {test-number} - d != Approx( 1.24 ) for: 1.23 != Approx( 1.24 ) +ok {test-number} - d != Approx( 1.24 ) for: 1.22999999999999998 != Approx( 1.23999999999999999 ) # Some simple comparisons between doubles -ok {test-number} - d == 1.23_a for: 1.23 == Approx( 1.23 ) +ok {test-number} - d == 1.23_a for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # Some simple comparisons between doubles -ok {test-number} - d != 1.22_a for: 1.23 != Approx( 1.22 ) +ok {test-number} - d != 1.22_a for: 1.22999999999999998 != Approx( 1.21999999999999997 ) # Some simple comparisons between doubles -ok {test-number} - Approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23 +ok {test-number} - Approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) == 1.22999999999999998 # Some simple comparisons between doubles -ok {test-number} - Approx( d ) != 1.22 for: Approx( 1.23 ) != 1.22 +ok {test-number} - Approx( d ) != 1.22 for: Approx( 1.22999999999999998 ) != 1.21999999999999997 # Some simple comparisons between doubles -ok {test-number} - Approx( d ) != 1.24 for: Approx( 1.23 ) != 1.24 +ok {test-number} - Approx( d ) != 1.24 for: Approx( 1.22999999999999998 ) != 1.23999999999999999 Message from section one Message from section two # StartsWith string matcher @@ -2812,19 +2824,19 @@ 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 +ok {test-number} - std::is_default_constructible<TestType>::value for: true # 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 +ok {test-number} - std::is_default_constructible<TestType>::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_trivially_copyable<TestType>::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_trivially_copyable<TestType>::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic<TestType>::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_arithmetic<TestType>::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 2 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic<TestType>::value for: true # 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 @@ -3334,7 +3346,7 @@ ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { # Type conversions of RangeEquals and similar ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } # Unexpected exceptions can be translated -not ok {test-number} - unexpected exception with message: '3.14' +not ok {test-number} - unexpected exception with message: '3.14000000000000012' # Upcasting special member functions ok {test-number} - bptr->i == 3 for: 3 == 3 # Upcasting special member functions @@ -3568,6 +3580,10 @@ ok {test-number} - needs_adl1, RangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } # Usage of RangeEquals range matcher ok {test-number} - needs_adl1, RangeEquals( needs_adl3, []( int l, int r ) { return l + 1 == r; } ) for: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 } # Usage of RangeEquals range matcher +ok {test-number} - array_a, RangeEquals( { 1, 2, 3 } ) for: { 1, 2, 3 } elements are { 1, 2, 3 } +# Usage of RangeEquals range matcher +ok {test-number} - array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) for: { 1, 2, 3 } elements are { 2, 4, 6 } +# Usage of RangeEquals range matcher ok {test-number} - mocked1, !RangeEquals( arr ) for: { 1, 2, 3, 4 } not elements are { 1, 2, 4, 4 } # Usage of RangeEquals range matcher ok {test-number} - mocked1.m_derefed[0] for: true @@ -3607,6 +3623,10 @@ ok {test-number} - vector_a, UnorderedRangeEquals( vector_a_plus_1, close_enough ok {test-number} - vector_a, !UnorderedRangeEquals( vector_b, close_enough ) for: { 1, 10, 21 } not unordered elements are { 11, 21, 3 } # Usage of UnorderedRangeEquals range matcher ok {test-number} - needs_adl1, UnorderedRangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 } +# Usage of UnorderedRangeEquals range matcher +ok {test-number} - array_a, UnorderedRangeEquals( { 10, 20, 1 } ) for: { 1, 10, 20 } unordered elements are { 10, 20, 1 } +# Usage of UnorderedRangeEquals range matcher +ok {test-number} - array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 } # Usage of the SizeIs range matcher ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0 # Usage of the SizeIs range matcher @@ -3626,21 +3646,21 @@ 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 ) +ok {test-number} - d == approx( 1.23 ) for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # Use a custom approx -ok {test-number} - d == approx( 1.22 ) for: 1.23 == Approx( 1.22 ) +ok {test-number} - d == approx( 1.22 ) for: 1.22999999999999998 == Approx( 1.21999999999999997 ) # Use a custom approx -ok {test-number} - d == approx( 1.24 ) for: 1.23 == Approx( 1.24 ) +ok {test-number} - d == approx( 1.24 ) for: 1.22999999999999998 == Approx( 1.23999999999999999 ) # Use a custom approx -ok {test-number} - d != approx( 1.25 ) for: 1.23 != Approx( 1.25 ) +ok {test-number} - d != approx( 1.25 ) for: 1.22999999999999998 != Approx( 1.25 ) # Use a custom approx -ok {test-number} - approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23 +ok {test-number} - approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) == 1.22999999999999998 # Use a custom approx -ok {test-number} - approx( d ) == 1.22 for: Approx( 1.23 ) == 1.22 +ok {test-number} - approx( d ) == 1.22 for: Approx( 1.22999999999999998 ) == 1.21999999999999997 # Use a custom approx -ok {test-number} - approx( d ) == 1.24 for: Approx( 1.23 ) == 1.24 +ok {test-number} - approx( d ) == 1.24 for: Approx( 1.22999999999999998 ) == 1.23999999999999999 # Use a custom approx -ok {test-number} - approx( d ) != 1.25 for: Approx( 1.23 ) != 1.25 +ok {test-number} - approx( d ) != 1.25 for: Approx( 1.22999999999999998 ) != 1.25 # Variadic macros ok {test-number} - with 1 message: 'no assertions' # Vector Approx matcher @@ -3966,11 +3986,11 @@ ok {test-number} - # SKIP 'skipping because answer = 43' # 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 ) +ok {test-number} - erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.09203687623843014 == Approx( -0.09203687623843015 ) # erfc_inv -ok {test-number} - erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.0598029112 == Approx( -0.0598029112 ) +ok {test-number} - erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.05980291115763361 == Approx( -0.05980291115763361 ) # erfc_inv -ok {test-number} - erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.3859038243 == Approx( 1.3859038243 ) +ok {test-number} - erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.38590382434967774 == Approx( 1.38590382434967796 ) # estimate_clock_resolution ok {test-number} - res.mean.count() == rate for: 2000.0 == 2000 (0x<hex digits>) # estimate_clock_resolution @@ -4115,22 +4135,12 @@ ok {test-number} - # SKIP 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 ) +ok {test-number} - normal_quantile(0.551780) == Approx(0.13015979861484198) for: 0.13015979861484195 == Approx( 0.13015979861484198 ) # normal_quantile -ok {test-number} - normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.084574088 == Approx( 0.084574088 ) +ok {test-number} - normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.08457408802851875 == Approx( 0.08457408802851875 ) # normal_quantile -ok {test-number} - normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.9599639845 == Approx( -1.9599639845 ) +ok {test-number} - normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.95996398454005405 == Approx( -1.95996398454005449 ) # not allowed ok {test-number} - # not prints unscoped info from previous failures @@ -4206,6 +4216,14 @@ 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(letters, "c", "cc") for: true +# replaceInPlace +ok {test-number} - letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(s, "--", "-") for: true +# replaceInPlace +ok {test-number} - s == "--" for: "--" == "--" +# replaceInPlace ok {test-number} - Catch::replaceInPlace(s, "'", "|'") for: true # replaceInPlace ok {test-number} - s == "didn|'t" for: "didn|'t" == "didn|'t" @@ -4406,15 +4424,15 @@ 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" +ok {test-number} - "1.5f" == ::Catch::Detail::stringify(float(1.5)) for: "1.5f" == "1.5f" # tuple<float,int> -ok {test-number} - "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) for: "{ 1.2f, 0 }" == "{ 1.2f, 0 }" +ok {test-number} - "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) for: "{ 1.5f, 0 }" == "{ 1.5f, 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 }" +ok {test-number} - "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.5f }" == "{ { 42 }, { }, 1.5f }" # uniform samples ok {test-number} - e.point == 23 for: 23.0 == 23 # uniform samples @@ -4422,7 +4440,7 @@ 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 +ok {test-number} - e.confidence_interval == 0.95 for: 0.94999999999999996 == 0.94999999999999996 # uniform_integer_distribution can return the bounds ok {test-number} - dist.a() == -10 for: -10 == -10 # uniform_integer_distribution can return the bounds @@ -4549,5 +4567,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2272 +1..2281 diff --git a/packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 13449bd40..7f281f646 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -476,6 +476,14 @@ ok {test-number} - Nttp_Fixture<V>::value > 0 for: 6 > 0 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 TEST_CASE_PERSISTENT_FIXTURE based test run that fails +ok {test-number} - m_a++ == 0 for: 0 == 0 +# A TEST_CASE_PERSISTENT_FIXTURE based test run that fails +not ok {test-number} - m_a == 0 for: 1 == 0 +# A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds +ok {test-number} - m_a++ == 0 for: 0 == 0 +# A TEST_CASE_PERSISTENT_FIXTURE 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> @@ -493,17 +501,17 @@ 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 ) +ok {test-number} - d == 1.23_a for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # A comparison that uses literals instead of the normal constructor -ok {test-number} - d != 1.22_a for: 1.23 != Approx( 1.22 ) +ok {test-number} - d != 1.22_a for: 1.22999999999999998 != Approx( 1.21999999999999997 ) # A comparison that uses literals instead of the normal constructor -ok {test-number} - -d == -1.23_a for: -1.23 == Approx( -1.23 ) +ok {test-number} - -d == -1.23_a for: -1.22999999999999998 == Approx( -1.22999999999999998 ) # 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 ) +ok {test-number} - d == 1.2_a .epsilon(.1) for: 1.22999999999999998 == Approx( 1.19999999999999996 ) # 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 ) +ok {test-number} - d != 1.2_a .epsilon(.001) for: 1.22999999999999998 != Approx( 1.19999999999999996 ) # A comparison that uses literals instead of the normal constructor -ok {test-number} - d == 1_a .epsilon(.3) for: 1.23 == Approx( 1.0 ) +ok {test-number} - d == 1_a .epsilon(.3) for: 1.22999999999999998 == 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 @@ -521,9 +529,9 @@ 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 ) +ok {test-number} - 100.3 != Approx(100.0) for: 100.29999999999999716 != Approx( 100.0 ) # Absolute margin -ok {test-number} - 100.3 == Approx(100.0).margin(0.5) for: 100.3 == Approx( 100.0 ) +ok {test-number} - 100.3 == Approx(100.0).margin(0.5) for: 100.29999999999999716 == 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 @@ -559,15 +567,15 @@ ok {test-number} - 245.0f == Approx(245.25f).margin(0.25f) for: 245.0f == Approx # 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 ) +ok {test-number} - divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) for: 3.14285714285714279 == Approx( 3.14100000000000001 ) # Approximate PI -ok {test-number} - divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.1428571429 != Approx( 3.141 ) +ok {test-number} - divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) for: 3.14285714285714279 != Approx( 3.14100000000000001 ) # Approximate comparisons with different epsilons -ok {test-number} - d != Approx( 1.231 ) for: 1.23 != Approx( 1.231 ) +ok {test-number} - d != Approx( 1.231 ) for: 1.22999999999999998 != Approx( 1.23100000000000009 ) # Approximate comparisons with different epsilons -ok {test-number} - d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.23 == Approx( 1.231 ) +ok {test-number} - d == Approx( 1.231 ).epsilon( 0.1 ) for: 1.22999999999999998 == Approx( 1.23100000000000009 ) # Approximate comparisons with floats -ok {test-number} - 1.23f == Approx( 1.23f ) for: 1.23f == Approx( 1.2300000191 ) +ok {test-number} - 1.23f == Approx( 1.23f ) for: 1.230000019f == Approx( 1.23000001907348633 ) # Approximate comparisons with floats ok {test-number} - 0.0f == Approx( 0.0f ) for: 0.0f == Approx( 0.0 ) # Approximate comparisons with ints @@ -581,9 +589,9 @@ 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 ) +ok {test-number} - 1.234f == Approx( dMedium ) for: 1.233999968f == Approx( 1.23399999999999999 ) # Approximate comparisons with mixed numeric types -ok {test-number} - dMedium == Approx( 1.234f ) for: 1.234 == Approx( 1.2339999676 ) +ok {test-number} - dMedium == Approx( 1.234f ) for: 1.23399999999999999 == Approx( 1.23399996757507324 ) # Arbitrary predicate matcher ok {test-number} - 1, Predicate<int>( alwaysTrue, "always true" ) for: 1 matches predicate: "always true" # Arbitrary predicate matcher @@ -695,33 +703,37 @@ 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: ' ' == ' ' +ok {test-number} - ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'a' == 'a' +ok {test-number} - ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'z' == 'z' +ok {test-number} - ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'A' == 'A' +ok {test-number} - ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'Z' == 'Z' +ok {test-number} - ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" # Character pretty printing -ok {test-number} - null_terminator == '\0' for: 0 == 0 +ok {test-number} - ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" # Character pretty printing -ok {test-number} - c == i for: 2 == 2 +ok {test-number} - ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" # Character pretty printing -ok {test-number} - c == i for: 3 == 3 +ok {test-number} - ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" # Character pretty printing -ok {test-number} - c == i for: 4 == 4 +ok {test-number} - ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" for: "2" == "2" # Character pretty printing -ok {test-number} - c == i for: 5 == 5 +ok {test-number} - ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" for: "5" == "5" +# Clara::Arg does not crash on incomplete input +ok {test-number} - name.empty() for: true +# Clara::Arg does not crash on incomplete input +ok {test-number} - result for: {?} +# Clara::Arg does not crash on incomplete input +ok {test-number} - result.type() == Catch::Clara::Detail::ResultType::Ok for: 0 == 0 +# Clara::Arg does not crash on incomplete input +ok {test-number} - parsed.type() == Catch::Clara::ParseResultType::NoMatch for: 1 == 1 +# Clara::Arg does not crash on incomplete input +ok {test-number} - parsed.remainingTokens().count() == 2 for: 2 == 2 +# Clara::Arg does not crash on incomplete input +ok {test-number} - name.empty() for: true # 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 @@ -973,7 +985,7 @@ not ok {test-number} - unexpected exception with message: 'custom exception - no # 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 ) +ok {test-number} - 101.000001 != Approx(100).epsilon(0.01) for: 101.00000099999999748 != 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 @@ -990,22 +1002,22 @@ ok {test-number} - Catch::makeStream( "" )->isConsole() for: true 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 +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1" -# Enums can quickly have stringification enabled using REGISTER_ENUM +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( EnumClass3::Value2 ) == "Value2" for: "Value2" == "Value2" -# Enums can quickly have stringification enabled using REGISTER_ENUM +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( EnumClass3::Value3 ) == "Value3" for: "Value3" == "Value3" -# Enums can quickly have stringification enabled using REGISTER_ENUM +# Enums can quickly have stringification enabled using CATCH_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 +# Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( ec3 ) == "Value2" for: "Value2" == "Value2" -# Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM +# Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM ok {test-number} - stringify( Bikeshed::Colours::Red ) == "Red" for: "Red" == "Red" -# Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM +# Enums in namespaces can quickly have stringification enabled using CATCH_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 ) +ok {test-number} - 101.01 != Approx(100).epsilon(0.01) for: 101.01000000000000512 != Approx( 100.0 ) # Equality checks that should fail not ok {test-number} - data.int_seven == 6 for: 7 == 6 # Equality checks that should fail @@ -1013,15 +1025,15 @@ 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 ) +not ok {test-number} - data.float_nine_point_one == Approx( 9.11f ) for: 9.100000381f == Approx( 9.10999965667724609 ) # Equality checks that should fail -not ok {test-number} - data.float_nine_point_one == Approx( 9.0f ) for: 9.1f == Approx( 9.0 ) +not ok {test-number} - data.float_nine_point_one == Approx( 9.0f ) for: 9.100000381f == 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 ) +not ok {test-number} - data.float_nine_point_one == Approx( 1 ) for: 9.100000381f == 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 ) +not ok {test-number} - data.float_nine_point_one == Approx( 0 ) for: 9.100000381f == Approx( 0.0 ) # Equality checks that should fail -not ok {test-number} - data.double_pi == Approx( 3.1415 ) for: 3.1415926535 == Approx( 3.1415 ) +not ok {test-number} - data.double_pi == Approx( 3.1415 ) for: 3.14159265350000005 == Approx( 3.14150000000000018 ) # Equality checks that should fail not ok {test-number} - data.str_hello == "goodbye" for: "hello" == "goodbye" # Equality checks that should fail @@ -1031,13 +1043,13 @@ 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 ) +not ok {test-number} - x == Approx( 1.301 ) for: 1.30000000000000027 == Approx( 1.30099999999999993 ) # 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 ) +ok {test-number} - data.float_nine_point_one == Approx( 9.1f ) for: 9.100000381f == Approx( 9.10000038146972656 ) # Equality checks that should succeed -ok {test-number} - data.double_pi == Approx( 3.1415926535 ) for: 3.1415926535 == Approx( 3.1415926535 ) +ok {test-number} - data.double_pi == Approx( 3.1415926535 ) for: 3.14159265350000005 == Approx( 3.14159265350000005 ) # Equality checks that should succeed ok {test-number} - data.str_hello == "hello" for: "hello" == "hello" # Equality checks that should succeed @@ -1045,7 +1057,7 @@ 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 ) +ok {test-number} - x == Approx( 1.3 ) for: 1.30000000000000027 == Approx( 1.30000000000000004 ) # 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 @@ -1131,23 +1143,23 @@ ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 362 # Filter generator throws exception for empty generator ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException # 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 +ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 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 +ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 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 +ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.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 +ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0.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 +ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 0.0 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 +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 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 +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.98999999999999999 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 @@ -1155,11 +1167,11 @@ ok {test-number} - 10., !WithinAbs( 11., 0.5 ) for: 10.0 not is within 0.5 of 11 # 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 +ok {test-number} - -10., WithinAbs( -9.6, 0.5 ) for: -10.0 is within 0.5 of -9.59999999999999964 # 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]) +ok {test-number} - nextafter( 1., 2. ), WithinULP( 1., 1 ) for: 1.00000000000000022 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 @@ -1175,7 +1187,7 @@ ok {test-number} - 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is # 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 ) +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.0 are within 10% of each other ) # Floating point matchers: double ok {test-number} - WithinAbs( 1., 0. ) # Floating point matchers: double @@ -1191,23 +1203,23 @@ ok {test-number} - WithinRel( 1., 1. ), std::domain_error # Floating point matchers: double ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN # 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 +ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.10000038146972656 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 +ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.19999980926513672 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 +ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.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 +ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0.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 +ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 0.0 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 +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 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 +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.99000000953674316 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 @@ -1217,13 +1229,13 @@ ok {test-number} - 10.f, !WithinAbs( 11.f, 0.5f ) for: 10.0f not is within 0.5 o # 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 +ok {test-number} - -10.f, WithinAbs( -9.6f, 0.5f ) for: -10.0f is within 0.5 of -9.60000038146972656 # 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]) +ok {test-number} - nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) for: 1.000000119f 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 @@ -1239,7 +1251,7 @@ ok {test-number} - 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( # 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 ) +ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.0 are within 10% of each other ) # Floating point matchers: float ok {test-number} - WithinAbs( 1.f, 0.f ) # Floating point matchers: float @@ -1599,83 +1611,83 @@ ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) wit # 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.90000000000000002 == Approx( -0.90000000000000002 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.80000000000000004 == Approx( -0.80000000000000004 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.70000000000000007 == Approx( -0.70000000000000007 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.60000000000000009 == Approx( -0.60000000000000009 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.50000000000000011 == Approx( -0.50000000000000011 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.40000000000000013 == Approx( -0.40000000000000013 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.30000000000000016 == Approx( -0.30000000000000016 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.20000000000000015 == Approx( -0.20000000000000015 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.10000000000000014 == Approx( -0.10000000000000014 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.00000000000000014 == Approx( -0.00000000000000014 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.09999999999999987 == Approx( 0.09999999999999987 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.19999999999999987 == Approx( 0.19999999999999987 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.29999999999999988 == Approx( 0.29999999999999988 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.39999999999999991 == Approx( 0.39999999999999991 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.49999999999999989 == Approx( 0.49999999999999989 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.59999999999999987 == Approx( 0.59999999999999987 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.69999999999999984 == Approx( 0.69999999999999984 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.79999999999999982 == Approx( 0.79999999999999982 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.8999999999999998 == Approx( 0.8999999999999998 ) 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 ) +ok {test-number} - gen.get() == Approx( rangeEnd ) for: 0.99999999999999978 == Approx( 1.0 ) # Generators internals ok {test-number} - !(gen.next()) for: !false # Generators internals @@ -1683,19 +1695,19 @@ ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) wit # 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.69999999999999996 == Approx( -0.69999999999999996 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.39999999999999997 == Approx( -0.39999999999999997 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.09999999999999998 == Approx( -0.09999999999999998 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.20000000000000001 == Approx( 0.20000000000000001 ) 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 @@ -1709,19 +1721,19 @@ ok {test-number} - gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) wit # 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.69999999999999996 == Approx( -0.69999999999999996 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.39999999999999997 == Approx( -0.39999999999999997 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: -0.09999999999999998 == Approx( -0.09999999999999998 ) 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' +ok {test-number} - gen.get() == Approx(expected) for: 0.20000000000000001 == Approx( 0.20000000000000001 ) 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 @@ -1783,13 +1795,13 @@ 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 ) +ok {test-number} - d >= Approx( 1.22 ) for: 1.22999999999999998 >= Approx( 1.21999999999999997 ) # Greater-than inequalities with different epsilons -ok {test-number} - d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) +ok {test-number} - d >= Approx( 1.23 ) for: 1.22999999999999998 >= Approx( 1.22999999999999998 ) # Greater-than inequalities with different epsilons -ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) +ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.22999999999999998 >= Approx( 1.23999999999999999 )) # Greater-than inequalities with different epsilons -ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.22999999999999998 >= Approx( 1.23999999999999999 ) # 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 @@ -1843,9 +1855,9 @@ not ok {test-number} - unexpected exception with message: 'Exception translation # 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 ) +not ok {test-number} - data.float_nine_point_one != Approx( 9.1f ) for: 9.100000381f != Approx( 9.10000038146972656 ) # Inequality checks that should fail -not ok {test-number} - data.double_pi != Approx( 3.1415926535 ) for: 3.1415926535 != Approx( 3.1415926535 ) +not ok {test-number} - data.double_pi != Approx( 3.1415926535 ) for: 3.14159265350000005 != Approx( 3.14159265350000005 ) # Inequality checks that should fail not ok {test-number} - data.str_hello != "hello" for: "hello" != "hello" # Inequality checks that should fail @@ -1855,15 +1867,15 @@ 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 ) +ok {test-number} - data.float_nine_point_one != Approx( 9.11f ) for: 9.100000381f != Approx( 9.10999965667724609 ) # Inequality checks that should succeed -ok {test-number} - data.float_nine_point_one != Approx( 9.0f ) for: 9.1f != Approx( 9.0 ) +ok {test-number} - data.float_nine_point_one != Approx( 9.0f ) for: 9.100000381f != Approx( 9.0 ) # Inequality checks that should succeed -ok {test-number} - data.float_nine_point_one != Approx( 1 ) for: 9.1f != Approx( 1.0 ) +ok {test-number} - data.float_nine_point_one != Approx( 1 ) for: 9.100000381f != Approx( 1.0 ) # Inequality checks that should succeed -ok {test-number} - data.float_nine_point_one != Approx( 0 ) for: 9.1f != Approx( 0.0 ) +ok {test-number} - data.float_nine_point_one != Approx( 0 ) for: 9.100000381f != Approx( 0.0 ) # Inequality checks that should succeed -ok {test-number} - data.double_pi != Approx( 3.1415 ) for: 3.1415926535 != Approx( 3.1415 ) +ok {test-number} - data.double_pi != Approx( 3.1415 ) for: 3.14159265350000005 != Approx( 3.14150000000000018 ) # Inequality checks that should succeed ok {test-number} - data.str_hello != "goodbye" for: "hello" != "goodbye" # Inequality checks that should succeed @@ -1911,13 +1923,13 @@ ok {test-number} - sstream.str() == "\"\\\\/\\t\\r\\n\"" for: ""\\/\t\r\n"" == " # 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 ) +ok {test-number} - d <= Approx( 1.24 ) for: 1.22999999999999998 <= Approx( 1.23999999999999999 ) # Less-than inequalities with different epsilons -ok {test-number} - d <= Approx( 1.23 ) for: 1.23 <= Approx( 1.23 ) +ok {test-number} - d <= Approx( 1.23 ) for: 1.22999999999999998 <= Approx( 1.22999999999999998 ) # Less-than inequalities with different epsilons -ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.23 <= Approx( 1.22 )) +ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.22999999999999998 <= Approx( 1.21999999999999997 )) # Less-than inequalities with different epsilons -ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) +ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 <= Approx( 1.21999999999999997 ) # ManuallyRegistered ok {test-number} - with 1 message: 'was called' # Matchers can be (AllOf) composed with the && operator @@ -2047,11 +2059,11 @@ 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 +not ok {test-number} - data.float_nine_point_one < 9 for: 9.100000381f < 9 # Ordering comparison checks that should fail -not ok {test-number} - data.float_nine_point_one > 10 for: 9.1f > 10 +not ok {test-number} - data.float_nine_point_one > 10 for: 9.100000381f > 10 # Ordering comparison checks that should fail -not ok {test-number} - data.float_nine_point_one > 9.2 for: 9.1f > 9.2 +not ok {test-number} - data.float_nine_point_one > 9.2 for: 9.100000381f > 9.19999999999999929 # Ordering comparison checks that should fail not ok {test-number} - data.str_hello > "hello" for: "hello" > "hello" # Ordering comparison checks that should fail @@ -2085,11 +2097,11 @@ 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 +ok {test-number} - data.float_nine_point_one > 9 for: 9.100000381f > 9 # Ordering comparison checks that should succeed -ok {test-number} - data.float_nine_point_one < 10 for: 9.1f < 10 +ok {test-number} - data.float_nine_point_one < 10 for: 9.100000381f < 10 # Ordering comparison checks that should succeed -ok {test-number} - data.float_nine_point_one < 9.2 for: 9.1f < 9.2 +ok {test-number} - data.float_nine_point_one < 9.2 for: 9.100000381f < 9.19999999999999929 # Ordering comparison checks that should succeed ok {test-number} - data.str_hello <= "hello" for: "hello" <= "hello" # Ordering comparison checks that should succeed @@ -2425,7 +2437,7 @@ ok {test-number} - config.benchmarkResamples == 20000 for: 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 ) +ok {test-number} - config.benchmarkConfidenceInterval == Catch::Approx(0.99) for: 0.98999999999999999 == Approx( 0.98999999999999999 ) # Process can be configured on command line ok {test-number} - cli.parse({ "test", "--benchmark-no-analysis" }) for: {?} # Process can be configured on command line @@ -2603,21 +2615,21 @@ 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 ) +ok {test-number} - d == Approx( 1.23 ) for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # Some simple comparisons between doubles -ok {test-number} - d != Approx( 1.22 ) for: 1.23 != Approx( 1.22 ) +ok {test-number} - d != Approx( 1.22 ) for: 1.22999999999999998 != Approx( 1.21999999999999997 ) # Some simple comparisons between doubles -ok {test-number} - d != Approx( 1.24 ) for: 1.23 != Approx( 1.24 ) +ok {test-number} - d != Approx( 1.24 ) for: 1.22999999999999998 != Approx( 1.23999999999999999 ) # Some simple comparisons between doubles -ok {test-number} - d == 1.23_a for: 1.23 == Approx( 1.23 ) +ok {test-number} - d == 1.23_a for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # Some simple comparisons between doubles -ok {test-number} - d != 1.22_a for: 1.23 != Approx( 1.22 ) +ok {test-number} - d != 1.22_a for: 1.22999999999999998 != Approx( 1.21999999999999997 ) # Some simple comparisons between doubles -ok {test-number} - Approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23 +ok {test-number} - Approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) == 1.22999999999999998 # Some simple comparisons between doubles -ok {test-number} - Approx( d ) != 1.22 for: Approx( 1.23 ) != 1.22 +ok {test-number} - Approx( d ) != 1.22 for: Approx( 1.22999999999999998 ) != 1.21999999999999997 # Some simple comparisons between doubles -ok {test-number} - Approx( d ) != 1.24 for: Approx( 1.23 ) != 1.24 +ok {test-number} - Approx( d ) != 1.24 for: Approx( 1.22999999999999998 ) != 1.23999999999999999 # 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 @@ -2805,19 +2817,19 @@ 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 +ok {test-number} - std::is_default_constructible<TestType>::value for: true # 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 +ok {test-number} - std::is_default_constructible<TestType>::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_trivially_copyable<TestType>::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_trivially_copyable<TestType>::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic<TestType>::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_arithmetic<TestType>::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 2 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic<TestType>::value for: true # 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 @@ -3327,7 +3339,7 @@ ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { # Type conversions of RangeEquals and similar ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } # Unexpected exceptions can be translated -not ok {test-number} - unexpected exception with message: '3.14' +not ok {test-number} - unexpected exception with message: '3.14000000000000012' # Upcasting special member functions ok {test-number} - bptr->i == 3 for: 3 == 3 # Upcasting special member functions @@ -3561,6 +3573,10 @@ ok {test-number} - needs_adl1, RangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } # Usage of RangeEquals range matcher ok {test-number} - needs_adl1, RangeEquals( needs_adl3, []( int l, int r ) { return l + 1 == r; } ) for: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 } # Usage of RangeEquals range matcher +ok {test-number} - array_a, RangeEquals( { 1, 2, 3 } ) for: { 1, 2, 3 } elements are { 1, 2, 3 } +# Usage of RangeEquals range matcher +ok {test-number} - array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) for: { 1, 2, 3 } elements are { 2, 4, 6 } +# Usage of RangeEquals range matcher ok {test-number} - mocked1, !RangeEquals( arr ) for: { 1, 2, 3, 4 } not elements are { 1, 2, 4, 4 } # Usage of RangeEquals range matcher ok {test-number} - mocked1.m_derefed[0] for: true @@ -3600,6 +3616,10 @@ ok {test-number} - vector_a, UnorderedRangeEquals( vector_a_plus_1, close_enough ok {test-number} - vector_a, !UnorderedRangeEquals( vector_b, close_enough ) for: { 1, 10, 21 } not unordered elements are { 11, 21, 3 } # Usage of UnorderedRangeEquals range matcher ok {test-number} - needs_adl1, UnorderedRangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 } +# Usage of UnorderedRangeEquals range matcher +ok {test-number} - array_a, UnorderedRangeEquals( { 10, 20, 1 } ) for: { 1, 10, 20 } unordered elements are { 10, 20, 1 } +# Usage of UnorderedRangeEquals range matcher +ok {test-number} - array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 } # Usage of the SizeIs range matcher ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0 # Usage of the SizeIs range matcher @@ -3619,21 +3639,21 @@ 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 ) +ok {test-number} - d == approx( 1.23 ) for: 1.22999999999999998 == Approx( 1.22999999999999998 ) # Use a custom approx -ok {test-number} - d == approx( 1.22 ) for: 1.23 == Approx( 1.22 ) +ok {test-number} - d == approx( 1.22 ) for: 1.22999999999999998 == Approx( 1.21999999999999997 ) # Use a custom approx -ok {test-number} - d == approx( 1.24 ) for: 1.23 == Approx( 1.24 ) +ok {test-number} - d == approx( 1.24 ) for: 1.22999999999999998 == Approx( 1.23999999999999999 ) # Use a custom approx -ok {test-number} - d != approx( 1.25 ) for: 1.23 != Approx( 1.25 ) +ok {test-number} - d != approx( 1.25 ) for: 1.22999999999999998 != Approx( 1.25 ) # Use a custom approx -ok {test-number} - approx( d ) == 1.23 for: Approx( 1.23 ) == 1.23 +ok {test-number} - approx( d ) == 1.23 for: Approx( 1.22999999999999998 ) == 1.22999999999999998 # Use a custom approx -ok {test-number} - approx( d ) == 1.22 for: Approx( 1.23 ) == 1.22 +ok {test-number} - approx( d ) == 1.22 for: Approx( 1.22999999999999998 ) == 1.21999999999999997 # Use a custom approx -ok {test-number} - approx( d ) == 1.24 for: Approx( 1.23 ) == 1.24 +ok {test-number} - approx( d ) == 1.24 for: Approx( 1.22999999999999998 ) == 1.23999999999999999 # Use a custom approx -ok {test-number} - approx( d ) != 1.25 for: Approx( 1.23 ) != 1.25 +ok {test-number} - approx( d ) != 1.25 for: Approx( 1.22999999999999998 ) != 1.25 # Variadic macros ok {test-number} - with 1 message: 'no assertions' # Vector Approx matcher @@ -3959,11 +3979,11 @@ ok {test-number} - # SKIP 'skipping because answer = 43' # 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 ) +ok {test-number} - erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.09203687623843014 == Approx( -0.09203687623843015 ) # erfc_inv -ok {test-number} - erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.0598029112 == Approx( -0.0598029112 ) +ok {test-number} - erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.05980291115763361 == Approx( -0.05980291115763361 ) # erfc_inv -ok {test-number} - erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.3859038243 == Approx( 1.3859038243 ) +ok {test-number} - erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.38590382434967774 == Approx( 1.38590382434967796 ) # estimate_clock_resolution ok {test-number} - res.mean.count() == rate for: 2000.0 == 2000 (0x<hex digits>) # estimate_clock_resolution @@ -4104,22 +4124,12 @@ ok {test-number} - # SKIP 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 ) +ok {test-number} - normal_quantile(0.551780) == Approx(0.13015979861484198) for: 0.13015979861484195 == Approx( 0.13015979861484198 ) # normal_quantile -ok {test-number} - normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.084574088 == Approx( 0.084574088 ) +ok {test-number} - normal_quantile(0.533700) == Approx(0.08457408802851875) for: 0.08457408802851875 == Approx( 0.08457408802851875 ) # normal_quantile -ok {test-number} - normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.9599639845 == Approx( -1.9599639845 ) +ok {test-number} - normal_quantile(0.025000) == Approx(-1.95996398454005449) for: -1.95996398454005405 == Approx( -1.95996398454005449 ) # not allowed ok {test-number} - # not prints unscoped info from previous failures @@ -4195,6 +4205,14 @@ 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(letters, "c", "cc") for: true +# replaceInPlace +ok {test-number} - letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(s, "--", "-") for: true +# replaceInPlace +ok {test-number} - s == "--" for: "--" == "--" +# replaceInPlace ok {test-number} - Catch::replaceInPlace(s, "'", "|'") for: true # replaceInPlace ok {test-number} - s == "didn|'t" for: "didn|'t" == "didn|'t" @@ -4395,15 +4413,15 @@ 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" +ok {test-number} - "1.5f" == ::Catch::Detail::stringify(float(1.5)) for: "1.5f" == "1.5f" # tuple<float,int> -ok {test-number} - "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) for: "{ 1.2f, 0 }" == "{ 1.2f, 0 }" +ok {test-number} - "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) for: "{ 1.5f, 0 }" == "{ 1.5f, 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 }" +ok {test-number} - "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) for: "{ { 42 }, { }, 1.5f }" == "{ { 42 }, { }, 1.5f }" # uniform samples ok {test-number} - e.point == 23 for: 23.0 == 23 # uniform samples @@ -4411,7 +4429,7 @@ 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 +ok {test-number} - e.confidence_interval == 0.95 for: 0.94999999999999996 == 0.94999999999999996 # uniform_integer_distribution can return the bounds ok {test-number} - dist.a() == -10 for: -10 == -10 # uniform_integer_distribution can return the bounds @@ -4538,5 +4556,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2272 +1..2281 diff --git a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt index 2a2c40cfc..db4855231 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -166,6 +166,11 @@ ##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 TEST_CASE_PERSISTENT_FIXTURE based test run that fails'] +##teamcity[testFailed name='A TEST_CASE_PERSISTENT_FIXTURE based test run that fails' message='-------------------------------------------------------------------------------|nSecond partial run|n-------------------------------------------------------------------------------|nClass.tests.cpp:<line number>|n...............................................................................|n|nClass.tests.cpp:<line number>|nexpression failed|n REQUIRE( m_a == 0 )|nwith expansion:|n 1 == 0|n'] +##teamcity[testFinished name='A TEST_CASE_PERSISTENT_FIXTURE based test run that fails' duration="{duration}"] +##teamcity[testStarted name='A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds'] +##teamcity[testFinished name='A TEST_CASE_PERSISTENT_FIXTURE 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>'] @@ -240,6 +245,8 @@ ##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 does not crash on incomplete input'] +##teamcity[testFinished name='Clara::Arg does not crash on incomplete input' 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'] @@ -308,26 +315,26 @@ ##teamcity[testFailed name='EndsWith string matcher' message='Matchers.tests.cpp:<line number>|n...............................................................................|n|nMatchers.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'] ##teamcity[testFailed name='EndsWith string matcher' message='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='Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM'] +##teamcity[testFinished name='Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM' duration="{duration}"] +##teamcity[testStarted name='Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM'] +##teamcity[testFinished name='Enums in namespaces can quickly have stringification enabled using CATCH_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'] ##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|n...............................................................................|n|nCondition.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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 9.11f ) )|nwith expansion:|n 9.100000381f|n==|nApprox( 9.10999965667724609 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 9.0f ) )|nwith expansion:|n 9.100000381f == Approx( 9.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 1 ) )|nwith expansion:|n 9.100000381f == Approx( 1.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 0 ) )|nwith expansion:|n 9.100000381f == Approx( 0.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.double_pi == Approx( 3.1415 ) )|nwith expansion:|n 3.14159265350000005|n==|nApprox( 3.14150000000000018 )|n- failure ignore as test marked as |'ok to fail|'|n'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( x == Approx( 1.301 ) )|nwith expansion:|n 1.30000000000000027|n==|nApprox( 1.30099999999999993 )|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}"] @@ -415,8 +422,8 @@ ##teamcity[testFinished name='Incomplete AssertionHandler' duration="{duration}"] ##teamcity[testStarted name='Inequality checks that should fail'] ##teamcity[testIgnored name='Inequality checks that should fail' message='Condition.tests.cpp:<line number>|n...............................................................................|n|nCondition.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'] -##teamcity[testIgnored name='Inequality checks that should fail' message='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'] -##teamcity[testIgnored name='Inequality checks that should fail' message='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'] +##teamcity[testIgnored name='Inequality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one != Approx( 9.1f ) )|nwith expansion:|n 9.100000381f|n!=|nApprox( 9.10000038146972656 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Inequality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.double_pi != Approx( 3.1415926535 ) )|nwith expansion:|n 3.14159265350000005|n!=|nApprox( 3.14159265350000005 )|n- failure ignore as test marked as |'ok to fail|'|n'] ##teamcity[testIgnored name='Inequality checks that should fail' message='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'] ##teamcity[testIgnored name='Inequality checks that should fail' message='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}"] @@ -479,9 +486,9 @@ ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven < -1 )|nwith expansion:|n 7 < -1|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven >= 8 )|nwith expansion:|n 7 >= 8|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven <= 6 )|nwith expansion:|n 7 <= 6|n'] -##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one < 9 )|nwith expansion:|n 9.1f < 9|n'] -##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 10 )|nwith expansion:|n 9.1f > 10|n'] -##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 9.2 )|nwith expansion:|n 9.1f > 9.2|n'] +##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one < 9 )|nwith expansion:|n 9.100000381f < 9|n'] +##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 10 )|nwith expansion:|n 9.100000381f > 10|n'] +##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 9.2 )|nwith expansion:|n 9.100000381f > 9.19999999999999929|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello > "hello" )|nwith expansion:|n "hello" > "hello"|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello < "hello" )|nwith expansion:|n "hello" < "hello"|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello > "hellp" )|nwith expansion:|n "hello" > "hellp"|n'] @@ -673,7 +680,7 @@ ##teamcity[testStarted name='Type conversions of RangeEquals and similar'] ##teamcity[testFinished name='Type conversions of RangeEquals and similar' duration="{duration}"] ##teamcity[testStarted name='Unexpected exceptions can be translated'] -##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "3.14"'] +##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "3.14000000000000012"'] ##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}"] @@ -861,8 +868,6 @@ loose text artifact ##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'] diff --git a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt index 24ed5d988..dde8a6820 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt @@ -166,6 +166,11 @@ ##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 TEST_CASE_PERSISTENT_FIXTURE based test run that fails'] +##teamcity[testFailed name='A TEST_CASE_PERSISTENT_FIXTURE based test run that fails' message='-------------------------------------------------------------------------------|nSecond partial run|n-------------------------------------------------------------------------------|nClass.tests.cpp:<line number>|n...............................................................................|n|nClass.tests.cpp:<line number>|nexpression failed|n REQUIRE( m_a == 0 )|nwith expansion:|n 1 == 0|n'] +##teamcity[testFinished name='A TEST_CASE_PERSISTENT_FIXTURE based test run that fails' duration="{duration}"] +##teamcity[testStarted name='A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds'] +##teamcity[testFinished name='A TEST_CASE_PERSISTENT_FIXTURE 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>'] @@ -240,6 +245,8 @@ ##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 does not crash on incomplete input'] +##teamcity[testFinished name='Clara::Arg does not crash on incomplete input' 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'] @@ -308,26 +315,26 @@ ##teamcity[testFailed name='EndsWith string matcher' message='Matchers.tests.cpp:<line number>|n...............................................................................|n|nMatchers.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'] ##teamcity[testFailed name='EndsWith string matcher' message='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='Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM'] +##teamcity[testFinished name='Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM' duration="{duration}"] +##teamcity[testStarted name='Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM'] +##teamcity[testFinished name='Enums in namespaces can quickly have stringification enabled using CATCH_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'] ##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|n...............................................................................|n|nCondition.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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 9.11f ) )|nwith expansion:|n 9.100000381f|n==|nApprox( 9.10999965667724609 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 9.0f ) )|nwith expansion:|n 9.100000381f == Approx( 9.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 1 ) )|nwith expansion:|n 9.100000381f == Approx( 1.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one == Approx( 0 ) )|nwith expansion:|n 9.100000381f == Approx( 0.0 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.double_pi == Approx( 3.1415 ) )|nwith expansion:|n 3.14159265350000005|n==|nApprox( 3.14150000000000018 )|n- failure ignore as test marked as |'ok to fail|'|n'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] ##teamcity[testIgnored name='Equality checks that should fail' message='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'] -##teamcity[testIgnored name='Equality checks that should fail' message='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[testIgnored name='Equality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( x == Approx( 1.301 ) )|nwith expansion:|n 1.30000000000000027|n==|nApprox( 1.30099999999999993 )|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}"] @@ -415,8 +422,8 @@ ##teamcity[testFinished name='Incomplete AssertionHandler' duration="{duration}"] ##teamcity[testStarted name='Inequality checks that should fail'] ##teamcity[testIgnored name='Inequality checks that should fail' message='Condition.tests.cpp:<line number>|n...............................................................................|n|nCondition.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'] -##teamcity[testIgnored name='Inequality checks that should fail' message='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'] -##teamcity[testIgnored name='Inequality checks that should fail' message='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'] +##teamcity[testIgnored name='Inequality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one != Approx( 9.1f ) )|nwith expansion:|n 9.100000381f|n!=|nApprox( 9.10000038146972656 )|n- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testIgnored name='Inequality checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.double_pi != Approx( 3.1415926535 ) )|nwith expansion:|n 3.14159265350000005|n!=|nApprox( 3.14159265350000005 )|n- failure ignore as test marked as |'ok to fail|'|n'] ##teamcity[testIgnored name='Inequality checks that should fail' message='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'] ##teamcity[testIgnored name='Inequality checks that should fail' message='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}"] @@ -479,9 +486,9 @@ ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven < -1 )|nwith expansion:|n 7 < -1|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven >= 8 )|nwith expansion:|n 7 >= 8|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.int_seven <= 6 )|nwith expansion:|n 7 <= 6|n'] -##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one < 9 )|nwith expansion:|n 9.1f < 9|n'] -##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 10 )|nwith expansion:|n 9.1f > 10|n'] -##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 9.2 )|nwith expansion:|n 9.1f > 9.2|n'] +##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one < 9 )|nwith expansion:|n 9.100000381f < 9|n'] +##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 10 )|nwith expansion:|n 9.100000381f > 10|n'] +##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.float_nine_point_one > 9.2 )|nwith expansion:|n 9.100000381f > 9.19999999999999929|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello > "hello" )|nwith expansion:|n "hello" > "hello"|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello < "hello" )|nwith expansion:|n "hello" < "hello"|n'] ##teamcity[testFailed name='Ordering comparison checks that should fail' message='Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello > "hellp" )|nwith expansion:|n "hello" > "hellp"|n'] @@ -673,7 +680,7 @@ ##teamcity[testStarted name='Type conversions of RangeEquals and similar'] ##teamcity[testFinished name='Type conversions of RangeEquals and similar' duration="{duration}"] ##teamcity[testStarted name='Unexpected exceptions can be translated'] -##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "3.14"'] +##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "3.14000000000000012"'] ##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}"] @@ -860,8 +867,6 @@ ##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'] diff --git a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt index be57798bf..aa6bd6a86 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -2056,6 +2056,56 @@ Nor would this </Expression> <OverallResult success="true" skips="0"/> </TestCase> + <TestCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails" tags="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Section name="First partial run" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a++ == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <Section name="Second partial run" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <OverallResults successes="0" failures="1" expectedFailures="0" skipped="false"/> + </Section> + <OverallResult success="false" skips="0"/> + </TestCase> + <TestCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds" tags="[class]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Section name="First partial run" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a++ == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <Section name="Second partial run" 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> + <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <OverallResult success="true" skips="0"/> + </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> @@ -2150,7 +2200,9 @@ Nor would this d == 1.23_a </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2158,7 +2210,9 @@ Nor would this d != 1.22_a </Original> <Expanded> - 1.23 != Approx( 1.22 ) + 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2166,7 +2220,9 @@ Nor would this -d == -1.23_a </Original> <Expanded> - -1.23 == Approx( -1.23 ) + -1.22999999999999998 +== +Approx( -1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2174,7 +2230,9 @@ Nor would this d == 1.2_a .epsilon(.1) </Original> <Expanded> - 1.23 == Approx( 1.2 ) + 1.22999999999999998 +== +Approx( 1.19999999999999996 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2182,7 +2240,9 @@ Nor would this d != 1.2_a .epsilon(.001) </Original> <Expanded> - 1.23 != Approx( 1.2 ) + 1.22999999999999998 +!= +Approx( 1.19999999999999996 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2190,7 +2250,7 @@ Nor would this d == 1_a .epsilon(.3) </Original> <Expanded> - 1.23 == Approx( 1.0 ) + 1.22999999999999998 == Approx( 1.0 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2264,7 +2324,7 @@ Nor would this 100.3 != Approx(100.0) </Original> <Expanded> - 100.3 != Approx( 100.0 ) + 100.29999999999999716 != Approx( 100.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2272,7 +2332,7 @@ Nor would this 100.3 == Approx(100.0).margin(0.5) </Original> <Expanded> - 100.3 == Approx( 100.0 ) + 100.29999999999999716 == Approx( 100.0 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2432,7 +2492,9 @@ Nor would this divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) </Original> <Expanded> - 3.1428571429 == Approx( 3.141 ) + 3.14285714285714279 +== +Approx( 3.14100000000000001 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2440,7 +2502,9 @@ Nor would this divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) </Original> <Expanded> - 3.1428571429 != Approx( 3.141 ) + 3.14285714285714279 +!= +Approx( 3.14100000000000001 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2451,7 +2515,9 @@ Nor would this d != Approx( 1.231 ) </Original> <Expanded> - 1.23 != Approx( 1.231 ) + 1.22999999999999998 +!= +Approx( 1.23100000000000009 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2459,7 +2525,9 @@ Nor would this d == Approx( 1.231 ).epsilon( 0.1 ) </Original> <Expanded> - 1.23 == Approx( 1.231 ) + 1.22999999999999998 +== +Approx( 1.23100000000000009 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2470,7 +2538,9 @@ Nor would this 1.23f == Approx( 1.23f ) </Original> <Expanded> - 1.23f == Approx( 1.2300000191 ) + 1.230000019f +== +Approx( 1.23000001907348633 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2532,7 +2602,9 @@ Nor would this 1.234f == Approx( dMedium ) </Original> <Expanded> - 1.234f == Approx( 1.234 ) + 1.233999968f +== +Approx( 1.23399999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2540,7 +2612,9 @@ Nor would this dMedium == Approx( 1.234f ) </Original> <Expanded> - 1.234 == Approx( 1.2339999676 ) + 1.23399999999999999 +== +Approx( 1.23399996757507324 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -3142,34 +3216,34 @@ Nor would this <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' + ::Catch::Detail::stringify('\t') == "'\\t'" </Original> <Expanded> - '\t' == '\t' + "'\t'" == "'\t'" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - newline == '\n' + ::Catch::Detail::stringify('\n') == "'\\n'" </Original> <Expanded> - '\n' == '\n' + "'\n'" == "'\n'" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - carr_return == '\r' + ::Catch::Detail::stringify('\r') == "'\\r'" </Original> <Expanded> - '\r' == '\r' + "'\r'" == "'\r'" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - form_feed == '\f' + ::Catch::Detail::stringify('\f') == "'\\f'" </Original> <Expanded> - '\f' == '\f' + "'\f'" == "'\f'" </Expanded> </Expression> <OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/> @@ -3177,91 +3251,110 @@ Nor would this <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 == ' ' + ::Catch::Detail::stringify( ' ' ) == "' '" </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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == chars[i] + ::Catch::Detail::stringify( 'A' ) == "'A'" </Original> <Expanded> - 'A' == 'A' + "'A'" == "'A'" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == chars[i] + ::Catch::Detail::stringify( 'z' ) == "'z'" </Original> <Expanded> - 'Z' == 'Z' + "'z'" == "'z'" </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0" skipped="false"/> + <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> </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' + ::Catch::Detail::stringify( '\0' ) == "0" </Original> <Expanded> - 0 == 0 + "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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == i + ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" </Original> <Expanded> - 4 == 4 + "2" == "2" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == i + ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" </Original> <Expanded> - 5 == 5 + "5" == "5" </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0" skipped="false"/> + <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> </Section> <OverallResult success="true" skips="0"/> </TestCase> + <TestCase name="Clara::Arg does not crash on incomplete input" 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="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + result.type() == Catch::Clara::Detail::ResultType::Ok + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + parsed.type() == Catch::Clara::ParseResultType::NoMatch + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + parsed.remainingTokens().count() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + name.empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true" skips="0"/> + </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> @@ -4322,7 +4415,7 @@ C 101.000001 != Approx(100).epsilon(0.01) </Original> <Expanded> - 101.000001 != Approx( 100.0 ) + 101.00000099999999748 != Approx( 100.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -4400,7 +4493,7 @@ C </Expression> <OverallResult success="false" skips="0"/> </TestCase> - <TestCase name="Enums can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <TestCase name="Enums can quickly have stringification enabled using CATCH_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" @@ -4445,7 +4538,7 @@ C </Expression> <OverallResult success="true" skips="0"/> </TestCase> - <TestCase name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <TestCase name="Enums in namespaces can quickly have stringification enabled using CATCH_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" @@ -4470,7 +4563,7 @@ C 101.01 != Approx(100).epsilon(0.01) </Original> <Expanded> - 101.01 != Approx( 100.0 ) + 101.01000000000000512 != Approx( 100.0 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -4505,7 +4598,9 @@ C data.float_nine_point_one == Approx( 9.11f ) </Original> <Expanded> - 9.1f == Approx( 9.1099996567 ) + 9.100000381f +== +Approx( 9.10999965667724609 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4513,7 +4608,7 @@ C data.float_nine_point_one == Approx( 9.0f ) </Original> <Expanded> - 9.1f == Approx( 9.0 ) + 9.100000381f == Approx( 9.0 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4521,7 +4616,7 @@ C data.float_nine_point_one == Approx( 1 ) </Original> <Expanded> - 9.1f == Approx( 1.0 ) + 9.100000381f == Approx( 1.0 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4529,7 +4624,7 @@ C data.float_nine_point_one == Approx( 0 ) </Original> <Expanded> - 9.1f == Approx( 0.0 ) + 9.100000381f == Approx( 0.0 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4537,7 +4632,9 @@ C data.double_pi == Approx( 3.1415 ) </Original> <Expanded> - 3.1415926535 == Approx( 3.1415 ) + 3.14159265350000005 +== +Approx( 3.14150000000000018 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4577,7 +4674,9 @@ C x == Approx( 1.301 ) </Original> <Expanded> - 1.3 == Approx( 1.301 ) + 1.30000000000000027 +== +Approx( 1.30099999999999993 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -4596,7 +4695,9 @@ C data.float_nine_point_one == Approx( 9.1f ) </Original> <Expanded> - 9.1f == Approx( 9.1000003815 ) + 9.100000381f +== +Approx( 9.10000038146972656 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4604,7 +4705,9 @@ C data.double_pi == Approx( 3.1415926535 ) </Original> <Expanded> - 3.1415926535 == Approx( 3.1415926535 ) + 3.14159265350000005 +== +Approx( 3.14159265350000005 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4636,7 +4739,9 @@ C x == Approx( 1.3 ) </Original> <Expanded> - 1.3 == Approx( 1.3 ) + 1.30000000000000027 +== +Approx( 1.30000000000000004 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -5038,7 +5143,7 @@ C 10., WithinRel( 11.1, 0.1 ) </Original> <Expanded> - 10.0 and 11.1 are within 10% of each other + 10.0 and 11.09999999999999964 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5046,7 +5151,7 @@ C 10., !WithinRel( 11.2, 0.1 ) </Original> <Expanded> - 10.0 not and 11.2 are within 10% of each other + 10.0 not and 11.19999999999999929 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5054,7 +5159,7 @@ C 1., !WithinRel( 0., 0.99 ) </Original> <Expanded> - 1.0 not and 0 are within 99% of each other + 1.0 not and 0.0 are within 99% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5062,7 +5167,7 @@ C -0., WithinRel( 0. ) </Original> <Expanded> - -0.0 and 0 are within 2.22045e-12% of each other + -0.0 and 0.0 are within 2.22045e-12% of each other </Expanded> </Expression> <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5071,7 +5176,7 @@ C v1, WithinRel( v2 ) </Original> <Expanded> - 0.0 and 2.22507e-308 are within 2.22045e-12% of each other + 0.0 and 0.0 are within 2.22045e-12% of each other </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> @@ -5100,7 +5205,7 @@ C 0., !WithinAbs( 1., 0.99 ) </Original> <Expanded> - 0.0 not is within 0.99 of 1.0 + 0.0 not is within 0.98999999999999999 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5108,7 +5213,7 @@ C 0., !WithinAbs( 1., 0.99 ) </Original> <Expanded> - 0.0 not is within 0.99 of 1.0 + 0.0 not is within 0.98999999999999999 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5140,7 +5245,7 @@ C -10., WithinAbs( -9.6, 0.5 ) </Original> <Expanded> - -10.0 is within 0.5 of -9.6 + -10.0 is within 0.5 of -9.59999999999999964 </Expanded> </Expression> <OverallResults successes="8" failures="0" expectedFailures="0" skipped="false"/> @@ -5159,7 +5264,7 @@ C nextafter( 1., 2. ), WithinULP( 1., 1 ) </Original> <Expanded> - 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) + 1.00000000000000022 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" > @@ -5226,7 +5331,7 @@ C 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 ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) </Expanded> </Expression> <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> @@ -5302,7 +5407,7 @@ C 10.f, WithinRel( 11.1f, 0.1f ) </Original> <Expanded> - 10.0f and 11.1 are within 10% of each other + 10.0f and 11.10000038146972656 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5310,7 +5415,7 @@ C 10.f, !WithinRel( 11.2f, 0.1f ) </Original> <Expanded> - 10.0f not and 11.2 are within 10% of each other + 10.0f not and 11.19999980926513672 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5318,7 +5423,7 @@ C 1.f, !WithinRel( 0.f, 0.99f ) </Original> <Expanded> - 1.0f not and 0 are within 99% of each other + 1.0f not and 0.0 are within 99% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5326,7 +5431,7 @@ C -0.f, WithinRel( 0.f ) </Original> <Expanded> - -0.0f and 0 are within 0.00119209% of each other + -0.0f and 0.0 are within 0.00119209% of each other </Expanded> </Expression> <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5335,7 +5440,7 @@ C v1, WithinRel( v2 ) </Original> <Expanded> - 0.0f and 1.17549e-38 are within 0.00119209% of each other + 0.0f and 0.0 are within 0.00119209% of each other </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> @@ -5364,7 +5469,7 @@ C 0.f, !WithinAbs( 1.f, 0.99f ) </Original> <Expanded> - 0.0f not is within 0.9900000095 of 1.0 + 0.0f not is within 0.99000000953674316 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5372,7 +5477,7 @@ C 0.f, !WithinAbs( 1.f, 0.99f ) </Original> <Expanded> - 0.0f not is within 0.9900000095 of 1.0 + 0.0f not is within 0.99000000953674316 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5412,7 +5517,7 @@ C -10.f, WithinAbs( -9.6f, 0.5f ) </Original> <Expanded> - -10.0f is within 0.5 of -9.6000003815 + -10.0f is within 0.5 of -9.60000038146972656 </Expanded> </Expression> <OverallResults successes="9" failures="0" expectedFailures="0" skipped="false"/> @@ -5439,7 +5544,7 @@ C 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]) + 1.000000119f 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" > @@ -5506,7 +5611,7 @@ C 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 ) + 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.0 are within 10% of each other ) </Expanded> </Expression> <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> @@ -7306,7 +7411,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.9 == Approx( -0.9 ) + -0.90000000000000002 +== +Approx( -0.90000000000000002 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7328,7 +7435,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.8 == Approx( -0.8 ) + -0.80000000000000004 +== +Approx( -0.80000000000000004 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7350,7 +7459,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.7 == Approx( -0.7 ) + -0.70000000000000007 +== +Approx( -0.70000000000000007 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7372,7 +7483,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.6 == Approx( -0.6 ) + -0.60000000000000009 +== +Approx( -0.60000000000000009 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7394,7 +7507,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.5 == Approx( -0.5 ) + -0.50000000000000011 +== +Approx( -0.50000000000000011 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7416,7 +7531,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.4 == Approx( -0.4 ) + -0.40000000000000013 +== +Approx( -0.40000000000000013 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7438,7 +7555,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.3 == Approx( -0.3 ) + -0.30000000000000016 +== +Approx( -0.30000000000000016 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7460,7 +7579,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.2 == Approx( -0.2 ) + -0.20000000000000015 +== +Approx( -0.20000000000000015 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7482,7 +7603,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.1 == Approx( -0.1 ) + -0.10000000000000014 +== +Approx( -0.10000000000000014 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7504,7 +7627,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.0 == Approx( -0.0 ) + -0.00000000000000014 +== +Approx( -0.00000000000000014 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7526,7 +7651,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.1 == Approx( 0.1 ) + 0.09999999999999987 +== +Approx( 0.09999999999999987 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7548,7 +7675,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.2 == Approx( 0.2 ) + 0.19999999999999987 +== +Approx( 0.19999999999999987 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7570,7 +7699,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.3 == Approx( 0.3 ) + 0.29999999999999988 +== +Approx( 0.29999999999999988 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7592,7 +7723,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.4 == Approx( 0.4 ) + 0.39999999999999991 +== +Approx( 0.39999999999999991 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7614,7 +7747,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.5 == Approx( 0.5 ) + 0.49999999999999989 +== +Approx( 0.49999999999999989 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7636,7 +7771,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.6 == Approx( 0.6 ) + 0.59999999999999987 +== +Approx( 0.59999999999999987 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7658,7 +7795,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.7 == Approx( 0.7 ) + 0.69999999999999984 +== +Approx( 0.69999999999999984 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7680,7 +7819,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.8 == Approx( 0.8 ) + 0.79999999999999982 +== +Approx( 0.79999999999999982 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7702,7 +7843,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.9 == Approx( 0.9 ) + 0.8999999999999998 +== +Approx( 0.8999999999999998 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7721,7 +7864,7 @@ C gen.get() == Approx( rangeEnd ) </Original> <Expanded> - 1.0 == Approx( 1.0 ) + 0.99999999999999978 == Approx( 1.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7774,7 +7917,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.7 == Approx( -0.7 ) + -0.69999999999999996 +== +Approx( -0.69999999999999996 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7796,7 +7941,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.4 == Approx( -0.4 ) + -0.39999999999999997 +== +Approx( -0.39999999999999997 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7818,7 +7965,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.1 == Approx( -0.1 ) + -0.09999999999999998 +== +Approx( -0.09999999999999998 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7840,7 +7989,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.2 == Approx( 0.2 ) + 0.20000000000000001 +== +Approx( 0.20000000000000001 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7926,7 +8077,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.7 == Approx( -0.7 ) + -0.69999999999999996 +== +Approx( -0.69999999999999996 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7948,7 +8101,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.4 == Approx( -0.4 ) + -0.39999999999999997 +== +Approx( -0.39999999999999997 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7970,7 +8125,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.1 == Approx( -0.1 ) + -0.09999999999999998 +== +Approx( -0.09999999999999998 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7992,7 +8149,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.2 == Approx( 0.2 ) + 0.20000000000000001 +== +Approx( 0.20000000000000001 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -8296,7 +8455,9 @@ C d >= Approx( 1.22 ) </Original> <Expanded> - 1.23 >= Approx( 1.22 ) + 1.22999999999999998 +>= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -8304,7 +8465,9 @@ C d >= Approx( 1.23 ) </Original> <Expanded> - 1.23 >= Approx( 1.23 ) + 1.22999999999999998 +>= +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -8312,7 +8475,9 @@ C !(d >= Approx( 1.24 )) </Original> <Expanded> - !(1.23 >= Approx( 1.24 )) + !(1.22999999999999998 +>= +Approx( 1.23999999999999999 )) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -8320,7 +8485,9 @@ C d >= Approx( 1.24 ).epsilon(0.1) </Original> <Expanded> - 1.23 >= Approx( 1.24 ) + 1.22999999999999998 +>= +Approx( 1.23999999999999999 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -8694,7 +8861,9 @@ C data.float_nine_point_one != Approx( 9.1f ) </Original> <Expanded> - 9.1f != Approx( 9.1000003815 ) + 9.100000381f +!= +Approx( 9.10000038146972656 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8702,7 +8871,9 @@ C data.double_pi != Approx( 3.1415926535 ) </Original> <Expanded> - 3.1415926535 != Approx( 3.1415926535 ) + 3.14159265350000005 +!= +Approx( 3.14159265350000005 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8745,7 +8916,9 @@ C data.float_nine_point_one != Approx( 9.11f ) </Original> <Expanded> - 9.1f != Approx( 9.1099996567 ) + 9.100000381f +!= +Approx( 9.10999965667724609 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8753,7 +8926,7 @@ C data.float_nine_point_one != Approx( 9.0f ) </Original> <Expanded> - 9.1f != Approx( 9.0 ) + 9.100000381f != Approx( 9.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8761,7 +8934,7 @@ C data.float_nine_point_one != Approx( 1 ) </Original> <Expanded> - 9.1f != Approx( 1.0 ) + 9.100000381f != Approx( 1.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8769,7 +8942,7 @@ C data.float_nine_point_one != Approx( 0 ) </Original> <Expanded> - 9.1f != Approx( 0.0 ) + 9.100000381f != Approx( 0.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8777,7 +8950,9 @@ C data.double_pi != Approx( 3.1415 ) </Original> <Expanded> - 3.1415926535 != Approx( 3.1415 ) + 3.14159265350000005 +!= +Approx( 3.14150000000000018 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9102,7 +9277,9 @@ C d <= Approx( 1.24 ) </Original> <Expanded> - 1.23 <= Approx( 1.24 ) + 1.22999999999999998 +<= +Approx( 1.23999999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -9110,7 +9287,9 @@ C d <= Approx( 1.23 ) </Original> <Expanded> - 1.23 <= Approx( 1.23 ) + 1.22999999999999998 +<= +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -9118,7 +9297,9 @@ C !(d <= Approx( 1.22 )) </Original> <Expanded> - !(1.23 <= Approx( 1.22 )) + !(1.22999999999999998 +<= +Approx( 1.21999999999999997 )) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -9126,7 +9307,9 @@ C d <= Approx( 1.22 ).epsilon(0.1) </Original> <Expanded> - 1.23 <= Approx( 1.22 ) + 1.22999999999999998 +<= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -9657,7 +9840,7 @@ C data.float_nine_point_one < 9 </Original> <Expanded> - 9.1f < 9 + 9.100000381f < 9 </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9665,7 +9848,7 @@ C data.float_nine_point_one > 10 </Original> <Expanded> - 9.1f > 10 + 9.100000381f > 10 </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9673,7 +9856,7 @@ C data.float_nine_point_one > 9.2 </Original> <Expanded> - 9.1f > 9.2 + 9.100000381f > 9.19999999999999929 </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9812,7 +9995,7 @@ C data.float_nine_point_one > 9 </Original> <Expanded> - 9.1f > 9 + 9.100000381f > 9 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9820,7 +10003,7 @@ C data.float_nine_point_one < 10 </Original> <Expanded> - 9.1f < 10 + 9.100000381f < 10 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9828,7 +10011,7 @@ C data.float_nine_point_one < 9.2 </Original> <Expanded> - 9.1f < 9.2 + 9.100000381f < 9.19999999999999929 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -11563,7 +11746,9 @@ C config.benchmarkConfidenceInterval == Catch::Approx(0.99) </Original> <Expanded> - 0.99 == Approx( 0.99 ) + 0.98999999999999999 +== +Approx( 0.98999999999999999 ) </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> @@ -12709,7 +12894,9 @@ A string sent to stderr via clog d == Approx( 1.23 ) </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12717,7 +12904,9 @@ A string sent to stderr via clog d != Approx( 1.22 ) </Original> <Expanded> - 1.23 != Approx( 1.22 ) + 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12725,7 +12914,9 @@ A string sent to stderr via clog d != Approx( 1.24 ) </Original> <Expanded> - 1.23 != Approx( 1.24 ) + 1.22999999999999998 +!= +Approx( 1.23999999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12733,7 +12924,9 @@ A string sent to stderr via clog d == 1.23_a </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12741,7 +12934,9 @@ A string sent to stderr via clog d != 1.22_a </Original> <Expanded> - 1.23 != Approx( 1.22 ) + 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12749,7 +12944,9 @@ A string sent to stderr via clog Approx( d ) == 1.23 </Original> <Expanded> - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) +== +1.22999999999999998 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12757,7 +12954,9 @@ A string sent to stderr via clog Approx( d ) != 1.22 </Original> <Expanded> - Approx( 1.23 ) != 1.22 + Approx( 1.22999999999999998 ) +!= +1.21999999999999997 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12765,7 +12964,9 @@ A string sent to stderr via clog Approx( d ) != 1.24 </Original> <Expanded> - Approx( 1.23 ) != 1.24 + Approx( 1.22999999999999998 ) +!= +1.23999999999999999 </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13592,10 +13793,10 @@ Message from section two <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 + std::is_default_constructible<TestType>::value </Original> <Expanded> - 1 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13603,10 +13804,10 @@ Message from section two <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 + std::is_default_constructible<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13614,10 +13815,10 @@ Message from section two <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 + std::is_trivially_copyable<TestType>::value </Original> <Expanded> - 1 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13625,10 +13826,10 @@ Message from section two <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 + std::is_trivially_copyable<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13636,10 +13837,10 @@ Message from section two <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 + std::is_arithmetic<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13647,10 +13848,10 @@ Message from section two <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 + std::is_arithmetic<TestType>::value </Original> <Expanded> - 1 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13658,10 +13859,10 @@ Message from section two <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 + std::is_arithmetic<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -15955,7 +16156,7 @@ There is no extra whitespace here </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 + 3.14000000000000012 </Exception> <OverallResult success="false" skips="0"/> </TestCase> @@ -17182,6 +17383,25 @@ There is no extra whitespace here </Expression> <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> </Section> + <Section name="Compare against std::initializer_list" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, RangeEquals( { 1, 2, 3 } ) + </Original> + <Expanded> + { 1, 2, 3 } elements are { 1, 2, 3 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) + </Original> + <Expanded> + { 1, 2, 3 } elements are { 2, 4, 6 } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> <Section name="Check short-circuiting behaviour" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Section name="Check short-circuits on failure" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > @@ -17408,6 +17628,25 @@ There is no extra whitespace here </Expression> <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> </Section> + <Section name="Compare against std::initializer_list" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, UnorderedRangeEquals( { 10, 20, 1 } ) + </Original> + <Expanded> + { 1, 10, 20 } unordered elements are { 10, 20, 1 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) + </Original> + <Expanded> + { 1, 10, 20 } unordered elements are { 11, 21, 2 } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> <OverallResult success="true" skips="0"/> </TestCase> <TestCase name="Usage of the SizeIs range matcher" tags="[matchers][size][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > @@ -17500,7 +17739,9 @@ There is no extra whitespace here d == approx( 1.23 ) </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17508,7 +17749,9 @@ There is no extra whitespace here d == approx( 1.22 ) </Original> <Expanded> - 1.23 == Approx( 1.22 ) + 1.22999999999999998 +== +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17516,7 +17759,9 @@ There is no extra whitespace here d == approx( 1.24 ) </Original> <Expanded> - 1.23 == Approx( 1.24 ) + 1.22999999999999998 +== +Approx( 1.23999999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17524,7 +17769,7 @@ There is no extra whitespace here d != approx( 1.25 ) </Original> <Expanded> - 1.23 != Approx( 1.25 ) + 1.22999999999999998 != Approx( 1.25 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17532,7 +17777,9 @@ There is no extra whitespace here approx( d ) == 1.23 </Original> <Expanded> - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) +== +1.22999999999999998 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17540,7 +17787,9 @@ There is no extra whitespace here approx( d ) == 1.22 </Original> <Expanded> - Approx( 1.23 ) == 1.22 + Approx( 1.22999999999999998 ) +== +1.21999999999999997 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17548,7 +17797,9 @@ There is no extra whitespace here approx( d ) == 1.24 </Original> <Expanded> - Approx( 1.23 ) == 1.24 + Approx( 1.22999999999999998 ) +== +1.23999999999999999 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17556,7 +17807,7 @@ There is no extra whitespace here approx( d ) != 1.25 </Original> <Expanded> - Approx( 1.23 ) != 1.25 + Approx( 1.22999999999999998 ) != 1.25 </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -19008,7 +19259,9 @@ There is no extra whitespace here erfc_inv(1.103560) == Approx(-0.09203687623843015) </Original> <Expanded> - -0.0920368762 == Approx( -0.0920368762 ) + -0.09203687623843014 +== +Approx( -0.09203687623843015 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19016,7 +19269,9 @@ There is no extra whitespace here erfc_inv(1.067400) == Approx(-0.05980291115763361) </Original> <Expanded> - -0.0598029112 == Approx( -0.0598029112 ) + -0.05980291115763361 +== +Approx( -0.05980291115763361 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19024,7 +19279,9 @@ There is no extra whitespace here erfc_inv(0.050000) == Approx(1.38590382434967796) </Original> <Expanded> - 1.3859038243 == Approx( 1.3859038243 ) + 1.38590382434967774 +== +Approx( 1.38590382434967796 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -19615,56 +19872,15 @@ b1! </Expression> <OverallResult success="true" skips="0"/> </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" skips="0"/> - </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 ) + 0.13015979861484195 +== +Approx( 0.13015979861484198 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19672,7 +19888,9 @@ b1! normal_quantile(0.533700) == Approx(0.08457408802851875) </Original> <Expanded> - 0.084574088 == Approx( 0.084574088 ) + 0.08457408802851875 +== +Approx( 0.08457408802851875 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19680,7 +19898,9 @@ b1! normal_quantile(0.025000) == Approx(-1.95996398454005449) </Original> <Expanded> - -1.9599639845 == Approx( -1.9599639845 ) + -1.95996398454005405 +== +Approx( -1.95996398454005449 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -20066,6 +20286,50 @@ b1! </Expression> <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> </Section> + <Section name="no replace in already-replaced string" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Section name="lengthening" 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", "cc") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + letters == "abccdefccg" + </Original> + <Expanded> + "abccdefccg" == "abccdefccg" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <Section name="no replace in already-replaced string" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Section name="shortening" 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 == "--" + </Original> + <Expanded> + "--" == "--" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </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> @@ -21046,18 +21310,18 @@ b1! <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)) + "1.5f" == ::Catch::Detail::stringify(float(1.5)) </Original> <Expanded> - "1.2f" == "1.2f" + "1.5f" == "1.5f" </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}) + "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) </Original> <Expanded> - "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + "{ 1.5f, 0 }" == "{ 1.5f, 0 }" </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -21089,12 +21353,12 @@ b1! <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) + "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) </Original> <Expanded> - "{ { 42 }, { }, 1.2f }" + "{ { 42 }, { }, 1.5f }" == -"{ { 42 }, { }, 1.2f }" +"{ { 42 }, { }, 1.5f }" </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -21129,7 +21393,7 @@ b1! e.confidence_interval == 0.95 </Original> <Expanded> - 0.95 == 0.95 + 0.94999999999999996 == 0.94999999999999996 </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -21707,6 +21971,6 @@ b1! </Section> <OverallResult success="true" skips="0"/> </TestCase> - <OverallResults successes="2079" failures="146" expectedFailures="35" skips="12"/> - <OverallResultsCases successes="312" failures="85" expectedFailures="14" skips="6"/> + <OverallResults successes="2087" failures="147" expectedFailures="35" skips="12"/> + <OverallResultsCases successes="313" failures="86" expectedFailures="14" skips="6"/> </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 index 08ff6c437..7f3b4984d 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -2056,6 +2056,56 @@ Nor would this </Expression> <OverallResult success="true" skips="0"/> </TestCase> + <TestCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that fails" tags="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Section name="First partial run" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a++ == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <Section name="Second partial run" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <OverallResults successes="0" failures="1" expectedFailures="0" skipped="false"/> + </Section> + <OverallResult success="false" skips="0"/> + </TestCase> + <TestCase name="A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds" tags="[class]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Section name="First partial run" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a++ == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <Section name="Second partial run" 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> + <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <OverallResult success="true" skips="0"/> + </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> @@ -2150,7 +2200,9 @@ Nor would this d == 1.23_a </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2158,7 +2210,9 @@ Nor would this d != 1.22_a </Original> <Expanded> - 1.23 != Approx( 1.22 ) + 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2166,7 +2220,9 @@ Nor would this -d == -1.23_a </Original> <Expanded> - -1.23 == Approx( -1.23 ) + -1.22999999999999998 +== +Approx( -1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2174,7 +2230,9 @@ Nor would this d == 1.2_a .epsilon(.1) </Original> <Expanded> - 1.23 == Approx( 1.2 ) + 1.22999999999999998 +== +Approx( 1.19999999999999996 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2182,7 +2240,9 @@ Nor would this d != 1.2_a .epsilon(.001) </Original> <Expanded> - 1.23 != Approx( 1.2 ) + 1.22999999999999998 +!= +Approx( 1.19999999999999996 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2190,7 +2250,7 @@ Nor would this d == 1_a .epsilon(.3) </Original> <Expanded> - 1.23 == Approx( 1.0 ) + 1.22999999999999998 == Approx( 1.0 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2264,7 +2324,7 @@ Nor would this 100.3 != Approx(100.0) </Original> <Expanded> - 100.3 != Approx( 100.0 ) + 100.29999999999999716 != Approx( 100.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2272,7 +2332,7 @@ Nor would this 100.3 == Approx(100.0).margin(0.5) </Original> <Expanded> - 100.3 == Approx( 100.0 ) + 100.29999999999999716 == Approx( 100.0 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2432,7 +2492,9 @@ Nor would this divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) </Original> <Expanded> - 3.1428571429 == Approx( 3.141 ) + 3.14285714285714279 +== +Approx( 3.14100000000000001 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2440,7 +2502,9 @@ Nor would this divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) </Original> <Expanded> - 3.1428571429 != Approx( 3.141 ) + 3.14285714285714279 +!= +Approx( 3.14100000000000001 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2451,7 +2515,9 @@ Nor would this d != Approx( 1.231 ) </Original> <Expanded> - 1.23 != Approx( 1.231 ) + 1.22999999999999998 +!= +Approx( 1.23100000000000009 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2459,7 +2525,9 @@ Nor would this d == Approx( 1.231 ).epsilon( 0.1 ) </Original> <Expanded> - 1.23 == Approx( 1.231 ) + 1.22999999999999998 +== +Approx( 1.23100000000000009 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -2470,7 +2538,9 @@ Nor would this 1.23f == Approx( 1.23f ) </Original> <Expanded> - 1.23f == Approx( 1.2300000191 ) + 1.230000019f +== +Approx( 1.23000001907348633 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2532,7 +2602,9 @@ Nor would this 1.234f == Approx( dMedium ) </Original> <Expanded> - 1.234f == Approx( 1.234 ) + 1.233999968f +== +Approx( 1.23399999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -2540,7 +2612,9 @@ Nor would this dMedium == Approx( 1.234f ) </Original> <Expanded> - 1.234 == Approx( 1.2339999676 ) + 1.23399999999999999 +== +Approx( 1.23399996757507324 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -3142,34 +3216,34 @@ Nor would this <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' + ::Catch::Detail::stringify('\t') == "'\\t'" </Original> <Expanded> - '\t' == '\t' + "'\t'" == "'\t'" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - newline == '\n' + ::Catch::Detail::stringify('\n') == "'\\n'" </Original> <Expanded> - '\n' == '\n' + "'\n'" == "'\n'" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - carr_return == '\r' + ::Catch::Detail::stringify('\r') == "'\\r'" </Original> <Expanded> - '\r' == '\r' + "'\r'" == "'\r'" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - form_feed == '\f' + ::Catch::Detail::stringify('\f') == "'\\f'" </Original> <Expanded> - '\f' == '\f' + "'\f'" == "'\f'" </Expanded> </Expression> <OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/> @@ -3177,91 +3251,110 @@ Nor would this <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 == ' ' + ::Catch::Detail::stringify( ' ' ) == "' '" </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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == chars[i] + ::Catch::Detail::stringify( 'A' ) == "'A'" </Original> <Expanded> - 'A' == 'A' + "'A'" == "'A'" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == chars[i] + ::Catch::Detail::stringify( 'z' ) == "'z'" </Original> <Expanded> - 'Z' == 'Z' + "'z'" == "'z'" </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0" skipped="false"/> + <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> </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' + ::Catch::Detail::stringify( '\0' ) == "0" </Original> <Expanded> - 0 == 0 + "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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == i + ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" </Original> <Expanded> - 4 == 4 + "2" == "2" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - c == i + ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" </Original> <Expanded> - 5 == 5 + "5" == "5" </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0" skipped="false"/> + <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> </Section> <OverallResult success="true" skips="0"/> </TestCase> + <TestCase name="Clara::Arg does not crash on incomplete input" 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="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + result.type() == Catch::Clara::Detail::ResultType::Ok + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + parsed.type() == Catch::Clara::ParseResultType::NoMatch + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + parsed.remainingTokens().count() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + name.empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true" skips="0"/> + </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> @@ -4322,7 +4415,7 @@ C 101.000001 != Approx(100).epsilon(0.01) </Original> <Expanded> - 101.000001 != Approx( 100.0 ) + 101.00000099999999748 != Approx( 100.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -4400,7 +4493,7 @@ C </Expression> <OverallResult success="false" skips="0"/> </TestCase> - <TestCase name="Enums can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <TestCase name="Enums can quickly have stringification enabled using CATCH_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" @@ -4445,7 +4538,7 @@ C </Expression> <OverallResult success="true" skips="0"/> </TestCase> - <TestCase name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <TestCase name="Enums in namespaces can quickly have stringification enabled using CATCH_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" @@ -4470,7 +4563,7 @@ C 101.01 != Approx(100).epsilon(0.01) </Original> <Expanded> - 101.01 != Approx( 100.0 ) + 101.01000000000000512 != Approx( 100.0 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -4505,7 +4598,9 @@ C data.float_nine_point_one == Approx( 9.11f ) </Original> <Expanded> - 9.1f == Approx( 9.1099996567 ) + 9.100000381f +== +Approx( 9.10999965667724609 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4513,7 +4608,7 @@ C data.float_nine_point_one == Approx( 9.0f ) </Original> <Expanded> - 9.1f == Approx( 9.0 ) + 9.100000381f == Approx( 9.0 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4521,7 +4616,7 @@ C data.float_nine_point_one == Approx( 1 ) </Original> <Expanded> - 9.1f == Approx( 1.0 ) + 9.100000381f == Approx( 1.0 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4529,7 +4624,7 @@ C data.float_nine_point_one == Approx( 0 ) </Original> <Expanded> - 9.1f == Approx( 0.0 ) + 9.100000381f == Approx( 0.0 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4537,7 +4632,9 @@ C data.double_pi == Approx( 3.1415 ) </Original> <Expanded> - 3.1415926535 == Approx( 3.1415 ) + 3.14159265350000005 +== +Approx( 3.14150000000000018 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4577,7 +4674,9 @@ C x == Approx( 1.301 ) </Original> <Expanded> - 1.3 == Approx( 1.301 ) + 1.30000000000000027 +== +Approx( 1.30099999999999993 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -4596,7 +4695,9 @@ C data.float_nine_point_one == Approx( 9.1f ) </Original> <Expanded> - 9.1f == Approx( 9.1000003815 ) + 9.100000381f +== +Approx( 9.10000038146972656 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4604,7 +4705,9 @@ C data.double_pi == Approx( 3.1415926535 ) </Original> <Expanded> - 3.1415926535 == Approx( 3.1415926535 ) + 3.14159265350000005 +== +Approx( 3.14159265350000005 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -4636,7 +4739,9 @@ C x == Approx( 1.3 ) </Original> <Expanded> - 1.3 == Approx( 1.3 ) + 1.30000000000000027 +== +Approx( 1.30000000000000004 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -5038,7 +5143,7 @@ C 10., WithinRel( 11.1, 0.1 ) </Original> <Expanded> - 10.0 and 11.1 are within 10% of each other + 10.0 and 11.09999999999999964 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5046,7 +5151,7 @@ C 10., !WithinRel( 11.2, 0.1 ) </Original> <Expanded> - 10.0 not and 11.2 are within 10% of each other + 10.0 not and 11.19999999999999929 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5054,7 +5159,7 @@ C 1., !WithinRel( 0., 0.99 ) </Original> <Expanded> - 1.0 not and 0 are within 99% of each other + 1.0 not and 0.0 are within 99% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5062,7 +5167,7 @@ C -0., WithinRel( 0. ) </Original> <Expanded> - -0.0 and 0 are within 2.22045e-12% of each other + -0.0 and 0.0 are within 2.22045e-12% of each other </Expanded> </Expression> <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5071,7 +5176,7 @@ C v1, WithinRel( v2 ) </Original> <Expanded> - 0.0 and 2.22507e-308 are within 2.22045e-12% of each other + 0.0 and 0.0 are within 2.22045e-12% of each other </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> @@ -5100,7 +5205,7 @@ C 0., !WithinAbs( 1., 0.99 ) </Original> <Expanded> - 0.0 not is within 0.99 of 1.0 + 0.0 not is within 0.98999999999999999 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5108,7 +5213,7 @@ C 0., !WithinAbs( 1., 0.99 ) </Original> <Expanded> - 0.0 not is within 0.99 of 1.0 + 0.0 not is within 0.98999999999999999 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5140,7 +5245,7 @@ C -10., WithinAbs( -9.6, 0.5 ) </Original> <Expanded> - -10.0 is within 0.5 of -9.6 + -10.0 is within 0.5 of -9.59999999999999964 </Expanded> </Expression> <OverallResults successes="8" failures="0" expectedFailures="0" skipped="false"/> @@ -5159,7 +5264,7 @@ C nextafter( 1., 2. ), WithinULP( 1., 1 ) </Original> <Expanded> - 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) + 1.00000000000000022 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" > @@ -5226,7 +5331,7 @@ C 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 ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) </Expanded> </Expression> <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> @@ -5302,7 +5407,7 @@ C 10.f, WithinRel( 11.1f, 0.1f ) </Original> <Expanded> - 10.0f and 11.1 are within 10% of each other + 10.0f and 11.10000038146972656 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5310,7 +5415,7 @@ C 10.f, !WithinRel( 11.2f, 0.1f ) </Original> <Expanded> - 10.0f not and 11.2 are within 10% of each other + 10.0f not and 11.19999980926513672 are within 10% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5318,7 +5423,7 @@ C 1.f, !WithinRel( 0.f, 0.99f ) </Original> <Expanded> - 1.0f not and 0 are within 99% of each other + 1.0f not and 0.0 are within 99% of each other </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5326,7 +5431,7 @@ C -0.f, WithinRel( 0.f ) </Original> <Expanded> - -0.0f and 0 are within 0.00119209% of each other + -0.0f and 0.0 are within 0.00119209% of each other </Expanded> </Expression> <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5335,7 +5440,7 @@ C v1, WithinRel( v2 ) </Original> <Expanded> - 0.0f and 1.17549e-38 are within 0.00119209% of each other + 0.0f and 0.0 are within 0.00119209% of each other </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> @@ -5364,7 +5469,7 @@ C 0.f, !WithinAbs( 1.f, 0.99f ) </Original> <Expanded> - 0.0f not is within 0.9900000095 of 1.0 + 0.0f not is within 0.99000000953674316 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5372,7 +5477,7 @@ C 0.f, !WithinAbs( 1.f, 0.99f ) </Original> <Expanded> - 0.0f not is within 0.9900000095 of 1.0 + 0.0f not is within 0.99000000953674316 of 1.0 </Expanded> </Expression> <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > @@ -5412,7 +5517,7 @@ C -10.f, WithinAbs( -9.6f, 0.5f ) </Original> <Expanded> - -10.0f is within 0.5 of -9.6000003815 + -10.0f is within 0.5 of -9.60000038146972656 </Expanded> </Expression> <OverallResults successes="9" failures="0" expectedFailures="0" skipped="false"/> @@ -5439,7 +5544,7 @@ C 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]) + 1.000000119f 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" > @@ -5506,7 +5611,7 @@ C 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 ) + 0.0001f ( is within 0.00100000004749745 of 0.0 or and 0.0 are within 10% of each other ) </Expanded> </Expression> <OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/> @@ -7306,7 +7411,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.9 == Approx( -0.9 ) + -0.90000000000000002 +== +Approx( -0.90000000000000002 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7328,7 +7435,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.8 == Approx( -0.8 ) + -0.80000000000000004 +== +Approx( -0.80000000000000004 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7350,7 +7459,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.7 == Approx( -0.7 ) + -0.70000000000000007 +== +Approx( -0.70000000000000007 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7372,7 +7483,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.6 == Approx( -0.6 ) + -0.60000000000000009 +== +Approx( -0.60000000000000009 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7394,7 +7507,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.5 == Approx( -0.5 ) + -0.50000000000000011 +== +Approx( -0.50000000000000011 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7416,7 +7531,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.4 == Approx( -0.4 ) + -0.40000000000000013 +== +Approx( -0.40000000000000013 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7438,7 +7555,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.3 == Approx( -0.3 ) + -0.30000000000000016 +== +Approx( -0.30000000000000016 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7460,7 +7579,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.2 == Approx( -0.2 ) + -0.20000000000000015 +== +Approx( -0.20000000000000015 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7482,7 +7603,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.1 == Approx( -0.1 ) + -0.10000000000000014 +== +Approx( -0.10000000000000014 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7504,7 +7627,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.0 == Approx( -0.0 ) + -0.00000000000000014 +== +Approx( -0.00000000000000014 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7526,7 +7651,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.1 == Approx( 0.1 ) + 0.09999999999999987 +== +Approx( 0.09999999999999987 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7548,7 +7675,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.2 == Approx( 0.2 ) + 0.19999999999999987 +== +Approx( 0.19999999999999987 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7570,7 +7699,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.3 == Approx( 0.3 ) + 0.29999999999999988 +== +Approx( 0.29999999999999988 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7592,7 +7723,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.4 == Approx( 0.4 ) + 0.39999999999999991 +== +Approx( 0.39999999999999991 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7614,7 +7747,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.5 == Approx( 0.5 ) + 0.49999999999999989 +== +Approx( 0.49999999999999989 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7636,7 +7771,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.6 == Approx( 0.6 ) + 0.59999999999999987 +== +Approx( 0.59999999999999987 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7658,7 +7795,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.7 == Approx( 0.7 ) + 0.69999999999999984 +== +Approx( 0.69999999999999984 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7680,7 +7819,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.8 == Approx( 0.8 ) + 0.79999999999999982 +== +Approx( 0.79999999999999982 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7702,7 +7843,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.9 == Approx( 0.9 ) + 0.8999999999999998 +== +Approx( 0.8999999999999998 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7721,7 +7864,7 @@ C gen.get() == Approx( rangeEnd ) </Original> <Expanded> - 1.0 == Approx( 1.0 ) + 0.99999999999999978 == Approx( 1.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7774,7 +7917,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.7 == Approx( -0.7 ) + -0.69999999999999996 +== +Approx( -0.69999999999999996 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7796,7 +7941,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.4 == Approx( -0.4 ) + -0.39999999999999997 +== +Approx( -0.39999999999999997 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7818,7 +7965,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.1 == Approx( -0.1 ) + -0.09999999999999998 +== +Approx( -0.09999999999999998 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7840,7 +7989,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.2 == Approx( 0.2 ) + 0.20000000000000001 +== +Approx( 0.20000000000000001 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7926,7 +8077,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.7 == Approx( -0.7 ) + -0.69999999999999996 +== +Approx( -0.69999999999999996 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7948,7 +8101,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.4 == Approx( -0.4 ) + -0.39999999999999997 +== +Approx( -0.39999999999999997 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7970,7 +8125,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - -0.1 == Approx( -0.1 ) + -0.09999999999999998 +== +Approx( -0.09999999999999998 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -7992,7 +8149,9 @@ C gen.get() == Approx(expected) </Original> <Expanded> - 0.2 == Approx( 0.2 ) + 0.20000000000000001 +== +Approx( 0.20000000000000001 ) </Expanded> </Expression> <Info filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > @@ -8296,7 +8455,9 @@ C d >= Approx( 1.22 ) </Original> <Expanded> - 1.23 >= Approx( 1.22 ) + 1.22999999999999998 +>= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -8304,7 +8465,9 @@ C d >= Approx( 1.23 ) </Original> <Expanded> - 1.23 >= Approx( 1.23 ) + 1.22999999999999998 +>= +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -8312,7 +8475,9 @@ C !(d >= Approx( 1.24 )) </Original> <Expanded> - !(1.23 >= Approx( 1.24 )) + !(1.22999999999999998 +>= +Approx( 1.23999999999999999 )) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -8320,7 +8485,9 @@ C d >= Approx( 1.24 ).epsilon(0.1) </Original> <Expanded> - 1.23 >= Approx( 1.24 ) + 1.22999999999999998 +>= +Approx( 1.23999999999999999 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -8694,7 +8861,9 @@ C data.float_nine_point_one != Approx( 9.1f ) </Original> <Expanded> - 9.1f != Approx( 9.1000003815 ) + 9.100000381f +!= +Approx( 9.10000038146972656 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8702,7 +8871,9 @@ C data.double_pi != Approx( 3.1415926535 ) </Original> <Expanded> - 3.1415926535 != Approx( 3.1415926535 ) + 3.14159265350000005 +!= +Approx( 3.14159265350000005 ) </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8745,7 +8916,9 @@ C data.float_nine_point_one != Approx( 9.11f ) </Original> <Expanded> - 9.1f != Approx( 9.1099996567 ) + 9.100000381f +!= +Approx( 9.10999965667724609 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8753,7 +8926,7 @@ C data.float_nine_point_one != Approx( 9.0f ) </Original> <Expanded> - 9.1f != Approx( 9.0 ) + 9.100000381f != Approx( 9.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8761,7 +8934,7 @@ C data.float_nine_point_one != Approx( 1 ) </Original> <Expanded> - 9.1f != Approx( 1.0 ) + 9.100000381f != Approx( 1.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8769,7 +8942,7 @@ C data.float_nine_point_one != Approx( 0 ) </Original> <Expanded> - 9.1f != Approx( 0.0 ) + 9.100000381f != Approx( 0.0 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -8777,7 +8950,9 @@ C data.double_pi != Approx( 3.1415 ) </Original> <Expanded> - 3.1415926535 != Approx( 3.1415 ) + 3.14159265350000005 +!= +Approx( 3.14150000000000018 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9102,7 +9277,9 @@ C d <= Approx( 1.24 ) </Original> <Expanded> - 1.23 <= Approx( 1.24 ) + 1.22999999999999998 +<= +Approx( 1.23999999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -9110,7 +9287,9 @@ C d <= Approx( 1.23 ) </Original> <Expanded> - 1.23 <= Approx( 1.23 ) + 1.22999999999999998 +<= +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -9118,7 +9297,9 @@ C !(d <= Approx( 1.22 )) </Original> <Expanded> - !(1.23 <= Approx( 1.22 )) + !(1.22999999999999998 +<= +Approx( 1.21999999999999997 )) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -9126,7 +9307,9 @@ C d <= Approx( 1.22 ).epsilon(0.1) </Original> <Expanded> - 1.23 <= Approx( 1.22 ) + 1.22999999999999998 +<= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -9657,7 +9840,7 @@ C data.float_nine_point_one < 9 </Original> <Expanded> - 9.1f < 9 + 9.100000381f < 9 </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9665,7 +9848,7 @@ C data.float_nine_point_one > 10 </Original> <Expanded> - 9.1f > 10 + 9.100000381f > 10 </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9673,7 +9856,7 @@ C data.float_nine_point_one > 9.2 </Original> <Expanded> - 9.1f > 9.2 + 9.100000381f > 9.19999999999999929 </Expanded> </Expression> <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9812,7 +9995,7 @@ C data.float_nine_point_one > 9 </Original> <Expanded> - 9.1f > 9 + 9.100000381f > 9 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9820,7 +10003,7 @@ C data.float_nine_point_one < 10 </Original> <Expanded> - 9.1f < 10 + 9.100000381f < 10 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -9828,7 +10011,7 @@ C data.float_nine_point_one < 9.2 </Original> <Expanded> - 9.1f < 9.2 + 9.100000381f < 9.19999999999999929 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > @@ -11563,7 +11746,9 @@ C config.benchmarkConfidenceInterval == Catch::Approx(0.99) </Original> <Expanded> - 0.99 == Approx( 0.99 ) + 0.98999999999999999 +== +Approx( 0.98999999999999999 ) </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> @@ -12709,7 +12894,9 @@ A string sent to stderr via clog d == Approx( 1.23 ) </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12717,7 +12904,9 @@ A string sent to stderr via clog d != Approx( 1.22 ) </Original> <Expanded> - 1.23 != Approx( 1.22 ) + 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12725,7 +12914,9 @@ A string sent to stderr via clog d != Approx( 1.24 ) </Original> <Expanded> - 1.23 != Approx( 1.24 ) + 1.22999999999999998 +!= +Approx( 1.23999999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12733,7 +12924,9 @@ A string sent to stderr via clog d == 1.23_a </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12741,7 +12934,9 @@ A string sent to stderr via clog d != 1.22_a </Original> <Expanded> - 1.23 != Approx( 1.22 ) + 1.22999999999999998 +!= +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12749,7 +12944,9 @@ A string sent to stderr via clog Approx( d ) == 1.23 </Original> <Expanded> - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) +== +1.22999999999999998 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12757,7 +12954,9 @@ A string sent to stderr via clog Approx( d ) != 1.22 </Original> <Expanded> - Approx( 1.23 ) != 1.22 + Approx( 1.22999999999999998 ) +!= +1.21999999999999997 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -12765,7 +12964,9 @@ A string sent to stderr via clog Approx( d ) != 1.24 </Original> <Expanded> - Approx( 1.23 ) != 1.24 + Approx( 1.22999999999999998 ) +!= +1.23999999999999999 </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13592,10 +13793,10 @@ Message from section two <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 + std::is_default_constructible<TestType>::value </Original> <Expanded> - 1 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13603,10 +13804,10 @@ Message from section two <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 + std::is_default_constructible<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13614,10 +13815,10 @@ Message from section two <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 + std::is_trivially_copyable<TestType>::value </Original> <Expanded> - 1 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13625,10 +13826,10 @@ Message from section two <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 + std::is_trivially_copyable<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13636,10 +13837,10 @@ Message from section two <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 + std::is_arithmetic<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13647,10 +13848,10 @@ Message from section two <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 + std::is_arithmetic<TestType>::value </Original> <Expanded> - 1 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -13658,10 +13859,10 @@ Message from section two <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 + std::is_arithmetic<TestType>::value </Original> <Expanded> - 4 > 0 + true </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -15955,7 +16156,7 @@ There is no extra whitespace here </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 + 3.14000000000000012 </Exception> <OverallResult success="false" skips="0"/> </TestCase> @@ -17182,6 +17383,25 @@ There is no extra whitespace here </Expression> <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> </Section> + <Section name="Compare against std::initializer_list" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, RangeEquals( { 1, 2, 3 } ) + </Original> + <Expanded> + { 1, 2, 3 } elements are { 1, 2, 3 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) + </Original> + <Expanded> + { 1, 2, 3 } elements are { 2, 4, 6 } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> <Section name="Check short-circuiting behaviour" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Section name="Check short-circuits on failure" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > @@ -17408,6 +17628,25 @@ There is no extra whitespace here </Expression> <OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/> </Section> + <Section name="Compare against std::initializer_list" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, UnorderedRangeEquals( { 10, 20, 1 } ) + </Original> + <Expanded> + { 1, 10, 20 } unordered elements are { 10, 20, 1 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) + </Original> + <Expanded> + { 1, 10, 20 } unordered elements are { 11, 21, 2 } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> <OverallResult success="true" skips="0"/> </TestCase> <TestCase name="Usage of the SizeIs range matcher" tags="[matchers][size][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > @@ -17500,7 +17739,9 @@ There is no extra whitespace here d == approx( 1.23 ) </Original> <Expanded> - 1.23 == Approx( 1.23 ) + 1.22999999999999998 +== +Approx( 1.22999999999999998 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17508,7 +17749,9 @@ There is no extra whitespace here d == approx( 1.22 ) </Original> <Expanded> - 1.23 == Approx( 1.22 ) + 1.22999999999999998 +== +Approx( 1.21999999999999997 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17516,7 +17759,9 @@ There is no extra whitespace here d == approx( 1.24 ) </Original> <Expanded> - 1.23 == Approx( 1.24 ) + 1.22999999999999998 +== +Approx( 1.23999999999999999 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17524,7 +17769,7 @@ There is no extra whitespace here d != approx( 1.25 ) </Original> <Expanded> - 1.23 != Approx( 1.25 ) + 1.22999999999999998 != Approx( 1.25 ) </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17532,7 +17777,9 @@ There is no extra whitespace here approx( d ) == 1.23 </Original> <Expanded> - Approx( 1.23 ) == 1.23 + Approx( 1.22999999999999998 ) +== +1.22999999999999998 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17540,7 +17787,9 @@ There is no extra whitespace here approx( d ) == 1.22 </Original> <Expanded> - Approx( 1.23 ) == 1.22 + Approx( 1.22999999999999998 ) +== +1.21999999999999997 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17548,7 +17797,9 @@ There is no extra whitespace here approx( d ) == 1.24 </Original> <Expanded> - Approx( 1.23 ) == 1.24 + Approx( 1.22999999999999998 ) +== +1.23999999999999999 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > @@ -17556,7 +17807,7 @@ There is no extra whitespace here approx( d ) != 1.25 </Original> <Expanded> - Approx( 1.23 ) != 1.25 + Approx( 1.22999999999999998 ) != 1.25 </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -19008,7 +19259,9 @@ There is no extra whitespace here erfc_inv(1.103560) == Approx(-0.09203687623843015) </Original> <Expanded> - -0.0920368762 == Approx( -0.0920368762 ) + -0.09203687623843014 +== +Approx( -0.09203687623843015 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19016,7 +19269,9 @@ There is no extra whitespace here erfc_inv(1.067400) == Approx(-0.05980291115763361) </Original> <Expanded> - -0.0598029112 == Approx( -0.0598029112 ) + -0.05980291115763361 +== +Approx( -0.05980291115763361 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19024,7 +19279,9 @@ There is no extra whitespace here erfc_inv(0.050000) == Approx(1.38590382434967796) </Original> <Expanded> - 1.3859038243 == Approx( 1.3859038243 ) + 1.38590382434967774 +== +Approx( 1.38590382434967796 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -19614,56 +19871,15 @@ b1! </Expression> <OverallResult success="true" skips="0"/> </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" skips="0"/> - </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 ) + 0.13015979861484195 +== +Approx( 0.13015979861484198 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19671,7 +19887,9 @@ b1! normal_quantile(0.533700) == Approx(0.08457408802851875) </Original> <Expanded> - 0.084574088 == Approx( 0.084574088 ) + 0.08457408802851875 +== +Approx( 0.08457408802851875 ) </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > @@ -19679,7 +19897,9 @@ b1! normal_quantile(0.025000) == Approx(-1.95996398454005449) </Original> <Expanded> - -1.9599639845 == Approx( -1.9599639845 ) + -1.95996398454005405 +== +Approx( -1.95996398454005449 ) </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -20065,6 +20285,50 @@ b1! </Expression> <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> </Section> + <Section name="no replace in already-replaced string" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Section name="lengthening" 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", "cc") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + letters == "abccdefccg" + </Original> + <Expanded> + "abccdefccg" == "abccdefccg" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <Section name="no replace in already-replaced string" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Section name="shortening" 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 == "--" + </Original> + <Expanded> + "--" == "--" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/> + </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> @@ -21045,18 +21309,18 @@ b1! <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)) + "1.5f" == ::Catch::Detail::stringify(float(1.5)) </Original> <Expanded> - "1.2f" == "1.2f" + "1.5f" == "1.5f" </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}) + "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) </Original> <Expanded> - "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + "{ 1.5f, 0 }" == "{ 1.5f, 0 }" </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -21088,12 +21352,12 @@ b1! <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) + "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) </Original> <Expanded> - "{ { 42 }, { }, 1.2f }" + "{ { 42 }, { }, 1.5f }" == -"{ { 42 }, { }, 1.2f }" +"{ { 42 }, { }, 1.5f }" </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -21128,7 +21392,7 @@ b1! e.confidence_interval == 0.95 </Original> <Expanded> - 0.95 == 0.95 + 0.94999999999999996 == 0.94999999999999996 </Expanded> </Expression> <OverallResult success="true" skips="0"/> @@ -21706,6 +21970,6 @@ b1! </Section> <OverallResult success="true" skips="0"/> </TestCase> - <OverallResults successes="2079" failures="146" expectedFailures="35" skips="12"/> - <OverallResultsCases successes="312" failures="85" expectedFailures="14" skips="6"/> + <OverallResults successes="2087" failures="147" expectedFailures="35" skips="12"/> + <OverallResultsCases successes="313" failures="86" expectedFailures="14" skips="6"/> </Catch2TestRun> diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp index 14ba433da..53023b502 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Clara.tests.cpp @@ -51,6 +51,21 @@ TEST_CASE("Clara::Arg supports single-arg parse the way Opt does", "[clara][arg] REQUIRE(name == "foo"); } +TEST_CASE("Clara::Arg does not crash on incomplete input", "[clara][arg][compilation]") { + std::string name; + auto p = Catch::Clara::Arg(name, "-"); + + CHECK(name.empty()); + + auto result = p.parse( Catch::Clara::Args{ "UnitTest", "-" } ); + CHECK( result ); + CHECK( result.type() == Catch::Clara::Detail::ResultType::Ok ); + const auto& parsed = result.value(); + CHECK( parsed.type() == Catch::Clara::ParseResultType::NoMatch ); + CHECK( parsed.remainingTokens().count() == 2 ); + CHECK( name.empty() ); +} + TEST_CASE("Clara::Opt supports accept-many lambdas", "[clara][opt]") { using namespace Catch::Clara; std::vector<std::string> res; diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp index d7175756b..5566bb597 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp @@ -120,13 +120,13 @@ TEST_CASE( "Optional supports move ops", "[optional][approvals]" ) { } SECTION( "Move construction from optional" ) { Optional<MoveChecker> opt_B( CATCH_MOVE( opt_A ) ); - REQUIRE( opt_A->has_moved ); + REQUIRE( opt_A->has_moved ); // NOLINT(clang-analyzer-cplusplus.Move) } SECTION( "Move assignment from optional" ) { Optional<MoveChecker> opt_B( opt_A ); REQUIRE_FALSE( opt_A->has_moved ); opt_B = CATCH_MOVE( opt_A ); - REQUIRE( opt_A->has_moved ); + REQUIRE( opt_A->has_moved ); // NOLINT(clang-analyzer-cplusplus.Move) } } diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp index acfeebed0..14c90114b 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp @@ -18,7 +18,6 @@ #include <catch2/generators/catch_generators_adapters.hpp> #include <catch2/generators/catch_generators_random.hpp> #include <catch2/generators/catch_generators_range.hpp> -#include <catch2/generators/catch_generator_exception.hpp> // Tests of generator implementation details TEST_CASE("Generators internals", "[generators][internals]") { diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp index fd620ebbf..8955f4001 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp @@ -8,6 +8,7 @@ #include <catch2/catch_test_macros.hpp> #include <catch2/internal/catch_random_integer_helpers.hpp> +#include <random> namespace { template <typename Int> @@ -20,6 +21,58 @@ namespace { CHECK( extendedMult( b, a ) == ExtendedMultResult<Int>{ upper_result, lower_result } ); } + + // Simple (and slow) implmentation of extended multiplication for tests + constexpr Catch::Detail::ExtendedMultResult<std::uint64_t> + extendedMultNaive( std::uint64_t lhs, std::uint64_t rhs ) { + // This is a simple long multiplication, where we split lhs and rhs + // into two 32-bit "digits", so that we can do ops with carry in 64-bits. + // + // 32b 32b 32b 32b + // lhs L1 L2 + // * rhs R1 R2 + // ------------------------ + // | R2 * L2 | + // | R2 * L1 | + // | R1 * L2 | + // | R1 * L1 | + // ------------------------- + // | a | b | c | d | + +#define CarryBits( x ) ( x >> 32 ) +#define Digits( x ) ( x & 0xFF'FF'FF'FF ) + + auto r2l2 = Digits( rhs ) * Digits( lhs ); + auto r2l1 = Digits( rhs ) * CarryBits( lhs ); + auto r1l2 = CarryBits( rhs ) * Digits( lhs ); + auto r1l1 = CarryBits( rhs ) * CarryBits( lhs ); + + // Sum to columns first + auto d = Digits( r2l2 ); + auto c = CarryBits( r2l2 ) + Digits( r2l1 ) + Digits( r1l2 ); + auto b = CarryBits( r2l1 ) + CarryBits( r1l2 ) + Digits( r1l1 ); + auto a = CarryBits( r1l1 ); + + // Propagate carries between columns + c += CarryBits( d ); + b += CarryBits( c ); + a += CarryBits( b ); + + // Remove the used carries + c = Digits( c ); + b = Digits( b ); + a = Digits( a ); + +#undef CarryBits +#undef Digits + + return { + a << 32 | b, // upper 64 bits + c << 32 | d // lower 64 bits + }; + } + + } // namespace TEST_CASE( "extendedMult 64x64", "[Integer][approvals]" ) { @@ -62,6 +115,27 @@ TEST_CASE( "extendedMult 64x64", "[Integer][approvals]" ) { 0xdf44'2d22'ce48'59b9 ); } +TEST_CASE("extendedMult 64x64 - all implementations", "[integer][approvals]") { + using Catch::Detail::extendedMult; + using Catch::Detail::extendedMultPortable; + using Catch::Detail::fillBitsFrom; + + std::random_device rng; + for (size_t i = 0; i < 100; ++i) { + auto a = fillBitsFrom<std::uint64_t>( rng ); + auto b = fillBitsFrom<std::uint64_t>( rng ); + CAPTURE( a, b ); + + auto naive_ab = extendedMultNaive( a, b ); + + REQUIRE( naive_ab == extendedMultNaive( b, a ) ); + REQUIRE( naive_ab == extendedMultPortable( a, b ) ); + REQUIRE( naive_ab == extendedMultPortable( b, a ) ); + REQUIRE( naive_ab == extendedMult( a, b ) ); + REQUIRE( naive_ab == extendedMult( b, a ) ); + } +} + TEST_CASE( "SizedUnsignedType helpers", "[integer][approvals]" ) { using Catch::Detail::SizedUnsignedType_t; using Catch::Detail::DoubleWidthUnsignedType_t; diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp index bc8d715b4..69251d973 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp @@ -172,7 +172,7 @@ TEST_CASE("uniform samples", "[benchmark]") { } -TEST_CASE("normal_cdf", "[benchmark]") { +TEST_CASE("normal_cdf", "[benchmark][approvals]") { using Catch::Benchmark::Detail::normal_cdf; using Catch::Approx; CHECK(normal_cdf(0.000000) == Approx(0.50000000000000000)); diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp index 03be6c9ca..893232153 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp @@ -140,7 +140,9 @@ TEMPLATE_TEST_CASE( "uniform_integer_distribution can handle unit ranges", uint32_t, int32_t, uint64_t, - int64_t ) { + int64_t, + size_t, + ptrdiff_t) { // We want random seed to sample different parts of the rng state, // the output is predetermined anyway std::random_device rd; @@ -493,6 +495,21 @@ TEMPLATE_TEST_CASE( "uniform_integer_distribution is reproducible", REQUIRE_THAT(generated, Catch::Matchers::RangeEquals(uniform_integer_test_params<TestType>::expected)); } +// The reproducibility tests assume that operations on `float`/`double` +// happen in the same precision as the operated-upon type. This is +// generally true, unless the code is compiled for 32 bit targets without +// SSE2 enabled, in which case the operations are done in the x87 FPU, +// which usually implies doing math in 80 bit floats, and then rounding +// into smaller type when the type is saved into memory. This obviously +// leads to a different answer, than doing the math in the correct precision. +#if ( defined( _MSC_VER ) && _M_IX86_FP < 2 ) || \ + ( defined( __GNUC__ ) && \ + ( ( defined( __i386__ ) || defined( __x86_64__ ) ) ) && \ + !defined( __SSE2_MATH__ ) ) +# define CATCH_TEST_CONFIG_DISABLE_FLOAT_REPRODUCIBILITY_TESTS +#endif + +#if !defined( CATCH_TEST_CONFIG_DISABLE_FLOAT_REPRODUCIBILITY_TESTS ) namespace { template <typename T> @@ -570,6 +587,8 @@ TEMPLATE_TEST_CASE( "uniform_floating_point_distribution is reproducible", REQUIRE_THAT( generated, Catch::Matchers::RangeEquals( uniform_fp_test_params<TestType>::expected ) ); } +#endif // ^^ float reproducibility tests are enabled + TEMPLATE_TEST_CASE( "uniform_floating_point_distribution can handle unitary ranges", "[rng][distribution][floating-point][approvals]", float, @@ -579,7 +598,7 @@ TEMPLATE_TEST_CASE( "uniform_floating_point_distribution can handle unitary rang CAPTURE( seed ); Catch::SimplePcg32 pcg( seed ); - const auto highest = uniform_fp_test_params<TestType>::highest; + const auto highest = TestType(385.125); Catch::uniform_floating_point_distribution<TestType> dist( highest, highest ); diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp index e5a65bda5..86ba1175d 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp @@ -107,7 +107,7 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { for (auto const& factory : factories) { INFO("Tested reporter: " << factory.first); auto sstream = Catch::Detail::make_unique<StringIStream>(); - auto& sstreamRef = *sstream.get(); + auto& sstreamRef = *sstream; Catch::ConfigData cfg_data; cfg_data.rngSeed = 1234; diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp index 36554ddc3..f30573cc5 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp @@ -57,6 +57,17 @@ TEST_CASE("replaceInPlace", "[string-manip]") { CHECK_FALSE(Catch::replaceInPlace(letters, "x", "z")); CHECK(letters == letters); } + SECTION("no replace in already-replaced string") { + SECTION("lengthening") { + CHECK(Catch::replaceInPlace(letters, "c", "cc")); + CHECK(letters == "abccdefccg"); + } + SECTION("shortening") { + std::string s = "----"; + CHECK(Catch::replaceInPlace(s, "--", "-")); + CHECK(s == "--"); + } + } SECTION("escape '") { std::string s = "didn't"; CHECK(Catch::replaceInPlace(s, "'", "|'")); diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp index 9c4eb03b1..11a7a7a83 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp @@ -236,7 +236,7 @@ TEST_CASE( "Parse test names and tags", "[command-line][test-spec][approvals]" ) CHECK( spec.matches( *tcD ) == false ); } SECTION( "two wildcarded names" ) { - TestSpec spec = parseTestSpec( "\"longer*\"\"*spaces\"" ); + TestSpec spec = parseTestSpec( R"("longer*""*spaces")" ); CHECK( spec.hasFilters() == true ); CHECK( spec.matches( *tcA ) == false ); CHECK( spec.matches( *tcB ) == false ); diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp index 82de5a27f..de03ed09a 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp @@ -12,6 +12,7 @@ #include <sstream> using Catch::TextFlow::Column; +using Catch::TextFlow::AnsiSkippingString; namespace { static std::string as_written(Column const& c) { @@ -152,7 +153,7 @@ TEST_CASE( "TextFlow::Column respects indentation for empty lines", std::string written = as_written(col); - REQUIRE(as_written(col) == " \n \n third line"); + REQUIRE(written == " \n \n third line"); } TEST_CASE( "TextFlow::Column leading/trailing whitespace", @@ -198,3 +199,202 @@ TEST_CASE( "#1400 - TextFlow::Column wrapping would sometimes duplicate words", " in \n" " convallis posuere, libero nisi ultricies orci, nec lobortis."); } + +TEST_CASE( "TextFlow::AnsiSkippingString skips ansi sequences", + "[TextFlow][ansiskippingstring][approvals]" ) { + + SECTION("basic string") { + std::string text = "a\033[38;2;98;174;239mb\033[38mc\033[0md\033[me"; + AnsiSkippingString str(text); + + SECTION( "iterates forward" ) { + auto it = str.begin(); + CHECK(*it == 'a'); + ++it; + CHECK(*it == 'b'); + ++it; + CHECK(*it == 'c'); + ++it; + CHECK(*it == 'd'); + ++it; + CHECK(*it == 'e'); + ++it; + CHECK(it == str.end()); + } + SECTION( "iterates backwards" ) { + auto it = str.end(); + --it; + CHECK(*it == 'e'); + --it; + CHECK(*it == 'd'); + --it; + CHECK(*it == 'c'); + --it; + CHECK(*it == 'b'); + --it; + CHECK(*it == 'a'); + CHECK(it == str.begin()); + } + } + + SECTION( "ansi escape sequences at the start" ) { + std::string text = "\033[38;2;98;174;239ma\033[38;2;98;174;239mb\033[38mc\033[0md\033[me"; + AnsiSkippingString str(text); + auto it = str.begin(); + CHECK(*it == 'a'); + ++it; + CHECK(*it == 'b'); + ++it; + CHECK(*it == 'c'); + ++it; + CHECK(*it == 'd'); + ++it; + CHECK(*it == 'e'); + ++it; + CHECK(it == str.end()); + --it; + CHECK(*it == 'e'); + --it; + CHECK(*it == 'd'); + --it; + CHECK(*it == 'c'); + --it; + CHECK(*it == 'b'); + --it; + CHECK(*it == 'a'); + CHECK(it == str.begin()); + } + + SECTION( "ansi escape sequences at the end" ) { + std::string text = "a\033[38;2;98;174;239mb\033[38mc\033[0md\033[me\033[38;2;98;174;239m"; + AnsiSkippingString str(text); + auto it = str.begin(); + CHECK(*it == 'a'); + ++it; + CHECK(*it == 'b'); + ++it; + CHECK(*it == 'c'); + ++it; + CHECK(*it == 'd'); + ++it; + CHECK(*it == 'e'); + ++it; + CHECK(it == str.end()); + --it; + CHECK(*it == 'e'); + --it; + CHECK(*it == 'd'); + --it; + CHECK(*it == 'c'); + --it; + CHECK(*it == 'b'); + --it; + CHECK(*it == 'a'); + CHECK(it == str.begin()); + } + + SECTION( "skips consecutive escapes" ) { + std::string text = "\033[38;2;98;174;239m\033[38;2;98;174;239ma\033[38;2;98;174;239mb\033[38m\033[38m\033[38mc\033[0md\033[me"; + AnsiSkippingString str(text); + auto it = str.begin(); + CHECK(*it == 'a'); + ++it; + CHECK(*it == 'b'); + ++it; + CHECK(*it == 'c'); + ++it; + CHECK(*it == 'd'); + ++it; + CHECK(*it == 'e'); + ++it; + CHECK(it == str.end()); + --it; + CHECK(*it == 'e'); + --it; + CHECK(*it == 'd'); + --it; + CHECK(*it == 'c'); + --it; + CHECK(*it == 'b'); + --it; + CHECK(*it == 'a'); + CHECK(it == str.begin()); + } + + SECTION( "handles incomplete ansi sequences" ) { + std::string text = "a\033[b\033[30c\033[30;d\033[30;2e"; + AnsiSkippingString str(text); + CHECK(std::string(str.begin(), str.end()) == text); + } +} + +TEST_CASE( "TextFlow::AnsiSkippingString computes the size properly", + "[TextFlow][ansiskippingstring][approvals]" ) { + std::string text = "\033[38;2;98;174;239m\033[38;2;98;174;239ma\033[38;2;98;174;239mb\033[38m\033[38m\033[38mc\033[0md\033[me"; + AnsiSkippingString str(text); + CHECK(str.size() == 5); +} + +TEST_CASE( "TextFlow::AnsiSkippingString substrings properly", + "[TextFlow][ansiskippingstring][approvals]" ) { + SECTION("basic test") { + std::string text = "a\033[38;2;98;174;239mb\033[38mc\033[0md\033[me"; + AnsiSkippingString str(text); + auto a = str.begin(); + auto b = str.begin(); + ++b; + ++b; + CHECK(str.substring(a, b) == "a\033[38;2;98;174;239mb\033[38m"); + ++a; + ++b; + CHECK(str.substring(a, b) == "b\033[38mc\033[0m"); + CHECK(str.substring(a, str.end()) == "b\033[38mc\033[0md\033[me"); + CHECK(str.substring(str.begin(), str.end()) == text); + } + SECTION("escapes at the start") { + std::string text = "\033[38;2;98;174;239m\033[38;2;98;174;239ma\033[38;2;98;174;239mb\033[38m\033[38m\033[38mc\033[0md\033[me"; + AnsiSkippingString str(text); + auto a = str.begin(); + auto b = str.begin(); + ++b; + ++b; + CHECK(str.substring(a, b) == "\033[38;2;98;174;239m\033[38;2;98;174;239ma\033[38;2;98;174;239mb\033[38m\033[38m\033[38m"); + ++a; + ++b; + CHECK(str.substring(a, b) == "b\033[38m\033[38m\033[38mc\033[0m"); + CHECK(str.substring(a, str.end()) == "b\033[38m\033[38m\033[38mc\033[0md\033[me"); + CHECK(str.substring(str.begin(), str.end()) == text); + } + SECTION("escapes at the end") { + std::string text = "a\033[38;2;98;174;239mb\033[38mc\033[0md\033[me\033[38m"; + AnsiSkippingString str(text); + auto a = str.begin(); + auto b = str.begin(); + ++b; + ++b; + CHECK(str.substring(a, b) == "a\033[38;2;98;174;239mb\033[38m"); + ++a; + ++b; + CHECK(str.substring(a, b) == "b\033[38mc\033[0m"); + CHECK(str.substring(a, str.end()) == "b\033[38mc\033[0md\033[me\033[38m"); + CHECK(str.substring(str.begin(), str.end()) == text); + } +} + +TEST_CASE( "TextFlow::Column skips ansi escape sequences", + "[TextFlow][column][approvals]" ) { + std::string text = "\033[38;2;98;174;239m\033[38;2;198;120;221mThe quick brown \033[38;2;198;120;221mfox jumped over the lazy dog\033[0m"; + Column col(text); + + SECTION( "width=20" ) { + col.width( 20 ); + REQUIRE( as_written( col ) == "\033[38;2;98;174;239m\033[38;2;198;120;221mThe quick brown \033[38;2;198;120;221mfox\n" + "jumped over the lazy\n" + "dog\033[0m" ); + } + + SECTION( "width=80" ) { + col.width( 80 ); + REQUIRE( as_written( col ) == text ); + } +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp index e50e4c5e7..e1904606f 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp @@ -7,10 +7,13 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_enum_values_registry.hpp> +#include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/matchers/catch_matchers_vector.hpp> #include <catch2/catch_test_macros.hpp> #include <catch2/catch_template_test_macros.hpp> +#include <chrono> + enum class EnumClass3 { Value1, Value2, Value3, Value4 }; struct UsesSentinel { @@ -95,3 +98,23 @@ TEMPLATE_TEST_CASE( "Stringifying char arrays with statically known sizes", TestType no_null_terminator[3] = { 'a', 'b', 'c' }; CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ); } + +TEST_CASE( "#2944 - Stringifying dates before 1970 should not crash", "[.approvals]" ) { + using Catch::Matchers::Equals; + using Days = std::chrono::duration<int32_t, std::ratio<86400>>; + using SysDays = std::chrono::time_point<std::chrono::system_clock, Days>; + Catch::StringMaker<std::chrono::system_clock::time_point> sm; + + // Check simple date first + const SysDays post1970{ Days{ 1 } }; + auto converted_post = sm.convert( post1970 ); + REQUIRE( converted_post == "1970-01-02T00:00:00Z" ); + + const SysDays pre1970{ Days{ -1 } }; + auto converted_pre = sm.convert( pre1970 ); + REQUIRE_THAT( + converted_pre, + Equals( "1969-12-31T00:00:00Z" ) || + Equals( "gmtime from provided timepoint has failed. This " + "happens e.g. with pre-1970 dates using Microsoft libc" ) ); +} diff --git a/packages/Catch2/tests/SelfTest/TestRegistrations.cpp b/packages/Catch2/tests/SelfTest/TestRegistrations.cpp index 647677352..d7a6966fe 100644 --- a/packages/Catch2/tests/SelfTest/TestRegistrations.cpp +++ b/packages/Catch2/tests/SelfTest/TestRegistrations.cpp @@ -20,7 +20,6 @@ CATCH_REGISTER_TAG_ALIAS("[@tricky]", "[tricky]~[.]") #ifdef __clang__ # pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wweak-vtables" -# pragma clang diagnostic ignored "-Wc++98-compat" #endif /** diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp index 557b2131c..c489eaa85 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp @@ -90,14 +90,14 @@ TEST_CASE("Benchmark containers", "[!benchmark]") { }; REQUIRE(v.size() == size); - int array[size]; + int array[size] {}; BENCHMARK("A fixed size array that should require no allocations") { for (int i = 0; i < size; ++i) array[i] = i; }; int sum = 0; - for (int i = 0; i < size; ++i) - sum += array[i]; + for (int val : array) + sum += val; REQUIRE(sum > size); SECTION("XYZ") { @@ -121,8 +121,8 @@ TEST_CASE("Benchmark containers", "[!benchmark]") { runs = benchmarkIndex; }; - for (size_t i = 0; i < v.size(); ++i) { - REQUIRE(v[i] == runs); + for (int val : v) { + REQUIRE(val == runs); } } } @@ -135,8 +135,8 @@ TEST_CASE("Benchmark containers", "[!benchmark]") { for (int i = 0; i < size; ++i) v[i] = generated; }; - for (size_t i = 0; i < v.size(); ++i) { - REQUIRE(v[i] == generated); + for (int val : v) { + REQUIRE(val == generated); } } diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp index bab7a6843..75510f10d 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp @@ -32,6 +32,10 @@ namespace { int m_a; }; + struct Persistent_Fixture { + mutable int m_a = 0; + }; + template <typename T> struct Template_Fixture { Template_Fixture(): m_a( 1 ) {} @@ -39,7 +43,7 @@ namespace { }; template <typename T> struct Template_Fixture_2 { - Template_Fixture_2() {} + Template_Fixture_2() = default; T m_a; }; @@ -64,6 +68,17 @@ TEST_CASE_METHOD( Fixture, "A TEST_CASE_METHOD based test run that succeeds", "[ REQUIRE( m_a == 1 ); } +TEST_CASE_PERSISTENT_FIXTURE( Persistent_Fixture, "A TEST_CASE_PERSISTENT_FIXTURE based test run that succeeds", "[class]" ) +{ + SECTION( "First partial run" ) { + REQUIRE( m_a++ == 0 ); + } + + SECTION( "Second partial run" ) { + REQUIRE( m_a == 1 ); + } +} + TEMPLATE_TEST_CASE_METHOD(Template_Fixture, "A TEMPLATE_TEST_CASE_METHOD based test run that succeeds", "[class][template]", int, float, double) { REQUIRE( Template_Fixture<TestType>::m_a == 1 ); } @@ -96,6 +111,17 @@ namespace Inner REQUIRE( m_a == 2 ); } + TEST_CASE_PERSISTENT_FIXTURE( Persistent_Fixture, "A TEST_CASE_PERSISTENT_FIXTURE based test run that fails", "[.][class][failing]" ) + { + SECTION( "First partial run" ) { + REQUIRE( m_a++ == 0 ); + } + + SECTION( "Second partial run" ) { + REQUIRE( m_a == 0 ); + } + } + TEMPLATE_TEST_CASE_METHOD(Template_Fixture,"A TEMPLATE_TEST_CASE_METHOD based test run that fails", "[.][class][template][failing]", int, float, double) { REQUIRE( Template_Fixture<TestType>::m_a == 2 ); diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp index 1cdcfb788..7a6a1f252 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp @@ -8,6 +8,7 @@ #include <helpers/type_with_lit_0_comparisons.hpp> +#include <array> #include <type_traits> // Setup for #1403 -- look for global overloads of operator << for classes @@ -34,6 +35,7 @@ static std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) { /////////////////////////////// #include <catch2/catch_test_macros.hpp> +#include <catch2/generators/catch_generators_range.hpp> #include <catch2/matchers/catch_matchers_string.hpp> #include <cstring> @@ -313,11 +315,12 @@ TEST_CASE("ADL universal operators don't hijack expression deconstruction", "[co REQUIRE(0 ^ adl::always_true{}); } -TEST_CASE( "#2555 - types that can only be compared with 0 literal (not int/long) are supported", "[compilation][approvals]" ) { +TEST_CASE( "#2555 - types that can only be compared with 0 literal implemented as pointer conversion are supported", + "[compilation][approvals]" ) { REQUIRE( TypeWithLit0Comparisons{} < 0 ); REQUIRE_FALSE( 0 < TypeWithLit0Comparisons{} ); REQUIRE( TypeWithLit0Comparisons{} <= 0 ); - REQUIRE_FALSE( 0 > TypeWithLit0Comparisons{} ); + REQUIRE_FALSE( 0 <= TypeWithLit0Comparisons{} ); REQUIRE( TypeWithLit0Comparisons{} > 0 ); REQUIRE_FALSE( 0 > TypeWithLit0Comparisons{} ); @@ -330,6 +333,105 @@ TEST_CASE( "#2555 - types that can only be compared with 0 literal (not int/long REQUIRE_FALSE( 0 != TypeWithLit0Comparisons{} ); } +// These tests require `consteval` to propagate through `constexpr` calls +// which is a late DR against C++20. +#if defined( CATCH_CPP20_OR_GREATER ) && defined( __cpp_consteval ) && \ + __cpp_consteval >= 202211L +// Can't have internal linkage to avoid warnings +void ZeroLiteralErrorFunc(); +namespace { + struct ZeroLiteralConsteval { + template <class T, std::enable_if_t<std::is_same_v<T, int>, int> = 0> + consteval ZeroLiteralConsteval( T zero ) noexcept { + if ( zero != 0 ) { ZeroLiteralErrorFunc(); } + } + }; + + // Should only be constructible from literal 0. Uses the propagating + // consteval constructor trick (currently used by MSVC, might be used + // by libc++ in the future as well). + struct TypeWithConstevalLit0Comparison { +# define DEFINE_COMP_OP( op ) \ + constexpr friend bool operator op( TypeWithConstevalLit0Comparison, \ + ZeroLiteralConsteval ) { \ + return true; \ + } \ + constexpr friend bool operator op( ZeroLiteralConsteval, \ + TypeWithConstevalLit0Comparison ) { \ + return false; \ + } \ + /* std::orderings only have these for ==, but we add them for all \ + operators so we can test all overloads for decomposer */ \ + constexpr friend bool operator op( TypeWithConstevalLit0Comparison, \ + TypeWithConstevalLit0Comparison ) { \ + return true; \ + } + + DEFINE_COMP_OP( < ) + DEFINE_COMP_OP( <= ) + DEFINE_COMP_OP( > ) + DEFINE_COMP_OP( >= ) + DEFINE_COMP_OP( == ) + DEFINE_COMP_OP( != ) + +#undef DEFINE_COMP_OP + }; + +} // namespace + +namespace Catch { + template <> + struct capture_by_value<TypeWithConstevalLit0Comparison> : std::true_type {}; +} + +TEST_CASE( "#2555 - types that can only be compared with 0 literal implemented as consteval check are supported", + "[compilation][approvals]" ) { + REQUIRE( TypeWithConstevalLit0Comparison{} < 0 ); + REQUIRE_FALSE( 0 < TypeWithConstevalLit0Comparison{} ); + REQUIRE( TypeWithConstevalLit0Comparison{} <= 0 ); + REQUIRE_FALSE( 0 <= TypeWithConstevalLit0Comparison{} ); + + REQUIRE( TypeWithConstevalLit0Comparison{} > 0 ); + REQUIRE_FALSE( 0 > TypeWithConstevalLit0Comparison{} ); + REQUIRE( TypeWithConstevalLit0Comparison{} >= 0 ); + REQUIRE_FALSE( 0 >= TypeWithConstevalLit0Comparison{} ); + + REQUIRE( TypeWithConstevalLit0Comparison{} == 0 ); + REQUIRE_FALSE( 0 == TypeWithConstevalLit0Comparison{} ); + REQUIRE( TypeWithConstevalLit0Comparison{} != 0 ); + REQUIRE_FALSE( 0 != TypeWithConstevalLit0Comparison{} ); +} + +// We check all comparison ops to test, even though orderings, the primary +// motivation for this functionality, only have self-comparison (and thus +// have the ambiguity issue) for `==` and `!=`. +TEST_CASE( "Comparing const instances of type registered with capture_by_value", + "[regression][approvals][compilation]" ) { + SECTION("Type with consteval-int constructor") { + auto const const_Lit0Type_1 = TypeWithConstevalLit0Comparison{}; + auto const const_Lit0Type_2 = TypeWithConstevalLit0Comparison{}; + REQUIRE( const_Lit0Type_1 == const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 <= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 < const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 >= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 > const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 != const_Lit0Type_2 ); + } + SECTION("Type with constexpr-int constructor") { + auto const const_Lit0Type_1 = TypeWithLit0Comparisons{}; + auto const const_Lit0Type_2 = TypeWithLit0Comparisons{}; + REQUIRE( const_Lit0Type_1 == const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 <= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 < const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 >= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 > const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 != const_Lit0Type_2 ); + } +} + +#endif // C++20 consteval + + namespace { struct MultipleImplicitConstructors { MultipleImplicitConstructors( double ) {} @@ -353,3 +455,71 @@ TEST_CASE("#2571 - tests compile types that have multiple implicit constructors REQUIRE( mic1 > mic2 ); REQUIRE( mic1 >= mic2 ); } + +#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS ) +// This test does not test all the related codepaths, but it is the original +// reproducer +TEST_CASE( "Comparing const std::weak_ordering instances must compile", + "[compilation][approvals][regression]" ) { + auto const const_ordering_1 = std::weak_ordering::less; + auto const const_ordering_2 = std::weak_ordering::less; + auto plain_ordering_1 = std::weak_ordering::less; + REQUIRE( const_ordering_1 == plain_ordering_1 ); + REQUIRE( const_ordering_1 == const_ordering_2 ); + REQUIRE( plain_ordering_1 == const_ordering_1 ); +} +#endif + +// Reproduce issue with yaml-cpp iterators, where the `const_iterator` +// for Node type has `const T` as the value_type. This is wrong for +// multitude of reasons, but there might be other libraries in the wild +// that share this issue, and the workaround needed to support +// `from_range(iter, iter)` helper with those libraries is easy enough. +class HasBadIterator { + std::array<int, 10> m_arr{}; + +public: + class iterator { + const int* m_ptr = nullptr; + + public: + iterator( const int* ptr ): m_ptr( ptr ) {} + + using difference_type = std::ptrdiff_t; + using value_type = const int; + using pointer = const int*; + using reference = const int&; + using iterator_category = std::input_iterator_tag; + + iterator& operator++() { + ++m_ptr; + return *this; + } + + iterator operator++( int ) { + auto ret( *this ); + ++( *this ); + return ret; + } + + friend bool operator==( iterator lhs, iterator rhs ) { + return lhs.m_ptr == rhs.m_ptr; + } + friend bool operator!=( iterator lhs, iterator rhs ) { + return !( lhs == rhs ); + } + + int operator*() const { return *m_ptr; } + }; + + iterator cbegin() const { return { m_arr.data() }; } + iterator cend() const { return { m_arr.data() + m_arr.size() }; } +}; + +TEST_CASE("from_range(iter, iter) supports const_iterators", "[generators][from-range][approvals]") { + using namespace Catch::Generators; + + HasBadIterator data; + auto gen = from_range(data.cbegin(), data.cend()); + (void)gen; +} diff --git a/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp index 362cf8046..268a7cad6 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/EnumToString.tests.cpp @@ -79,7 +79,7 @@ enum class EnumClass3 { Value1, Value2, Value3, Value4 }; CATCH_REGISTER_ENUM( EnumClass3, EnumClass3::Value1, EnumClass3::Value2, EnumClass3::Value3 ) -TEST_CASE( "Enums can quickly have stringification enabled using REGISTER_ENUM" ) { +TEST_CASE( "Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" ) { using Catch::Detail::stringify; REQUIRE( stringify( EnumClass3::Value1 ) == "Value1" ); REQUIRE( stringify( EnumClass3::Value2 ) == "Value2" ); @@ -101,7 +101,7 @@ CATCH_REGISTER_ENUM( Bikeshed::Colours, Bikeshed::Colours::Green, Bikeshed::Colours::Blue ) -TEST_CASE( "Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" ) { +TEST_CASE( "Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM" ) { using Catch::Detail::stringify; REQUIRE( stringify( Bikeshed::Colours::Red ) == "Red" ); REQUIRE( stringify( Bikeshed::Colours::Blue ) == "Blue" ); diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp index 4f91a30c4..7c6b0c86a 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp @@ -119,7 +119,7 @@ TEST_CASE( "When unchecked exceptions are thrown, but caught, they do not affect try { throw std::domain_error( "unexpected exception" ); } - catch(...) {} + catch(...) {} // NOLINT(bugprone-empty-catch) } @@ -152,7 +152,7 @@ TEST_CASE( "Custom exceptions can be translated when testing for throwing as som } TEST_CASE( "Unexpected exceptions can be translated", "[.][failing][!throws]" ) { - throw double( 3.14 ); + throw double( 3.14 ); // NOLINT(readability-redundant-casting): the type is important here, so we want to be explicit } TEST_CASE("Thrown string literals are translated", "[.][failing][!throws]") { diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp index 74bedf5ea..7c4501c67 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp @@ -1027,7 +1027,6 @@ TEST_CASE( "Combining MatchNotOfGeneric does not nest", } struct EvilAddressOfOperatorUsed : std::exception { - EvilAddressOfOperatorUsed() {} const char* what() const noexcept override { return "overloaded address-of operator of matcher was used instead of " "std::addressof"; @@ -1035,7 +1034,6 @@ struct EvilAddressOfOperatorUsed : std::exception { }; struct EvilCommaOperatorUsed : std::exception { - EvilCommaOperatorUsed() {} const char* what() const noexcept override { return "overloaded comma operator of matcher was used"; } @@ -1073,7 +1071,6 @@ struct ImmovableMatcher : Catch::Matchers::MatcherGenericBase { }; struct MatcherWasMovedOrCopied : std::exception { - MatcherWasMovedOrCopied() {} const char* what() const noexcept override { return "attempted to copy or move a matcher"; } @@ -1081,17 +1078,20 @@ struct MatcherWasMovedOrCopied : std::exception { struct ThrowOnCopyOrMoveMatcher : Catch::Matchers::MatcherGenericBase { ThrowOnCopyOrMoveMatcher() = default; - [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher const& ): - Catch::Matchers::MatcherGenericBase() { + + [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher const& other ): + Catch::Matchers::MatcherGenericBase( other ) { throw MatcherWasMovedOrCopied(); } - [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher&& ): - Catch::Matchers::MatcherGenericBase() { + // NOLINTNEXTLINE(performance-noexcept-move-constructor) + [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher&& other ): + Catch::Matchers::MatcherGenericBase( CATCH_MOVE(other) ) { throw MatcherWasMovedOrCopied(); } ThrowOnCopyOrMoveMatcher& operator=( ThrowOnCopyOrMoveMatcher const& ) { throw MatcherWasMovedOrCopied(); } + // NOLINTNEXTLINE(performance-noexcept-move-constructor) ThrowOnCopyOrMoveMatcher& operator=( ThrowOnCopyOrMoveMatcher&& ) { throw MatcherWasMovedOrCopied(); } diff --git a/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp index cc8c54f8b..4f906b99a 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp @@ -727,6 +727,15 @@ TEST_CASE( "Usage of RangeEquals range matcher", "[matchers][templated][quantifi } ) ); } + SECTION( "Compare against std::initializer_list" ) { + const std::array<int, 3> array_a{ { 1, 2, 3 } }; + + REQUIRE_THAT( array_a, RangeEquals( { 1, 2, 3 } ) ); + REQUIRE_THAT( array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { + return l * 2 == r; + } ) ); + } + SECTION("Check short-circuiting behaviour") { with_mocked_iterator_access<int> const mocked1{ 1, 2, 3, 4 }; @@ -820,6 +829,16 @@ TEST_CASE( "Usage of UnorderedRangeEquals range matcher", REQUIRE_THAT( needs_adl1, UnorderedRangeEquals( needs_adl2 ) ); } + + SECTION( "Compare against std::initializer_list" ) { + const std::array<int, 3> array_a{ { 1, 10, 20 } }; + + REQUIRE_THAT( array_a, UnorderedRangeEquals( { 10, 20, 1 } ) ); + REQUIRE_THAT( array_a, + UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { + return std::abs( l - r ) <= 1; + } ) ); + } } /** diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp index 6367bf591..7626e0055 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp @@ -80,20 +80,20 @@ TEST_CASE( "Output from all sections is reported", "[failing][messages][.]" ) { TEST_CASE( "Standard output from all sections is reported", "[messages][.]" ) { SECTION( "one" ) { - std::cout << "Message from section one" << std::endl; + std::cout << "Message from section one\n"; } SECTION( "two" ) { - std::cout << "Message from section two" << std::endl; + std::cout << "Message from section two\n"; } } TEST_CASE( "Standard error is reported and redirected", "[messages][.][approvals]" ) { SECTION( "std::cerr" ) { - std::cerr << "Write to std::cerr" << std::endl; + std::cerr << "Write to std::cerr\n"; } SECTION( "std::clog" ) { - std::clog << "Write to std::clog" << std::endl; + std::clog << "Write to std::clog\n"; } SECTION( "Interleaved writes to cerr and clog" ) { std::cerr << "Inter"; @@ -101,7 +101,7 @@ TEST_CASE( "Standard error is reported and redirected", "[messages][.][approvals std::cerr << ' '; std::clog << "writes"; std::cerr << " to error"; - std::clog << " streams" << std::endl; + std::clog << " streams\n" << std::flush; } } diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp index 7f06704b4..3697f0695 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp @@ -11,11 +11,6 @@ #include <catch2/internal/catch_config_wchar.hpp> #include <catch2/internal/catch_windows_h_proxy.hpp> -#ifdef __clang__ -# pragma clang diagnostic ignored "-Wc++98-compat" -# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" -#endif - #include <iostream> #include <cerrno> @@ -158,9 +153,9 @@ TEST_CASE( "looped tests", "[.][failing]" ) { } TEST_CASE( "Sends stuff to stdout and stderr", "[.]" ) { - std::cout << "A string sent directly to stdout" << std::endl; - std::cerr << "A string sent directly to stderr" << std::endl; - std::clog << "A string sent to stderr via clog" << std::endl; + std::cout << "A string sent directly to stdout\n" << std::flush; + std::cerr << "A string sent directly to stderr\n" << std::flush; + std::clog << "A string sent to stderr via clog\n" << std::flush; } TEST_CASE( "null strings" ) { @@ -396,7 +391,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product using MyTypes = std::tuple<int, char, float>; TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes) { - REQUIRE(sizeof(TestType) > 0); + REQUIRE(std::is_arithmetic<TestType>::value); } struct NonDefaultConstructibleType { @@ -406,7 +401,7 @@ struct NonDefaultConstructibleType { using MyNonDefaultConstructibleTypes = std::tuple<NonDefaultConstructibleType, float>; TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-default-constructible std::tuple", "[template][list]", MyNonDefaultConstructibleTypes) { - REQUIRE(sizeof(TestType) > 0); + REQUIRE(std::is_trivially_copyable<TestType>::value); } struct NonCopyableAndNonMovableType { @@ -421,7 +416,7 @@ struct NonCopyableAndNonMovableType { using NonCopyableAndNonMovableTypes = std::tuple<NonCopyableAndNonMovableType, float>; TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-copyable and non-movable std::tuple", "[template][list]", NonCopyableAndNonMovableTypes) { - REQUIRE(sizeof(TestType) > 0); + REQUIRE(std::is_default_constructible<TestType>::value); } // https://github.com/philsquared/Catch/issues/166 diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp index 28d60196c..78c0c80a8 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp @@ -14,31 +14,20 @@ TEST_CASE( "Character pretty printing" ){ SECTION("Specifically escaped"){ - char tab = '\t'; - char newline = '\n'; - char carr_return = '\r'; - char form_feed = '\f'; - CHECK(tab == '\t'); - CHECK(newline == '\n'); - CHECK(carr_return == '\r'); - CHECK(form_feed == '\f'); + CHECK(::Catch::Detail::stringify('\t') == "'\\t'"); + CHECK(::Catch::Detail::stringify('\n') == "'\\n'"); + CHECK(::Catch::Detail::stringify('\r') == "'\\r'"); + CHECK(::Catch::Detail::stringify('\f') == "'\\f'"); } SECTION("General chars"){ - char space = ' '; - CHECK(space == ' '); - char chars[] = {'a', 'z', 'A', 'Z'}; - for (int i = 0; i < 4; ++i){ - char c = chars[i]; - REQUIRE(c == chars[i]); - } + CHECK(::Catch::Detail::stringify( ' ' ) == "' '" ); + CHECK(::Catch::Detail::stringify( 'A' ) == "'A'" ); + CHECK(::Catch::Detail::stringify( 'z' ) == "'z'" ); } SECTION("Low ASCII"){ - char null_terminator = '\0'; - CHECK(null_terminator == '\0'); - for (int i = 2; i < 6; ++i){ - char c = static_cast<char>(i); - REQUIRE(c == i); - } + CHECK(::Catch::Detail::stringify( '\0' ) == "0" ); + CHECK(::Catch::Detail::stringify( static_cast<char>(2) ) == "2" ); + CHECK(::Catch::Detail::stringify( static_cast<char>(5) ) == "5" ); } } @@ -135,8 +124,8 @@ TEST_CASE("Precision of floating point stringification can be set", "[toString][ const auto oldPrecision = sm::precision; const float testFloat = 1.12345678901234567899f; - auto str1 = sm::convert(testFloat); sm::precision = 5; + auto str1 = sm::convert( testFloat ); // "1." prefix = 2 chars, f suffix is another char CHECK(str1.size() == 3 + 5); diff --git a/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp index b2813a817..9d1d2c462 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/ToStringTuple.tests.cpp @@ -29,8 +29,8 @@ TEST_CASE( "tuple<int>", "[toString][tuple]" ) TEST_CASE( "tuple<float,int>", "[toString][tuple]" ) { typedef std::tuple<float,int> type; - CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) ); - CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) ); + CHECK( "1.5f" == ::Catch::Detail::stringify(float(1.5)) ); + CHECK( "{ 1.5f, 0 }" == ::Catch::Detail::stringify(type{1.5f,0}) ); } TEST_CASE( "tuple<string,string>", "[toString][tuple]" ) @@ -42,8 +42,8 @@ TEST_CASE( "tuple<string,string>", "[toString][tuple]" ) TEST_CASE( "tuple<tuple<int>,tuple<>,float>", "[toString][tuple]" ) { typedef std::tuple<std::tuple<int>,std::tuple<>,float> type; - type value { std::tuple<int>{42}, {}, 1.2f }; - CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) ); + type value { std::tuple<int>{42}, {}, 1.5f }; + CHECK( "{ { 42 }, { }, 1.5f }" == ::Catch::Detail::stringify(value) ); } TEST_CASE( "tuple<nullptr,int,const char *>", "[approvals][toString][tuple]" ) { diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp index 25770340a..041d78675 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp @@ -261,7 +261,7 @@ TEST_CASE( "non streamable - with conv. op", "[Tricky]" ) inline void foo() {} -typedef void (*fooptr_t)(); +using fooptr_t = void (*)(); TEST_CASE( "Comparing function pointers", "[Tricky][function pointer]" ) { @@ -281,7 +281,7 @@ struct S TEST_CASE( "Comparing member function pointers", "[Tricky][member function pointer][approvals]" ) { - typedef void (S::*MF)(); + using MF = void (S::*)(); MF m = &S::f; CHECK( m == &S::f ); diff --git a/packages/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp b/packages/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp index 202c3af4d..a8e517c05 100644 --- a/packages/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp +++ b/packages/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp @@ -12,23 +12,34 @@ #include <type_traits> // Should only be constructible from literal 0. +// Based on the constructor from pointer trick, used by libstdc++ and libc++ +// (formerly also MSVC, but they've moved to consteval int constructor). // Used by `TypeWithLit0Comparisons` for testing comparison // ops that only work with literal zero, the way std::*orderings do -struct ZeroLiteralDetector { - constexpr ZeroLiteralDetector( ZeroLiteralDetector* ) noexcept {} +struct ZeroLiteralAsPointer { + constexpr ZeroLiteralAsPointer( ZeroLiteralAsPointer* ) noexcept {} template <typename T, typename = std::enable_if_t<!std::is_same<T, int>::value>> - constexpr ZeroLiteralDetector( T ) = delete; + constexpr ZeroLiteralAsPointer( T ) = delete; }; + struct TypeWithLit0Comparisons { -#define DEFINE_COMP_OP( op ) \ - friend bool operator op( TypeWithLit0Comparisons, ZeroLiteralDetector ) { \ - return true; \ - } \ - friend bool operator op( ZeroLiteralDetector, TypeWithLit0Comparisons ) { \ - return false; \ +#define DEFINE_COMP_OP( op ) \ + constexpr friend bool operator op( TypeWithLit0Comparisons, \ + ZeroLiteralAsPointer ) { \ + return true; \ + } \ + constexpr friend bool operator op( ZeroLiteralAsPointer, \ + TypeWithLit0Comparisons ) { \ + return false; \ + } \ + /* std::orderings only have these for ==, but we add them for all \ + operators so we can test all overloads for decomposer */ \ + constexpr friend bool operator op( TypeWithLit0Comparisons, \ + TypeWithLit0Comparisons ) { \ + return true; \ } DEFINE_COMP_OP( < ) diff --git a/packages/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt b/packages/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt index d19f2f889..f0b49f4de 100644 --- a/packages/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt +++ b/packages/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) project(discover-tests-test LANGUAGES CXX @@ -11,6 +11,19 @@ add_executable(tests add_subdirectory(${CATCH2_PATH} catch2-build) target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) -include(CTest) +enable_testing() include(Catch) -catch_discover_tests(tests) +set(extra_args) +if (CMAKE_VERSION GREATER_EQUAL 3.27) + list(APPEND extra_args + DL_PATHS "${CMAKE_CURRENT_LIST_DIR};${CMAKE_CURRENT_LIST_DIR}/.." + ) +endif () +catch_discover_tests( + tests + ADD_TAGS_AS_LABELS + DISCOVERY_MODE PRE_TEST + ${extra_args} +) + +# DISCOVERY_MODE <POST_BUILD|PRE_TEST> diff --git a/packages/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/packages/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py index 9ec42f24c..33150caec 100644 --- a/packages/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py +++ b/packages/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py @@ -10,7 +10,28 @@ import os import subprocess import sys +import re +import json +from collections import namedtuple +from typing import List +TestInfo = namedtuple('TestInfo', ['name', 'tags']) + +cmake_version_regex = re.compile('cmake version (\d+)\.(\d+)\.(\d+)') + +def get_cmake_version(): + result = subprocess.run(['cmake', '--version'], + capture_output = True, + check = True, + text = True) + version_match = cmake_version_regex.match(result.stdout) + if not version_match: + print('Could not find cmake version in output') + print(f"output: '{result.stdout}'") + exit(4) + return (int(version_match.group(1)), + int(version_match.group(2)), + int(version_match.group(3))) def build_project(sources_dir, output_base_path, catch2_path): build_dir = os.path.join(output_base_path, 'ctest-registration-test') @@ -44,7 +65,7 @@ def build_project(sources_dir, output_base_path, catch2_path): -def get_test_names(build_path): +def get_test_names(build_path: str) -> List[TestInfo]: # 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. @@ -52,18 +73,25 @@ def get_test_names(build_path): full_path = os.path.join(build_path, config_path, 'tests') - cmd = [full_path, '--reporter', 'xml', '--list-tests'] + cmd = [full_path, '--reporter', 'json', '--list-tests'] result = subprocess.run(cmd, capture_output = True, check = True, text = True) - import xml.etree.ElementTree as ET - root = ET.fromstring(result.stdout) - return [tc.text for tc in root.findall('TestCase/Name')] + test_listing = json.loads(result.stdout) + + assert test_listing['version'] == 1 + tests = [] + for test in test_listing['listings']['tests']: + test_name = test['name'] + tags = test['tags'] + tests.append(TestInfo(test_name, tags)) -def list_ctest_tests(build_path): + return tests + +def get_ctest_listing(build_path): old_path = os.getcwd() os.chdir(build_path) @@ -73,27 +101,45 @@ def list_ctest_tests(build_path): check = True, text = True) os.chdir(old_path) + return result.stdout - import json - - ctest_response = json.loads(result.stdout) +def extract_tests_from_ctest(ctest_output) -> List[TestInfo]: + ctest_response = json.loads(ctest_output) tests = ctest_response['tests'] - test_names = [] + test_infos = [] for test in tests: test_command = test['command'] # First part of the command is the binary, second is the filter. # If there are less, registration has failed. If there are more, # registration has changed and the script needs updating. assert len(test_command) == 2 - test_names.append(test_command[1]) test_name = test_command[1] + labels = [] + for prop in test['properties']: + if prop['name'] == 'LABELS': + labels = prop['value'] + + test_infos.append(TestInfo(test_name, labels)) - return test_names + return test_infos -def escape_catch2_test_name(name): - for char in ('\\', ',', '[', ']'): - name = name.replace(char, f"\\{char}") - return name +def check_DL_PATHS(ctest_output): + ctest_response = json.loads(ctest_output) + tests = ctest_response['tests'] + for test in tests: + properties = test['properties'] + for property in properties: + if property['name'] == 'ENVIRONMENT_MODIFICATION': + assert len(property['value']) == 2, f"The test provides 2 arguments to DL_PATHS, but instead found {len(property['value'])}" + +def escape_catch2_test_names(infos: List[TestInfo]): + escaped = [] + for info in infos: + name = info.name + for char in ('\\', ',', '[', ']'): + name = name.replace(char, f"\\{char}") + escaped.append(TestInfo(name, info.tags)) + return escaped if __name__ == '__main__': if len(sys.argv) != 3: @@ -105,8 +151,9 @@ if __name__ == '__main__': build_path = build_project(sources_dir, output_base_path, catch2_path) - catch_test_names = [escape_catch2_test_name(name) for name in get_test_names(build_path)] - ctest_test_names = list_ctest_tests(build_path) + catch_test_names = escape_catch2_test_names(get_test_names(build_path)) + ctest_output = get_ctest_listing(build_path) + ctest_test_names = extract_tests_from_ctest(ctest_output) mismatched = 0 for catch_test in catch_test_names: @@ -121,3 +168,8 @@ if __name__ == '__main__': if mismatched: print(f"Found {mismatched} mismatched tests catch test names and ctest test commands!") exit(1) + print(f"{len(catch_test_names)} tests matched") + + cmake_version = get_cmake_version() + if cmake_version >= (3, 27): + check_DL_PATHS(ctest_output) diff --git a/packages/Catch2/tests/TestScripts/DiscoverTests/register-tests.cpp b/packages/Catch2/tests/TestScripts/DiscoverTests/register-tests.cpp index aa603df1a..be533ab69 100644 --- a/packages/Catch2/tests/TestScripts/DiscoverTests/register-tests.cpp +++ b/packages/Catch2/tests/TestScripts/DiscoverTests/register-tests.cpp @@ -14,3 +14,10 @@ TEST_CASE( "Let's have a test case with a long name. Longer. No, even longer. " "Really looooooooooooong. Even longer than that. Multiple lines " "worth of test name. Yep, like this." ) {} TEST_CASE( "And now a test case with weird tags.", "[tl;dr][tl;dw][foo,bar]" ) {} +// Also check that we handle tests on class, which have name in output as 'class-name', not 'name'. +class TestCaseFixture { +public: + int m_a; +}; + +TEST_CASE_METHOD(TestCaseFixture, "A test case as method", "[tagstagstags]") {} diff --git a/packages/Catch2/tests/TestScripts/testBazelReporter.py b/packages/Catch2/tests/TestScripts/testBazelReporter.py index d0893f816..573eafd24 100644 --- a/packages/Catch2/tests/TestScripts/testBazelReporter.py +++ b/packages/Catch2/tests/TestScripts/testBazelReporter.py @@ -52,7 +52,7 @@ try: ) stdout = ret.stdout except subprocess.SubprocessError as ex: - if ex.returncode == 1: + if ex.returncode == 42: # The test cases are allowed to fail. test_passing = False stdout = ex.stdout diff --git a/packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py b/packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py index 5bf978712..119e1ca26 100644 --- a/packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py +++ b/packages/Catch2/tests/TestScripts/testConfigureDefaultReporter.py @@ -28,14 +28,23 @@ if len(sys.argv) != 3: catch2_source_path = os.path.abspath(sys.argv[1]) build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests', 'DefaultReporter') +output_file = f"{build_dir_path}/foo.xml" +# We need to escape backslashes in Windows paths, because otherwise they +# are interpreted as escape characters in strings, and cause compilation +# error. +escaped_output_file = output_file.replace('\\', '\\\\') configure_and_build(catch2_source_path, build_dir_path, - [("CATCH_CONFIG_DEFAULT_REPORTER", "xml")]) + [("CATCH_CONFIG_DEFAULT_REPORTER", f"xml::out={escaped_output_file}")]) stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), 'SelfTest', ['[approx][custom]']) -xml_tag = '</Catch2TestRun>' -if xml_tag not in stdout: - print("Could not find '{}' in the stdout".format(xml_tag)) - print('stdout: "{}"'.format(stdout)) +if not os.path.exists(output_file): + print(f'Did not find the {output_file} file') exit(2) + +xml_tag = '</Catch2TestRun>' +with open(output_file, 'r', encoding='utf-8') as file: + if xml_tag not in file.read(): + print(f"Could not find '{xml_tag}' in the file") + exit(3) diff --git a/packages/Catch2/tools/misc/CMakeLists.txt b/packages/Catch2/tools/misc/CMakeLists.txt index bf80846cd..59811dfe5 100644 --- a/packages/Catch2/tools/misc/CMakeLists.txt +++ b/packages/Catch2/tools/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.16) project(CatchCoverageHelper) diff --git a/packages/Catch2/tools/misc/appveyorTestRunScript.bat b/packages/Catch2/tools/misc/appveyorTestRunScript.bat index 5982fc929..661bae240 100644 --- a/packages/Catch2/tools/misc/appveyorTestRunScript.bat +++ b/packages/Catch2/tools/misc/appveyorTestRunScript.bat @@ -5,7 +5,7 @@ reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusion cd Build if "%CONFIGURATION%"=="Debug" ( if "%coverage%"=="1" ( - ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck || exit /b !ERRORLEVEL! + ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck -LE uses-signals || exit /b !ERRORLEVEL! python ..\tools\misc\appveyorMergeCoverageScript.py || exit /b !ERRORLEVEL! codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN% || exit /b !ERRORLEVEL! ) else ( diff --git a/packages/Catch2/tools/scripts/buildAndTest.cmd b/packages/Catch2/tools/scripts/buildAndTest.cmd index 7c10e564f..fa3591246 100644 --- a/packages/Catch2/tools/scripts/buildAndTest.cmd +++ b/packages/Catch2/tools/scripts/buildAndTest.cmd @@ -12,6 +12,5 @@ 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 +ctest -j 4 --output-on-failure -C Debug --test-dir debug-build rem end-snippet diff --git a/packages/Catch2/tools/scripts/buildAndTest.sh b/packages/Catch2/tools/scripts/buildAndTest.sh index 01a82837a..0383c97ee 100755 --- a/packages/Catch2/tools/scripts/buildAndTest.sh +++ b/packages/Catch2/tools/scripts/buildAndTest.sh @@ -14,6 +14,5 @@ cmake -B debug-build -S . -DCMAKE_BUILD_TYPE=Debug --preset all-tests cmake --build debug-build # 4. Run the tests using CTest -cd debug-build -ctest -j 4 --output-on-failure -C Debug +ctest -j 4 --output-on-failure -C Debug --test-dir debug-build # end-snippet diff --git a/packages/Catch2/tools/scripts/releaseCommon.py b/packages/Catch2/tools/scripts/releaseCommon.py index 1ff4af291..81efa7623 100644 --- a/packages/Catch2/tools/scripts/releaseCommon.py +++ b/packages/Catch2/tools/scripts/releaseCommon.py @@ -89,7 +89,7 @@ def updateCmakeFile(version): def updateMesonFile(version): with open(mesonPath, 'rb') as file: lines = file.readlines() - replacementRegex = re.compile(b'''version\s*:\s*'(\\d+.\\d+.\\d+)', # CML version placeholder, don't delete''') + replacementRegex = re.compile(b'''version\\s*:\\s*'(\\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(mesonPath, 'wb') as file: for line in lines: -- GitLab