From 5809f3aeb3dacfc19ff4e1808f64895e05d8c875 Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Thu, 11 Apr 2019 21:12:01 +0200 Subject: [PATCH] git subrepo pull packages/Catch2 subrepo: subdir: "packages/Catch2" merged: "36fb85616" upstream: origin: "git@github.com:catchorg/Catch2.git" branch: "master" commit: "36fb85616" git-subrepo: version: "0.4.0" origin: "git@github.com:ingydotnet/git-subrepo.git" commit: "5d6aba9" --- packages/Catch2/.conan/build.py | 2 +- .../.github/ISSUE_TEMPLATE/bug_report.md | 29 + .../.github/ISSUE_TEMPLATE/feature_request.md | 14 + packages/Catch2/.github/issue_template.md | 29 - .../Catch2/.github/pull_request_template.md | 2 +- packages/Catch2/.gitrepo | 4 +- packages/Catch2/.travis.yml | 4 +- packages/Catch2/CMake/FindGcov.cmake | 2 +- packages/Catch2/CMake/Findcodecov.cmake | 2 +- packages/Catch2/CMakeLists.txt | 2 +- packages/Catch2/README.md | 6 +- .../contrib/ParseAndAddCatchTests.cmake | 67 +- packages/Catch2/docs/assertions.md | 4 +- packages/Catch2/docs/cmake-integration.md | 2 +- packages/Catch2/docs/command-line.md | 2 +- packages/Catch2/docs/commercial-users.md | 2 + packages/Catch2/docs/configuration.md | 13 +- packages/Catch2/docs/contributing.md | 56 +- packages/Catch2/docs/deprecations.md | 5 + packages/Catch2/docs/generators.md | 145 +- packages/Catch2/docs/list-of-examples.md | 5 + packages/Catch2/docs/logging.md | 67 +- packages/Catch2/docs/matchers.md | 2 +- packages/Catch2/docs/opensource-users.md | 36 +- packages/Catch2/docs/other-macros.md | 4 +- packages/Catch2/docs/release-notes.md | 111 +- packages/Catch2/docs/release-process.md | 24 +- .../Catch2/docs/test-cases-and-sections.md | 4 +- packages/Catch2/docs/tutorial.md | 6 +- .../examples/210-Evt-EventListeners.cpp | 6 +- .../Catch2/examples/300-Gen-OwnGenerator.cpp | 59 + .../examples/301-Gen-MapTypeConversion.cpp | 54 + .../310-Gen-VariablesInGenerators.cpp | 33 + .../Catch2/examples/311-Gen-CustomCapture.cpp | 41 + packages/Catch2/examples/CMakeLists.txt | 4 + packages/Catch2/include/catch.hpp | 11 +- packages/Catch2/include/external/clara.hpp | 7 +- .../Catch2/include/internal/catch_capture.hpp | 6 +- .../Catch2/include/internal/catch_common.h | 8 +- .../internal/catch_compiler_capabilities.h | 16 +- .../Catch2/include/internal/catch_config.cpp | 5 +- .../Catch2/include/internal/catch_config.hpp | 2 +- .../include/internal/catch_console_colour.cpp | 3 +- .../include/internal/catch_debugger.cpp | 18 +- .../Catch2/include/internal/catch_debugger.h | 7 +- .../include/internal/catch_decomposer.h | 74 +- .../catch_exception_translator_registry.cpp | 18 +- .../internal/catch_fatal_condition.cpp | 8 +- .../include/internal/catch_generators.cpp | 28 +- .../include/internal/catch_generators.hpp | 259 +- .../internal/catch_generators_generic.hpp | 242 + .../internal/catch_generators_specific.hpp | 135 + .../internal/catch_interfaces_capture.h | 3 + .../internal/catch_interfaces_config.h | 1 + .../catch_interfaces_generatortracker.h | 18 +- .../internal/catch_interfaces_reporter.h | 4 +- .../internal/catch_interfaces_testcase.h | 3 - .../Catch2/include/internal/catch_list.cpp | 18 +- packages/Catch2/include/internal/catch_list.h | 2 +- .../internal/catch_matchers_generic.hpp | 2 +- .../Catch2/include/internal/catch_message.cpp | 10 +- .../Catch2/include/internal/catch_message.h | 3 + .../Catch2/include/internal/catch_meta.hpp | 69 +- .../Catch2/include/internal/catch_objc.hpp | 10 +- .../internal/catch_output_redirect.cpp | 11 +- .../include/internal/catch_output_redirect.h | 15 + .../include/internal/catch_preprocessor.hpp | 12 +- .../include/internal/catch_run_context.cpp | 36 +- .../include/internal/catch_run_context.h | 5 +- .../Catch2/include/internal/catch_session.cpp | 25 +- .../Catch2/include/internal/catch_stringref.h | 2 - .../internal/catch_suppress_warnings.h | 9 +- .../include/internal/catch_test_case_info.cpp | 8 +- .../catch_test_case_registry_impl.cpp | 9 +- .../internal/catch_test_case_tracker.cpp | 57 +- .../internal/catch_test_case_tracker.h | 23 +- .../include/internal/catch_test_registry.h | 14 +- .../Catch2/include/internal/catch_timer.cpp | 2 +- .../Catch2/include/internal/catch_tostring.h | 19 + .../include/internal/catch_type_traits.hpp | 2 + .../Catch2/include/internal/catch_version.cpp | 2 +- .../include/internal/catch_xmlwriter.cpp | 2 + .../reporters/catch_reporter_bases.cpp | 16 +- .../reporters/catch_reporter_bases.hpp | 3 + .../reporters/catch_reporter_console.cpp | 11 +- .../reporters/catch_reporter_console.h | 3 +- .../reporters/catch_reporter_junit.cpp | 16 + .../include/reporters/catch_reporter_tap.hpp | 2 +- .../include/reporters/catch_reporter_xml.cpp | 2 + packages/Catch2/misc/coverage-helper.cpp | 39 +- packages/Catch2/projects/CMakeLists.txt | 11 +- .../Baselines/compact.sw.approved.txt | 537 +- .../Baselines/console.std.approved.txt | 117 +- .../Baselines/console.sw.approved.txt | 7345 +++++++++-------- .../Baselines/console.swa4.approved.txt | 53 +- .../SelfTest/Baselines/junit.sw.approved.txt | 146 +- .../SelfTest/Baselines/xml.sw.approved.txt | 4607 +++++++---- .../GeneratorsImpl.tests.cpp | 311 +- .../IntrospectiveTests/PartTracker.tests.cpp | 166 +- .../{TagAlias.tests.cpp => Tag.tests.cpp} | 5 + .../SelfTest/UsageTests/Compilation.tests.cpp | 10 + .../SelfTest/UsageTests/Generators.tests.cpp | 212 +- .../SelfTest/UsageTests/Message.tests.cpp | 72 + .../UsageTests/ToStringGeneral.tests.cpp | 4 +- .../UsageTests/ToStringOptional.tests.cpp | 23 + .../UsageTests/ToStringVariant.tests.cpp | 37 +- .../SelfTest/UsageTests/Tricky.tests.cpp | 8 + .../XCode/OCTest/OCTest/CatchOCTestCase.mm | 2 +- packages/Catch2/scripts/scriptCommon.py | 9 +- .../Catch2/single_include/catch2/catch.hpp | 1534 +++- .../catch2/catch_reporter_tap.hpp | 2 +- packages/Catch2/third_party/clara.hpp | 3 + 112 files changed, 10672 insertions(+), 6725 deletions(-) create mode 100644 packages/Catch2/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 packages/Catch2/.github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 packages/Catch2/.github/issue_template.md create mode 100644 packages/Catch2/examples/300-Gen-OwnGenerator.cpp create mode 100644 packages/Catch2/examples/301-Gen-MapTypeConversion.cpp create mode 100644 packages/Catch2/examples/310-Gen-VariablesInGenerators.cpp create mode 100644 packages/Catch2/examples/311-Gen-CustomCapture.cpp create mode 100644 packages/Catch2/include/internal/catch_generators_generic.hpp create mode 100644 packages/Catch2/include/internal/catch_generators_specific.hpp rename packages/Catch2/projects/SelfTest/IntrospectiveTests/{TagAlias.tests.cpp => Tag.tests.cpp} (84%) create mode 100644 packages/Catch2/projects/SelfTest/UsageTests/ToStringOptional.tests.cpp diff --git a/packages/Catch2/.conan/build.py b/packages/Catch2/.conan/build.py index dfba26428..272986516 100644 --- a/packages/Catch2/.conan/build.py +++ b/packages/Catch2/.conan/build.py @@ -47,7 +47,7 @@ class BuilderSettings(object): @property def reference(self): - """ Read project version from branch create Conan referece + """ Read project version from branch create Conan reference """ return os.getenv("CONAN_REFERENCE", "Catch2/{}".format(self._version)) diff --git a/packages/Catch2/.github/ISSUE_TEMPLATE/bug_report.md b/packages/Catch2/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..dbeff1152 --- /dev/null +++ b/packages/Catch2/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Create an issue that documents a bug +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Reproduction steps** +Steps to reproduce the bug. +<!-- Usually this means a small and self-contained piece of code that uses Catch and specifying compiler flags if relevant. --> + + +**Platform information:** +<!-- Fill in any extra information that might be important for your issue. --> + - OS: **Windows NT** + - Compiler+version: **GCC v2.9.5** + - Catch version: **v1.2.3** + + +**Additional context** +Add any other context about the problem here. diff --git a/packages/Catch2/.github/ISSUE_TEMPLATE/feature_request.md b/packages/Catch2/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..be9b9eeae --- /dev/null +++ b/packages/Catch2/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,14 @@ +--- +name: Feature request +about: Create an issue that requests a feature or other improvement +title: '' +labels: '' +assignees: '' + +--- + +**Description** +Describe the feature/change you request and why do you want it. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/packages/Catch2/.github/issue_template.md b/packages/Catch2/.github/issue_template.md deleted file mode 100644 index 051b5e5f8..000000000 --- a/packages/Catch2/.github/issue_template.md +++ /dev/null @@ -1,29 +0,0 @@ -## Description -<!-- -If your issue is a bugreport, this means describing what you did, -what did you want to happen and what actually did happen. - -If your issue is a feature request, describe the feature and why do you -want it. ---> - - -### Steps to reproduce -<!-- -This is only relevant for bug reports, but if you do have one, -please provide a minimal set of steps to reproduce the problem. - -Usually this means providing a small and self-contained code using Catch -and specifying compiler flags/tools used if relevant. ---> - - -### Extra information -<!-- -Fill in any extra information that might be important for your issue. - -If your issue is a bugreport, definitely fill out at least the following. ---> -* Catch version: **v42.42.42** -* Operating System: **Joe's discount operating system** -* Compiler+version: **Hidden Dragon v1.2.3** diff --git a/packages/Catch2/.github/pull_request_template.md b/packages/Catch2/.github/pull_request_template.md index 368f41fb1..ea2b7bb5f 100644 --- a/packages/Catch2/.github/pull_request_template.md +++ b/packages/Catch2/.github/pull_request_template.md @@ -12,7 +12,7 @@ at docs/contributing.md. It will tell you how to properly test your changes. <!-- Describe the what and the why of your pull request. Remember that these two are usually a bit different. As an example, if you have made various changes -to decrease the number of new strings allocated, thats what. The why probably +to decrease the number of new strings allocated, that's what. The why probably was that you have a large set of tests and found that this speeds them up. --> diff --git a/packages/Catch2/.gitrepo b/packages/Catch2/.gitrepo index 69a7ef8a3..a2720b741 100644 --- a/packages/Catch2/.gitrepo +++ b/packages/Catch2/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = git@github.com:catchorg/Catch2.git branch = master - commit = 461843b1f02a4bf5c59db88ff201d2c56fabf3a4 - parent = 948c251985efea2e0b476fbab221850efee6a689 + commit = 36fb8561633cca30a66d47314e5da9c61c6a756b + parent = da523f3d6fb1784863693f1a678839df16f5084f cmdver = 0.4.0 method = merge diff --git a/packages/Catch2/.travis.yml b/packages/Catch2/.travis.yml index ebf238591..345edfbb3 100644 --- a/packages/Catch2/.travis.yml +++ b/packages/Catch2/.travis.yml @@ -276,7 +276,7 @@ matrix: - "3.7" dist: xenial install: - - pip install conan conan-package-tools + - pip install conan==1.10.2 conan-package-tools env: - CONAN_GCC_VERSIONS=8 - CONAN_DOCKER_IMAGE=conanio/gcc8 @@ -304,7 +304,7 @@ before_script: # Use Debug builds for running Valgrind and building examples - cmake -H. -BBuild-Debug -DCMAKE_BUILD_TYPE=Debug -Wdev -DUSE_CPP14=${CPP14} -DUSE_CPP17=${CPP17} -DCATCH_USE_VALGRIND=${VALGRIND} -DCATCH_BUILD_EXAMPLES=${EXAMPLES} -DCATCH_ENABLE_COVERAGE=${COVERAGE} -DCATCH_BUILD_EXTRA_TESTS=${EXTRAS} # Don't bother with release build for coverage build - - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -Wdev -DUSE_CPP14=${CPP14} + - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -Wdev -DUSE_CPP14=${CPP14} -DUSE_CPP17=${CPP17} script: diff --git a/packages/Catch2/CMake/FindGcov.cmake b/packages/Catch2/CMake/FindGcov.cmake index 6ffd6eacb..414171134 100644 --- a/packages/Catch2/CMake/FindGcov.cmake +++ b/packages/Catch2/CMake/FindGcov.cmake @@ -19,7 +19,7 @@ set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY}) get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) foreach (LANG ${ENABLED_LANGUAGES}) - # Gcov evaluation is dependend on the used compiler. Check gcov support for + # Gcov evaluation is dependent on the used compiler. Check gcov support for # each compiler that is used. If gcov binary was already found for this # compiler, do not try to find it again. if (NOT GCOV_${CMAKE_${LANG}_COMPILER_ID}_BIN) diff --git a/packages/Catch2/CMake/Findcodecov.cmake b/packages/Catch2/CMake/Findcodecov.cmake index fa135fa8f..2c0f2fee5 100644 --- a/packages/Catch2/CMake/Findcodecov.cmake +++ b/packages/Catch2/CMake/Findcodecov.cmake @@ -74,7 +74,7 @@ set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY}) get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) foreach (LANG ${ENABLED_LANGUAGES}) - # Coverage flags are not dependend on language, but the used compiler. So + # Coverage flags are not dependent on language, but the used compiler. So # instead of searching flags foreach language, search flags foreach compiler # used. set(COMPILER ${CMAKE_${LANG}_COMPILER_ID}) diff --git a/packages/Catch2/CMakeLists.txt b/packages/Catch2/CMakeLists.txt index 802ff4590..660910469 100644 --- a/packages/Catch2/CMakeLists.txt +++ b/packages/Catch2/CMakeLists.txt @@ -6,7 +6,7 @@ if(NOT DEFINED PROJECT_NAME) set(NOT_SUBPROJECT ON) endif() -project(Catch2 LANGUAGES CXX VERSION 2.5.0) +project(Catch2 LANGUAGES CXX VERSION 2.7.1) # Provide path for scripts list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") diff --git a/packages/Catch2/README.md b/packages/Catch2/README.md index f1f67f5b3..a09ad44bb 100644 --- a/packages/Catch2/README.md +++ b/packages/Catch2/README.md @@ -5,17 +5,17 @@ [](https://travis-ci.org/catchorg/Catch2) [](https://ci.appveyor.com/project/catchorg/catch2) [](https://codecov.io/gh/catchorg/Catch2) -[](https://wandbox.org/permlink/7lDqHmzKQxA2eaM0) +[](https://wandbox.org/permlink/ZFBZ5XbLA9F1gzKi) [](https://discord.gg/4CWS9zD) -<a href="https://github.com/catchorg/Catch2/releases/download/v2.5.0/catch.hpp">The latest version of the single header can be downloaded directly using this link</a> +<a href="https://github.com/catchorg/Catch2/releases/download/v2.7.1/catch.hpp">The latest version of the single header can be downloaded directly using this link</a> ## Catch2 is released! If you've been using an earlier version of Catch, please see the Breaking Changes section of [the release notes](https://github.com/catchorg/Catch2/releases/tag/v2.0.1) -before moving to Catch2. You might also like to read [this blog post](http://www.levelofindirection.com/journal/2017/11/3/catch2-released.html) for more details. +before moving to Catch2. You might also like to read [this blog post](https://levelofindirection.com/blog/catch2-released.html) for more details. ## What's the Catch? diff --git a/packages/Catch2/contrib/ParseAndAddCatchTests.cmake b/packages/Catch2/contrib/ParseAndAddCatchTests.cmake index e7c64f012..dac1dc926 100644 --- a/packages/Catch2/contrib/ParseAndAddCatchTests.cmake +++ b/packages/Catch2/contrib/ParseAndAddCatchTests.cmake @@ -44,9 +44,19 @@ # set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) # # just before calling this ParseAndAddCatchTests function # # # +# The AdditionalCatchParameters optional variable can be used to pass extra argument to the test # +# command. For example, to include successful tests in the output, one can write # +# set(AdditionalCatchParameters --success) # +# # +# After the script, the ParseAndAddCatchTests_TESTS property for the target, and for each source # +# file in the target is set, and contains the list of the tests extracted from that target, or # +# from that file. This is useful, for example to add further labels or properties to the tests. # +# # #==================================================================================================# -cmake_minimum_required(VERSION 2.8.8) +if (CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8) + message(FATAL_ERROR "ParseAndAddCatchTests requires CMake 2.8.8 or newer") +endif() option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF) option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF) @@ -54,7 +64,7 @@ option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON) option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF) -function(PrintDebugMessage) +function(ParseAndAddCatchTests_PrintDebugMessage) if(PARSE_CATCH_TESTS_VERBOSE) message(STATUS "ParseAndAddCatchTests: ${ARGV}") endif() @@ -65,7 +75,7 @@ endfunction() # - full line comments (i.e. // ... ) # contents have been read into '${CppCode}'. # !keep partial line comments -function(RemoveComments CppCode) +function(ParseAndAddCatchTests_RemoveComments CppCode) string(ASCII 2 CMakeBeginBlockComment) string(ASCII 3 CMakeEndBlockComment) string(REGEX REPLACE "/\\*" "${CMakeBeginBlockComment}" ${CppCode} "${${CppCode}}") @@ -77,24 +87,24 @@ function(RemoveComments CppCode) endfunction() # Worker function -function(ParseFile SourceFile TestTarget) +function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) # According to CMake docs EXISTS behavior is well-defined only for full paths. get_filename_component(SourceFile ${SourceFile} ABSOLUTE) if(NOT EXISTS ${SourceFile}) message(WARNING "Cannot find source file: ${SourceFile}") return() endif() - PrintDebugMessage("parsing ${SourceFile}") + ParseAndAddCatchTests_PrintDebugMessage("parsing ${SourceFile}") file(STRINGS ${SourceFile} Contents NEWLINE_CONSUME) # Remove block and fullline comments - RemoveComments(Contents) + ParseAndAddCatchTests_RemoveComments(Contents) # Find definition of test names string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^\)]+\\)+[ \t\n]*{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}") if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests) - PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property") + ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property") set_property( DIRECTORY APPEND @@ -109,7 +119,7 @@ function(ParseFile SourceFile TestTarget) # Get test type and fixture if applicable string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}") string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}") - string(REPLACE "${TestType}(" "" TestFixture "${TestTypeAndFixture}") + string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}") # Get string parts of test definition string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}") @@ -155,7 +165,6 @@ function(ParseFile SourceFile TestTarget) list(APPEND Labels ${Tags}) - list(FIND Labels "!hide" IndexOfHideLabel) set(HiddenTagFound OFF) foreach(label ${Labels}) string(REGEX MATCH "^!hide|^\\." result ${label}) @@ -164,30 +173,48 @@ function(ParseFile SourceFile TestTarget) break() endif(result) endforeach(label) - if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound}) - PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label") + if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9") + ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label") else() - PrintDebugMessage("Adding test \"${CTestName}\"") + ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"") if(Labels) - PrintDebugMessage("Setting labels to ${Labels}") + ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}") endif() + # Escape commas in the test spec + string(REPLACE "," "\\," Name ${Name}) + # Add the test and set its properties - add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} ${TestTarget} ${Name} ${AdditionalCatchParameters}) - set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" - LABELS "${Labels}") + add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters}) + # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead + if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8") + ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property") + set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON) + else() + set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" + LABELS "${Labels}") + endif() + set_property( + TARGET ${TestTarget} + APPEND + PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") + set_property( + SOURCE ${SourceFile} + APPEND + PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") endif() + endforeach() endfunction() # entry point function(ParseAndAddCatchTests TestTarget) - PrintDebugMessage("Started parsing ${TestTarget}") + ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}") get_target_property(SourceFiles ${TestTarget} SOURCES) - PrintDebugMessage("Found the following sources: ${SourceFiles}") + ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}") foreach(SourceFile ${SourceFiles}) - ParseFile(${SourceFile} ${TestTarget}) + ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget}) endforeach() - PrintDebugMessage("Finished parsing ${TestTarget}") + ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}") endfunction() diff --git a/packages/Catch2/docs/assertions.md b/packages/Catch2/docs/assertions.md index 900fd52c0..07d2484e7 100644 --- a/packages/Catch2/docs/assertions.md +++ b/packages/Catch2/docs/assertions.md @@ -10,7 +10,7 @@ Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc). -Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there are a rich set of auxiliary macros as well. We'll describe all of these here. +Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there is a rich set of auxiliary macros as well. We'll describe all of these here. Most of these macros come in two forms: @@ -61,7 +61,7 @@ Catch provides a way to perform tolerant comparisons of floating point values th REQUIRE( performComputation() == Approx( 2.1 ) ); ``` -Catch also provides a UDL for `Approx`; `_a`. It resides in +Catch also provides a user-defined literal for `Approx`; `_a`. It resides in the `Catch::literals` namespace and can be used like so: ```cpp using namespace Catch::literals; diff --git a/packages/Catch2/docs/cmake-integration.md b/packages/Catch2/docs/cmake-integration.md index 246e7f0ec..57073c40c 100644 --- a/packages/Catch2/docs/cmake-integration.md +++ b/packages/Catch2/docs/cmake-integration.md @@ -48,7 +48,7 @@ If Catch2 has been installed in system, both of these can be used after doing `find_package(Catch2 REQUIRED)`. Otherwise you need to add them to your CMake module path. -### `Catch.cmake` and `AddCatchTests.cmake` +### `Catch.cmake` and `CatchAddTests.cmake` `Catch.cmake` provides function `catch_discover_tests` to get tests from a target. This function works by running the resulting executable with diff --git a/packages/Catch2/docs/command-line.md b/packages/Catch2/docs/command-line.md index fc63fe87b..f68c84ca8 100644 --- a/packages/Catch2/docs/command-line.md +++ b/packages/Catch2/docs/command-line.md @@ -27,7 +27,7 @@ [Override output colouring](#override-output-colouring)<br> Catch works quite nicely without any command line options at all - but for those times when you want greater control the following options are available. -Click one of the followings links to take you straight to that option - or scroll on to browse the available options. +Click one of the following links to take you straight to that option - or scroll on to browse the available options. <a href="#specifying-which-tests-to-run"> ` <test-spec> ...`</a><br /> <a href="#usage"> ` -h, -?, --help`</a><br /> diff --git a/packages/Catch2/docs/commercial-users.md b/packages/Catch2/docs/commercial-users.md index e4d789f10..4f98f759f 100644 --- a/packages/Catch2/docs/commercial-users.md +++ b/packages/Catch2/docs/commercial-users.md @@ -13,5 +13,7 @@ fact then please let us know - either directly, via a PR or [issue](https://github.com/philsquared/Catch/issues), or on the [forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum). - Bloomberg + - [Bloomlife](https://bloomlife.com) - NASA - [Inscopix Inc.](https://www.inscopix.com/) + - [Makimo](https://makimo.pl/) diff --git a/packages/Catch2/docs/configuration.md b/packages/Catch2/docs/configuration.md index db1ebc728..c01d7f5e6 100644 --- a/packages/Catch2/docs/configuration.md +++ b/packages/Catch2/docs/configuration.md @@ -89,7 +89,7 @@ them yourself, their signatures are: By default, when Catch's stringification machinery has to stringify a type that does not specialize `StringMaker`, does not overload `operator<<`, is not an enumeration and is not a range, it uses `"{?}"`. This can be -overriden by defining `CATCH_CONFIG_FALLBACK_STRINGIFIER` to name of a +overridden by defining `CATCH_CONFIG_FALLBACK_STRINGIFIER` to name of a function that should perform the stringification instead. All types that do not provide `StringMaker` specialization or `operator<<` @@ -200,11 +200,12 @@ On Windows Catch includes `windows.h`. To minimize global namespace clutter in t By default, Catch does not stringify some types from the standard library. This is done to avoid dragging in various standard library headers by default. However, Catch does contain these and can be configured to provide them, using these macros: - CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER // Provide StringMaker specialization for std::pair - CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER // Provide StringMaker specialization for std::tuple - CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER // Provide StringMaker specialization for std::chrono::duration, std::chrono::timepoint - CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER // Provide StringMaker specialization for std::variant, std::monostate (on C++17) - CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS // Defines all of the above + CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER // Provide StringMaker specialization for std::pair + CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER // Provide StringMaker specialization for std::tuple + CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER // Provide StringMaker specialization for std::chrono::duration, std::chrono::timepoint + CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER // Provide StringMaker specialization for std::variant, std::monostate (on C++17) + CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER // Provide StringMaker specialization for std::optional (on C++17) + CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS // Defines all of the above ## Disabling exceptions diff --git a/packages/Catch2/docs/contributing.md b/packages/Catch2/docs/contributing.md index b6150375c..21bbad14c 100644 --- a/packages/Catch2/docs/contributing.md +++ b/packages/Catch2/docs/contributing.md @@ -1,8 +1,8 @@ <a id="top"></a> # Contributing to Catch -So you want to contribute something to Catch? That's great! Whether it's a bug fix, a new feature, support for -additional compilers - or just a fix to the documentation - all contributions are very welcome and very much appreciated. +So you want to contribute something to Catch? That's great! Whether it's a bug fix, a new feature, support for +additional compilers - or just a fix to the documentation - all contributions are very welcome and very much appreciated. Of course so are bug reports and other comments and questions. If you are contributing to the code base there are a few simple guidelines to keep in mind. This also includes notes to @@ -16,7 +16,7 @@ Ongoing development is currently on _master_. At some point an integration branc ## Directory structure -_Users_ of Catch primarily use the single header version. _Maintainers_ should work with the full source (which is still, +_Users_ of Catch primarily use the single header version. _Maintainers_ should work with the full source (which is still, primarily, in headers). This can be found in the `include` folder. There are a set of test files, currently under `projects/SelfTest`. The test app can be built via CMake from the `CMakeLists.txt` file in the root, or you can generate project files for Visual Studio, XCode, and others (instructions in the `projects` folder). If you have access to CLion, @@ -37,20 +37,42 @@ as these are managed by the scripts!__ ## Testing your changes -Obviously all changes to Catch's code should be tested. If you added new functionality, you should add tests covering and -showcasing it. Even if you have only made changes to Catch internals (ie you implemented some performance improvements), -you should still test your changes. - -This means 3 things - -* Compiling Catch's SelfTest project -- code that does not compile is evidently incorrect. Obviously, you are not expected to -have access to all compilers and platforms Catch supports, Catch's CI pipeline will compile your code using supported compilers -once you open a PR. -* Running the SelfTest binary. There should be no unexpected failures on simple run. -* Running Catch's approval tests. Approval tests compare current output of the SelfTest binary in various configurations against -known good output. Catch's repository provides utility scripts `approvalTests.py` to help you with this. It needs to be passed -the SelfTest binary compiled with your changes, like so: `$ ./scripts/approvalTests.py clang-build/SelfTest`. The output should -be fairly self-explanatory. +Obviously all changes to Catch's code should be tested. If you added new +functionality, you should add tests covering and showcasing it. Even if you have +only made changes to Catch internals (i.e. you implemented some performance +improvements), you should still test your changes. + +This means 2 things + +* Compiling Catch's SelfTest project: +``` +$ cd Catch2 +$ cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug +$ cmake --build debug-build +``` +because code that does not compile is evidently incorrect. Obviously, +you are not expected to have access to all the compilers and platforms +supported by Catch2, but you should at least smoke test your changes +on your platform. Our CI pipeline will check your PR against most of +the supported platforms, but it takes an hour to finish -- compiling +locally takes just a few minutes. + + +* Running the tests via CTest: +``` +$ cd debug-build +$ ctest -j 2 --output-on-failure +``` +If you added new tests, approval tests are very likely to fail. If they +do not, it means that your changes weren't run as part of them. This +_might_ be intentional, but usually is not. + +The approval tests compare current output of the SelfTest binary in various +configurations against known good outputs. The reason it fails is, +_usually_, that you've added new tests but have not yet approved the changes +they introduce. This is done with the `scripts/approve.py` script, but +before you do so, you need to check that the introduced changes are indeed +intentional. diff --git a/packages/Catch2/docs/deprecations.md b/packages/Catch2/docs/deprecations.md index b80476842..0489e1ff8 100644 --- a/packages/Catch2/docs/deprecations.md +++ b/packages/Catch2/docs/deprecations.md @@ -83,6 +83,11 @@ be changed so that hidden tests are included in a run only if they positively match a testspec. +### Console Colour API + +The API for Catch2's console colour will be changed to take an extra +argument, the stream to which the colour code should be applied. + --- [Home](Readme.md#top) diff --git a/packages/Catch2/docs/generators.md b/packages/Catch2/docs/generators.md index 40b42004e..57fdf44bb 100644 --- a/packages/Catch2/docs/generators.md +++ b/packages/Catch2/docs/generators.md @@ -1,50 +1,137 @@ <a id="top"></a> # Data Generators -_Generators are currently considered an experimental feature and their -API can change between versions freely._ - Data generators (also known as _data driven/parametrized test cases_) let you reuse the same set of assertions across different input values. In Catch2, this means that they respect the ordering and nesting -of the `TEST_CASE` and `SECTION` macros. - -How does combining generators and test cases work might be better -explained by an example: +of the `TEST_CASE` and `SECTION` macros, and their nested sections +are run once per each value in a generator. +This is best explained with an example: ```cpp TEST_CASE("Generators") { - auto i = GENERATE( range(1, 11) ); + auto i = GENERATE(1, 2, 3); + SECTION("one") { + auto j = GENERATE( -3, -2, -1 ); + REQUIRE(j < i); + } +} +``` + +The assertion in this test case will be run 9 times, because there +are 3 possible values for `i` (1, 2, and 3) and there are 3 possible +values for `j` (-3, -2, and -1). + + +There are 2 parts to generators in Catch2, the `GENERATE` macro together +with the already provided generators, and the `IGenerator<T>` interface +that allows users to implement their own generators. + +## Provided generators + +Catch2's provided generator functionality consists of three parts, + +* `GENERATE` macro, that serves to integrate generator expression with +a test case, +* 2 fundamental generators + * `ValueGenerator<T>` -- contains only single element + * `ValuesGenerator<T>` -- contains multiple elements +* 5 generic generators that modify other generators + * `FilterGenerator<T, Predicate>` -- filters out elements from a generator + for which the predicate returns "false" + * `TakeGenerator<T>` -- takes first `n` elements from a generator + * `RepeatGenerator<T>` -- repeats output from a generator `n` times + * `MapGenerator<T, U, Func>` -- returns the result of applying `Func` + on elements from a different generator + * `ChunkGenerator<T>` -- returns chunks (inside `std::vector`) of n elements from a generator +* 3 specific purpose generators + * `RandomIntegerGenerator<Integral>` -- generates random Integrals from range + * `RandomFloatGenerator<Float>` -- generates random Floats from range + * `RangeGenerator<T>` -- generates all values inside a specific range + +The generators also have associated helper functions that infer their +type, making their usage much nicer. These are + +* `value(T&&)` for `ValueGenerator<T>` +* `values(std::initializer_list<T>)` for `ValuesGenerator<T>` +* `filter(predicate, GeneratorWrapper<T>&&)` for `FilterGenerator<T, Predicate>` +* `take(count, GeneratorWrapper<T>&&)` for `TakeGenerator<T>` +* `repeat(repeats, GeneratorWrapper<T>&&)` for `RepeatGenerator<T>` +* `map(func, GeneratorWrapper<T>&&)` for `MapGenerator<T, U, Func>` (map `U` to `T`, deduced from `Func`) +* `map<T>(func, GeneratorWrapper<U>&&)` for `MapGenerator<T, U, Func>` (map `U` to `T`) +* `chunk(chunk-size, GeneratorWrapper<T>&&)` for `ChunkGenerator<T>` +* `random(IntegerOrFloat a, IntegerOrFloat b)` for `RandomIntegerGenerator` or `RandomFloatGenerator` +* `range(start, end)` for `RangeGenerator<T>` with a step size of `1` +* `range(start, end, step)` for `RangeGenerator<T>` with a custom step size - SECTION( "Some section" ) { - auto j = GENERATE( range( 11, 21 ) ); - REQUIRE(i < j); + +And can be used as shown in the example below to create a generator +that returns 100 odd random number: + +```cpp +TEST_CASE("Generating random ints", "[example][generator]") { + SECTION("Deducing functions") { + auto i = GENERATE(take(100, filter([](int i) { return i % 2 == 1; }, random(-100, 100)))); + REQUIRE(i > -100); + REQUIRE(i < 100); + REQUIRE(i % 2 == 1); } } ``` -the assertion will be checked 100 times, because there are 10 possible -values for `i` (1, 2, ..., 10) and for each of them, there are 10 possible -values for `j` (11, 12, ..., 20). -You can also combine multiple generators by concatenation: +Apart from registering generators with Catch2, the `GENERATE` macro has +one more purpose, and that is to provide simple way of generating trivial +generators, as seen in the first example on this page, where we used it +as `auto i = GENERATE(1, 2, 3);`. This usage converted each of the three +literals into a single `ValueGenerator<int>` and then placed them all in +a special generator that concatenates other generators. It can also be +used with other generators as arguments, such as `auto i = GENERATE(0, 2, +take(100, random(300, 3000)));`. This is useful e.g. if you know that +specific inputs are problematic and want to test them separately/first. + +**For safety reasons, you cannot use variables inside the `GENERATE` macro. +This is done because the generator expression _will_ outlive the outside +scope and thus capturing references is dangerous. If you need to use +variables inside the generator expression, make sure you thought through +the lifetime implications and use `GENERATE_COPY` or `GENERATE_REF`.** + +You can also override the inferred type by using `as<type>` as the first +argument to the macro. This can be useful when dealing with string literals, +if you want them to come out as `std::string`: + ```cpp -static int square(int x) { return x * x; } -TEST_CASE("Generators 2") { - auto i = GENERATE(0, 1, -1, range(-20, -10), range(10, 20)); - CAPTURE(i); - REQUIRE(square(i) >= 0); +TEST_CASE("type conversion", "[generators]") { + auto str = GENERATE(as<std::string>{}, "a", "bb", "ccc"); + REQUIRE(str.size() > 0); } ``` -This will call `square` with arguments `0`, `1`, `-1`, `-20`, ..., `-11`, -`10`, ..., `19`. +## Generator interface + +You can also implement your own generators, by deriving from the +`IGenerator<T>` interface: + +```cpp +template<typename T> +struct IGenerator : GeneratorUntypedBase { + // via GeneratorUntypedBase: + // Attempts to move the generator to the next element. + // Returns true if successful (and thus has another element that can be read) + virtual bool next() = 0; + + // Precondition: + // The generator is either freshly constructed or the last call to next() returned true + virtual T const& get() const = 0; +}; +``` + +However, to be able to use your custom generator inside `GENERATE`, it +will need to be wrapped inside a `GeneratorWrapper<T>`. +`GeneratorWrapper<T>` is a value wrapper around a +`std::unique_ptr<IGenerator<T>>`. ----------- +For full example of implementing your own generator, look into Catch2's +examples, specifically +[Generators: Create your own generator](../examples/300-Gen-OwnGenerator.cpp). -Because of the experimental nature of the current Generator implementation, -we won't list all of the first-party generators in Catch2. Instead you -should look at our current usage tests in -[projects/SelfTest/UsageTests/Generators.tests.cpp](/projects/SelfTest/UsageTests/Generators.tests.cpp). -For implementing your own generators, you can look at their implementation in -[include/internal/catch_generators.hpp](/include/internal/catch_generators.hpp). diff --git a/packages/Catch2/docs/list-of-examples.md b/packages/Catch2/docs/list-of-examples.md index 5b538da03..95e7bda0c 100644 --- a/packages/Catch2/docs/list-of-examples.md +++ b/packages/Catch2/docs/list-of-examples.md @@ -14,6 +14,11 @@ - Report: [TeamCity reporter](../examples/207-Rpt-TeamCityReporter.cpp) - Listener: [Listeners](../examples/210-Evt-EventListeners.cpp) - Configuration: [Provide your own output streams](../examples/231-Cfg-OutputStreams.cpp) +- Generators: [Create your own generator](../examples/300-Gen-OwnGenerator.cpp) +- Generators: [Use map to convert types in GENERATE expression](../examples/301-Gen-MapTypeConversion.cpp) +- Generators: [Use variables in generator expressions](../examples/310-Gen-VariablesInGenerators.cpp) +- Generators: [Use custom variable capture in generator expressions](../examples/311-Gen-CustomCapture.cpp) + ## Planned diff --git a/packages/Catch2/docs/logging.md b/packages/Catch2/docs/logging.md index 423ce6a87..7b5c6c4b7 100644 --- a/packages/Catch2/docs/logging.md +++ b/packages/Catch2/docs/logging.md @@ -1,7 +1,7 @@ <a id="top"></a> # Logging macros -Additional messages can be logged during a test case. Note that the messages are scoped and thus will not be reported if failure occurs in scope preceding the message declaration. An example: +Additional messages can be logged during a test case. Note that the messages logged with `INFO` are scoped and thus will not be reported if failure occurs in scope preceding the message declaration. An example: ```cpp TEST_CASE("Foo") { @@ -28,10 +28,64 @@ The number is 1 ``` When the last `CHECK` fails in the "Bar" test case, then only one message will be printed: `Test case start`. +## Logging without local scope + +`UNSCOPED_INFO` is similar to `INFO` with two key differences: + +- Lifetime of an unscoped message is not tied to its own scope. +- An unscoped message can be reported by the first following assertion only, regardless of the result of that assertion. + +In other words, lifetime of `UNSCOPED_INFO` is limited by the following assertion (or by the end of test case/section, whichever comes first) whereas lifetime of `INFO` is limited by its own scope. + +These differences make this macro useful for reporting information from helper functions or inner scopes. An example: + +```cpp +void print_some_info() { + UNSCOPED_INFO("Info from helper"); +} + +TEST_CASE("Baz") { + print_some_info(); + for (int i = 0; i < 2; ++i) { + UNSCOPED_INFO("The number is " << i); + } + CHECK(false); +} + +TEST_CASE("Qux") { + INFO("First info"); + UNSCOPED_INFO("First unscoped info"); + CHECK(false); + + INFO("Second info"); + UNSCOPED_INFO("Second unscoped info"); + CHECK(false); +} +``` + +"Baz" test case prints: +``` +Info from helper +The number is 0 +The number is 1 +``` + +With "Qux" test case, two messages will be printed when the first `CHECK` fails: +``` +First info +First unscoped info +``` + +"First unscoped info" message will be cleared after the first `CHECK`, while "First info" message will persist until the end of the test case. Therefore, when the second `CHECK` fails, three messages will be printed: +``` +First info +Second info +Second unscoped info +``` ## Streaming macros -All these macros allow heterogenous sequences of values to be streaming using the insertion operator (```<<```) in the same way that std::ostream, std::cout, etc support it. +All these macros allow heterogeneous sequences of values to be streaming using the insertion operator (```<<```) in the same way that std::ostream, std::cout, etc support it. E.g.: ```c++ @@ -43,7 +97,14 @@ These macros come in three forms: **INFO(** _message expression_ **)** -The message is logged to a buffer, but only reported with the next assertion that is logged. This allows you to log contextual information in case of failures which is not shown during a successful test run (for the console reporter, without -s). Messages are removed from the buffer at the end of their scope, so may be used, for example, in loops. +The message is logged to a buffer, but only reported with next assertions that are logged. This allows you to log contextual information in case of failures which is not shown during a successful test run (for the console reporter, without -s). Messages are removed from the buffer at the end of their scope, so may be used, for example, in loops. + +_Note that in Catch2 2.x.x `INFO` can be used without a trailing semicolon as there is a trailing semicolon inside macro. +This semicolon will be removed with next major version. It is highly advised to use a trailing semicolon after `INFO` macro._ + +**UNSCOPED_INFO(** _message expression_ **)** + +Similar to `INFO`, but messages are not limited to their own scope: They are removed from the buffer after each assertion, section or test case, whichever comes first. **WARN(** _message expression_ **)** diff --git a/packages/Catch2/docs/matchers.md b/packages/Catch2/docs/matchers.md index adbd4ce7b..e3d936bd5 100644 --- a/packages/Catch2/docs/matchers.md +++ b/packages/Catch2/docs/matchers.md @@ -100,7 +100,7 @@ public: // include any provided data (the begin/ end in this case) and // be written as if it were stating a fact (in the output it will be // preceded by the value under test). - virtual std::string describe() const { + virtual std::string describe() const override { std::ostringstream ss; ss << "is between " << m_begin << " and " << m_end; return ss.str(); diff --git a/packages/Catch2/docs/opensource-users.md b/packages/Catch2/docs/opensource-users.md index f094167e5..489bbdcc6 100644 --- a/packages/Catch2/docs/opensource-users.md +++ b/packages/Catch2/docs/opensource-users.md @@ -17,29 +17,32 @@ Listing a project here does not imply endorsement and the plan is to keep these ## Libraries & Frameworks +### [ApprovalTests.cpp](https://github.com/approvals/ApprovalTests.cpp) +C++11 implementation of Approval Tests, for quick, convenient testing of legacy code. + ### [Azmq](https://github.com/zeromq/azmq) -Boost Asio style bindings for ZeroMQ +Boost Asio style bindings for ZeroMQ. ### [ChakraCore](https://github.com/Microsoft/ChakraCore) -The core part of the Chakra JavaScript engine that powers Microsoft Edge +The core part of the Chakra JavaScript engine that powers Microsoft Edge. ### [ChaiScript](https://github.com/ChaiScript/ChaiScript) -A, header-only, embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques +A, header-only, embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques. ### [Clara](https://github.com/philsquared/Clara) A, single-header-only, type-safe, command line parser - which also prints formatted usage strings. ### [Couchbase-lite-core](https://github.com/couchbase/couchbase-lite-core) -The next-generation core storage and query engine for Couchbase Lite +The next-generation core storage and query engine for Couchbase Lite. ### [cppcodec](https://github.com/tplgy/cppcodec) Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32. ### [DtCraft](https://github.com/twhuang-uiuc/DtCraft) -A High-performance Cluster Computing Engine +A High-performance Cluster Computing Engine. ### [forest](https://github.com/xorz57/forest) -Template Library of Tree Data Structures +Template Library of Tree Data Structures. ### [Fuxedo](https://github.com/fuxedo/fuxedo) Open source Oracle Tuxedo-like XATMI middleware for C and C++. @@ -63,25 +66,25 @@ A small C++ library wrapper for the native C ODBC API. A header-only framework for benchmarking small snippets of C++ code. ### [SOCI](https://github.com/SOCI/soci) -The C++ Database Access Library +The C++ Database Access Library. ### [polymorphic_value](https://github.com/jbcoe/polymorphic_value) -A polymorphic value-type for C++ +A polymorphic value-type for C++. ### [Ppconsul](https://github.com/oliora/ppconsul) -A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure +A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure. ### [Reactive-Extensions/ RxCpp](https://github.com/Reactive-Extensions/RxCpp) -A library of algorithms for values-distributed-in-time +A library of algorithms for values-distributed-in-time. ### [thor](https://github.com/xorz57/thor) -Wrapper Library for CUDA +Wrapper Library for CUDA. ### [TextFlowCpp](https://github.com/philsquared/textflowcpp) -A small, single-header-only, library for wrapping and composing columns of text +A small, single-header-only, library for wrapping and composing columns of text. ### [Trompeloeil](https://github.com/rollbear/trompeloeil) -A thread safe header only mocking framework for C++14 +A thread-safe header-only mocking framework for C++14. ### [args](https://github.com/Taywee/args) A simple header-only C++ argument parser library. @@ -95,16 +98,19 @@ ArangoDB is a native multi-model database with flexible data models for document Minimal, open-source and cross-platform audio tool for live music production. ### [MAME](https://github.com/mamedev/mame) -MAME originally stood for Multiple Arcade Machine Emulator +MAME originally stood for Multiple Arcade Machine Emulator. ### [Newsbeuter](https://github.com/akrennmair/newsbeuter) Newsbeuter is an open-source RSS/Atom feed reader for text terminals. +### [raspigcd](https://github.com/pantadeusz/raspigcd) +Low level CLI app and library for execution of GCODE on Raspberry Pi without any additional microcontrolers (just RPi + Stepsticks). + ### [SpECTRE](https://github.com/sxs-collaboration/spectre) SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics. ### [Standardese](https://github.com/foonathan/standardese) -Standardese aims to be a nextgen Doxygen +Standardese aims to be a nextgen Doxygen. --- diff --git a/packages/Catch2/docs/other-macros.md b/packages/Catch2/docs/other-macros.md index 6f5fac7b0..345234d55 100644 --- a/packages/Catch2/docs/other-macros.md +++ b/packages/Catch2/docs/other-macros.md @@ -30,7 +30,7 @@ CHECKED_IF( a == b ) { `CHECK_NOFAIL( expr )` is a variant of `CHECK` that does not fail the test case if _expr_ evaluates to `false`. This can be useful for checking some -assumption, that might be violated without the test neccessarily failing. +assumption, that might be violated without the test necessarily failing. Example output: ``` @@ -120,7 +120,7 @@ constructor, or before Catch2's session is created in user's own main._ `ANON_TEST_CASE` is a `TEST_CASE` replacement that will autogenerate unique name. The advantage of this is that you do not have to think of a name for the test case,`the disadvantage is that the name doesn't -neccessarily remain stable across different links, and thus it might be +necessarily remain stable across different links, and thus it might be hard to run directly. Example: diff --git a/packages/Catch2/docs/release-notes.md b/packages/Catch2/docs/release-notes.md index bc85006de..528f6cf12 100644 --- a/packages/Catch2/docs/release-notes.md +++ b/packages/Catch2/docs/release-notes.md @@ -2,6 +2,10 @@ # Release notes **Contents**<br> +[2.7.1](#271)<br> +[2.7.0](#270)<br> +[2.6.1](#261)<br> +[2.6.0](#260)<br> [2.5.0](#250)<br> [2.4.2](#242)<br> [2.4.1](#241)<br> @@ -18,6 +22,109 @@ [Older versions](#older-versions)<br> [Even Older versions](#even-older-versions)<br> +## 2.7.1 + +### Improvements +* Reporters now print out the filters applied to test cases (#1550, #1585) +* Added `GENERATE_COPY` and `GENERATE_VAR` macros that can use variables inside the generator expression + * Because of the significant danger of lifetime issues, the default `GENERATE` macro still does not allow variables +* The `map` generator helper now deduces the mapped return type (#1576) + +### Fixes +* Fixed ObjC++ compilation (#1571) +* Fixed test tag parsing so that `[.foo]` is now parsed as `[.][foo]`. +* Suppressed warning caused by the Windows headers defining SE codes in different manners (#1575) + +## 2.7.0 + +### Improvements +* `TEMPLATE_PRODUCT_TEST_CASE` now uses the resulting type in the name, instead of the serial number (#1544) +* Catch2's single header is now strictly ASCII (#1542) +* Added generator for random integral/floating point types + * The types are inferred within the `random` helper +* Added back RangeGenerator (#1526) + * RangeGenerator returns elements within a certain range +* Added ChunkGenerator generic transform (#1538) + * A ChunkGenerator returns the elements from different generator in chunks of n elements +* Added `UNSCOPED_INFO` (#415, #983, #1522) + * This is a variant of `INFO` that lives until next assertion/end of the test case. + + +### Fixes +* All calls to C stdlib functions are now `std::` qualified (#1541) + * Code brought in from Clara was also updated. +* Running tests will no longer open the specified output file twice (#1545) + * This would cause trouble when the file was not a file, but rather a named pipe + * Fixes the CLion/Resharper integration with Catch +* Fixed `-Wunreachable-code` occurring with (old) ccache+cmake+clang combination (#1540) +* Fixed `-Wdefaulted-function-deleted` warning with Clang 8 (#1537) +* Catch2's type traits and helpers are now properly namespaced inside `Catch::` (#1548) +* Fixed std{out,err} redirection for failing test (#1514, #1525) + * Somehow, this bug has been present for well over a year before it was reported + + +### Contrib +* `ParseAndAddCatchTests` now properly escapes commas in the test name + + + +## 2.6.1 + +### Improvements +* The JUnit reporter now also reports random seed (#1520, #1521) + +### Fixes +* The TAP reporter now formats comments with test name properly (#1529) +* `CATCH_REQUIRE_THROWS`'s internals were unified with `REQUIRE_THROWS` (#1536) + * This fixes a potential `-Wunused-value` warning when used +* Fixed a potential segfault when using any of the `--list-*` options (#1533, #1534) + + +## 2.6.0 + +**With this release the data generator feature is now fully supported.** + + +### Improvements +* Added `TEMPLATE_PRODUCT_TEST_CASE` (#1454, #1468) + * This allows you to easily test various type combinations, see documentation for details +* The error message for `&&` and `||` inside assertions has been improved (#1273, #1480) +* The error message for chained comparisons inside assertions has been improved (#1481) +* Added `StringMaker` specialization for `std::optional` (#1510) +* The generator interface has been redone once again (#1516) + * It is no longer considered experimental and is fully supported + * The new interface supports "Input" generators + * The generator documentation has been fully updated + * We also added 2 generator examples + + +### Fixes +* Fixed `-Wredundant-move` on newer Clang (#1474) +* Removed unreachable mentions `std::current_exception`, `std::rethrow_exception` in no-exceptions mode (#1462) + * This should fix compilation with IAR +* Fixed missing `<type_traits>` include (#1494) +* Fixed various static analysis warnings + * Unrestored stream state in `XmlWriter` (#1489) + * Potential division by zero in `estimateClockResolution` (#1490) + * Uninitialized member in `RunContext` (#1491) + * `SourceLineInfo` move ops are now marked `noexcept` + * `CATCH_BREAK_INTO_DEBUGGER` is now always a function +* Fix double run of a test case if user asks for a specific section (#1394, #1492) +* ANSI colour code output now respects `-o` flag and writes to the file as well (#1502) +* Fixed detection of `std::variant` support for compilers other than Clang (#1511) + + +### Contrib +* `ParseAndAddCatchTests` has learned how to use `DISABLED` CTest property (#1452) +* `ParseAndAddCatchTests` now works when there is a whitspace before the test name (#1493) + + +### Miscellaneous +* We added new issue templates for reporting issues on GitHub +* `contributing.md` has been updated to reflect the current test status (#1484) + + + ## 2.5.0 ### Improvements @@ -631,7 +738,7 @@ Cygwin issue with `gettimeofday` - `#define` was not early enough * Usage of `gettimeofday` inside Catch should no longer cause compilation errors. * Improved `-Wparentheses` suppression for gcc (#674) * When compiled with gcc 4.8 or newer, the suppression is localized to assertions only - * Otherwise it is supressed for the whole TU + * Otherwise it is suppressed for the whole TU * Fixed test spec parser issue (with escapes in multiple names) ##### Other @@ -714,7 +821,7 @@ Other: ##### Other: * Types with overloaded `&&` operator are no longer evaluated twice when used in an assertion macro. -* The use of `__COUNTER__` is supressed when Catch is parsed by CLion +* The use of `__COUNTER__` is suppressed when Catch is parsed by CLion * This change is not active when compiling a binary * Approval tests can now be run on Windows * CMake will now warn if a file is present in the `include` folder but not is not enumerated as part of the project diff --git a/packages/Catch2/docs/release-process.md b/packages/Catch2/docs/release-process.md index 91e338c3a..7fa5f7e17 100644 --- a/packages/Catch2/docs/release-process.md +++ b/packages/Catch2/docs/release-process.md @@ -32,7 +32,7 @@ Once a release is ready, release notes need to be written. They should summarize ### Commit and push update to GitHub -After version number is incremented, single-include header is regenerated and release notes are updated, changes should be commited and pushed to GitHub. +After version number is incremented, single-include header is regenerated and release notes are updated, changes should be committed and pushed to GitHub. ### Release on GitHub @@ -48,3 +48,25 @@ dependent on a specific version of the single-include header. Since 2.5.0, the release tag and the "binaries" (headers) should be PGP signed. + +#### Signing a tag + +To create a signed tag, use `git tag -s <VERSION>`, where `<VERSION>` +is the version being released, e.g. `git tag -s v2.6.0`. + +Use the version name as the short message and the release notes as +the body (long) message. + +#### Signing the headers + +This will create ASCII-armored signatures for the headers that are +uploaded to the GitHub release: + +``` +$ gpg2 --armor --output catch.hpp.asc --detach-sig catch.hpp +$ gpg2 --armor --output catch_reporter_automake.hpp.asc --detach-sig catch_reporter_automake.hpp +$ gpg2 --armor --output catch_reporter_teamcity.hpp.asc --detach-sig catch_reporter_teamcity.hpp +$ gpg2 --armor --output catch_reporter_tap.hpp.asc --detach-sig catch_reporter_tap.hpp +``` + +_GPG does not support signing multiple files in single invocation._ diff --git a/packages/Catch2/docs/test-cases-and-sections.md b/packages/Catch2/docs/test-cases-and-sections.md index abd55cd09..62a805f49 100644 --- a/packages/Catch2/docs/test-cases-and-sections.md +++ b/packages/Catch2/docs/test-cases-and-sections.md @@ -165,7 +165,7 @@ or the _template-args_. Example: -``` +```cpp template< typename T> struct Foo { size_t size() { @@ -180,7 +180,7 @@ TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]" ``` You can also have different arities in the _template-arg_ packs: -``` +```cpp TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) { TestType x; REQUIRE(std::tuple_size<TestType>::value >= 1); diff --git a/packages/Catch2/docs/tutorial.md b/packages/Catch2/docs/tutorial.md index 7c0f81450..e45f967e2 100644 --- a/packages/Catch2/docs/tutorial.md +++ b/packages/Catch2/docs/tutorial.md @@ -23,7 +23,7 @@ The full source for Catch2, including test projects, documentation, and other th ## Where to put it? -Catch2 is header only. All you need to do is drop the file somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](http://www.levelofindirection.com/journal/2011/5/27/unit-testing-in-c-and-objective-c-just-got-ridiculously-easi.html). +Catch2 is header only. All you need to do is drop the file somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](https://levelofindirection.com/blog/unit-testing-in-cpp-and-objective-c-just-got-ridiculously-easier-still.html). The rest of this tutorial will assume that the Catch2 single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary. @@ -103,7 +103,7 @@ Of course there are still more issues to deal with. For example we'll hit proble ### What did we do here? -Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take moment to consider those before we move on. +Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take a moment to consider those before we move on. 1. All we did was ```#define``` one identifier and ```#include``` one header and we got everything - even an implementation of ```main()``` that will [respond to command line arguments](command-line.md#top). You can only use that ```#define``` in one implementation file, for (hopefully) obvious reasons. Once you have more than one file with unit tests in you'll just ```#include "catch.hpp"``` and go. Usually it's a good idea to have a dedicated implementation file that just has ```#define CATCH_CONFIG_MAIN``` and ```#include "catch.hpp"```. You can also provide your own implementation of main and drive Catch yourself (see [Supplying-your-own-main()](own-main.md#top)). 2. We introduce test cases with the ```TEST_CASE``` macro. This macro takes one or two arguments - a free form test name and, optionally, one or more tags (for more see <a href="#test-cases-and-sections">Test cases and Sections</a>, ). The test name must be unique. You can run sets of tests by specifying a wildcarded test name or a tag expression. See the [command line docs](command-line.md#top) for more information on running tests. @@ -159,7 +159,7 @@ This works because the ```SECTION``` macro contains an if statement that calls b So far so good - this is already an improvement on the setup/teardown approach because now we see our setup code inline and use the stack. -The power of sections really shows, however, when we need to execute a sequence of, checked, operations. Continuing the vector example, we might want to verify that attempting to reserve a capacity smaller than the current capacity of the vector changes nothing. We can do that, naturally, like so: +The power of sections really shows, however, when we need to execute a sequence of checked operations. Continuing the vector example, we might want to verify that attempting to reserve a capacity smaller than the current capacity of the vector changes nothing. We can do that, naturally, like so: ```c++ SECTION( "reserving bigger changes capacity but not size" ) { diff --git a/packages/Catch2/examples/210-Evt-EventListeners.cpp b/packages/Catch2/examples/210-Evt-EventListeners.cpp index 7df93d715..fde51c7ea 100644 --- a/packages/Catch2/examples/210-Evt-EventListeners.cpp +++ b/packages/Catch2/examples/210-Evt-EventListeners.cpp @@ -387,16 +387,16 @@ TEST_CASE( "2: Testcase with sections", "[tag-A][tag-B]" ) { REQUIRE( i == 42 ); SECTION("Section 1") { - INFO("Section 1") + INFO("Section 1"); i = 7; SECTION("Section 1.1") { - INFO("Section 1.1") + INFO("Section 1.1"); REQUIRE( i == 42 ); } } SECTION("Section 2") { - INFO("Section 2") + INFO("Section 2"); REQUIRE( i == 42 ); } WARN("At end of test case"); diff --git a/packages/Catch2/examples/300-Gen-OwnGenerator.cpp b/packages/Catch2/examples/300-Gen-OwnGenerator.cpp new file mode 100644 index 000000000..c8b6a65df --- /dev/null +++ b/packages/Catch2/examples/300-Gen-OwnGenerator.cpp @@ -0,0 +1,59 @@ +// 300-Gen-OwnGenerator.cpp +// Shows how to define a custom generator. + +// Specifically we will implement a random number generator for integers +// It will have infinite capacity and settable lower/upper bound + +#include <catch2/catch.hpp> + +#include <random> + +// This class shows how to implement a simple generator for Catch tests +class RandomIntGenerator : public Catch::Generators::IGenerator<int> { + std::minstd_rand m_rand; + std::uniform_int_distribution<> m_dist; + int current_number; +public: + + RandomIntGenerator(int low, int high): + m_rand(std::random_device{}()), + m_dist(low, high) + { + static_cast<void>(next()); + } + + int const& get() const override; + bool next() override { + current_number = m_dist(m_rand); + return true; + } +}; + +// Avoids -Wweak-vtables +int const& RandomIntGenerator::get() const { + return current_number; +} + +// This helper function provides a nicer UX when instantiating the generator +// Notice that it returns an instance of GeneratorWrapper<int>, which +// is a value-wrapper around std::unique_ptr<IGenerator<int>>. +Catch::Generators::GeneratorWrapper<int> random(int low, int high) { + return Catch::Generators::GeneratorWrapper<int>(std::unique_ptr<Catch::Generators::IGenerator<int>>(new RandomIntGenerator(low, high))); +} + +// The two sections in this test case are equivalent, but the first one +// is much more readable/nicer to use +TEST_CASE("Generating random ints", "[example][generator]") { + SECTION("Nice UX") { + auto i = GENERATE(take(100, random(-100, 100))); + REQUIRE(i >= -100); + REQUIRE(i <= 100); + } + SECTION("Creating the random generator directly") { + auto i = GENERATE(take(100, GeneratorWrapper<int>(std::unique_ptr<IGenerator<int>>(new RandomIntGenerator(-100, 100))))); + REQUIRE(i >= -100); + REQUIRE(i <= 100); + } +} + +// Compiling and running this file will result in 400 successful assertions diff --git a/packages/Catch2/examples/301-Gen-MapTypeConversion.cpp b/packages/Catch2/examples/301-Gen-MapTypeConversion.cpp new file mode 100644 index 000000000..b6377e99d --- /dev/null +++ b/packages/Catch2/examples/301-Gen-MapTypeConversion.cpp @@ -0,0 +1,54 @@ +// 301-Gen-MapTypeConversion.cpp +// Shows how to use map to modify generator's return type. + +// TODO + +#include <catch2/catch.hpp> + +#include <string> +#include <sstream> + +// Returns a line from a stream. You could have it e.g. read lines from +// a file, but to avoid problems with paths in examples, we will use +// a fixed stringstream. +class LineGenerator : public Catch::Generators::IGenerator<std::string> { + std::string m_line; + std::stringstream m_stream; +public: + LineGenerator() { + m_stream.str("1\n2\n3\n4\n"); + if (!next()) { + throw Catch::GeneratorException("Couldn't read a single line"); + } + } + + std::string const& get() const override { + return m_line; + } + + bool next() override { + return !!std::getline(m_stream, m_line); + } +}; + +// This helper function provides a nicer UX when instantiating the generator +// Notice that it returns an instance of GeneratorWrapper<std::string>, which +// is a value-wrapper around std::unique_ptr<IGenerator<std::string>>. +Catch::Generators::GeneratorWrapper<std::string> lines(std::string /* ignored for example */) { + return Catch::Generators::GeneratorWrapper<std::string>( + std::unique_ptr<Catch::Generators::IGenerator<std::string>>( + new LineGenerator() + ) + ); +} + + + +TEST_CASE("filter can convert types inside the generator expression", "[example][generator]") { + auto num = GENERATE(map<int>([](std::string const& line) { return std::stoi(line); }, + lines("fake-file"))); + + REQUIRE(num > 0); +} + +// Compiling and running this file will result in 4 successful assertions diff --git a/packages/Catch2/examples/310-Gen-VariablesInGenerators.cpp b/packages/Catch2/examples/310-Gen-VariablesInGenerators.cpp new file mode 100644 index 000000000..422815d24 --- /dev/null +++ b/packages/Catch2/examples/310-Gen-VariablesInGenerators.cpp @@ -0,0 +1,33 @@ +// 310-Gen-VariablesInGenerator.cpp +// Shows how to use variables when creating generators. + +// Note that using variables inside generators is dangerous and should +// be done only if you know what you are doing, because the generators +// _WILL_ outlive the variables -- thus they should be either captured +// by value directly, or copied by the generators during construction. + +#include <catch2/catch.hpp> + +TEST_CASE("Generate random doubles across different ranges", + "[generator][example][advanced]") { + // Workaround for old libstdc++ + using record = std::tuple<double, double>; + // Set up 3 ranges to generate numbers from + auto r = GENERATE(table<double, double>({ + record{3, 4}, + record{-4, -3}, + record{10, 1000} + })); + + // This will not compile (intentionally), because it accesses a variable + // auto number = GENERATE(take(50, random(std::get<0>(r), std::get<1>(r)))); + + // GENERATE_COPY copies all variables mentioned inside the expression + // thus this will work. + auto number = GENERATE_COPY(take(50, random(std::get<0>(r), std::get<1>(r)))); + + REQUIRE(std::abs(number) > 0); +} + +// Compiling and running this file will result in 150 successful assertions + diff --git a/packages/Catch2/examples/311-Gen-CustomCapture.cpp b/packages/Catch2/examples/311-Gen-CustomCapture.cpp new file mode 100644 index 000000000..da6d686f9 --- /dev/null +++ b/packages/Catch2/examples/311-Gen-CustomCapture.cpp @@ -0,0 +1,41 @@ +// 311-Gen-CustomCapture.cpp +// Shows how to provide custom capture list to the generator expression + +// Note that using variables inside generators is dangerous and should +// be done only if you know what you are doing, because the generators +// _WILL_ outlive the variables. Also, even if you know what you are +// doing, you should probably use GENERATE_COPY or GENERATE_REF macros +// instead. However, if your use case requires having a +// per-variable custom capture list, this example shows how to achieve +// that. + +#include <catch2/catch.hpp> + +TEST_CASE("Generate random doubles across different ranges", + "[generator][example][advanced]") { + // Workaround for old libstdc++ + using record = std::tuple<double, double>; + // Set up 3 ranges to generate numbers from + auto r1 = GENERATE(table<double, double>({ + record{3, 4}, + record{-4, -3}, + record{10, 1000} + })); + + auto r2(r1); + + // This will take r1 by reference and r2 by value. + // Note that there are no advantages for doing so in this example, + // it is done only for expository purposes. + auto number = Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, + [&r1, r2]{ + using namespace Catch::Generators; + return makeGenerators(take(50, random(std::get<0>(r1), std::get<1>(r2)))); + } + ); + + REQUIRE(std::abs(number) > 0); +} + +// Compiling and running this file will result in 150 successful assertions + diff --git a/packages/Catch2/examples/CMakeLists.txt b/packages/Catch2/examples/CMakeLists.txt index 2551e77c0..65dc5f54a 100644 --- a/packages/Catch2/examples/CMakeLists.txt +++ b/packages/Catch2/examples/CMakeLists.txt @@ -44,6 +44,10 @@ set( SOURCES_IDIOMATIC_TESTS 110-Fix-ClassFixture.cpp 120-Bdd-ScenarioGivenWhenThen.cpp 210-Evt-EventListeners.cpp + 300-Gen-OwnGenerator.cpp + 301-Gen-MapTypeConversion.cpp + 310-Gen-VariablesInGenerators.cpp + 311-Gen-CustomCapture.cpp ) # main-s for reporter-specific test sources: diff --git a/packages/Catch2/include/catch.hpp b/packages/Catch2/include/catch.hpp index 727f602ee..5ee7ffdd9 100644 --- a/packages/Catch2/include/catch.hpp +++ b/packages/Catch2/include/catch.hpp @@ -10,8 +10,8 @@ #define TWOBLUECUBES_CATCH_HPP_INCLUDED #define CATCH_VERSION_MAJOR 2 -#define CATCH_VERSION_MINOR 5 -#define CATCH_VERSION_PATCH 0 +#define CATCH_VERSION_MINOR 7 +#define CATCH_VERSION_PATCH 1 #ifdef __clang__ # pragma clang system_header @@ -63,6 +63,8 @@ #include "internal/catch_capture_matchers.h" #endif #include "internal/catch_generators.hpp" +#include "internal/catch_generators_generic.hpp" +#include "internal/catch_generators_specific.hpp" // These files are included here so the single_include script doesn't put them // in the conditionally compiled sections @@ -101,7 +103,7 @@ #define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ ) #define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ ) -#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, "", __VA_ARGS__ ) +#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ ) #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr ) #define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr ) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) @@ -115,7 +117,7 @@ #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) -#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, "", __VA_ARGS__ ) +#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr ) #define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr ) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) @@ -213,6 +215,7 @@ #endif // CATCH_CONFIG_DISABLE_MATCHERS #define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg ) +#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg ) #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) #define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE",__VA_ARGS__ ) diff --git a/packages/Catch2/include/external/clara.hpp b/packages/Catch2/include/external/clara.hpp index 056e0a315..c7348bf95 100644 --- a/packages/Catch2/include/external/clara.hpp +++ b/packages/Catch2/include/external/clara.hpp @@ -111,6 +111,9 @@ public: m_suffix = false; auto width = m_column.m_width - indent(); m_end = m_pos; + if (line()[m_pos] == '\n') { + ++m_end; + } while (m_end < line().size() && line()[m_end] != '\n') ++m_end; @@ -370,7 +373,7 @@ inline auto Column::operator + (Column const& other) -> Columns { // ----------- end of #include from clara_textflow.hpp ----------- // ........... back in clara.hpp - +#include <cctype> #include <string> #include <memory> #include <set> @@ -664,7 +667,7 @@ namespace detail { } inline auto convertInto( std::string const &source, bool &target ) -> ParserResult { std::string srcLC = source; - std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( ::tolower(c) ); } ); + std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( std::tolower(c) ); } ); if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on") target = true; else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off") diff --git a/packages/Catch2/include/internal/catch_capture.hpp b/packages/Catch2/include/internal/catch_capture.hpp index a9c2e0d72..303e891ac 100644 --- a/packages/Catch2/include/internal/catch_capture.hpp +++ b/packages/Catch2/include/internal/catch_capture.hpp @@ -48,7 +48,7 @@ CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ INTERNAL_CATCH_REACT( catchAssertionHandler ) \ - } while( (void)0, false && static_cast<bool>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look + } while( (void)0, (false) && static_cast<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 &&. /////////////////////////////////////////////////////////////////////////////// @@ -130,6 +130,10 @@ #define INTERNAL_CATCH_INFO( macroName, log ) \ Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ); +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \ + Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ) + /////////////////////////////////////////////////////////////////////////////// // Although this is matcher-based, it can be used with just a string #define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \ diff --git a/packages/Catch2/include/internal/catch_common.h b/packages/Catch2/include/internal/catch_common.h index b332e164b..e47456220 100644 --- a/packages/Catch2/include/internal/catch_common.h +++ b/packages/Catch2/include/internal/catch_common.h @@ -52,10 +52,10 @@ namespace Catch { line( _line ) {} - SourceLineInfo( SourceLineInfo const& other ) = default; - SourceLineInfo( SourceLineInfo && ) = default; - SourceLineInfo& operator = ( SourceLineInfo const& ) = default; - SourceLineInfo& operator = ( SourceLineInfo && ) = default; + SourceLineInfo( SourceLineInfo const& other ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo( SourceLineInfo&& ) noexcept = default; + SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; bool empty() const noexcept; bool operator == ( SourceLineInfo const& other ) const noexcept; diff --git a/packages/Catch2/include/internal/catch_compiler_capabilities.h b/packages/Catch2/include/internal/catch_compiler_capabilities.h index cf3a44242..012bf462a 100644 --- a/packages/Catch2/include/internal/catch_compiler_capabilities.h +++ b/packages/Catch2/include/internal/catch_compiler_capabilities.h @@ -183,6 +183,14 @@ #endif #endif +//////////////////////////////////////////////////////////////////////////////// +// Check if optional is available and usable +#if defined(__has_include) +# if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER) +# define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL +# endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER) +#endif // __has_include + //////////////////////////////////////////////////////////////////////////////// // Check if variant is available and usable #if defined(__has_include) @@ -193,9 +201,11 @@ # include <ciso646> # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) # define CATCH_CONFIG_NO_CPP17_VARIANT -# else +# else # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) +# else +# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT # endif // defined(__clang__) && (__clang_major__ < 8) # endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER) #endif // __has_include @@ -220,6 +230,10 @@ # define CATCH_CONFIG_CPP11_TO_STRING #endif +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) +# define CATCH_CONFIG_CPP17_OPTIONAL +#endif + #if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) # define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS #endif diff --git a/packages/Catch2/include/internal/catch_config.cpp b/packages/Catch2/include/internal/catch_config.cpp index e8ad2a81f..d9ee9182b 100644 --- a/packages/Catch2/include/internal/catch_config.cpp +++ b/packages/Catch2/include/internal/catch_config.cpp @@ -16,10 +16,7 @@ namespace Catch { m_stream( openStream() ) { TestSpecParser parser(ITagAliasRegistry::get()); - if (data.testsOrTags.empty()) { - parser.parse("~[.]"); // All not hidden tests - } - else { + if (!data.testsOrTags.empty()) { m_hasTestFilters = true; for( auto const& testOrTags : data.testsOrTags ) parser.parse( testOrTags ); diff --git a/packages/Catch2/include/internal/catch_config.hpp b/packages/Catch2/include/internal/catch_config.hpp index 7bafc9c36..953badbdc 100644 --- a/packages/Catch2/include/internal/catch_config.hpp +++ b/packages/Catch2/include/internal/catch_config.hpp @@ -82,7 +82,7 @@ namespace Catch { std::string getProcessName() const; std::string const& getReporterName() const; - std::vector<std::string> const& getTestsOrTags() const; + std::vector<std::string> const& getTestsOrTags() const override; std::vector<std::string> const& getSectionsToRun() const override; virtual TestSpec const& testSpec() const override; diff --git a/packages/Catch2/include/internal/catch_console_colour.cpp b/packages/Catch2/include/internal/catch_console_colour.cpp index 5fb1d07f1..07072db6f 100644 --- a/packages/Catch2/include/internal/catch_console_colour.cpp +++ b/packages/Catch2/include/internal/catch_console_colour.cpp @@ -160,7 +160,8 @@ namespace { private: void setColour( const char* _escapeCode ) { - Catch::cout() << '\033' << _escapeCode; + getCurrentContext().getConfig()->stream() + << '\033' << _escapeCode; } }; diff --git a/packages/Catch2/include/internal/catch_debugger.cpp b/packages/Catch2/include/internal/catch_debugger.cpp index 71dc65066..f04900a4c 100644 --- a/packages/Catch2/include/internal/catch_debugger.cpp +++ b/packages/Catch2/include/internal/catch_debugger.cpp @@ -18,19 +18,23 @@ # include <stdbool.h> # include <sys/types.h> # include <unistd.h> -# include <sys/sysctl.h> # include <cstddef> # include <ostream> -namespace Catch { +#ifdef __apple_build_version__ + // These headers will only compile with AppleClang (XCode) + // For other compilers (Clang, GCC, ... ) we need to exclude them +# include <sys/sysctl.h> +#endif + namespace Catch { + #ifdef __apple_build_version__ // The following function is taken directly from the following technical note: - // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html + // https://developer.apple.com/library/archive/qa/qa1361/_index.html // Returns true if the current process is being debugged (either // running under the debugger or has a debugger attached post facto). bool isDebuggerActive(){ - int mib[4]; struct kinfo_proc info; std::size_t size; @@ -60,6 +64,12 @@ namespace Catch { return ( (info.kp_proc.p_flag & P_TRACED) != 0 ); } + #else + bool isDebuggerActive() { + // We need to find another way to determine this for non-appleclang compilers on macOS + return false; + } + #endif } // namespace Catch #elif defined(CATCH_PLATFORM_LINUX) diff --git a/packages/Catch2/include/internal/catch_debugger.h b/packages/Catch2/include/internal/catch_debugger.h index 75419842b..db3ff681b 100644 --- a/packages/Catch2/include/internal/catch_debugger.h +++ b/packages/Catch2/include/internal/catch_debugger.h @@ -38,12 +38,9 @@ namespace Catch { #endif #ifdef CATCH_TRAP - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } + #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }() #else - namespace Catch { - inline void doNothing() {} - } - #define CATCH_BREAK_INTO_DEBUGGER() Catch::doNothing() + #define CATCH_BREAK_INTO_DEBUGGER() []{}() #endif #endif // TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED diff --git a/packages/Catch2/include/internal/catch_decomposer.h b/packages/Catch2/include/internal/catch_decomposer.h index 618a25090..08075f0e9 100644 --- a/packages/Catch2/include/internal/catch_decomposer.h +++ b/packages/Catch2/include/internal/catch_decomposer.h @@ -10,6 +10,7 @@ #include "catch_tostring.h" #include "catch_stringref.h" +#include "catch_meta.hpp" #include <iosfwd> @@ -19,6 +20,7 @@ #pragma warning(disable:4018) // more "signed/unsigned mismatch" #pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform) #pragma warning(disable:4180) // qualifier applied to function type has no meaning +#pragma warning(disable:4800) // Forcing result to true or false #endif namespace Catch { @@ -62,6 +64,62 @@ namespace Catch { m_op( op ), m_rhs( rhs ) {} + + template<typename T> + auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } }; template<typename LhsT> @@ -74,7 +132,7 @@ namespace Catch { public: explicit UnaryExpr( LhsT lhs ) - : ITransientExpression{ false, lhs ? true : false }, + : ITransientExpression{ false, static_cast<bool>(lhs) }, m_lhs( lhs ) {} }; @@ -143,6 +201,20 @@ namespace Catch { return { static_cast<bool>(m_lhs <= rhs), m_lhs, "<=", rhs }; } + template<typename RhsT> + auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<RhsT>::value, + "operator&& is not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename RhsT> + auto operator || ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<RhsT>::value, + "operator|| is not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + auto makeUnaryExpr() const -> UnaryExpr<LhsT> { return UnaryExpr<LhsT>{ m_lhs }; } diff --git a/packages/Catch2/include/internal/catch_exception_translator_registry.cpp b/packages/Catch2/include/internal/catch_exception_translator_registry.cpp index b836cd9cb..cef36e513 100644 --- a/packages/Catch2/include/internal/catch_exception_translator_registry.cpp +++ b/packages/Catch2/include/internal/catch_exception_translator_registry.cpp @@ -67,17 +67,23 @@ namespace Catch { } } + std::string ExceptionTranslatorRegistry::tryTranslators() const { + if (m_translators.empty()) { + std::rethrow_exception(std::current_exception()); + } else { + return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end()); + } + } + #else // ^^ Exceptions are enabled // Exceptions are disabled vv std::string ExceptionTranslatorRegistry::translateActiveException() const { CATCH_INTERNAL_ERROR("Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!"); } -#endif - std::string ExceptionTranslatorRegistry::tryTranslators() const { - if( m_translators.empty() ) - std::rethrow_exception(std::current_exception()); - else - return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() ); + CATCH_INTERNAL_ERROR("Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!"); } +#endif + + } diff --git a/packages/Catch2/include/internal/catch_fatal_condition.cpp b/packages/Catch2/include/internal/catch_fatal_condition.cpp index 24e16d3c6..cea271f38 100644 --- a/packages/Catch2/include/internal/catch_fatal_condition.cpp +++ b/packages/Catch2/include/internal/catch_fatal_condition.cpp @@ -37,10 +37,10 @@ namespace Catch { // Windows can easily distinguish between SO and SigSegV, // but SigInt, SigTerm, etc are handled differently. static SignalDefs signalDefs[] = { - { EXCEPTION_ILLEGAL_INSTRUCTION, "SIGILL - Illegal instruction signal" }, - { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" }, - { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" }, - { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" }, + { static_cast<DWORD>(EXCEPTION_ILLEGAL_INSTRUCTION), "SIGILL - Illegal instruction signal" }, + { static_cast<DWORD>(EXCEPTION_STACK_OVERFLOW), "SIGSEGV - Stack overflow" }, + { static_cast<DWORD>(EXCEPTION_ACCESS_VIOLATION), "SIGSEGV - Segmentation violation signal" }, + { static_cast<DWORD>(EXCEPTION_INT_DIVIDE_BY_ZERO), "Divide by zero error" }, }; LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { diff --git a/packages/Catch2/include/internal/catch_generators.cpp b/packages/Catch2/include/internal/catch_generators.cpp index 786da7367..5fbe2d238 100644 --- a/packages/Catch2/include/internal/catch_generators.cpp +++ b/packages/Catch2/include/internal/catch_generators.cpp @@ -16,35 +16,17 @@ namespace Catch { IGeneratorTracker::~IGeneratorTracker() {} -namespace Generators { - - GeneratorBase::~GeneratorBase() {} +const char* GeneratorException::what() const noexcept { + return m_msg; +} - std::vector<size_t> randomiseIndices( size_t selectionSize, size_t sourceSize ) { +namespace Generators { - assert( selectionSize <= sourceSize ); - std::vector<size_t> indices; - indices.reserve( selectionSize ); - std::uniform_int_distribution<size_t> uid( 0, sourceSize-1 ); - - std::set<size_t> seen; - // !TBD: improve this algorithm - while( indices.size() < selectionSize ) { - auto index = uid( rng() ); - if( seen.insert( index ).second ) - indices.push_back( index ); - } - return indices; - } + GeneratorUntypedBase::~GeneratorUntypedBase() {} auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& { return getResultCapture().acquireGeneratorTracker( lineInfo ); } - template<> - auto all<int>() -> Generator<int> { - return range( std::numeric_limits<int>::min(), std::numeric_limits<int>::max() ); - } - } // namespace Generators } // namespace Catch diff --git a/packages/Catch2/include/internal/catch_generators.hpp b/packages/Catch2/include/internal/catch_generators.hpp index 4a446be13..8f06b8c6c 100644 --- a/packages/Catch2/include/internal/catch_generators.hpp +++ b/packages/Catch2/include/internal/catch_generators.hpp @@ -16,8 +16,21 @@ #include <cassert> #include <utility> +#include <exception> namespace Catch { + +class GeneratorException : public std::exception { + const char* const m_msg = ""; + +public: + GeneratorException(const char* msg): + m_msg(msg) + {} + + const char* what() const noexcept override final; +}; + namespace Generators { // !TBD move this into its own location? @@ -29,225 +42,169 @@ namespace Generators { } template<typename T> - struct IGenerator { - virtual ~IGenerator() {} - virtual auto get( size_t index ) const -> T = 0; + struct IGenerator : GeneratorUntypedBase { + virtual ~IGenerator() = default; + + // Returns the current element of the generator + // + // \Precondition The generator is either freshly constructed, + // or the last call to `next()` returned true + virtual T const& get() const = 0; + using type = T; }; template<typename T> - class SingleValueGenerator : public IGenerator<T> { + class SingleValueGenerator final : public IGenerator<T> { T m_value; public: - SingleValueGenerator( T const& value ) : m_value( value ) {} + SingleValueGenerator(T const& value) : m_value( value ) {} + SingleValueGenerator(T&& value) : m_value(std::move(value)) {} - auto get( size_t ) const -> T override { + T const& get() const override { return m_value; } + bool next() override { + return false; + } }; template<typename T> - class FixedValuesGenerator : public IGenerator<T> { + class FixedValuesGenerator final : public IGenerator<T> { std::vector<T> m_values; - + size_t m_idx = 0; public: FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {} - auto get( size_t index ) const -> T override { - return m_values[index]; + T const& get() const override { + return m_values[m_idx]; } - }; - - template<typename T> - class RangeGenerator : public IGenerator<T> { - T const m_first; - T const m_last; - - public: - RangeGenerator( T const& first, T const& last ) : m_first( first ), m_last( last ) { - assert( m_last > m_first ); - } - - auto get( size_t index ) const -> T override { - // ToDo:: introduce a safe cast to catch potential overflows - return static_cast<T>(m_first+index); + bool next() override { + ++m_idx; + return m_idx < m_values.size(); } }; - - template<typename T> - struct NullGenerator : IGenerator<T> { - auto get( size_t ) const -> T override { - CATCH_INTERNAL_ERROR("A Null Generator is always empty"); - } - }; - - template<typename T> - class Generator { + template <typename T> + class GeneratorWrapper final { std::unique_ptr<IGenerator<T>> m_generator; - size_t m_size; - public: - Generator( size_t size, std::unique_ptr<IGenerator<T>> generator ) - : m_generator( std::move( generator ) ), - m_size( size ) + GeneratorWrapper(std::unique_ptr<IGenerator<T>> generator): + m_generator(std::move(generator)) {} - - auto size() const -> size_t { return m_size; } - auto operator[]( size_t index ) const -> T { - assert( index < m_size ); - return m_generator->get( index ); + T const& get() const { + return m_generator->get(); } - }; - - std::vector<size_t> randomiseIndices( size_t selectionSize, size_t sourceSize ); - - template<typename T> - class GeneratorRandomiser : public IGenerator<T> { - Generator<T> m_baseGenerator; - - std::vector<size_t> m_indices; - public: - GeneratorRandomiser( Generator<T>&& baseGenerator, size_t numberOfItems ) - : m_baseGenerator( std::move( baseGenerator ) ), - m_indices( randomiseIndices( numberOfItems, m_baseGenerator.size() ) ) - {} - - auto get( size_t index ) const -> T override { - return m_baseGenerator[m_indices[index]]; + bool next() { + return m_generator->next(); } }; - template<typename T> - struct RequiresASpecialisationFor; - - template<typename T> - auto all() -> Generator<T> { return RequiresASpecialisationFor<T>(); } - - template<> - auto all<int>() -> Generator<int>; - - - template<typename T> - auto range( T const& first, T const& last ) -> Generator<T> { - return Generator<T>( (last-first), pf::make_unique<RangeGenerator<T>>( first, last ) ); - } - - template<typename T> - auto random( T const& first, T const& last ) -> Generator<T> { - auto gen = range( first, last ); - auto size = gen.size(); - - return Generator<T>( size, pf::make_unique<GeneratorRandomiser<T>>( std::move( gen ), size ) ); - } - template<typename T> - auto random( size_t size ) -> Generator<T> { - return Generator<T>( size, pf::make_unique<GeneratorRandomiser<T>>( all<T>(), size ) ); - } - - template<typename T> - auto values( std::initializer_list<T> values ) -> Generator<T> { - return Generator<T>( values.size(), pf::make_unique<FixedValuesGenerator<T>>( values ) ); - } - template<typename T> - auto value( T const& val ) -> Generator<T> { - return Generator<T>( 1, pf::make_unique<SingleValueGenerator<T>>( val ) ); + template <typename T> + GeneratorWrapper<T> value(T&& value) { + return GeneratorWrapper<T>(pf::make_unique<SingleValueGenerator<T>>(std::forward<T>(value))); } - - template<typename T> - auto as() -> Generator<T> { - return Generator<T>( 0, pf::make_unique<NullGenerator<T>>() ); + template <typename T> + GeneratorWrapper<T> values(std::initializer_list<T> values) { + return GeneratorWrapper<T>(pf::make_unique<FixedValuesGenerator<T>>(values)); } - template<typename... Ts> - auto table( std::initializer_list<std::tuple<Ts...>>&& tuples ) -> Generator<std::tuple<Ts...>> { - return values<std::tuple<Ts...>>( std::forward<std::initializer_list<std::tuple<Ts...>>>( tuples ) ); - } - - template<typename T> - struct Generators : GeneratorBase { - std::vector<Generator<T>> m_generators; + class Generators : public IGenerator<T> { + std::vector<GeneratorWrapper<T>> m_generators; + size_t m_current = 0; - using type = T; - - Generators() : GeneratorBase( 0 ) {} - - void populate( T&& val ) { - m_size += 1; - m_generators.emplace_back( value( std::move( val ) ) ); + void populate(GeneratorWrapper<T>&& generator) { + m_generators.emplace_back(std::move(generator)); + } + void populate(T&& val) { + m_generators.emplace_back(value(std::move(val))); } template<typename U> - void populate( U&& val ) { - populate( T( std::move( val ) ) ); + void populate(U&& val) { + populate(T(std::move(val))); } - void populate( Generator<T>&& generator ) { - m_size += generator.size(); - m_generators.emplace_back( std::move( generator ) ); + template<typename U, typename... Gs> + void populate(U&& valueOrGenerator, Gs... moreGenerators) { + populate(std::forward<U>(valueOrGenerator)); + populate(std::forward<Gs>(moreGenerators)...); } - template<typename U, typename... Gs> - void populate( U&& valueOrGenerator, Gs... moreGenerators ) { - populate( std::forward<U>( valueOrGenerator ) ); - populate( std::forward<Gs>( moreGenerators )... ); + public: + template <typename... Gs> + Generators(Gs... moreGenerators) { + m_generators.reserve(sizeof...(Gs)); + populate(std::forward<Gs>(moreGenerators)...); + } + + T const& get() const override { + return m_generators[m_current].get(); } - auto operator[]( size_t index ) const -> T { - size_t sizes = 0; - for( auto const& gen : m_generators ) { - auto localIndex = index-sizes; - sizes += gen.size(); - if( index < sizes ) - return gen[localIndex]; + bool next() override { + if (m_current >= m_generators.size()) { + return false; } - CATCH_INTERNAL_ERROR("Index '" << index << "' is out of range (" << sizes << ')'); + const bool current_status = m_generators[m_current].next(); + if (!current_status) { + ++m_current; + } + return m_current < m_generators.size(); } }; + + template<typename... Ts> + GeneratorWrapper<std::tuple<Ts...>> table( std::initializer_list<std::tuple<typename std::decay<Ts>::type...>> tuples ) { + return values<std::tuple<Ts...>>( tuples ); + } + + // Tag type to signal that a generator sequence should convert arguments to a specific type + template <typename T> + struct as {}; + template<typename T, typename... Gs> - auto makeGenerators( Generator<T>&& generator, Gs... moreGenerators ) -> Generators<T> { - Generators<T> generators; - generators.m_generators.reserve( 1+sizeof...(Gs) ); - generators.populate( std::move( generator ), std::forward<Gs>( moreGenerators )... ); - return generators; + auto makeGenerators( GeneratorWrapper<T>&& generator, Gs... moreGenerators ) -> Generators<T> { + return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...); } template<typename T> - auto makeGenerators( Generator<T>&& generator ) -> Generators<T> { - Generators<T> generators; - generators.populate( std::move( generator ) ); - return generators; + auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> { + return Generators<T>(std::move(generator)); } template<typename T, typename... Gs> auto makeGenerators( T&& val, Gs... moreGenerators ) -> Generators<T> { return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... ); } template<typename T, typename U, typename... Gs> - auto makeGenerators( U&& val, Gs... moreGenerators ) -> Generators<T> { + auto makeGenerators( as<T>, U&& val, Gs... moreGenerators ) -> Generators<T> { return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... ); } - auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&; template<typename L> // Note: The type after -> is weird, because VS2015 cannot parse // the expression used in the typedef inside, when it is in - // return type. Yeah, ¯\_(ツ)_/¯ - auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>()[0]) { + // return type. Yeah. + auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) { using UnderlyingType = typename decltype(generatorExpression())::type; IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo ); - if( !tracker.hasGenerator() ) - tracker.setGenerator( pf::make_unique<Generators<UnderlyingType>>( generatorExpression() ) ); + if (!tracker.hasGenerator()) { + tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression())); + } - auto const& generator = static_cast<Generators<UnderlyingType> const&>( *tracker.getGenerator() ); - return generator[tracker.getIndex()]; + auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() ); + return generator.get(); } } // namespace Generators } // namespace Catch #define GENERATE( ... ) \ - Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, []{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) - + Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) +#define GENERATE_COPY( ... ) \ + Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) +#define GENERATE_REF( ... ) \ + Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) #endif // TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_generators_generic.hpp b/packages/Catch2/include/internal/catch_generators_generic.hpp new file mode 100644 index 000000000..2903ba69d --- /dev/null +++ b/packages/Catch2/include/internal/catch_generators_generic.hpp @@ -0,0 +1,242 @@ +/* + * Created by Martin on 23/2/2019. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_GENERATORS_GENERIC_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_GENERATORS_GENERIC_HPP_INCLUDED + +#include "catch_generators.hpp" + +namespace Catch { +namespace Generators { + + template <typename T> + class TakeGenerator : public IGenerator<T> { + GeneratorWrapper<T> m_generator; + size_t m_returned = 0; + size_t m_target; + public: + TakeGenerator(size_t target, GeneratorWrapper<T>&& generator): + m_generator(std::move(generator)), + m_target(target) + { + assert(target != 0 && "Empty generators are not allowed"); + } + T const& get() const override { + return m_generator.get(); + } + bool next() override { + ++m_returned; + if (m_returned >= m_target) { + return false; + } + + const auto success = m_generator.next(); + // If the underlying generator does not contain enough values + // then we cut short as well + if (!success) { + m_returned = m_target; + } + return success; + } + }; + + template <typename T> + GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<T>(pf::make_unique<TakeGenerator<T>>(target, std::move(generator))); + } + + + template <typename T, typename Predicate> + class FilterGenerator : public IGenerator<T> { + GeneratorWrapper<T> m_generator; + Predicate m_predicate; + public: + template <typename P = Predicate> + FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator): + m_generator(std::move(generator)), + m_predicate(std::forward<P>(pred)) + { + if (!m_predicate(m_generator.get())) { + // It might happen that there are no values that pass the + // filter. In that case we throw an exception. + auto has_initial_value = next(); + if (!has_initial_value) { + Catch::throw_exception(GeneratorException("No valid value found in filtered generator")); + } + } + } + + T const& get() const override { + return m_generator.get(); + } + + bool next() override { + bool success = m_generator.next(); + if (!success) { + return false; + } + while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true); + return success; + } + }; + + + template <typename T, typename Predicate> + GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<T>(std::unique_ptr<IGenerator<T>>(pf::make_unique<FilterGenerator<T, Predicate>>(std::forward<Predicate>(pred), std::move(generator)))); + } + + template <typename T> + class RepeatGenerator : public IGenerator<T> { + GeneratorWrapper<T> m_generator; + mutable std::vector<T> m_returned; + size_t m_target_repeats; + size_t m_current_repeat = 0; + size_t m_repeat_index = 0; + public: + RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator): + m_generator(std::move(generator)), + m_target_repeats(repeats) + { + assert(m_target_repeats > 0 && "Repeat generator must repeat at least once"); + } + + T const& get() const override { + if (m_current_repeat == 0) { + m_returned.push_back(m_generator.get()); + return m_returned.back(); + } + return m_returned[m_repeat_index]; + } + + bool next() override { + // There are 2 basic cases: + // 1) We are still reading the generator + // 2) We are reading our own cache + + // In the first case, we need to poke the underlying generator. + // If it happily moves, we are left in that state, otherwise it is time to start reading from our cache + if (m_current_repeat == 0) { + const auto success = m_generator.next(); + if (!success) { + ++m_current_repeat; + } + return m_current_repeat < m_target_repeats; + } + + // In the second case, we need to move indices forward and check that we haven't run up against the end + ++m_repeat_index; + if (m_repeat_index == m_returned.size()) { + m_repeat_index = 0; + ++m_current_repeat; + } + return m_current_repeat < m_target_repeats; + } + }; + + template <typename T> + GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<T>(pf::make_unique<RepeatGenerator<T>>(repeats, std::move(generator))); + } + + template <typename T, typename U, typename Func> + class MapGenerator : public IGenerator<T> { + // TBD: provide static assert for mapping function, for friendly error message + GeneratorWrapper<U> m_generator; + Func m_function; + // To avoid returning dangling reference, we have to save the values + T m_cache; + public: + template <typename F2 = Func> + MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) : + m_generator(std::move(generator)), + m_function(std::forward<F2>(function)), + m_cache(m_function(m_generator.get())) + {} + + T const& get() const override { + return m_cache; + } + bool next() override { + const auto success = m_generator.next(); + if (success) { + m_cache = m_function(m_generator.get()); + } + return success; + } + }; + +#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703 + // std::result_of is deprecated in C++17 and removed in C++20. Hence, it is + // replaced with std::invoke_result here. Also *_t format is preferred over + // typename *::type format. + template <typename Func, typename U> + using MapFunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U>>>; +#else + template <typename Func, typename U> + using MapFunctionReturnType = typename std::remove_reference<typename std::remove_cv<typename std::result_of<Func(U)>::type>::type>::type; +#endif + + template <typename Func, typename U, typename T = MapFunctionReturnType<Func, U>> + GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { + return GeneratorWrapper<T>( + pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + ); + } + + template <typename T, typename U, typename Func> + GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { + return GeneratorWrapper<T>( + pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + ); + } + + template <typename T> + class ChunkGenerator final : public IGenerator<std::vector<T>> { + std::vector<T> m_chunk; + size_t m_chunk_size; + GeneratorWrapper<T> m_generator; + bool m_used_up = false; + public: + ChunkGenerator(size_t size, GeneratorWrapper<T> generator) : + m_chunk_size(size), m_generator(std::move(generator)) + { + m_chunk.reserve(m_chunk_size); + m_chunk.push_back(m_generator.get()); + for (size_t i = 1; i < m_chunk_size; ++i) { + if (!m_generator.next()) { + Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk")); + } + m_chunk.push_back(m_generator.get()); + } + } + std::vector<T> const& get() const override { + return m_chunk; + } + bool next() override { + m_chunk.clear(); + for (size_t idx = 0; idx < m_chunk_size; ++idx) { + if (!m_generator.next()) { + return false; + } + m_chunk.push_back(m_generator.get()); + } + return true; + } + }; + + template <typename T> + GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<std::vector<T>>( + pf::make_unique<ChunkGenerator<T>>(size, std::move(generator)) + ); + } + +} // namespace Generators +} // namespace Catch + + +#endif // TWOBLUECUBES_CATCH_GENERATORS_GENERIC_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_generators_specific.hpp b/packages/Catch2/include/internal/catch_generators_specific.hpp new file mode 100644 index 000000000..7aae06bd5 --- /dev/null +++ b/packages/Catch2/include/internal/catch_generators_specific.hpp @@ -0,0 +1,135 @@ +/* + * Created by Martin on 15/6/2018. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_CATCH_GENERATORS_SPECIFIC_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_GENERATORS_SPECIFIC_HPP_INCLUDED + +#include "catch_context.h" +#include "catch_generators.hpp" +#include "catch_interfaces_config.h" + +#include <random> + +namespace Catch { +namespace Generators { + +template <typename Float> +class RandomFloatingGenerator final : public IGenerator<Float> { + // FIXME: What is the right seed? + std::minstd_rand m_rand; + std::uniform_real_distribution<Float> m_dist; + Float m_current_number; +public: + + RandomFloatingGenerator(Float a, Float b): + m_rand(getCurrentContext().getConfig()->rngSeed()), + m_dist(a, b) { + static_cast<void>(next()); + } + + Float const& get() const override { + return m_current_number; + } + bool next() override { + m_current_number = m_dist(m_rand); + return true; + } +}; + +template <typename Integer> +class RandomIntegerGenerator final : public IGenerator<Integer> { + std::minstd_rand m_rand; + std::uniform_int_distribution<Integer> m_dist; + Integer m_current_number; +public: + + RandomIntegerGenerator(Integer a, Integer b): + m_rand(getCurrentContext().getConfig()->rngSeed()), + m_dist(a, b) { + static_cast<void>(next()); + } + + Integer const& get() const override { + return m_current_number; + } + bool next() override { + m_current_number = m_dist(m_rand); + return true; + } +}; + +// TODO: Ideally this would be also constrained against the various char types, +// but I don't expect users to run into that in practice. +template <typename T> +typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value, +GeneratorWrapper<T>>::type +random(T a, T b) { + return GeneratorWrapper<T>( + pf::make_unique<RandomIntegerGenerator<T>>(a, b) + ); +} + +template <typename T> +typename std::enable_if<std::is_floating_point<T>::value, +GeneratorWrapper<T>>::type +random(T a, T b) { + return GeneratorWrapper<T>( + pf::make_unique<RandomFloatingGenerator<T>>(a, b) + ); +} + + +template <typename T> +class RangeGenerator final : public IGenerator<T> { + T m_current; + T m_end; + T m_step; + bool m_positive; + +public: + RangeGenerator(T const& start, T const& end, T const& step): + m_current(start), + m_end(end), + m_step(step), + m_positive(m_step > T(0)) + { + assert(m_current != m_end && "Range start and end cannot be equal"); + assert(m_step != T(0) && "Step size cannot be zero"); + assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end"); + } + + RangeGenerator(T const& start, T const& end): + RangeGenerator(start, end, (start < end) ? T(1) : T(-1)) + {} + + T const& get() const override { + return m_current; + } + + bool next() override { + m_current += m_step; + return (m_positive) ? (m_current < m_end) : (m_current > m_end); + } +}; + +template <typename T> +GeneratorWrapper<T> range(T const& start, T const& end, T const& step) { + static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer"); + return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end, step)); +} + +template <typename T> +GeneratorWrapper<T> range(T const& start, T const& end) { + static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer"); + return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end)); +} + + +} // namespace Generators +} // namespace Catch + + +#endif // TWOBLUECUBES_CATCH_GENERATORS_SPECIFIC_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_interfaces_capture.h b/packages/Catch2/include/internal/catch_interfaces_capture.h index 950d498dc..36f27a331 100644 --- a/packages/Catch2/include/internal/catch_interfaces_capture.h +++ b/packages/Catch2/include/internal/catch_interfaces_capture.h @@ -20,6 +20,7 @@ namespace Catch { struct SectionInfo; struct SectionEndInfo; struct MessageInfo; + struct MessageBuilder; struct Counts; struct BenchmarkInfo; struct BenchmarkStats; @@ -46,6 +47,8 @@ namespace Catch { virtual void pushScopedMessage( MessageInfo const& message ) = 0; virtual void popScopedMessage( MessageInfo const& message ) = 0; + virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0; + virtual void handleFatalErrorCondition( StringRef message ) = 0; virtual void handleExpr diff --git a/packages/Catch2/include/internal/catch_interfaces_config.h b/packages/Catch2/include/internal/catch_interfaces_config.h index f509c7ed8..341bb7420 100644 --- a/packages/Catch2/include/internal/catch_interfaces_config.h +++ b/packages/Catch2/include/internal/catch_interfaces_config.h @@ -69,6 +69,7 @@ namespace Catch { virtual ShowDurations::OrNot showDurations() const = 0; virtual TestSpec const& testSpec() const = 0; virtual bool hasTestFilters() const = 0; + virtual std::vector<std::string> const& getTestsOrTags() const = 0; virtual RunTests::InWhatOrder runOrder() const = 0; virtual unsigned int rngSeed() const = 0; virtual int benchmarkResolutionMultiple() const = 0; diff --git a/packages/Catch2/include/internal/catch_interfaces_generatortracker.h b/packages/Catch2/include/internal/catch_interfaces_generatortracker.h index 2cf6269e4..c1b1391ff 100644 --- a/packages/Catch2/include/internal/catch_interfaces_generatortracker.h +++ b/packages/Catch2/include/internal/catch_interfaces_generatortracker.h @@ -13,16 +13,17 @@ namespace Catch { namespace Generators { - class GeneratorBase { - protected: - size_t m_size = 0; - + class GeneratorUntypedBase { public: - GeneratorBase( size_t size ) : m_size( size ) {} - virtual ~GeneratorBase(); - auto size() const -> size_t { return m_size; } + GeneratorUntypedBase() = default; + virtual ~GeneratorUntypedBase(); + // Attempts to move the generator to the next element + // + // Returns true iff the move succeeded (and a valid element + // can be retrieved). + virtual bool next() = 0; }; - using GeneratorBasePtr = std::unique_ptr<GeneratorBase>; + using GeneratorBasePtr = std::unique_ptr<GeneratorUntypedBase>; } // namespace Generators @@ -31,7 +32,6 @@ namespace Catch { virtual auto hasGenerator() const -> bool = 0; virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0; virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0; - virtual auto getIndex() const -> std::size_t = 0; }; } // namespace Catch diff --git a/packages/Catch2/include/internal/catch_interfaces_reporter.h b/packages/Catch2/include/internal/catch_interfaces_reporter.h index 9d99c9814..e5fbf8bb0 100644 --- a/packages/Catch2/include/internal/catch_interfaces_reporter.h +++ b/packages/Catch2/include/internal/catch_interfaces_reporter.h @@ -80,8 +80,8 @@ namespace Catch { AssertionStats( AssertionStats const& ) = default; AssertionStats( AssertionStats && ) = default; - AssertionStats& operator = ( AssertionStats const& ) = default; - AssertionStats& operator = ( AssertionStats && ) = default; + AssertionStats& operator = ( AssertionStats const& ) = delete; + AssertionStats& operator = ( AssertionStats && ) = delete; virtual ~AssertionStats(); AssertionResult assertionResult; diff --git a/packages/Catch2/include/internal/catch_interfaces_testcase.h b/packages/Catch2/include/internal/catch_interfaces_testcase.h index 9e02b14fb..f57cc8fe7 100644 --- a/packages/Catch2/include/internal/catch_interfaces_testcase.h +++ b/packages/Catch2/include/internal/catch_interfaces_testcase.h @@ -9,7 +9,6 @@ #define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED #include <vector> -#include <memory> namespace Catch { @@ -20,8 +19,6 @@ namespace Catch { virtual ~ITestInvoker(); }; - using ITestCasePtr = std::shared_ptr<ITestInvoker>; - class TestCase; struct IConfig; diff --git a/packages/Catch2/include/internal/catch_list.cpp b/packages/Catch2/include/internal/catch_list.cpp index 6010ec15d..e1d99222e 100644 --- a/packages/Catch2/include/internal/catch_list.cpp +++ b/packages/Catch2/include/internal/catch_list.cpp @@ -12,6 +12,7 @@ #include "catch_interfaces_reporter.h" #include "catch_interfaces_testcase.h" +#include "catch_context.h" #include "catch_stream.h" #include "catch_text.h" @@ -146,15 +147,16 @@ namespace Catch { return factories.size(); } - Option<std::size_t> list( Config const& config ) { + Option<std::size_t> list( std::shared_ptr<Config> const& config ) { Option<std::size_t> listedCount; - if( config.listTests() ) - listedCount = listedCount.valueOr(0) + listTests( config ); - if( config.listTestNamesOnly() ) - listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config ); - if( config.listTags() ) - listedCount = listedCount.valueOr(0) + listTags( config ); - if( config.listReporters() ) + getCurrentMutableContext().setConfig( config ); + if( config->listTests() ) + listedCount = listedCount.valueOr(0) + listTests( *config ); + if( config->listTestNamesOnly() ) + listedCount = listedCount.valueOr(0) + listTestsNamesOnly( *config ); + if( config->listTags() ) + listedCount = listedCount.valueOr(0) + listTags( *config ); + if( config->listReporters() ) listedCount = listedCount.valueOr(0) + listReporters(); return listedCount; } diff --git a/packages/Catch2/include/internal/catch_list.h b/packages/Catch2/include/internal/catch_list.h index bd29d9706..cea7bbabf 100644 --- a/packages/Catch2/include/internal/catch_list.h +++ b/packages/Catch2/include/internal/catch_list.h @@ -31,7 +31,7 @@ namespace Catch { std::size_t listReporters(); - Option<std::size_t> list( Config const& config ); + Option<std::size_t> list( std::shared_ptr<Config> const& config ); } // end namespace Catch diff --git a/packages/Catch2/include/internal/catch_matchers_generic.hpp b/packages/Catch2/include/internal/catch_matchers_generic.hpp index 7c4f9f1dd..7d57c9d44 100644 --- a/packages/Catch2/include/internal/catch_matchers_generic.hpp +++ b/packages/Catch2/include/internal/catch_matchers_generic.hpp @@ -45,7 +45,7 @@ public: // The following functions create the actual matcher objects. // The user has to explicitly specify type to the function, because - // infering std::function<bool(T const&)> is hard (but possible) and + // inferring std::function<bool(T const&)> is hard (but possible) and // requires a lot of TMP. template<typename T> Generic::PredicateMatcher<T> Predicate(std::function<bool(T const&)> const& predicate, std::string const& description = "") { diff --git a/packages/Catch2/include/internal/catch_message.cpp b/packages/Catch2/include/internal/catch_message.cpp index 98a4dae11..fa7e87461 100644 --- a/packages/Catch2/include/internal/catch_message.cpp +++ b/packages/Catch2/include/internal/catch_message.cpp @@ -47,14 +47,20 @@ namespace Catch { ScopedMessage::ScopedMessage( MessageBuilder const& builder ) - : m_info( builder.m_info ) + : m_info( builder.m_info ), m_moved() { m_info.message = builder.m_stream.str(); getResultCapture().pushScopedMessage( m_info ); } + ScopedMessage::ScopedMessage( ScopedMessage&& old ) + : m_info( old.m_info ), m_moved() + { + old.m_moved = true; + } + ScopedMessage::~ScopedMessage() { - if ( !uncaught_exceptions() ){ + if ( !uncaught_exceptions() && !m_moved ){ getResultCapture().popScopedMessage(m_info); } } diff --git a/packages/Catch2/include/internal/catch_message.h b/packages/Catch2/include/internal/catch_message.h index e81069bfb..748f5ac56 100644 --- a/packages/Catch2/include/internal/catch_message.h +++ b/packages/Catch2/include/internal/catch_message.h @@ -64,9 +64,12 @@ namespace Catch { class ScopedMessage { public: explicit ScopedMessage( MessageBuilder const& builder ); + ScopedMessage( ScopedMessage& duplicate ) = delete; + ScopedMessage( ScopedMessage&& old ); ~ScopedMessage(); MessageInfo m_info; + bool m_moved; }; class Capturer { diff --git a/packages/Catch2/include/internal/catch_meta.hpp b/packages/Catch2/include/internal/catch_meta.hpp index 43ba30fbc..3508a46f7 100644 --- a/packages/Catch2/include/internal/catch_meta.hpp +++ b/packages/Catch2/include/internal/catch_meta.hpp @@ -9,68 +9,69 @@ #ifndef TWOBLUECUBES_CATCH_META_HPP_INCLUDED #define TWOBLUECUBES_CATCH_META_HPP_INCLUDED +#include <type_traits> + +namespace Catch { template< typename... > -struct TypeList{}; +struct TypeList {}; template< typename... > struct append; template< template<typename...> class L1 - , typename...E1 - , template<typename...> class L2 - , typename...E2 - > -struct append< L1<E1...>, L2<E2...> > -{ - using type = L1<E1..., E2...>; + , typename...E1 + , template<typename...> class L2 + , typename...E2 +> +struct append< L1<E1...>, L2<E2...> > { + using type = L1<E1..., E2...>; }; template< template<typename...> class L1 - , typename...E1 - , template<typename...> class L2 - , typename...E2 - , typename...Rest - > -struct append< L1<E1...>, L2<E2...>, Rest...> -{ - using type = typename append< L1<E1..., E2...>, Rest... >::type; + , typename...E1 + , template<typename...> class L2 + , typename...E2 + , typename...Rest +> +struct append< L1<E1...>, L2<E2...>, Rest...> { + using type = typename append< L1<E1..., E2...>, Rest... >::type; }; template< template<typename...> class - , typename... - > + , typename... +> struct rewrap; template< template<typename...> class Container - , template<typename...> class List - , typename...elems - > -struct rewrap<Container, List<elems...>> -{ + , template<typename...> class List + , typename...elems +> +struct rewrap<Container, List<elems...>> { using type = TypeList< Container< elems... > >; }; template< template<typename...> class Container - , template<typename...> class List - , class...Elems - , typename...Elements> -struct rewrap<Container, List<Elems...>, Elements...> -{ + , template<typename...> class List + , class...Elems + , typename...Elements> + struct rewrap<Container, List<Elems...>, Elements...> { using type = typename append<TypeList<Container<Elems...>>, typename rewrap<Container, Elements...>::type>::type; }; template< template<typename...> class...Containers > -struct combine -{ +struct combine { template< typename...Types > - struct with_types - { + struct with_types { template< template <typename...> class Final > - struct into - { + struct into { using type = typename append<Final<>, typename rewrap<Containers, Types...>::type...>::type; }; }; }; +template<typename T> +struct always_false : std::false_type {}; + +} // namespace Catch + #endif // TWOBLUECUBES_CATCH_META_HPP_INCLUDED diff --git a/packages/Catch2/include/internal/catch_objc.hpp b/packages/Catch2/include/internal/catch_objc.hpp index 39cbb1fa8..f927e0d3d 100644 --- a/packages/Catch2/include/internal/catch_objc.hpp +++ b/packages/Catch2/include/internal/catch_objc.hpp @@ -116,7 +116,7 @@ namespace Catch { arcSafeRelease( m_substr ); } - bool match( NSString* arg ) const override { + bool match( NSString* const& str ) const override { return false; } @@ -126,7 +126,7 @@ namespace Catch { struct Equals : StringHolder { Equals( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const override { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str isEqualToString:m_substr]; } @@ -139,7 +139,7 @@ namespace Catch { struct Contains : StringHolder { Contains( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str rangeOfString:m_substr].location != NSNotFound; } @@ -152,7 +152,7 @@ namespace Catch { struct StartsWith : StringHolder { StartsWith( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const override { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str rangeOfString:m_substr].location == 0; } @@ -164,7 +164,7 @@ namespace Catch { struct EndsWith : StringHolder { EndsWith( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const override { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str rangeOfString:m_substr].location == [str length] - [m_substr length]; } diff --git a/packages/Catch2/include/internal/catch_output_redirect.cpp b/packages/Catch2/include/internal/catch_output_redirect.cpp index 86b0f6a0e..1308bfe33 100644 --- a/packages/Catch2/include/internal/catch_output_redirect.cpp +++ b/packages/Catch2/include/internal/catch_output_redirect.cpp @@ -49,6 +49,15 @@ namespace Catch { {} auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); } + RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr) + : m_redirectedCout(redirectedCout), + m_redirectedCerr(redirectedCerr) + {} + + RedirectedStreams::~RedirectedStreams() { + m_redirectedCout += m_redirectedStdOut.str(); + m_redirectedCerr += m_redirectedStdErr.str(); + } #if defined(CATCH_CONFIG_NEW_CAPTURE) @@ -62,7 +71,7 @@ namespace Catch { if (strerror_s(buffer, errno)) { CATCH_RUNTIME_ERROR("Could not translate errno to a string"); } - CATCH_RUNTIME_ERROR("Coul dnot open the temp file: '" << m_buffer << "' because: " << buffer); + CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer); } } #else diff --git a/packages/Catch2/include/internal/catch_output_redirect.h b/packages/Catch2/include/internal/catch_output_redirect.h index ac0404055..3d1c2d451 100644 --- a/packages/Catch2/include/internal/catch_output_redirect.h +++ b/packages/Catch2/include/internal/catch_output_redirect.h @@ -46,6 +46,21 @@ namespace Catch { auto str() const -> std::string; }; + class RedirectedStreams { + public: + RedirectedStreams(RedirectedStreams const&) = delete; + RedirectedStreams& operator=(RedirectedStreams const&) = delete; + RedirectedStreams(RedirectedStreams&&) = delete; + RedirectedStreams& operator=(RedirectedStreams&&) = delete; + + RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr); + ~RedirectedStreams(); + private: + std::string& m_redirectedCout; + std::string& m_redirectedCerr; + RedirectedStdOut m_redirectedStdOut; + RedirectedStdErr m_redirectedStdErr; + }; #if defined(CATCH_CONFIG_NEW_CAPTURE) diff --git a/packages/Catch2/include/internal/catch_preprocessor.hpp b/packages/Catch2/include/internal/catch_preprocessor.hpp index e58e0bc58..faf41e6b3 100644 --- a/packages/Catch2/include/internal/catch_preprocessor.hpp +++ b/packages/Catch2/include/internal/catch_preprocessor.hpp @@ -57,6 +57,16 @@ #define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ #define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ #define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#else +// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) +#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#endif #define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) @@ -71,7 +81,7 @@ #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1(Name, INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) #endif -#define INTERNAL_CATCH_MAKE_TYPE_LIST(types) TypeList<INTERNAL_CATCH_REMOVE_PARENS(types)> +#define INTERNAL_CATCH_MAKE_TYPE_LIST(types) Catch::TypeList<INTERNAL_CATCH_REMOVE_PARENS(types)> #define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(types)\ CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,INTERNAL_CATCH_REMOVE_PARENS(types)) diff --git a/packages/Catch2/include/internal/catch_run_context.cpp b/packages/Catch2/include/internal/catch_run_context.cpp index ffdd2ebbf..bc3a51512 100644 --- a/packages/Catch2/include/internal/catch_run_context.cpp +++ b/packages/Catch2/include/internal/catch_run_context.cpp @@ -14,7 +14,6 @@ namespace Catch { namespace Generators { struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker { - size_t m_index = static_cast<size_t>( -1 ); GeneratorBasePtr m_generator; GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) @@ -28,7 +27,7 @@ namespace Catch { ITracker& currentTracker = ctx.currentTracker(); if( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { assert( childTracker ); - assert( childTracker->isIndexTracker() ); + assert( childTracker->isGeneratorTracker() ); tracker = std::static_pointer_cast<GeneratorTracker>( childTracker ); } else { @@ -37,28 +36,24 @@ namespace Catch { } if( !ctx.completedCycle() && !tracker->isComplete() ) { - if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) - tracker->moveNext(); tracker->open(); } return *tracker; } - void moveNext() { - m_index++; - m_children.clear(); - } - // TrackerBase interface - bool isIndexTracker() const override { return true; } + bool isGeneratorTracker() const override { return true; } auto hasGenerator() const -> bool override { return !!m_generator; } void close() override { TrackerBase::close(); - if( m_runState == CompletedSuccessfully && m_index < m_generator->size()-1 ) + // Generator interface only finds out if it has another item on atual move + if (m_runState == CompletedSuccessfully && m_generator->next()) { + m_children.clear(); m_runState = Executing; + } } // IGeneratorTracker interface @@ -68,14 +63,10 @@ namespace Catch { void setGenerator( GeneratorBasePtr&& generator ) override { m_generator = std::move( generator ); } - auto getIndex() const -> size_t override { - return m_index; - } }; GeneratorTracker::~GeneratorTracker() {} } - RunContext::RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter) : m_runInfo(_config->name()), m_context(getCurrentMutableContext()), @@ -170,6 +161,9 @@ namespace Catch { // and should be let to clear themselves out. static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); + if (result.getResultType() != ResultWas::Warning) + m_messageScopes.clear(); + // Reset working state resetAssertionInfo(); m_lastResult = result; @@ -224,6 +218,7 @@ namespace Catch { m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions)); m_messages.clear(); + m_messageScopes.clear(); } void RunContext::sectionEndedEarly(SectionEndInfo const & endInfo) { @@ -250,6 +245,10 @@ namespace Catch { m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end()); } + void RunContext::emplaceUnscopedMessage( MessageBuilder const& builder ) { + m_messageScopes.emplace_back( builder ); + } + std::string RunContext::getCurrentTestName() const { return m_activeTestCase ? m_activeTestCase->getTestCaseInfo().name @@ -310,6 +309,7 @@ namespace Catch { m_lastAssertionPassed = true; ++m_totals.assertions.passed; resetAssertionInfo(); + m_messageScopes.clear(); } bool RunContext::aborting() const { @@ -331,13 +331,10 @@ namespace Catch { CATCH_TRY { if (m_reporter->getPreferences().shouldRedirectStdOut) { #if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) - RedirectedStdOut redirectedStdOut; - RedirectedStdErr redirectedStdErr; + RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr); timer.start(); invokeActiveTestCase(); - redirectedCout += redirectedStdOut.str(); - redirectedCerr += redirectedStdErr.str(); #else OutputRedirect r(redirectedCout, redirectedCerr); timer.start(); @@ -364,6 +361,7 @@ namespace Catch { m_testCaseTracker->close(); handleUnfinishedSections(); m_messages.clear(); + m_messageScopes.clear(); SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions); m_reporter->sectionEnded(testCaseSectionStats); diff --git a/packages/Catch2/include/internal/catch_run_context.h b/packages/Catch2/include/internal/catch_run_context.h index 952ef1478..c530a7b2d 100644 --- a/packages/Catch2/include/internal/catch_run_context.h +++ b/packages/Catch2/include/internal/catch_run_context.h @@ -88,6 +88,8 @@ namespace Catch { void pushScopedMessage( MessageInfo const& message ) override; void popScopedMessage( MessageInfo const& message ) override; + void emplaceUnscopedMessage( MessageBuilder const& builder ) override; + std::string getCurrentTestName() const override; const AssertionResult* getLastResult() const override; @@ -128,13 +130,14 @@ namespace Catch { TestRunInfo m_runInfo; IMutableContext& m_context; TestCase const* m_activeTestCase = nullptr; - ITracker* m_testCaseTracker; + ITracker* m_testCaseTracker = nullptr; Option<AssertionResult> m_lastResult; IConfigPtr m_config; Totals m_totals; IStreamingReporterPtr m_reporter; std::vector<MessageInfo> m_messages; + std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */ AssertionInfo m_lastAssertionInfo; std::vector<SectionEndInfo> m_unfinishedSections; std::vector<ITracker*> m_activeSections; diff --git a/packages/Catch2/include/internal/catch_session.cpp b/packages/Catch2/include/internal/catch_session.cpp index 0920521c0..38b74ef72 100644 --- a/packages/Catch2/include/internal/catch_session.cpp +++ b/packages/Catch2/include/internal/catch_session.cpp @@ -10,6 +10,7 @@ #include "catch_console_colour.h" #include "catch_enforce.h" #include "catch_list.h" +#include "catch_context.h" #include "catch_run_context.h" #include "catch_stream.h" #include "catch_test_spec.h" @@ -42,14 +43,19 @@ namespace Catch { return createReporter(config->getReporterName(), config); } - auto multi = std::unique_ptr<ListeningReporter>(new ListeningReporter); - + // On older platforms, returning std::unique_ptr<ListeningReporter> + // when the return type is std::unique_ptr<IStreamingReporter> + // doesn't compile without a std::move call. However, this causes + // a warning on newer platforms. Thus, we have to work around + // it a bit and downcast the pointer manually. + auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); + auto& multi = static_cast<ListeningReporter&>(*ret); auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); for (auto const& listener : listeners) { - multi->addListener(listener->create(Catch::ReporterConfig(config))); + multi.addListener(listener->create(Catch::ReporterConfig(config))); } - multi->addReporter(createReporter(config->getReporterName(), config)); - return std::move(multi); + multi.addReporter(createReporter(config->getReporterName(), config)); + return ret; } @@ -66,7 +72,10 @@ namespace Catch { auto const& allTestCases = getAllTestCasesSorted(*config); for (auto const& testCase : allTestCases) { - if (!context.aborting() && matchTest(testCase, testSpec, *config)) + bool matching = (!testSpec.hasFilters() && !testCase.isHidden()) || + (testSpec.hasFilters() && matchTest(testCase, testSpec, *config)); + + if (!context.aborting() && matching) totals += context.runTest(testCase); else context.reporter().skipTest(testCase); @@ -166,6 +175,8 @@ namespace Catch { auto result = m_cli.parse( clara::Args( argc, argv ) ); if( !result ) { + config(); + getCurrentMutableContext().setConfig(m_config); Catch::cerr() << Colour( Colour::Red ) << "\nError(s) in input:\n" @@ -257,7 +268,7 @@ namespace Catch { applyFilenamesAsTags( *m_config ); // Handle list request - if( Option<std::size_t> listed = list( config() ) ) + if( Option<std::size_t> listed = list( m_config ) ) return static_cast<int>( *listed ); auto totals = runTests( m_config ); diff --git a/packages/Catch2/include/internal/catch_stringref.h b/packages/Catch2/include/internal/catch_stringref.h index 05206b0b1..64f595b36 100644 --- a/packages/Catch2/include/internal/catch_stringref.h +++ b/packages/Catch2/include/internal/catch_stringref.h @@ -13,8 +13,6 @@ namespace Catch { - class StringData; - /// A non-owning string class (similar to the forthcoming std::string_view) /// Note that, because a StringRef may be a substring of another string, /// it may not be null terminated. c_str() must return a null terminated diff --git a/packages/Catch2/include/internal/catch_suppress_warnings.h b/packages/Catch2/include/internal/catch_suppress_warnings.h index 25d90125b..dc8c1da2f 100644 --- a/packages/Catch2/include/internal/catch_suppress_warnings.h +++ b/packages/Catch2/include/internal/catch_suppress_warnings.h @@ -16,10 +16,11 @@ # pragma clang diagnostic ignored "-Wcovered-switch-default" # endif #elif defined __GNUC__ - // GCC likes to warn on REQUIREs, and we cannot suppress them - // locally because g++'s support for _Pragma is lacking in older, - // still supported, versions -# pragma GCC diagnostic ignored "-Wparentheses" + // Because REQUIREs trigger GCC's -Wparentheses, and because still + // supported version of g++ have only buggy support for _Pragmas, + // Wparentheses have to be suppressed globally. +# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details + # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-variable" # pragma GCC diagnostic ignored "-Wpadded" diff --git a/packages/Catch2/include/internal/catch_test_case_info.cpp b/packages/Catch2/include/internal/catch_test_case_info.cpp index 536462d11..4baa9d4bd 100644 --- a/packages/Catch2/include/internal/catch_test_case_info.cpp +++ b/packages/Catch2/include/internal/catch_test_case_info.cpp @@ -43,7 +43,7 @@ namespace Catch { void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) { CATCH_ENFORCE( !isReservedTag(tag), "Tag name: [" << tag << "] is not allowed.\n" - << "Tag names starting with non alpha-numeric characters are reserved\n" + << "Tag names starting with non alphanumeric characters are reserved\n" << _lineInfo ); } } @@ -75,6 +75,12 @@ namespace Catch { else if( prop == TestCaseInfo::None ) enforceNotReservedTag( tag, _lineInfo ); + // Merged hide tags like `[.approvals]` should be added as + // `[.][approvals]`. The `[.]` is added at later point, so + // we only strip the prefix + if (startsWith(tag, '.') && tag.size() > 1) { + tag.erase(0, 1); + } tags.push_back( tag ); tag.clear(); inTag = false; diff --git a/packages/Catch2/include/internal/catch_test_case_registry_impl.cpp b/packages/Catch2/include/internal/catch_test_case_registry_impl.cpp index a6b7f5703..a85d0edf6 100644 --- a/packages/Catch2/include/internal/catch_test_case_registry_impl.cpp +++ b/packages/Catch2/include/internal/catch_test_case_registry_impl.cpp @@ -54,9 +54,12 @@ namespace Catch { std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config ) { std::vector<TestCase> filtered; filtered.reserve( testCases.size() ); - for( auto const& testCase : testCases ) - if( matchTest( testCase, testSpec, config ) ) - filtered.push_back( testCase ); + for (auto const& testCase : testCases) { + if ((!testSpec.hasFilters() && !testCase.isHidden()) || + (testSpec.hasFilters() && matchTest(testCase, testSpec, config))) { + filtered.push_back(testCase); + } + } return filtered; } std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config ) { diff --git a/packages/Catch2/include/internal/catch_test_case_tracker.cpp b/packages/Catch2/include/internal/catch_test_case_tracker.cpp index 7839a71b4..210f27305 100644 --- a/packages/Catch2/include/internal/catch_test_case_tracker.cpp +++ b/packages/Catch2/include/internal/catch_test_case_tracker.cpp @@ -121,7 +121,7 @@ namespace TestCaseTracking { } bool TrackerBase::isSectionTracker() const { return false; } - bool TrackerBase::isIndexTracker() const { return false; } + bool TrackerBase::isGeneratorTracker() const { return false; } void TrackerBase::open() { m_runState = Executing; @@ -190,6 +190,17 @@ namespace TestCaseTracking { } } + bool SectionTracker::isComplete() const { + bool complete = true; + + if ((m_filters.empty() || m_filters[0] == "") || + std::find(m_filters.begin(), m_filters.end(), + m_nameAndLocation.name) != m_filters.end()) + complete = TrackerBase::isComplete(); + return complete; + + } + bool SectionTracker::isSectionTracker() const { return true; } SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) { @@ -227,55 +238,11 @@ namespace TestCaseTracking { m_filters.insert( m_filters.end(), ++filters.begin(), filters.end() ); } - IndexTracker::IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ) - : TrackerBase( nameAndLocation, ctx, parent ), - m_size( size ) - {} - - bool IndexTracker::isIndexTracker() const { return true; } - - IndexTracker& IndexTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ) { - std::shared_ptr<IndexTracker> tracker; - - ITracker& currentTracker = ctx.currentTracker(); - if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { - assert( childTracker ); - assert( childTracker->isIndexTracker() ); - tracker = std::static_pointer_cast<IndexTracker>( childTracker ); - } - else { - tracker = std::make_shared<IndexTracker>( nameAndLocation, ctx, ¤tTracker, size ); - currentTracker.addChild( tracker ); - } - - if( !ctx.completedCycle() && !tracker->isComplete() ) { - if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) - tracker->moveNext(); - tracker->open(); - } - - return *tracker; - } - - int IndexTracker::index() const { return m_index; } - - void IndexTracker::moveNext() { - m_index++; - m_children.clear(); - } - - void IndexTracker::close() { - TrackerBase::close(); - if( m_runState == CompletedSuccessfully && m_index < m_size-1 ) - m_runState = Executing; - } - } // namespace TestCaseTracking using TestCaseTracking::ITracker; using TestCaseTracking::TrackerContext; using TestCaseTracking::SectionTracker; -using TestCaseTracking::IndexTracker; } // namespace Catch diff --git a/packages/Catch2/include/internal/catch_test_case_tracker.h b/packages/Catch2/include/internal/catch_test_case_tracker.h index 72b506a9f..172760017 100644 --- a/packages/Catch2/include/internal/catch_test_case_tracker.h +++ b/packages/Catch2/include/internal/catch_test_case_tracker.h @@ -54,7 +54,7 @@ namespace TestCaseTracking { // Debug/ checking virtual bool isSectionTracker() const = 0; - virtual bool isIndexTracker() const = 0; + virtual bool isGeneratorTracker() const = 0; }; class TrackerContext { @@ -120,7 +120,7 @@ namespace TestCaseTracking { void openChild() override; bool isSectionTracker() const override; - bool isIndexTracker() const override; + bool isGeneratorTracker() const override; void open(); @@ -140,6 +140,8 @@ namespace TestCaseTracking { bool isSectionTracker() const override; + bool isComplete() const override; + static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ); void tryOpen(); @@ -148,28 +150,11 @@ namespace TestCaseTracking { void addNextFilters( std::vector<std::string> const& filters ); }; - class IndexTracker : public TrackerBase { - int m_size; - int m_index = -1; - public: - IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ); - - bool isIndexTracker() const override; - void close() override; - - static IndexTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ); - - int index() const; - - void moveNext(); - }; - } // namespace TestCaseTracking using TestCaseTracking::ITracker; using TestCaseTracking::TrackerContext; using TestCaseTracking::SectionTracker; -using TestCaseTracking::IndexTracker; } // namespace Catch diff --git a/packages/Catch2/include/internal/catch_test_registry.h b/packages/Catch2/include/internal/catch_test_registry.h index 7ad8c802d..0e7b53ded 100644 --- a/packages/Catch2/include/internal/catch_test_registry.h +++ b/packages/Catch2/include/internal/catch_test_registry.h @@ -161,11 +161,14 @@ struct AutoReg : NonCopyable { CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...) \ int index = 0; \ using expander = int[]; \ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + Catch::StringMaker<int>::convert(index++), Tags } ), 0)... };/* NOLINT */ \ + constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ + constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ + constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */\ } \ }; \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ - using TestInit = combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)> \ + using TestInit = Catch::combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)> \ ::with_types<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(TypesList)>::into<TestName>::type; \ TestInit(); \ return 0; \ @@ -226,11 +229,14 @@ struct AutoReg : NonCopyable { CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...)\ int index = 0;\ using expander = int[];\ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + Catch::StringMaker<int>::convert(index++), Tags } ), 0)... };/* NOLINT */ \ + constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ + constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ + constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */ \ }\ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ - using TestInit = combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>\ + using TestInit = Catch::combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>\ ::with_types<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(TypesList)>::into<TestNameClass>::type;\ TestInit();\ return 0;\ diff --git a/packages/Catch2/include/internal/catch_timer.cpp b/packages/Catch2/include/internal/catch_timer.cpp index d52c0085c..ca383a2df 100644 --- a/packages/Catch2/include/internal/catch_timer.cpp +++ b/packages/Catch2/include/internal/catch_timer.cpp @@ -40,7 +40,7 @@ namespace Catch { // is terrible and we should move on. // TBD: How to signal that the measured resolution is probably wrong? if (ticks > startTime + 3 * nanosecondsInSecond) { - return sum / i; + return sum / ( i + 1u ); } } diff --git a/packages/Catch2/include/internal/catch_tostring.h b/packages/Catch2/include/internal/catch_tostring.h index 3aff268bc..13a43b0c8 100644 --- a/packages/Catch2/include/internal/catch_tostring.h +++ b/packages/Catch2/include/internal/catch_tostring.h @@ -348,6 +348,7 @@ namespace Catch { # define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER # define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER # define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +# define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER #endif // Separate std::pair specialization @@ -369,6 +370,24 @@ namespace Catch { } #endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER +#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL) +#include <optional> +namespace Catch { + template<typename T> + struct StringMaker<std::optional<T> > { + static std::string convert(const std::optional<T>& optional) { + ReusableStringStream rss; + if (optional.has_value()) { + rss << ::Catch::Detail::stringify(*optional); + } else { + rss << "{ }"; + } + return rss.str(); + } + }; +} +#endif // CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER + // Separate std::tuple specialization #if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER) #include <tuple> diff --git a/packages/Catch2/include/internal/catch_type_traits.hpp b/packages/Catch2/include/internal/catch_type_traits.hpp index 88615484b..8edb1ecf0 100644 --- a/packages/Catch2/include/internal/catch_type_traits.hpp +++ b/packages/Catch2/include/internal/catch_type_traits.hpp @@ -9,6 +9,8 @@ #ifndef TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED #define TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED +#include <type_traits> + namespace Catch{ #ifdef CATCH_CPP17_OR_GREATER diff --git a/packages/Catch2/include/internal/catch_version.cpp b/packages/Catch2/include/internal/catch_version.cpp index 16887eb22..43832053c 100644 --- a/packages/Catch2/include/internal/catch_version.cpp +++ b/packages/Catch2/include/internal/catch_version.cpp @@ -37,7 +37,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 2, 5, 0, "", 0 ); + static Version version( 2, 7, 1, "", 0 ); return version; } diff --git a/packages/Catch2/include/internal/catch_xmlwriter.cpp b/packages/Catch2/include/internal/catch_xmlwriter.cpp index 221f1c63c..5354efa7c 100644 --- a/packages/Catch2/include/internal/catch_xmlwriter.cpp +++ b/packages/Catch2/include/internal/catch_xmlwriter.cpp @@ -44,9 +44,11 @@ namespace { } void hexEscapeChar(std::ostream& os, unsigned char c) { + std::ios_base::fmtflags f(os.flags()); os << "\\x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(c); + os.flags(f); } } // anonymous namespace diff --git a/packages/Catch2/include/reporters/catch_reporter_bases.cpp b/packages/Catch2/include/reporters/catch_reporter_bases.cpp index fa441ee54..fcbafef58 100644 --- a/packages/Catch2/include/reporters/catch_reporter_bases.cpp +++ b/packages/Catch2/include/reporters/catch_reporter_bases.cpp @@ -36,11 +36,25 @@ namespace Catch { #ifdef _MSC_VER sprintf_s(buffer, "%.3f", duration); #else - sprintf(buffer, "%.3f", duration); + std::sprintf(buffer, "%.3f", duration); #endif return std::string(buffer); } + std::string serializeFilters( std::vector<std::string> const& container ) { + ReusableStringStream oss; + bool first = true; + for (auto&& filter : container) + { + if (!first) + oss << ' '; + else + first = false; + + oss << filter; + } + return oss.str(); + } TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config) :StreamingReporterBase(_config) {} diff --git a/packages/Catch2/include/reporters/catch_reporter_bases.hpp b/packages/Catch2/include/reporters/catch_reporter_bases.hpp index 4a27db681..a9b0640c3 100644 --- a/packages/Catch2/include/reporters/catch_reporter_bases.hpp +++ b/packages/Catch2/include/reporters/catch_reporter_bases.hpp @@ -25,6 +25,8 @@ namespace Catch { // Returns double formatted as %.3f (format expected on output) std::string getFormattedDuration( double duration ); + std::string serializeFilters( std::vector<std::string> const& container ); + template<typename DerivedT> struct StreamingReporterBase : IStreamingReporter { @@ -52,6 +54,7 @@ namespace Catch { void testRunStarting(TestRunInfo const& _testRunInfo) override { currentTestRunInfo = _testRunInfo; } + void testGroupStarting(GroupInfo const& _groupInfo) override { currentGroupInfo = _groupInfo; } diff --git a/packages/Catch2/include/reporters/catch_reporter_console.cpp b/packages/Catch2/include/reporters/catch_reporter_console.cpp index 500677b9c..53b977eb1 100644 --- a/packages/Catch2/include/reporters/catch_reporter_console.cpp +++ b/packages/Catch2/include/reporters/catch_reporter_console.cpp @@ -245,7 +245,7 @@ public: case Unit::Nanoseconds: return "ns"; case Unit::Microseconds: - return "µs"; + return "us"; case Unit::Milliseconds: return "ms"; case Unit::Seconds: @@ -441,6 +441,10 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { stream << std::endl; StreamingReporterBase::testRunEnded(_testRunStats); } +void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { + StreamingReporterBase::testRunStarting(_testInfo); + printTestFilters(); +} void ConsoleReporter::lazyPrint() { @@ -622,6 +626,11 @@ void ConsoleReporter::printSummaryDivider() { stream << getLineOfChars<'-'>() << '\n'; } +void ConsoleReporter::printTestFilters() { + if (m_config->testSpec().hasFilters()) + stream << Colour(Colour::BrightYellow) << "Filters: " << serializeFilters( m_config->getTestsOrTags() ) << '\n'; +} + CATCH_REGISTER_REPORTER("console", ConsoleReporter) } // end namespace Catch diff --git a/packages/Catch2/include/reporters/catch_reporter_console.h b/packages/Catch2/include/reporters/catch_reporter_console.h index 10cea49ab..effa58d34 100644 --- a/packages/Catch2/include/reporters/catch_reporter_console.h +++ b/packages/Catch2/include/reporters/catch_reporter_console.h @@ -46,7 +46,7 @@ namespace Catch { void testCaseEnded(TestCaseStats const& _testCaseStats) override; void testGroupEnded(TestGroupStats const& _testGroupStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; - + void testRunStarting(TestRunInfo const& _testRunInfo) override; private: void lazyPrint(); @@ -69,6 +69,7 @@ namespace Catch { void printTotalsDivider(Totals const& totals); void printSummaryDivider(); + void printTestFilters(); private: bool m_headerPrinted = false; diff --git a/packages/Catch2/include/reporters/catch_reporter_junit.cpp b/packages/Catch2/include/reporters/catch_reporter_junit.cpp index 03dc35c1b..e83758622 100644 --- a/packages/Catch2/include/reporters/catch_reporter_junit.cpp +++ b/packages/Catch2/include/reporters/catch_reporter_junit.cpp @@ -114,6 +114,7 @@ namespace Catch { void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) { XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); + TestGroupStats const& stats = groupNode.value; xml.writeAttribute( "name", stats.groupInfo.name ); xml.writeAttribute( "errors", unexpectedExceptions ); @@ -126,6 +127,21 @@ namespace Catch { xml.writeAttribute( "time", suiteTime ); xml.writeAttribute( "timestamp", getCurrentTimestamp() ); + // Write properties if there are any + if (m_config->hasTestFilters() || m_config->rngSeed() != 0) { + auto properties = xml.scopedElement("properties"); + if (m_config->hasTestFilters()) { + xml.scopedElement("property") + .writeAttribute("name", "filters") + .writeAttribute("value", serializeFilters(m_config->getTestsOrTags())); + } + if (m_config->rngSeed() != 0) { + xml.scopedElement("property") + .writeAttribute("name", "random-seed") + .writeAttribute("value", m_config->rngSeed()); + } + } + // Write test cases for( auto const& child : groupNode.children ) writeTestCase( *child ); diff --git a/packages/Catch2/include/reporters/catch_reporter_tap.hpp b/packages/Catch2/include/reporters/catch_reporter_tap.hpp index ccc4051be..1bfe4f5e1 100644 --- a/packages/Catch2/include/reporters/catch_reporter_tap.hpp +++ b/packages/Catch2/include/reporters/catch_reporter_tap.hpp @@ -42,9 +42,9 @@ namespace Catch { bool assertionEnded( AssertionStats const& _assertionStats ) override { ++counter; + stream << "# " << currentTestCaseInfo->name << std::endl; AssertionPrinter printer( stream, _assertionStats, counter ); printer.print(); - stream << " # " << currentTestCaseInfo->name ; stream << std::endl; return true; diff --git a/packages/Catch2/include/reporters/catch_reporter_xml.cpp b/packages/Catch2/include/reporters/catch_reporter_xml.cpp index 902014cf4..c7572d1eb 100644 --- a/packages/Catch2/include/reporters/catch_reporter_xml.cpp +++ b/packages/Catch2/include/reporters/catch_reporter_xml.cpp @@ -55,6 +55,8 @@ namespace Catch { m_xml.startElement( "Catch" ); if( !m_config->name().empty() ) m_xml.writeAttribute( "name", m_config->name() ); + if (m_config->testSpec().hasFilters()) + m_xml.writeAttribute( "filters", serializeFilters( m_config->getTestsOrTags() ) ); if( m_config->rngSeed() != 0 ) m_xml.scopedElement( "Randomness" ) .writeAttribute( "seed", m_config->rngSeed() ); diff --git a/packages/Catch2/misc/coverage-helper.cpp b/packages/Catch2/misc/coverage-helper.cpp index 172189055..a6643838f 100644 --- a/packages/Catch2/misc/coverage-helper.cpp +++ b/packages/Catch2/misc/coverage-helper.cpp @@ -9,6 +9,38 @@ #include <string> #include <vector> +std::string escape_arg(const std::string& arg) { + if (arg.empty() == false && + arg.find_first_of(" \t\n\v\"") == arg.npos) { + return arg; + } + + std::string escaped; + escaped.push_back('"'); + for (auto it = arg.begin(); ; ++it) { + int num_backslashes = 0; + + while (it != arg.end() && *it == '\\') { + ++it; + ++num_backslashes; + } + + if (it == arg.end()) { + escaped.append(num_backslashes * 2, '\\'); + break; + } else if (*it == '"') { + escaped.append(num_backslashes * 2 + 1, '\\'); + escaped.push_back(*it); + } else { + escaped.append(num_backslashes, '\\'); + escaped.push_back(*it); + } + } + escaped.push_back('"'); + + return escaped; +} + void create_empty_file(std::string const& path) { std::ofstream ofs(path); @@ -60,8 +92,9 @@ std::string windowsify_path(std::string path) { void exec_cmd(std::string const& cmd, int log_num, std::string const& path) { std::array<char, 128> buffer; #if defined(_WIN32) + // cmd has already been escaped outside this function. auto real_cmd = "OpenCppCoverage --export_type binary:cov-report" + std::to_string(log_num) - + ".bin --quiet " + "--sources " + path + " --cover_children -- " + cmd; + + ".bin --quiet " + "--sources " + escape_arg(path) + " --cover_children -- " + cmd; std::cout << "=== Marker ===: Cmd: " << real_cmd << '\n'; std::shared_ptr<FILE> pipe(_popen(real_cmd.c_str(), "r"), _pclose); #else // Just for testing, in the real world we will always work under WIN32 @@ -91,9 +124,9 @@ int main(int argc, char** argv) { assert(sep - begin(args) == 2 && "Structure differs from expected!"); auto num = parse_log_file_arg(args[1]); - + auto cmdline = std::accumulate(++sep, end(args), std::string{}, [] (const std::string& lhs, const std::string& rhs) { - return lhs + ' ' + rhs; + return lhs + ' ' + escape_arg(rhs); }); try { diff --git a/packages/Catch2/projects/CMakeLists.txt b/packages/Catch2/projects/CMakeLists.txt index fbd3fd2ee..37b0865ae 100644 --- a/packages/Catch2/projects/CMakeLists.txt +++ b/packages/Catch2/projects/CMakeLists.txt @@ -19,7 +19,7 @@ set(TEST_SOURCES ${SELF_TEST_DIR}/IntrospectiveTests/CmdLine.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/GeneratorsImpl.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/PartTracker.tests.cpp - ${SELF_TEST_DIR}/IntrospectiveTests/TagAlias.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/Tag.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/String.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Xml.tests.cpp ${SELF_TEST_DIR}/UsageTests/Approx.tests.cpp @@ -36,6 +36,7 @@ set(TEST_SOURCES ${SELF_TEST_DIR}/UsageTests/Misc.tests.cpp ${SELF_TEST_DIR}/UsageTests/ToStringChrono.tests.cpp ${SELF_TEST_DIR}/UsageTests/ToStringGeneral.tests.cpp + ${SELF_TEST_DIR}/UsageTests/ToStringOptional.tests.cpp ${SELF_TEST_DIR}/UsageTests/ToStringPair.tests.cpp ${SELF_TEST_DIR}/UsageTests/ToStringTuple.tests.cpp ${SELF_TEST_DIR}/UsageTests/ToStringVariant.tests.cpp @@ -101,6 +102,8 @@ set(INTERNAL_HEADERS ${HEADER_DIR}/internal/catch_external_interfaces.h ${HEADER_DIR}/internal/catch_fatal_condition.h ${HEADER_DIR}/internal/catch_generators.hpp + ${HEADER_DIR}/internal/catch_generators_generic.hpp + ${HEADER_DIR}/internal/catch_generators_specific.hpp ${HEADER_DIR}/internal/catch_impl.hpp ${HEADER_DIR}/internal/catch_interfaces_capture.h ${HEADER_DIR}/internal/catch_interfaces_config.h @@ -345,10 +348,16 @@ set_tests_properties(NoAssertions PROPERTIES PASS_REGULAR_EXPRESSION "No asserti add_test(NAME NoTest COMMAND $<TARGET_FILE:SelfTest> -w NoTests "___nonexistent_test___") set_tests_properties(NoTest PROPERTIES PASS_REGULAR_EXPRESSION "No test cases matched") +add_test(NAME FilteredSection-1 COMMAND $<TARGET_FILE:SelfTest> \#1394 -c RunSection) +set_tests_properties(FilteredSection-1 PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran") +add_test(NAME FilteredSection-2 COMMAND $<TARGET_FILE:SelfTest> \#1394\ nested -c NestedRunSection -c s1) +set_tests_properties(FilteredSection-2 PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran") + # AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable add_test(NAME ApprovalTests COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/scripts/approvalTests.py $<TARGET_FILE:SelfTest>) set_tests_properties(ApprovalTests PROPERTIES FAIL_REGULAR_EXPRESSION "Results differed") + if (CATCH_USE_VALGRIND) add_test(NAME ValgrindRunTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest>) add_test(NAME ValgrindListTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest> --list-tests --verbosity high) diff --git a/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt index 547678cea..99eca94da 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -14,6 +14,13 @@ Compilation.tests.cpp:<line number>: passed: std::memcmp(uarr, "123", sizeof(uar Compilation.tests.cpp:<line number>: passed: std::memcmp(sarr, "456", sizeof(sarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"' Compilation.tests.cpp:<line number>: passed: Compilation.tests.cpp:<line number>: passed: h1 == h2 for: [1403 helper] == [1403 helper] +Message.tests.cpp:<line number>: warning: ' +This info message starts with a linebreak' with 1 message: ' +This warning message starts with a linebreak' +This would not be caught previously +Nor would this +Tricky.tests.cpp:<line number>: failed: explicitly with 1 message: '1514' +Compilation.tests.cpp:<line number>: passed: std::is_same<TypeList<int>, TypeList<int>>::value for: true Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42' with 1 message: 'expected exception' Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42'; expression was: thisThrows() with 1 message: 'expected exception' Exception.tests.cpp:<line number>: passed: thisThrows() with 1 message: 'answer := 42' @@ -57,106 +64,87 @@ Tricky.tests.cpp:<line number>: passed: !is_true<false>::value for: true Tricky.tests.cpp:<line number>: passed: !!is_true<true>::value for: true Tricky.tests.cpp:<line number>: passed: is_true<true>::value for: true Tricky.tests.cpp:<line number>: passed: !(is_true<false>::value) for: !false -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 1 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 2 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 3 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 4 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 5 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 6 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 7 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 8 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 9 < 110 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 101 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 102 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 103 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 104 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 105 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 106 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 107 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 108 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 109 -Generators.tests.cpp:<line number>: passed: x < y for: 10 < 110 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 1 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 1 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 2 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 2 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 4 +Generators.tests.cpp:<line number>: passed: y < z for: 4 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 5 +Generators.tests.cpp:<line number>: passed: y < z for: 5 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 9 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 7 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 7 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 8 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 8 +Generators.tests.cpp:<line number>: passed: x < y for: 3 < 6 +Generators.tests.cpp:<line number>: passed: y < z for: 6 < 9 +Generators.tests.cpp:<line number>: passed: x < z for: 3 < 9 Class.tests.cpp:<line number>: failed: s == "world" for: "hello" == "world" Class.tests.cpp:<line number>: passed: s == "hello" for: "hello" == "hello" Class.tests.cpp:<line number>: failed: Template_Fixture_2<TestType>::m_a.size() == 1 for: 0 == 1 @@ -338,9 +326,9 @@ Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals("this Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals("this string contains 'ABC' as a substring") for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) -ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(WhatException{}) == "This exception has overriden what() method" for: "This exception has overriden what() method" +ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" for: "This exception has overridden what() method" == -"This exception has overriden what() method" +"This exception has overridden what() method" ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" for: "OperatorException" == "OperatorException" ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" for: "StringMakerException" == @@ -418,48 +406,189 @@ Matchers.tests.cpp:<line number>: passed: WithinAbs(1.f, 0.f) Matchers.tests.cpp:<line number>: passed: WithinAbs(1.f, -1.f), std::domain_error Matchers.tests.cpp:<line number>: passed: WithinULP(1.f, 0) Matchers.tests.cpp:<line number>: passed: WithinULP(1.f, -1), std::domain_error -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "a"' and 'j := 8' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "a"' and 'j := 9' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "a"' and 'j := 10' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "a"' and 'j := 2' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "a"' and 'j := 3.141' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "a"' and 'j := 1.379' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "b"' and 'j := 8' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "b"' and 'j := 9' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "b"' and 'j := 10' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "b"' and 'j := 2' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "b"' and 'j := 3.141' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "b"' and 'j := 1.379' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "c"' and 'j := 8' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "c"' and 'j := 9' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "c"' and 'j := 10' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "c"' and 'j := 2' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "c"' and 'j := 3.141' -Generators.tests.cpp:<line number>: passed: with 2 messages: 'i := "c"' and 'j := 1.379' -GeneratorsImpl.tests.cpp:<line number>: passed: gen.size() == 2 for: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[0] == 1 for: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[1] == 2 for: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: passed: gen.size() == 4 for: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[0] == 3 for: 3 == 3 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[1] == 1 for: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[2] == 4 for: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[3] == 1 for: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: passed: gen.size() == 4 for: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[0] == 1 for: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[1] == 2 for: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[2] == 9 for: 9 == 9 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[3] == 7 for: 7 == 7 -GeneratorsImpl.tests.cpp:<line number>: passed: gen.size() == 2 for: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[0] == 3 for: 3 == 3 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[1] == 1 for: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: passed: gen.size() == 2 for: 2 == 2 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[0] == 3 for: 3 == 3 -GeneratorsImpl.tests.cpp:<line number>: passed: gen[1] == 1 for: 1 == 1 -GeneratorsImpl.tests.cpp:<line number>: passed: base->size() == 4 for: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: passed: typed for: 0x<hex digits> -GeneratorsImpl.tests.cpp:<line number>: passed: typed->size() == 4 for: 4 == 4 -GeneratorsImpl.tests.cpp:<line number>: passed: (*typed)[0] == 7 for: 7 == 7 -GeneratorsImpl.tests.cpp:<line number>: passed: (*typed)[3] == 11 for: 11 == 11 +Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 +Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 +Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 +Generators.tests.cpp:<line number>: passed: filter([] (int) {return false; }, value(1)), Catch::GeneratorException +Generators.tests.cpp:<line number>: passed: i < 4 for: 1 < 4 +Generators.tests.cpp:<line number>: passed: i < 4 for: 2 < 4 +Generators.tests.cpp:<line number>: passed: i < 4 for: 3 < 4 +Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 +Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 +Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 +Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1 +Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1 +Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1 +Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1 +Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1 +Generators.tests.cpp:<line number>: passed: i.size() == 1 for: 1 == 1 +Generators.tests.cpp:<line number>: passed: j > 0 for: 1 > 0 +Generators.tests.cpp:<line number>: passed: j > 0 for: 2 > 0 +Generators.tests.cpp:<line number>: passed: j > 0 for: 3 > 0 +Generators.tests.cpp:<line number>: passed: j > 0 for: 1 > 0 +Generators.tests.cpp:<line number>: passed: j > 0 for: 2 > 0 +Generators.tests.cpp:<line number>: passed: j > 0 for: 3 > 0 +Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2 +Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 1 == 1 +Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2 +Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 2 == 2 +Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2 +Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 3 == 3 +Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2 +Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 1 == 1 +Generators.tests.cpp:<line number>: passed: chunk2.front() < 3 for: 1 < 3 +Generators.tests.cpp:<line number>: passed: chunk2.size() == 2 for: 2 == 2 +Generators.tests.cpp:<line number>: passed: chunk2.front() == chunk2.back() for: 2 == 2 +Generators.tests.cpp:<line number>: passed: chunk2.front() < 3 for: 2 < 3 +Generators.tests.cpp:<line number>: passed: chunk(2, value(1)), Catch::GeneratorException +Generators.tests.cpp:<line number>: passed: j < i for: -3 < 1 +Generators.tests.cpp:<line number>: passed: j < i for: -2 < 1 +Generators.tests.cpp:<line number>: passed: j < i for: -1 < 1 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 4 > 1 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 4 > 2 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 4 > 3 +Generators.tests.cpp:<line number>: passed: j < i for: -3 < 2 +Generators.tests.cpp:<line number>: passed: j < i for: -2 < 2 +Generators.tests.cpp:<line number>: passed: j < i for: -1 < 2 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 8 > 1 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 8 > 2 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 8 > 3 +Generators.tests.cpp:<line number>: passed: j < i for: -3 < 3 +Generators.tests.cpp:<line number>: passed: j < i for: -2 < 3 +Generators.tests.cpp:<line number>: passed: j < i for: -1 < 3 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 1 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 2 +Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 3 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 123 for: 123 == 123 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 4 for: 4 == 4 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 0 for: 0 == 0 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get().size() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == "aa" for: "aa" == "aa" +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == "bb" for: "bb" == "bb" +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == "cc" for: "cc" == "cc" +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: filter([] (int) { return false; }, value(1)), Catch::GeneratorException +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2.0 for: 2.0 == 2.0 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 4.0 for: 4.0 == 4.0 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 6.0 for: 6.0 == 6.0 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2.0 for: 2.0 == 2.0 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 4.0 for: 4.0 == 4.0 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 6.0 for: 6.0 == 6.0 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 3 for: 3 == 3 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -2 for: -2 == -2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 0 for: 0 == 0 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 0 for: 0 == 0 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -1 for: -1 == -1 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -4 for: -4 == -4 +GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true +GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == -7 for: -7 == -7 +GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false Approx.tests.cpp:<line number>: passed: d >= Approx( 1.22 ) for: 1.23 >= Approx( 1.22 ) Approx.tests.cpp:<line number>: passed: d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) Approx.tests.cpp:<line number>: passed: !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) @@ -511,6 +640,22 @@ Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !Contains("di Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !Contains("substring") for: "this string contains 'abc' as a substring" not contains: "substring" Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" Exception.tests.cpp:<line number>: failed: thisThrows(), "should fail" for: "expected exception" equals: "should fail" +Generators.tests.cpp:<line number>: passed: values > -6 for: 3 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 4 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 5 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 6 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: -5 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: -4 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 90 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 91 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 92 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 93 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 94 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 95 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 96 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 97 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 98 > -6 +Generators.tests.cpp:<line number>: passed: values > -6 for: 99 > -6 Misc.tests.cpp:<line number>: warning: 'This one ran' Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'custom exception' Tricky.tests.cpp:<line number>: passed: True for: {?} @@ -762,9 +907,9 @@ CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "--use-colour", "no" CmdLine.tests.cpp:<line number>: passed: config.useColour == UseColour::No for: 2 == 2 CmdLine.tests.cpp:<line number>: passed: !result for: true CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), Contains( "colour mode must be one of" ) for: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" -Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1 -Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1 Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1 +Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1 +Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1 Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy! Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively @@ -878,22 +1023,22 @@ Misc.tests.cpp:<line number>: failed: s1 == s2 for: "if ($b == 10) { $a = 20; } " -TagAlias.tests.cpp:<line number>: passed: what, Contains( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:<line number>: passed: what, Contains( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" -TagAlias.tests.cpp:<line number>: passed: what, Contains( "file" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:<line number>: passed: what, Contains( "file" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" -TagAlias.tests.cpp:<line number>: passed: what, Contains( "2" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:<line number>: passed: what, Contains( "2" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" -TagAlias.tests.cpp:<line number>: passed: what, Contains( "10" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:<line number>: passed: what, Contains( "10" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "10" -TagAlias.tests.cpp:<line number>: passed: registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) -TagAlias.tests.cpp:<line number>: passed: registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) -TagAlias.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) -TagAlias.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) +Tag.tests.cpp:<line number>: passed: registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) +Tag.tests.cpp:<line number>: passed: registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) +Tag.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) +Tag.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) 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 @@ -1034,69 +1179,6 @@ PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false PartTracker.tests.cpp:<line number>: passed: s1.isComplete() for: true PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:<line number>: passed: g1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase.isSuccessfullyCompleted() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.index() == 1 for: 1 == 1 -PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s1b.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: testCase2.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:<line number>: passed: g1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s2.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s2.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.index() == 1 for: 1 == 1 -PartTracker.tests.cpp:<line number>: passed: s2b.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s2b.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: s1b.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: testCase2.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:<line number>: passed: g1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s2.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s2.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: s2.isSuccessfullyCompleted() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1b.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:<line number>: passed: s2b.isOpen() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: g1b.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: s1b.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase2.isComplete() == false for: false == false -PartTracker.tests.cpp:<line number>: passed: testCase3.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s1c.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1c.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: g1c.index() == 1 for: 1 == 1 -PartTracker.tests.cpp:<line number>: passed: s2c.isOpen() for: true -PartTracker.tests.cpp:<line number>: passed: s2c.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: g1c.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: s1c.isComplete() for: true -PartTracker.tests.cpp:<line number>: passed: testCase3.isComplete() for: true Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14' Approx.tests.cpp:<line number>: passed: d == approx( 1.23 ) for: 1.23 == Approx( 1.23 ) Approx.tests.cpp:<line number>: passed: d == approx( 1.22 ) for: 1.23 == Approx( 1.22 ) @@ -1231,6 +1313,7 @@ Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: loose text artifact Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'Previous info should not be seen' +Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'previous unscoped info SHOULD not be seen' Misc.tests.cpp:<line number>: passed: l == std::numeric_limits<long long>::max() for: 9223372036854775807 (0x<hex digits>) == 9223372036854775807 (0x<hex digits>) @@ -1252,6 +1335,8 @@ Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 mes Misc.tests.cpp:<line number>: passed: ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[5] (8) is even' Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even' Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even' +Message.tests.cpp:<line number>: warning: 'info' with 2 messages: 'unscoped info' and 'and warn may mix' +Message.tests.cpp:<line number>: warning: 'info' with 2 messages: 'unscoped info' and 'they are not cleared after warnings' Misc.tests.cpp:<line number>: failed: a == b for: 1 == 2 Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2 Misc.tests.cpp:<line number>: passed: a < b for: 1 < 2 @@ -1261,6 +1346,9 @@ Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2 Tricky.tests.cpp:<line number>: passed: s == "7" for: "7" == "7" Tricky.tests.cpp:<line number>: passed: ti == typeid(int) for: {?} == {?} Misc.tests.cpp:<line number>: passed: +Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen only for the FIRST assertion IF info is printed for passing assertions' +Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen only for the SECOND assertion IF info is printed for passing assertions' +Message.tests.cpp:<line number>: failed: false with 1 message: 'this SHOULD be seen' Misc.tests.cpp:<line number>: passed: makeString( false ) != static_cast<char*>(0) for: "valid string" != {null string} Misc.tests.cpp:<line number>: passed: makeString( true ) == static_cast<char*>(0) for: {null string} == {null string} Tricky.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0 @@ -1268,6 +1356,12 @@ ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, "Arthur" }, { "Ford", 24 } }" Tricky.tests.cpp:<line number>: passed: p == 0 for: 0 == 0 +Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen IF info is printed for passing assertions' +Message.tests.cpp:<line number>: failed: false with 2 messages: 'this SHOULD be seen' and 'this SHOULD also be seen' +Message.tests.cpp:<line number>: failed: false with 1 message: 'this SHOULD be seen only ONCE' +Message.tests.cpp:<line number>: passed: true +Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY also be seen only ONCE IF info is printed for passing assertions' +Message.tests.cpp:<line number>: passed: true Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2 Misc.tests.cpp:<line number>: passed: b != a for: 2 != 1 Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2 @@ -1287,6 +1381,9 @@ String.tests.cpp:<line number>: passed: Catch::replaceInPlace( s, "'", "|'" ) fo String.tests.cpp:<line number>: passed: s == "didn|'t" for: "didn|'t" == "didn|'t" Misc.tests.cpp:<line number>: failed: false with 1 message: '3' Message.tests.cpp:<line number>: failed: false with 2 messages: 'hi' and 'i := 7' +Tag.tests.cpp:<line number>: passed: testcase.tags, Catch::VectorContains(std::string("magic-tag")) && Catch::VectorContains(std::string(".")) for: { ".", "magic-tag" } ( Contains: "magic-tag" and Contains: "." ) +Message.tests.cpp:<line number>: failed: false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' +Message.tests.cpp:<line number>: failed: false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6' ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( emptyMap ) == "{ }" for: "{ }" == "{ }" ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }" ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" @@ -1337,6 +1434,10 @@ Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 = Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 == 3 Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 5 == 5 Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 4 == 4 +Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5 +Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6 +Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5 +Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6 Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'Why would you throw a std::string?' Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" @@ -1404,5 +1505,5 @@ Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: -Failed 69 test cases, failed 129 assertions. +Failed 78 test cases, failed 139 assertions. diff --git a/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt index df483fda2..3b6f20684 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/console.std.approved.txt @@ -1,3 +1,4 @@ +Filters: ~[!nonportable]~[!benchmark]~[approvals] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <exe-name> is a <version> host application. @@ -5,6 +6,28 @@ Run with -? for options Randomness seeded to: 1 +------------------------------------------------------------------------------- +#1455 - INFO and WARN can start with a linebreak +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: warning: + +This warning message starts with a linebreak + +This would not be caught previously +Nor would this +------------------------------------------------------------------------------- +#1514: stderr/stdout is not captured in tests aborted by an exception +------------------------------------------------------------------------------- +Tricky.tests.cpp:<line number> +............................................................................... + +Tricky.tests.cpp:<line number>: FAILED: +explicitly with message: + 1514 + ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions outside assertions @@ -93,7 +116,8 @@ with expansion: "hello" == "world" ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0 +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo +<float> ------------------------------------------------------------------------------- Class.tests.cpp:<line number> ............................................................................... @@ -104,7 +128,8 @@ with expansion: 0 == 1 ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1 +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo +<int> ------------------------------------------------------------------------------- Class.tests.cpp:<line number> ............................................................................... @@ -115,7 +140,8 @@ with expansion: 0 == 1 ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2 +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector +<float> ------------------------------------------------------------------------------- Class.tests.cpp:<line number> ............................................................................... @@ -126,7 +152,8 @@ with expansion: 0 == 1 ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3 +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector +<int> ------------------------------------------------------------------------------- Class.tests.cpp:<line number> ............................................................................... @@ -1040,6 +1067,16 @@ Message.tests.cpp:<line number>: FAILED: explicitly with message: Previous info should not be seen +------------------------------------------------------------------------------- +just failure after unscoped info +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: +explicitly with message: + previous unscoped info SHOULD not be seen + ------------------------------------------------------------------------------- looped SECTION tests b is currently: 0 @@ -1112,6 +1149,18 @@ with expansion: with message: Testing if fib[7] (21) is even +------------------------------------------------------------------------------- +mix info, unscoped info and warning +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: warning: + and warn may mix + +Message.tests.cpp:<line number>: warning: + they are not cleared after warnings + ------------------------------------------------------------------------------- more nested SECTION tests doesn't equal @@ -1125,6 +1174,40 @@ Misc.tests.cpp:<line number>: FAILED: with expansion: 1 == 2 +------------------------------------------------------------------------------- +not prints unscoped info from previous failures +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: + REQUIRE( false ) +with message: + this SHOULD be seen + +------------------------------------------------------------------------------- +prints unscoped info on failure +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: + REQUIRE( false ) +with messages: + this SHOULD be seen + this SHOULD also be seen + +------------------------------------------------------------------------------- +prints unscoped info only for the first assertion +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: + CHECK( false ) +with message: + this SHOULD be seen only ONCE + ------------------------------------------------------------------------------- send a single char to INFO ------------------------------------------------------------------------------- @@ -1148,6 +1231,28 @@ with messages: hi i := 7 +------------------------------------------------------------------------------- +stacks unscoped info in loops +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: + CHECK( false ) +with messages: + Count 1 to 3... + 1 + 2 + 3 + +Message.tests.cpp:<line number>: FAILED: + CHECK( false ) +with messages: + Count 4 to 6... + 4 + 5 + 6 + ------------------------------------------------------------------------------- string literals of different sizes can be compared ------------------------------------------------------------------------------- @@ -1170,6 +1275,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 243 | 183 passed | 56 failed | 4 failed as expected -assertions: 1325 | 1189 passed | 115 failed | 21 failed as expected +test cases: 258 | 192 passed | 62 failed | 4 failed as expected +assertions: 1419 | 1276 passed | 122 failed | 21 failed as expected diff --git a/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt index 7069d0b12..c63de78ac 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/console.sw.approved.txt @@ -1,3 +1,4 @@ +Filters: ~[!nonportable]~[!benchmark]~[approvals] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <exe-name> is a <version> host application. @@ -133,6 +134,44 @@ Compilation.tests.cpp:<line number>: PASSED: with expansion: [1403 helper] == [1403 helper] +------------------------------------------------------------------------------- +#1455 - INFO and WARN can start with a linebreak +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: warning: + +This info message starts with a linebreak + +This warning message starts with a linebreak + + +No assertions in test case '#1455 - INFO and WARN can start with a linebreak' + +This would not be caught previously +Nor would this +------------------------------------------------------------------------------- +#1514: stderr/stdout is not captured in tests aborted by an exception +------------------------------------------------------------------------------- +Tricky.tests.cpp:<line number> +............................................................................... + +Tricky.tests.cpp:<line number>: FAILED: +explicitly with message: + 1514 + +------------------------------------------------------------------------------- +#1548 +------------------------------------------------------------------------------- +Compilation.tests.cpp:<line number> +............................................................................... + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( std::is_same<TypeList<int>, TypeList<int>>::value ) +with expansion: + true + ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions outside assertions @@ -456,7 +495,7 @@ with expansion: !false ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -464,21 +503,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 1 < 101 + 1 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 1 < 102 + 1 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -486,21 +524,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 1 < 103 + 1 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 1 < 104 + 1 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -508,21 +545,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 1 < 105 + 1 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 1 < 106 + 1 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -530,21 +566,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 1 < 107 + 1 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 1 < 108 + 1 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -552,21 +587,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 1 < 109 + 1 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 1 < 110 + 1 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -574,21 +608,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 2 < 101 + 1 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 2 < 102 + 1 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -596,21 +629,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 2 < 103 + 1 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 2 < 104 + 1 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -618,21 +650,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 2 < 105 + 1 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 2 < 106 + 1 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -640,21 +671,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 2 < 107 + 1 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 2 < 108 + 1 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -662,21 +692,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 2 < 109 + 2 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 2 < 110 + 2 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -684,21 +713,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 3 < 101 + 2 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 3 < 102 + 2 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -706,21 +734,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 3 < 103 + 2 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 3 < 104 + 2 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -728,21 +755,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 3 < 105 + 2 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 3 < 106 + 2 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -750,21 +776,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 3 < 107 + 2 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 3 < 108 + 2 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -772,21 +797,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 3 < 109 + 2 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 3 < 110 + 2 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -794,21 +818,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 4 < 101 + 2 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 4 < 102 + 2 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -816,21 +839,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 4 < 103 + 2 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 4 < 104 + 2 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -838,21 +860,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 4 < 105 + 2 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 4 < 106 + 2 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -860,21 +881,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 4 < 107 + 3 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 4 < 108 + 3 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -882,21 +902,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 4 < 109 + 3 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 4 < 110 + 3 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -904,21 +923,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 5 < 101 + 3 < 4 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 4 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 5 < 102 + 3 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -926,21 +944,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 5 < 103 + 3 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 5 < 104 + 3 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -948,21 +965,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 5 < 105 + 3 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 5 < 106 + 3 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -970,21 +986,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 5 < 107 + 3 < 5 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 5 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 5 < 108 + 3 < 9 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -992,21 +1007,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 5 < 109 + 3 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 7 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 5 < 110 + 3 < 7 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -1014,21 +1028,20 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 6 < 101 + 3 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 8 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 6 < 102 + 3 < 8 ------------------------------------------------------------------------------- -10x10 ints +3x3x3 ints ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... @@ -1036,2730 +1049,3262 @@ Generators.tests.cpp:<line number> Generators.tests.cpp:<line number>: PASSED: CHECK( x < y ) with expansion: - 6 < 103 + 3 < 6 -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Generators.tests.cpp:<line number>: PASSED: + CHECK( y < z ) +with expansion: + 6 < 9 Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) + REQUIRE( x < z ) with expansion: - 6 < 104 + 3 < 9 ------------------------------------------------------------------------------- -10x10 ints +A METHOD_AS_TEST_CASE based test run that fails ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( s == "world" ) with expansion: - 6 < 105 + "hello" == "world" ------------------------------------------------------------------------------- -10x10 ints +A METHOD_AS_TEST_CASE based test run that succeeds ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( s == "hello" ) with expansion: - 6 < 106 + "hello" == "hello" ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo +<float> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) with expansion: - 6 < 107 + 0 == 1 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo +<int> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) with expansion: - 6 < 108 + 0 == 1 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector +<float> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) with expansion: - 6 < 109 + 0 == 1 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector +<int> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) with expansion: - 6 < 110 + 0 == 1 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo +<float> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) with expansion: - 7 < 101 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo +<int> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) with expansion: - 7 < 102 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector +<float> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) with expansion: - 7 < 103 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector +<int> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) with expansion: - 7 < 104 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_TEST_CASE_METHOD based test run that fails - double ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) with expansion: - 7 < 105 + 1.0 == 2 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_TEST_CASE_METHOD based test run that fails - float ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) with expansion: - 7 < 106 + 1.0f == 2 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_TEST_CASE_METHOD based test run that fails - int ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( Template_Fixture<TestType>::m_a == 2 ) with expansion: - 7 < 107 + 1 == 2 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture<TestType>::m_a == 1 ) with expansion: - 7 < 108 + 1.0 == 1 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture<TestType>::m_a == 1 ) with expansion: - 7 < 109 + 1.0f == 1 ------------------------------------------------------------------------------- -10x10 ints +A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( Template_Fixture<TestType>::m_a == 1 ) with expansion: - 7 < 110 + 1 == 1 ------------------------------------------------------------------------------- -10x10 ints +A TEST_CASE_METHOD based test run that fails ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: FAILED: + REQUIRE( m_a == 2 ) with expansion: - 8 < 101 + 1 == 2 ------------------------------------------------------------------------------- -10x10 ints +A TEST_CASE_METHOD based test run that succeeds ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Class.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Class.tests.cpp:<line number>: PASSED: + REQUIRE( m_a == 1 ) with expansion: - 8 < 102 + 1 == 1 ------------------------------------------------------------------------------- -10x10 ints +A Template product test case - Foo<float> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) with expansion: - 8 < 103 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A Template product test case - Foo<int> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) with expansion: - 8 < 104 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A Template product test case - std::vector<float> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) with expansion: - 8 < 105 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A Template product test case - std::vector<int> ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( x.size() == 0 ) with expansion: - 8 < 106 + 0 == 0 ------------------------------------------------------------------------------- -10x10 ints +A comparison that uses literals instead of the normal constructor ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d == 1.23_a ) with expansion: - 8 < 107 - -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... + 1.23 == Approx( 1.23 ) -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d != 1.22_a ) with expansion: - 8 < 108 + 1.23 != Approx( 1.22 ) -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( -d == -1.23_a ) +with expansion: + -1.23 == Approx( -1.23 ) -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d == 1.2_a .epsilon(.1) ) with expansion: - 8 < 109 + 1.23 == Approx( 1.2 ) -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d != 1.2_a .epsilon(.001) ) +with expansion: + 1.23 != Approx( 1.2 ) -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d == 1_a .epsilon(.3) ) with expansion: - 8 < 110 + 1.23 == Approx( 1.0 ) ------------------------------------------------------------------------------- -10x10 ints +A couple of nested sections followed by a failure + Outer + Inner ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) -with expansion: - 9 < 101 +Misc.tests.cpp:<line number>: PASSED: +with message: + that's not flying - that's failing in style ------------------------------------------------------------------------------- -10x10 ints +A couple of nested sections followed by a failure ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) -with expansion: - 9 < 102 +Misc.tests.cpp:<line number>: FAILED: +explicitly with message: + to infinity and beyond ------------------------------------------------------------------------------- -10x10 ints +A failing expression with a non streamable type is still captured ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Tricky.tests.cpp:<line number>: FAILED: + CHECK( &o1 == &o2 ) +with expansion: + 0x<hex digits> == 0x<hex digits> + +Tricky.tests.cpp:<line number>: FAILED: + CHECK( o1 == o2 ) with expansion: - 9 < 103 + {?} == {?} ------------------------------------------------------------------------------- -10x10 ints +Absolute margin ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 104.0 != Approx(100.0) ) with expansion: - 9 < 104 + 104.0 != Approx( 100.0 ) -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 104.0 == Approx(100.0).margin(5) ) +with expansion: + 104.0 == Approx( 100.0 ) -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 104.0 == Approx(100.0).margin(4) ) with expansion: - 9 < 105 + 104.0 == Approx( 100.0 ) -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 104.0 != Approx(100.0).margin(3) ) +with expansion: + 104.0 != Approx( 100.0 ) -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 100.3 != Approx(100.0) ) +with expansion: + 100.3 != Approx( 100.0 ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 100.3 == Approx(100.0).margin(0.5) ) with expansion: - 9 < 106 + 100.3 == Approx( 100.0 ) ------------------------------------------------------------------------------- -10x10 ints +An empty test with no assertions ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) -with expansion: - 9 < 107 + +No assertions in test case 'An empty test with no assertions' ------------------------------------------------------------------------------- -10x10 ints +An expression with side-effects should only be evaluated once ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( i++ == 7 ) with expansion: - 9 < 108 - -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... + 7 == 7 -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( i++ == 8 ) with expansion: - 9 < 109 + 8 == 8 ------------------------------------------------------------------------------- -10x10 ints +An unchecked exception reports the line of the last assertion ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Exception.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) -with expansion: - 9 < 110 +Exception.tests.cpp:<line number>: PASSED: + CHECK( 1 == 1 ) + +Exception.tests.cpp:<line number>: FAILED: + {Unknown expression after the reported line} +due to unexpected exception with message: + unexpected exception ------------------------------------------------------------------------------- -10x10 ints +Anonymous test case 1 ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +VariadicMacros.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) -with expansion: - 10 < 101 +VariadicMacros.tests.cpp:<line number>: PASSED: +with message: + anonymous test case ------------------------------------------------------------------------------- -10x10 ints +Approx setters validate their arguments ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) -with expansion: - 10 < 102 +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Approx(0).margin(0) ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Approx(0).margin(1234656) ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( Approx(0).margin(-2), std::domain_error ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Approx(0).epsilon(0) ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( Approx(0).epsilon(1) ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( Approx(0).epsilon(-0.001), std::domain_error ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( Approx(0).epsilon(1.0001), std::domain_error ) ------------------------------------------------------------------------------- -10x10 ints +Approx with exactly-representable margin ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + CHECK( 0.25f == Approx(0.0f).margin(0.25f) ) with expansion: - 10 < 103 + 0.25f == Approx( 0.0 ) -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + CHECK( 0.0f == Approx(0.25f).margin(0.25f) ) +with expansion: + 0.0f == Approx( 0.25 ) -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + CHECK( 0.5f == Approx(0.25f).margin(0.25f) ) with expansion: - 10 < 104 + 0.5f == Approx( 0.25 ) -------------------------------------------------------------------------------- -10x10 ints -------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + CHECK( 245.0f == Approx(245.25f).margin(0.25f) ) +with expansion: + 245.0f == Approx( 245.25 ) -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + CHECK( 245.5f == Approx(245.25f).margin(0.25f) ) with expansion: - 10 < 105 + 245.5f == Approx( 245.25 ) ------------------------------------------------------------------------------- -10x10 ints +Approximate PI ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) ) +with expansion: + 3.1428571429 == Approx( 3.141 ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) with expansion: - 10 < 106 + 3.1428571429 != Approx( 3.141 ) ------------------------------------------------------------------------------- -10x10 ints +Approximate comparisons with different epsilons ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d != Approx( 1.231 ) ) +with expansion: + 1.23 != Approx( 1.231 ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) with expansion: - 10 < 107 + 1.23 == Approx( 1.231 ) ------------------------------------------------------------------------------- -10x10 ints +Approximate comparisons with floats ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 1.23f == Approx( 1.23f ) ) +with expansion: + 1.23f == Approx( 1.2300000191 ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 0.0f == Approx( 0.0f ) ) with expansion: - 10 < 108 + 0.0f == Approx( 0.0 ) ------------------------------------------------------------------------------- -10x10 ints +Approximate comparisons with ints ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 1 == Approx( 1 ) ) +with expansion: + 1 == Approx( 1.0 ) + +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 0 == Approx( 0 ) ) with expansion: - 10 < 109 + 0 == Approx( 0.0 ) ------------------------------------------------------------------------------- -10x10 ints +Approximate comparisons with mixed numeric types ------------------------------------------------------------------------------- -Generators.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Generators.tests.cpp:<line number>: PASSED: - CHECK( x < y ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 1.0f == Approx( 1 ) ) with expansion: - 10 < 110 + 1.0f == Approx( 1.0 ) -------------------------------------------------------------------------------- -A METHOD_AS_TEST_CASE based test run that fails -------------------------------------------------------------------------------- -Class.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 0 == Approx( dZero) ) +with expansion: + 0 == Approx( 0.0 ) -Class.tests.cpp:<line number>: FAILED: - REQUIRE( s == "world" ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 0 == Approx( dSmall ).margin( 0.001 ) ) with expansion: - "hello" == "world" + 0 == Approx( 0.00001 ) -------------------------------------------------------------------------------- -A METHOD_AS_TEST_CASE based test run that succeeds -------------------------------------------------------------------------------- -Class.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 1.234f == Approx( dMedium ) ) +with expansion: + 1.234f == Approx( 1.234 ) -Class.tests.cpp:<line number>: PASSED: - REQUIRE( s == "hello" ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( dMedium == Approx( 1.234f ) ) with expansion: - "hello" == "hello" + 1.234 == Approx( 1.2339999676 ) ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0 +Arbitrary predicate matcher + Function pointer ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: FAILED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, Predicate<int>(alwaysTrue, "always true") ) with expansion: - 0 == 1 + 1 matches predicate: "always true" + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1, !Predicate<int>(alwaysFalse, "always false") ) +with expansion: + 1 not matches predicate: "always false" ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1 +Arbitrary predicate matcher + Lambdas + different type ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: FAILED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") ) with expansion: - 0 == 1 + "Hello olleH" matches predicate: "First and last character should be equal" + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) ) +with expansion: + "This wouldn't pass" not matches undescribed predicate ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2 +Assertions then sections ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: FAILED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) -with expansion: - 0 == 1 +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( true ) ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3 +Assertions then sections + A section ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: FAILED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 ) -with expansion: - 0 == 1 +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( true ) ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 0 +Assertions then sections + A section + Another section ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) -with expansion: - 0 == 0 +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( true ) ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 1 +Assertions then sections ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) -with expansion: - 0 == 0 +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( true ) ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 2 +Assertions then sections + A section ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) -with expansion: - 0 == 0 +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( true ) ------------------------------------------------------------------------------- -A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 3 +Assertions then sections + A section + Another other section ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 0 ) -with expansion: - 0 == 0 +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( true ) ------------------------------------------------------------------------------- -A TEMPLATE_TEST_CASE_METHOD based test run that fails - double +Assorted miscellaneous tests ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: FAILED: - REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( INFINITY == Approx(INFINITY) ) with expansion: - 1.0 == 2 + inff == Approx( inf ) -------------------------------------------------------------------------------- -A TEMPLATE_TEST_CASE_METHOD based test run that fails - float -------------------------------------------------------------------------------- -Class.tests.cpp:<line number> -............................................................................... +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( NAN != Approx(NAN) ) +with expansion: + nanf != Approx( nan ) -Class.tests.cpp:<line number>: FAILED: - REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( NAN == Approx(NAN) ) with expansion: - 1.0f == 2 + !(nanf == Approx( nan )) ------------------------------------------------------------------------------- -A TEMPLATE_TEST_CASE_METHOD based test run that fails - int +Bitfields can be captured (#1027) ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: FAILED: - REQUIRE( Template_Fixture<TestType>::m_a == 2 ) +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( y.v == 0 ) with expansion: - 1 == 2 + 0 == 0 + +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( 0 == y.v ) +with expansion: + 0 == 0 ------------------------------------------------------------------------------- -A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double +CAPTURE can deal with complex expressions ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Message.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( Template_Fixture<TestType>::m_a == 1 ) -with expansion: - 1.0 == 1 +Message.tests.cpp:<line number>: PASSED: +with messages: + a := 1 + b := 2 + c := 3 + a + b := 3 + a+b := 3 + c > b := true + a == 1 := true ------------------------------------------------------------------------------- -A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float +CAPTURE can deal with complex expressions involving commas ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +Message.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( Template_Fixture<TestType>::m_a == 1 ) -with expansion: - 1.0f == 1 +Message.tests.cpp:<line number>: PASSED: +with messages: + std::vector<int>{1, 2, 3}[0, 1, 2] := 3 + std::vector<int>{1, 2, 3}[(0, 1)] := 2 + std::vector<int>{1, 2, 3}[0] := 1 + (helper_1436<int, int>{12, -12}) := { 12, -12 } + (helper_1436<int, int>(-12, 12)) := { -12, 12 } + (1, 2) := 2 + (2, 3) := 3 ------------------------------------------------------------------------------- -A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int +Capture and info messages + Capture should stringify like assertions ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( Template_Fixture<TestType>::m_a == 1 ) -with expansion: - 1 == 1 +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( true ) +with message: + i := 2 ------------------------------------------------------------------------------- -A TEST_CASE_METHOD based test run that fails +Capture and info messages + Info should NOT stringify the way assertions do ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: FAILED: - REQUIRE( m_a == 2 ) -with expansion: - 1 == 2 +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( true ) +with message: + 3 ------------------------------------------------------------------------------- -A TEST_CASE_METHOD based test run that succeeds +Character pretty printing + Specifically escaped ------------------------------------------------------------------------------- -Class.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -Class.tests.cpp:<line number>: PASSED: - REQUIRE( m_a == 1 ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + CHECK( tab == '\t' ) with expansion: - 1 == 1 + '\t' == '\t' -------------------------------------------------------------------------------- -A Template product test case - 0 -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... +ToStringGeneral.tests.cpp:<line number>: PASSED: + CHECK( newline == '\n' ) +with expansion: + '\n' == '\n' -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( x.size() == 0 ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + CHECK( carr_return == '\r' ) with expansion: - 0 == 0 + '\r' == '\r' + +ToStringGeneral.tests.cpp:<line number>: PASSED: + CHECK( form_feed == '\f' ) +with expansion: + '\f' == '\f' ------------------------------------------------------------------------------- -A Template product test case - 1 +Character pretty printing + General chars ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( x.size() == 0 ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + CHECK( space == ' ' ) with expansion: - 0 == 0 + ' ' == ' ' -------------------------------------------------------------------------------- -A Template product test case - 2 -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == chars[i] ) +with expansion: + 'a' == 'a' -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( x.size() == 0 ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == chars[i] ) with expansion: - 0 == 0 + 'z' == 'z' -------------------------------------------------------------------------------- -A Template product test case - 3 -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == chars[i] ) +with expansion: + 'A' == 'A' -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( x.size() == 0 ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == chars[i] ) with expansion: - 0 == 0 + 'Z' == 'Z' ------------------------------------------------------------------------------- -A comparison that uses literals instead of the normal constructor +Character pretty printing + Low ASCII ------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d == 1.23_a ) -with expansion: - 1.23 == Approx( 1.23 ) - -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d != 1.22_a ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + CHECK( null_terminator == '\0' ) with expansion: - 1.23 != Approx( 1.22 ) + 0 == 0 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( -d == -1.23_a ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == i ) with expansion: - -1.23 == Approx( -1.23 ) + 2 == 2 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d == 1.2_a .epsilon(.1) ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == i ) with expansion: - 1.23 == Approx( 1.2 ) + 3 == 3 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d != 1.2_a .epsilon(.001) ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == i ) with expansion: - 1.23 != Approx( 1.2 ) + 4 == 4 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d == 1_a .epsilon(.3) ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( c == i ) with expansion: - 1.23 == Approx( 1.0 ) + 5 == 5 ------------------------------------------------------------------------------- -A couple of nested sections followed by a failure - Outer - Inner +Commas in various macros are allowed ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: -with message: - that's not flying - that's failing in style +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} ) -------------------------------------------------------------------------------- -A couple of nested sections followed by a failure -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... +Tricky.tests.cpp:<line number>: PASSED: + CHECK_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} ) -Misc.tests.cpp:<line number>: FAILED: -explicitly with message: - to infinity and beyond +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} ) -------------------------------------------------------------------------------- -A failing expression with a non streamable type is still captured -------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> -............................................................................... +Tricky.tests.cpp:<line number>: PASSED: + CHECK_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} ) -Tricky.tests.cpp:<line number>: FAILED: - CHECK( &o1 == &o2 ) +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: - 0x<hex digits> == 0x<hex digits> + { 1, 2 } == { 1, 2 } -Tricky.tests.cpp:<line number>: FAILED: - CHECK( o1 == o2 ) +Tricky.tests.cpp:<line number>: PASSED: + CHECK( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: - {?} == {?} - -------------------------------------------------------------------------------- -Absolute margin -------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> -............................................................................... + { 1, 2 } == { 1, 2 } -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 104.0 != Approx(100.0) ) +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} ) with expansion: - 104.0 != Approx( 100.0 ) + !({ 1, 2 } == { 1, 2, 3 }) -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 104.0 == Approx(100.0).margin(5) ) +Tricky.tests.cpp:<line number>: PASSED: + CHECK_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} ) with expansion: - 104.0 == Approx( 100.0 ) + !({ 1, 2 } == { 1, 2, 3 }) -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 104.0 == Approx(100.0).margin(4) ) +Tricky.tests.cpp:<line number>: PASSED: + CHECK_NOFAIL( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: - 104.0 == Approx( 100.0 ) + { 1, 2 } == { 1, 2 } -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 104.0 != Approx(100.0).margin(3) ) +Tricky.tests.cpp:<line number>: PASSED: + CHECKED_IF( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: - 104.0 != Approx( 100.0 ) + { 1, 2 } == { 1, 2 } -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 100.3 != Approx(100.0) ) -with expansion: - 100.3 != Approx( 100.0 ) +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( true ) -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 100.3 == Approx(100.0).margin(0.5) ) +Tricky.tests.cpp:<line number>: PASSED: + CHECKED_ELSE( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) with expansion: - 100.3 == Approx( 100.0 ) - -------------------------------------------------------------------------------- -An empty test with no assertions -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... - - -No assertions in test case 'An empty test with no assertions' + { 1, 2 } == { 1, 2 } ------------------------------------------------------------------------------- -An expression with side-effects should only be evaluated once +Comparing function pointers ------------------------------------------------------------------------------- Tricky.tests.cpp:<line number> ............................................................................... Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( i++ == 7 ) + REQUIRE( a ) with expansion: - 7 == 7 + 0x<hex digits> Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( i++ == 8 ) + REQUIRE( a == &foo ) with expansion: - 8 == 8 - -------------------------------------------------------------------------------- -An unchecked exception reports the line of the last assertion -------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> -............................................................................... - -Exception.tests.cpp:<line number>: PASSED: - CHECK( 1 == 1 ) - -Exception.tests.cpp:<line number>: FAILED: - {Unknown expression after the reported line} -due to unexpected exception with message: - unexpected exception - -------------------------------------------------------------------------------- -Anonymous test case 1 -------------------------------------------------------------------------------- -VariadicMacros.tests.cpp:<line number> -............................................................................... - -VariadicMacros.tests.cpp:<line number>: PASSED: -with message: - anonymous test case + 0x<hex digits> == 0x<hex digits> ------------------------------------------------------------------------------- -Approx setters validate their arguments +Comparison with explicitly convertible types ------------------------------------------------------------------------------- Approx.tests.cpp:<line number> ............................................................................... Approx.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( Approx(0).margin(0) ) + REQUIRE( td == Approx(10.0) ) +with expansion: + StrongDoubleTypedef(10) == Approx( 10.0 ) Approx.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( Approx(0).margin(1234656) ) + REQUIRE( Approx(10.0) == td ) +with expansion: + Approx( 10.0 ) == StrongDoubleTypedef(10) Approx.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( Approx(0).margin(-2), std::domain_error ) + REQUIRE( td != Approx(11.0) ) +with expansion: + StrongDoubleTypedef(10) != Approx( 11.0 ) Approx.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( Approx(0).epsilon(0) ) + REQUIRE( Approx(11.0) != td ) +with expansion: + Approx( 11.0 ) != StrongDoubleTypedef(10) Approx.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( Approx(0).epsilon(1) ) + REQUIRE( td <= Approx(10.0) ) +with expansion: + StrongDoubleTypedef(10) <= Approx( 10.0 ) Approx.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( Approx(0).epsilon(-0.001), std::domain_error ) + REQUIRE( td <= Approx(11.0) ) +with expansion: + StrongDoubleTypedef(10) <= Approx( 11.0 ) Approx.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( Approx(0).epsilon(1.0001), std::domain_error ) - -------------------------------------------------------------------------------- -Approx with exactly-representable margin -------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> -............................................................................... + REQUIRE( Approx(10.0) <= td ) +with expansion: + Approx( 10.0 ) <= StrongDoubleTypedef(10) Approx.tests.cpp:<line number>: PASSED: - CHECK( 0.25f == Approx(0.0f).margin(0.25f) ) + REQUIRE( Approx(9.0) <= td ) with expansion: - 0.25f == Approx( 0.0 ) + Approx( 9.0 ) <= StrongDoubleTypedef(10) Approx.tests.cpp:<line number>: PASSED: - CHECK( 0.0f == Approx(0.25f).margin(0.25f) ) + REQUIRE( td >= Approx(9.0) ) with expansion: - 0.0f == Approx( 0.25 ) + StrongDoubleTypedef(10) >= Approx( 9.0 ) Approx.tests.cpp:<line number>: PASSED: - CHECK( 0.5f == Approx(0.25f).margin(0.25f) ) + REQUIRE( td >= Approx(td) ) with expansion: - 0.5f == Approx( 0.25 ) + StrongDoubleTypedef(10) >= Approx( 10.0 ) Approx.tests.cpp:<line number>: PASSED: - CHECK( 245.0f == Approx(245.25f).margin(0.25f) ) + REQUIRE( Approx(td) >= td ) with expansion: - 245.0f == Approx( 245.25 ) + Approx( 10.0 ) >= StrongDoubleTypedef(10) Approx.tests.cpp:<line number>: PASSED: - CHECK( 245.5f == Approx(245.25f).margin(0.25f) ) + REQUIRE( Approx(11.0) >= td ) with expansion: - 245.5f == Approx( 245.25 ) + Approx( 11.0 ) >= StrongDoubleTypedef(10) ------------------------------------------------------------------------------- -Approximate PI +Comparisons between ints where one side is computed ------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> +Condition.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) ) -with expansion: - 3.1428571429 == Approx( 3.141 ) - -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) ) +Condition.tests.cpp:<line number>: PASSED: + CHECK( 54 == 6*9 ) with expansion: - 3.1428571429 != Approx( 3.141 ) + 54 == 54 ------------------------------------------------------------------------------- -Approximate comparisons with different epsilons +Comparisons between unsigned ints and negative signed ints match c++ standard +behaviour ------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> +Condition.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d != Approx( 1.231 ) ) +Condition.tests.cpp:<line number>: PASSED: + CHECK( ( -1 > 2u ) ) with expansion: - 1.23 != Approx( 1.231 ) + true -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d == Approx( 1.231 ).epsilon( 0.1 ) ) +Condition.tests.cpp:<line number>: PASSED: + CHECK( -1 > 2u ) with expansion: - 1.23 == Approx( 1.231 ) - -------------------------------------------------------------------------------- -Approximate comparisons with floats -------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> -............................................................................... + -1 > 2 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 1.23f == Approx( 1.23f ) ) +Condition.tests.cpp:<line number>: PASSED: + CHECK( ( 2u < -1 ) ) with expansion: - 1.23f == Approx( 1.2300000191 ) + true -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 0.0f == Approx( 0.0f ) ) +Condition.tests.cpp:<line number>: PASSED: + CHECK( 2u < -1 ) with expansion: - 0.0f == Approx( 0.0 ) - -------------------------------------------------------------------------------- -Approximate comparisons with ints -------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> -............................................................................... + 2 < -1 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 1 == Approx( 1 ) ) +Condition.tests.cpp:<line number>: PASSED: + CHECK( ( minInt > 2u ) ) with expansion: - 1 == Approx( 1.0 ) + true -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 0 == Approx( 0 ) ) +Condition.tests.cpp:<line number>: PASSED: + CHECK( minInt > 2u ) with expansion: - 0 == Approx( 0.0 ) + -2147483648 > 2 ------------------------------------------------------------------------------- -Approximate comparisons with mixed numeric types +Comparisons with int literals don't warn when mixing signed/ unsigned ------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> +Condition.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 1.0f == Approx( 1 ) ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( i == 1 ) with expansion: - 1.0f == Approx( 1.0 ) + 1 == 1 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 0 == Approx( dZero) ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( ui == 2 ) with expansion: - 0 == Approx( 0.0 ) + 2 == 2 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 0 == Approx( dSmall ).margin( 0.001 ) ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( l == 3 ) with expansion: - 0 == Approx( 0.00001 ) + 3 == 3 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 1.234f == Approx( dMedium ) ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( ul == 4 ) with expansion: - 1.234f == Approx( 1.234 ) + 4 == 4 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( dMedium == Approx( 1.234f ) ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( c == 5 ) with expansion: - 1.234 == Approx( 1.2339999676 ) + 5 == 5 -------------------------------------------------------------------------------- -Arbitrary predicate matcher - Function pointer -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( uc == 6 ) +with expansion: + 6 == 6 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, Predicate<int>(alwaysTrue, "always true") ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( 1 == i ) with expansion: - 1 matches predicate: "always true" + 1 == 1 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, !Predicate<int>(alwaysFalse, "always false") ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( 2 == ui ) with expansion: - 1 not matches predicate: "always false" + 2 == 2 -------------------------------------------------------------------------------- -Arbitrary predicate matcher - Lambdas + different type -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( 3 == l ) +with expansion: + 3 == 3 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( 4 == ul ) with expansion: - "Hello olleH" matches predicate: "First and last character should be equal" + 4 == 4 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( 5 == c ) with expansion: - "This wouldn't pass" not matches undescribed predicate + 5 == 5 -------------------------------------------------------------------------------- -Assertions then sections -------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> -............................................................................... +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( 6 == uc ) +with expansion: + 6 == 6 -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( true ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( (std::numeric_limits<uint32_t>::max)() > ul ) +with expansion: + 4294967295 (0x<hex digits>) > 4 ------------------------------------------------------------------------------- -Assertions then sections - A section +Contains string matcher ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( true ) - -------------------------------------------------------------------------------- -Assertions then sections - A section - Another section -------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> -............................................................................... +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) ) +with expansion: + "this string contains 'abc' as a substring" contains: "not there" (case + insensitive) -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( true ) +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), Contains("STRING") ) +with expansion: + "this string contains 'abc' as a substring" contains: "STRING" ------------------------------------------------------------------------------- -Assertions then sections +Custom exceptions can be translated when testing for nothrow ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Exception.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( true ) +Exception.tests.cpp:<line number>: FAILED: + REQUIRE_NOTHROW( throwCustom() ) +due to unexpected exception with message: + custom exception - not std ------------------------------------------------------------------------------- -Assertions then sections - A section +Custom exceptions can be translated when testing for throwing as something else ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Exception.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( true ) +Exception.tests.cpp:<line number>: FAILED: + REQUIRE_THROWS_AS( throwCustom(), std::exception ) +due to unexpected exception with message: + custom exception - not std ------------------------------------------------------------------------------- -Assertions then sections - A section - Another other section +Custom std-exceptions can be custom translated ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Exception.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( true ) +Exception.tests.cpp:<line number>: FAILED: +due to unexpected exception with message: + custom std exception ------------------------------------------------------------------------------- -Assorted miscellaneous tests +Default scale is invisible to comparison ------------------------------------------------------------------------------- Approx.tests.cpp:<line number> ............................................................................... Approx.tests.cpp:<line number>: PASSED: - REQUIRE( INFINITY == Approx(INFINITY) ) -with expansion: - inff == Approx( inf ) - -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( NAN != Approx(NAN) ) + REQUIRE( 101.000001 != Approx(100).epsilon(0.01) ) with expansion: - nanf != Approx( nan ) + 101.000001 != Approx( 100.0 ) Approx.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( NAN == Approx(NAN) ) + REQUIRE( std::pow(10, -5) != Approx(std::pow(10, -7)) ) with expansion: - !(nanf == Approx( nan )) + 0.00001 != Approx( 0.0000001 ) ------------------------------------------------------------------------------- -Bitfields can be captured (#1027) +EndsWith string matcher ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( y.v == 0 ) +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), EndsWith("Substring") ) with expansion: - 0 == 0 + "this string contains 'abc' as a substring" ends with: "Substring" -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( 0 == y.v ) +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) ) with expansion: - 0 == 0 + "this string contains 'abc' as a substring" ends with: "this" (case + insensitive) ------------------------------------------------------------------------------- -CAPTURE can deal with complex expressions +Epsilon only applies to Approx's value ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: PASSED: -with messages: - a := 1 - b := 2 - c := 3 - a + b := 3 - a+b := 3 - c > b := true - a == 1 := true +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( 101.01 != Approx(100).epsilon(0.01) ) +with expansion: + 101.01 != Approx( 100.0 ) ------------------------------------------------------------------------------- -CAPTURE can deal with complex expressions involving commas +Equality checks that should fail ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +Condition.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: PASSED: -with messages: - std::vector<int>{1, 2, 3}[0, 1, 2] := 3 - std::vector<int>{1, 2, 3}[(0, 1)] := 2 - std::vector<int>{1, 2, 3}[0] := 1 - (helper_1436<int, int>{12, -12}) := { 12, -12 } - (helper_1436<int, int>(-12, 12)) := { -12, 12 } - (1, 2) := 2 - (2, 3) := 3 +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.int_seven == 6 ) +with expansion: + 7 == 6 -------------------------------------------------------------------------------- -Capture and info messages - Capture should stringify like assertions -------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> -............................................................................... +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.int_seven == 8 ) +with expansion: + 7 == 8 -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( true ) -with message: - i := 2 +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.int_seven == 0 ) +with expansion: + 7 == 0 -------------------------------------------------------------------------------- -Capture and info messages - Info should NOT stringify the way assertions do -------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> -............................................................................... +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.float_nine_point_one == Approx( 9.11f ) ) +with expansion: + 9.1f == Approx( 9.1099996567 ) -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( true ) -with message: - 3 +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.float_nine_point_one == Approx( 9.0f ) ) +with expansion: + 9.1f == Approx( 9.0 ) -------------------------------------------------------------------------------- -Character pretty printing - Specifically escaped -------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> -............................................................................... +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.float_nine_point_one == Approx( 1 ) ) +with expansion: + 9.1f == Approx( 1.0 ) -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( tab == '\t' ) +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.float_nine_point_one == Approx( 0 ) ) with expansion: - '\t' == '\t' + 9.1f == Approx( 0.0 ) -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( newline == '\n' ) +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.double_pi == Approx( 3.1415 ) ) with expansion: - '\n' == '\n' + 3.1415926535 == Approx( 3.1415 ) -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( carr_return == '\r' ) +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.str_hello == "goodbye" ) with expansion: - '\r' == '\r' + "hello" == "goodbye" -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( form_feed == '\f' ) +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.str_hello == "hell" ) with expansion: - '\f' == '\f' + "hello" == "hell" -------------------------------------------------------------------------------- -Character pretty printing - General chars -------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.str_hello == "hello1" ) +with expansion: + "hello" == "hello1" + +Condition.tests.cpp:<line number>: FAILED: + CHECK( data.str_hello.size() == 6 ) +with expansion: + 5 == 6 + +Condition.tests.cpp:<line number>: FAILED: + CHECK( x == Approx( 1.301 ) ) +with expansion: + 1.3 == Approx( 1.301 ) + +------------------------------------------------------------------------------- +Equality checks that should succeed +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( space == ' ' ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( data.int_seven == 7 ) with expansion: - ' ' == ' ' + 7 == 7 -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) with expansion: - 'a' == 'a' + 9.1f == Approx( 9.1000003815 ) -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) with expansion: - 'z' == 'z' + 3.1415926535 == Approx( 3.1415926535 ) -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( data.str_hello == "hello" ) with expansion: - 'A' == 'A' + "hello" == "hello" -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == chars[i] ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( "hello" == data.str_hello ) with expansion: - 'Z' == 'Z' + "hello" == "hello" + +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( data.str_hello.size() == 5 ) +with expansion: + 5 == 5 + +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( x == Approx( 1.3 ) ) +with expansion: + 1.3 == Approx( 1.3 ) ------------------------------------------------------------------------------- -Character pretty printing - Low ASCII +Equals ------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - CHECK( null_terminator == '\0' ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), Equals("this string contains 'abc' as a substring") ) with expansion: - 0 == 0 + "this string contains 'abc' as a substring" equals: "this string contains + 'abc' as a substring" -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) ) with expansion: - 2 == 2 + "this string contains 'abc' as a substring" equals: "this string contains + 'abc' as a substring" (case insensitive) + +------------------------------------------------------------------------------- +Equals string matcher +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") ) +with expansion: + "this string contains 'abc' as a substring" equals: "this string contains + 'ABC' as a substring" + +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) ) +with expansion: + "this string contains 'abc' as a substring" equals: "something else" (case + insensitive) + +------------------------------------------------------------------------------- +Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified +------------------------------------------------------------------------------- +ToStringGeneral.tests.cpp:<line number> +............................................................................... ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) + REQUIRE( ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" ) with expansion: - 3 == 3 + "This exception has overridden what() method" + == + "This exception has overridden what() method" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) + REQUIRE( ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" ) with expansion: - 4 == 4 + "OperatorException" == "OperatorException" ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( c == i ) + REQUIRE( ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" ) with expansion: - 5 == 5 + "StringMakerException" + == + "StringMakerException" ------------------------------------------------------------------------------- -Commas in various macros are allowed +Exception matchers that fail + No exception ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} ) +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) +because no exception was thrown where one was expected: -Tricky.tests.cpp:<line number>: PASSED: - CHECK_THROWS( std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} ) +Matchers.tests.cpp:<line number>: FAILED: + REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) +because no exception was thrown where one was expected: -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} ) +------------------------------------------------------------------------------- +Exception matchers that fail + Type mismatch +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - CHECK_NOTHROW( std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} ) +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) +due to unexpected exception with message: + Unknown exception -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) -with expansion: - { 1, 2 } == { 1, 2 } +Matchers.tests.cpp:<line number>: FAILED: + REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) +due to unexpected exception with message: + Unknown exception -Tricky.tests.cpp:<line number>: PASSED: - CHECK( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) -with expansion: - { 1, 2 } == { 1, 2 } +------------------------------------------------------------------------------- +Exception matchers that fail + Contents are wrong +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} ) +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THROWS_MATCHES( throws(3), SpecialException, ExceptionMatcher{1} ) with expansion: - !({ 1, 2 } == { 1, 2, 3 }) + SpecialException::what special exception has value of 1 -Tricky.tests.cpp:<line number>: PASSED: - CHECK_FALSE( std::vector<int>{1, 2} == std::vector<int>{1, 2, 3} ) +Matchers.tests.cpp:<line number>: FAILED: + REQUIRE_THROWS_MATCHES( throws(4), SpecialException, ExceptionMatcher{1} ) with expansion: - !({ 1, 2 } == { 1, 2, 3 }) + SpecialException::what special exception has value of 1 -Tricky.tests.cpp:<line number>: PASSED: - CHECK_NOFAIL( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) -with expansion: - { 1, 2 } == { 1, 2 } +------------------------------------------------------------------------------- +Exception matchers that succeed +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - CHECKED_IF( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THROWS_MATCHES( throws(1), SpecialException, ExceptionMatcher{1} ) with expansion: - { 1, 2 } == { 1, 2 } - -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( true ) + SpecialException::what special exception has value of 1 -Tricky.tests.cpp:<line number>: PASSED: - CHECKED_ELSE( std::vector<int>{1, 2} == std::vector<int>{1, 2} ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_MATCHES( throws(2), SpecialException, ExceptionMatcher{2} ) with expansion: - { 1, 2 } == { 1, 2 } + SpecialException::what special exception has value of 2 ------------------------------------------------------------------------------- -Comparing function pointers +Exception messages can be tested for + exact match ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Exception.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( a ) -with expansion: - 0x<hex digits> - -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( a == &foo ) +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), "expected exception" ) with expansion: - 0x<hex digits> == 0x<hex digits> + "expected exception" equals: "expected exception" ------------------------------------------------------------------------------- -Comparison with explicitly convertible types +Exception messages can be tested for + different case ------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> +Exception.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( td == Approx(10.0) ) +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) ) with expansion: - StrongDoubleTypedef(10) == Approx( 10.0 ) + "expected exception" equals: "expected exception" (case insensitive) -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx(10.0) == td ) +------------------------------------------------------------------------------- +Exception messages can be tested for + wildcarded +------------------------------------------------------------------------------- +Exception.tests.cpp:<line number> +............................................................................... + +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), StartsWith( "expected" ) ) with expansion: - Approx( 10.0 ) == StrongDoubleTypedef(10) + "expected exception" starts with: "expected" -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( td != Approx(11.0) ) +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), EndsWith( "exception" ) ) with expansion: - StrongDoubleTypedef(10) != Approx( 11.0 ) + "expected exception" ends with: "exception" -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx(11.0) != td ) +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) ) with expansion: - Approx( 11.0 ) != StrongDoubleTypedef(10) + "expected exception" contains: "except" -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( td <= Approx(10.0) ) +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) ) with expansion: - StrongDoubleTypedef(10) <= Approx( 10.0 ) + "expected exception" contains: "except" (case insensitive) -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( td <= Approx(11.0) ) -with expansion: - StrongDoubleTypedef(10) <= Approx( 11.0 ) - -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx(10.0) <= td ) -with expansion: - Approx( 10.0 ) <= StrongDoubleTypedef(10) +------------------------------------------------------------------------------- +Expected exceptions that don't throw or unexpected exceptions fail the test +------------------------------------------------------------------------------- +Exception.tests.cpp:<line number> +............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx(9.0) <= td ) -with expansion: - Approx( 9.0 ) <= StrongDoubleTypedef(10) +Exception.tests.cpp:<line number>: FAILED: + CHECK_THROWS_AS( thisThrows(), std::string ) +due to unexpected exception with message: + expected exception -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( td >= Approx(9.0) ) -with expansion: - StrongDoubleTypedef(10) >= Approx( 9.0 ) +Exception.tests.cpp:<line number>: FAILED: + CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error ) +because no exception was thrown where one was expected: -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( td >= Approx(td) ) -with expansion: - StrongDoubleTypedef(10) >= Approx( 10.0 ) +Exception.tests.cpp:<line number>: FAILED: + CHECK_NOTHROW( thisThrows() ) +due to unexpected exception with message: + expected exception -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx(td) >= td ) -with expansion: - Approx( 10.0 ) >= StrongDoubleTypedef(10) +------------------------------------------------------------------------------- +FAIL aborts the test +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx(11.0) >= td ) -with expansion: - Approx( 11.0 ) >= StrongDoubleTypedef(10) +Message.tests.cpp:<line number>: FAILED: +explicitly with message: + This is a failure ------------------------------------------------------------------------------- -Comparisons between ints where one side is computed +FAIL does not require an argument ------------------------------------------------------------------------------- -Condition.tests.cpp:<line number> +Message.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: PASSED: - CHECK( 54 == 6*9 ) -with expansion: - 54 == 54 +Message.tests.cpp:<line number>: FAILED: ------------------------------------------------------------------------------- -Comparisons between unsigned ints and negative signed ints match c++ standard -behaviour +FAIL_CHECK does not abort the test ------------------------------------------------------------------------------- -Condition.tests.cpp:<line number> +Message.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: PASSED: - CHECK( ( -1 > 2u ) ) -with expansion: - true +Message.tests.cpp:<line number>: FAILED: +explicitly with message: + This is a failure -Condition.tests.cpp:<line number>: PASSED: - CHECK( -1 > 2u ) +Message.tests.cpp:<line number>: warning: + This message appears in the output + +------------------------------------------------------------------------------- +Factorials are computed +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( Factorial(0) == 1 ) with expansion: - -1 > 2 + 1 == 1 -Condition.tests.cpp:<line number>: PASSED: - CHECK( ( 2u < -1 ) ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( Factorial(1) == 1 ) with expansion: - true + 1 == 1 -Condition.tests.cpp:<line number>: PASSED: - CHECK( 2u < -1 ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( Factorial(2) == 2 ) with expansion: - 2 < -1 + 2 == 2 -Condition.tests.cpp:<line number>: PASSED: - CHECK( ( minInt > 2u ) ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( Factorial(3) == 6 ) with expansion: - true + 6 == 6 -Condition.tests.cpp:<line number>: PASSED: - CHECK( minInt > 2u ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( Factorial(10) == 3628800 ) with expansion: - -2147483648 > 2 + 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) ------------------------------------------------------------------------------- -Comparisons with int literals don't warn when mixing signed/ unsigned +Floating point matchers: double + Margin ------------------------------------------------------------------------------- -Condition.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( i == 1 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1., WithinAbs(1., 0) ) with expansion: - 1 == 1 + 1.0 is within 0.0 of 1.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( ui == 2 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0., WithinAbs(1., 1) ) with expansion: - 2 == 2 + 0.0 is within 1.0 of 1.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( l == 3 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) with expansion: - 3 == 3 + 0.0 not is within 0.99 of 1.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( ul == 4 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) with expansion: - 4 == 4 + 0.0 not is within 0.99 of 1.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( c == 5 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( NAN, !WithinAbs(NAN, 0) ) with expansion: - 5 == 5 + nanf not is within 0.0 of nan -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( uc == 6 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 11., !WithinAbs(10., 0.5) ) with expansion: - 6 == 6 + 11.0 not is within 0.5 of 10.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 1 == i ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 10., !WithinAbs(11., 0.5) ) with expansion: - 1 == 1 + 10.0 not is within 0.5 of 11.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 2 == ui ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( -10., WithinAbs(-10., 0.5) ) with expansion: - 2 == 2 + -10.0 is within 0.5 of -10.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 3 == l ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( -10., WithinAbs(-9.6, 0.5) ) with expansion: - 3 == 3 + -10.0 is within 0.5 of -9.6 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 4 == ul ) +------------------------------------------------------------------------------- +Floating point matchers: double + ULPs +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1., WithinULP(1., 0) ) with expansion: - 4 == 4 + 1.0 is within 0 ULPs of 1.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 5 == c ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( nextafter(1., 2.), WithinULP(1., 1) ) with expansion: - 5 == 5 + 1.0 is within 1 ULPs of 1.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 6 == uc ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( nextafter(1., 0.), WithinULP(1., 1) ) with expansion: - 6 == 6 + 1.0 is within 1 ULPs of 1.0 -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( (std::numeric_limits<uint32_t>::max)() > ul ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( nextafter(1., 2.), !WithinULP(1., 0) ) with expansion: - 4294967295 (0x<hex digits>) > 4 + 1.0 not is within 0 ULPs of 1.0 -------------------------------------------------------------------------------- -Contains string matcher -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1., WithinULP(1., 0) ) +with expansion: + 1.0 is within 0 ULPs of 1.0 -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( -0., WithinULP(0., 0) ) with expansion: - "this string contains 'abc' as a substring" contains: "not there" (case - insensitive) + -0.0 is within 0 ULPs of 0.0 -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains("STRING") ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( NAN, !WithinULP(NAN, 123) ) with expansion: - "this string contains 'abc' as a substring" contains: "STRING" + nanf not is within 123 ULPs of nanf ------------------------------------------------------------------------------- -Custom exceptions can be translated when testing for nothrow +Floating point matchers: double + Composed ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: FAILED: - REQUIRE_NOTHROW( throwCustom() ) -due to unexpected exception with message: - custom exception - not std +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1., WithinAbs(1., 0.5) || WithinULP(2., 1) ) +with expansion: + 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0 ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1., WithinAbs(2., 0.5) || WithinULP(1., 0) ) +with expansion: + 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0 ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123)) ) +with expansion: + nanf not ( is within 100.0 of nan or is within 123 ULPs of nanf ) ------------------------------------------------------------------------------- -Custom exceptions can be translated when testing for throwing as something else +Floating point matchers: double + Constructor validation ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_AS( throwCustom(), std::exception ) -due to unexpected exception with message: - custom exception - not std - -------------------------------------------------------------------------------- -Custom std-exceptions can be custom translated -------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> -............................................................................... - -Exception.tests.cpp:<line number>: FAILED: -due to unexpected exception with message: - custom std exception +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( WithinAbs(1., 0.) ) -------------------------------------------------------------------------------- -Default scale is invisible to comparison -------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> -............................................................................... +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( WithinAbs(1., -1.), std::domain_error ) -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 101.000001 != Approx(100).epsilon(0.01) ) -with expansion: - 101.000001 != Approx( 100.0 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( WithinULP(1., 0) ) -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( std::pow(10, -5) != Approx(std::pow(10, -7)) ) -with expansion: - 0.00001 != Approx( 0.0000001 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( WithinULP(1., -1), std::domain_error ) ------------------------------------------------------------------------------- -EndsWith string matcher +Floating point matchers: float + Margin ------------------------------------------------------------------------------- Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("Substring") ) -with expansion: - "this string contains 'abc' as a substring" ends with: "Substring" - -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) ) -with expansion: - "this string contains 'abc' as a substring" ends with: "this" (case - insensitive) - -------------------------------------------------------------------------------- -Epsilon only applies to Approx's value -------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> -............................................................................... - -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( 101.01 != Approx(100).epsilon(0.01) ) -with expansion: - 101.01 != Approx( 100.0 ) - -------------------------------------------------------------------------------- -Equality checks that should fail -------------------------------------------------------------------------------- -Condition.tests.cpp:<line number> -............................................................................... - -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.int_seven == 6 ) -with expansion: - 7 == 6 - -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.int_seven == 8 ) -with expansion: - 7 == 8 - -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.int_seven == 0 ) -with expansion: - 7 == 0 - -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.float_nine_point_one == Approx( 9.11f ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1.f, WithinAbs(1.f, 0) ) with expansion: - 9.1f == Approx( 9.1099996567 ) + 1.0f is within 0.0 of 1.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.float_nine_point_one == Approx( 9.0f ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0.f, WithinAbs(1.f, 1) ) with expansion: - 9.1f == Approx( 9.0 ) + 0.0f is within 1.0 of 1.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.float_nine_point_one == Approx( 1 ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) with expansion: - 9.1f == Approx( 1.0 ) + 0.0f not is within 0.9900000095 of 1.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.float_nine_point_one == Approx( 0 ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) with expansion: - 9.1f == Approx( 0.0 ) + 0.0f not is within 0.9900000095 of 1.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.double_pi == Approx( 3.1415 ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 0.f, WithinAbs(-0.f, 0) ) with expansion: - 3.1415926535 == Approx( 3.1415 ) + 0.0f is within 0.0 of -0.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.str_hello == "goodbye" ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( NAN, !WithinAbs(NAN, 0) ) with expansion: - "hello" == "goodbye" + nanf not is within 0.0 of nan -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.str_hello == "hell" ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 11.f, !WithinAbs(10.f, 0.5f) ) with expansion: - "hello" == "hell" + 11.0f not is within 0.5 of 10.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.str_hello == "hello1" ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 10.f, !WithinAbs(11.f, 0.5f) ) with expansion: - "hello" == "hello1" + 10.0f not is within 0.5 of 11.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( data.str_hello.size() == 6 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( -10.f, WithinAbs(-10.f, 0.5f) ) with expansion: - 5 == 6 + -10.0f is within 0.5 of -10.0 -Condition.tests.cpp:<line number>: FAILED: - CHECK( x == Approx( 1.301 ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( -10.f, WithinAbs(-9.6f, 0.5f) ) with expansion: - 1.3 == Approx( 1.301 ) + -10.0f is within 0.5 of -9.6000003815 ------------------------------------------------------------------------------- -Equality checks that should succeed +Floating point matchers: float + ULPs ------------------------------------------------------------------------------- -Condition.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( data.int_seven == 7 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) with expansion: - 7 == 7 + 1.0f is within 0 ULPs of 1.0f -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( data.float_nine_point_one == Approx( 9.1f ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( nextafter(1.f, 2.f), WithinULP(1.f, 1) ) with expansion: - 9.1f == Approx( 9.1000003815 ) + 1.0f is within 1 ULPs of 1.0f -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( data.double_pi == Approx( 3.1415926535 ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( nextafter(1.f, 0.f), WithinULP(1.f, 1) ) with expansion: - 3.1415926535 == Approx( 3.1415926535 ) + 1.0f is within 1 ULPs of 1.0f -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( data.str_hello == "hello" ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( nextafter(1.f, 2.f), !WithinULP(1.f, 0) ) with expansion: - "hello" == "hello" + 1.0f not is within 0 ULPs of 1.0f -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( "hello" == data.str_hello ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) with expansion: - "hello" == "hello" + 1.0f is within 0 ULPs of 1.0f -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( data.str_hello.size() == 5 ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( -0.f, WithinULP(0.f, 0) ) with expansion: - 5 == 5 + -0.0f is within 0 ULPs of 0.0f -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( x == Approx( 1.3 ) ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( NAN, !WithinULP(NAN, 123) ) with expansion: - 1.3 == Approx( 1.3 ) + nanf not is within 123 ULPs of nanf ------------------------------------------------------------------------------- -Equals +Floating point matchers: float + Composed ------------------------------------------------------------------------------- Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'abc' as a substring") ) + REQUIRE_THAT( 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) ) with expansion: - "this string contains 'abc' as a substring" equals: "this string contains - 'abc' as a substring" + 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.0f ) Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) ) + REQUIRE_THAT( 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) ) with expansion: - "this string contains 'abc' as a substring" equals: "this string contains - 'abc' as a substring" (case insensitive) + 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0f ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123)) ) +with expansion: + nanf not ( is within 100.0 of nan or is within 123 ULPs of nanf ) ------------------------------------------------------------------------------- -Equals string matcher +Floating point matchers: float + Constructor validation ------------------------------------------------------------------------------- Matchers.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") ) -with expansion: - "this string contains 'abc' as a substring" equals: "this string contains - 'ABC' as a substring" +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( WithinAbs(1.f, 0.f) ) -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) ) -with expansion: - "this string contains 'abc' as a substring" equals: "something else" (case - insensitive) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( WithinAbs(1.f, -1.f), std::domain_error ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_NOTHROW( WithinULP(1.f, 0) ) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( WithinULP(1.f, -1), std::domain_error ) ------------------------------------------------------------------------------- -Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified +Generators -- adapters + Filtering by predicate + Basic usage ------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( ::Catch::Detail::stringify(WhatException{}) == "This exception has overriden what() method" ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i % 2 == 0 ) with expansion: - "This exception has overriden what() method" - == - "This exception has overriden what() method" + 0 == 0 -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" ) -with expansion: - "OperatorException" == "OperatorException" +------------------------------------------------------------------------------- +Generators -- adapters + Filtering by predicate + Basic usage +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i % 2 == 0 ) with expansion: - "StringMakerException" - == - "StringMakerException" + 0 == 0 ------------------------------------------------------------------------------- -Exception matchers that fail - No exception +Generators -- adapters + Filtering by predicate + Basic usage ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) -because no exception was thrown where one was expected: - -Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) -because no exception was thrown where one was expected: +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i % 2 == 0 ) +with expansion: + 0 == 0 ------------------------------------------------------------------------------- -Exception matchers that fail - Type mismatch +Generators -- adapters + Filtering by predicate + Throws if there are no matching values ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) -due to unexpected exception with message: - Unknown exception - -Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) -due to unexpected exception with message: - Unknown exception +Generators.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( filter([] (int) {return false; }, value(1)), Catch::GeneratorException ) ------------------------------------------------------------------------------- -Exception matchers that fail - Contents are wrong +Generators -- adapters + Shortening a range ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( throws(3), SpecialException, ExceptionMatcher{1} ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i < 4 ) with expansion: - SpecialException::what special exception has value of 1 + 1 < 4 -Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( throws(4), SpecialException, ExceptionMatcher{1} ) +------------------------------------------------------------------------------- +Generators -- adapters + Shortening a range +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i < 4 ) with expansion: - SpecialException::what special exception has value of 1 + 2 < 4 ------------------------------------------------------------------------------- -Exception matchers that succeed +Generators -- adapters + Shortening a range ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THROWS_MATCHES( throws(1), SpecialException, ExceptionMatcher{1} ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i < 4 ) with expansion: - SpecialException::what special exception has value of 1 + 3 < 4 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_MATCHES( throws(2), SpecialException, ExceptionMatcher{2} ) +------------------------------------------------------------------------------- +Generators -- adapters + Transforming elements + Same type +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i % 2 == 0 ) with expansion: - SpecialException::what special exception has value of 2 + 0 == 0 ------------------------------------------------------------------------------- -Exception messages can be tested for - exact match +Generators -- adapters + Transforming elements + Same type ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), "expected exception" ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i % 2 == 0 ) with expansion: - "expected exception" equals: "expected exception" + 0 == 0 ------------------------------------------------------------------------------- -Exception messages can be tested for - different case +Generators -- adapters + Transforming elements + Same type ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i % 2 == 0 ) with expansion: - "expected exception" equals: "expected exception" (case insensitive) + 0 == 0 ------------------------------------------------------------------------------- -Exception messages can be tested for - wildcarded +Generators -- adapters + Transforming elements + Different type ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), StartsWith( "expected" ) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i.size() == 1 ) with expansion: - "expected exception" starts with: "expected" + 1 == 1 -Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), EndsWith( "exception" ) ) -with expansion: - "expected exception" ends with: "exception" +------------------------------------------------------------------------------- +Generators -- adapters + Transforming elements + Different type +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... -Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i.size() == 1 ) with expansion: - "expected exception" contains: "except" + 1 == 1 -Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) ) +------------------------------------------------------------------------------- +Generators -- adapters + Transforming elements + Different type +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i.size() == 1 ) with expansion: - "expected exception" contains: "except" (case insensitive) + 1 == 1 ------------------------------------------------------------------------------- -Expected exceptions that don't throw or unexpected exceptions fail the test +Generators -- adapters + Transforming elements + Different deduced type ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: FAILED: - CHECK_THROWS_AS( thisThrows(), std::string ) -due to unexpected exception with message: - expected exception +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i.size() == 1 ) +with expansion: + 1 == 1 -Exception.tests.cpp:<line number>: FAILED: - CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error ) -because no exception was thrown where one was expected: +------------------------------------------------------------------------------- +Generators -- adapters + Transforming elements + Different deduced type +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... -Exception.tests.cpp:<line number>: FAILED: - CHECK_NOTHROW( thisThrows() ) -due to unexpected exception with message: - expected exception +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i.size() == 1 ) +with expansion: + 1 == 1 ------------------------------------------------------------------------------- -FAIL aborts the test +Generators -- adapters + Transforming elements + Different deduced type ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: FAILED: -explicitly with message: - This is a failure +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( i.size() == 1 ) +with expansion: + 1 == 1 ------------------------------------------------------------------------------- -FAIL does not require an argument +Generators -- adapters + Repeating a generator ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: FAILED: +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( j > 0 ) +with expansion: + 1 > 0 ------------------------------------------------------------------------------- -FAIL_CHECK does not abort the test +Generators -- adapters + Repeating a generator ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: FAILED: -explicitly with message: - This is a failure - -Message.tests.cpp:<line number>: warning: - This message appears in the output +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( j > 0 ) +with expansion: + 2 > 0 ------------------------------------------------------------------------------- -Factorials are computed +Generators -- adapters + Repeating a generator ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( Factorial(0) == 1 ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( j > 0 ) with expansion: - 1 == 1 + 3 > 0 -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( Factorial(1) == 1 ) -with expansion: - 1 == 1 +------------------------------------------------------------------------------- +Generators -- adapters + Repeating a generator +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( Factorial(2) == 2 ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( j > 0 ) with expansion: - 2 == 2 + 1 > 0 -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( Factorial(3) == 6 ) -with expansion: - 6 == 6 +------------------------------------------------------------------------------- +Generators -- adapters + Repeating a generator +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( Factorial(10) == 3628800 ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( j > 0 ) with expansion: - 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) + 2 > 0 ------------------------------------------------------------------------------- -Floating point matchers: double - Margin +Generators -- adapters + Repeating a generator ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinAbs(1., 0) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( j > 0 ) with expansion: - 1.0 is within 0.0 of 1.0 + 3 > 0 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0., WithinAbs(1., 1) ) -with expansion: - 0.0 is within 1.0 of 1.0 +------------------------------------------------------------------------------- +Generators -- adapters + Chunking a generator into sized pieces + Number of elements in source is divisible by chunk size +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.size() == 2 ) with expansion: - 0.0 not is within 0.99 of 1.0 + 2 == 2 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.front() == chunk2.back() ) with expansion: - 0.0 not is within 0.99 of 1.0 + 1 == 1 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( NAN, !WithinAbs(NAN, 0) ) -with expansion: - nanf not is within 0.0 of nan +------------------------------------------------------------------------------- +Generators -- adapters + Chunking a generator into sized pieces + Number of elements in source is divisible by chunk size +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 11., !WithinAbs(10., 0.5) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.size() == 2 ) with expansion: - 11.0 not is within 0.5 of 10.0 + 2 == 2 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10., !WithinAbs(11., 0.5) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.front() == chunk2.back() ) with expansion: - 10.0 not is within 0.5 of 11.0 + 2 == 2 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10., WithinAbs(-10., 0.5) ) +------------------------------------------------------------------------------- +Generators -- adapters + Chunking a generator into sized pieces + Number of elements in source is divisible by chunk size +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.size() == 2 ) with expansion: - -10.0 is within 0.5 of -10.0 + 2 == 2 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10., WithinAbs(-9.6, 0.5) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.front() == chunk2.back() ) with expansion: - -10.0 is within 0.5 of -9.6 + 3 == 3 ------------------------------------------------------------------------------- -Floating point matchers: double - ULPs +Generators -- adapters + Chunking a generator into sized pieces + Number of elements in source is not divisible by chunk size ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinULP(1., 0) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.size() == 2 ) with expansion: - 1.0 is within 0 ULPs of 1.0 + 2 == 2 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( nextafter(1., 2.), WithinULP(1., 1) ) -with expansion: - 1.0 is within 1 ULPs of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( nextafter(1., 0.), WithinULP(1., 1) ) -with expansion: - 1.0 is within 1 ULPs of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( nextafter(1., 2.), !WithinULP(1., 0) ) -with expansion: - 1.0 not is within 0 ULPs of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinULP(1., 0) ) -with expansion: - 1.0 is within 0 ULPs of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -0., WithinULP(0., 0) ) -with expansion: - -0.0 is within 0 ULPs of 0.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( NAN, !WithinULP(NAN, 123) ) -with expansion: - nanf not is within 123 ULPs of nanf - -------------------------------------------------------------------------------- -Floating point matchers: double - Composed -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinAbs(1., 0.5) || WithinULP(2., 1) ) -with expansion: - 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0 ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinAbs(2., 0.5) || WithinULP(1., 0) ) -with expansion: - 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0 ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123)) ) -with expansion: - nanf not ( is within 100.0 of nan or is within 123 ULPs of nanf ) - -------------------------------------------------------------------------------- -Floating point matchers: double - Constructor validation -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinAbs(1., 0.) ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinAbs(1., -1.), std::domain_error ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinULP(1., 0) ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinULP(1., -1), std::domain_error ) - -------------------------------------------------------------------------------- -Floating point matchers: float - Margin -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinAbs(1.f, 0) ) -with expansion: - 1.0f is within 0.0 of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, WithinAbs(1.f, 1) ) -with expansion: - 0.0f is within 1.0 of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) -with expansion: - 0.0f not is within 0.9900000095 of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) -with expansion: - 0.0f not is within 0.9900000095 of 1.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, WithinAbs(-0.f, 0) ) -with expansion: - 0.0f is within 0.0 of -0.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( NAN, !WithinAbs(NAN, 0) ) -with expansion: - nanf not is within 0.0 of nan - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 11.f, !WithinAbs(10.f, 0.5f) ) -with expansion: - 11.0f not is within 0.5 of 10.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10.f, !WithinAbs(11.f, 0.5f) ) -with expansion: - 10.0f not is within 0.5 of 11.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10.f, WithinAbs(-10.f, 0.5f) ) -with expansion: - -10.0f is within 0.5 of -10.0 - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10.f, WithinAbs(-9.6f, 0.5f) ) -with expansion: - -10.0f is within 0.5 of -9.6000003815 - -------------------------------------------------------------------------------- -Floating point matchers: float - ULPs -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) -with expansion: - 1.0f is within 0 ULPs of 1.0f - -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.0f - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( nextafter(1.f, 0.f), WithinULP(1.f, 1) ) -with expansion: - 1.0f is within 1 ULPs of 1.0f - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( nextafter(1.f, 2.f), !WithinULP(1.f, 0) ) -with expansion: - 1.0f not is within 0 ULPs of 1.0f - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) -with expansion: - 1.0f is within 0 ULPs of 1.0f - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -0.f, WithinULP(0.f, 0) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.front() == chunk2.back() ) with expansion: - -0.0f is within 0 ULPs of 0.0f + 1 == 1 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( NAN, !WithinULP(NAN, 123) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.front() < 3 ) with expansion: - nanf not is within 123 ULPs of nanf + 1 < 3 ------------------------------------------------------------------------------- -Floating point matchers: float - Composed +Generators -- adapters + Chunking a generator into sized pieces + Number of elements in source is not divisible by chunk size ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.size() == 2 ) with expansion: - 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.0f ) + 2 == 2 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.front() == chunk2.back() ) with expansion: - 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0f ) + 2 == 2 -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123)) ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( chunk2.front() < 3 ) with expansion: - nanf not ( is within 100.0 of nan or is within 123 ULPs of nanf ) + 2 < 3 ------------------------------------------------------------------------------- -Floating point matchers: float - Constructor validation +Generators -- adapters + Chunking a generator into sized pieces + Throws on too small generators ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +Generators.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinAbs(1.f, 0.f) ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinAbs(1.f, -1.f), std::domain_error ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinULP(1.f, 0) ) - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinULP(1.f, -1), std::domain_error ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( chunk(2, value(1)), Catch::GeneratorException ) ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "a" - j := 8 + REQUIRE( j < i ) +with expansion: + -3 < 1 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "a" - j := 9 + REQUIRE( j < i ) +with expansion: + -2 < 1 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "a" - j := 10 + REQUIRE( j < i ) +with expansion: + -1 < 1 ------------------------------------------------------------------------------- -Generators - one +Generators -- simple + two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "a" - j := 2 + REQUIRE( 4u * i > str.size() ) +with expansion: + 4 > 1 ------------------------------------------------------------------------------- -Generators +Generators -- simple two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "a" - j := 3.141 + REQUIRE( 4u * i > str.size() ) +with expansion: + 4 > 2 ------------------------------------------------------------------------------- -Generators +Generators -- simple two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "a" - j := 1.379 + REQUIRE( 4u * i > str.size() ) +with expansion: + 4 > 3 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "b" - j := 8 + REQUIRE( j < i ) +with expansion: + -3 < 2 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "b" - j := 9 + REQUIRE( j < i ) +with expansion: + -2 < 2 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "b" - j := 10 + REQUIRE( j < i ) +with expansion: + -1 < 2 ------------------------------------------------------------------------------- -Generators - one +Generators -- simple + two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "b" - j := 2 + REQUIRE( 4u * i > str.size() ) +with expansion: + 8 > 1 ------------------------------------------------------------------------------- -Generators +Generators -- simple two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "b" - j := 3.141 + REQUIRE( 4u * i > str.size() ) +with expansion: + 8 > 2 ------------------------------------------------------------------------------- -Generators +Generators -- simple two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "b" - j := 1.379 + REQUIRE( 4u * i > str.size() ) +with expansion: + 8 > 3 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "c" - j := 8 + REQUIRE( j < i ) +with expansion: + -3 < 3 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "c" - j := 9 + REQUIRE( j < i ) +with expansion: + -2 < 3 ------------------------------------------------------------------------------- -Generators +Generators -- simple one ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "c" - j := 10 + REQUIRE( j < i ) +with expansion: + -1 < 3 ------------------------------------------------------------------------------- -Generators - one +Generators -- simple + two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "c" - j := 2 + REQUIRE( 4u * i > str.size() ) +with expansion: + 12 > 1 ------------------------------------------------------------------------------- -Generators +Generators -- simple two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "c" - j := 3.141 + REQUIRE( 4u * i > str.size() ) +with expansion: + 12 > 2 ------------------------------------------------------------------------------- -Generators +Generators -- simple two ------------------------------------------------------------------------------- Generators.tests.cpp:<line number> ............................................................................... Generators.tests.cpp:<line number>: PASSED: -with messages: - i := "c" - j := 1.379 + REQUIRE( 4u * i > str.size() ) +with expansion: + 12 > 3 + +------------------------------------------------------------------------------- +Generators internals + Single value +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 123 ) +with expansion: + 123 == 123 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Preset values +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 3 ) +with expansion: + 3 == 3 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 5 ) +with expansion: + 5 == 5 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Generator combinator +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 5 ) +with expansion: + 5 == 5 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 4 ) +with expansion: + 4 == 4 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 0 ) +with expansion: + 0 == 0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Explicitly typed generator sequence +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get().size() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == "aa" ) +with expansion: + "aa" == "aa" + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == "bb" ) +with expansion: + "bb" == "bb" + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == "cc" ) +with expansion: + "cc" == "cc" + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Filter generator +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 3 ) +with expansion: + 3 == 3 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_AS( filter([] (int) { return false; }, value(1)), Catch::GeneratorException ) + +------------------------------------------------------------------------------- +Generators internals + Take generator + Take less +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Take generator + Take more +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Map with explicit return type +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2.0 ) +with expansion: + 2.0 == 2.0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 4.0 ) +with expansion: + 4.0 == 4.0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 6.0 ) +with expansion: + 6.0 == 6.0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Map with deduced return type +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2.0 ) +with expansion: + 2.0 == 2.0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 4.0 ) +with expansion: + 4.0 == 4.0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 6.0 ) +with expansion: + 6.0 == 6.0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Repeat + Singular repeat +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 3 ) +with expansion: + 3 == 3 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Repeat + Actual repeat +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 3 ) +with expansion: + 3 == 3 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 3 ) +with expansion: + 3 == 3 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Range + Positive auto step + Integer +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -2 ) +with expansion: + -2 == -2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -1 ) +with expansion: + -1 == -1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 0 ) +with expansion: + 0 == 0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Range + Negative auto step + Integer +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 1 ) +with expansion: + 1 == 1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 0 ) +with expansion: + 0 == 0 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -1 ) +with expansion: + -1 == -1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + +------------------------------------------------------------------------------- +Generators internals + Range + Positive manual step + Integer + Exact +------------------------------------------------------------------------------- +GeneratorsImpl.tests.cpp:<line number> +............................................................................... + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -7 ) +with expansion: + -7 == -7 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -4 ) +with expansion: + -4 == -4 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -1 ) +with expansion: + -1 == -1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false ------------------------------------------------------------------------------- -Generators impl - range +Generators internals + Range + Positive manual step + Integer + Slightly over end ------------------------------------------------------------------------------- GeneratorsImpl.tests.cpp:<line number> ............................................................................... GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen.size() == 2 ) + REQUIRE( gen.get() == -7 ) with expansion: - 2 == 2 + -7 == -7 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[0] == 1 ) + REQUIRE( gen.next() ) with expansion: - 1 == 1 + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -4 ) +with expansion: + -4 == -4 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -1 ) +with expansion: + -1 == -1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[1] == 2 ) + REQUIRE( gen.get() == 2 ) with expansion: 2 == 2 +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false + ------------------------------------------------------------------------------- -Generators impl - fixed values +Generators internals + Range + Positive manual step + Integer + Slightly under end ------------------------------------------------------------------------------- GeneratorsImpl.tests.cpp:<line number> ............................................................................... GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen.size() == 4 ) + REQUIRE( gen.get() == -7 ) with expansion: - 4 == 4 + -7 == -7 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[0] == 3 ) + REQUIRE( gen.next() ) with expansion: - 3 == 3 + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[1] == 1 ) + REQUIRE( gen.get() == -4 ) with expansion: - 1 == 1 + -4 == -4 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[2] == 4 ) + REQUIRE( gen.next() ) with expansion: - 4 == 4 + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[3] == 1 ) + REQUIRE( gen.get() == -1 ) with expansion: - 1 == 1 + -1 == -1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) +with expansion: + 2 == 2 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 5 ) +with expansion: + 5 == 5 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false ------------------------------------------------------------------------------- -Generators impl - combined +Generators internals + Range + Negative manual step + Integer + Exact ------------------------------------------------------------------------------- GeneratorsImpl.tests.cpp:<line number> ............................................................................... GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen.size() == 4 ) + REQUIRE( gen.get() == 5 ) with expansion: - 4 == 4 + 5 == 5 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[0] == 1 ) + REQUIRE( gen.next() ) with expansion: - 1 == 1 + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[1] == 2 ) + REQUIRE( gen.get() == 2 ) with expansion: 2 == 2 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[2] == 9 ) + REQUIRE( gen.next() ) with expansion: - 9 == 9 + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[3] == 7 ) + REQUIRE( gen.get() == -1 ) with expansion: - 7 == 7 + -1 == -1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -4 ) +with expansion: + -4 == -4 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false ------------------------------------------------------------------------------- -Generators impl - values +Generators internals + Range + Negative manual step + Integer + Slightly over end ------------------------------------------------------------------------------- GeneratorsImpl.tests.cpp:<line number> ............................................................................... GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen.size() == 2 ) + REQUIRE( gen.get() == 5 ) +with expansion: + 5 == 5 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == 2 ) with expansion: 2 == 2 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[0] == 3 ) + REQUIRE( gen.next() ) with expansion: - 3 == 3 + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[1] == 1 ) + REQUIRE( gen.get() == -1 ) with expansion: - 1 == 1 + -1 == -1 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.get() == -4 ) +with expansion: + -4 == -4 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false ------------------------------------------------------------------------------- -Generators impl - values2 +Generators internals + Range + Negative manual step + Integer + Slightly under end ------------------------------------------------------------------------------- GeneratorsImpl.tests.cpp:<line number> ............................................................................... GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen.size() == 2 ) + REQUIRE( gen.get() == 5 ) with expansion: - 2 == 2 + 5 == 5 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[0] == 3 ) + REQUIRE( gen.next() ) with expansion: - 3 == 3 + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( gen[1] == 1 ) + REQUIRE( gen.get() == 2 ) with expansion: - 1 == 1 + 2 == 2 -------------------------------------------------------------------------------- -Generators impl - type erasure -------------------------------------------------------------------------------- -GeneratorsImpl.tests.cpp:<line number> -............................................................................... +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE( gen.next() ) +with expansion: + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( base->size() == 4 ) + REQUIRE( gen.get() == -1 ) with expansion: - 4 == 4 + -1 == -1 GeneratorsImpl.tests.cpp:<line number>: PASSED: - REQUIRE( typed ) + REQUIRE( gen.next() ) with expansion: - 0x<hex digits> + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( typed->size() == 4 ) + REQUIRE( gen.get() == -4 ) with expansion: - 4 == 4 + -4 == -4 GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( (*typed)[0] == 7 ) + REQUIRE( gen.next() ) with expansion: - 7 == 7 + true GeneratorsImpl.tests.cpp:<line number>: PASSED: - CHECK( (*typed)[3] == 11 ) + REQUIRE( gen.get() == -7 ) with expansion: - 11 == 11 + -7 == -7 + +GeneratorsImpl.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( gen.next() ) +with expansion: + !false ------------------------------------------------------------------------------- Greater-than inequalities with different epsilons @@ -4155,18 +4700,194 @@ with expansion: ------------------------------------------------------------------------------- Mismatching exception messages failing the test ------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> +Exception.tests.cpp:<line number> +............................................................................... + +Exception.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS_WITH( thisThrows(), "expected exception" ) +with expansion: + "expected exception" equals: "expected exception" + +Exception.tests.cpp:<line number>: FAILED: + REQUIRE_THROWS_WITH( thisThrows(), "should fail" ) +with expansion: + "expected exception" equals: "should fail" + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 3 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 4 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 5 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 6 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + -5 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + -4 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 90 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 91 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 92 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 93 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 94 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 95 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 96 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 97 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) +with expansion: + 98 > -6 + +------------------------------------------------------------------------------- +Nested generators and captured variables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> ............................................................................... -Exception.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), "expected exception" ) -with expansion: - "expected exception" equals: "expected exception" - -Exception.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_WITH( thisThrows(), "should fail" ) +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( values > -6 ) with expansion: - "expected exception" equals: "should fail" + 99 > -6 ------------------------------------------------------------------------------- Nice descriptive name @@ -5360,1774 +6081,1484 @@ with expansion: Condition.tests.cpp:<line number>: PASSED: REQUIRE( cpc != 0 ) with expansion: - 0x<hex digits> != 0 - -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( returnsNull() == 0 ) -with expansion: - {null string} == 0 - -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( returnsConstNull() == 0 ) -with expansion: - {null string} == 0 - -Condition.tests.cpp:<line number>: PASSED: - REQUIRE( 0 != p ) -with expansion: - 0 != 0x<hex digits> - -------------------------------------------------------------------------------- -Predicate matcher can accept const char* -------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> -............................................................................... - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "foo", Predicate<const char*>([] (const char* const&) { return true; }) ) -with expansion: - "foo" matches undescribed predicate - -------------------------------------------------------------------------------- -Process can be configured on command line - empty args don't cause a crash -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( result ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.processName == "" ) -with expansion: - "" == "" - -------------------------------------------------------------------------------- -Process can be configured on command line - default - no arguments -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( result ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.processName == "test" ) -with expansion: - "test" == "test" - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.shouldDebugBreak == false ) -with expansion: - false == false - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.abortAfter == -1 ) -with expansion: - -1 == -1 - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.noThrow == false ) -with expansion: - false == false - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.reporterName == "console" ) -with expansion: - "console" == "console" - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK_FALSE( cfg.hasTestFilters() ) -with expansion: - !false - -------------------------------------------------------------------------------- -Process can be configured on command line - test lists - Specify one test case using -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( result ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.hasTestFilters() ) -with expansion: - true - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.testSpec().matches(fakeTestCase("notIncluded")) == false ) -with expansion: - false == false - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) ) -with expansion: - true - -------------------------------------------------------------------------------- -Process can be configured on command line - test lists - Specify one test case exclusion using exclude: -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( result ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.hasTestFilters() ) -with expansion: - true - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) -with expansion: - false == false - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) -with expansion: - true - -------------------------------------------------------------------------------- -Process can be configured on command line - test lists - Specify one test case exclusion using ~ -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( result ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.hasTestFilters() ) -with expansion: - true - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) -with expansion: - false == false - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) -with expansion: - true - -------------------------------------------------------------------------------- -Process can be configured on command line - reporter - -r/console -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-r", "console"}) ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterName == "console" ) -with expansion: - "console" == "console" - -------------------------------------------------------------------------------- -Process can be configured on command line - reporter - -r/xml -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-r", "xml"}) ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterName == "xml" ) -with expansion: - "xml" == "xml" - -------------------------------------------------------------------------------- -Process can be configured on command line - reporter - --reporter/junit -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--reporter", "junit"}) ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterName == "junit" ) -with expansion: - "junit" == "junit" - -------------------------------------------------------------------------------- -Process can be configured on command line - reporter - Only one reporter is accepted -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( cli.parse({ "test", "-r", "xml", "-r", "junit" }) ) -with expansion: - !{?} - -------------------------------------------------------------------------------- -Process can be configured on command line - reporter - must match one of the available ones -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... + 0x<hex digits> != 0 -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( !result ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( returnsNull() == 0 ) with expansion: - true + {null string} == 0 -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("Unrecognized reporter") ) +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( returnsConstNull() == 0 ) with expansion: - "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" - contains: "Unrecognized reporter" + {null string} == 0 + +Condition.tests.cpp:<line number>: PASSED: + REQUIRE( 0 != p ) +with expansion: + 0 != 0x<hex digits> ------------------------------------------------------------------------------- -Process can be configured on command line - debugger - -b +Predicate matcher can accept const char* ------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-b"}) ) -with expansion: - {?} - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.shouldDebugBreak == true ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( "foo", Predicate<const char*>([] (const char* const&) { return true; }) ) with expansion: - true == true + "foo" matches undescribed predicate ------------------------------------------------------------------------------- Process can be configured on command line - debugger - --break + empty args don't cause a crash ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--break"}) ) + CHECK( result ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.shouldDebugBreak ) + CHECK( config.processName == "" ) with expansion: - true + "" == "" ------------------------------------------------------------------------------- Process can be configured on command line - abort - -a aborts after first failure + default - no arguments ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-a"}) ) + CHECK( result ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.abortAfter == 1 ) + CHECK( config.processName == "test" ) with expansion: - 1 == 1 - -------------------------------------------------------------------------------- -Process can be configured on command line - abort - -x 2 aborts after two failures -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... + "test" == "test" CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-x", "2"}) ) + CHECK( config.shouldDebugBreak == false ) with expansion: - {?} + false == false CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.abortAfter == 2 ) + CHECK( config.abortAfter == -1 ) with expansion: - 2 == 2 + -1 == -1 -------------------------------------------------------------------------------- -Process can be configured on command line - abort - -x must be numeric -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( config.noThrow == false ) +with expansion: + false == false CmdLine.tests.cpp:<line number>: PASSED: - CHECK( !result ) + CHECK( config.reporterName == "console" ) with expansion: - true + "console" == "console" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("convert") && Contains("oops") ) + CHECK_FALSE( cfg.hasTestFilters() ) with expansion: - "Unable to convert 'oops' to destination type" ( contains: "convert" and - contains: "oops" ) + !false ------------------------------------------------------------------------------- Process can be configured on command line - nothrow - -e + test lists + Specify one test case using ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-e"}) ) + CHECK( result ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.noThrow ) + REQUIRE( cfg.hasTestFilters() ) with expansion: true -------------------------------------------------------------------------------- -Process can be configured on command line - nothrow - --nothrow -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--nothrow"}) ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("notIncluded")) == false ) with expansion: - {?} + false == false CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.noThrow ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) ) with expansion: true ------------------------------------------------------------------------------- Process can be configured on command line - output filename - -o filename + test lists + Specify one test case exclusion using exclude: ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-o", "filename.ext"}) ) + CHECK( result ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.outputFilename == "filename.ext" ) + REQUIRE( cfg.hasTestFilters() ) with expansion: - "filename.ext" == "filename.ext" - -------------------------------------------------------------------------------- -Process can be configured on command line - output filename - --out -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... + true CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--out", "filename.ext"}) ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) with expansion: - {?} + false == false CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.outputFilename == "filename.ext" ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) with expansion: - "filename.ext" == "filename.ext" + true ------------------------------------------------------------------------------- Process can be configured on command line - combinations - Single character flags can be combined + test lists + Specify one test case exclusion using ~ ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "-abe"}) ) + CHECK( result ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.abortAfter == 1 ) -with expansion: - 1 == 1 - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.shouldDebugBreak ) + REQUIRE( cfg.hasTestFilters() ) with expansion: true CmdLine.tests.cpp:<line number>: PASSED: - CHECK( config.noThrow == true ) -with expansion: - true == true - -------------------------------------------------------------------------------- -Process can be configured on command line - use-colour - without option -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test"}) ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false ) with expansion: - {?} + false == false CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::Auto ) + REQUIRE( cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) ) with expansion: - 0 == 0 + true ------------------------------------------------------------------------------- Process can be configured on command line - use-colour - auto + reporter + -r/console ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--use-colour", "auto"}) ) + CHECK( cli.parse({"test", "-r", "console"}) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::Auto ) + REQUIRE( config.reporterName == "console" ) with expansion: - 0 == 0 + "console" == "console" ------------------------------------------------------------------------------- Process can be configured on command line - use-colour - yes + reporter + -r/xml ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--use-colour", "yes"}) ) + CHECK( cli.parse({"test", "-r", "xml"}) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::Yes ) + REQUIRE( config.reporterName == "xml" ) with expansion: - 1 == 1 + "xml" == "xml" ------------------------------------------------------------------------------- Process can be configured on command line - use-colour - no + reporter + --reporter/junit ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({"test", "--use-colour", "no"}) ) + CHECK( cli.parse({"test", "--reporter", "junit"}) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.useColour == UseColour::No ) + REQUIRE( config.reporterName == "junit" ) with expansion: - 2 == 2 + "junit" == "junit" ------------------------------------------------------------------------------- Process can be configured on command line - use-colour - error + reporter + Only one reporter is accepted ------------------------------------------------------------------------------- CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( !result ) -with expansion: - true - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ) -with expansion: - "colour mode must be one of: auto, yes or no. 'wrong' not recognised" - contains: "colour mode must be one of" - -------------------------------------------------------------------------------- -Product with differing arities - 0 -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... - -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( std::tuple_size<TestType>::value >= 1 ) -with expansion: - 1 >= 1 - -------------------------------------------------------------------------------- -Product with differing arities - 1 -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... - -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( std::tuple_size<TestType>::value >= 1 ) -with expansion: - 2 >= 1 - -------------------------------------------------------------------------------- -Product with differing arities - 2 -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... - -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( std::tuple_size<TestType>::value >= 1 ) -with expansion: - 3 >= 1 - -------------------------------------------------------------------------------- -Reconstruction should be based on stringification: #914 -------------------------------------------------------------------------------- -Decomposition.tests.cpp:<line number> -............................................................................... - -Decomposition.tests.cpp:<line number>: FAILED: - CHECK( truthy(false) ) + REQUIRE_FALSE( cli.parse({ "test", "-r", "xml", "-r", "junit" }) ) with expansion: - Hey, its truthy! + !{?} ------------------------------------------------------------------------------- -Regex string matcher +Process can be configured on command line + reporter + must match one of the available ones ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") ) -with expansion: - "this string contains 'abc' as a substring" matches "this STRING contains - 'abc' as a substring" case sensitively - -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( !result ) with expansion: - "this string contains 'abc' as a substring" matches "contains 'abc' as a - substring" case sensitively + true -Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") ) +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), Contains("Unrecognized reporter") ) with expansion: - "this string contains 'abc' as a substring" matches "this string contains - 'abc' as a" case sensitively + "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" + contains: "Unrecognized reporter" ------------------------------------------------------------------------------- -Regression test #1 +Process can be configured on command line + debugger + -b ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( actual, !UnorderedEquals(expected) ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "-b"}) ) with expansion: - { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } - -------------------------------------------------------------------------------- -SUCCEED counts as a test pass -------------------------------------------------------------------------------- -Message.tests.cpp:<line number> -............................................................................... + {?} -Message.tests.cpp:<line number>: PASSED: -with message: - this is a success +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.shouldDebugBreak == true ) +with expansion: + true == true ------------------------------------------------------------------------------- -SUCCEED does not require an argument +Process can be configured on command line + debugger + --break ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -Message.tests.cpp:<line number>: PASSED: +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "--break"}) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.shouldDebugBreak ) +with expansion: + true ------------------------------------------------------------------------------- -Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or - methods - Given: No operations precede me +Process can be configured on command line + abort + -a aborts after first failure ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( before == 0 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "-a"}) ) with expansion: - 0 == 0 + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.abortAfter == 1 ) +with expansion: + 1 == 1 ------------------------------------------------------------------------------- -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 +Process can be configured on command line + abort + -x 2 aborts after two failures ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( after > before ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "-x", "2"}) ) with expansion: - 1 > 0 + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.abortAfter == 2 ) +with expansion: + 2 == 2 ------------------------------------------------------------------------------- -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 +Process can be configured on command line + abort + -x must be numeric ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( itDoesThis() ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( !result ) with expansion: true +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( result.errorMessage(), Contains("convert") && Contains("oops") ) +with expansion: + "Unable to convert 'oops' to destination type" ( contains: "convert" and + contains: "oops" ) + ------------------------------------------------------------------------------- -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 +Process can be configured on command line + nothrow + -e ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( itDoesThat() ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "-e"}) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.noThrow ) with expansion: true ------------------------------------------------------------------------------- -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 +Process can be configured on command line + nothrow + --nothrow ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: -with message: - boo! +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "--nothrow"}) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.noThrow ) +with expansion: + true ------------------------------------------------------------------------------- -Scenario: Vector resizing affects size and capacity - Given: an empty vector +Process can be configured on command line + output filename + -o filename ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 0 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "-o", "filename.ext"}) ) with expansion: - 0 == 0 + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.outputFilename == "filename.ext" ) +with expansion: + "filename.ext" == "filename.ext" ------------------------------------------------------------------------------- -Scenario: Vector resizing affects size and capacity - Given: an empty vector - When: it is made larger - Then: the size and capacity go up +Process can be configured on command line + output filename + --out ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 10 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "--out", "filename.ext"}) ) with expansion: - 10 == 10 + {?} -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 10 ) +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.outputFilename == "filename.ext" ) with expansion: - 10 >= 10 + "filename.ext" == "filename.ext" ------------------------------------------------------------------------------- -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 +Process can be configured on command line + combinations + Single character flags can be combined ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "-abe"}) ) with expansion: - 5 == 5 + {?} -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 10 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( config.abortAfter == 1 ) with expansion: - 10 >= 10 + 1 == 1 + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( config.shouldDebugBreak ) +with expansion: + true + +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( config.noThrow == true ) +with expansion: + true == true ------------------------------------------------------------------------------- -Scenario: Vector resizing affects size and capacity - Given: an empty vector +Process can be configured on command line + use-colour + without option ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 0 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test"}) ) +with expansion: + {?} + +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.useColour == UseColour::Auto ) with expansion: 0 == 0 ------------------------------------------------------------------------------- -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 +Process can be configured on command line + use-colour + auto ------------------------------------------------------------------------------- -BDD.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 10 ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "--use-colour", "auto"}) ) with expansion: - 10 >= 10 + {?} -BDD.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 0 ) +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.useColour == UseColour::Auto ) with expansion: 0 == 0 -A string sent directly to stdout -A string sent directly to stderr -A string sent to stderr via clog ------------------------------------------------------------------------------- -Sends stuff to stdout and stderr +Process can be configured on command line + use-colour + yes ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "--use-colour", "yes"}) ) +with expansion: + {?} -No assertions in test case 'Sends stuff to stdout and stderr' +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.useColour == UseColour::Yes ) +with expansion: + 1 == 1 ------------------------------------------------------------------------------- -Some simple comparisons between doubles +Process can be configured on command line + use-colour + no ------------------------------------------------------------------------------- -Approx.tests.cpp:<line number> +CmdLine.tests.cpp:<line number> ............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d == Approx( 1.23 ) ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( cli.parse({"test", "--use-colour", "no"}) ) with expansion: - 1.23 == Approx( 1.23 ) + {?} -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d != Approx( 1.22 ) ) +CmdLine.tests.cpp:<line number>: PASSED: + REQUIRE( config.useColour == UseColour::No ) with expansion: - 1.23 != Approx( 1.22 ) + 2 == 2 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d != Approx( 1.24 ) ) -with expansion: - 1.23 != Approx( 1.24 ) +------------------------------------------------------------------------------- +Process can be configured on command line + use-colour + error +------------------------------------------------------------------------------- +CmdLine.tests.cpp:<line number> +............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d == 1.23_a ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK( !result ) with expansion: - 1.23 == Approx( 1.23 ) + true -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( d != 1.22_a ) +CmdLine.tests.cpp:<line number>: PASSED: + CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ) with expansion: - 1.23 != Approx( 1.22 ) + "colour mode must be one of: auto, yes or no. 'wrong' not recognised" + contains: "colour mode must be one of" -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx( d ) == 1.23 ) -with expansion: - Approx( 1.23 ) == 1.23 +------------------------------------------------------------------------------- +Product with differing arities - std::tuple<int, double, float> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx( d ) != 1.22 ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( std::tuple_size<TestType>::value >= 1 ) with expansion: - Approx( 1.23 ) != 1.22 + 3 >= 1 -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( Approx( d ) != 1.24 ) -with expansion: - Approx( 1.23 ) != 1.24 +------------------------------------------------------------------------------- +Product with differing arities - std::tuple<int, double> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -Approx.tests.cpp:<line number>: PASSED: - REQUIRE( INFINITY == Approx(INFINITY) ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( std::tuple_size<TestType>::value >= 1 ) with expansion: - inff == Approx( inf ) + 2 >= 1 -Message from section one ------------------------------------------------------------------------------- -Standard output from all sections is reported - one +Product with differing arities - std::tuple<int> ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( std::tuple_size<TestType>::value >= 1 ) +with expansion: + 1 >= 1 -No assertions in section 'one' - -Message from section two ------------------------------------------------------------------------------- -Standard output from all sections is reported - two +Reconstruction should be based on stringification: #914 ------------------------------------------------------------------------------- -Message.tests.cpp:<line number> +Decomposition.tests.cpp:<line number> ............................................................................... - -No assertions in section 'two' +Decomposition.tests.cpp:<line number>: FAILED: + CHECK( truthy(false) ) +with expansion: + Hey, its truthy! ------------------------------------------------------------------------------- -StartsWith string matcher +Regex string matcher ------------------------------------------------------------------------------- Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("This String") ) + CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") ) with expansion: - "this string contains 'abc' as a substring" starts with: "This String" + "this string contains 'abc' as a substring" matches "this STRING contains + 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") ) with expansion: - "this string contains 'abc' as a substring" starts with: "string" (case - insensitive) + "this string contains 'abc' as a substring" matches "contains 'abc' as a + substring" case sensitively + +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") ) +with expansion: + "this string contains 'abc' as a substring" matches "this string contains + 'abc' as a" case sensitively ------------------------------------------------------------------------------- -Static arrays are convertible to string - Single item +Regression test #1 ------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( Catch::Detail::stringify(singular) == "{ 1 }" ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( actual, !UnorderedEquals(expected) ) with expansion: - "{ 1 }" == "{ 1 }" + { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } ------------------------------------------------------------------------------- -Static arrays are convertible to string - Multiple +SUCCEED counts as a test pass ------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +Message.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" ) -with expansion: - "{ 3, 2, 1 }" == "{ 3, 2, 1 }" +Message.tests.cpp:<line number>: PASSED: +with message: + this is a success ------------------------------------------------------------------------------- -Static arrays are convertible to string - Non-trivial inner items +SUCCEED does not require an argument ------------------------------------------------------------------------------- -ToStringGeneral.tests.cpp:<line number> +Message.tests.cpp:<line number> ............................................................................... -ToStringGeneral.tests.cpp:<line number>: PASSED: - REQUIRE( Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" ) -with expansion: - "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" - == - "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" +Message.tests.cpp:<line number>: PASSED: ------------------------------------------------------------------------------- -String matchers +Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or + methods + Given: No operations precede me ------------------------------------------------------------------------------- -Matchers.tests.cpp:<line number> +BDD.tests.cpp:<line number> ............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( testStringForMatching(), Contains("string") ) -with expansion: - "this string contains 'abc' as a substring" contains: "string" - -Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( testStringForMatching(), Contains("string", Catch::CaseSensitive::No) ) -with expansion: - "this string contains 'abc' as a substring" contains: "string" (case - insensitive) - -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains("abc") ) -with expansion: - "this string contains 'abc' as a substring" contains: "abc" - -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( before == 0 ) with expansion: - "this string contains 'abc' as a substring" contains: "abc" (case - insensitive) + 0 == 0 -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), StartsWith("this") ) -with expansion: - "this string contains 'abc' as a substring" starts with: "this" +------------------------------------------------------------------------------- +Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or + methods + Given: No operations precede me + When: We get the count + Then: Subsequently values are higher +------------------------------------------------------------------------------- +BDD.tests.cpp:<line number> +............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( after > before ) with expansion: - "this string contains 'abc' as a substring" starts with: "this" (case - insensitive) + 1 > 0 -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), EndsWith("substring") ) -with expansion: - "this string contains 'abc' as a substring" ends with: "substring" +------------------------------------------------------------------------------- +Scenario: Do that thing with the thing + Given: This stuff exists + And given: And some assumption + When: I do this + Then: it should do this +------------------------------------------------------------------------------- +BDD.tests.cpp:<line number> +............................................................................... -Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( itDoesThis() ) with expansion: - "this string contains 'abc' as a substring" ends with: " substring" (case - insensitive) + true ------------------------------------------------------------------------------- -StringRef - Empty string +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 ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +BDD.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( empty.empty() ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( itDoesThat() ) with expansion: true -String.tests.cpp:<line number>: PASSED: - REQUIRE( empty.size() == 0 ) -with expansion: - 0 == 0 +------------------------------------------------------------------------------- +Scenario: This is a really long scenario name to see how the list command deals + with wrapping + Given: A section name that is so long that it cannot fit in a single + console width + When: The test headers are printed as part of the normal running of the + scenario + Then: The, deliberately very long and overly verbose (you see what I did + there?) section names must wrap, along with an indent +------------------------------------------------------------------------------- +BDD.tests.cpp:<line number> +............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 ) -with expansion: - 0 == 0 +BDD.tests.cpp:<line number>: PASSED: +with message: + boo! ------------------------------------------------------------------------------- -StringRef - From string literal +Scenario: Vector resizing affects size and capacity + Given: an empty vector ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +BDD.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( s.empty() == false ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) with expansion: - false == false + 0 == 0 -String.tests.cpp:<line number>: PASSED: - REQUIRE( s.size() == 5 ) -with expansion: - 5 == 5 +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up +------------------------------------------------------------------------------- +BDD.tests.cpp:<line number> +............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( isSubstring( s ) == false ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 10 ) with expansion: - false == false + 10 == 10 -String.tests.cpp:<line number>: PASSED: - REQUIRE( std::strcmp( rawChars, "hello" ) == 0 ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) with expansion: - 0 == 0 + 10 >= 10 ------------------------------------------------------------------------------- -StringRef - From string literal - c_str() does not cause copy +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 ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +BDD.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( isOwned( s ) == false ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - false == false + 5 == 5 -String.tests.cpp:<line number>: PASSED: - REQUIRE( s.c_str() == rawChars ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) with expansion: - "hello" == "hello" + 10 >= 10 -String.tests.cpp:<line number>: PASSED: - REQUIRE( isOwned( s ) == false ) +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +------------------------------------------------------------------------------- +BDD.tests.cpp:<line number> +............................................................................... + +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) with expansion: - false == false + 0 == 0 ------------------------------------------------------------------------------- -StringRef - From sub-string +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 ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +BDD.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( original == "original" ) - -String.tests.cpp:<line number>: PASSED: - REQUIRE( isSubstring( original ) ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) with expansion: - true + 10 >= 10 -String.tests.cpp:<line number>: PASSED: - REQUIRE( isOwned( original ) == false ) +BDD.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) with expansion: - false == false + 0 == 0 -String.tests.cpp:<line number>: PASSED: - REQUIRE( isSubstring( original ) == false ) -with expansion: - false == false +A string sent directly to stdout +A string sent directly to stderr +A string sent to stderr via clog +------------------------------------------------------------------------------- +Sends stuff to stdout and stderr +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( isOwned( original ) ) -with expansion: - true + +No assertions in test case 'Sends stuff to stdout and stderr' ------------------------------------------------------------------------------- -StringRef - Substrings - zero-based substring +Some simple comparisons between doubles ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +Approx.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( ss.empty() == false ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d == Approx( 1.23 ) ) with expansion: - false == false + 1.23 == Approx( 1.23 ) -String.tests.cpp:<line number>: PASSED: - REQUIRE( ss.size() == 5 ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d != Approx( 1.22 ) ) with expansion: - 5 == 5 + 1.23 != Approx( 1.22 ) -String.tests.cpp:<line number>: PASSED: - REQUIRE( std::strcmp( ss.c_str(), "hello" ) == 0 ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d != Approx( 1.24 ) ) with expansion: - 0 == 0 + 1.23 != Approx( 1.24 ) -String.tests.cpp:<line number>: PASSED: - REQUIRE( ss == "hello" ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d == 1.23_a ) with expansion: - hello == "hello" - -------------------------------------------------------------------------------- -StringRef - Substrings - c_str() causes copy -------------------------------------------------------------------------------- -String.tests.cpp:<line number> -............................................................................... + 1.23 == Approx( 1.23 ) -String.tests.cpp:<line number>: PASSED: - REQUIRE( isSubstring( ss ) ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( d != 1.22_a ) with expansion: - true + 1.23 != Approx( 1.22 ) -String.tests.cpp:<line number>: PASSED: - REQUIRE( isOwned( ss ) == false ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( Approx( d ) == 1.23 ) with expansion: - false == false + Approx( 1.23 ) == 1.23 -String.tests.cpp:<line number>: PASSED: - REQUIRE( rawChars == s.currentData() ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( Approx( d ) != 1.22 ) with expansion: - "hello world!" == "hello world!" + Approx( 1.23 ) != 1.22 -String.tests.cpp:<line number>: PASSED: - REQUIRE( ss.c_str() != rawChars ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( Approx( d ) != 1.24 ) with expansion: - "hello" != "hello world!" + Approx( 1.23 ) != 1.24 -String.tests.cpp:<line number>: PASSED: - REQUIRE( isSubstring( ss ) == false ) +Approx.tests.cpp:<line number>: PASSED: + REQUIRE( INFINITY == Approx(INFINITY) ) with expansion: - false == false + inff == Approx( inf ) -String.tests.cpp:<line number>: PASSED: - REQUIRE( isOwned( ss ) ) -with expansion: - true +Message from section one +------------------------------------------------------------------------------- +Standard output from all sections is reported + one +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( ss.currentData() != s.currentData() ) -with expansion: - "hello" != "hello world!" +No assertions in section 'one' + +Message from section two ------------------------------------------------------------------------------- -StringRef - Substrings - non-zero-based substring +Standard output from all sections is reported + two ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +Message.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( ss.size() == 6 ) + +No assertions in section 'two' + +------------------------------------------------------------------------------- +StartsWith string matcher +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), StartsWith("This String") ) with expansion: - 6 == 6 + "this string contains 'abc' as a substring" starts with: "This String" -String.tests.cpp:<line number>: PASSED: - REQUIRE( std::strcmp( ss.c_str(), "world!" ) == 0 ) +Matchers.tests.cpp:<line number>: FAILED: + CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) ) with expansion: - 0 == 0 + "this string contains 'abc' as a substring" starts with: "string" (case + insensitive) ------------------------------------------------------------------------------- -StringRef - Substrings - Pointer values of full refs should match +Static arrays are convertible to string + Single item ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( s.c_str() == s2.c_str() ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::Detail::stringify(singular) == "{ 1 }" ) with expansion: - "hello world!" == "hello world!" + "{ 1 }" == "{ 1 }" ------------------------------------------------------------------------------- -StringRef - Substrings - Pointer values of substring refs should not match +Static arrays are convertible to string + Multiple ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( s.c_str() != ss.c_str() ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" ) with expansion: - "hello world!" != "hello" + "{ 3, 2, 1 }" == "{ 3, 2, 1 }" ------------------------------------------------------------------------------- -StringRef - Comparisons +Static arrays are convertible to string + Non-trivial inner items ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +ToStringGeneral.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( StringRef("hello") == StringRef("hello") ) -with expansion: - hello == hello - -String.tests.cpp:<line number>: PASSED: - REQUIRE( StringRef("hello") != StringRef("cello") ) +ToStringGeneral.tests.cpp:<line number>: PASSED: + REQUIRE( Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" ) with expansion: - hello != cello + "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" + == + "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" ------------------------------------------------------------------------------- -StringRef - from std::string - implicitly constructed +String matchers ------------------------------------------------------------------------------- -String.tests.cpp:<line number> +Matchers.tests.cpp:<line number> ............................................................................... -String.tests.cpp:<line number>: PASSED: - REQUIRE( sr == "a standard string" ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( testStringForMatching(), Contains("string") ) with expansion: - a standard string == "a standard string" + "this string contains 'abc' as a substring" contains: "string" -String.tests.cpp:<line number>: PASSED: - REQUIRE( sr.size() == stdStr.size() ) +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( testStringForMatching(), Contains("string", Catch::CaseSensitive::No) ) with expansion: - 17 == 17 + "this string contains 'abc' as a substring" contains: "string" (case + insensitive) -------------------------------------------------------------------------------- -StringRef - from std::string - explicitly constructed -------------------------------------------------------------------------------- -String.tests.cpp:<line number> -............................................................................... +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), Contains("abc") ) +with expansion: + "this string contains 'abc' as a substring" contains: "abc" -String.tests.cpp:<line number>: PASSED: - REQUIRE( sr == "a standard string" ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) ) with expansion: - a standard string == "a standard string" + "this string contains 'abc' as a substring" contains: "abc" (case + insensitive) -String.tests.cpp:<line number>: PASSED: - REQUIRE( sr.size() == stdStr.size() ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), StartsWith("this") ) with expansion: - 17 == 17 + "this string contains 'abc' as a substring" starts with: "this" -------------------------------------------------------------------------------- -StringRef - from std::string - assigned -------------------------------------------------------------------------------- -String.tests.cpp:<line number> -............................................................................... +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) ) +with expansion: + "this string contains 'abc' as a substring" starts with: "this" (case + insensitive) -String.tests.cpp:<line number>: PASSED: - REQUIRE( sr == "a standard string" ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), EndsWith("substring") ) with expansion: - a standard string == "a standard string" + "this string contains 'abc' as a substring" ends with: "substring" -String.tests.cpp:<line number>: PASSED: - REQUIRE( sr.size() == stdStr.size() ) +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) ) with expansion: - 17 == 17 + "this string contains 'abc' as a substring" ends with: " substring" (case + insensitive) ------------------------------------------------------------------------------- StringRef - to std::string - implicitly constructed + Empty string ------------------------------------------------------------------------------- String.tests.cpp:<line number> ............................................................................... String.tests.cpp:<line number>: PASSED: - REQUIRE( stdStr == "a stringref" ) + REQUIRE( empty.empty() ) with expansion: - "a stringref" == "a stringref" + true String.tests.cpp:<line number>: PASSED: - REQUIRE( stdStr.size() == sr.size() ) + REQUIRE( empty.size() == 0 ) with expansion: - 11 == 11 + 0 == 0 + +String.tests.cpp:<line number>: PASSED: + REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 ) +with expansion: + 0 == 0 ------------------------------------------------------------------------------- StringRef - to std::string - explicitly constructed + From string literal ------------------------------------------------------------------------------- String.tests.cpp:<line number> ............................................................................... String.tests.cpp:<line number>: PASSED: - REQUIRE( stdStr == "a stringref" ) + REQUIRE( s.empty() == false ) with expansion: - "a stringref" == "a stringref" + false == false String.tests.cpp:<line number>: PASSED: - REQUIRE( stdStr.size() == sr.size() ) + REQUIRE( s.size() == 5 ) with expansion: - 11 == 11 - -------------------------------------------------------------------------------- -StringRef - to std::string - assigned -------------------------------------------------------------------------------- -String.tests.cpp:<line number> -............................................................................... + 5 == 5 String.tests.cpp:<line number>: PASSED: - REQUIRE( stdStr == "a stringref" ) + REQUIRE( isSubstring( s ) == false ) with expansion: - "a stringref" == "a stringref" + false == false String.tests.cpp:<line number>: PASSED: - REQUIRE( stdStr.size() == sr.size() ) + REQUIRE( std::strcmp( rawChars, "hello" ) == 0 ) with expansion: - 11 == 11 + 0 == 0 ------------------------------------------------------------------------------- StringRef - Counting utf-8 codepoints + From string literal + c_str() does not cause copy ------------------------------------------------------------------------------- String.tests.cpp:<line number> ............................................................................... String.tests.cpp:<line number>: PASSED: - REQUIRE( ascii.numberOfCharacters() == ascii.size() ) + REQUIRE( isOwned( s ) == false ) with expansion: - 39 == 39 + false == false String.tests.cpp:<line number>: PASSED: - REQUIRE( simpleu8.numberOfCharacters() == 30 ) + REQUIRE( s.c_str() == rawChars ) with expansion: - 30 == 30 + "hello" == "hello" String.tests.cpp:<line number>: PASSED: - REQUIRE( emojis.numberOfCharacters() == 9 ) + REQUIRE( isOwned( s ) == false ) with expansion: - 9 == 9 + false == false ------------------------------------------------------------------------------- -Stringifying std::chrono::duration helpers +StringRef + From sub-string ------------------------------------------------------------------------------- -ToStringChrono.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -ToStringChrono.tests.cpp:<line number>: PASSED: - REQUIRE( minute == seconds ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( original == "original" ) + +String.tests.cpp:<line number>: PASSED: + REQUIRE( isSubstring( original ) ) with expansion: - 1 m == 60 s + true -ToStringChrono.tests.cpp:<line number>: PASSED: - REQUIRE( hour != seconds ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( isOwned( original ) == false ) with expansion: - 1 h != 60 s + false == false -ToStringChrono.tests.cpp:<line number>: PASSED: - REQUIRE( micro != milli ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( isSubstring( original ) == false ) with expansion: - 1 us != 1 ms + false == false -ToStringChrono.tests.cpp:<line number>: PASSED: - REQUIRE( nano != micro ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( isOwned( original ) ) with expansion: - 1 ns != 1 us + true ------------------------------------------------------------------------------- -Stringifying std::chrono::duration with weird ratios +StringRef + Substrings + zero-based substring ------------------------------------------------------------------------------- -ToStringChrono.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -ToStringChrono.tests.cpp:<line number>: PASSED: - REQUIRE( half_minute != femto_second ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( ss.empty() == false ) with expansion: - 1 [30/1]s != 1 fs + false == false -ToStringChrono.tests.cpp:<line number>: PASSED: - REQUIRE( pico_second != atto_second ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( ss.size() == 5 ) with expansion: - 1 ps != 1 as - -------------------------------------------------------------------------------- -Stringifying std::chrono::time_point<system_clock> -------------------------------------------------------------------------------- -ToStringChrono.tests.cpp:<line number> -............................................................................... + 5 == 5 -ToStringChrono.tests.cpp:<line number>: PASSED: - REQUIRE( now != later ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( std::strcmp( ss.c_str(), "hello" ) == 0 ) with expansion: - {iso8601-timestamp} - != - {iso8601-timestamp} - -------------------------------------------------------------------------------- -Tabs and newlines show in output -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... + 0 == 0 -Misc.tests.cpp:<line number>: FAILED: - CHECK( s1 == s2 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( ss == "hello" ) with expansion: - "if ($b == 10) { - $a = 20; - }" - == - "if ($b == 10) { - $a = 20; - } - " + hello == "hello" ------------------------------------------------------------------------------- -Tag alias can be registered against tag patterns - The same tag alias can only be registered once +StringRef + Substrings + c_str() causes copy ------------------------------------------------------------------------------- -TagAlias.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THAT( what, Contains( "[@zzz]" ) ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( isSubstring( ss ) ) with expansion: - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "[@zzz]" + true -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THAT( what, Contains( "file" ) ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( isOwned( ss ) == false ) with expansion: - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "file" + false == false -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THAT( what, Contains( "2" ) ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( rawChars == s.currentData() ) with expansion: - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "2" + "hello world!" == "hello world!" -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THAT( what, Contains( "10" ) ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( ss.c_str() != rawChars ) with expansion: - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "10" - -------------------------------------------------------------------------------- -Tag alias can be registered against tag patterns - Tag aliases must be of the form [@name] -------------------------------------------------------------------------------- -TagAlias.tests.cpp:<line number> -............................................................................... - -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + "hello" != "hello world!" -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( isSubstring( ss ) == false ) +with expansion: + false == false -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( isOwned( ss ) ) +with expansion: + true -TagAlias.tests.cpp:<line number>: PASSED: - CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( ss.currentData() != s.currentData() ) +with expansion: + "hello" != "hello world!" ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float +StringRef + Substrings + non-zero-based substring ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( ss.size() == 6 ) with expansion: - 5 == 5 + 6 == 6 -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( std::strcmp( ss.c_str(), "world!" ) == 0 ) with expansion: - 5 >= 5 + 0 == 0 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float - resizing bigger changes size and capacity +StringRef + Substrings + Pointer values of full refs should match ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 10 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( s.c_str() == s2.c_str() ) with expansion: - 10 == 10 + "hello world!" == "hello world!" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 10 ) +------------------------------------------------------------------------------- +StringRef + Substrings + Pointer values of substring refs should not match +------------------------------------------------------------------------------- +String.tests.cpp:<line number> +............................................................................... + +String.tests.cpp:<line number>: PASSED: + REQUIRE( s.c_str() != ss.c_str() ) with expansion: - 10 >= 10 + "hello world!" != "hello" ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float +StringRef + Comparisons ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( StringRef("hello") == StringRef("hello") ) with expansion: - 5 == 5 + hello == hello -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( StringRef("hello") != StringRef("cello") ) with expansion: - 5 >= 5 + hello != cello ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float - resizing smaller changes size but not capacity +StringRef + from std::string + implicitly constructed ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 0 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( sr == "a standard string" ) with expansion: - 0 == 0 + a standard string == "a standard string" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( sr.size() == stdStr.size() ) with expansion: - 5 >= 5 + 17 == 17 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float - resizing smaller changes size but not capacity - We can use the 'swap trick' to reset the capacity +StringRef + from std::string + explicitly constructed ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() == 0 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( sr == "a standard string" ) with expansion: - 0 == 0 + a standard string == "a standard string" + +String.tests.cpp:<line number>: PASSED: + REQUIRE( sr.size() == stdStr.size() ) +with expansion: + 17 == 17 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float +StringRef + from std::string + assigned ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( sr == "a standard string" ) with expansion: - 5 == 5 + a standard string == "a standard string" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( sr.size() == stdStr.size() ) with expansion: - 5 >= 5 + 17 == 17 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float - reserving bigger changes capacity but not size +StringRef + to std::string + implicitly constructed ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( stdStr == "a stringref" ) with expansion: - 5 == 5 + "a stringref" == "a stringref" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 10 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( stdStr.size() == sr.size() ) with expansion: - 10 >= 10 + 11 == 11 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float +StringRef + to std::string + explicitly constructed ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( stdStr == "a stringref" ) with expansion: - 5 == 5 + "a stringref" == "a stringref" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( stdStr.size() == sr.size() ) with expansion: - 5 >= 5 + 11 == 11 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - float - reserving smaller does not change size or capacity +StringRef + to std::string + assigned ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( stdStr == "a stringref" ) with expansion: - 5 == 5 + "a stringref" == "a stringref" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( stdStr.size() == sr.size() ) with expansion: - 5 >= 5 + 11 == 11 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int +StringRef + Counting utf-8 codepoints ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +String.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( ascii.numberOfCharacters() == ascii.size() ) with expansion: - 5 == 5 + 39 == 39 + +String.tests.cpp:<line number>: PASSED: + REQUIRE( simpleu8.numberOfCharacters() == 30 ) +with expansion: + 30 == 30 -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +String.tests.cpp:<line number>: PASSED: + REQUIRE( emojis.numberOfCharacters() == 9 ) with expansion: - 5 >= 5 + 9 == 9 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int - resizing bigger changes size and capacity +Stringifying std::chrono::duration helpers ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +ToStringChrono.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 10 ) +ToStringChrono.tests.cpp:<line number>: PASSED: + REQUIRE( minute == seconds ) with expansion: - 10 == 10 + 1 m == 60 s -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 10 ) +ToStringChrono.tests.cpp:<line number>: PASSED: + REQUIRE( hour != seconds ) with expansion: - 10 >= 10 - -------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... + 1 h != 60 s -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +ToStringChrono.tests.cpp:<line number>: PASSED: + REQUIRE( micro != milli ) with expansion: - 5 == 5 + 1 us != 1 ms -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +ToStringChrono.tests.cpp:<line number>: PASSED: + REQUIRE( nano != micro ) with expansion: - 5 >= 5 + 1 ns != 1 us ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int - resizing smaller changes size but not capacity +Stringifying std::chrono::duration with weird ratios ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +ToStringChrono.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 0 ) +ToStringChrono.tests.cpp:<line number>: PASSED: + REQUIRE( half_minute != femto_second ) with expansion: - 0 == 0 + 1 [30/1]s != 1 fs -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +ToStringChrono.tests.cpp:<line number>: PASSED: + REQUIRE( pico_second != atto_second ) with expansion: - 5 >= 5 + 1 ps != 1 as ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int - resizing smaller changes size but not capacity - We can use the 'swap trick' to reset the capacity +Stringifying std::chrono::time_point<system_clock> ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +ToStringChrono.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() == 0 ) +ToStringChrono.tests.cpp:<line number>: PASSED: + REQUIRE( now != later ) with expansion: - 0 == 0 + {iso8601-timestamp} + != + {iso8601-timestamp} ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int +Tabs and newlines show in output ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) -with expansion: - 5 == 5 - -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +Misc.tests.cpp:<line number>: FAILED: + CHECK( s1 == s2 ) with expansion: - 5 >= 5 + "if ($b == 10) { + $a = 20; + }" + == + "if ($b == 10) { + $a = 20; + } + " ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int - reserving bigger changes capacity but not size +Tag alias can be registered against tag patterns + The same tag alias can only be registered once ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +Tag.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +Tag.tests.cpp:<line number>: PASSED: + CHECK_THAT( what, Contains( "[@zzz]" ) ) with expansion: - 5 == 5 + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "[@zzz]" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 10 ) +Tag.tests.cpp:<line number>: PASSED: + CHECK_THAT( what, Contains( "file" ) ) with expansion: - 10 >= 10 - -------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int -------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> -............................................................................... + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "file" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) +Tag.tests.cpp:<line number>: PASSED: + CHECK_THAT( what, Contains( "2" ) ) with expansion: - 5 == 5 + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "2" -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) +Tag.tests.cpp:<line number>: PASSED: + CHECK_THAT( what, Contains( "10" ) ) with expansion: - 5 >= 5 + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "10" ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - int - reserving smaller does not change size or capacity +Tag alias can be registered against tag patterns + Tag aliases must be of the form [@name] ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +Tag.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.size() == 5 ) -with expansion: - 5 == 5 +Tag.tests.cpp:<line number>: PASSED: + CHECK_THROWS( registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) ) -Misc.tests.cpp:<line number>: PASSED: - REQUIRE( v.capacity() >= 5 ) -with expansion: - 5 >= 5 +Tag.tests.cpp:<line number>: PASSED: + CHECK_THROWS( registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +Tag.tests.cpp:<line number>: PASSED: + CHECK_THROWS( registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) ) + +Tag.tests.cpp:<line number>: PASSED: + CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) ) ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7143,7 +7574,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float resizing bigger changes size and capacity ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7160,7 +7591,7 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7176,7 +7607,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float resizing smaller changes size but not capacity ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7193,7 +7624,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float resizing smaller changes size but not capacity We can use the 'swap trick' to reset the capacity ------------------------------------------------------------------------------- @@ -7206,7 +7637,7 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7222,7 +7653,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float reserving bigger changes capacity but not size ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7239,7 +7670,7 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7255,7 +7686,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::string +TemplateTest: vectors can be sized and resized - float reserving smaller does not change size or capacity ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7272,7 +7703,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7288,7 +7719,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int resizing bigger changes size and capacity ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7305,7 +7736,7 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7321,7 +7752,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int resizing smaller changes size but not capacity ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7338,7 +7769,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int resizing smaller changes size but not capacity We can use the 'swap trick' to reset the capacity ------------------------------------------------------------------------------- @@ -7351,7 +7782,7 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7367,7 +7798,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int reserving bigger changes capacity but not size ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7384,7 +7815,7 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7400,7 +7831,7 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -TemplateTest: vectors can be sized and resized - std::tuple<int,float> +TemplateTest: vectors can be sized and resized - int reserving smaller does not change size or capacity ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -7417,465 +7848,388 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- -Test case with one argument -------------------------------------------------------------------------------- -VariadicMacros.tests.cpp:<line number> -............................................................................... - -VariadicMacros.tests.cpp:<line number>: PASSED: -with message: - no assertions - -------------------------------------------------------------------------------- -Test enum bit values +TemplateTest: vectors can be sized and resized - std::string ------------------------------------------------------------------------------- -Tricky.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -Tricky.tests.cpp:<line number>: PASSED: - REQUIRE( 0x<hex digits> == bit30and31 ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - 3221225472 (0x<hex digits>) == 3221225472 - -------------------------------------------------------------------------------- -The NO_FAIL macro reports a failure but does not fail the test -------------------------------------------------------------------------------- -Message.tests.cpp:<line number> -............................................................................... - -Message.tests.cpp:<line number>: FAILED - but was ok: - CHECK_NOFAIL( 1 == 2 ) - + 5 == 5 -No assertions in test case 'The NO_FAIL macro reports a failure but does not fail the test' +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) +with expansion: + 5 >= 5 ------------------------------------------------------------------------------- -This test 'should' fail but doesn't +TemplateTest: vectors can be sized and resized - std::string + resizing bigger changes size and capacity ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... Misc.tests.cpp:<line number>: PASSED: -with message: - oops! - -------------------------------------------------------------------------------- -Thrown string literals are translated -------------------------------------------------------------------------------- -Exception.tests.cpp:<line number> -............................................................................... + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 -Exception.tests.cpp:<line number>: FAILED: -due to unexpected exception with message: - For some reason someone is throwing a string literal! +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 ------------------------------------------------------------------------------- -Tracker +TemplateTest: vectors can be sized and resized - std::string ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - true + 5 >= 5 ------------------------------------------------------------------------------- -Tracker - successfully close one section +TemplateTest: vectors can be sized and resized - std::string + resizing smaller changes size but not capacity ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isSuccessfullyCompleted() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) with expansion: - true + 0 == 0 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - false == false + 5 >= 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() ) -with expansion: - true +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string + resizing smaller changes size but not capacity + We can use the 'swap trick' to reset the capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isSuccessfullyCompleted() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() == 0 ) with expansion: - true + 0 == 0 ------------------------------------------------------------------------------- -Tracker +TemplateTest: vectors can be sized and resized - std::string ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - true + 5 >= 5 ------------------------------------------------------------------------------- -Tracker - fail one section +TemplateTest: vectors can be sized and resized - std::string + reserving bigger changes capacity but not size ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isSuccessfullyCompleted() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) with expansion: - false == false + 10 >= 10 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() == false ) -with expansion: - false == false +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::string +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isSuccessfullyCompleted() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - false == false + 5 >= 5 ------------------------------------------------------------------------------- -Tracker - fail one section - re-enter after failed section +TemplateTest: vectors can be sized and resized - std::string + reserving smaller does not change size or capacity ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isOpen() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - false == false + 5 >= 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() ) -with expansion: - true +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isSuccessfullyCompleted() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - true + 5 >= 5 ------------------------------------------------------------------------------- -Tracker +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + resizing bigger changes size and capacity ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 10 ) with expansion: - true + 10 == 10 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) with expansion: - true + 10 >= 10 ------------------------------------------------------------------------------- -Tracker - fail one section +TemplateTest: vectors can be sized and resized - std::tuple<int,float> ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isSuccessfullyCompleted() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - false == false + 5 >= 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() == false ) -with expansion: - false == false +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + resizing smaller changes size but not capacity +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 0 ) with expansion: - true + 0 == 0 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isSuccessfullyCompleted() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - false == false + 5 >= 5 ------------------------------------------------------------------------------- -Tracker - fail one section - re-enter after failed section and find next section +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + resizing smaller changes size but not capacity + We can use the 'swap trick' to reset the capacity ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isOpen() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() == 0 ) with expansion: - true + 0 == 0 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() ) -with expansion: - true +------------------------------------------------------------------------------- +TemplateTest: vectors can be sized and resized - std::tuple<int,float> +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isSuccessfullyCompleted() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - true + 5 >= 5 ------------------------------------------------------------------------------- -Tracker +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + reserving bigger changes capacity but not size ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 10 ) with expansion: - true + 10 >= 10 ------------------------------------------------------------------------------- -Tracker - successfully close one section, then find another +TemplateTest: vectors can be sized and resized - std::tuple<int,float> ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isOpen() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - false == false + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - false == false + 5 >= 5 ------------------------------------------------------------------------------- -Tracker - successfully close one section, then find another - Re-enter - skips S1 and enters S2 +TemplateTest: vectors can be sized and resized - std::tuple<int,float> + reserving smaller does not change size or capacity ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isOpen() ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.size() == 5 ) with expansion: - true + 5 == 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isOpen() == false ) +Misc.tests.cpp:<line number>: PASSED: + REQUIRE( v.capacity() >= 5 ) with expansion: - false == false + 5 >= 5 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isOpen() ) -with expansion: - true +------------------------------------------------------------------------------- +Test case with one argument +------------------------------------------------------------------------------- +VariadicMacros.tests.cpp:<line number> +............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() == false ) -with expansion: - false == false +VariadicMacros.tests.cpp:<line number>: PASSED: +with message: + no assertions ------------------------------------------------------------------------------- -Tracker - successfully close one section, then find another - Re-enter - skips S1 and enters S2 - Successfully close S2 +Test enum bit values ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Tricky.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() ) +Tricky.tests.cpp:<line number>: PASSED: + REQUIRE( 0x<hex digits> == bit30and31 ) with expansion: - true + 3221225472 (0x<hex digits>) == 3221225472 -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isSuccessfullyCompleted() ) -with expansion: - true +------------------------------------------------------------------------------- +The NO_FAIL macro reports a failure but does not fail the test +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isComplete() == false ) -with expansion: - false == false +Message.tests.cpp:<line number>: FAILED - but was ok: + CHECK_NOFAIL( 1 == 2 ) -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isSuccessfullyCompleted() ) -with expansion: - true + +No assertions in test case 'The NO_FAIL macro reports a failure but does not fail the test' ------------------------------------------------------------------------------- -Tracker +This test 'should' fail but doesn't ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isOpen() ) -with expansion: - true +Misc.tests.cpp:<line number>: PASSED: +with message: + oops! ------------------------------------------------------------------------------- -Tracker - successfully close one section, then find another +Thrown string literals are translated ------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> +Exception.tests.cpp:<line number> ............................................................................... -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isOpen() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() == false ) -with expansion: - false == false +Exception.tests.cpp:<line number>: FAILED: +due to unexpected exception with message: + For some reason someone is throwing a string literal! ------------------------------------------------------------------------------- Tracker - successfully close one section, then find another - Re-enter - skips S1 and enters S2 ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isOpen() ) + REQUIRE( testCase.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isOpen() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isOpen() ) + REQUIRE( s1.isOpen() ) with expansion: true -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() == false ) -with expansion: - false == false - ------------------------------------------------------------------------------- Tracker - successfully close one section, then find another - Re-enter - skips S1 and enters S2 - fail S2 + successfully close one section ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( ctx.completedCycle() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isComplete() ) + REQUIRE( s1.isSuccessfullyCompleted() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isSuccessfullyCompleted() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isSuccessfullyCompleted() == false ) + REQUIRE( testCase.isComplete() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase3.isOpen() ) + REQUIRE( ctx.completedCycle() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1c.isOpen() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2c.isOpen() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase3.isSuccessfullyCompleted() ) + REQUIRE( testCase.isSuccessfullyCompleted() ) with expansion: true @@ -7897,214 +8251,180 @@ with expansion: ------------------------------------------------------------------------------- Tracker - open a nested section + fail one section ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isOpen() ) + REQUIRE( s1.isComplete() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isComplete() ) + REQUIRE( s1.isSuccessfullyCompleted() == false ) with expansion: - true + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( testCase.isComplete() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() ) + REQUIRE( ctx.completedCycle() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() == false ) + REQUIRE( testCase.isSuccessfullyCompleted() == false ) with expansion: false == false -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() ) -with expansion: - true - ------------------------------------------------------------------------------- Tracker + fail one section + re-enter after failed section ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isOpen() ) + REQUIRE( testCase2.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isOpen() ) + REQUIRE( s1b.isOpen() == false ) with expansion: - true - -------------------------------------------------------------------------------- -Tracker - start a generator -------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> -............................................................................... + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.isOpen() ) + REQUIRE( ctx.completedCycle() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.index() == 0 ) -with expansion: - 0 == 0 - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.isComplete() == false ) + REQUIRE( testCase.isComplete() ) with expansion: - false == false + true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( testCase.isSuccessfullyCompleted() ) with expansion: - false == false + true ------------------------------------------------------------------------------- Tracker - start a generator - close outer section ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( testCase.isOpen() ) with expansion: - false == false + true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isSuccessfullyCompleted() == false ) + REQUIRE( s1.isOpen() ) with expansion: - false == false + true ------------------------------------------------------------------------------- Tracker - start a generator - close outer section - Re-enter for second generation + fail one section ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.isOpen() ) + REQUIRE( s1.isComplete() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.index() == 1 ) -with expansion: - 1 == 1 - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( s1.isSuccessfullyCompleted() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isComplete() ) + REQUIRE( testCase.isComplete() == false ) with expansion: - true + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.isComplete() ) + REQUIRE( ctx.completedCycle() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isComplete() ) + REQUIRE( testCase.isSuccessfullyCompleted() == false ) with expansion: - true + false == false ------------------------------------------------------------------------------- Tracker + fail one section + re-enter after failed section and find next section ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isOpen() ) + REQUIRE( testCase2.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isOpen() ) + REQUIRE( s1b.isOpen() == false ) with expansion: - true - -------------------------------------------------------------------------------- -Tracker - start a generator -------------------------------------------------------------------------------- -PartTracker.tests.cpp:<line number> -............................................................................... + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.isOpen() ) + REQUIRE( s2.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.index() == 0 ) + REQUIRE( ctx.completedCycle() ) with expansion: - 0 == 0 + true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.isComplete() == false ) + REQUIRE( testCase.isComplete() ) with expansion: - false == false + true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( testCase.isSuccessfullyCompleted() ) with expansion: - false == false + true ------------------------------------------------------------------------------- Tracker - start a generator - Start a new inner section ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isOpen() ) + REQUIRE( testCase.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isComplete() ) + REQUIRE( s1.isOpen() ) with expansion: true +------------------------------------------------------------------------------- +Tracker + successfully close one section, then find another +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( s2.isOpen() == false ) with expansion: false == false @@ -8115,9 +8435,8 @@ with expansion: ------------------------------------------------------------------------------- Tracker - start a generator - Start a new inner section - Re-enter for second generation + successfully close one section, then find another + Re-enter - skips S1 and enters S2 ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... @@ -8128,42 +8447,46 @@ with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isOpen() ) + REQUIRE( s1b.isOpen() == false ) with expansion: - true + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.isOpen() ) + REQUIRE( s2b.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.index() == 1 ) + REQUIRE( ctx.completedCycle() == false ) with expansion: - 1 == 1 + false == false -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isOpen() ) -with expansion: - true +------------------------------------------------------------------------------- +Tracker + successfully close one section, then find another + Re-enter - skips S1 and enters S2 + Successfully close S2 +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isComplete() ) + REQUIRE( ctx.completedCycle() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.isComplete() ) + REQUIRE( s2b.isSuccessfullyCompleted() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isComplete() ) + REQUIRE( testCase2.isComplete() == false ) with expansion: - true + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isComplete() ) + REQUIRE( testCase2.isSuccessfullyCompleted() ) with expansion: true @@ -8185,155 +8508,148 @@ with expansion: ------------------------------------------------------------------------------- Tracker - start a generator + successfully close one section, then find another ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.index() == 0 ) -with expansion: - 0 == 0 - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1.isComplete() == false ) + REQUIRE( s2.isOpen() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( testCase.isComplete() == false ) with expansion: false == false ------------------------------------------------------------------------------- Tracker - start a generator - Fail an inner section + successfully close one section, then find another + Re-enter - skips S1 and enters S2 ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isComplete() ) + REQUIRE( testCase2.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2.isSuccessfullyCompleted() == false ) + REQUIRE( s1b.isOpen() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1.isComplete() == false ) + REQUIRE( s2b.isOpen() ) with expansion: - false == false + true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase.isComplete() == false ) + REQUIRE( ctx.completedCycle() == false ) with expansion: false == false ------------------------------------------------------------------------------- Tracker - start a generator - Fail an inner section - Re-enter for second generation + successfully close one section, then find another + Re-enter - skips S1 and enters S2 + fail S2 ------------------------------------------------------------------------------- PartTracker.tests.cpp:<line number> ............................................................................... PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isOpen() ) + REQUIRE( ctx.completedCycle() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.isOpen() ) + REQUIRE( s2b.isComplete() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.index() == 0 ) + REQUIRE( s2b.isSuccessfullyCompleted() == false ) with expansion: - 0 == 0 + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2b.isOpen() == false ) + REQUIRE( testCase2.isSuccessfullyCompleted() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1b.isComplete() == false ) + REQUIRE( testCase3.isOpen() ) with expansion: - false == false + true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1b.isComplete() == false ) + REQUIRE( s1c.isOpen() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase2.isComplete() == false ) + REQUIRE( s2c.isOpen() == false ) with expansion: false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase3.isOpen() ) + REQUIRE( testCase3.isSuccessfullyCompleted() ) with expansion: true +------------------------------------------------------------------------------- +Tracker +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1c.isOpen() ) + REQUIRE( testCase.isOpen() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1c.isOpen() ) + REQUIRE( s1.isOpen() ) with expansion: true +------------------------------------------------------------------------------- +Tracker + open a nested section +------------------------------------------------------------------------------- +PartTracker.tests.cpp:<line number> +............................................................................... + PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1c.index() == 1 ) + REQUIRE( s2.isOpen() ) with expansion: - 1 == 1 + true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2c.isOpen() ) + REQUIRE( s2.isComplete() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s2c.isComplete() ) + REQUIRE( s1.isComplete() == false ) with expansion: - true + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( g1c.isComplete() ) + REQUIRE( s1.isComplete() ) with expansion: true PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( s1c.isComplete() ) + REQUIRE( testCase.isComplete() == false ) with expansion: - true + false == false PartTracker.tests.cpp:<line number>: PASSED: - REQUIRE( testCase3.isComplete() ) + REQUIRE( testCase.isComplete() ) with expansion: true @@ -9320,6 +9636,16 @@ Message.tests.cpp:<line number>: FAILED: explicitly with message: Previous info should not be seen +------------------------------------------------------------------------------- +just failure after unscoped info +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: +explicitly with message: + previous unscoped info SHOULD not be seen + ------------------------------------------------------------------------------- just info ------------------------------------------------------------------------------- @@ -9329,6 +9655,15 @@ Message.tests.cpp:<line number> No assertions in test case 'just info' +------------------------------------------------------------------------------- +just unscoped info +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + + +No assertions in test case 'just unscoped info' + ------------------------------------------------------------------------------- long long ------------------------------------------------------------------------------- @@ -9524,6 +9859,25 @@ with expansion: with message: Testing if fib[7] (21) is even +------------------------------------------------------------------------------- +mix info, unscoped info and warning +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: warning: + info + unscoped info + and warn may mix + +Message.tests.cpp:<line number>: warning: + info + unscoped info + they are not cleared after warnings + + +No assertions in test case 'mix info, unscoped info and warning' + ------------------------------------------------------------------------------- more nested SECTION tests doesn't equal @@ -9623,6 +9977,29 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: +------------------------------------------------------------------------------- +not prints unscoped info from previous failures +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: PASSED: + REQUIRE( true ) +with message: + this MAY be seen only for the FIRST assertion IF info is printed for passing + assertions + +Message.tests.cpp:<line number>: PASSED: + REQUIRE( true ) +with message: + this MAY be seen only for the SECOND assertion IF info is printed for passing + assertions + +Message.tests.cpp:<line number>: FAILED: + REQUIRE( false ) +with message: + this SHOULD be seen + ------------------------------------------------------------------------------- null strings ------------------------------------------------------------------------------- @@ -9674,6 +10051,51 @@ Tricky.tests.cpp:<line number>: PASSED: with expansion: 0 == 0 +------------------------------------------------------------------------------- +print unscoped info if passing unscoped info is printed +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: PASSED: + REQUIRE( true ) +with message: + this MAY be seen IF info is printed for passing assertions + +------------------------------------------------------------------------------- +prints unscoped info on failure +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: + REQUIRE( false ) +with messages: + this SHOULD be seen + this SHOULD also be seen + +------------------------------------------------------------------------------- +prints unscoped info only for the first assertion +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: + CHECK( false ) +with message: + this SHOULD be seen only ONCE + +Message.tests.cpp:<line number>: PASSED: + CHECK( true ) + +Message.tests.cpp:<line number>: PASSED: + CHECK( true ) +with message: + this MAY also be seen only ONCE IF info is printed for passing assertions + +Message.tests.cpp:<line number>: PASSED: + CHECK( true ) + ------------------------------------------------------------------------------- random SECTION tests doesn't equal @@ -9854,6 +10276,39 @@ with messages: hi i := 7 +------------------------------------------------------------------------------- +shortened hide tags are split apart +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( testcase.tags, Catch::VectorContains(std::string("magic-tag")) && Catch::VectorContains(std::string(".")) ) +with expansion: + { ".", "magic-tag" } ( Contains: "magic-tag" and Contains: "." ) + +------------------------------------------------------------------------------- +stacks unscoped info in loops +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: FAILED: + CHECK( false ) +with messages: + Count 1 to 3... + 1 + 2 + 3 + +Message.tests.cpp:<line number>: FAILED: + CHECK( false ) +with messages: + Count 4 to 6... + 4 + 5 + 6 + ------------------------------------------------------------------------------- std::map is convertible string empty @@ -10152,6 +10607,50 @@ Generators.tests.cpp:<line number>: PASSED: with expansion: 4 == 4 +------------------------------------------------------------------------------- +tables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) ) +with expansion: + 5 == 5 + +------------------------------------------------------------------------------- +tables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) ) +with expansion: + 6 == 6 + +------------------------------------------------------------------------------- +tables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) ) +with expansion: + 5 == 5 + +------------------------------------------------------------------------------- +tables +------------------------------------------------------------------------------- +Generators.tests.cpp:<line number> +............................................................................... + +Generators.tests.cpp:<line number>: PASSED: + REQUIRE( strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) ) +with expansion: + 6 == 6 + ------------------------------------------------------------------------------- thrown std::strings are translated ------------------------------------------------------------------------------- @@ -10629,6 +11128,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 243 | 170 passed | 69 failed | 4 failed as expected -assertions: 1339 | 1189 passed | 129 failed | 21 failed as expected +test cases: 258 | 176 passed | 78 failed | 4 failed as expected +assertions: 1436 | 1276 passed | 139 failed | 21 failed as expected diff --git a/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt index 36ca1bde5..bfa667506 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/console.swa4.approved.txt @@ -1,3 +1,4 @@ +Filters: ~[!nonportable]~[!benchmark]~[approvals] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <exe-name> is a <version> host application. @@ -133,6 +134,44 @@ Compilation.tests.cpp:<line number>: PASSED: with expansion: [1403 helper] == [1403 helper] +------------------------------------------------------------------------------- +#1455 - INFO and WARN can start with a linebreak +------------------------------------------------------------------------------- +Message.tests.cpp:<line number> +............................................................................... + +Message.tests.cpp:<line number>: warning: + +This info message starts with a linebreak + +This warning message starts with a linebreak + + +No assertions in test case '#1455 - INFO and WARN can start with a linebreak' + +This would not be caught previously +Nor would this +------------------------------------------------------------------------------- +#1514: stderr/stdout is not captured in tests aborted by an exception +------------------------------------------------------------------------------- +Tricky.tests.cpp:<line number> +............................................................................... + +Tricky.tests.cpp:<line number>: FAILED: +explicitly with message: + 1514 + +------------------------------------------------------------------------------- +#1548 +------------------------------------------------------------------------------- +Compilation.tests.cpp:<line number> +............................................................................... + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( std::is_same<TypeList<int>, TypeList<int>>::value ) +with expansion: + true + ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions outside assertions @@ -312,17 +351,7 @@ Condition.tests.cpp:<line number>: FAILED: Condition.tests.cpp:<line number>: FAILED: CHECK( true != true ) -Condition.tests.cpp:<line number>: FAILED: - CHECK( !true ) -with expansion: - false - -Condition.tests.cpp:<line number>: FAILED: - CHECK_FALSE( true ) -with expansion: - !true - =============================================================================== -test cases: 15 | 12 passed | 1 failed | 2 failed as expected -assertions: 39 | 32 passed | 4 failed | 3 failed as expected +test cases: 18 | 13 passed | 3 failed | 2 failed as expected +assertions: 40 | 33 passed | 4 failed | 3 failed as expected diff --git a/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt index beb8b459d..43c78d7ea 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="113" tests="1340" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="123" tests="1437" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <properties> + <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/> + <property name="random-seed" value="1"/> + </properties> <testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/> <testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/> <testcase classname="<exe-name>.global" name="#1027" time="{duration}"/> @@ -10,6 +14,20 @@ <testcase classname="<exe-name>.global" name="#1238" time="{duration}"/> <testcase classname="<exe-name>.(Fixture_1245<int, int>)" name="#1245" time="{duration}"/> <testcase classname="<exe-name>.global" name="#1403" time="{duration}"/> + <testcase classname="<exe-name>.global" name="#1455 - INFO and WARN can start with a linebreak" time="{duration}"/> + <testcase classname="<exe-name>.global" name="#1514: stderr/stdout is not captured in tests aborted by an exception" time="{duration}"> + <failure type="FAIL"> +1514 +Tricky.tests.cpp:<line number> + </failure> + <system-out> +This would not be caught previously + </system-out> + <system-err> +Nor would this + </system-err> + </testcase> + <testcase classname="<exe-name>.global" name="#1548" time="{duration}"/> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}"> <error type="TEST_CASE"> expected exception @@ -70,37 +88,37 @@ Condition.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/negation" time="{duration}"/> <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/double negation" time="{duration}"/> <testcase classname="<exe-name>.global" name="(unimplemented) static bools can be evaluated/direct" time="{duration}"/> - <testcase classname="<exe-name>.global" name="10x10 ints" time="{duration}"/> + <testcase classname="<exe-name>.global" name="3x3x3 ints" time="{duration}"/> <testcase classname="<exe-name>.TestClass" name="A METHOD_AS_TEST_CASE based test run that fails" time="{duration}"> <failure message=""hello" == "world"" type="REQUIRE"> Class.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.TestClass" name="A METHOD_AS_TEST_CASE based test run that succeeds" time="{duration}"/> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0" time="{duration}"> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float>" time="{duration}"> <failure message="0 == 1" type="REQUIRE"> Class.tests.cpp:<line number> </failure> </testcase> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1" time="{duration}"> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int>" time="{duration}"> <failure message="0 == 1" type="REQUIRE"> Class.tests.cpp:<line number> </failure> </testcase> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2" time="{duration}"> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float>" time="{duration}"> <failure message="0 == 1" type="REQUIRE"> Class.tests.cpp:<line number> </failure> </testcase> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3" time="{duration}"> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int>" time="{duration}"> <failure message="0 == 1" type="REQUIRE"> Class.tests.cpp:<line number> </failure> </testcase> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 0" time="{duration}"/> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 1" time="{duration}"/> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 2" time="{duration}"/> - <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 3" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float>" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>" time="{duration}"/> + <testcase classname="<exe-name>.Template_Fixture_2" name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>" time="{duration}"/> <testcase classname="<exe-name>.Template_Fixture" name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" time="{duration}"> <failure message="1.0 == 2" type="REQUIRE"> Class.tests.cpp:<line number> @@ -125,10 +143,10 @@ Class.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.Fixture" name="A TEST_CASE_METHOD based test run that succeeds" time="{duration}"/> - <testcase classname="<exe-name>.global" name="A Template product test case - 0" time="{duration}"/> - <testcase classname="<exe-name>.global" name="A Template product test case - 1" time="{duration}"/> - <testcase classname="<exe-name>.global" name="A Template product test case - 2" time="{duration}"/> - <testcase classname="<exe-name>.global" name="A Template product test case - 3" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - Foo<float>" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - Foo<int>" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - std::vector<float>" time="{duration}"/> + <testcase classname="<exe-name>.global" name="A Template product test case - std::vector<int>" time="{duration}"/> <testcase classname="<exe-name>.global" name="A comparison that uses literals instead of the normal constructor" time="{duration}"/> <testcase classname="<exe-name>.global" name="A couple of nested sections followed by a failure" time="{duration}"> <failure type="FAIL"> @@ -339,14 +357,37 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Floating point matchers: float/ULPs" time="{duration}"/> <testcase classname="<exe-name>.global" name="Floating point matchers: float/Composed" time="{duration}"/> <testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators/one" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators/two" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators impl/range" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators impl/fixed values" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators impl/combined" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators impl/values" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators impl/values2" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Generators impl/type erasure" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Throws if there are no matching values" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Shortening a range" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Same type" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Different type" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Transforming elements/Different deduced type" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Repeating a generator" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Number of elements in source is divisible by chunk size" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Number of elements in source is not divisible by chunk size" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- adapters/Chunking a generator into sized pieces/Throws on too small generators" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- simple/one" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators -- simple/two" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Single value" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Preset values" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Generator combinator" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Explicitly typed generator sequence" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Filter generator" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take less" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Take generator/Take more" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Map with explicit return type" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Map with deduced return type" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Repeat/Singular repeat" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Repeat/Actual repeat" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive auto step/Integer" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative auto step/Integer" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Exact" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly over end" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly under end" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Exact" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly over end" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly under end" time="{duration}"/> <testcase classname="<exe-name>.global" name="Greater-than inequalities with different epsilons" time="{duration}"/> <testcase classname="<exe-name>.global" name="INFO and WARN do not abort tests" time="{duration}"/> <testcase classname="<exe-name>.global" name="INFO gets logged on failure" time="{duration}"> @@ -415,6 +456,7 @@ Matchers.tests.cpp:<line number> Exception.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Nested generators and captured variables" time="{duration}"/> <testcase classname="<exe-name>.global" name="Nice descriptive name" time="{duration}"/> <testcase classname="<exe-name>.global" name="Non-std exceptions can be translated" time="{duration}"> <error type="TEST_CASE"> @@ -554,9 +596,9 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/yes" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/no" time="{duration}"/> <testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/error" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Product with differing arities - 0" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Product with differing arities - 1" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Product with differing arities - 2" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double, float>" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double>" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int>" time="{duration}"/> <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}"> <failure message="Hey, its truthy!" type="CHECK"> Decomposition.tests.cpp:<line number> @@ -691,13 +733,6 @@ 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/Successfully close S2" time="{duration}"/> <testcase classname="<exe-name>.global" name="Tracker/successfully close one section, then find another/Re-enter - skips S1 and enters S2/fail S2" time="{duration}"/> <testcase classname="<exe-name>.global" name="Tracker/open a nested section" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Tracker/start a generator" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Tracker/start a generator/close outer section" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Tracker/start a generator/close outer section/Re-enter for second generation" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Tracker/start a generator/Start a new inner section" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Tracker/start a generator/Start a new inner section/Re-enter for second generation" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Tracker/start a generator/Fail an inner section" time="{duration}"/> - <testcase classname="<exe-name>.global" name="Tracker/start a generator/Fail an inner section/Re-enter for second generation" time="{duration}"/> <testcase classname="<exe-name>.global" name="Unexpected exceptions can be translated" time="{duration}"> <error type="TEST_CASE"> 3.14 @@ -835,6 +870,12 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="just failure" time="{duration}"> <failure type="FAIL"> Previous info should not be seen +Message.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="just failure after unscoped info" time="{duration}"> + <failure type="FAIL"> +previous unscoped info SHOULD not be seen Message.tests.cpp:<line number> </failure> </testcase> @@ -883,6 +924,7 @@ Testing if fib[7] (21) is even Misc.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="mix info, unscoped info and warning" time="{duration}"/> <testcase classname="<exe-name>.global" name="more nested SECTION tests/equal/doesn't equal" time="{duration}"> <failure message="1 == 2" type="REQUIRE"> Misc.tests.cpp:<line number> @@ -895,10 +937,30 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="non streamable - with conv. op" time="{duration}"/> <testcase classname="<exe-name>.global" name="non-copyable objects" time="{duration}"/> <testcase classname="<exe-name>.global" name="not allowed" time="{duration}"/> + <testcase classname="<exe-name>.global" name="not prints unscoped info from previous failures" time="{duration}"> + <failure message="false" type="REQUIRE"> +this SHOULD be seen +Message.tests.cpp:<line number> + </failure> + </testcase> <testcase classname="<exe-name>.global" name="null strings" time="{duration}"/> <testcase classname="<exe-name>.global" name="null_ptr" time="{duration}"/> <testcase classname="<exe-name>.global" name="pair<pair<int,const char *,pair<std::string,int> > -> toString" time="{duration}"/> <testcase classname="<exe-name>.global" name="pointer to class" time="{duration}"/> + <testcase classname="<exe-name>.global" name="print unscoped info if passing unscoped info is printed" time="{duration}"/> + <testcase classname="<exe-name>.global" name="prints unscoped info on failure" time="{duration}"> + <failure message="false" type="REQUIRE"> +this SHOULD be seen +this SHOULD also be seen +Message.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="prints unscoped info only for the first assertion" time="{duration}"> + <failure message="false" type="CHECK"> +this SHOULD be seen only ONCE +Message.tests.cpp:<line number> + </failure> + </testcase> <testcase classname="<exe-name>.global" name="random SECTION tests/doesn't equal" time="{duration}"/> <testcase classname="<exe-name>.global" name="random SECTION tests/not equal" time="{duration}"/> <testcase classname="<exe-name>.global" name="replaceInPlace/replace single char" time="{duration}"/> @@ -918,6 +980,23 @@ Misc.tests.cpp:<line number> <failure message="false" type="REQUIRE"> hi i := 7 +Message.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="shortened hide tags are split apart" time="{duration}"/> + <testcase classname="<exe-name>.global" name="stacks unscoped info in loops" time="{duration}"> + <failure message="false" type="CHECK"> +Count 1 to 3... +1 +2 +3 +Message.tests.cpp:<line number> + </failure> + <failure message="false" type="CHECK"> +Count 4 to 6... +4 +5 +6 Message.tests.cpp:<line number> </failure> </testcase> @@ -945,6 +1024,7 @@ Tricky.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="stringify( vectors<has_maker_and_operator> )" time="{duration}"/> <testcase classname="<exe-name>.global" name="stringify( vectors<has_operator> )" time="{duration}"/> <testcase classname="<exe-name>.global" name="strlen3" time="{duration}"/> + <testcase classname="<exe-name>.global" name="tables" time="{duration}"/> <testcase classname="<exe-name>.global" name="thrown std::strings are translated" time="{duration}"> <error type="TEST_CASE"> Why would you throw a std::string? @@ -979,11 +1059,13 @@ Exception.tests.cpp:<line number> <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}"/> <testcase classname="<exe-name>.global" name="xmlentitycheck/encoded chars: these should all be encoded: &&&"""<<<&"<<&"" time="{duration}"/> <system-out> +This would not be caught previously A string sent directly to stdout Message from section one Message from section two </system-out> <system-err> +Nor would this A string sent directly to stderr A string sent to stderr via clog </system-err> diff --git a/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt b/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt index b2d0c61e2..b526a5f7f 100644 --- a/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/packages/Catch2/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<Catch name="<exe-name>"> +<Catch name="<exe-name>" filters="~[!nonportable]~[!benchmark]~[approvals]"> <Randomness seed="1"/> <Group name="<exe-name>"> <TestCase name="# A test name that starts with a #" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -142,6 +142,41 @@ </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="#1455 - INFO and WARN can start with a linebreak" tags="[.][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + +This info message starts with a linebreak + </Info> + <Warning> + +This warning message starts with a linebreak + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="#1514: stderr/stdout is not captured in tests aborted by an exception" tags="[.][output-capture][regression]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Failure filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" > + 1514 + </Failure> + <OverallResult success="false"> + <StdOut> +This would not be caught previously + </StdOut> + <StdErr> +Nor would this + </StdErr> + </OverallResult> + </TestCase> + <TestCase name="#1548" tags="[compilation]" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + std::is_same<TypeList<int>, TypeList<int>>::value + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > <Section name="outside assertions" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > <Info> @@ -522,29 +557,29 @@ </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="10x10 ints" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <TestCase name="3x3x3 ints" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> x < y </Original> <Expanded> - 1 < 101 + 1 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 1 < 102 + 4 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 1 < 103 + 1 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -552,23 +587,23 @@ x < y </Original> <Expanded> - 1 < 104 + 1 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 1 < 105 + 4 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 1 < 106 + 1 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -576,23 +611,23 @@ x < y </Original> <Expanded> - 1 < 107 + 1 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 1 < 108 + 4 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 1 < 109 + 1 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -600,23 +635,23 @@ x < y </Original> <Expanded> - 1 < 110 + 1 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 2 < 101 + 5 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 2 < 102 + 1 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -624,23 +659,23 @@ x < y </Original> <Expanded> - 2 < 103 + 1 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 2 < 104 + 5 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 2 < 105 + 1 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -648,23 +683,23 @@ x < y </Original> <Expanded> - 2 < 106 + 1 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 2 < 107 + 5 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 2 < 108 + 1 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -672,23 +707,23 @@ x < y </Original> <Expanded> - 2 < 109 + 1 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 2 < 110 + 6 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 3 < 101 + 1 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -696,23 +731,23 @@ x < y </Original> <Expanded> - 3 < 102 + 1 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 3 < 103 + 6 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 3 < 104 + 1 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -720,23 +755,23 @@ x < y </Original> <Expanded> - 3 < 105 + 1 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 3 < 106 + 6 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 3 < 107 + 1 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -744,23 +779,23 @@ x < y </Original> <Expanded> - 3 < 108 + 2 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 3 < 109 + 4 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 3 < 110 + 2 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -768,23 +803,23 @@ x < y </Original> <Expanded> - 4 < 101 + 2 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 4 < 102 + 4 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 4 < 103 + 2 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -792,23 +827,23 @@ x < y </Original> <Expanded> - 4 < 104 + 2 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 4 < 105 + 4 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 4 < 106 + 2 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -816,23 +851,23 @@ x < y </Original> <Expanded> - 4 < 107 + 2 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 4 < 108 + 5 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 4 < 109 + 2 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -840,23 +875,23 @@ x < y </Original> <Expanded> - 4 < 110 + 2 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 5 < 101 + 5 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 5 < 102 + 2 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -864,23 +899,23 @@ x < y </Original> <Expanded> - 5 < 103 + 2 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 5 < 104 + 5 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 5 < 105 + 2 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -888,23 +923,23 @@ x < y </Original> <Expanded> - 5 < 106 + 2 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 5 < 107 + 6 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 5 < 108 + 2 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -912,23 +947,23 @@ x < y </Original> <Expanded> - 5 < 109 + 2 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 5 < 110 + 6 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 6 < 101 + 2 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -936,23 +971,23 @@ x < y </Original> <Expanded> - 6 < 102 + 2 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 6 < 103 + 6 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 6 < 104 + 2 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -960,23 +995,23 @@ x < y </Original> <Expanded> - 6 < 105 + 3 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 6 < 106 + 4 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 6 < 107 + 3 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -984,23 +1019,23 @@ x < y </Original> <Expanded> - 6 < 108 + 3 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 6 < 109 + 4 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 6 < 110 + 3 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -1008,23 +1043,23 @@ x < y </Original> <Expanded> - 7 < 101 + 3 < 4 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 7 < 102 + 4 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 7 < 103 + 3 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -1032,23 +1067,23 @@ x < y </Original> <Expanded> - 7 < 104 + 3 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 7 < 105 + 5 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 7 < 106 + 3 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -1056,23 +1091,23 @@ x < y </Original> <Expanded> - 7 < 107 + 3 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 7 < 108 + 5 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 7 < 109 + 3 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -1080,23 +1115,23 @@ x < y </Original> <Expanded> - 7 < 110 + 3 < 5 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 8 < 101 + 5 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 8 < 102 + 3 < 9 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -1104,23 +1139,23 @@ x < y </Original> <Expanded> - 8 < 103 + 3 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 8 < 104 + 6 < 7 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 8 < 105 + 3 < 7 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -1128,23 +1163,23 @@ x < y </Original> <Expanded> - 8 < 106 + 3 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 8 < 107 + 6 < 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 8 < 108 + 3 < 8 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > @@ -1152,357 +1187,205 @@ x < y </Original> <Expanded> - 8 < 109 + 3 < 6 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + y < z </Original> <Expanded> - 8 < 110 + 6 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + x < z </Original> <Expanded> - 9 < 101 + 3 < 9 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A METHOD_AS_TEST_CASE based test run that fails" tags="[.][class][failing]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + s == "world" </Original> <Expanded> - 9 < 102 + "hello" == "world" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds" tags="[class]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + s == "hello" </Original> <Expanded> - 9 < 103 + "hello" == "hello" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float>" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 1 </Original> <Expanded> - 9 < 104 + 0 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int>" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 1 </Original> <Expanded> - 9 < 105 + 0 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float>" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 1 </Original> <Expanded> - 9 < 106 + 0 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int>" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 1 </Original> <Expanded> - 9 < 107 + 0 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 0 </Original> <Expanded> - 9 < 108 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 0 </Original> <Expanded> - 9 < 109 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 0 </Original> <Expanded> - 9 < 110 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture_2<TestType>::m_a.size() == 0 </Original> <Expanded> - 10 < 101 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture<TestType>::m_a == 2 </Original> <Expanded> - 10 < 102 + 1.0 == 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture<TestType>::m_a == 2 </Original> <Expanded> - 10 < 103 + 1.0f == 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture<TestType>::m_a == 2 </Original> <Expanded> - 10 < 104 + 1 == 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture<TestType>::m_a == 1 </Original> <Expanded> - 10 < 105 + 1.0 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture<TestType>::m_a == 1 </Original> <Expanded> - 10 < 106 + 1.0f == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> - x < y + Template_Fixture<TestType>::m_a == 1 </Original> <Expanded> - 10 < 107 + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - x < y - </Original> - <Expanded> - 10 < 108 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - x < y - </Original> - <Expanded> - 10 < 109 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - x < y - </Original> - <Expanded> - 10 < 110 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A METHOD_AS_TEST_CASE based test run that fails" tags="[.][class][failing]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - s == "world" - </Original> - <Expanded> - "hello" == "world" - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds" tags="[class]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - s == "hello" - </Original> - <Expanded> - "hello" == "hello" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 - </Original> - <Expanded> - 0 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 - </Original> - <Expanded> - 0 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 - </Original> - <Expanded> - 0 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3" tags="[.][class][failing][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 - </Original> - <Expanded> - 0 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 0" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 1" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 2" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - 3" tags="[class][product][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture<TestType>::m_a == 2 - </Original> - <Expanded> - 1.0 == 2 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture<TestType>::m_a == 2 - </Original> - <Expanded> - 1.0f == 2 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" tags="[.][class][failing][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture<TestType>::m_a == 2 - </Original> - <Expanded> - 1 == 2 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture<TestType>::m_a == 1 - </Original> - <Expanded> - 1.0 == 1 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture<TestType>::m_a == 1 - </Original> - <Expanded> - 1.0f == 1 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" tags="[class][template]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture<TestType>::m_a == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEST_CASE_METHOD based test run that fails" tags="[.][class][failing]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEST_CASE_METHOD based test run that fails" tags="[.][class][failing]" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Class.tests.cpp" > <Original> m_a == 2 </Original> @@ -1523,7 +1406,7 @@ </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="A Template product test case - 0" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="A Template product test case - Foo<float>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> x.size() == 0 @@ -1534,7 +1417,7 @@ </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="A Template product test case - 1" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="A Template product test case - Foo<int>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> x.size() == 0 @@ -1545,7 +1428,7 @@ </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="A Template product test case - 2" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="A Template product test case - std::vector<float>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> x.size() == 0 @@ -1556,7 +1439,7 @@ </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="A Template product test case - 3" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="A Template product test case - std::vector<int>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> x.size() == 0 @@ -3016,12 +2899,12 @@ <TestCase name="Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified" tags="[exception][toString]" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - ::Catch::Detail::stringify(WhatException{}) == "This exception has overriden what() method" + ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" </Original> <Expanded> - "This exception has overriden what() method" + "This exception has overridden what() method" == -"This exception has overriden what() method" +"This exception has overridden what() method" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > @@ -3044,7 +2927,7 @@ </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Exception matchers that fail" tags="[!throws][.][.failing][exceptions][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <TestCase name="Exception matchers that fail" tags="[!throws][.][exceptions][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > <Section name="No exception" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="false" type="CHECK_THROWS_MATCHES" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> @@ -3690,381 +3573,1806 @@ </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="Generators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "a" - </Info> - <Info> - j := 8 - </Info> + <TestCase name="Generators -- adapters" tags="[generators][generic]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "a" - </Info> - <Info> - j := 9 - </Info> + <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "a" - </Info> - <Info> - j := 10 - </Info> + <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "a" - </Info> - <Info> - j := 2 - </Info> + <Section name="Filtering by predicate" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Throws if there are no matching values" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + filter([] (int) {return false; }, value(1)), Catch::GeneratorException + </Original> + <Expanded> + filter([] (int) {return false; }, value(1)), Catch::GeneratorException + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "a" - </Info> - <Info> - j := 3.141 - </Info> + <Section name="Shortening a range" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i < 4 + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "a" - </Info> - <Info> - j := 1.379 - </Info> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "b" - </Info> - <Info> - j := 8 - </Info> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "b" - </Info> - <Info> - j := 9 - </Info> + <Section name="Shortening a range" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i < 4 + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "b" - </Info> - <Info> - j := 10 - </Info> + <Section name="Shortening a range" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i < 4 + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "b" - </Info> - <Info> - j := 2 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "b" - </Info> - <Info> - j := 3.141 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "b" - </Info> - <Info> - j := 1.379 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "c" - </Info> - <Info> - j := 8 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "c" - </Info> - <Info> - j := 9 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "c" - </Info> - <Info> - j := 10 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "c" - </Info> - <Info> - j := 2 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "c" - </Info> - <Info> - j := 3.141 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > - <Info> - i := "c" - </Info> - <Info> - j := 1.379 - </Info> + <Section name="Transforming elements" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Generators impl" tags="[impl]" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[0] == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - gen[1] == 2 + j > 0 </Original> <Expanded> - 2 == 2 + 1 > 0 </Expanded> </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="fixed values" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.size() == 4 - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[0] == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[1] == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[2] == 4 - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - gen[3] == 1 + j > 0 </Original> <Expanded> - 1 == 1 + 2 > 0 </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="combined" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - gen.size() == 4 + j > 0 </Original> <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[0] == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[1] == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[2] == 9 - </Original> - <Expanded> - 9 == 9 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[3] == 7 - </Original> - <Expanded> - 7 == 7 + 3 > 0 </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="values" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - gen[0] == 3 + j > 0 </Original> <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[1] == 1 - </Original> - <Expanded> - 1 == 1 + 1 > 0 </Expanded> </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="values2" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen[0] == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - gen[1] == 1 + j > 0 </Original> <Expanded> - 1 == 1 + 2 > 0 </Expanded> </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="type erasure" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Repeating a generator" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - base->size() == 4 + j > 0 </Original> <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - typed - </Original> - <Expanded> - 0x<hex digits> + 3 > 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - typed->size() == 4 + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is not divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() < 3 + </Original> + <Expanded> + 1 < 3 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is not divisible by chunk size" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() < 3 + </Original> + <Expanded> + 2 < 3 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Throws on too small generators" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk(2, value(1)), Catch::GeneratorException + </Original> + <Expanded> + chunk(2, value(1)), Catch::GeneratorException + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Generators -- simple" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i </Original> <Expanded> - 4 == 4 + -3 < 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - (*typed)[0] == 7 + j < i </Original> <Expanded> - 7 == 7 + -2 < 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - (*typed)[3] == 11 + j < i </Original> <Expanded> - 11 == 11 + -1 < 1 </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 4 > 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 4 > 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 4 > 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -3 < 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -2 < 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -1 < 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 8 > 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 8 > 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 8 > 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -3 < 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -2 < 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + j < i + </Original> + <Expanded> + -1 < 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 12 > 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 12 > 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + 4u * i > str.size() + </Original> + <Expanded> + 12 > 3 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Generators internals" tags="[generators][internals]" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Single value" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 123 + </Original> + <Expanded> + 123 == 123 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Preset values" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Generator combinator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 4 + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <Section name="Explicitly typed generator sequence" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get().size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == "aa" + </Original> + <Expanded> + "aa" == "aa" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == "bb" + </Original> + <Expanded> + "bb" == "bb" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == "cc" + </Original> + <Expanded> + "cc" == "cc" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <Section name="Filter generator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + filter([] (int) { return false; }, value(1)), Catch::GeneratorException + </Original> + <Expanded> + filter([] (int) { return false; }, value(1)), Catch::GeneratorException + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take generator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take less" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take generator" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take more" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Map with explicit return type" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2.0 + </Original> + <Expanded> + 2.0 == 2.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 4.0 + </Original> + <Expanded> + 4.0 == 4.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 6.0 + </Original> + <Expanded> + 6.0 == 6.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Map with deduced return type" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2.0 + </Original> + <Expanded> + 2.0 == 2.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 4.0 + </Original> + <Expanded> + 4.0 == 4.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 6.0 + </Original> + <Expanded> + 6.0 == 6.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Singular repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Actual repeat" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="12" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="12" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive auto step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -2 + </Original> + <Expanded> + -2 == -2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative auto step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> </Section> <OverallResult success="true"/> </TestCase> @@ -4461,160 +5769,291 @@ </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > <Original> - data.str_hello != "hell" + data.str_hello != "hell" + </Original> + <Expanded> + "hello" != "hell" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "hello1" + </Original> + <Expanded> + "hello" != "hello1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() != 6 + </Original> + <Expanded> + 5 != 6 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Less-than inequalities with different epsilons" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d <= Approx( 1.24 ) + </Original> + <Expanded> + 1.23 <= Approx( 1.24 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d <= Approx( 1.23 ) + </Original> + <Expanded> + 1.23 <= Approx( 1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + !(d <= Approx( 1.22 )) + </Original> + <Expanded> + !(1.23 <= Approx( 1.22 )) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d <= Approx( 1.22 ).epsilon(0.1) + </Original> + <Expanded> + 1.23 <= Approx( 1.22 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="ManuallyRegistered" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be (AnyOf) composed with the || operator" tags="[matchers][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains("string") || Contains("different") || Contains("random") + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") + </Original> + <Expanded> + "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be composed with both && and ||" tags="[matchers][operator&&][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be composed with both && and || - failing" tags="[.][failing][matchers][operator&&][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Matchers can be negated (Not) with the ! operator" tags="[matchers][not][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), !Contains("different") + </Original> + <Expanded> + "this string contains 'abc' as a substring" not contains: "different" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be negated (Not) with the ! operator - failing" tags="[.][failing][matchers][not][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), !Contains("substring") + </Original> + <Expanded> + "this string contains 'abc' as a substring" not contains: "substring" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Mismatching exception messages failing the test" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), "expected exception" + </Original> + <Expanded> + "expected exception" equals: "expected exception" + </Expanded> + </Expression> + <Expression success="false" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), "should fail" + </Original> + <Expanded> + "expected exception" equals: "should fail" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Nested generators and captured variables" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 </Original> <Expanded> - "hello" != "hell" + 3 > -6 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - data.str_hello != "hello1" + values > -6 </Original> <Expanded> - "hello" != "hello1" + 4 > -6 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - data.str_hello.size() != 6 + values > -6 </Original> <Expanded> - 5 != 6 + 5 > -6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Less-than inequalities with different epsilons" tags="[Approx]" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - d <= Approx( 1.24 ) + values > -6 </Original> <Expanded> - 1.23 <= Approx( 1.24 ) + 6 > -6 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - d <= Approx( 1.23 ) + values > -6 </Original> <Expanded> - 1.23 <= Approx( 1.23 ) + -5 > -6 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - !(d <= Approx( 1.22 )) + values > -6 </Original> <Expanded> - !(1.23 <= Approx( 1.22 )) + -4 > -6 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - d <= Approx( 1.22 ).epsilon(0.1) + values > -6 </Original> <Expanded> - 1.23 <= Approx( 1.22 ) + 90 > -6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="ManuallyRegistered" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") + values > -6 </Original> <Expanded> - "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) + 91 > -6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be (AnyOf) composed with the || operator" tags="[matchers][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - testStringForMatching(), Contains("string") || Contains("different") || Contains("random") + values > -6 </Original> <Expanded> - "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) + 92 > -6 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") + values > -6 </Original> <Expanded> - "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) + 93 > -6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be composed with both && and ||" tags="[matchers][operator&&][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") + values > -6 </Original> <Expanded> - "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) + 94 > -6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be composed with both && and || - failing" tags="[.][.failing][matchers][operator&&][operators][operator||]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") + values > -6 </Original> <Expanded> - "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) + 95 > -6 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Matchers can be negated (Not) with the ! operator" tags="[matchers][not][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - testStringForMatching(), !Contains("different") + values > -6 </Original> <Expanded> - "this string contains 'abc' as a substring" not contains: "different" + 96 > -6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be negated (Not) with the ! operator - failing" tags="[.][.failing][matchers][not][operators]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - testStringForMatching(), !Contains("substring") + values > -6 </Original> <Expanded> - "this string contains 'abc' as a substring" not contains: "substring" + 97 > -6 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Mismatching exception messages failing the test" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - thisThrows(), "expected exception" + values > -6 </Original> <Expanded> - "expected exception" equals: "expected exception" + 98 > -6 </Expanded> </Expression> - <Expression success="false" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - thisThrows(), "should fail" + values > -6 </Original> <Expanded> - "expected exception" equals: "should fail" + 99 > -6 </Expanded> </Expression> - <OverallResult success="false"/> + <OverallResult success="true"/> </TestCase> <TestCase name="Nice descriptive name" tags="[.][tag1][tag2][tag3]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Warning> @@ -6864,18 +8303,18 @@ </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="Product with differing arities - 0" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="Product with differing arities - std::tuple<int, double, float>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> std::tuple_size<TestType>::value >= 1 </Original> <Expanded> - 1 >= 1 + 3 >= 1 </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Product with differing arities - 1" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="Product with differing arities - std::tuple<int, double>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> std::tuple_size<TestType>::value >= 1 @@ -6886,13 +8325,13 @@ </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="Product with differing arities - 2" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="Product with differing arities - std::tuple<int>" tags="[product][template]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> std::tuple_size<TestType>::value >= 1 </Original> <Expanded> - 3 >= 1 + 1 >= 1 </Expanded> </Expression> <OverallResult success="true"/> @@ -6908,7 +8347,7 @@ </Expression> <OverallResult success="false"/> </TestCase> - <TestCase name="Regex string matcher" tags="[.][.failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > + <TestCase name="Regex string matcher" tags="[.][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > <Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> testStringForMatching(), Matches("this STRING contains 'abc' as a substring") @@ -7889,9 +9328,9 @@ Message from section two </Expression> <OverallResult success="false"/> </TestCase> - <TestCase name="Tag alias can be registered against tag patterns" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Section name="The same tag alias can only be registered once" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > + <TestCase name="Tag alias can be registered against tag patterns" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Section name="The same tag alias can only be registered once" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> what, Contains( "[@zzz]" ) </Original> @@ -7901,230 +9340,76 @@ Message from section two Redefined at: file:10" contains: "[@zzz]" </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Original> - what, Contains( "file" ) - </Original> - <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "file" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Original> - what, Contains( "2" ) - </Original> - <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "2" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Original> - what, Contains( "10" ) - </Original> - <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "10" - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Tag aliases must be of the form [@name]" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Original> - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Original> - registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Original> - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/TagAlias.tests.cpp" > - <Original> - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - float" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 10 - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + what, Contains( "file" ) + </Original> + <Expanded> + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "file" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - v.size() == 5 + what, Contains( "2" ) </Original> <Expanded> - 5 == 5 + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "2" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - v.capacity() >= 10 + what, Contains( "10" ) </Original> <Expanded> - 10 >= 10 + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "10" </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Tag aliases must be of the form [@name]" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - v.size() == 5 + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) </Original> <Expanded> - 5 == 5 + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > <Original> - v.capacity() >= 5 + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) </Original> <Expanded> - 5 >= 5 + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THROWS" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - int" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTest: vectors can be sized and resized - float" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> v.size() == 5 @@ -8278,7 +9563,7 @@ Message from section two </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - std::string" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTest: vectors can be sized and resized - int" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> v.size() == 5 @@ -8432,7 +9717,7 @@ Message from section two </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="TemplateTest: vectors can be sized and resized - std::string" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> v.size() == 5 @@ -8586,409 +9871,195 @@ Message from section two </Section> <OverallResult success="true"/> </TestCase> - <TestCase name="Test case with one argument" filename="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Test enum bit values" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - 0x<hex digits> == bit30and31 - </Original> - <Expanded> - 3221225472 (0x<hex digits>) == 3221225472 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > - <Expression success="false" type="CHECK_NOFAIL" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - 1 == 2 - </Original> - <Expanded> - 1 == 2 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > - For some reason someone is throwing a string literal! - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Tracker" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="successfully close one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <TestCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" tags="[template][vector]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - testCase.isOpen() + v.size() == 5 </Original> <Expanded> - true + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - s1.isOpen() + v.capacity() >= 5 </Original> <Expanded> - true + 5 >= 5 </Expanded> </Expression> - <Section name="fail one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="resizing bigger changes size and capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() == false + v.size() == 10 </Original> <Expanded> - false == false + 10 == 10 </Expanded> </Expression> - <Section name="re-enter after failed section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - testCase.isOpen() + v.size() == 5 </Original> <Expanded> - true + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - s1.isOpen() + v.capacity() >= 5 </Original> <Expanded> - true + 5 >= 5 </Expanded> </Expression> - <Section name="fail one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="resizing smaller changes size but not capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - s1.isSuccessfullyCompleted() == false + v.size() == 0 </Original> <Expanded> - false == false + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - testCase.isComplete() == false + v.capacity() >= 5 </Original> <Expanded> - false == false + 5 >= 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="We can use the 'swap trick' to reset the capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ctx.completedCycle() + v.size() == 5 </Original> <Expanded> - true + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() == false + v.capacity() >= 10 </Original> <Expanded> - false == false + 10 >= 10 </Expanded> </Expression> - <Section name="re-enter after failed section and find next section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="11" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - testCase.isOpen() + v.size() == 5 </Original> <Expanded> - true + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - s1.isOpen() + v.capacity() >= 5 </Original> <Expanded> - true + 5 >= 5 </Expanded> </Expression> - <Section name="successfully close one section, then find another" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="reserving smaller does not change size or capacity" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - s2.isOpen() == false + v.size() == 5 </Original> <Expanded> - false == false + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - testCase.isComplete() == false + v.capacity() >= 5 </Original> <Expanded> - false == false + 5 >= 5 </Expanded> </Expression> - <Section name="Re-enter - skips S1 and enters S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Section name="Successfully close S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test case with one argument" filename="projects/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test enum bit values" tags="[Tricky]" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + 0x<hex digits> == bit30and31 + </Original> + <Expanded> + 3221225472 (0x<hex digits>) == 3221225472 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="false" type="CHECK_NOFAIL" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + 1 == 2 + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > + For some reason someone is throwing a string literal! + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Tracker" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> testCase.isOpen() @@ -9005,13 +10076,13 @@ Message from section two true </Expanded> </Expression> - <Section name="successfully close one section, then find another" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="successfully close one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2.isOpen() == false + s1.isSuccessfullyCompleted() </Original> <Expanded> - false == false + true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > @@ -9022,109 +10093,23 @@ Message from section two false == false </Expanded> </Expression> - <Section name="Re-enter - skips S1 and enters S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Section name="fail S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase3.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1c.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2c.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase3.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="12" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="14" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> @@ -9142,10 +10127,10 @@ Message from section two true </Expanded> </Expression> - <Section name="open a nested section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="fail one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2.isOpen() + s1.isComplete() </Original> <Expanded> true @@ -9153,15 +10138,15 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2.isComplete() + s1.isSuccessfullyCompleted() == false </Original> <Expanded> - true + false == false </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() == false + testCase.isComplete() == false </Original> <Expanded> false == false @@ -9169,7 +10154,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() + ctx.completedCycle() </Original> <Expanded> true @@ -9177,21 +10162,56 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCase.isComplete() == false + testCase.isSuccessfullyCompleted() == false </Original> <Expanded> false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <Section name="re-enter after failed section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> @@ -9209,10 +10229,10 @@ Message from section two true </Expanded> </Expression> - <Section name="start a generator" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="fail one section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1.isOpen() + s1.isComplete() </Original> <Expanded> true @@ -9220,15 +10240,15 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1.index() == 0 + s1.isSuccessfullyCompleted() == false </Original> <Expanded> - 0 == 0 + false == false </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1.isComplete() == false + testCase.isComplete() == false </Original> <Expanded> false == false @@ -9236,99 +10256,72 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() == false + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() == false </Original> <Expanded> false == false </Expanded> </Expression> - <Section name="close outer section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="re-enter after failed section and find next section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1b.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() == false + testCase.isComplete() </Original> <Expanded> - false == false + true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() == false + testCase.isSuccessfullyCompleted() </Original> <Expanded> - false == false + true </Expanded> </Expression> - <Section name="Re-enter for second generation" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1b.index() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1b.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="14" failures="0" expectedFailures="0"/> + <OverallResults successes="11" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> @@ -9346,26 +10339,10 @@ Message from section two true </Expanded> </Expression> - <Section name="start a generator" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1.index() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> + <Section name="successfully close one section, then find another" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1.isComplete() == false + s2.isOpen() == false </Original> <Expanded> false == false @@ -9373,16 +10350,16 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() == false + testCase.isComplete() == false </Original> <Expanded> false == false </Expanded> </Expression> - <Section name="Start a new inner section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="Re-enter - skips S1 and enters S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2.isOpen() + testCase2.isOpen() </Original> <Expanded> true @@ -9390,72 +10367,32 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2.isComplete() + s1b.isOpen() == false </Original> <Expanded> - true + false == false </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() == false + s2b.isOpen() </Original> <Expanded> - false == false + true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCase.isComplete() == false + ctx.completedCycle() == false </Original> <Expanded> false == false </Expanded> </Expression> - <Section name="Re-enter for second generation" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1b.index() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> + <Section name="Successfully close S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2b.isComplete() + ctx.completedCycle() </Original> <Expanded> true @@ -9463,7 +10400,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1b.isComplete() + s2b.isSuccessfullyCompleted() </Original> <Expanded> true @@ -9471,25 +10408,25 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1b.isComplete() + testCase2.isComplete() == false </Original> <Expanded> - true + false == false </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCase2.isComplete() + testCase2.isSuccessfullyCompleted() </Original> <Expanded> true </Expanded> </Expression> - <OverallResults successes="9" failures="0" expectedFailures="0"/> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="13" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="17" failures="0" expectedFailures="0"/> + <OverallResults successes="10" failures="0" expectedFailures="0"/> </Section> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> @@ -9507,26 +10444,10 @@ Message from section two true </Expanded> </Expression> - <Section name="start a generator" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1.index() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> + <Section name="successfully close one section, then find another" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1.isComplete() == false + s2.isOpen() == false </Original> <Expanded> false == false @@ -9534,24 +10455,16 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() == false + testCase.isComplete() == false </Original> <Expanded> false == false </Expanded> </Expression> - <Section name="Fail an inner section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> + <Section name="Re-enter - skips S1 and enters S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2.isComplete() + testCase2.isOpen() </Original> <Expanded> true @@ -9559,7 +10472,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s2.isSuccessfullyCompleted() == false + s1b.isOpen() == false </Original> <Expanded> false == false @@ -9567,32 +10480,24 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1.isComplete() == false + s2b.isOpen() </Original> <Expanded> - false == false + true </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCase.isComplete() == false + ctx.completedCycle() == false </Original> <Expanded> false == false </Expanded> </Expression> - <Section name="Re-enter for second generation" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> + <Section name="fail S2" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1b.isOpen() + ctx.completedCycle() </Original> <Expanded> true @@ -9600,7 +10505,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1b.isOpen() + s2b.isComplete() </Original> <Expanded> true @@ -9608,31 +10513,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - g1b.index() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1b.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isComplete() == false + s2b.isSuccessfullyCompleted() == false </Original> <Expanded> false == false @@ -9640,7 +10521,7 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCase2.isComplete() == false + testCase2.isSuccessfullyCompleted() == false </Original> <Expanded> false == false @@ -9656,73 +10537,100 @@ Message from section two </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1c.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1c.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1c.index() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2c.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2c.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - g1c.isComplete() + s1c.isOpen() == false </Original> <Expanded> - true + false == false </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - s1c.isComplete() + s2c.isOpen() == false </Original> <Expanded> - true + false == false </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCase3.isComplete() + testCase3.isSuccessfullyCompleted() </Original> <Expanded> true </Expanded> </Expression> - <OverallResults successes="17" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="22" failures="0" expectedFailures="0"/> + <OverallResults successes="12" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="26" failures="0" expectedFailures="0"/> + <OverallResults successes="14" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="open a nested section" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> <OverallResult success="true"/> </TestCase> @@ -10868,9 +11776,18 @@ loose text artifact </Failure> <OverallResult success="false"/> </TestCase> + <TestCase name="just failure after unscoped info" tags="[.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + previous unscoped info SHOULD not be seen + </Failure> + <OverallResult success="false"/> + </TestCase> <TestCase name="just info" tags="[info][isolated info][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > <OverallResult success="false"/> </TestCase> + <TestCase name="just unscoped info" tags="[info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="false"/> + </TestCase> <TestCase name="long long" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> @@ -11088,6 +12005,27 @@ loose text artifact </Expression> <OverallResult success="false"/> </TestCase> + <TestCase name="mix info, unscoped info and warning" tags="[info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + info + </Info> + <Info> + unscoped info + </Info> + <Warning> + and warn may mix + </Warning> + <Info> + info + </Info> + <Info> + unscoped info + </Info> + <Warning> + they are not cleared after warnings + </Warning> + <OverallResult success="false"/> + </TestCase> <TestCase name="more nested SECTION tests" tags="[.][failing][sections]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Section name="doesn't equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Section name="equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -11191,6 +12129,42 @@ loose text artifact <TestCase name="not allowed" tags="[!throws]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <OverallResult success="true"/> </TestCase> + <TestCase name="not prints unscoped info from previous failures" tags="[.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this MAY be seen only for the FIRST assertion IF info is printed for passing assertions + </Info> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + this MAY be seen only for the SECOND assertion IF info is printed for passing assertions + </Info> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + this SHOULD be seen + </Info> + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> <TestCase name="null strings" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> @@ -11245,6 +12219,78 @@ loose text artifact </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="print unscoped info if passing unscoped info is printed" tags="[info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this MAY be seen IF info is printed for passing assertions + </Info> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="prints unscoped info on failure" tags="[.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this SHOULD be seen + </Info> + <Info> + this SHOULD also be seen + </Info> + <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="prints unscoped info only for the first assertion" tags="[.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this SHOULD be seen only ONCE + </Info> + <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + this MAY also be seen only ONCE IF info is printed for passing assertions + </Info> + <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> <TestCase name="random SECTION tests" tags="[.][failing][sections]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Section name="doesn't equal" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -11448,6 +12494,60 @@ loose text artifact </Expression> <OverallResult success="false"/> </TestCase> + <TestCase name="shortened hide tags are split apart" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testcase.tags, Catch::VectorContains(std::string("magic-tag")) && Catch::VectorContains(std::string(".")) + </Original> + <Expanded> + { ".", "magic-tag" } ( Contains: "magic-tag" and Contains: "." ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stacks unscoped info in loops" tags="[.][failing][info][unscoped]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + Count 1 to 3... + </Info> + <Info> + 1 + </Info> + <Info> + 2 + </Info> + <Info> + 3 + </Info> + <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Info> + Count 4 to 6... + </Info> + <Info> + 4 + </Info> + <Info> + 5 + </Info> + <Info> + 6 + </Info> + <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> <TestCase name="std::map is convertible string" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Section name="empty" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > @@ -11711,7 +12811,7 @@ loose text artifact </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="strlen3" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <TestCase name="strlen3" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> data.str.size() == data.len @@ -11746,6 +12846,41 @@ loose text artifact </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="tables" tags="[generators]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="thrown std::strings are translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > <Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > Why would you throw a std::string? @@ -12264,7 +13399,7 @@ loose text artifact </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="1189" failures="130" expectedFailures="21"/> + <OverallResults successes="1276" failures="140" expectedFailures="21"/> </Group> - <OverallResults successes="1189" failures="129" expectedFailures="21"/> + <OverallResults successes="1276" failures="139" expectedFailures="21"/> </Catch> diff --git a/packages/Catch2/projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/packages/Catch2/projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp index b3074b2e1..dbc1d9578 100644 --- a/packages/Catch2/projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp +++ b/packages/Catch2/projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp @@ -1,93 +1,260 @@ #include "catch.hpp" -// Tests of generartor implementation details - -TEST_CASE("Generators impl", "[impl]") { +// Tests of generator implementation details +TEST_CASE("Generators internals", "[generators][internals]") { using namespace Catch::Generators; - SECTION( "range" ) { - auto gen = range(1,3); - - CHECK( gen.size() == 2 ); - - CHECK( gen[0] == 1 ); - CHECK( gen[1] == 2 ); + SECTION("Single value") { + auto gen = value(123); + REQUIRE(gen.get() == 123); + REQUIRE_FALSE(gen.next()); } - SECTION( "fixed values" ) { - auto gen = values( { 3, 1, 4, 1 } ); - - CHECK( gen.size() == 4 ); - CHECK( gen[0] == 3 ); - CHECK( gen[1] == 1 ); - CHECK( gen[2] == 4 ); - CHECK( gen[3] == 1 ); + SECTION("Preset values") { + auto gen = values({ 1, 3, 5 }); + REQUIRE(gen.get() == 1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 3); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 5); + REQUIRE_FALSE(gen.next()); } - SECTION( "combined" ) { - auto gen = makeGenerators( range( 1, 3 ), values( { 9, 7 } ) ); - - CHECK( gen.size() == 4 ); - CHECK( gen[0] == 1 ); - CHECK( gen[1] == 2 ); - CHECK( gen[2] == 9 ); - CHECK( gen[3] == 7 ); + SECTION("Generator combinator") { + auto gen = makeGenerators(1, 5, values({ 2, 4 }), 0); + REQUIRE(gen.get() == 1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 5); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 4); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 0); + REQUIRE_FALSE(gen.next()); } - - SECTION( "values" ) { - auto gen = makeGenerators( 3, 1 ); - - CHECK( gen.size() == 2 ); - CHECK( gen[0] == 3 ); - CHECK( gen[1] == 1 ); + SECTION("Explicitly typed generator sequence") { + auto gen = makeGenerators(as<std::string>{}, "aa", "bb", "cc"); + // This just checks that the type is std::string: + REQUIRE(gen.get().size() == 2); + // Iterate over the generator + REQUIRE(gen.get() == "aa"); + REQUIRE(gen.next()); + REQUIRE(gen.get() == "bb"); + REQUIRE(gen.next()); + REQUIRE(gen.get() == "cc"); + REQUIRE_FALSE(gen.next()); } - SECTION( "values2" ) { - auto gen = makeGenerators( 3, 1 ); + SECTION("Filter generator") { + // Normal usage + auto gen = filter([] (int i) { return i != 2; }, values({ 2, 1, 2, 3, 2, 2 })); + REQUIRE(gen.get() == 1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 3); + REQUIRE_FALSE(gen.next()); - CHECK( gen.size() == 2 ); - CHECK( gen[0] == 3 ); - CHECK( gen[1] == 1 ); + // Completely filtered-out generator should throw on construction + REQUIRE_THROWS_AS(filter([] (int) { return false; }, value(1)), Catch::GeneratorException); + } + SECTION("Take generator") { + SECTION("Take less") { + auto gen = take(2, values({ 1, 2, 3 })); + REQUIRE(gen.get() == 1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE_FALSE(gen.next()); + } + SECTION("Take more") { + auto gen = take(2, value(1)); + REQUIRE(gen.get() == 1); + REQUIRE_FALSE(gen.next()); + } + } + SECTION("Map with explicit return type") { + auto gen = map<double>([] (int i) {return 2.0 * i; }, values({ 1, 2, 3 })); + REQUIRE(gen.get() == 2.0); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 4.0); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 6.0); + REQUIRE_FALSE(gen.next()); + } + SECTION("Map with deduced return type") { + auto gen = map([] (int i) {return 2.0 * i; }, values({ 1, 2, 3 })); + REQUIRE(gen.get() == 2.0); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 4.0); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 6.0); + REQUIRE_FALSE(gen.next()); + } + SECTION("Repeat") { + SECTION("Singular repeat") { + auto gen = repeat(1, value(3)); + REQUIRE(gen.get() == 3); + REQUIRE_FALSE(gen.next()); + } + SECTION("Actual repeat") { + auto gen = repeat(2, values({ 1, 2, 3 })); + REQUIRE(gen.get() == 1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 3); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 3); + REQUIRE_FALSE(gen.next()); + } + } + SECTION("Range") { + SECTION("Positive auto step") { + SECTION("Integer") { + auto gen = range(-2, 2); + REQUIRE(gen.get() == -2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 0); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 1); + REQUIRE_FALSE(gen.next()); + } + } + SECTION("Negative auto step") { + SECTION("Integer") { + auto gen = range(2, -2); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 0); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE_FALSE(gen.next()); + } + } + SECTION("Positive manual step") { + SECTION("Integer") { + SECTION("Exact") { + auto gen = range(-7, 5, 3); + REQUIRE(gen.get() == -7); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -4); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE_FALSE(gen.next()); + } + SECTION("Slightly over end") { + auto gen = range(-7, 4, 3); + REQUIRE(gen.get() == -7); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -4); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE_FALSE(gen.next()); + } + SECTION("Slightly under end") { + auto gen = range(-7, 6, 3); + REQUIRE(gen.get() == -7); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -4); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 5); + REQUIRE_FALSE(gen.next()); + } + } + } + SECTION("Negative manual step") { + SECTION("Integer") { + SECTION("Exact") { + auto gen = range(5, -7, -3); + REQUIRE(gen.get() == 5); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -4); + REQUIRE_FALSE(gen.next()); + } + SECTION("Slightly over end") { + auto gen = range(5, -6, -3); + REQUIRE(gen.get() == 5); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -4); + REQUIRE_FALSE(gen.next()); + } + SECTION("Slightly under end") { + auto gen = range(5, -8, -3); + REQUIRE(gen.get() == 5); + REQUIRE(gen.next()); + REQUIRE(gen.get() == 2); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -1); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -4); + REQUIRE(gen.next()); + REQUIRE(gen.get() == -7); + REQUIRE_FALSE(gen.next()); + } + } + } } +} + - SECTION( "type erasure" ) { - auto gen = makeGenerators( range( 7, 10 ), 11 ); +// todo: uncopyable type used in a generator +// idea: uncopyable tag type for a stupid generator - // Make type erased version - auto dynCopy = pf::make_unique<Generators<int>>( std::move( gen ) ); - std::unique_ptr<GeneratorBase const> base = std::move( dynCopy ); +namespace { +struct non_copyable { + non_copyable() = default; + non_copyable(non_copyable const&) = delete; + non_copyable& operator=(non_copyable const&) = delete; + int value = -1; +}; - // Only thing we can do is ask for the size - CHECK( base->size() == 4 ); +// This class shows how to implement a simple generator for Catch tests +class TestGen : public Catch::Generators::IGenerator<int> { + int current_number; +public: - // Restore typed version - auto typed = dynamic_cast<Generators<int> const*>( base.get() ); - REQUIRE( typed ); - CHECK( typed->size() == 4 ); - CHECK( (*typed)[0] == 7 ); - CHECK( (*typed)[3] == 11 ); + TestGen(non_copyable const& nc): + current_number(nc.value) {} + + int const& get() const override; + bool next() override { + return false; } -} +}; -TEST_CASE("Generators impl - random", "[approvals]") { - using namespace Catch::Generators; +// Avoids -Wweak-vtables +int const& TestGen::get() const { + return current_number; +} - SECTION( "random range" ) { - auto gen = random( 3, 9 ); +} - CHECK( gen.size() == 6 ); - for( size_t i = 0; i < 6; ++i ) { - CHECK( gen[i] >= 3 ); - CHECK( gen[i] <= 8 ); - if( i > 0 ) - CHECK( gen[i] != gen[i-1] ); - } - } - SECTION( "random selection" ) { - auto gen = random<int>( 10 ); +TEST_CASE("GENERATE capture macros", "[generators][internals][.approvals]") { + auto value = GENERATE(take(10, random(0, 10))); - CHECK( gen.size() == 10 ); - for( size_t i = 0; i < 10; ++i ) { - if( i > 0 ) - CHECK( gen[i] != gen[i-1] ); - } - } + non_copyable nc; nc.value = value; + // neither `GENERATE_COPY` nor plain `GENERATE` would compile here + auto value2 = GENERATE_REF(Catch::Generators::GeneratorWrapper<int>(std::unique_ptr<Catch::Generators::IGenerator<int>>(new TestGen(nc)))); + REQUIRE(value == value2); } diff --git a/packages/Catch2/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp b/packages/Catch2/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp index 7e7f14b45..9372b1c3b 100644 --- a/packages/Catch2/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp +++ b/packages/Catch2/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp @@ -173,154 +173,34 @@ TEST_CASE( "Tracker" ) { testCase.close(); REQUIRE( testCase.isComplete() ); } +} - SECTION( "start a generator" ) { - IndexTracker& g1 = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1.isOpen() ); - REQUIRE( g1.index() == 0 ); - - REQUIRE( g1.isComplete() == false ); - REQUIRE( s1.isComplete() == false ); - - SECTION( "close outer section" ) - { - s1.close(); - REQUIRE( s1.isComplete() == false ); - testCase.close(); - REQUIRE( testCase.isSuccessfullyCompleted() == false ); - - SECTION( "Re-enter for second generation" ) { - ctx.startCycle(); - ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase2.isOpen() ); - - ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1b.isOpen() ); - - - IndexTracker& g1b = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1b.isOpen() ); - REQUIRE( g1b.index() == 1 ); - - REQUIRE( s1.isComplete() == false ); - - s1b.close(); - REQUIRE( s1b.isComplete() ); - REQUIRE( g1b.isComplete() ); - testCase2.close(); - REQUIRE( testCase2.isComplete() ); - } - } - SECTION( "Start a new inner section" ) { - ITracker& s2 = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2.isOpen() ); - - s2.close(); - REQUIRE( s2.isComplete() ); - - s1.close(); - REQUIRE( s1.isComplete() == false ); - - testCase.close(); - REQUIRE( testCase.isComplete() == false ); - - SECTION( "Re-enter for second generation" ) { - ctx.startCycle(); - ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase2.isOpen() ); - - ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1b.isOpen() ); - - // generator - next value - IndexTracker& g1b = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1b.isOpen() ); - REQUIRE( g1b.index() == 1 ); - - // inner section again - ITracker& s2b = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2b.isOpen() ); - - s2b.close(); - REQUIRE( s2b.isComplete() ); - - s1b.close(); - REQUIRE( g1b.isComplete() ); - REQUIRE( s1b.isComplete() ); - - testCase2.close(); - REQUIRE( testCase2.isComplete() ); - } - } - - SECTION( "Fail an inner section" ) { - ITracker& s2 = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2.isOpen() ); - - s2.fail(); - REQUIRE( s2.isComplete() ); - REQUIRE( s2.isSuccessfullyCompleted() == false ); - - s1.close(); - REQUIRE( s1.isComplete() == false ); - - testCase.close(); - REQUIRE( testCase.isComplete() == false ); - - SECTION( "Re-enter for second generation" ) { - ctx.startCycle(); - ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase2.isOpen() ); - - ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1b.isOpen() ); - - // generator - still same value - IndexTracker& g1b = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1b.isOpen() ); - REQUIRE( g1b.index() == 0 ); - - // inner section again - this time won't open - ITracker& s2b = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2b.isOpen() == false ); - - s1b.close(); - REQUIRE( g1b.isComplete() == false ); - REQUIRE( s1b.isComplete() == false ); - - testCase2.close(); - REQUIRE( testCase2.isComplete() == false ); - - // Another cycle - now should complete - ctx.startCycle(); - ITracker& testCase3 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase3.isOpen() ); - - ITracker& s1c = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1c.isOpen() ); +static bool previouslyRun = false; +static bool previouslyRunNested = false; - // generator - now next value - IndexTracker& g1c = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1c.isOpen() ); - REQUIRE( g1c.index() == 1 ); +TEST_CASE( "#1394", "[.][approvals][tracker]" ) { + // -- Don't re-run after specified section is done + REQUIRE(previouslyRun == false); - // inner section - now should open again - ITracker& s2c = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2c.isOpen() ); - - s2c.close(); - REQUIRE( s2c.isComplete() ); + SECTION( "RunSection" ) { + previouslyRun = true; + } + SECTION( "SkipSection" ) { + // cause an error if this section is called because it shouldn't be + REQUIRE(1 == 0); + } +} - s1c.close(); - REQUIRE( g1c.isComplete() ); - REQUIRE( s1c.isComplete() ); +TEST_CASE( "#1394 nested", "[.][approvals][tracker]" ) { + REQUIRE(previouslyRunNested == false); - testCase3.close(); - REQUIRE( testCase3.isComplete() ); - } + SECTION( "NestedRunSection" ) { + SECTION( "s1" ) { + previouslyRunNested = true; } - // !TBD" - // nested generator - // two sections within a generator + } + SECTION( "NestedSkipSection" ) { + // cause an error if this section is called because it shouldn't be + REQUIRE(1 == 0); } } diff --git a/packages/Catch2/projects/SelfTest/IntrospectiveTests/TagAlias.tests.cpp b/packages/Catch2/projects/SelfTest/IntrospectiveTests/Tag.tests.cpp similarity index 84% rename from packages/Catch2/projects/SelfTest/IntrospectiveTests/TagAlias.tests.cpp rename to packages/Catch2/projects/SelfTest/IntrospectiveTests/Tag.tests.cpp index b533c4544..27958223b 100644 --- a/packages/Catch2/projects/SelfTest/IntrospectiveTests/TagAlias.tests.cpp +++ b/packages/Catch2/projects/SelfTest/IntrospectiveTests/Tag.tests.cpp @@ -40,3 +40,8 @@ TEST_CASE( "Tag alias can be registered against tag patterns" ) { CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) ); } } + +TEST_CASE("shortened hide tags are split apart") { + auto testcase = Catch::makeTestCase(nullptr, "", {"fake test name", "[.magic-tag]"}, CATCH_INTERNAL_LINEINFO); + REQUIRE_THAT(testcase.tags, Catch::VectorContains(std::string("magic-tag")) && Catch::VectorContains(std::string("."))); +} diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp index 325a81427..7f2ad8bc9 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Compilation.tests.cpp @@ -17,6 +17,11 @@ namespace foo { }; } +namespace bar { + template <typename... Ts> + struct TypeList {}; +} + #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wmissing-declarations" #endif @@ -184,6 +189,11 @@ namespace { namespace CompilationTests { STATIC_REQUIRE_FALSE( std::is_void<int>::value ); } + TEST_CASE("#1548", "[compilation]") { + using namespace bar; + REQUIRE(std::is_same<TypeList<int>, TypeList<int>>::value); + } + }} // namespace CompilationTests diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Generators.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Generators.tests.cpp index 9242174a8..f5e3f6a53 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Generators.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Generators.tests.cpp @@ -1,75 +1,63 @@ #include "catch.hpp" -// Examples of usage of Generators +#include <cstring> -// This test doesn't do much - it just shows how you can have several generators, of different -// types (ie `i` and `j` are different types), can be sequenced using `,` and -// can be expressed as named generators (like range) or as individual values. -// Generators can be mixed with SECTIONs. -// At time of writing the generated values are not automatically reported as part of the test -// name or associated values - so we explicitly CAPTURE then (run this with `-s` to see them). -// We could also incorporate them into the section names using DYNAMIC_SECTION. See the BDD -// example later for more information. -TEST_CASE("Generators") { - auto i = GENERATE( as<std::string>(), "a", "b", "c" ); - - SECTION( "one" ) { - auto j = GENERATE( range( 8, 11 ), 2 ); - - CAPTURE( i, j ); - SUCCEED(); +// Generators and sections can be nested freely +TEST_CASE("Generators -- simple", "[generators]") { + auto i = GENERATE(1, 2, 3); + SECTION("one") { + auto j = GENERATE(values({ -3, -2, -1 })); + REQUIRE(j < i); } - SECTION( "two" ) { - auto j = GENERATE( 3.141, 1.379 ); - CAPTURE( i, j ); - SUCCEED(); + + SECTION("two") { + // You can also explicitly set type for generators via Catch::Generators::as + auto str = GENERATE(as<std::string>{}, "a", "bb", "ccc"); + REQUIRE(4u * i > str.size()); } } -// This one generates the cross-product of two ranges. -// It's mostly here to demonstrate the performance which, at time of writing, -// leaves a lot to be desired. -TEST_CASE( "100x100 ints", "[.][approvals]" ) { - auto x = GENERATE( range( 0,100 ) ); - auto y = GENERATE( range( 200,300 ) ); - - CHECK( x < y ); +// You can create a cartesian-product of generators by creating multiple ones +TEST_CASE("3x3x3 ints", "[generators]") { + auto x = GENERATE(1, 2, 3); + auto y = GENERATE(4, 5, 6); + auto z = GENERATE(7, 8, 9); + // These assertions will be run 27 times (3x3x3) + CHECK(x < y); + CHECK(y < z); + REQUIRE(x < z); } -// smaller version -TEST_CASE( "10x10 ints" ) { - auto x = GENERATE( range( 1,11 ) ); - auto y = GENERATE( range( 101, 111 ) ); - - CHECK( x < y ); +// You can also create data tuples +TEST_CASE("tables", "[generators]") { + // Note that this will not compile with libstdc++ older than libstdc++6 + // See https://stackoverflow.com/questions/12436586/tuple-vector-and-initializer-list + // for possible workarounds + // auto data = GENERATE(table<char const*, int>({ + // {"first", 5}, + // {"second", 6}, + // {"third", 5}, + // {"etc...", 6} + // })); + + // Workaround for the libstdc++ bug mentioned above + using tuple_type = std::tuple<char const*, int>; + auto data = GENERATE(table<char const*, int>({ + tuple_type{"first", 5}, + tuple_type{"second", 6}, + tuple_type{"third", 5}, + tuple_type{"etc...", 6} + })); + + REQUIRE(strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data))); } -// Some of the following tests use structured bindings for convenience and so are -// conditionally compiled using the de-facto (and soon to be formally) standard -// feature macros #ifdef __cpp_structured_bindings -// One way to do pairs of values (actual/ expected?) -// For a simple case like this I'd recommend writing out a series of REQUIREs -// but it demonstrates a possible usage. -// Spelling out the pair like this is a bit verbose, so read on for better examples -// - the use of structured bindings here is an optional convenience -TEST_CASE( "strlen", "[approvals]" ) { - auto [test_input, expected] = GENERATE( values<std::pair<std::string_view, size_t>>({ - {"one", 3}, - {"two", 3}, - {"three", 5}, - {"four", 4} - })); - - REQUIRE( test_input.size() == expected ); -} - -// A nicer way to do pairs (or more) of values - using the table generator. -// Note, you must specify the types up-front. -TEST_CASE( "strlen2", "[approvals]" ) { +// Structured bindings make the table utility much nicer to use +TEST_CASE( "strlen2", "[approvals][generators]" ) { auto [test_input, expected] = GENERATE( table<std::string, size_t>({ {"one", 3}, {"two", 3}, @@ -81,11 +69,11 @@ TEST_CASE( "strlen2", "[approvals]" ) { } #endif -// An alternate way of doing data tables without structure bindings -// - I'd prefer to have the Data class within the test case but gcc 4.x doesn't seem to like it + +// An alternate way of doing data tables without structured bindings struct Data { std::string str; size_t len; }; -TEST_CASE( "strlen3" ) { +TEST_CASE( "strlen3", "[generators]" ) { auto data = GENERATE( values<Data>({ {"one", 3}, {"two", 3}, @@ -96,15 +84,7 @@ TEST_CASE( "strlen3" ) { REQUIRE( data.str.size() == data.len ); } -// A nod towards property-based testing - generate a random selection of numbers -// in a range and assert on global properties those numbers. -static auto square( int i ) -> int { return i*i; } -TEST_CASE( "Random numbers in a range", "[.][approvals]" ) { - auto x = GENERATE( random( -10000, 10000 ) ); - CAPTURE( x ); - REQUIRE( square(x) >= 0 ); -} #ifdef __cpp_structured_bindings @@ -118,7 +98,7 @@ TEST_CASE( "Random numbers in a range", "[.][approvals]" ) { static auto eatCucumbers( int start, int eat ) -> int { return start-eat; } -SCENARIO("Eating cucumbers", "[approvals]") { +SCENARIO("Eating cucumbers", "[generators][approvals]") { auto [start, eat, left] = GENERATE( table<int,int,int> ({ { 12, 5, 7 }, @@ -132,3 +112,97 @@ SCENARIO("Eating cucumbers", "[approvals]") { } } #endif + +// There are also some generic generator manipulators +TEST_CASE("Generators -- adapters", "[generators][generic]") { + // TODO: This won't work yet, introduce GENERATE_VAR? + //auto numbers = Catch::Generators::values({ 1, 2, 3, 4, 5, 6 }); + SECTION("Filtering by predicate") { + SECTION("Basic usage") { + // This filters out all odd (false) numbers, giving [2, 4, 6] + auto i = GENERATE(filter([] (int val) { return val % 2 == 0; }, values({ 1, 2, 3, 4, 5, 6 }))); + REQUIRE(i % 2 == 0); + } + SECTION("Throws if there are no matching values") { + using namespace Catch::Generators; + REQUIRE_THROWS_AS(filter([] (int) {return false; }, value(1)), Catch::GeneratorException); + } + } + SECTION("Shortening a range") { + // This takes the first 3 elements from the values, giving back [1, 2, 3] + auto i = GENERATE(take(3, values({ 1, 2, 3, 4, 5, 6 }))); + REQUIRE(i < 4); + } + SECTION("Transforming elements") { + SECTION("Same type") { + // This doubles values [1, 2, 3] into [2, 4, 6] + auto i = GENERATE(map([] (int val) { return val * 2; }, values({ 1, 2, 3 }))); + REQUIRE(i % 2 == 0); + } + SECTION("Different type") { + // This takes a generator that returns ints and maps them into strings + auto i = GENERATE(map<std::string>([] (int val) { return std::to_string(val); }, values({ 1, 2, 3 }))); + REQUIRE(i.size() == 1); + } + SECTION("Different deduced type") { + // This takes a generator that returns ints and maps them into strings + auto i = GENERATE(map([] (int val) { return std::to_string(val); }, values({ 1, 2, 3 }))); + REQUIRE(i.size() == 1); + } + } + SECTION("Repeating a generator") { + // This will return values [1, 2, 3, 1, 2, 3] + auto j = GENERATE(repeat(2, values({ 1, 2, 3 }))); + REQUIRE(j > 0); + } + SECTION("Chunking a generator into sized pieces") { + SECTION("Number of elements in source is divisible by chunk size") { + auto chunk2 = GENERATE(chunk(2, values({ 1, 1, 2, 2, 3, 3 }))); + REQUIRE(chunk2.size() == 2); + REQUIRE(chunk2.front() == chunk2.back()); + } + SECTION("Number of elements in source is not divisible by chunk size") { + auto chunk2 = GENERATE(chunk(2, values({ 1, 1, 2, 2, 3 }))); + REQUIRE(chunk2.size() == 2); + REQUIRE(chunk2.front() == chunk2.back()); + REQUIRE(chunk2.front() < 3); + } + SECTION("Throws on too small generators") { + using namespace Catch::Generators; + REQUIRE_THROWS_AS(chunk(2, value(1)), Catch::GeneratorException); + } + } +} + +// Note that because of the non-reproducibility of distributions, +// anything involving the random generators cannot be part of approvals +TEST_CASE("Random generator", "[generators][.][approvals]") { + SECTION("Infer int from integral arguments") { + auto val = GENERATE(take(4, random(0, 1))); + STATIC_REQUIRE(std::is_same<decltype(val), int>::value); + static_cast<void>(val); // Silence VS 2015 unused variable warning + } + SECTION("Infer double from double arguments") { + auto val = GENERATE(take(4, random(0., 1.))); + STATIC_REQUIRE(std::is_same<decltype(val), double>::value); + static_cast<void>(val); // Silence VS 2015 unused variable warning + } +} + + +TEST_CASE("Nested generators and captured variables", "[generators]") { + // Workaround for old libstdc++ + using record = std::tuple<int, int>; + // Set up 3 ranges to generate numbers from + auto extent = GENERATE(table<int, int>({ + record{3, 7}, + record{-5, -3}, + record{90, 100} + })); + + auto from = std::get<0>(extent); + auto to = std::get<1>(extent); + + auto values = GENERATE_COPY(range(from, to)); + REQUIRE(values > -6); +} diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp index 002fb875a..50992cebb 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Message.tests.cpp @@ -14,6 +14,13 @@ TEST_CASE( "INFO and WARN do not abort tests", "[messages][.]" ) { WARN( "this is a " << "warning" ); // This should always output the message but then continue } +TEST_CASE( "#1455 - INFO and WARN can start with a linebreak", "[messages][.]" ) { + // Previously these would be hidden from the console reporter output, + // because it would fail at properly reflowing the text + INFO( "\nThis info message starts with a linebreak" ); + WARN( "\nThis warning message starts with a linebreak" ); +} + TEST_CASE( "SUCCEED counts as a test pass", "[messages]" ) { SUCCEED( "this is a " << "success" ); } @@ -132,6 +139,71 @@ TEST_CASE( "Pointers can be converted to strings", "[messages][.][approvals]" ) WARN( "toString(p): " << ::Catch::Detail::stringify( &p ) ); } +template <typename T> +static void unscoped_info( T msg ) { + UNSCOPED_INFO( msg ); +} + +TEST_CASE( "just unscoped info", "[unscoped][info]" ) { + unscoped_info( "this should NOT be seen" ); + unscoped_info( "this also should NOT be seen" ); +} + +TEST_CASE( "just failure after unscoped info", "[failing][.][unscoped][info]" ) { + FAIL( "previous unscoped info SHOULD not be seen" ); +} + +TEST_CASE( "print unscoped info if passing unscoped info is printed", "[unscoped][info]" ) { + unscoped_info( "this MAY be seen IF info is printed for passing assertions" ); + REQUIRE( true ); +} + +TEST_CASE( "prints unscoped info on failure", "[failing][.][unscoped][info]" ) { + unscoped_info( "this SHOULD be seen" ); + unscoped_info( "this SHOULD also be seen" ); + REQUIRE( false ); + unscoped_info( "but this should NOT be seen" ); +} + +TEST_CASE( "not prints unscoped info from previous failures", "[failing][.][unscoped][info]" ) { + unscoped_info( "this MAY be seen only for the FIRST assertion IF info is printed for passing assertions" ); + REQUIRE( true ); + unscoped_info( "this MAY be seen only for the SECOND assertion IF info is printed for passing assertions" ); + REQUIRE( true ); + unscoped_info( "this SHOULD be seen" ); + REQUIRE( false ); +} + +TEST_CASE( "prints unscoped info only for the first assertion", "[failing][.][unscoped][info]" ) { + unscoped_info( "this SHOULD be seen only ONCE" ); + CHECK( false ); + CHECK( true ); + unscoped_info( "this MAY also be seen only ONCE IF info is printed for passing assertions" ); + CHECK( true ); + CHECK( true ); +} + +TEST_CASE( "stacks unscoped info in loops", "[failing][.][unscoped][info]" ) { + UNSCOPED_INFO("Count 1 to 3..."); + for (int i = 1; i <= 3; i++) { + unscoped_info(i); + } + CHECK( false ); + + UNSCOPED_INFO("Count 4 to 6..."); + for (int i = 4; i <= 6; i++) { + unscoped_info(i); + } + CHECK( false ); +} + +TEST_CASE( "mix info, unscoped info and warning", "[unscoped][info]" ) { + INFO("info"); + unscoped_info("unscoped info"); + WARN("and warn may mix"); + WARN("they are not cleared after warnings"); +} + TEST_CASE( "CAPTURE can deal with complex expressions", "[messages][capture]" ) { int a = 1; int b = 2; diff --git a/packages/Catch2/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp index acddf2238..09ac30451 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp @@ -132,7 +132,7 @@ namespace { struct WhatException : std::exception { char const* what() const noexcept override { - return "This exception has overriden what() method"; + return "This exception has overridden what() method"; } ~WhatException() override; }; @@ -170,7 +170,7 @@ StringMakerException::~StringMakerException() = default; TEST_CASE("Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified", "[toString][exception]") { - REQUIRE(::Catch::Detail::stringify(WhatException{}) == "This exception has overriden what() method"); + REQUIRE(::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method"); REQUIRE(::Catch::Detail::stringify(OperatorException{}) == "OperatorException"); REQUIRE(::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException"); } diff --git a/packages/Catch2/projects/SelfTest/UsageTests/ToStringOptional.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/ToStringOptional.tests.cpp new file mode 100644 index 000000000..d78579d90 --- /dev/null +++ b/packages/Catch2/projects/SelfTest/UsageTests/ToStringOptional.tests.cpp @@ -0,0 +1,23 @@ +#define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER +#include "catch.hpp" + +#if defined(CATCH_CONFIG_CPP17_OPTIONAL) + +TEST_CASE( "std::optional<int> -> toString", "[toString][optional][approvals]" ) { + using type = std::optional<int>; + REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) ); + REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) ); +} + +TEST_CASE( "std::optional<std::string> -> toString", "[toString][optional][approvals]" ) { + using type = std::optional<std::string>; + REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) ); + REQUIRE( "\"abc\"" == ::Catch::Detail::stringify( type{ "abc" } ) ); +} + +TEST_CASE( "std::vector<std::optional<int> > -> toString", "[toString][optional][approvals]" ) { + using type = std::vector<std::optional<int> >; + REQUIRE( "{ 0, { }, 2 }" == ::Catch::Detail::stringify( type{ 0, {}, 2 } ) ); +} + +#endif // CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL diff --git a/packages/Catch2/projects/SelfTest/UsageTests/ToStringVariant.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/ToStringVariant.tests.cpp index 62f923f06..60b3f903a 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/ToStringVariant.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/ToStringVariant.tests.cpp @@ -6,6 +6,18 @@ #include <string> #include <variant> +// We need 2 types with non-trivial copies/moves +struct MyType1 { + MyType1() = default; + MyType1(MyType1 const&) { throw 1; } + MyType1& operator=(MyType1 const&) { throw 3; } +}; +struct MyType2 { + MyType2() = default; + MyType2(MyType2 const&) { throw 2; } + MyType2& operator=(MyType2 const&) { throw 4; } +}; + TEST_CASE( "variant<std::monostate>", "[toString][variant][approvals]") { using type = std::variant<std::monostate>; @@ -26,19 +38,18 @@ TEST_CASE( "variant<float, int>", "[toString][variant][approvals]") using type = std::variant<float, int>; CHECK( "0.5f" == ::Catch::Detail::stringify(type{0.5f}) ); CHECK( "0" == ::Catch::Detail::stringify(type{0}) ); +} - SECTION("valueless by exception") { - struct sample { - operator int() const { throw 42; } - }; +TEST_CASE( "variant -- valueless-by-exception", "[toString][variant][approvals]" ) { + using type = std::variant<MyType1, MyType2>; - type value{1.5f}; - REQUIRE_THROWS_AS( value.emplace<int>(sample{}), int ); - REQUIRE( value.valueless_by_exception() ); - CHECK( "{valueless variant}" == ::Catch::Detail::stringify(value) ); - } + type value; + REQUIRE_THROWS_AS(value.emplace<MyType2>(MyType2{}), int); + REQUIRE(value.valueless_by_exception()); + CHECK("{valueless variant}" == ::Catch::Detail::stringify(value)); } + TEST_CASE( "variant<string, int>", "[toString][variant][approvals]") { using type = std::variant<std::string, int>; @@ -48,22 +59,18 @@ TEST_CASE( "variant<string, int>", "[toString][variant][approvals]") TEST_CASE( "variant<variant<float, int>, string>", "[toString][variant][approvals]") { - using inner = std::variant<float, int>; + using inner = std::variant<MyType1, float, int>; using type = std::variant<inner, std::string>; CHECK( "0.5f" == ::Catch::Detail::stringify(type{0.5f}) ); CHECK( "0" == ::Catch::Detail::stringify(type{0}) ); CHECK( "\"foo\"" == ::Catch::Detail::stringify(type{"foo"}) ); - struct sample { - operator int() const { throw 42; } - }; - SECTION("valueless nested variant") { type value = inner{0.5f}; REQUIRE( std::holds_alternative<inner>(value) ); REQUIRE( std::holds_alternative<float>(std::get<inner>(value)) ); - REQUIRE_THROWS_AS( std::get<0>(value).emplace<int>(sample{}), int ); + REQUIRE_THROWS_AS( std::get<0>(value).emplace<MyType1>(MyType1{}), int ); // outer variant is still valid and contains inner REQUIRE( std::holds_alternative<inner>(value) ); diff --git a/packages/Catch2/projects/SelfTest/UsageTests/Tricky.tests.cpp b/packages/Catch2/projects/SelfTest/UsageTests/Tricky.tests.cpp index b0363d420..ea507a888 100644 --- a/packages/Catch2/projects/SelfTest/UsageTests/Tricky.tests.cpp +++ b/packages/Catch2/projects/SelfTest/UsageTests/Tricky.tests.cpp @@ -19,6 +19,7 @@ #include <stdio.h> #include <sstream> +#include <iostream> /////////////////////////////////////////////////////////////////////////////// TEST_CASE @@ -426,3 +427,10 @@ TEST_CASE( "Bitfields can be captured (#1027)" ) { REQUIRE( y.v == 0 ); REQUIRE( 0 == y.v ); } + +TEST_CASE("#1514: stderr/stdout is not captured in tests aborted by an exception", "[output-capture][regression][.]") { + std::cout << "This would not be caught previously\n" << std::flush; + std::clog << "Nor would this\n" << std::flush; + // FAIL aborts the test by throwing a Catch exception + FAIL("1514"); +} diff --git a/packages/Catch2/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm b/packages/Catch2/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm index 9bd1fa09d..e285138be 100644 --- a/packages/Catch2/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm +++ b/packages/Catch2/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm @@ -70,7 +70,7 @@ OC_TEST_CASE( "Matches work with OC types (NSString so far)", "[!shouldfail]" ) { using namespace Catch::Matchers; - REQUIRE_THAT( @"This is a string", Equals( @"This isnt a string" ) ); + REQUIRE_THAT( @"This is a string", Equals( @"This isn't a string" ) ); REQUIRE_THAT( @"This is a string", Contains( @"is a" ) ); REQUIRE_THAT( @"This is a string", StartsWith( @"This" ) ); REQUIRE_THAT( @"This is a string", EndsWith( @"string" ) ); diff --git a/packages/Catch2/scripts/scriptCommon.py b/packages/Catch2/scripts/scriptCommon.py index 4b70f9613..eadf9ff3e 100644 --- a/packages/Catch2/scripts/scriptCommon.py +++ b/packages/Catch2/scripts/scriptCommon.py @@ -6,8 +6,13 @@ import subprocess catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0]))) def getBuildExecutable(): - dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest") - return dir + if os.name == 'nt': + dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest.exe") + return dir + else: + dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest") + return dir + def runAndCapture( args ): child = subprocess.Popen(" ".join( args ), shell=True, stdout=subprocess.PIPE) diff --git a/packages/Catch2/single_include/catch2/catch.hpp b/packages/Catch2/single_include/catch2/catch.hpp index b1b2411d2..98672c07d 100644 --- a/packages/Catch2/single_include/catch2/catch.hpp +++ b/packages/Catch2/single_include/catch2/catch.hpp @@ -1,9 +1,9 @@ /* - * Catch v2.5.0 - * Generated: 2018-11-26 20:46:12.165372 + * Catch v2.7.1 + * Generated: 2019-04-05 18:22:37.720122 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly - * Copyright (c) 2018 Two Blue Cubes Ltd. All rights reserved. + * Copyright (c) 2019 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -14,8 +14,8 @@ #define CATCH_VERSION_MAJOR 2 -#define CATCH_VERSION_MINOR 5 -#define CATCH_VERSION_PATCH 0 +#define CATCH_VERSION_MINOR 7 +#define CATCH_VERSION_PATCH 1 #ifdef __clang__ # pragma clang system_header @@ -36,10 +36,11 @@ # pragma clang diagnostic ignored "-Wcovered-switch-default" # endif #elif defined __GNUC__ - // GCC likes to warn on REQUIREs, and we cannot suppress them - // locally because g++'s support for _Pragma is lacking in older, - // still supported, versions -# pragma GCC diagnostic ignored "-Wparentheses" + // Because REQUIREs trigger GCC's -Wparentheses, and because still + // supported version of g++ have only buggy support for _Pragmas, + // Wparentheses have to be suppressed globally. +# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details + # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-variable" # pragma GCC diagnostic ignored "-Wpadded" @@ -273,6 +274,14 @@ namespace Catch { #endif #endif +//////////////////////////////////////////////////////////////////////////////// +// Check if optional is available and usable +#if defined(__has_include) +# if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER) +# define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL +# endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER) +#endif // __has_include + //////////////////////////////////////////////////////////////////////////////// // Check if variant is available and usable #if defined(__has_include) @@ -283,9 +292,11 @@ namespace Catch { # include <ciso646> # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) # define CATCH_CONFIG_NO_CPP17_VARIANT -# else +# else # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) +# else +# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT # endif // defined(__clang__) && (__clang_major__ < 8) # endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER) #endif // __has_include @@ -309,6 +320,10 @@ namespace Catch { # define CATCH_CONFIG_CPP11_TO_STRING #endif +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) +# define CATCH_CONFIG_CPP17_OPTIONAL +#endif + #if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) # define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS #endif @@ -407,10 +422,10 @@ namespace Catch { line( _line ) {} - SourceLineInfo( SourceLineInfo const& other ) = default; - SourceLineInfo( SourceLineInfo && ) = default; - SourceLineInfo& operator = ( SourceLineInfo const& ) = default; - SourceLineInfo& operator = ( SourceLineInfo && ) = default; + SourceLineInfo( SourceLineInfo const& other ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo( SourceLineInfo&& ) noexcept = default; + SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; bool empty() const noexcept; bool operator == ( SourceLineInfo const& other ) const noexcept; @@ -463,7 +478,6 @@ namespace Catch { // start catch_interfaces_testcase.h #include <vector> -#include <memory> namespace Catch { @@ -474,8 +488,6 @@ namespace Catch { virtual ~ITestInvoker(); }; - using ITestCasePtr = std::shared_ptr<ITestInvoker>; - class TestCase; struct IConfig; @@ -500,8 +512,6 @@ namespace Catch { namespace Catch { - class StringData; - /// A non-owning string class (similar to the forthcoming std::string_view) /// Note that, because a StringRef may be a substring of another string, /// it may not be null terminated. c_str() must return a null terminated @@ -621,6 +631,8 @@ inline auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noex // start catch_type_traits.hpp +#include <type_traits> + namespace Catch{ #ifdef CATCH_CPP17_OR_GREATER @@ -699,6 +711,16 @@ struct is_unique<T0, T1, Rest...> : std::integral_constant #define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ #define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ #define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#else +// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) +#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#endif #define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) @@ -713,7 +735,81 @@ struct is_unique<T0, T1, Rest...> : std::integral_constant #define INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME(Name, ...) INTERNAL_CATCH_TEMPLATE_UNIQUE_NAME1(Name, INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) #endif +#define INTERNAL_CATCH_MAKE_TYPE_LIST(types) Catch::TypeList<INTERNAL_CATCH_REMOVE_PARENS(types)> + +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(types)\ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,INTERNAL_CATCH_REMOVE_PARENS(types)) + // end catch_preprocessor.hpp +// start catch_meta.hpp + + +#include <type_traits> + +namespace Catch { +template< typename... > +struct TypeList {}; + +template< typename... > +struct append; + +template< template<typename...> class L1 + , typename...E1 + , template<typename...> class L2 + , typename...E2 +> +struct append< L1<E1...>, L2<E2...> > { + using type = L1<E1..., E2...>; +}; + +template< template<typename...> class L1 + , typename...E1 + , template<typename...> class L2 + , typename...E2 + , typename...Rest +> +struct append< L1<E1...>, L2<E2...>, Rest...> { + using type = typename append< L1<E1..., E2...>, Rest... >::type; +}; + +template< template<typename...> class + , typename... +> +struct rewrap; + +template< template<typename...> class Container + , template<typename...> class List + , typename...elems +> +struct rewrap<Container, List<elems...>> { + using type = TypeList< Container< elems... > >; +}; + +template< template<typename...> class Container + , template<typename...> class List + , class...Elems + , typename...Elements> + struct rewrap<Container, List<Elems...>, Elements...> { + using type = typename append<TypeList<Container<Elems...>>, typename rewrap<Container, Elements...>::type>::type; +}; + +template< template<typename...> class...Containers > +struct combine { + template< typename...Types > + struct with_types { + template< template <typename...> class Final > + struct into { + using type = typename append<Final<>, typename rewrap<Containers, Types...>::type...>::type; + }; + }; +}; + +template<typename T> +struct always_false : std::false_type {}; + +} // namespace Catch + +// end catch_meta.hpp namespace Catch { template<typename C> @@ -849,6 +945,41 @@ struct AutoReg : NonCopyable { return 0;\ }(); + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, TmplTypes, TypesList) \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> static void TestFuncName(); \ + namespace { \ + template<typename... Types> \ + struct TestName { \ + TestName() { \ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...) \ + int index = 0; \ + using expander = int[]; \ + constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ + constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ + constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */\ + } \ + }; \ + static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ + using TestInit = Catch::combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)> \ + ::with_types<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(TypesList)>::into<TestName>::type; \ + TestInit(); \ + return 0; \ + }(); \ + } \ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + static void TestFuncName() + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\ + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ),Name,Tags,__VA_ARGS__) +#else + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ ) ) +#endif + #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, ... ) \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ namespace{ \ @@ -879,6 +1010,44 @@ struct AutoReg : NonCopyable { INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, __VA_ARGS__ ) ) #endif + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, TmplTypes, TypesList)\ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \ + void test();\ + };\ + namespace {\ + template<typename...Types>\ + struct TestNameClass{\ + TestNameClass(){\ + CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...)\ + int index = 0;\ + using expander = int[];\ + constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ + constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ + constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */ \ + }\ + };\ + static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ + using TestInit = Catch::combine<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>\ + ::with_types<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(TypesList)>::into<TestNameClass>::type;\ + TestInit();\ + return 0;\ + }(); \ + }\ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ + template<typename TestType> \ + void TestName<TestType>::test() + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\ + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, __VA_ARGS__ ) +#else + #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\ + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, __VA_ARGS__ ) ) +#endif + // end catch_test_registry.h // start catch_capture.hpp @@ -1370,6 +1539,7 @@ namespace Catch { # define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER # define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER # define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +# define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER #endif // Separate std::pair specialization @@ -1391,6 +1561,24 @@ namespace Catch { } #endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER +#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL) +#include <optional> +namespace Catch { + template<typename T> + struct StringMaker<std::optional<T> > { + static std::string convert(const std::optional<T>& optional) { + ReusableStringStream rss; + if (optional.has_value()) { + rss << ::Catch::Detail::stringify(*optional); + } else { + rss << "{ }"; + } + return rss.str(); + } + }; +} +#endif // CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER + // Separate std::tuple specialization #if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER) #include <tuple> @@ -1652,6 +1840,7 @@ struct ratio_string<std::milli> { #pragma warning(disable:4018) // more "signed/unsigned mismatch" #pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform) #pragma warning(disable:4180) // qualifier applied to function type has no meaning +#pragma warning(disable:4800) // Forcing result to true or false #endif namespace Catch { @@ -1695,6 +1884,62 @@ namespace Catch { m_op( op ), m_rhs( rhs ) {} + + template<typename T> + auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename T> + auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<T>::value, + "chained comparisons are not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } }; template<typename LhsT> @@ -1707,7 +1952,7 @@ namespace Catch { public: explicit UnaryExpr( LhsT lhs ) - : ITransientExpression{ false, lhs ? true : false }, + : ITransientExpression{ false, static_cast<bool>(lhs) }, m_lhs( lhs ) {} }; @@ -1774,6 +2019,20 @@ namespace Catch { return { static_cast<bool>(m_lhs <= rhs), m_lhs, "<=", rhs }; } + template<typename RhsT> + auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<RhsT>::value, + "operator&& is not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + + template<typename RhsT> + auto operator || ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { + static_assert(always_false<RhsT>::value, + "operator|| is not supported inside assertions, " + "wrap the expression inside parentheses, or decompose it"); + } + auto makeUnaryExpr() const -> UnaryExpr<LhsT> { return UnaryExpr<LhsT>{ m_lhs }; } @@ -1815,6 +2074,7 @@ namespace Catch { struct SectionInfo; struct SectionEndInfo; struct MessageInfo; + struct MessageBuilder; struct Counts; struct BenchmarkInfo; struct BenchmarkStats; @@ -1841,6 +2101,8 @@ namespace Catch { virtual void pushScopedMessage( MessageInfo const& message ) = 0; virtual void popScopedMessage( MessageInfo const& message ) = 0; + virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0; + virtual void handleFatalErrorCondition( StringRef message ) = 0; virtual void handleExpr @@ -2004,9 +2266,12 @@ namespace Catch { class ScopedMessage { public: explicit ScopedMessage( MessageBuilder const& builder ); + ScopedMessage( ScopedMessage& duplicate ) = delete; + ScopedMessage( ScopedMessage&& old ); ~ScopedMessage(); MessageInfo m_info; + bool m_moved; }; class Capturer { @@ -2069,7 +2334,7 @@ namespace Catch { CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ INTERNAL_CATCH_REACT( catchAssertionHandler ) \ - } while( (void)0, false && static_cast<bool>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look + } while( (void)0, (false) && static_cast<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 &&. /////////////////////////////////////////////////////////////////////////////// @@ -2150,6 +2415,10 @@ namespace Catch { #define INTERNAL_CATCH_INFO( macroName, log ) \ Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ); +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \ + Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ) + /////////////////////////////////////////////////////////////////////////////// // Although this is matcher-based, it can be used with just a string #define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \ @@ -3175,16 +3444,17 @@ namespace Catch { namespace Catch { namespace Generators { - class GeneratorBase { - protected: - size_t m_size = 0; - + class GeneratorUntypedBase { public: - GeneratorBase( size_t size ) : m_size( size ) {} - virtual ~GeneratorBase(); - auto size() const -> size_t { return m_size; } + GeneratorUntypedBase() = default; + virtual ~GeneratorUntypedBase(); + // Attempts to move the generator to the next element + // + // Returns true iff the move succeeded (and a valid element + // can be retrieved). + virtual bool next() = 0; }; - using GeneratorBasePtr = std::unique_ptr<GeneratorBase>; + using GeneratorBasePtr = std::unique_ptr<GeneratorUntypedBase>; } // namespace Generators @@ -3193,7 +3463,6 @@ namespace Catch { virtual auto hasGenerator() const -> bool = 0; virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0; virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0; - virtual auto getIndex() const -> std::size_t = 0; }; } // namespace Catch @@ -3233,8 +3502,21 @@ namespace Catch { #include <cassert> #include <utility> +#include <exception> namespace Catch { + +class GeneratorException : public std::exception { + const char* const m_msg = ""; + +public: + GeneratorException(const char* msg): + m_msg(msg) + {} + + const char* what() const noexcept override final; +}; + namespace Generators { // !TBD move this into its own location? @@ -3246,223 +3528,648 @@ namespace Generators { } template<typename T> - struct IGenerator { - virtual ~IGenerator() {} - virtual auto get( size_t index ) const -> T = 0; + struct IGenerator : GeneratorUntypedBase { + virtual ~IGenerator() = default; + + // Returns the current element of the generator + // + // \Precondition The generator is either freshly constructed, + // or the last call to `next()` returned true + virtual T const& get() const = 0; + using type = T; }; template<typename T> - class SingleValueGenerator : public IGenerator<T> { + class SingleValueGenerator final : public IGenerator<T> { T m_value; public: - SingleValueGenerator( T const& value ) : m_value( value ) {} + SingleValueGenerator(T const& value) : m_value( value ) {} + SingleValueGenerator(T&& value) : m_value(std::move(value)) {} - auto get( size_t ) const -> T override { + T const& get() const override { return m_value; } + bool next() override { + return false; + } }; template<typename T> - class FixedValuesGenerator : public IGenerator<T> { + class FixedValuesGenerator final : public IGenerator<T> { std::vector<T> m_values; - + size_t m_idx = 0; public: FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {} - auto get( size_t index ) const -> T override { - return m_values[index]; + T const& get() const override { + return m_values[m_idx]; + } + bool next() override { + ++m_idx; + return m_idx < m_values.size(); + } + }; + + template <typename T> + class GeneratorWrapper final { + std::unique_ptr<IGenerator<T>> m_generator; + public: + GeneratorWrapper(std::unique_ptr<IGenerator<T>> generator): + m_generator(std::move(generator)) + {} + T const& get() const { + return m_generator->get(); + } + bool next() { + return m_generator->next(); } }; + template <typename T> + GeneratorWrapper<T> value(T&& value) { + return GeneratorWrapper<T>(pf::make_unique<SingleValueGenerator<T>>(std::forward<T>(value))); + } + template <typename T> + GeneratorWrapper<T> values(std::initializer_list<T> values) { + return GeneratorWrapper<T>(pf::make_unique<FixedValuesGenerator<T>>(values)); + } + template<typename T> - class RangeGenerator : public IGenerator<T> { - T const m_first; - T const m_last; + class Generators : public IGenerator<T> { + std::vector<GeneratorWrapper<T>> m_generators; + size_t m_current = 0; + + void populate(GeneratorWrapper<T>&& generator) { + m_generators.emplace_back(std::move(generator)); + } + void populate(T&& val) { + m_generators.emplace_back(value(std::move(val))); + } + template<typename U> + void populate(U&& val) { + populate(T(std::move(val))); + } + template<typename U, typename... Gs> + void populate(U&& valueOrGenerator, Gs... moreGenerators) { + populate(std::forward<U>(valueOrGenerator)); + populate(std::forward<Gs>(moreGenerators)...); + } public: - RangeGenerator( T const& first, T const& last ) : m_first( first ), m_last( last ) { - assert( m_last > m_first ); + template <typename... Gs> + Generators(Gs... moreGenerators) { + m_generators.reserve(sizeof...(Gs)); + populate(std::forward<Gs>(moreGenerators)...); } - auto get( size_t index ) const -> T override { - // ToDo:: introduce a safe cast to catch potential overflows - return static_cast<T>(m_first+index); + T const& get() const override { + return m_generators[m_current].get(); } - }; - template<typename T> - struct NullGenerator : IGenerator<T> { - auto get( size_t ) const -> T override { - CATCH_INTERNAL_ERROR("A Null Generator is always empty"); + bool next() override { + if (m_current >= m_generators.size()) { + return false; + } + const bool current_status = m_generators[m_current].next(); + if (!current_status) { + ++m_current; + } + return m_current < m_generators.size(); } }; + template<typename... Ts> + GeneratorWrapper<std::tuple<Ts...>> table( std::initializer_list<std::tuple<typename std::decay<Ts>::type...>> tuples ) { + return values<std::tuple<Ts...>>( tuples ); + } + + // Tag type to signal that a generator sequence should convert arguments to a specific type + template <typename T> + struct as {}; + + template<typename T, typename... Gs> + auto makeGenerators( GeneratorWrapper<T>&& generator, Gs... moreGenerators ) -> Generators<T> { + return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...); + } template<typename T> - class Generator { - std::unique_ptr<IGenerator<T>> m_generator; - size_t m_size; + auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> { + return Generators<T>(std::move(generator)); + } + template<typename T, typename... Gs> + auto makeGenerators( T&& val, Gs... moreGenerators ) -> Generators<T> { + return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... ); + } + template<typename T, typename U, typename... Gs> + auto makeGenerators( as<T>, U&& val, Gs... moreGenerators ) -> Generators<T> { + return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... ); + } - public: - Generator( size_t size, std::unique_ptr<IGenerator<T>> generator ) - : m_generator( std::move( generator ) ), - m_size( size ) - {} + auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&; - auto size() const -> size_t { return m_size; } - auto operator[]( size_t index ) const -> T { - assert( index < m_size ); - return m_generator->get( index ); + template<typename L> + // Note: The type after -> is weird, because VS2015 cannot parse + // the expression used in the typedef inside, when it is in + // return type. Yeah. + auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) { + using UnderlyingType = typename decltype(generatorExpression())::type; + + IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo ); + if (!tracker.hasGenerator()) { + tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression())); } - }; - std::vector<size_t> randomiseIndices( size_t selectionSize, size_t sourceSize ); + auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() ); + return generator.get(); + } - template<typename T> - class GeneratorRandomiser : public IGenerator<T> { - Generator<T> m_baseGenerator; +} // namespace Generators +} // namespace Catch + +#define GENERATE( ... ) \ + Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) +#define GENERATE_COPY( ... ) \ + Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) +#define GENERATE_REF( ... ) \ + Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) - std::vector<size_t> m_indices; +// end catch_generators.hpp +// start catch_generators_generic.hpp + +namespace Catch { +namespace Generators { + + template <typename T> + class TakeGenerator : public IGenerator<T> { + GeneratorWrapper<T> m_generator; + size_t m_returned = 0; + size_t m_target; public: - GeneratorRandomiser( Generator<T>&& baseGenerator, size_t numberOfItems ) - : m_baseGenerator( std::move( baseGenerator ) ), - m_indices( randomiseIndices( numberOfItems, m_baseGenerator.size() ) ) - {} + TakeGenerator(size_t target, GeneratorWrapper<T>&& generator): + m_generator(std::move(generator)), + m_target(target) + { + assert(target != 0 && "Empty generators are not allowed"); + } + T const& get() const override { + return m_generator.get(); + } + bool next() override { + ++m_returned; + if (m_returned >= m_target) { + return false; + } - auto get( size_t index ) const -> T override { - return m_baseGenerator[m_indices[index]]; + const auto success = m_generator.next(); + // If the underlying generator does not contain enough values + // then we cut short as well + if (!success) { + m_returned = m_target; + } + return success; } }; - template<typename T> - struct RequiresASpecialisationFor; + template <typename T> + GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<T>(pf::make_unique<TakeGenerator<T>>(target, std::move(generator))); + } - template<typename T> - auto all() -> Generator<T> { return RequiresASpecialisationFor<T>(); } + template <typename T, typename Predicate> + class FilterGenerator : public IGenerator<T> { + GeneratorWrapper<T> m_generator; + Predicate m_predicate; + public: + template <typename P = Predicate> + FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator): + m_generator(std::move(generator)), + m_predicate(std::forward<P>(pred)) + { + if (!m_predicate(m_generator.get())) { + // It might happen that there are no values that pass the + // filter. In that case we throw an exception. + auto has_initial_value = next(); + if (!has_initial_value) { + Catch::throw_exception(GeneratorException("No valid value found in filtered generator")); + } + } + } - template<> - auto all<int>() -> Generator<int>; + T const& get() const override { + return m_generator.get(); + } - template<typename T> - auto range( T const& first, T const& last ) -> Generator<T> { - return Generator<T>( (last-first), pf::make_unique<RangeGenerator<T>>( first, last ) ); + bool next() override { + bool success = m_generator.next(); + if (!success) { + return false; + } + while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true); + return success; + } + }; + + template <typename T, typename Predicate> + GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<T>(std::unique_ptr<IGenerator<T>>(pf::make_unique<FilterGenerator<T, Predicate>>(std::forward<Predicate>(pred), std::move(generator)))); } - template<typename T> - auto random( T const& first, T const& last ) -> Generator<T> { - auto gen = range( first, last ); - auto size = gen.size(); + template <typename T> + class RepeatGenerator : public IGenerator<T> { + GeneratorWrapper<T> m_generator; + mutable std::vector<T> m_returned; + size_t m_target_repeats; + size_t m_current_repeat = 0; + size_t m_repeat_index = 0; + public: + RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator): + m_generator(std::move(generator)), + m_target_repeats(repeats) + { + assert(m_target_repeats > 0 && "Repeat generator must repeat at least once"); + } + + T const& get() const override { + if (m_current_repeat == 0) { + m_returned.push_back(m_generator.get()); + return m_returned.back(); + } + return m_returned[m_repeat_index]; + } - return Generator<T>( size, pf::make_unique<GeneratorRandomiser<T>>( std::move( gen ), size ) ); + bool next() override { + // There are 2 basic cases: + // 1) We are still reading the generator + // 2) We are reading our own cache + + // In the first case, we need to poke the underlying generator. + // If it happily moves, we are left in that state, otherwise it is time to start reading from our cache + if (m_current_repeat == 0) { + const auto success = m_generator.next(); + if (!success) { + ++m_current_repeat; + } + return m_current_repeat < m_target_repeats; + } + + // In the second case, we need to move indices forward and check that we haven't run up against the end + ++m_repeat_index; + if (m_repeat_index == m_returned.size()) { + m_repeat_index = 0; + ++m_current_repeat; + } + return m_current_repeat < m_target_repeats; + } + }; + + template <typename T> + GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<T>(pf::make_unique<RepeatGenerator<T>>(repeats, std::move(generator))); } - template<typename T> - auto random( size_t size ) -> Generator<T> { - return Generator<T>( size, pf::make_unique<GeneratorRandomiser<T>>( all<T>(), size ) ); + + template <typename T, typename U, typename Func> + class MapGenerator : public IGenerator<T> { + // TBD: provide static assert for mapping function, for friendly error message + GeneratorWrapper<U> m_generator; + Func m_function; + // To avoid returning dangling reference, we have to save the values + T m_cache; + public: + template <typename F2 = Func> + MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) : + m_generator(std::move(generator)), + m_function(std::forward<F2>(function)), + m_cache(m_function(m_generator.get())) + {} + + T const& get() const override { + return m_cache; + } + bool next() override { + const auto success = m_generator.next(); + if (success) { + m_cache = m_function(m_generator.get()); + } + return success; + } + }; + +#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703 + // std::result_of is deprecated in C++17 and removed in C++20. Hence, it is + // replaced with std::invoke_result here. Also *_t format is preferred over + // typename *::type format. + template <typename Func, typename U> + using MapFunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U>>>; +#else + template <typename Func, typename U> + using MapFunctionReturnType = typename std::remove_reference<typename std::remove_cv<typename std::result_of<Func(U)>::type>::type>::type; +#endif + + template <typename Func, typename U, typename T = MapFunctionReturnType<Func, U>> + GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { + return GeneratorWrapper<T>( + pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + ); } - template<typename T> - auto values( std::initializer_list<T> values ) -> Generator<T> { - return Generator<T>( values.size(), pf::make_unique<FixedValuesGenerator<T>>( values ) ); + template <typename T, typename U, typename Func> + GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { + return GeneratorWrapper<T>( + pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + ); } - template<typename T> - auto value( T const& val ) -> Generator<T> { - return Generator<T>( 1, pf::make_unique<SingleValueGenerator<T>>( val ) ); + + template <typename T> + class ChunkGenerator final : public IGenerator<std::vector<T>> { + std::vector<T> m_chunk; + size_t m_chunk_size; + GeneratorWrapper<T> m_generator; + bool m_used_up = false; + public: + ChunkGenerator(size_t size, GeneratorWrapper<T> generator) : + m_chunk_size(size), m_generator(std::move(generator)) + { + m_chunk.reserve(m_chunk_size); + m_chunk.push_back(m_generator.get()); + for (size_t i = 1; i < m_chunk_size; ++i) { + if (!m_generator.next()) { + Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk")); + } + m_chunk.push_back(m_generator.get()); + } + } + std::vector<T> const& get() const override { + return m_chunk; + } + bool next() override { + m_chunk.clear(); + for (size_t idx = 0; idx < m_chunk_size; ++idx) { + if (!m_generator.next()) { + return false; + } + m_chunk.push_back(m_generator.get()); + } + return true; + } + }; + + template <typename T> + GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) { + return GeneratorWrapper<std::vector<T>>( + pf::make_unique<ChunkGenerator<T>>(size, std::move(generator)) + ); } - template<typename T> - auto as() -> Generator<T> { - return Generator<T>( 0, pf::make_unique<NullGenerator<T>>() ); +} // namespace Generators +} // namespace Catch + +// end catch_generators_generic.hpp +// start catch_generators_specific.hpp + +// start catch_context.h + +#include <memory> + +namespace Catch { + + struct IResultCapture; + struct IRunner; + struct IConfig; + struct IMutableContext; + + using IConfigPtr = std::shared_ptr<IConfig const>; + + struct IContext + { + virtual ~IContext(); + + virtual IResultCapture* getResultCapture() = 0; + virtual IRunner* getRunner() = 0; + virtual IConfigPtr const& getConfig() const = 0; + }; + + struct IMutableContext : IContext + { + virtual ~IMutableContext(); + virtual void setResultCapture( IResultCapture* resultCapture ) = 0; + virtual void setRunner( IRunner* runner ) = 0; + virtual void setConfig( IConfigPtr const& config ) = 0; + + private: + static IMutableContext *currentContext; + friend IMutableContext& getCurrentMutableContext(); + friend void cleanUpContext(); + static void createContext(); + }; + + inline IMutableContext& getCurrentMutableContext() + { + if( !IMutableContext::currentContext ) + IMutableContext::createContext(); + return *IMutableContext::currentContext; } - template<typename... Ts> - auto table( std::initializer_list<std::tuple<Ts...>>&& tuples ) -> Generator<std::tuple<Ts...>> { - return values<std::tuple<Ts...>>( std::forward<std::initializer_list<std::tuple<Ts...>>>( tuples ) ); + inline IContext& getCurrentContext() + { + return getCurrentMutableContext(); } - template<typename T> - struct Generators : GeneratorBase { - std::vector<Generator<T>> m_generators; + void cleanUpContext(); +} - using type = T; +// end catch_context.h +// start catch_interfaces_config.h - Generators() : GeneratorBase( 0 ) {} +#include <iosfwd> +#include <string> +#include <vector> +#include <memory> - void populate( T&& val ) { - m_size += 1; - m_generators.emplace_back( value( std::move( val ) ) ); - } - template<typename U> - void populate( U&& val ) { - populate( T( std::move( val ) ) ); - } - void populate( Generator<T>&& generator ) { - m_size += generator.size(); - m_generators.emplace_back( std::move( generator ) ); - } +namespace Catch { - template<typename U, typename... Gs> - void populate( U&& valueOrGenerator, Gs... moreGenerators ) { - populate( std::forward<U>( valueOrGenerator ) ); - populate( std::forward<Gs>( moreGenerators )... ); - } + enum class Verbosity { + Quiet = 0, + Normal, + High + }; - auto operator[]( size_t index ) const -> T { - size_t sizes = 0; - for( auto const& gen : m_generators ) { - auto localIndex = index-sizes; - sizes += gen.size(); - if( index < sizes ) - return gen[localIndex]; - } - CATCH_INTERNAL_ERROR("Index '" << index << "' is out of range (" << sizes << ')'); - } + struct WarnAbout { enum What { + Nothing = 0x00, + NoAssertions = 0x01, + NoTests = 0x02 + }; }; + + struct ShowDurations { enum OrNot { + DefaultForReporter, + Always, + Never + }; }; + struct RunTests { enum InWhatOrder { + InDeclarationOrder, + InLexicographicalOrder, + InRandomOrder + }; }; + struct UseColour { enum YesOrNo { + Auto, + Yes, + No + }; }; + struct WaitForKeypress { enum When { + Never, + BeforeStart = 1, + BeforeExit = 2, + BeforeStartAndExit = BeforeStart | BeforeExit + }; }; + + class TestSpec; + + struct IConfig : NonCopyable { + + virtual ~IConfig(); + + virtual bool allowThrows() const = 0; + virtual std::ostream& stream() const = 0; + virtual std::string name() const = 0; + virtual bool includeSuccessfulResults() const = 0; + virtual bool shouldDebugBreak() const = 0; + virtual bool warnAboutMissingAssertions() const = 0; + virtual bool warnAboutNoTests() const = 0; + virtual int abortAfter() const = 0; + virtual bool showInvisibles() const = 0; + virtual ShowDurations::OrNot showDurations() const = 0; + virtual TestSpec const& testSpec() const = 0; + virtual bool hasTestFilters() const = 0; + virtual std::vector<std::string> const& getTestsOrTags() const = 0; + virtual RunTests::InWhatOrder runOrder() const = 0; + virtual unsigned int rngSeed() const = 0; + virtual int benchmarkResolutionMultiple() const = 0; + virtual UseColour::YesOrNo useColour() const = 0; + virtual std::vector<std::string> const& getSectionsToRun() const = 0; + virtual Verbosity verbosity() const = 0; }; - template<typename T, typename... Gs> - auto makeGenerators( Generator<T>&& generator, Gs... moreGenerators ) -> Generators<T> { - Generators<T> generators; - generators.m_generators.reserve( 1+sizeof...(Gs) ); - generators.populate( std::move( generator ), std::forward<Gs>( moreGenerators )... ); - return generators; + using IConfigPtr = std::shared_ptr<IConfig const>; +} + +// end catch_interfaces_config.h +#include <random> + +namespace Catch { +namespace Generators { + +template <typename Float> +class RandomFloatingGenerator final : public IGenerator<Float> { + // FIXME: What is the right seed? + std::minstd_rand m_rand; + std::uniform_real_distribution<Float> m_dist; + Float m_current_number; +public: + + RandomFloatingGenerator(Float a, Float b): + m_rand(getCurrentContext().getConfig()->rngSeed()), + m_dist(a, b) { + static_cast<void>(next()); } - template<typename T> - auto makeGenerators( Generator<T>&& generator ) -> Generators<T> { - Generators<T> generators; - generators.populate( std::move( generator ) ); - return generators; + + Float const& get() const override { + return m_current_number; } - template<typename T, typename... Gs> - auto makeGenerators( T&& val, Gs... moreGenerators ) -> Generators<T> { - return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... ); + bool next() override { + m_current_number = m_dist(m_rand); + return true; } - template<typename T, typename U, typename... Gs> - auto makeGenerators( U&& val, Gs... moreGenerators ) -> Generators<T> { - return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... ); +}; + +template <typename Integer> +class RandomIntegerGenerator final : public IGenerator<Integer> { + std::minstd_rand m_rand; + std::uniform_int_distribution<Integer> m_dist; + Integer m_current_number; +public: + + RandomIntegerGenerator(Integer a, Integer b): + m_rand(getCurrentContext().getConfig()->rngSeed()), + m_dist(a, b) { + static_cast<void>(next()); + } + + Integer const& get() const override { + return m_current_number; + } + bool next() override { + m_current_number = m_dist(m_rand); + return true; } +}; - auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&; +// TODO: Ideally this would be also constrained against the various char types, +// but I don't expect users to run into that in practice. +template <typename T> +typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value, +GeneratorWrapper<T>>::type +random(T a, T b) { + return GeneratorWrapper<T>( + pf::make_unique<RandomIntegerGenerator<T>>(a, b) + ); +} - template<typename L> - // Note: The type after -> is weird, because VS2015 cannot parse - // the expression used in the typedef inside, when it is in - // return type. Yeah, ¯\_(ツ)_/¯ - auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>()[0]) { - using UnderlyingType = typename decltype(generatorExpression())::type; +template <typename T> +typename std::enable_if<std::is_floating_point<T>::value, +GeneratorWrapper<T>>::type +random(T a, T b) { + return GeneratorWrapper<T>( + pf::make_unique<RandomFloatingGenerator<T>>(a, b) + ); +} - IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo ); - if( !tracker.hasGenerator() ) - tracker.setGenerator( pf::make_unique<Generators<UnderlyingType>>( generatorExpression() ) ); +template <typename T> +class RangeGenerator final : public IGenerator<T> { + T m_current; + T m_end; + T m_step; + bool m_positive; + +public: + RangeGenerator(T const& start, T const& end, T const& step): + m_current(start), + m_end(end), + m_step(step), + m_positive(m_step > T(0)) + { + assert(m_current != m_end && "Range start and end cannot be equal"); + assert(m_step != T(0) && "Step size cannot be zero"); + assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end"); + } + + RangeGenerator(T const& start, T const& end): + RangeGenerator(start, end, (start < end) ? T(1) : T(-1)) + {} + + T const& get() const override { + return m_current; + } - auto const& generator = static_cast<Generators<UnderlyingType> const&>( *tracker.getGenerator() ); - return generator[tracker.getIndex()]; + bool next() override { + m_current += m_step; + return (m_positive) ? (m_current < m_end) : (m_current > m_end); } +}; + +template <typename T> +GeneratorWrapper<T> range(T const& start, T const& end, T const& step) { + static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer"); + return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end, step)); +} + +template <typename T> +GeneratorWrapper<T> range(T const& start, T const& end) { + static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer"); + return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end)); +} } // namespace Generators } // namespace Catch -#define GENERATE( ... ) \ - Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, []{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) - -// end catch_generators.hpp +// end catch_generators_specific.hpp // These files are included here so the single_include script doesn't put them // in the conditionally compiled sections @@ -3662,7 +4369,7 @@ namespace Catch { arcSafeRelease( m_substr ); } - bool match( NSString* arg ) const override { + bool match( NSString* const& str ) const override { return false; } @@ -3672,7 +4379,7 @@ namespace Catch { struct Equals : StringHolder { Equals( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const override { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str isEqualToString:m_substr]; } @@ -3685,7 +4392,7 @@ namespace Catch { struct Contains : StringHolder { Contains( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str rangeOfString:m_substr].location != NSNotFound; } @@ -3698,7 +4405,7 @@ namespace Catch { struct StartsWith : StringHolder { StartsWith( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const override { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str rangeOfString:m_substr].location == 0; } @@ -3710,7 +4417,7 @@ namespace Catch { struct EndsWith : StringHolder { EndsWith( NSString* substr ) : StringHolder( substr ){} - bool match( NSString* str ) const override { + bool match( NSString* const& str ) const override { return (str != nil || m_substr == nil ) && [str rangeOfString:m_substr].location == [str length] - [m_substr length]; } @@ -3949,79 +4656,6 @@ namespace Catch { #endif // end catch_test_spec_parser.h -// start catch_interfaces_config.h - -#include <iosfwd> -#include <string> -#include <vector> -#include <memory> - -namespace Catch { - - enum class Verbosity { - Quiet = 0, - Normal, - High - }; - - struct WarnAbout { enum What { - Nothing = 0x00, - NoAssertions = 0x01, - NoTests = 0x02 - }; }; - - struct ShowDurations { enum OrNot { - DefaultForReporter, - Always, - Never - }; }; - struct RunTests { enum InWhatOrder { - InDeclarationOrder, - InLexicographicalOrder, - InRandomOrder - }; }; - struct UseColour { enum YesOrNo { - Auto, - Yes, - No - }; }; - struct WaitForKeypress { enum When { - Never, - BeforeStart = 1, - BeforeExit = 2, - BeforeStartAndExit = BeforeStart | BeforeExit - }; }; - - class TestSpec; - - struct IConfig : NonCopyable { - - virtual ~IConfig(); - - virtual bool allowThrows() const = 0; - virtual std::ostream& stream() const = 0; - virtual std::string name() const = 0; - virtual bool includeSuccessfulResults() const = 0; - virtual bool shouldDebugBreak() const = 0; - virtual bool warnAboutMissingAssertions() const = 0; - virtual bool warnAboutNoTests() const = 0; - virtual int abortAfter() const = 0; - virtual bool showInvisibles() const = 0; - virtual ShowDurations::OrNot showDurations() const = 0; - virtual TestSpec const& testSpec() const = 0; - virtual bool hasTestFilters() const = 0; - virtual RunTests::InWhatOrder runOrder() const = 0; - virtual unsigned int rngSeed() const = 0; - virtual int benchmarkResolutionMultiple() const = 0; - virtual UseColour::YesOrNo useColour() const = 0; - virtual std::vector<std::string> const& getSectionsToRun() const = 0; - virtual Verbosity verbosity() const = 0; - }; - - using IConfigPtr = std::shared_ptr<IConfig const>; -} - -// end catch_interfaces_config.h // Libstdc++ doesn't like incomplete classes for unique_ptr #include <memory> @@ -4091,7 +4725,7 @@ namespace Catch { std::string getProcessName() const; std::string const& getReporterName() const; - std::vector<std::string> const& getTestsOrTags() const; + std::vector<std::string> const& getTestsOrTags() const override; std::vector<std::string> const& getSectionsToRun() const override; virtual TestSpec const& testSpec() const override; @@ -4301,8 +4935,8 @@ namespace Catch { AssertionStats( AssertionStats const& ) = default; AssertionStats( AssertionStats && ) = default; - AssertionStats& operator = ( AssertionStats const& ) = default; - AssertionStats& operator = ( AssertionStats && ) = default; + AssertionStats& operator = ( AssertionStats const& ) = delete; + AssertionStats& operator = ( AssertionStats && ) = delete; virtual ~AssertionStats(); AssertionResult assertionResult; @@ -4465,6 +5099,8 @@ namespace Catch { // Returns double formatted as %.3f (format expected on output) std::string getFormattedDuration( double duration ); + std::string serializeFilters( std::vector<std::string> const& container ); + template<typename DerivedT> struct StreamingReporterBase : IStreamingReporter { @@ -4492,6 +5128,7 @@ namespace Catch { void testRunStarting(TestRunInfo const& _testRunInfo) override { currentTestRunInfo = _testRunInfo; } + void testGroupStarting(GroupInfo const& _groupInfo) override { currentGroupInfo = _groupInfo; } @@ -4904,7 +5541,7 @@ namespace Catch { void testCaseEnded(TestCaseStats const& _testCaseStats) override; void testGroupEnded(TestGroupStats const& _testGroupStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; - + void testRunStarting(TestRunInfo const& _testRunInfo) override; private: void lazyPrint(); @@ -4926,6 +5563,7 @@ namespace Catch { void printTotalsDivider(Totals const& totals); void printSummaryDivider(); + void printTestFilters(); private: bool m_headerPrinted = false; @@ -5189,7 +5827,7 @@ namespace TestCaseTracking { // Debug/ checking virtual bool isSectionTracker() const = 0; - virtual bool isIndexTracker() const = 0; + virtual bool isGeneratorTracker() const = 0; }; class TrackerContext { @@ -5254,7 +5892,7 @@ namespace TestCaseTracking { void openChild() override; bool isSectionTracker() const override; - bool isIndexTracker() const override; + bool isGeneratorTracker() const override; void open(); @@ -5274,6 +5912,8 @@ namespace TestCaseTracking { bool isSectionTracker() const override; + bool isComplete() const override; + static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ); void tryOpen(); @@ -5282,28 +5922,11 @@ namespace TestCaseTracking { void addNextFilters( std::vector<std::string> const& filters ); }; - class IndexTracker : public TrackerBase { - int m_size; - int m_index = -1; - public: - IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ); - - bool isIndexTracker() const override; - void close() override; - - static IndexTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ); - - int index() const; - - void moveNext(); - }; - } // namespace TestCaseTracking using TestCaseTracking::ITracker; using TestCaseTracking::TrackerContext; using TestCaseTracking::SectionTracker; -using TestCaseTracking::IndexTracker; } // namespace Catch @@ -5401,58 +6024,6 @@ std::string StringMaker<Catch::Detail::Approx>::convert(Catch::Detail::Approx co // end catch_approx.cpp // start catch_assertionhandler.cpp -// start catch_context.h - -#include <memory> - -namespace Catch { - - struct IResultCapture; - struct IRunner; - struct IConfig; - struct IMutableContext; - - using IConfigPtr = std::shared_ptr<IConfig const>; - - struct IContext - { - virtual ~IContext(); - - virtual IResultCapture* getResultCapture() = 0; - virtual IRunner* getRunner() = 0; - virtual IConfigPtr const& getConfig() const = 0; - }; - - struct IMutableContext : IContext - { - virtual ~IMutableContext(); - virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( IConfigPtr const& config ) = 0; - - private: - static IMutableContext *currentContext; - friend IMutableContext& getCurrentMutableContext(); - friend void cleanUpContext(); - static void createContext(); - }; - - inline IMutableContext& getCurrentMutableContext() - { - if( !IMutableContext::currentContext ) - IMutableContext::createContext(); - return *IMutableContext::currentContext; - } - - inline IContext& getCurrentContext() - { - return getCurrentMutableContext(); - } - - void cleanUpContext(); -} - -// end catch_context.h // start catch_debugger.h namespace Catch { @@ -5482,12 +6053,9 @@ namespace Catch { #endif #ifdef CATCH_TRAP - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } + #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }() #else - namespace Catch { - inline void doNothing() {} - } - #define CATCH_BREAK_INTO_DEBUGGER() Catch::doNothing() + #define CATCH_BREAK_INTO_DEBUGGER() []{}() #endif // end catch_debugger.h @@ -5642,6 +6210,8 @@ namespace Catch { void pushScopedMessage( MessageInfo const& message ) override; void popScopedMessage( MessageInfo const& message ) override; + void emplaceUnscopedMessage( MessageBuilder const& builder ) override; + std::string getCurrentTestName() const override; const AssertionResult* getLastResult() const override; @@ -5682,13 +6252,14 @@ namespace Catch { TestRunInfo m_runInfo; IMutableContext& m_context; TestCase const* m_activeTestCase = nullptr; - ITracker* m_testCaseTracker; + ITracker* m_testCaseTracker = nullptr; Option<AssertionResult> m_lastResult; IConfigPtr m_config; Totals m_totals; IStreamingReporterPtr m_reporter; std::vector<MessageInfo> m_messages; + std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */ AssertionInfo m_lastAssertionInfo; std::vector<SectionEndInfo> m_unfinishedSections; std::vector<ITracker*> m_activeSections; @@ -6325,6 +6896,7 @@ inline auto Column::operator + (Column const& other) -> Columns { // ----------- end of #include from clara_textflow.hpp ----------- // ........... back in clara.hpp +#include <cctype> #include <string> #include <memory> #include <set> @@ -6617,7 +7189,7 @@ namespace detail { } inline auto convertInto( std::string const &source, bool &target ) -> ParserResult { std::string srcLC = source; - std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( ::tolower(c) ); } ); + std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( std::tolower(c) ); } ); if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on") target = true; else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off") @@ -7682,7 +8254,8 @@ namespace { private: void setColour( const char* _escapeCode ) { - Catch::cout() << '\033' << _escapeCode; + getCurrentContext().getConfig()->stream() + << '\033' << _escapeCode; } }; @@ -8061,18 +8634,24 @@ namespace Catch { } } + std::string ExceptionTranslatorRegistry::tryTranslators() const { + if (m_translators.empty()) { + std::rethrow_exception(std::current_exception()); + } else { + return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end()); + } + } + #else // ^^ Exceptions are enabled // Exceptions are disabled vv std::string ExceptionTranslatorRegistry::translateActiveException() const { CATCH_INTERNAL_ERROR("Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!"); } -#endif std::string ExceptionTranslatorRegistry::tryTranslators() const { - if( m_translators.empty() ) - std::rethrow_exception(std::current_exception()); - else - return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() ); + CATCH_INTERNAL_ERROR("Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!"); } +#endif + } // end catch_exception_translator_registry.cpp // start catch_fatal_condition.cpp @@ -8102,10 +8681,10 @@ namespace Catch { // Windows can easily distinguish between SO and SigSegV, // but SigInt, SigTerm, etc are handled differently. static SignalDefs signalDefs[] = { - { EXCEPTION_ILLEGAL_INSTRUCTION, "SIGILL - Illegal instruction signal" }, - { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" }, - { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" }, - { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" }, + { static_cast<DWORD>(EXCEPTION_ILLEGAL_INSTRUCTION), "SIGILL - Illegal instruction signal" }, + { static_cast<DWORD>(EXCEPTION_STACK_OVERFLOW), "SIGSEGV - Stack overflow" }, + { static_cast<DWORD>(EXCEPTION_ACCESS_VIOLATION), "SIGSEGV - Segmentation violation signal" }, + { static_cast<DWORD>(EXCEPTION_INT_DIVIDE_BY_ZERO), "Divide by zero error" }, }; LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { @@ -8261,36 +8840,18 @@ namespace Catch { IGeneratorTracker::~IGeneratorTracker() {} -namespace Generators { - - GeneratorBase::~GeneratorBase() {} - - std::vector<size_t> randomiseIndices( size_t selectionSize, size_t sourceSize ) { +const char* GeneratorException::what() const noexcept { + return m_msg; +} - assert( selectionSize <= sourceSize ); - std::vector<size_t> indices; - indices.reserve( selectionSize ); - std::uniform_int_distribution<size_t> uid( 0, sourceSize-1 ); +namespace Generators { - std::set<size_t> seen; - // !TBD: improve this algorithm - while( indices.size() < selectionSize ) { - auto index = uid( rng() ); - if( seen.insert( index ).second ) - indices.push_back( index ); - } - return indices; - } + GeneratorUntypedBase::~GeneratorUntypedBase() {} auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& { return getResultCapture().acquireGeneratorTracker( lineInfo ); } - template<> - auto all<int>() -> Generator<int> { - return range( std::numeric_limits<int>::min(), std::numeric_limits<int>::max() ); - } - } // namespace Generators } // namespace Catch // end catch_generators.cpp @@ -8538,7 +9099,7 @@ namespace Catch { std::size_t listReporters(); - Option<std::size_t> list( Config const& config ); + Option<std::size_t> list( std::shared_ptr<Config> const& config ); } // end namespace Catch @@ -8676,15 +9237,16 @@ namespace Catch { return factories.size(); } - Option<std::size_t> list( Config const& config ) { + Option<std::size_t> list( std::shared_ptr<Config> const& config ) { Option<std::size_t> listedCount; - if( config.listTests() ) - listedCount = listedCount.valueOr(0) + listTests( config ); - if( config.listTestNamesOnly() ) - listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config ); - if( config.listTags() ) - listedCount = listedCount.valueOr(0) + listTags( config ); - if( config.listReporters() ) + getCurrentMutableContext().setConfig( config ); + if( config->listTests() ) + listedCount = listedCount.valueOr(0) + listTests( *config ); + if( config->listTestNamesOnly() ) + listedCount = listedCount.valueOr(0) + listTestsNamesOnly( *config ); + if( config->listTags() ) + listedCount = listedCount.valueOr(0) + listTags( *config ); + if( config->listReporters() ) listedCount = listedCount.valueOr(0) + listReporters(); return listedCount; } @@ -9030,14 +9592,20 @@ namespace Catch { //////////////////////////////////////////////////////////////////////////// ScopedMessage::ScopedMessage( MessageBuilder const& builder ) - : m_info( builder.m_info ) + : m_info( builder.m_info ), m_moved() { m_info.message = builder.m_stream.str(); getResultCapture().pushScopedMessage( m_info ); } + ScopedMessage::ScopedMessage( ScopedMessage&& old ) + : m_info( old.m_info ), m_moved() + { + old.m_moved = true; + } + ScopedMessage::~ScopedMessage() { - if ( !uncaught_exceptions() ){ + if ( !uncaught_exceptions() && !m_moved ){ getResultCapture().popScopedMessage(m_info); } } @@ -9145,6 +9713,22 @@ namespace Catch { auto str() const -> std::string; }; + class RedirectedStreams { + public: + RedirectedStreams(RedirectedStreams const&) = delete; + RedirectedStreams& operator=(RedirectedStreams const&) = delete; + RedirectedStreams(RedirectedStreams&&) = delete; + RedirectedStreams& operator=(RedirectedStreams&&) = delete; + + RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr); + ~RedirectedStreams(); + private: + std::string& m_redirectedCout; + std::string& m_redirectedCerr; + RedirectedStdOut m_redirectedStdOut; + RedirectedStdErr m_redirectedStdErr; + }; + #if defined(CATCH_CONFIG_NEW_CAPTURE) // Windows's implementation of std::tmpfile is terrible (it tries @@ -9236,6 +9820,16 @@ namespace Catch { {} auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); } + RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr) + : m_redirectedCout(redirectedCout), + m_redirectedCerr(redirectedCerr) + {} + + RedirectedStreams::~RedirectedStreams() { + m_redirectedCout += m_redirectedStdOut.str(); + m_redirectedCerr += m_redirectedStdErr.str(); + } + #if defined(CATCH_CONFIG_NEW_CAPTURE) #if defined(_MSC_VER) @@ -9671,7 +10265,6 @@ namespace Catch { namespace Generators { struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker { - size_t m_index = static_cast<size_t>( -1 ); GeneratorBasePtr m_generator; GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) @@ -9685,7 +10278,7 @@ namespace Catch { ITracker& currentTracker = ctx.currentTracker(); if( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { assert( childTracker ); - assert( childTracker->isIndexTracker() ); + assert( childTracker->isGeneratorTracker() ); tracker = std::static_pointer_cast<GeneratorTracker>( childTracker ); } else { @@ -9694,28 +10287,24 @@ namespace Catch { } if( !ctx.completedCycle() && !tracker->isComplete() ) { - if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) - tracker->moveNext(); tracker->open(); } return *tracker; } - void moveNext() { - m_index++; - m_children.clear(); - } - // TrackerBase interface - bool isIndexTracker() const override { return true; } + bool isGeneratorTracker() const override { return true; } auto hasGenerator() const -> bool override { return !!m_generator; } void close() override { TrackerBase::close(); - if( m_runState == CompletedSuccessfully && m_index < m_generator->size()-1 ) + // Generator interface only finds out if it has another item on atual move + if (m_runState == CompletedSuccessfully && m_generator->next()) { + m_children.clear(); m_runState = Executing; + } } // IGeneratorTracker interface @@ -9725,9 +10314,6 @@ namespace Catch { void setGenerator( GeneratorBasePtr&& generator ) override { m_generator = std::move( generator ); } - auto getIndex() const -> size_t override { - return m_index; - } }; GeneratorTracker::~GeneratorTracker() {} } @@ -9825,6 +10411,9 @@ namespace Catch { // and should be let to clear themselves out. static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); + if (result.getResultType() != ResultWas::Warning) + m_messageScopes.clear(); + // Reset working state resetAssertionInfo(); m_lastResult = result; @@ -9879,6 +10468,7 @@ namespace Catch { m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions)); m_messages.clear(); + m_messageScopes.clear(); } void RunContext::sectionEndedEarly(SectionEndInfo const & endInfo) { @@ -9905,6 +10495,10 @@ namespace Catch { m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end()); } + void RunContext::emplaceUnscopedMessage( MessageBuilder const& builder ) { + m_messageScopes.emplace_back( builder ); + } + std::string RunContext::getCurrentTestName() const { return m_activeTestCase ? m_activeTestCase->getTestCaseInfo().name @@ -9965,6 +10559,7 @@ namespace Catch { m_lastAssertionPassed = true; ++m_totals.assertions.passed; resetAssertionInfo(); + m_messageScopes.clear(); } bool RunContext::aborting() const { @@ -9986,13 +10581,10 @@ namespace Catch { CATCH_TRY { if (m_reporter->getPreferences().shouldRedirectStdOut) { #if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) - RedirectedStdOut redirectedStdOut; - RedirectedStdErr redirectedStdErr; + RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr); timer.start(); invokeActiveTestCase(); - redirectedCout += redirectedStdOut.str(); - redirectedCerr += redirectedStdErr.str(); #else OutputRedirect r(redirectedCout, redirectedCerr); timer.start(); @@ -10019,6 +10611,7 @@ namespace Catch { m_testCaseTracker->close(); handleUnfinishedSections(); m_messages.clear(); + m_messageScopes.clear(); SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions); m_reporter->sectionEnded(testCaseSectionStats); @@ -10299,14 +10892,19 @@ namespace Catch { return createReporter(config->getReporterName(), config); } - auto multi = std::unique_ptr<ListeningReporter>(new ListeningReporter); - + // On older platforms, returning std::unique_ptr<ListeningReporter> + // when the return type is std::unique_ptr<IStreamingReporter> + // doesn't compile without a std::move call. However, this causes + // a warning on newer platforms. Thus, we have to work around + // it a bit and downcast the pointer manually. + auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); + auto& multi = static_cast<ListeningReporter&>(*ret); auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); for (auto const& listener : listeners) { - multi->addListener(listener->create(Catch::ReporterConfig(config))); + multi.addListener(listener->create(Catch::ReporterConfig(config))); } - multi->addReporter(createReporter(config->getReporterName(), config)); - return std::move(multi); + multi.addReporter(createReporter(config->getReporterName(), config)); + return ret; } Catch::Totals runTests(std::shared_ptr<Config> const& config) { @@ -10422,6 +11020,8 @@ namespace Catch { auto result = m_cli.parse( clara::Args( argc, argv ) ); if( !result ) { + config(); + getCurrentMutableContext().setConfig(m_config); Catch::cerr() << Colour( Colour::Red ) << "\nError(s) in input:\n" @@ -10513,7 +11113,7 @@ namespace Catch { applyFilenamesAsTags( *m_config ); // Handle list request - if( Option<std::size_t> listed = list( config() ) ) + if( Option<std::size_t> listed = list( m_config ) ) return static_cast<int>( *listed ); auto totals = runTests( m_config ); @@ -11078,6 +11678,12 @@ namespace Catch { else if( prop == TestCaseInfo::None ) enforceNotReservedTag( tag, _lineInfo ); + // Merged hide tags like `[.approvals]` should be added as + // `[.][approvals]`. The `[.]` is added at later point, so + // we only strip the prefix + if (startsWith(tag, '.') && tag.size() > 1) { + tag.erase(0, 1); + } tags.push_back( tag ); tag.clear(); inTag = false; @@ -11387,7 +11993,7 @@ namespace TestCaseTracking { } bool TrackerBase::isSectionTracker() const { return false; } - bool TrackerBase::isIndexTracker() const { return false; } + bool TrackerBase::isGeneratorTracker() const { return false; } void TrackerBase::open() { m_runState = Executing; @@ -11456,6 +12062,17 @@ namespace TestCaseTracking { } } + bool SectionTracker::isComplete() const { + bool complete = true; + + if ((m_filters.empty() || m_filters[0] == "") || + std::find(m_filters.begin(), m_filters.end(), + m_nameAndLocation.name) != m_filters.end()) + complete = TrackerBase::isComplete(); + return complete; + + } + bool SectionTracker::isSectionTracker() const { return true; } SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) { @@ -11493,55 +12110,11 @@ namespace TestCaseTracking { m_filters.insert( m_filters.end(), ++filters.begin(), filters.end() ); } - IndexTracker::IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ) - : TrackerBase( nameAndLocation, ctx, parent ), - m_size( size ) - {} - - bool IndexTracker::isIndexTracker() const { return true; } - - IndexTracker& IndexTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ) { - std::shared_ptr<IndexTracker> tracker; - - ITracker& currentTracker = ctx.currentTracker(); - if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { - assert( childTracker ); - assert( childTracker->isIndexTracker() ); - tracker = std::static_pointer_cast<IndexTracker>( childTracker ); - } - else { - tracker = std::make_shared<IndexTracker>( nameAndLocation, ctx, ¤tTracker, size ); - currentTracker.addChild( tracker ); - } - - if( !ctx.completedCycle() && !tracker->isComplete() ) { - if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) - tracker->moveNext(); - tracker->open(); - } - - return *tracker; - } - - int IndexTracker::index() const { return m_index; } - - void IndexTracker::moveNext() { - m_index++; - m_children.clear(); - } - - void IndexTracker::close() { - TrackerBase::close(); - if( m_runState == CompletedSuccessfully && m_index < m_size-1 ) - m_runState = Executing; - } - } // namespace TestCaseTracking using TestCaseTracking::ITracker; using TestCaseTracking::TrackerContext; using TestCaseTracking::SectionTracker; -using TestCaseTracking::IndexTracker; } // namespace Catch @@ -11744,7 +12317,7 @@ namespace Catch { // is terrible and we should move on. // TBD: How to signal that the measured resolution is probably wrong? if (ticks > startTime + 3 * nanosecondsInSecond) { - return sum / i; + return sum / ( i + 1u ); } } @@ -12119,7 +12692,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 2, 5, 0, "", 0 ); + static Version version( 2, 7, 1, "", 0 ); return version; } @@ -12203,9 +12776,11 @@ namespace { } void hexEscapeChar(std::ostream& os, unsigned char c) { + std::ios_base::fmtflags f(os.flags()); os << "\\x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(c); + os.flags(f); } } // anonymous namespace @@ -12469,11 +13044,26 @@ namespace Catch { #ifdef _MSC_VER sprintf_s(buffer, "%.3f", duration); #else - sprintf(buffer, "%.3f", duration); + std::sprintf(buffer, "%.3f", duration); #endif return std::string(buffer); } + std::string serializeFilters( std::vector<std::string> const& container ) { + ReusableStringStream oss; + bool first = true; + for (auto&& filter : container) + { + if (!first) + oss << ' '; + else + first = false; + + oss << filter; + } + return oss.str(); + } + TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config) :StreamingReporterBase(_config) {} @@ -13003,7 +13593,7 @@ public: case Unit::Nanoseconds: return "ns"; case Unit::Microseconds: - return "µs"; + return "us"; case Unit::Milliseconds: return "ms"; case Unit::Seconds: @@ -13198,6 +13788,10 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { stream << std::endl; StreamingReporterBase::testRunEnded(_testRunStats); } +void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { + StreamingReporterBase::testRunStarting(_testInfo); + printTestFilters(); +} void ConsoleReporter::lazyPrint() { @@ -13379,6 +13973,11 @@ void ConsoleReporter::printSummaryDivider() { stream << getLineOfChars<'-'>() << '\n'; } +void ConsoleReporter::printTestFilters() { + if (m_config->testSpec().hasFilters()) + stream << Colour(Colour::BrightYellow) << "Filters: " << serializeFilters( m_config->getTestsOrTags() ) << '\n'; +} + CATCH_REGISTER_REPORTER("console", ConsoleReporter) } // end namespace Catch @@ -13452,6 +14051,22 @@ namespace Catch { void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) { CumulativeReporterBase::testRunStarting( runInfo ); xml.startElement( "testsuites" ); + + if ( m_config->hasTestFilters() || m_config->rngSeed() != 0 ) + xml.startElement("properties"); + + if ( m_config->hasTestFilters() ) { + xml.scopedElement( "property" ) + .writeAttribute( "name" , "filters" ) + .writeAttribute( "value" , serializeFilters( m_config->getTestsOrTags() ) ); + } + + if( m_config->rngSeed() != 0 ) { + xml.scopedElement( "property" ) + .writeAttribute( "name", "random-seed" ) + .writeAttribute( "value", m_config->rngSeed() ); + xml.endElement(); + } } void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) { @@ -13802,6 +14417,8 @@ namespace Catch { m_xml.startElement( "Catch" ); if( !m_config->name().empty() ) m_xml.writeAttribute( "name", m_config->name() ); + if (m_config->testSpec().hasFilters()) + m_xml.writeAttribute( "filters", serializeFilters( m_config->getTestsOrTags() ) ); if( m_config->rngSeed() != 0 ) m_xml.scopedElement( "Randomness" ) .writeAttribute( "seed", m_config->rngSeed() ); @@ -14036,7 +14653,7 @@ int main (int argc, char * const argv[]) { #define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ ) #define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ ) -#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, "", __VA_ARGS__ ) +#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ ) #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr ) #define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr ) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) @@ -14050,7 +14667,7 @@ int main (int argc, char * const argv[]) { #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) -#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, "", __VA_ARGS__ ) +#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr ) #define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr ) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) @@ -14083,9 +14700,13 @@ int main (int argc, char * const argv[]) { #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) #else #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) ) #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) #endif #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) @@ -14141,6 +14762,7 @@ int main (int argc, char * const argv[]) { #endif // CATCH_CONFIG_DISABLE_MATCHERS #define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg ) +#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg ) #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) #define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE",__VA_ARGS__ ) @@ -14158,9 +14780,13 @@ int main (int argc, char * const argv[]) { #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) #else #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) ) #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) ) #endif #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE) @@ -14244,9 +14870,13 @@ using Catch::Detail::Approx; #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) #else #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) ) #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) #endif // "BDD-style" convenience wrappers @@ -14314,9 +14944,13 @@ using Catch::Detail::Approx; #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) #else #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) ) ) #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), className ) ) +#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ ) +#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) #endif #define STATIC_REQUIRE( ... ) (void)(0) diff --git a/packages/Catch2/single_include/catch2/catch_reporter_tap.hpp b/packages/Catch2/single_include/catch2/catch_reporter_tap.hpp index ccc4051be..1bfe4f5e1 100644 --- a/packages/Catch2/single_include/catch2/catch_reporter_tap.hpp +++ b/packages/Catch2/single_include/catch2/catch_reporter_tap.hpp @@ -42,9 +42,9 @@ namespace Catch { bool assertionEnded( AssertionStats const& _assertionStats ) override { ++counter; + stream << "# " << currentTestCaseInfo->name << std::endl; AssertionPrinter printer( stream, _assertionStats, counter ); printer.print(); - stream << " # " << currentTestCaseInfo->name ; stream << std::endl; return true; diff --git a/packages/Catch2/third_party/clara.hpp b/packages/Catch2/third_party/clara.hpp index 6be5a98b1..9f4f1b2c3 100644 --- a/packages/Catch2/third_party/clara.hpp +++ b/packages/Catch2/third_party/clara.hpp @@ -110,6 +110,9 @@ namespace clara { namespace TextFlow { m_suffix = false; auto width = m_column.m_width-indent(); m_end = m_pos; + if (line()[m_pos] == '\n') { + ++m_end; + } while( m_end < line().size() && line()[m_end] != '\n' ) ++m_end; -- GitLab