catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Remove what Catch2's maintainers left that is not ours
- Commit
a2edf60b9f410d26485ac7c0492870a0905f9545- Author
- Leitwolf11 ·
- Parents
4f1c759cffcb
Changes
.github/FUNDING.yml | 2 - CMake/catch2-with-main.pc.in | 2 +- CMake/catch2.pc.in | 4 +- CMakeLists.txt | 4 +- CODE_OF_CONDUCT.md | 2 +- Doxyfile | 4 +- MAINTAINERS.md | 11 - appveyor.yml | 83 - data/artwork/catch2-c-logo.svg | 105 - data/artwork/catch2-hand-logo.svg | 83 - docs/Readme.md | 10 +- docs/commercial-users.md | 26 - docs/contributing.md | 396 +--- docs/deprecations.md | 92 - docs/migrate-v2-to-v3.md | 2 +- docs/opensource-users.md | 162 -- docs/release-notes.md | 2208 +--------------------- docs/release-process.md | 69 - docs/why-catch.md | 62 - extras/catch_amalgamated.cpp | 4 +- extras/catch_amalgamated.hpp | 4 +- tools/misc/CMakeLists.txt | 8 - tools/misc/appveyorBuildConfigurationScript.bat | 21 - tools/misc/appveyorMergeCoverageScript.py | 9 - tools/misc/appveyorTestRunScript.bat | 17 - tools/misc/coverage-helper.cpp | 142 -- tools/misc/installOpenCppCoverage.ps1 | 19 - tools/scripts/developBuild.py | 9 - tools/scripts/extractFeaturesFromReleaseNotes.py | 92 - tools/scripts/generateAmalgamatedFiles.py | 11 +- tools/scripts/majorRelease.py | 9 - tools/scripts/minorRelease.py | 9 - tools/scripts/patchRelease.py | 9 - tools/scripts/releaseCommon.py | 116 +- 34 files changed, 133 insertions(+), 3673 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 9122aa8a..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: "horenmar" -custom: "https://www.paypal.me/horenmar" diff --git a/CMake/catch2-with-main.pc.in b/CMake/catch2-with-main.pc.in index eeac3e35..e20a28f9 100644 --- a/CMake/catch2-with-main.pc.in +++ b/CMake/catch2-with-main.pc.in @@ -4,7 +4,7 @@ pkg_version=@Catch2_VERSION@ Name: Catch2 with main function Description: A modern, C++-native test framework for C++14 and above (links in default main) -URL: https://github.com/catchorg/Catch2 +URL: https://github.com/Progmasoft/catch3 Version: ${pkg_version} Requires: catch2 = ${pkg_version} Libs: -L${libdir} -l@lib_name@ diff --git a/CMake/catch2.pc.in b/CMake/catch2.pc.in index 74e22c15..93886089 100644 --- a/CMake/catch2.pc.in +++ b/CMake/catch2.pc.in @@ -4,8 +4,8 @@ includedir=${prefix}/@include_dir@ libdir=${prefix}/@lib_dir@ Name: Catch2 -Description: A modern, C++-native, test framework for C++14 and above -URL: https://github.com/catchorg/Catch2 +Description: Catch3, Catch2's test API with its own runner; headers need C++14 and above +URL: https://github.com/Progmasoft/catch3 Version: @Catch2_VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -l@lib_name@ diff --git a/CMakeLists.txt b/CMakeLists.txt index a8f1da6d..6510f62d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,8 +37,8 @@ endif() project(Catch2 VERSION 3.16.1 # CML version placeholder, don't delete LANGUAGES CXX - HOMEPAGE_URL "https://github.com/catchorg/Catch2" - DESCRIPTION "A modern, C++-native, unit test framework." + HOMEPAGE_URL "https://github.com/Progmasoft/catch3" + DESCRIPTION "Catch2's test API with a parallel runner, property testing and snapshots." ) # Provide path for scripts. We first add path to the scripts we don't use, diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index be1a688e..c132abab 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at github@philnash.me. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting Progmasoft at support@progmasoft.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. diff --git a/Doxyfile b/Doxyfile index 83b4f215..4d248a61 100644 --- a/Doxyfile +++ b/Doxyfile @@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = Catch2 +PROJECT_NAME = Catch3 # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -54,7 +54,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Popular C++ unit testing framework" +PROJECT_BRIEF = "Catch2's test API with a parallel runner, property testing and snapshots" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 diff --git a/MAINTAINERS.md b/MAINTAINERS.md deleted file mode 100644 index 574418a7..00000000 --- a/MAINTAINERS.md +++ /dev/null @@ -1,11 +0,0 @@ -<a id="top"></a> -# Catch2 Maintainers - -## Current - -* Chris Thrasher ([@christhrasher](https://github.com/ChrisThrasher)), gpg key: 56FB686C9DFC8E2C -* Martin Hořeňovský ([@horenmar](https://github.com/horenmar)), gpg key: E29C46F3B8A7502860793B7DECC9C20E314B2360 - -## Retired - -* Phil Nash ([@philsquared](https://github.com/philsquared)) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index ba4556ea..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,83 +0,0 @@ -version: "{build}-{branch}" - -# If we ever get a backlog larger than clone_depth, builds will fail -# spuriously. I do not think we will ever get 20 deep commits deep though. -clone_depth: 20 - -# We want to build everything, except for branches that are explicitly -# for messing around with Github Actions. -branches: - except: - - /devel-gha.+/ - - -# We need a more up to date pip because Python 2.7 is EOL soon -init: - - set PATH=C:\Python35;C:\Python35\Scripts;%PATH% - - -install: - - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { pip --disable-pip-version-check install codecov } - # This removes our changes to PATH. Keep this step last! - - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { .\tools\misc\installOpenCppCoverage.ps1 } - - -before_build: - # We need to modify PATH again, because it was reset since the "init" step - - set PATH=C:\Python35;C:\Python35\Scripts;%PATH% - - set CXXFLAGS=%additional_flags% - # If we are building examples/extra-tests, we need to regenerate the amalgamated files - - cmd: if "%examples%"=="1" ( python .\tools\scripts\generateAmalgamatedFiles.py ) - # Indirection because appveyor doesn't handle multiline batch scripts properly - # https://stackoverflow.com/questions/37627248/how-to-split-a-command-over-multiple-lines-in-appveyor-yml/37647169#37647169 - # https://help.appveyor.com/discussions/questions/3888-multi-line-cmd-or-powershell-warning-ignore - - cmd: .\tools\misc\appveyorBuildConfigurationScript.bat - - -# build with MSBuild -build: - project: Build\Catch2.sln # path to Visual Studio solution or project - parallel: true # enable MSBuild parallel builds - verbosity: normal # MSBuild verbosity level {quiet|minimal|normal|detailed} - -test_script: - - set CTEST_OUTPUT_ON_FAILURE=1 - - cmd: .\tools\misc\appveyorTestRunScript.bat - - -# Sadly we cannot use the standard "dimensions" based approach towards -# specifying the different builds, as there is no way to add one-offs -# builds afterwards. This means that we will painfully specify each -# build explicitly. -environment: - matrix: - - FLAVOR: VS 2019 x64 Debug Coverage Examples - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - examples: 1 - coverage: 1 - platform: x64 - configuration: Debug - - - FLAVOR: VS 2019 x64 Debug WMain - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - wmain: 1 - additional_flags: "/D_UNICODE /DUNICODE" - platform: x64 - configuration: Debug - - - FLAVOR: VS 2019 x64 Debug Latest Strict - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - additional_flags: "/permissive- /std:c++latest" - platform: x64 - configuration: Debug - - - FLAVOR: VS 2017 x64 Debug - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - platform: x64 - configuration: Debug - - - FLAVOR: VS 2017 x64 Release Coverage - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - coverage: 1 - platform: x64 - configuration: Debug diff --git a/data/artwork/catch2-c-logo.svg b/data/artwork/catch2-c-logo.svg deleted file mode 100644 index 2c736986..00000000 --- a/data/artwork/catch2-c-logo.svg +++ /dev/null @@ -1,105 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - width="104.41245mm" - height="120.99883mm" - viewBox="0 0 101.59999 117.7396" - version="1.1" - id="svg1" - inkscape:version="1.4-beta (62f545ba5e, 2024-04-22)" - sodipodi:docname="catch2-c-logo.svg" - xml:space="preserve" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview - id="namedview1" - pagecolor="#ffffff" - bordercolor="#000000" - borderopacity="0.25" - inkscape:showpageshadow="2" - inkscape:pageopacity="0.0" - inkscape:pagecheckerboard="0" - inkscape:deskcolor="#d1d1d1" - inkscape:document-units="mm" - inkscape:zoom="2" - inkscape:cx="181" - inkscape:cy="192.25" - inkscape:window-width="2560" - inkscape:window-height="1411" - inkscape:window-x="-9" - inkscape:window-y="-6" - inkscape:window-maximized="1" - inkscape:current-layer="svg1" - inkscape:clip-to-page="false" /><defs - id="defs1"><inkscape:path-effect - effect="bspline" - id="path-effect21" - is_visible="true" - lpeversion="1.3" - weight="33.333333" - steps="2" - helper_size="0" - apply_no_weight="true" - apply_with_weight="true" - only_selected="false" - uniform="false" /><inkscape:path-effect - effect="mirror_symmetry" - start_point="73.777381,64.846856" - end_point="82.510207,65.15" - center_point="78.143794,64.998428" - id="path-effect17" - is_visible="true" - lpeversion="1.2" - lpesatellites="" - mode="free" - discard_orig_path="false" - fuse_paths="true" - oposite_fuse="false" - split_items="false" - split_open="false" - link_styles="false" /></defs><g - inkscape:groupmode="layer" - id="layer2" - inkscape:label="Layer 1" - style="display:inline;opacity:1"><path - style="display:inline;opacity:1;fill:#ff2500;fill-opacity:1;stroke:none" - d="m 51.144204,74.60863 c 2.755126,3.847649 8.114087,5.089451 12.620377,4.385634 2.354879,-0.367807 8.839176,-2.41493 8.839176,-4.301423 V 61.300036 c 0,-0.274854 -4.644748,-5.35579 -14.139807,-4.033868 -7.781631,0.854243 -12.297148,10.391313 -7.319746,17.342462 z" - id="path19" /><path - style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none" - d="M 51.858331,11.754161 C 41.642983,13.144685 33.527664,20.30548 26.946464,27.781252 13.41997,43.146393 1.1940791,63.412939 0.27499404,84.40209 c -0.2484557,5.673984 0.0720803,11.551339 2.02561406,16.93334 6.4303318,17.71559 27.0809729,18.5262 42.4139739,13.56112 9.635256,-3.12006 19.559145,-9.05196 26.722916,-16.206958 2.544515,-2.541399 6.489211,-6.811827 4.760053,-10.836485 -0.807945,-1.880505 -3.120844,-1.771387 -4.760053,-1.239217 -3.777039,1.226226 -7.054253,3.815005 -10.31875,5.990284 -8.595381,5.727494 -18.582582,10.587386 -29.104166,10.583336 -5.314431,-0.002 -11.064865,-1.53917 -14.276067,-6.085419 C 14.249559,92.162607 14.966246,85.515419 15.941144,79.904173 18.379578,65.869225 26.039129,51.275896 34.494849,39.952087 37.975232,35.291195 43.042486,28.027749 49.477081,27.54157 c 2.673121,-0.201974 4.452111,1.728755 5.613208,3.943849 2.172279,4.144192 2.284401,8.974146 4.143505,13.229168 1.160297,2.655628 3.911041,5.951729 7.175599,4.380934 4.423264,-2.128318 5.563981,-8.759454 5.557271,-13.112185 -0.0164,-10.64231 -7.561412,-25.937074 -20.108333,-24.229175" - id="path14" /><path - style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14596;stroke-linecap:round" - d="m 53.953228,68.740885 v -1.206827 h 3.137751 v -3.266479 h 1.174645 v 3.266479 h 3.073387 v 1.206827 h -3.073387 v 3.202116 h -1.174645 v -3.202116 z" - id="path15" - sodipodi:nodetypes="ccccccccccccc" /><path - style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14596;stroke-linecap:round" - d="m 62.418518,68.740885 v -1.206827 h 3.137751 v -3.266479 h 1.174645 v 3.266479 h 3.073387 v 1.206827 h -3.073387 v 3.202116 h -1.174645 v -3.202116 z" - id="path16" - sodipodi:nodetypes="ccccccccccccc" /><path - d="M 85.440222,24.062768 C 86.646399,22.95745 88.272019,22.342526 89.673556,21.247484 94.611094,17.389708 103.0499,9.5981005 101.23198,3.5611216 100.54356,1.2749953 97.954172,0.02851298 95.475242,0.19207103 92.915127,0.3609856 90.311542,1.5166605 88.615222,2.3873449 86.831645,3.3028167 85.048448,3.2384541 84.477375,4.6552681 83.67664,6.6418721 85.77327,9.3242102 87.820455,9.0669662 88.433774,8.9898962 89.041201,8.700584 89.29669,8.1526509 89.865278,6.9332293 90.823337,6.6449856 92.781525,5.7141794 94.684453,4.8096405 96.75508,4.4020758 95.458862,7.6585999 93.598546,12.332323 85.734679,17.924982 80.774891,21.407129 c 0,0 -2.282573,1.504251 -2.853005,1.705572 -1.235548,0.436059 -2.378469,0.514326 -2.192851,1.747903 0.209704,1.393648 1.686087,2.720176 2.912476,2.922238 2.91246,0.479863 3.255425,0.04457 7.857045,0.896861 1.782728,0.330191 4.511564,1.873082 5.236267,1.861978 1.114192,-0.01707 2.38496,-5.01e-4 3.098369,-0.950708 1.003097,-1.336037 0.164345,-3.66292 -1.202522,-4.426382 -2.017657,-1.126959 -6.832185,-0.826419 -8.190448,-1.101823" - style="display:inline;opacity:1;fill:#ff2500;fill-opacity:1;stroke:none" - id="path1" - inkscape:label="path1" - sodipodi:nodetypes="csssssssssssssssssc" /><circle - style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14596;stroke-linecap:round" - id="path20" - cx="81.427208" - cy="64.690056" - r="1.1207407" /><circle - style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14596;stroke-linecap:round" - id="circle21" - cx="81.427208" - cy="71.551033" - r="1.1207407" /><path - style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14596;stroke-linecap:round" - d="M 73.866479,74.571917 V 61.475751 c 0.716819,0.227562 4.096107,2.192671 4.096107,6.519638 0,4.326967 -3.010942,6.386799 -4.096107,6.576528 z" - id="path21" - sodipodi:nodetypes="cczc" /><path - style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14596;stroke-linecap:round" - d="m 77.405059,65.799422 3.424802,-1.331236 0.204807,0.933002 -3.652363,1.353992 z" - id="path22" /><path - style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14596;stroke-linecap:round" - d="m 77.427815,70.4303 3.094839,1.115049 0.40961,-0.739575 -3.402045,-1.433636 z" - id="path23" /></g></svg> diff --git a/data/artwork/catch2-hand-logo.svg b/data/artwork/catch2-hand-logo.svg deleted file mode 100644 index 3b24df11..00000000 --- a/data/artwork/catch2-hand-logo.svg +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - width="221.19167mm" - height="254mm" - viewBox="0 0 221.19167 254" - version="1.1" - id="svg1" - inkscape:version="1.4-beta (62f545ba5e, 2024-04-22)" - sodipodi:docname="catch2-hand-logo.svg" - xml:space="preserve" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview - id="namedview1" - pagecolor="#ffffff" - bordercolor="#000000" - borderopacity="0.25" - inkscape:showpageshadow="2" - inkscape:pageopacity="0.0" - inkscape:pagecheckerboard="false" - inkscape:deskcolor="#d1d1d1" - inkscape:document-units="mm" - inkscape:zoom="0.75528389" - inkscape:cx="423.01975" - inkscape:cy="494.51604" - inkscape:window-width="2560" - inkscape:window-height="1411" - inkscape:window-x="-9" - inkscape:window-y="-6" - inkscape:window-maximized="1" - inkscape:current-layer="layer3" /><defs - id="defs1" /><g - inkscape:groupmode="layer" - id="layer3" - inkscape:label="Layer 1" - style="display:inline;opacity:1"><path - style="display:inline;fill:#ff2500;fill-opacity:1;stroke:none;stroke-width:0.997109" - d="m 167.951,135.96691 c 2.74718,3.83654 8.09064,5.07475 12.58391,4.37297 2.34808,-0.36675 8.81363,-2.40795 8.81363,-4.28899 v -13.3541 c 0,-0.27407 -4.63132,-5.34032 -14.09894,-4.02222 -7.75915,0.85177 -12.26161,10.36129 -7.2986,17.29234 z" - id="path19" /><path - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.997109" - d="m 168.66307,73.294073 c -10.18583,1.386506 -18.27769,8.526609 -24.83988,15.980778 -13.4874,15.320749 -25.67797,35.528729 -26.59439,56.457219 -0.24775,5.65759 0.0719,11.51796 2.01975,16.88442 6.41176,17.66439 27.00272,18.47266 42.29142,13.52193 9.6074,-3.11105 19.50262,-9.0258 26.64569,-16.16012 2.53716,-2.53406 6.47045,-6.79215 4.7463,-10.80518 -0.80561,-1.87507 -3.11182,-1.76626 -4.7463,-1.23563 -3.76612,1.22268 -7.03387,3.80398 -10.28893,5.97297 -8.57055,5.71095 -18.52889,10.55679 -29.02007,10.55276 -5.29907,-0.002 -11.03289,-1.53473 -14.23481,-6.06784 -3.47888,-4.92522 -2.76426,-11.55319 -1.79218,-17.14822 2.43139,-13.99439 10.06881,-28.54555 18.5001,-39.83664 3.47032,-4.647428 8.52293,-11.889884 14.93893,-12.374659 2.6654,-0.20139 4.43924,1.72376 5.59699,3.932453 2.166,4.132217 2.2778,8.948216 4.13153,13.190946 1.15694,2.64795 3.89974,5.93453 7.15487,4.36828 4.41048,-2.12217 5.5479,-8.73415 5.5412,-13.074306 -0.0164,-10.611557 -7.53956,-25.862124 -20.05022,-24.159161" - id="path14" /><path - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.145538;stroke-linecap:round" - d="m 170.75192,130.11613 v -1.20334 h 3.12868 v -3.25705 h 1.17125 v 3.25705 h 3.0645 v 1.20334 h -3.0645 v 3.19287 h -1.17125 v -3.19287 z" - id="path15" - sodipodi:nodetypes="ccccccccccccc" /><path - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.145538;stroke-linecap:round" - d="m 179.19274,130.11613 v -1.20334 h 3.12869 v -3.25705 h 1.17125 v 3.25705 h 3.0645 v 1.20334 h -3.0645 v 3.19287 h -1.17125 v -3.19287 z" - id="path16" - sodipodi:nodetypes="ccccccccccccc" /><path - d="m 204.99654,83.647387 c 1.20269,-1.102124 2.82361,-1.715271 4.2211,-2.807149 4.92327,-3.846627 13.33769,-11.61572 11.52502,-17.635254 -0.68642,-2.27952 -3.26833,-3.5224 -5.7401,-3.359314 -2.55271,0.168426 -5.14878,1.320761 -6.8402,2.18893 -1.77842,0.912826 -3.55647,0.84865 -4.12589,2.26137 -0.79842,1.980862 1.29215,4.655449 3.33343,4.398949 0.61154,-0.07684 1.21721,-0.365323 1.47197,-0.911673 0.56694,-1.215898 1.52223,-1.503309 3.47476,-2.431425 1.89743,-0.901925 3.96207,-1.308312 2.6696,1.938802 -1.85495,4.660217 -9.69609,10.236715 -14.64154,13.7088 0,0 -2.27598,1.499904 -2.84476,1.700643 -1.23198,0.434799 -2.37159,0.512839 -2.18652,1.742852 0.2091,1.38962 1.68122,2.712316 2.90406,2.913793 2.90404,0.478477 3.24602,0.04444 7.83434,0.89427 1.77758,0.329237 4.49854,1.867669 5.22114,1.856598 1.11097,-0.01702 2.37807,-5e-4 3.08942,-0.947962 1.00019,-1.332175 0.16387,-3.652334 -1.19905,-4.41359 -2.01182,-1.123702 -6.81244,-0.824031 -8.16678,-1.09864" - style="display:inline;fill:#ff2500;fill-opacity:1;stroke:none;stroke-width:0.997109" - id="path1-4" - inkscape:label="path2" - sodipodi:nodetypes="csssssssssssssssssc" /><circle - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.145538;stroke-linecap:round" - id="path20" - cx="198.14651" - cy="126.077" - r="1.117502" /><circle - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.145538;stroke-linecap:round" - id="circle21" - cx="198.14651" - cy="132.91815" - r="1.117502" /><path - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.145538;stroke-linecap:round" - d="m 190.60762,135.93031 v -13.05833 c 0.71475,0.22692 4.08427,2.18634 4.08427,6.50081 0,4.31446 -3.00224,6.36834 -4.08427,6.55752 z" - id="path21" - sodipodi:nodetypes="cczc" /><path - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.145538;stroke-linecap:round" - d="m 194.13597,127.18316 3.41491,-1.32739 0.20422,0.93031 -3.64181,1.35009 z" - id="path22" /><path - style="display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.145538;stroke-linecap:round" - d="m 194.15867,131.80066 3.08589,1.11183 0.40843,-0.73744 -3.39221,-1.42949 z" - id="path23" /><path - style="opacity:1;fill:#000000" - d="m 52.485231,274.30677 c -1.44545,-0.96726 -2.86981,-3.09456 -3.13906,-4.6882 -0.39677,-2.34847 0.81078,-4.39701 5.15499,-8.74518 20.43177,-20.45035 46.487389,-31.49087 92.078009,-39.01608 2.25557,-0.37231 4.92152,-0.92104 5.92434,-1.21941 4.02143,-1.19651 9.24392,-3.85561 19.87253,-10.11836 9.8535,-5.80602 12.12477,-6.79037 15.66794,-6.79037 2.05936,0 4.57269,2.67656 4.57269,4.86966 0,1.68904 -2.6986,6.0579 -4.7121,7.6286 -2.28208,1.78021 -6.58253,4.6015 -11.7076,7.68073 -9.06231,5.44478 -11.98022,6.71427 -21.41534,9.31715 -5.04752,1.39246 -16.38447,4.02852 -25.53267,5.93683 -25.13851,5.24388 -25.00563,5.21162 -29.765619,7.22491 -7.03101,2.97384 -16.88366,8.57665 -28.32629,16.10804 -4.97279,3.27302 -5.23095,3.48606 -6.59919,5.44572 -2.03051,2.90821 -4.81825,5.75178 -6.42266,6.55129 -2.02273,1.00797 -3.9618,0.94437 -5.64997,-0.18533 z M 2.1166706,214.04812 c -4.43974,-1.17966 -6.29001,-2.86592 -6.50258,-5.92618 -0.0561,-0.80826 -0.34243,-2.18306 -0.6362,-3.05512 -0.29378,-0.87205 -0.53414,-2.12574 -0.53414,-2.78598 0,-2.4519 9.57939,-32.76364 14.76039,-46.70584 C 21.897901,121.41582 36.072191,94.814185 53.824111,71.834375 c 11.92384,-15.435387 26.74991,-30.208723 41.2936,-41.146727 5.899709,-4.437045 11.752929,-7.682035 15.523289,-8.606009 2.83253,-0.694146 6.49309,-0.456289 8.54715,0.55538 0.86947,0.428233 2.07876,1.254856 2.6873,1.836939 1.24377,1.189682 1.58018,2.435151 1.36349,5.048044 -0.19501,2.351645 -1.01118,3.232511 -6.23188,6.725914 -2.50094,1.67349 -7.49666,5.375621 -11.10159,8.226959 -8.626469,6.823143 -12.675559,9.813426 -18.592969,13.731047 -4.5713,3.026431 -5.19257,3.540143 -9.40057,7.773067 -6.75068,6.79066 -18.35611,20.995666 -21.41793,26.215466 -7.26888,12.392015 -19.02869,38.165965 -27.46982,60.205545 -7.14782,18.66277 -15.28897,43.14897 -16.8808,50.77253 -1.36968,6.55961 -2.3943804,8.86415 -4.6390304,10.43312 -1.42141,0.99355 -2.86689,1.11226 -5.38768,0.44247 z M 84.451711,131.53763 c -2.71586,-1.44798 -4.39099,-4.45284 -3.91041,-7.01452 0.22361,-1.19197 2.16953,-4.12452 4.94017,-7.44499 2.77937,-3.33091 13.49664,-14.08622 17.176859,-17.237833 20.86316,-17.866412 44.82366,-30.594172 72.62813,-38.579882 13.98648,-4.017052 21.64688,-4.578234 28.9691,-2.122202 2.68998,0.902278 3.92015,1.642753 4.93107,2.968151 2.42706,3.182092 1.37728,7.464086 -2.28839,9.334167 -1.72612,0.880603 -5.30307,1.720503 -18.52445,4.349714 -34.65213,6.890939 -45.21368,10.483785 -64.01962,21.778305 -4.90594,2.94642 -12.73144,8.97117 -19.60898,15.0967 -4.21536,3.75444 -5.629099,5.40595 -7.922789,9.25525 -2.61622,4.39059 -3.64884,5.89007 -5.11311,7.42481 -2.32969,2.44183 -5.17662,3.30181 -7.25758,2.19233 z m -19.34134,-7.37312 c -0.67308,-0.23773 -1.75582,-0.98544 -2.55596,-1.76505 -1.563,-1.52288 -2.12938,-2.99059 -1.84499,-4.78105 0.49788,-3.13453 6.69521,-13.63592 13.12251,-22.236119 17.01101,-22.761971 41.464519,-41.822254 69.705419,-54.331885 8.97055,-3.973604 14.33402,-5.413308 20.23973,-5.432901 6.16545,-0.02045 10.0683,1.082726 12.13437,3.429906 2.78341,3.162114 2.82958,6.444745 0.12416,8.826153 -1.53485,1.351031 -4.80881,2.63842 -18.21165,7.161207 -31.8573,10.75024 -42.5879,16.147741 -58.492839,29.421967 -5.67746,4.738392 -13.21765,12.843914 -18.77808,20.185972 -2.50637,3.30944 -3.41949,5.02515 -5.06932,9.525 -2.27988,6.21828 -3.86567,8.69854 -6.28046,9.823 -1.53672,0.71558 -2.4493,0.75433 -4.09289,0.1738 z" - id="path1" - sodipodi:nodetypes="sssssssssssssssssscssssssssssssssssssssscssssssssssssssssssssssss" - transform="translate(5.8208328,-21.43125)" /></g></svg> diff --git a/docs/Readme.md b/docs/Readme.md index 5d21ef7f..65268c99 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -50,10 +50,6 @@ engine, not a claim that Catch3 is an official Catch2 release. * [Thread safety of the compatibility engine](thread-safety.md#top) **Other:** -* [Why the Catch2 compatibility base?](why-catch.md#top) -* [Migrating from v2 to v3](migrate-v2-to-v3.md#top) -* [Historical Catch2 open-source users](opensource-users.md#top) -* [Historical Catch2 commercial users](commercial-users.md#top) -* [Upstream contribution guide (historical)](contributing.md#top) -* [Upstream release notes (historical)](release-notes.md#top) -* [Upstream deprecations (historical)](deprecations.md#top) +* [Release notes](release-notes.md#top) +* [Contributing](contributing.md#top) +* [Migrating from Catch2 v2 to v3](migrate-v2-to-v3.md#top) diff --git a/docs/commercial-users.md b/docs/commercial-users.md deleted file mode 100644 index 44df8c52..00000000 --- a/docs/commercial-users.md +++ /dev/null @@ -1,26 +0,0 @@ -<a id="top"></a> - -> **Upstream history:** This page is retained from Catch2 for provenance and compatibility. It does not describe Catch3 release policy or Progmasoft support. See [Catch3 documentation](Readme.md#top) for current guidance. - -# Commercial users of Catch2 - -Catch2 is also widely used in proprietary code bases. This page contains -some of them that are willing to share this information. - -If you want to add your organisation, please check that there is no issue -with you sharing this fact. - - - Bloomberg - - [Bloomlife](https://bloomlife.com) - - [Inscopix Inc.](https://www.inscopix.com/) - - Locksley.CZ - - [Makimo](https://makimo.pl/) - - NASA - - [Nexus Software Systems](https://nexwebsites.com) - - [UX3D](https://ux3d.io) - - [King](https://king.com) - - ---- - -[Home](Readme.md#top) diff --git a/docs/contributing.md b/docs/contributing.md index e67ea237..ba8fe371 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1,378 +1,100 @@ <a id="top"></a> - -> **Upstream history:** This page is retained from Catch2 for provenance and compatibility. It does not describe Catch3 release policy or Progmasoft support. See [Catch3 documentation](Readme.md#top) for current guidance. - -# Contributing to Catch2 +# Contributing to Catch3 **Contents**<br> -[Using Git(Hub)](#using-github)<br> -[Testing your changes](#testing-your-changes)<br> -[Writing documentation](#writing-documentation)<br> -[Writing code](#writing-code)<br> -[CoC](#coc)<br> -[Using LLMs when contributing](#using-llms-when-contributing)<br> - - -So you want to contribute something to Catch2? 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, other comments, and -questions, but generally it is a better idea to ask questions in our -[Discord](https://discord.gg/4CWS9zD), than in the issue tracker. - - -This page covers some guidelines and helpful tips for contributing -to the codebase itself. - -## Using Git(Hub) - -Ongoing development happens in the `devel` branch for Catch2 v3, and in -`v2.x` for maintenance updates to the v2 versions. - -Commits should be small and atomic. A commit is atomic when, after it is -applied, the codebase, tests and all, still works as expected. Small -commits are also preferred, as they make later operations with git history, -whether it is bisecting, reverting, or something else, easier. - -_When submitting a pull request please do not include changes to the -amalgamated distribution files. This means do not include them in your -git commits!_ - -When addressing review comments in a MR, please do not rebase/squash the -commits immediately. Doing so makes it harder to review the new changes, -slowing down the process of merging a MR. Instead, when addressing review -comments, you should append new commits to the branch and only squash -them into other commits when the MR is ready to be merged. We recommend -creating new commits with `git commit --fixup` (or `--squash`) and then -later squashing them with `git rebase --autosquash` to make things easier. +[Where to start](#where-to-start)<br> +[Building and testing](#building-and-testing)<br> +[Two parts, two sets of rules](#two-parts-two-sets-of-rules)<br> +[Tests](#tests)<br> +[Documentation](#documentation)<br> +[Code of Conduct](#code-of-conduct)<br> +Progmasoft maintains Catch3. Issues and pull requests are welcome on +[Progmasoft/catch3](https://github.com/Progmasoft/catch3); pull requests go +to the `devel` branch. Report security problems privately, as described in +[SECURITY.md](../SECURITY.md), not in a public issue. -## Testing your changes +## Where to start -_Note: Running Catch2's tests requires Python3_ +Open an issue before a large change, so that the direction can be agreed +first. A pull request should do one thing, say why in its description and +come with the tests that show it works. -Catch2 has multiple layers of tests that are then run as part of our CI. -The most obvious one are the unit tests compiled into the `SelfTest` -binary. These are then used in "Approval tests", which run (almost) all -tests from `SelfTest` through a specific reporter and then compare the -generated output with a known good output ("Baseline"). By default, new -tests should be placed here. +## Building and testing -To configure a Catch2 build with just the basic tests, use the `basic-tests` -preset, like so: +Bazel is the main build. With [Bazelisk](https://github.com/bazelbuild/bazelisk): ``` -# Assuming you are in Catch2's root folder - -cmake -B basic-test-build -S . -DCMAKE_BUILD_TYPE=Debug --preset basic-tests +bazelisk test //tests/... ``` -However, not all tests can be written as plain unit tests. For example, -checking that Catch2 orders tests randomly when asked to, and that this -random ordering is subset-invariant, is better done as an integration -test using an external check script. Catch2 integration tests are written -using CTest, either as a direct command invocation + pass/fail regex, -or by delegating the check to a Python script. - -Catch2 is slowly gaining more and more types of tests, currently Catch2 -project also has buildable examples, "ExtraTests", and CMake config tests. -Examples present a small and self-contained snippets of code that -use Catch2's facilities for specific purpose. Currently they are assumed -passing if they compile. - -ExtraTests then are expensive tests, that we do not want to run all the -time. This can be either because they take a long time to run, or because -they take a long time to compile, e.g. because they test compile time -configuration and require separate compilation. - -Finally, CMake config tests test that you set Catch2's compile-time -configuration options through CMake, using CMake options of the same name. - -These test categories can be enabled one by one, by passing -`-DCATCH_BUILD_EXAMPLES=ON`, `-DCATCH_BUILD_EXTRA_TESTS=ON`, and -`-DCATCH_ENABLE_CONFIGURE_TESTS=ON` when configuring the build. - -Catch2 also provides a preset that promises to enable _all_ test types, -`all-tests`. - -The snippet below will build & run all tests, in `Debug` compilation mode. - -<!-- snippet: catch2-build-and-test --> -<a id='snippet-catch2-build-and-test'></a> -```sh -# 1. Regenerate the amalgamated distribution (some tests are built against it) -./tools/scripts/generateAmalgamatedFiles.py - -# 2. Configure the full test build -cmake -B debug-build -S . -DCMAKE_BUILD_TYPE=Debug --preset all-tests - -# 3. Run the actual build -cmake --build debug-build +On Windows, point Bazel at Git's bash first: +`BAZEL_SH="C:\Program Files\Git\usr\bin\bash.exe"`. -# 4. Run the tests using CTest -ctest -j 4 --output-on-failure -C Debug --test-dir debug-build -``` -<sup><a href='/tools/scripts/buildAndTest.sh#L6-L19' title='File snippet `catch2-build-and-test` was extracted from'>snippet source</a> | <a href='#snippet-catch2-build-and-test' title='Navigate to start of snippet `catch2-build-and-test`'>anchor</a></sup> -<!-- endSnippet --> - -For convenience, the above commands are in the script `tools/scripts/buildAndTest.sh`, and can be run like this: +CMake builds every test, including the extra tests that check compile-time +configurations: -```bash -cd Catch2 -./tools/scripts/buildAndTest.sh ``` - -A Windows version of the script is available at `tools\scripts\buildAndTest.cmd`. - -If you added new tests, you will likely see `ApprovalTests` failure. -After you check that the output difference is expected, you should -run `tools/scripts/approve.py` to confirm them, and include these changes -in your commit. - - -## Writing documentation - -If you have added new feature to Catch2, it needs documentation, so that -other people can use it as well. This section collects some technical -information that you will need for updating Catch2's documentation, and -possibly some generic advise as well. - - -### Technicalities - -First, the technicalities: - -* If you have introduced a new document, there is a simple template you -should use. It provides you with the top anchor mentioned to link to -(more below), and also with a backlink to the top of the documentation: -```markdown -<a id="top"></a> -# Cool feature - -> [Introduced](https://github.com/catchorg/Catch2/pull/123456) in Catch2 X.Y.Z - -Text that explains how to use the cool feature. - - ---- - -[Home](Readme.md#top) +cmake --preset basic-tests -GNinja -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON +cmake --build build +ctest --test-dir build -j ``` -* Crosslinks to different pages should target the `top` anchor, like this -`[link to contributing](contributing.md#top)`. - -* We introduced version tags to the documentation, which show users in -which version a specific feature was introduced. This means that newly -written documentation should be tagged with a placeholder, that will -be replaced with the actual version upon release. There are 2 styles -of placeholders used through the documentation, you should pick one that -fits your text better (if in doubt, take a look at the existing version -tags for other features). - * `> [Introduced](link-to-issue-or-PR) in Catch2 X.Y.Z` - this - placeholder is usually used after a section heading - * `> X (Y and Z) was [introduced](link-to-issue-or-PR) in Catch2 X.Y.Z` - - this placeholder is used when you need to tag a subpart of something, - e.g. a list - -* For pages with more than 4 subheadings, we provide a table of contents -(ToC) at the top of the page. Because GitHub markdown does not support -automatic generation of ToC, it has to be handled semi-manually. Thus, -if you've added a new subheading to some page, you should add it to the -ToC. This can be done either manually, or by running the -`updateDocumentToC.py` script in the `scripts/` folder. +Meson, Xmake and Premake builds exist as well and are checked in CI. -### Contents +Before you push, run the repository checks: -Now, for some content tips: - -* Usage examples are good. However, having large code snippets inline -can make the documentation less readable, and so the inline snippets -should be kept reasonably short. To provide more complex compilable -examples, consider adding new .cpp file to `examples/`. - -* Don't be afraid to introduce new pages. The current documentation -tends towards long pages, but a lot of that is caused by legacy, and -we know that some of the pages are overly big and unfocused. - -* When adding information to an existing page, please try to keep your -formatting, style and changes consistent with the rest of the page. - -* Any documentation has multiple different audiences, that desire -different information from the text. The 3 basic user-types to try and -cover are: - * A beginner to Catch2, who requires closer guidance for the usage of Catch2. - * Advanced user of Catch2, who want to customize their usage. - * Experts, looking for full reference of Catch2's capabilities. - - -## Writing code - -If want to contribute code, this section contains some simple rules -and tips on things like code formatting, code constructions to avoid, -and so on. - -### C++ standard version - -Catch2 currently targets C++14 as the minimum supported C++ version. -Features from higher language versions should be used only sparingly, -when the benefits from using them outweigh the maintenance overhead. - -Example of good use of polyfilling features is our use of `conjunction`, -where if available we use `std::conjunction` and otherwise provide our -own implementation. The reason it is good is that the surface area for -maintenance is quite small, and `std::conjunction` can directly use -compiler built-ins, thus providing significant compilation benefits. - -Example of bad use of polyfilling features would be to keep around two -sets of metaprogramming in the stringification implementation, once -using C++14 compliant TMP and once using C++17's `if constexpr`. While -the C++17 would provide significant compilation speedups, the maintenance -cost would be too high. - - -### Formatting - -To make code formatting simpler for the contributors, Catch2 provides -its own config for `clang-format`. However, because it is currently -impossible to replicate existing Catch2's formatting in clang-format, -using it to reformat a whole file would cause massive diffs. To keep -the size of your diffs reasonable, you should only use clang-format -on the newly changed code. - - -### Progmasoft-authored code - -The code under `src/Progmasoft/` and `tests/Progmasoft/` is not derived -from Catch2 and follows -[Progmasoft C++ Style](https://github.com/Progmasoft/progmasoft-cpp): -its naming, its formatting profile, its language and documentation -rules. The code derived from Catch2 keeps the upstream style described -on this page, so that changes from upstream still apply cleanly. - -Progmasoft-authored code deviates from the guide where the Catch2 API -requires it: - -* It lives in the namespace `Progmasoft::Catch3`, with helpers in - `Progmasoft::Catch3::Detail`. -* It may throw, because a failed assertion is reported by an exception, - as everywhere in Catch2. Exceptions stay inside the library and never - cross into the code under test. - - -### Code constructs to watch out for - -This section is a (sadly incomplete) listing of various constructs that -are problematic and are not always caught by our CI infrastructure. - - -#### Naked exceptions and exceptions-related function - -If you are throwing an exception, it should be done via `CATCH_ERROR` -or `CATCH_RUNTIME_ERROR` in `internal/catch_enforce.hpp`. These macros will handle -the differences between compilation with or without exceptions for you. -However, some platforms (IAR) also have problems with exceptions-related -functions, such as `std::current_exceptions`. We do not have IAR in our -CI, but luckily there should not be too many reasons to use these. -However, if you do, they should be kept behind a -`CATCH_CONFIG_DISABLE_EXCEPTIONS` macro. - - -#### Avoid `std::move` and `std::forward` - -`std::move` and `std::forward` provide nice semantic name for a specific -`static_cast`. However, being function templates they have surprisingly -high cost during compilation, and can also have a negative performance -impact for low-optimization builds. - -You should be using `CATCH_MOVE` and `CATCH_FORWARD` macros from -`internal/catch_move_and_forward.hpp` instead. They expand into the proper -`static_cast`, and avoid the overhead of `std::move` and `std::forward`. - - -#### Unqualified usage of functions from C's stdlib - -If you are using a function from C's stdlib, please include the header -as `<cfoo>` and call the function qualified. The common knowledge that -there is no difference is wrong, QNX and VxWorks won't compile if you -include the header as `<cfoo>` and call the function unqualified. - - -#### User-Defined Literals (UDL) for Catch2' types - -Due to messy standardese and ... not great ... implementation of -`-Wreserved-identifier` in Clang, avoid declaring UDLs as -```cpp -Approx operator "" _a(long double); ``` -and instead declare them as -```cpp -Approx operator ""_a(long double); +python tools/scripts/checkLicense.py +python tools/scripts/checkConvenienceHeaders.py +python tools/scripts/checkDuplicateFilenames.py ``` -Notice that the second version does not have a space between the `""` and -the literal suffix. - - - -### New source file template - -If you are adding new source file, there is a template you should use. -Specifically, every source file should start with the licence header: -```cpp - - // Copyright Catch2 Authors - // Distributed under the Boost Software License, Version 1.0. - // (See accompanying file LICENSE.txt or copy at - // https://www.boost.org/LICENSE_1_0.txt) - - // SPDX-License-Identifier: BSL-1.0 -``` +A change to anything under `src/` also regenerates the single-file +distribution with `python tools/scripts/generateAmalgamatedFiles.py`. -The include guards for header files should follow the pattern `{FILENAME}_INCLUDED`. -This means that for file `catch_matchers_foo.hpp`, the include guard should -be `CATCH_MATCHERS_FOO_HPP_INCLUDED`, for `catch_generators_bar.hpp`, the include -guard should be `CATCH_GENERATORS_BAR_HPP_INCLUDED`, and so on. +## Two parts, two sets of rules -### Adding new `CATCH_CONFIG` option +`src/catch2` is the compatibility engine taken from Catch2. Its public API is +what Catch3 promises to keep: code that compiles against Catch2's headers +must keep compiling. It stays under the Boost Software License 1.0, keeps the +`Catch2 Authors` header and follows the style of the surrounding Catch2 code. +Code that includes only its headers needs C++14. -When adding new `CATCH_CONFIG` option, there are multiple places to edit: - * `CMake/CatchConfigOptions.cmake` - this is used to generate the - configuration options in CMake, so that CMake frontends know about them. - * `docs/configuration.md` - this is where the options are documented - * `src/catch2/catch_user_config.hpp.in` - this is template for generating - `catch_user_config.hpp` which contains the materialized configuration - * `BUILD.bazel` - Bazel does not have configuration support like CMake, - and all expansions need to be done manually - * other files as needed, e.g. `catch2/internal/catch_config_foo.hpp` - for the logic that guards the configuration +`src/Progmasoft` holds what Progmasoft adds: the runner, the results model, +property testing and snapshots. It is licensed `MPL-2.0 WITH +AdditionRef-Progmasoft-Exception-1.1`, follows the +[Progmasoft C++ Style](https://github.com/Progmasoft/progmasoft-cpp), is +C++20, reports recoverable errors with `Expected` rather than exceptions, and +is formatted with the `.clang-format` beside it. +`tools/scripts/checkLicense.py` checks that every source file carries the +header of its part. -## CoC -This project has a [CoC](../CODE_OF_CONDUCT.md). Please adhere to it -while contributing to Catch2. +## Tests +`tests/SelfTest` tests the compatibility engine; `tests/ExtraTests` tests +compile-time configurations and the runner's behaviour around them; +`tests/Progmasoft` tests the Progmasoft code, and the runner's integration +tests there start a fixture binary whose tests misbehave on purpose. A bug fix +comes with a test that fails without it. -## Using LLMs when contributing -I do not care whether you used LLM for your contribution. What I care -about is the quality of the contribution, not whether you made it through -prompting LLM, letting GAs run wild, dictated it into the computer, wrote -it using your nose or used butterflies to flip the correct bits. +## Documentation -The flipside of this is that I am also not going to iterate your LLM for -you. If a PR looks LLM generated and does not pass the muster to be merged -as-is, I am going to close it. +User documentation lives in `docs/`. A new page is linked from +[the documentation index](Readme.md#top), and a page with sections gets a table +of contents; `python tools/scripts/updateDocumentToC.py` keeps them current. +A user-visible change gets a line in [the release notes](release-notes.md#top). ------------ +## Code of Conduct -_This documentation will always be in-progress as new information comes -up, but we are trying to keep it as up to date as possible._ +Everyone who takes part follows the [Code of Conduct](../CODE_OF_CONDUCT.md). --- diff --git a/docs/deprecations.md b/docs/deprecations.md deleted file mode 100644 index 82f044cc..00000000 --- a/docs/deprecations.md +++ /dev/null @@ -1,92 +0,0 @@ -<a id="top"></a> - -> **Upstream history:** This page is retained from Catch2 for provenance and compatibility. It does not describe Catch3 release policy or Progmasoft support. See [Catch3 documentation](Readme.md#top) for current guidance. - -# Deprecations and incoming changes - -This page documents current deprecations and upcoming planned changes -inside Catch2. The difference between these is that a deprecated feature -will be removed, while a planned change to a feature means that the -feature will behave differently, but will still be present. Obviously, -either of these is a breaking change, and thus will not happen until -at least the next major release. - - -### `ParseAndAddCatchTests.cmake` - -The CMake/CTest integration using `ParseAndAddCatchTests.cmake` is deprecated, -as it can be replaced by `Catch.cmake` that provides the function -`catch_discover_tests` to get tests directly from a CMake target via the -command line interface instead of parsing C++ code with regular expressions. - - -### `CATCH_CONFIG_BAZEL_SUPPORT` - -Catch2 supports writing the Bazel JUnit XML output file when it is aware -that is within a bazel testing environment. Originally there was no way -to accurately probe the environment for this information so the flag -`CATCH_CONFIG_BAZEL_SUPPORT` was added. This now deprecated. Bazel has now had a change -where it will export `BAZEL_TEST=1` for purposes like the above. Catch2 -will now instead inspect the environment instead of relying on build configuration. - -### `IEventLister::skipTest( TestCaseInfo const& testInfo )` - -This event (including implementations in derived classes such as `ReporterBase`) -is deprecated and will be removed in the next major release. It is currently -invoked for all test cases that are not going to be executed due to the test run -being aborted (when using `--abort` or `--abortx`). It is however -**NOT** invoked for test cases that are [explicitly skipped using the `SKIP` -macro](skipping-passing-failing.md#top). - - -### Non-const function for `TEST_CASE_METHOD` - -> Deprecated in Catch2 3.7.0 - -Currently, the member function generated for `TEST_CASE_METHOD` is -not `const` qualified. In the future, the generated member function will -be `const` qualified, just as `TEST_CASE_PERSISTENT_FIXTURE` does. - -If you are mutating the fixture instance from within the test case, and -want to keep doing so in the future, mark the mutated members as `mutable`. - - -### Section-only filtering with `-c/--section` - -> Deprecated in Catch2 3.13.0 - -Currently, if you use only `-c/--section` parameters to decide which -sections to enter, the filtering ignores generators completely. In the -future, using only `-c/--section` will behave the same way as if you -specified the filters through the new `-p/--path-filter` parameter, which -means that generators are taken into account. - - -### Reporter event handling functions without noexcept - -> Deprecated in Catch2 3.16.1 - -Catch2 does not try to support reporters throwing from arbitrary -`fooStarting` or `fooEnded` test running event. For legacy reasons, the -event listener interface is declared without `noexcept`, but in the future -it will be changed to use `noexcept` to make this limitation explicit. - - -### Generator interfaces - -#### Defaulted `UntypedGeneratorBase::isFinite()` - -> Deprecated in Catch2 3.13.0 - -The `UntypedGeneratorBase` currently provides a default implementation -for `isFinite` that always returns `true`. This was done to keep backwards -compatibility with pre-existing generators, as infinite generators can -be diagnosed as errors in some cases. - -In the future, all generators will be expected to override `isFinite`. - - - ---- - -[Home](Readme.md#top) diff --git a/docs/migrate-v2-to-v3.md b/docs/migrate-v2-to-v3.md index b0ad3fc6..7255fdeb 100644 --- a/docs/migrate-v2-to-v3.md +++ b/docs/migrate-v2-to-v3.md @@ -22,7 +22,7 @@ The result of this move is a significant improvement in compilation times, e.g. the inclusion overhead of Catch2 in the common case has been reduced by roughly 80%. The improved ease of maintenance also led to various runtime performance improvements and the introduction of new features. -For details, look at [the release notes of 3.0.1](release-notes.md#301). +For details, look at [the release notes of Catch2 3.0.1](https://github.com/catchorg/Catch2/blob/devel/docs/release-notes.md#301). _Note that we still provide one header + one translation unit (TU) distribution but do not consider it the primarily supported option. You diff --git a/docs/opensource-users.md b/docs/opensource-users.md deleted file mode 100644 index 97e8f9ba..00000000 --- a/docs/opensource-users.md +++ /dev/null @@ -1,162 +0,0 @@ -<a id="top"></a> - -> **Upstream history:** This page is retained from Catch2 for provenance and compatibility. It does not describe Catch3 release policy or Progmasoft support. See [Catch3 documentation](Readme.md#top) for current guidance. - -# Open Source projects using Catch2 - -Catch2 is great for open source. It is licensed under the [Boost Software -License (BSL)](../LICENSE.txt), has no further dependencies and supports -two file distribution. - -As a result, Catch2 is used for testing in many different Open Source -projects. This page lists at least some of them, even though it will -obviously never be complete (and does not have the ambition to be -complete). Note that the list below is intended to be in alphabetical -order, to avoid implications of relative importance of the projects. - -_Please only add projects here if you are their maintainer, or have the -maintainer's explicit consent._ - - -## Libraries & Frameworks - -### [accessorpp](https://github.com/wqking/accessorpp) -C++ library for implementing property and data binding. - -### [alpaka](https://github.com/alpaka-group/alpaka) -A header-only C++14 abstraction library for accelerator development. - -### [ApprovalTests.cpp](https://github.com/approvals/ApprovalTests.cpp) -C++11 implementation of Approval Tests, for quick, convenient testing of legacy code. - -### [args](https://github.com/Taywee/args) -A simple header-only C++ argument parser library. - -### [Azmq](https://github.com/zeromq/azmq) -Boost Asio style bindings for ZeroMQ. - -### [Cataclysm: Dark Days Ahead](https://github.com/CleverRaven/Cataclysm-DDA) -Post-apocalyptic survival RPG. - -### [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. - -### [ChakraCore](https://github.com/Microsoft/ChakraCore) -The core part of the Chakra JavaScript engine that powers Microsoft Edge. - -### [Clara](https://github.com/philsquared/Clara) -A, single-header-only, type-safe, command line parser - which also prints formatted usage strings. - -### [Couchbase-lite-core](https://github.com/couchbase/couchbase-lite-core) -The next-generation core storage and query engine for Couchbase Lite. - -### [cppcodec](https://github.com/tplgy/cppcodec) -Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32. - -### [DtCraft](https://github.com/twhuang-uiuc/DtCraft) -A High-performance Cluster Computing Engine. - -### [eventpp](https://github.com/wqking/eventpp) -C++ event library for callbacks, event dispatcher, and event queue. With eventpp you can easily implement signal and slot mechanism, publisher and subscriber pattern, or observer pattern. - -### [forest](https://github.com/xorz57/forest) -Template Library of Tree Data Structures. - -### [Fuxedo](https://github.com/fuxedo/fuxedo) -Open source Oracle Tuxedo-like XATMI middleware for C and C++. - -### [HIP CPU Runtime](https://github.com/ROCm-Developer-Tools/HIP-CPU) -A header-only library that allows CPUs to execute unmodified HIP code. It is generic and does not assume a particular CPU vendor or architecture. - -### [Inja](https://github.com/pantor/inja) -A header-only template engine for modern C++. - -### [LLAMA](https://github.com/alpaka-group/llama) -A C++17 template header-only library for the abstraction of memory access patterns. - -### [libcluon](https://github.com/chrberger/libcluon) -A single-header-only library written in C++14 to glue distributed software components (UDP, TCP, shared memory) supporting natively Protobuf, LCM/ZCM, MsgPack, and JSON for dynamic message transformations in-between. - -### [MNMLSTC Core](https://github.com/mnmlstc/core) -A small and easy to use C++11 library that adds a functionality set that will be available in C++14 and later, as well as some useful additions. - -### [nanodbc](https://github.com/lexicalunit/nanodbc/) -A small C++ library wrapper for the native C ODBC API. - -### [Nonius](https://github.com/libnonius/nonius) -A header-only framework for benchmarking small snippets of C++ code. - -### [OpenALpp](https://github.com/Laguna1989/OpenALpp) -A modern OOP C++14 audio library built on OpenAL for Windows, Linux and web (emscripten). - -### [polymorphic_value](https://github.com/jbcoe/polymorphic_value) -A polymorphic value-type for C++. - -### [Ppconsul](https://github.com/oliora/ppconsul) -A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure. - -### [Reactive-Extensions/ RxCpp](https://github.com/Reactive-Extensions/RxCpp) -A library of algorithms for values-distributed-in-time. - -### [SFML](https://github.com/SFML/SFML) -Simple and Fast Multimedia Library. - -### [SOCI](https://github.com/SOCI/soci) -The C++ Database Access Library. - -### [TextFlowCpp](https://github.com/philsquared/textflowcpp) -A small, single-header-only, library for wrapping and composing columns of text. - -### [thor](https://github.com/xorz57/thor) -Wrapper Library for CUDA. - -### [toml++](https://github.com/marzer/tomlplusplus) -A header-only TOML parser and serializer for modern C++. - -### [Trompeloeil](https://github.com/rollbear/trompeloeil) -A thread-safe header-only mocking framework for C++14. - -### [wxWidgets](https://www.wxwidgets.org/) -Cross-Platform C++ GUI Library. - -### [xmlwrapp](https://github.com/vslavik/xmlwrapp) -C++ XML parsing library using libxml2. - -## Applications & Tools - -### [App Mesh](https://github.com/laoshanxi/app-mesh) -A high available cloud native micro-service application management platform implemented by modern C++. - -### [ArangoDB](https://github.com/arangodb/arangodb) -ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. - -### [Cytopia](https://github.com/CytopiaTeam/Cytopia) -Cytopia is a free, open source retro pixel-art city building game with a big focus on mods. It utilizes a custom isometric rendering engine based on SDL2. - -### [d-SEAMS](https://github.com/d-SEAMS/seams-core) -Open source molecular dynamics simulation structure analysis suite of tools in modern C++. - -### [Giada - Your Hardcore Loop Machine](https://github.com/monocasual/giada) -Minimal, open-source and cross-platform audio tool for live music production. - -### [MAME](https://github.com/mamedev/mame) -MAME originally stood for Multiple Arcade Machine Emulator. - -### [Newsbeuter](https://github.com/akrennmair/newsbeuter) -Newsbeuter is an open-source RSS/Atom feed reader for text terminals. - -### [PopHead](https://github.com/SPC-Some-Polish-Coders/PopHead) -A 2D, Zombie, RPG game which is being made on our own engine. - -### [raspigcd](https://github.com/pantadeusz/raspigcd) -Low level CLI app and library for execution of GCODE on Raspberry Pi without any additional microcontrollers (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. - ---- - -[Home](Readme.md#top) diff --git a/docs/release-notes.md b/docs/release-notes.md index 2ba3b663..9f5a1b31 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,2187 +1,73 @@ <a id="top"></a> -> **Upstream history:** This page is retained from Catch2 for provenance and compatibility. It does not describe Catch3 release policy or Progmasoft support. See [Catch3 documentation](Readme.md#top) for current guidance. - - -# Release notes -**Contents**<br> -[3.16.1](#3161)<br> -[3.16.0](#3160)<br> -[3.15.3](#3153)<br> -[3.15.2](#3152)<br> -[3.15.1](#3151)<br> -[3.15.0](#3150)<br> -[3.14.0](#3140)<br> -[3.13.0](#3130)<br> -[3.12.0](#3120)<br> -[3.11.0](#3110)<br> -[3.10.0](#3100)<br> -[3.9.1](#391)<br> -[3.9.0](#390)<br> -[3.8.1](#381)<br> -[3.8.0](#380)<br> -[3.7.1](#371)<br> -[3.7.0](#370)<br> -[3.6.0](#360)<br> -[3.5.4](#354)<br> -[3.5.3](#353)<br> -[3.5.2](#352)<br> -[3.5.1](#351)<br> -[3.5.0](#350)<br> -[3.4.0](#340)<br> -[3.3.2](#332)<br> -[3.3.1](#331)<br> -[3.3.0](#330)<br> -[3.2.1](#321)<br> -[3.2.0](#320)<br> -[3.1.1](#311)<br> -[3.1.0](#310)<br> -[3.0.1](#301)<br> -[2.13.7](#2137)<br> -[2.13.6](#2136)<br> -[2.13.5](#2135)<br> -[2.13.4](#2134)<br> -[2.13.3](#2133)<br> -[2.13.2](#2132)<br> -[2.13.1](#2131)<br> -[2.13.0](#2130)<br> -[2.12.4](#2124)<br> -[2.12.3](#2123)<br> -[2.12.2](#2122)<br> -[2.12.1](#2121)<br> -[2.12.0](#2120)<br> -[2.11.3](#2113)<br> -[2.11.2](#2112)<br> -[2.11.1](#2111)<br> -[2.11.0](#2110)<br> -[2.10.2](#2102)<br> -[2.10.1](#2101)<br> -[2.10.0](#2100)<br> -[2.9.2](#292)<br> -[2.9.1](#291)<br> -[2.9.0](#290)<br> -[2.8.0](#280)<br> -[2.7.2](#272)<br> -[2.7.1](#271)<br> -[2.7.0](#270)<br> -[2.6.1](#261)<br> -[2.6.0](#260)<br> -[2.5.0](#250)<br> -[2.4.2](#242)<br> -[2.4.1](#241)<br> -[2.4.0](#240)<br> -[2.3.0](#230)<br> -[2.2.3](#223)<br> -[2.2.2](#222)<br> -[2.2.1](#221)<br> -[2.2.0](#220)<br> -[2.1.2](#212)<br> -[2.1.1](#211)<br> -[2.1.0](#210)<br> -[2.0.1](#201)<br> -[Older versions](#older-versions)<br> -[Even Older versions](#even-older-versions)<br> - - -## 3.16.1 - -### Fixes -* Fixed optimizations being disabled after including benchmarking headers under MSVC. (#3212) - * This was introduced in 3.16.0's fix for the deopt implementation for MSVC never being used. -* Fixed Console reporter replacing `\0xFF`s in user-provided strings. -* Added missing `<cassert>` include to `catch_generators_range.hpp`. (#3205) - -### Improvements -* Workaround for GCC's quadratic scaling for release builds with number of test cases. - * In practice the improvement is only noticeable with unity builds and/or template product tests. -* Changed how decomposer operators are defined for better compilation times. - * For Catch2's `SelfTest` binary, this provides ~2% build time improvement. -* Changed how decomposer handles stringification for smaller binary sizes. - * For the `SelfTest` binary this is about ~8%. -* Improved compilation costs of multiple assertions in one test cases for release builds. -* Optimized initial test registration at process start: - * Fewer allocations for test cases with many tags. - * Faster processing for test cases with <=2 tags. - * Faster tag validation. - * Faster checking for duplicated test cases. -* Optimized test selection and filtering: -* Optimized filtering tests by test name. - * Running `SelfTest` with `abc*` as the filter pattern is ~10% faster. - -### Miscellaneous -* `catch_discover_tests` registers individual tests with `--order decl` for faster startup. - * For `SelfTest`, this provides 20% improvement in Debug and 5% in Release builds. -* `CMakeConfig::` family of tests use the main build's toolchain file. (#3202) -* Deprecated throwing exceptions from the reporter interface functions. - * Previously, throwing from e.g. `assertionEnded` might, or might not, have worked depending on which assertion has ended. As it is not practical for Catch2 to guard against the reporters failing randomly, and marking so with `noexcept` can provide compilation throughput improvements, I decided to fully forbid it. - * Reporter constructors are allowed to throw and the test binary will report the error nicely before exiting. - * Due to C++ limitations, this deprecation cannot be marked inside the code, only in docs. - - -## 3.16.0 - -### Fixes -* Multiple fixes in `catch_discover_tests`: - * Fixed `<target>_TESTS` variable accumulating JSON fragments alongside test names. - * This was introduced during the refactoring in last release. - * Fixed `<target>_TESTS` variable from `catch_discover_tests` not escaping test names to be properly parsed by CMake. - * This means that e.g. test names with semicolons will not be split into multiple partial test names. - * This bug has existed since the first version of the script. - * Fixed `TEST_PREFIX`/`TEST_SUFFIX` args having leading/trailing whitespace stripped. -* Added workaround for Clang 20-21 compile error with `TEMPLATE_PRODUCT_TEST_CASE` (#3115, #3173) - -### Improvements -* Verbosity option is now handled per reporter. - * The standalone `--verbosity` flag is propagated to all reporters as default, just like `--colour-mode`. -* The JSON reporter considers verbosity when listing tests. -* Another set of performance improvements for `catch_discover_tests` performance - * The newest version can register about 3k tests in 1 second, up from 1k previously. -* The initial `TEST_CASE` registration is slightly faster. -* Reduced overhead from first instantiating `BENCHMARK` machinery in a TU. -* Improved compilation speed when multiple templated test case macros use the same types. -* Rewrote implementation of the string matchers - * Case-sensitive matching (the default) is significantly faster. - * Case-insensitive matching is faster in most cases. -* Added optimizer barrier to calls into benchmarks without return values - * This limits the optimizations compiler can perform **between calls** into the benchmarked function, improving the accuracy. -* Added warning that checks for using sharding without deterministic test order (#3186) - - -## 3.15.3 - -### Fixes -* The JSON reporter's number handling is locale-independent. (#3176) -* Removed leftover debug message from `catch_discover_tests` (#3177) -* Fixed typo in the "Could not jump to the Nth element" exception message (#3181) - -### Improvements -* `catch_discover_tests` registers tests in deterministic (alphabetical) order. -* `catch_discover_tests` has been rewritten to be massively faster. - * Preparing the actual CTest script is significantly faster. - * Parsing the JSON test array is significantly faster. - * Running without `ADD_TAGS_AS_LABELS` set is 10-15% faster (as opposed to being the same speed) (#3169) - * The new implementation is about 4x-5x faster, so registering 500 tests now takes ~350ms (down from 1.1s). -* JSON writing is faster - * Small improvement in writing non-string values - * ~6-40% improvement in writing string values that do not need escaping - * ~1-6% improvement in writing string values that do need escaping -* Better support for infs and NaNs in JSON output - - -## 3.15.2 - -### Fixes -* Fixed `--warn InfiniteGenerators` triggering even if the generator was limited to specific element via path filtering. -* Fixed `-Wunused-parameter` triggering in `-fnoexceptions` builds. - -### Improvements -* `catch_discover_tests` can handle cases where the binary prints out non-Catch2 output due to global constructors (#3162) - - -## 3.15.1 - -### Fixes -* Fixed potential OOB access when looking for start of broken UTF-8 sequence during linebreaking (#3096) -* Fixed `TEMPLATE_LIST_TEST_CASE_METHOD` and `CATCH_TEMPLATE_PRODUCT_TEST_CASE` potentially causing ODR violations (#3161) - - -## 3.15.0 - -### Fixes -* Fixed ambiguous overload issue with `std::optional<T>` in C++26. (#3095) - * Since `std::optional` was turned into a range, the partial specialization of `StringMaker` for range-like types and for `std::optional<T>` were in conflict. - -### Improvements -* Simplified `CATCH_REGISTER_ENUM` internals for faster compilation and retrieval. -* Successful assertion are slightly (1-2%) faster. -* Generic (new-style) matchers support constexpr matching in C++20. - * Combining matchers requires C++26. - * Catch2-provided generic matchers are all constexpr enabled. -* Added `STATIC_REQUIRE_THAT` for compile-time matcher assertions. - * This requires the compiler to support enough `constexpr` for matchers, see above. - - -## 3.14.0 - -### Fixes -* Added missing `<cstdint>` includes. (#3078) -* Fixed suppression of empty variadic macro arguments warning on Clang <19. (#3085) -* Fixed `catch_discover_tests` failing during `PRE_TEST` discovery if a target does not have discoverable tests. (#3075) -* Fixed build of the main library failing with `CATCH_CONFIG_PREFIX_ALL` defined. (#3087) -* JUnit reporter outputs single failed (errored/skipped) assertion per test case. (#1919) - -### Improvements -* The default implementation of `--list-tags` and `--list-listeners` has a quiet variant. -* Suppressed the new Clang warning about `__COUNTER__` usage. (#3076) -* Line-wrapping counts utf-8 codepoints instead of bytes. (#1022, #3086) - * Combining character sequences are still miscounted, but Catch2 does not aim to fully support Unicode. - - -## 3.13.0 - -### Fixes -* `--benchmark-samples 0` no longer hard crashes (#3056) - * The CLI validation fails instead. -* Fixed warning suppression macros being doubly defined when using Clang on Windows (#3060) - -### Improvements -* Suppressed static analysis 26426 diagnostic for MSVC (#3057) -* Renamed the internal deprecation macro from `DEPRECATED` to `CATCH_DEPRECATED` to avoid conflicts (#3058) -* Added `UNSCOPED_CAPTURE` macro (#2954) -* Added `ConcatGenerator` to combine multiple separate generator into one - * The short form is `cat` -* Generators can now jump forward to nth element efficiently - * Custom generators that can jump forward efficiently should override `skipToNthElementImpl` -* Generators can declare themselves infinite - * The generator base defaults to declaring itself finite for backwards compatibility - * Custom generators should override `isFinite()` to return the proper value -* Added `--warn InfiniteGenerators` to error out on `GENERATE` being given an infinite generator -* Extended options for section filtering from CLI to include generators - * The user can specify which element from the generator to use in the test case - * See documentation for how the new filters work and how they can be specified -* `MapGenerator` only calls the mapping function if the output will be used - - -## 3.12.0 - -### Fixes -* Fixed unscoped messages after a passing fast-pathed assertion being lost. -* Fixed the help string for `--order` to mention random order as the default. (#3045) -* Fixed small documentation typos. (#3039) -* Fixed compilation with `CATCH_CONFIG_THREAD_SAFE_ASSERTIONS` for older C++ standards. -* Fixed a thread-safety issue with message macros being used too early after the process starts. -* Fixed automatic configuration to properly handle PlayStation platform. (#3054) -* **Fixed the _weird_ behaviour of section filtering when specifying multiple filters.** (#3038) - * See #3038 for more details. - -### Improvements -* Added `lifetimebound` attribute to various places. - * As an example, compiler that supports lifetime analysis will now diagnose invalid use of Matcher combinators. -* Minor compile-time improvements to stringification. (#3028) - * `std::tuple` printer does not recurse. - * Some implementation details were outlined into the cpp file. -* Global variables will only be marked with `thread_local` in thread-safe builds. (#3044) - -### Miscellaneous -* The thread safety support is no longer experimental. - * The new CMake option and C++ define is now `CATCH_CONFIG_THREAD_SAFE_ASSERTIONS`. - - -## 3.11.0 - -### Fixes -* Fixed building on non-desktop GDK platforms (#3029) -* Fixed message macros being susceptible to race in specific scenario (#3031) -* Catch2's SEH filter will call the previously installed filter after reporting the error (#3033) - -### Improvements -* Handling of scoped messages (e.g. `CAPTURE`) is a bit faster. -* Better out-of-the-box support for QNX (#2953) -* Improved performance of assertions by up-to 10% - * Release mode assertion fast-path sees the biggest improvement. -* Faster processing of non-escaped strings in `--invisibles` mode. -* Added support for Bazel's `TEST_RANDOM_SEED` env var (#3021) -* Added support for Bazel's `TEST_PREMATURE_EXIT_FILE` env var (#3020) - * This creates a file that is deleted if the tests exit normally, but stays around if the process dies unexpectedly. - * This functionality is also exposed through CLI as `--premature-exit-guard-file` - -### Miscellaneous -* **[Tuple.app](https://tuple.app/catch2) has sponsored Catch2** - - -## 3.10.0 - -### Fixes -* pkg-config files will take `DESTDIR` env var into account when selecting install destination (#3006, #3019) -* Changed `filter` to store the provided predicate by value (#3002, #3005) - * This is done to avoid dangling-by-default behaviour when `filter` is used inside `GENERATE_COPY`/`GENERATE_REF`. - -### Improvements -* Escaping XML and JSON output is faster when the strings do not need escaping. - * The improvement starts at about 3x throughput, up to 10x for long strings. -* Message macros (`INFO`, `CAPTURE`, `WARN`, `SUCCEED`, etc) are now thread safe. - - -## 3.9.1 - -### Fixes -* Fixed bad error reporting for multiple nested assertions (#1292) -* Fixed W4702 (unreachable code) in the polyfill for std::unreachable (#3007) -* Fixed decomposition of assertions comparing enum-backed bitfields (#3001) -* Fixed StringMaker specialization for `time_point<system_clock>` with non-default duration type (#2685) - -### Improvements -* Exceptions thrown during stringification of decomposed expression no longer fail the assertion (#2980) -* The selection logic for `CATCH_TRAP` prefers `__builtin_debugtrap` on all platforms when Catch2 is compiled with Clang - - -## 3.9.0 - -### Improvements -* **Added experimental opt-in support for thread safe assertions** - * Read the documentation for full details -* **The default test run order has been changed to random** -* Passing assertions are significantly faster when the reporter does not ask for `assertionEnded` events on passing assertions. - * This is the default behaviour of e.g. Console or Compact reporter - * Simple `REQUIRE(true)` is 60% faster in Release and 80% faster in Debug build configuration - * Simple `REQUIRE_NOTHROW` is 230% faster in Release and 430% faster in Debug build configuration - * Simple `REQUIRE_THROWS` is ~3% faster in Release and 20% faster in Debug build configuration (throwing introduces enough overhead that the optimizations inside Catch2 are mostly irrelevant) -* Small (2-5%) improvement if the reporter asks for `assertionEnded` events for passing assertions. -* The exit code constants are part of the Session API. (#2955, #2976) -* Suppressed unsigned integer overflow checking in locations with intended overflow (#2965) -* Reporters flush output after writing metadata, e.g. rng seed (#2964) -* Added unreachable after `FAIL` and `SKIP` macros (#2941) - * This allows the compiler to understand that the execution does not continue past the macro, and avoids warnings. -* Added fast path for `assertionStarting` event when no reporter requires it - * For backwards compatibility, this fast path is opt-in - * A reporter can opt in by changing its `ReporterPreferences::shouldReportAllAssertionStarts` -* Improved last seen source location tracking to be more precise - * This is used when reporting unexpected exceptions from tests - -### Fixes -* Fixed formatting of tags with more than 100 tests in the default `--list-tags` output (#2963) -* Fixed Clang-Tidy's `readability-static-accessed-through-instance` in tests -* Fixed most of Clang-Tidy's `cppcoreguidelines-avoid-non-const-global-variables` (#2582) -* The lifetime of scoped messages now strictly obeys their scope (#1759, #2019, #2959) - * Previously Catch2 would try to keep them around during unexpected exception, to provide helpful context. - * The amount of surprises the irregularities caused was not worth the occasional utility provided. -* `TEMPLATE_TEST_CASE_SIG` can handle signatures consisting of only types (#2680, #2995) -* Moved `catch_test_run_info.hpp` up from `internal/` subfolder into the main one (#2972) - -### Miscellaneous -* pkg-config files are now generated at install time (#2979) - * This fixes missing debug suffix in library names - * This fixes install prefix mismatch between build config and actuall installation - - -## 3.8.1 - -### Fixes -* Fixed bug where catch_discover_tests fails when no TEST_CASEs are present (#2962) -* Fixed Clang 19 -Wc++20-extensions warning (#2968) - - -## 3.8.0 - -### Improvements -* Added `std::initializer_list` overloads for `(Unordered)RangeEquals` matcher (#2915, #2919) -* Added explicit casts to silence GCC's `Wconversion` (#2875) -* Made the use of `builtin_constant_p` tricks in assertion macros configurable (#2925) - * It is used to prod GCC-like compilers into providing warnings for the asserted expressions, but the compilers miscompile it annoyingly often. -* Cleaned out Clang-Tidy's `performance-enum-size` warnings -* Added support for using `from_range` generator with iterators with `value_type = const T` (#2926) - * This is not correct `value_type` typedef, but it is used in the wild and the change does not make the code meaningfully worse. - -### Fixes -* Fixed crash when stringifying pre-1970 (epoch) dates on Windows (#2944) - -### Miscellaneous -* Fixes and improvements for `catch_discover_tests` CMake helper - * Removed redundant `CTEST_FILE` param when creating the indirection file for `PRE_TEST` discovery mode (#2936) - * Rewrote the test discovery logic to use output from the JSON reporter - * This means that `catch_discover_tests` now requires CMake 3.19 or newer - * Added `ADD_TAGS_AS_LABELS` option. If specified, each CTest test will be labeled with corresponding Catch2's test tag -* Bumped up the minimum required CMake version to build Catch2 to 3.16 -* Meson build now provides option to avoid installing Catch2 -* Bazel build is moved to Bzlmod. - - -## 3.7.1 - -### Improvements -* Applied the JUnit reporter's optimization from last release to the SonarQube reporter -* Suppressed `-Wuseless-cast` in `CHECK_THROWS_MATCHES` (#2904) -* Standardize exit codes for various failures - * Running no tests is now guaranteed to exit with 2 (without the `--allow-running-no-tests` flag) - * All tests skipped is now always 4 (...) - * Assertion failures are now always 42 - * and so on - -### Fixes -* Fixed out-of-bounds access when the arg parser encounters single `-` as an argument (#2905) - -### Miscellaneous -* Added `catch_config_prefix_messages.hpp` to meson build (#2903) -* `catch_discover_tests` now supports skipped tests (#2873) - * You can get the old behaviour by calling `catch_discover_tests` with `SKIP_IS_FAILURE` option. - - -## 3.7.0 - -### Improvements -* Slightly improved compile times of benchmarks -* Made the resolution estimation in benchmarks slightly more precise -* Added new test case macro, `TEST_CASE_PERSISTENT_FIXTURE` (#2885, #1602) - * Unlike `TEST_CASE_METHOD`, the same underlying instance is used for all partial runs of that test case -* **MASSIVELY** improved performance of the JUnit reporter when handling successful assertions (#2897) - * For 1 test case and 10M assertions, the new reporter runs 3x faster and uses up only 8 MB of memory, while the old one needs 7 GB of memory. -* Reworked how output redirects works. - * Combining a reporter writing to stdout with capturing reporter no longer leads to the capturing reporter seeing all of the other reporter's output. - * The file based redirect no longer opens up a new temporary file for each partial test case run, so it will not run out of temporary files when running many tests in single process. - -### Miscellaneous -* Better documentation for matchers on thrown exceptions (`REQUIRE_THROWS_MATCHES`) -* Improved `catch_discover_tests`'s handling of environment paths (#2878) - * It won't reorder paths in `DL_PATHS` or `DYLD_FRAMEWORK_PATHS` args - * It won't overwrite the environment paths for test discovery - - -## 3.6.0 - -### Fixes -* Fixed Windows ARM64 build by fixing the preprocessor condition guarding use `_umul128` intrinsic. -* Fixed Windows ARM64EC build by removing intrinsic pragma it does not understand. (#2858) - * Why doesn't the x64-emulation build mode understand x64 pragmas? Don't ask me, ask the MSVC guys. -* Fixed the JUnit reporter sometimes crashing when reporting a fatal error. (#1210, #2855) - * The binary will still exit, but through the original error, rather than secondary error inside the reporter. - * The underlying fix applies to all reporters, not just the JUnit one, but only JUnit was currently causing troubles. - -### Improvements -* Disable `-Wnon-virtual-dtor` in Decomposer and Matchers (#2854) -* `precision` in floating point stringmakers defaults to `max_digits10`. - * This means that floating point values will be printed with enough precision to disambiguate any two floats. -* Column wrapping ignores ansi colour codes when calculating string width (#2833, #2849) - * This makes the output much more readable when the provided messages contain colour codes. - -### Miscellaneous -* Conan support improvements - * `compatibility_cppstr` is set to False. (#2860) - * This means that Conan won't let you mix library and project with different C++ standard settings. - * The implementation library CMake target name through Conan is properly set to `Catch2::Catch2` (#2861) -* `SelfTest` target can be built through Bazel (#2857) - - -## 3.5.4 - -### Fixes -* Fixed potential compilation error when asked to generate random integers whose type did not match `std::(u)int*_t`. - * This manifested itself when generating random `size_t`s on MacOS -* Added missing outlined destructor causing `Wdelete-incomplete` when compiling against libstdc++ in C++23 mode (#2852) -* Fixed regression where decomposing assertion with const instance of `std::foo_ordering` would not compile - -### Improvements -* Reintroduced support for GCC 5 and 6 (#2836) - * As with VS2017, if they start causing trouble again, they will be dropped again. -* Added workaround for targeting newest MacOS (Sonoma) using GCC (#2837, #2839) -* `CATCH_CONFIG_DEFAULT_REPORTER` can now be an arbitrary reporter spec - * Previously it could only be a plain reporter name, so it was impossible to compile in custom arguments to the reporter. -* Improved performance of generating 64bit random integers by 20+% - -### Miscellaneous -* Significantly improved Conan in-tree recipe (#2831) -* `DL_PATHS` in `catch_discover_tests` now supports multiple arguments (#2852, #2736) -* Fixed preprocessor logic for checking whether we expect reproducible floating point results in tests. -* Improved the floating point tests structure to avoid `Wunused` when the reproducibility tests are disabled (#2845) - - -## 3.5.3 - -### Fixes -* Fixed OOB access when computing filename tag (from the `-#` flag) for file without extension (#2798) -* Fixed the linking against `log` on Android to be `PRIVATE` (#2815) -* Fixed `Wuseless-cast` in benchmarking internals (#2823) - -### Improvements -* Restored compatibility with VS2017 (#2792, #2822) - * The baseline for Catch2 is still C++14 with some reasonable workarounds for specific compilers, so if VS2017 starts acting up again, the support will be dropped again. -* Suppressed clang-tidy's `bugprone-chained-comparison` in assertions (#2801) -* Improved the static analysis mode to evaluate arguments to `TEST_CASE` and `SECTION` (#2817) - * Clang-tidy should no longer warn about runtime arguments to these macros being unused in static analysis mode. - * Clang-tidy can warn on issues involved arguments to these macros. -* Added support for literal-zero detectors based on `consteval` constructors - * This is required for compiling `REQUIRE((a <=> b) == 0)` against MSVC's stdlib. - * Sadly, MSVC still cannot compile this assertion as it does not implement C++20 correctly. - * You can use `clang-cl` with MSVC's stdlib instead. - * If for some godforsaken reasons you want to understand this better, read the two relevant commits: [`dc51386b9fd61f99ea9c660d01867e6ad489b403`](https://github.com/catchorg/Catch2/commit/dc51386b9fd61f99ea9c660d01867e6ad489b403), and [`0787132fc82a75e3fb255aa9484ca1dc1eff2a30`](https://github.com/catchorg/Catch2/commit/0787132fc82a75e3fb255aa9484ca1dc1eff2a30). - -### Miscellaneous -* Disabled tests for FP random generator reproducibility on non-SSE2 x86 targets (#2796) -* Modified the in-tree Conan recipe to support Conan 2 (#2805) - - -## 3.5.2 - -### Fixes -* Fixed `-Wsubobject-linkage` in the Console reporter (#2794) -* Fixed adding new CLI Options to lvalue parser using `|` (#2787) - - -## 3.5.1 - -### Improvements -* Significantly improved performance of the CLI parsing. - * This includes the cost of preparing the CLI parser, so Catch2's binaries start much faster. - -### Miscellaneous -* Added support for Bazel modules (#2781) -* Added CMake option to disable the build reproducibility settings (#2785) -* Added `log` library linking to the Meson build (#2784) - - -## 3.5.0 - -### Improvements -* Introduced `CATCH_CONFIG_PREFIX_MESSAGES` to prefix only logging macros (#2544) - * This means `INFO`, `UNSCOPED_INFO`, `WARN` and `CAPTURE`. -* Section hints in static analysis mode are now `const` - * This prevents Clang-Tidy from complaining about `misc-const-correctness`. -* `from_range` generator supports C arrays and ranges that require ADL (#2737) -* Stringification support for `std::optional` now also includes `std::nullopt` (#2740) -* The Console reporter flushes output after writing benchmark runtime estimate. - * This means that you can immediately see for how long the benchmark is expected to run. -* Added workaround to enable compilation with ICC 19.1 (#2551, #2766) -* Compiling Catch2 for XBox should work out of the box (#2772) - * Catch2 should automatically disable getenv when compiled for XBox. -* Compiling Catch2 with exceptions disabled no longer triggers `Wunused-function` (#2726) -* **`random` Generators for integral types are now reproducible across different platforms** - * Unlike `<random>`, Catch2's generators also support 1 byte integral types (`char`, `bool`, ...) -* **`random` Generators for `float` and `double` are now reproducible across different platforms** - * `long double` varies across different platforms too much to be reproducible - * This guarantee applies only to platforms with IEEE 754 floats. - -### Fixes -* UDL declaration inside Catch2 are now strictly conforming to the standard - * `operator "" _a` is UB, `operator ""_a` is fine. Seriously. -* Fixed `CAPTURE` tests failing to compile in C++23 mode (#2744) -* Fixed missing include in `catch_message.hpp` (#2758) -* Fixed `CHECK_ELSE` suppressing failure from uncaught exceptions(#2723) - -### Miscellaneous -* The documentation for specifying which tests to run through commandline has been completely rewritten (#2738) -* Fixed installation when building Catch2 with meson (#2722, #2742) -* Fixed `catch_discover_tests` when using custom reporter and `PRE_TEST` discovery mode (#2747) -* `catch_discover_tests` supports multi-config CMake generator in `PRE_TEST` discovery mode (#2739, #2746) - - -## 3.4.0 - -### Improvements -* `VectorEquals` supports elements that provide only `==` and not `!=` (#2648) -* Catch2 supports compiling with IAR compiler (#2651) -* Various small internal performance improvements -* Various small internal compilation time improvements -* XMLReporter now reports location info for INFO and WARN (#1251) - * This bumps up the xml format version to 3 -* Documented that `SKIP` in generator constructor can be used to handle empty generator (#1593) -* Added experimental static analysis support to `TEST_CASE` and `SECTION` macros (#2681) - * The two macros are redefined in a way that helps the SA tools reason about the possible paths through a test case with sections. - * The support is controlled by the `CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT` option and autodetects clang-tidy and Coverity. -* `*_THROWS`, `*_THROWS_AS`, etc now suppress warning coming from `__attribute__((warn_unused_result))` on GCC (#2691) - * Unlike plain `[[nodiscard]]`, this warning is not silenced by void cast. WTF GCC? - -### Fixes -* Fixed `assertionStarting` events being sent after the expr is evaluated (#2678) -* Errors in `TEST_CASE` tags are now reported nicely (#2650) - -### Miscellaneous -* Bunch of improvements to `catch_discover_tests` - * Added DISCOVERY_MODE option, so the discovery can happen either post build or pre-run. - * Fixed handling of semicolons and backslashes in test names (#2674, #2676) -* meson build can disable building tests (#2693) -* meson build properly sets meson version 0.54.1 as the minimal supported version (#2688) - - -## 3.3.2 - -### Improvements -* Further reduced allocations - * The compact, console, TAP and XML reporters perform less allocations in various cases - * Removed 1 allocation per entered `SECTION`/`TEST_CASE`. - * Removed 2 allocations per test case exit, if stdout/stderr is captured -* Improved performance - * Section tracking is 10%-25% faster than in v3.3.0 - * Assertion handling is 5%-10% faster than in v3.3.0 - * Test case registration is 1%-2% faster than in v3.3.0 - * Tiny speedup for registering listeners - * Tiny speedup for `CAPTURE`, `TEST_CASE_METHOD`, `METHOD_AS_TEST_CASE`, and `TEMPLATE_LIST_TEST_*` macros. -* `Contains`, `RangeEquals` and `UnorderedRangeEquals` matchers now support ranges with iterator + sentinel pair -* Added `IsNaN` matcher - * Unlike `REQUIRE(isnan(x))`, `REQUIRE_THAT(x, IsNaN())` shows you the value of `x`. -* Suppressed `declared_but_not_referenced` warning for NVHPC (#2637) - -### Fixes -* Fixed performance regression in section tracking introduced in v3.3.1 - * Extreme cases would cause the tracking to run about 4x slower than in 3.3.0 - - -## 3.3.1 - -### Improvements -* Reduced allocations and improved performance - * The exact improvements are dependent on your usage of Catch2. - * For example running Catch2's SelfTest binary performs 8k less allocations. - * The main improvement comes from smarter handling of `SECTION`s, especially sibling `SECTION`s - - -## 3.3.0 - -### Improvements - -* Added `MessageMatches` exception matcher (#2570) -* Added `RangeEquals` and `UnorderedRangeEquals` generic range matchers (#2377) -* Added `SKIP` macro for skipping tests from within the test body (#2360) - * All built-in reporters have been extended to handle it properly, whether your custom reporter needs changes depends on how it was written - * `skipTest` reporter event **is unrelated** to this, and has been deprecated since it has practically no uses -* Restored support for PPC Macs in the break-into-debugger functionality (#2619) -* Made our warning suppression compatible with CUDA toolkit pre 11.5 (#2626) -* Cleaned out some static analysis complaints - - -### Fixes - -* Fixed macro redefinition warning when NVCC was reporting as MSVC (#2603) -* Fixed throws in generator constructor causing the whole binary to abort (#2615) - * Now it just fails the test -* Fixed missing transitive include with libstdc++13 (#2611) - - -### Miscellaneous - -* Improved support for dynamic library build with non-MSVC compilers on Windows (#2630) -* When used as a subproject, Catch2 keeps its generated header in a separate directory from the main project (#2604) - - - -## 3.2.1 - -### Improvements -* Fix the reworked decomposer to work with older (pre 9) GCC versions (#2571) - * **This required more significant changes to properly support C++20, there might be bugs.** - - -## 3.2.0 - -### Improvements -* Catch2 now compiles on PlayStation (#2562) -* Added `CATCH_CONFIG_GETENV` compile-time toggle (#2562) - * This toggle guards whether Catch2 calls `std::getenv` when reading env variables -* Added support for more Bazel test environment variables - * `TESTBRIDGE_TEST_ONLY` is now supported (#2490) - * Sharding variables, `TEST_SHARD_INDEX`, `TEST_TOTAL_SHARDS`, `TEST_SHARD_STATUS_FILE`, are now all supported (#2491) -* Bunch of small tweaks and improvements in reporters - * The TAP and SonarQube reporters output the used test filters - * The XML reporter now also reports the version of its output format - * The compact reporter now uses the same summary output as the console reporter (#878, #2554) -* Added support for asserting on types that can only be compared with literal 0 (#2555) - * A canonical example is C++20's `std::*_ordering` types, which cannot be compared with an `int` variable, only `0` - * The support extends to any type with this property, not just the ones in stdlib - * This change imposes 2-3% slowdown on compiling files that are heavy on `REQUIRE` and friends - * **This required significant rewrite of decomposition, there might be bugs** -* Simplified internals of matcher related macros - * This provides about ~2% speed up compiling files that are heavy on `REQUIRE_THAT` and friends - - -### Fixes -* Cleaned out some warnings and static analysis issues - * Suppressed `-Wcomma` warning rarely occurring in templated test cases (#2543) - * Constified implementation details in `INFO` (#2564) - * Made `MatcherGenericBase` copy constructor const (#2566) -* Fixed serialization of test filters so the output roundtrips - * This means that e.g. `./tests/SelfTest "aaa bbb", [approx]` outputs `Filters: "aaa bbb",[approx]` - - -### Miscellaneous -* Catch2's build no longer leaks `-ffile-prefix-map` setting to dependees (#2533) - - - -## 3.1.1 - -### Improvements -* Added `Catch::getSeed` function that user code can call to retrieve current rng-seed -* Better detection of compiler support for `-ffile-prefix-map` (#2517) -* Catch2's shared libraries now have `SOVERSION` set (#2516) -* `catch2/catch_all.hpp` convenience header no longer transitively includes `windows.h` (#2432, #2526) - - -### Fixes -* Fixed compilation on Universal Windows Platform -* Fixed compilation on VxWorks (#2515) -* Fixed compilation on Cygwin (#2540) -* Remove unused variable in reporter registration (#2538) -* Fixed some symbol visibility issues with dynamic library on Windows (#2527) -* Suppressed `-Wuseless-cast` warnings in `REQUIRE_THROWS*` macros (#2520, #2521) - * This was triggered when the potentially throwing expression evaluates to `void` -* Fixed "warning: storage class is not first" with `nvc++` (#2533) -* Fixed handling of `DL_PATHS` argument to `catch_discover_tests` on MacOS (#2483) -* Suppressed `*-avoid-c-arrays` clang-tidy warning in `TEMPLATE_TEST_CASE` (#2095, #2536) - - -### Miscellaneous -* Fixed CMake install step for Catch2 build as dynamic library (#2485) -* Raised minimum CMake version to 3.10 (#2523) - * Expect the minimum CMake version to increase once more in next few releases. -* Whole bunch of doc updates and fixes - * #1444, #2497, #2547, #2549, and more -* Added support for building Catch2 with Meson (#2530, #2539) - - - -## 3.1.0 - -### Improvements -* Improved suppression of `-Wparentheses` for older GCCs - * Turns out that even GCC 9 does not properly handle `_Pragma`s in the C++ frontend. -* Added type constraints onto `random` generator (#2433) - * These constraints copy what the standard says for the underlying `std::uniform_int_distribution` -* Suppressed -Wunused-variable from nvcc (#2306, #2427) -* Suppressed -Wunused-variable from MinGW (#2132) -* Added All/Any/NoneTrue range matchers (#2319) - * These check that all/any/none of boolean values in a range are true. -* The JUnit reporter now normalizes classnames from C++ namespaces to Java-like namespaces (#2468) - * This provides better support for other JUnit based tools. -* The Bazel support now understands `BAZEL_TEST` environment variable (#2459) - * The `CATCH_CONFIG_BAZEL_SUPPORT` configuration option is also still supported. -* Returned support for compiling Catch2 with GCC 5 (#2448) - * This required removing inherited constructors from Catch2's internals. - * I recommend updating to a newer GCC anyway. -* `catch_discover_tests` now has a new options for setting library load path(s) when running the Catch2 binary (#2467) - - -### Fixes -* Fixed crash when listing listeners without any registered listeners (#2442) -* Fixed nvcc compilation error in constructor benchmarking helper (#2477) -* Catch2's CMakeList supports pre-3.12 CMake again (#2428) - * The gain from requiring CMake 3.12 was very minor, but y'all should really update to newer CMake - - -### Miscellaneous -* Fixed SelfTest build on MinGW (#2447) -* The in-repo conan recipe exports the CMake helper (#2460) -* Added experimental CMake script to showcase using test case sharding together with CTest - * Compared to `catch_discover_tests`, it supports very limited number of options and customization -* Added documentation page on best practices when running Catch2 tests -* Catch2 can be built as a dynamic library (#2397, #2398) - * Note that Catch2 does not have visibility annotations, and you are responsible for ensuring correct visibility built into the resulting library. - - - -## 3.0.1 - -**Catch2 now uses statically compiled library as its distribution model. -This also means that to get all of Catch2's functionality in a test file, -you have to include multiple headers.** - -You probably want to look into the [migration docs](migrate-v2-to-v3.md#top), -which were written to help people coming from v2.x.x versions to the -v3 releases. - - -### FAQ - -* Why is Catch2 moving to separate headers? - * The short answer is future extensibility and scalability. The long answer is complex and can be found on my blog, but at the most basic level, it is that providing single-header distribution is at odds with providing variety of useful features. When Catch2 was distributed in a single header, adding a new Matcher would cause overhead for everyone, but was useful only to a subset of users. This meant that the barrier to entry for new Matchers/Generators/etc is high in single header model, but much smaller in the new model. -* Will Catch2 again distribute single-header version in the future? - * No. But we do provide sqlite-style amalgamated distribution option. This means that you can download just 1 .cpp file and 1 header and place them next to your own sources. However, doing this has downsides similar to using the `catch_all.hpp` header. -* Why the big breaking change caused by replacing `catch.hpp` with `catch_all.hpp`? - * The convenience header `catch_all.hpp` exists for two reasons. One of them is to provide a way for quick migration from Catch2, the second one is to provide a simple way to test things with Catch2. Using it for migration has one drawback in that it is **big**. This means that including it _will_ cause significant compile time drag, and so using it to migrate should be a conscious decision by the user, not something they can just stumble into unknowingly. - - -### (Potentially) Breaking changes -* **Catch2 now uses statically compiled library as its distribution model** - * **Including `catch.hpp` no longer works** -* **Catch2 now uses C++14 as the minimum support language version** -* `ANON_TEST_CASE` has been removed, use `TEST_CASE` with no arguments instead (#1220) -* `--list*` commands no longer have non-zero return code (#1410) -* `--list-test-names-only` has been removed (#1190) - * You should use verbosity-modifiers for `--list-tests` instead -* `--list*` commands are now piped through the reporters - * The top-level reporter interface provides default implementation that works just as the old one - * XmlReporter outputs a machine-parseable XML -* `TEST_CASE` description support has been removed - * If the second argument has text outside tags, the text will be ignored. -* Hidden test cases are no longer included just because they don't match an exclusion tag - * Previously, a `TEST_CASE("A", "[.foo]")` would be included by asking for `~[bar]`. -* `PredicateMatcher` is no longer type erased. - * This means that the type of the provided predicate is part of the `PredicateMatcher`'s type -* `SectionInfo` no longer contains section description as a member (#1319) - * You can still write `SECTION("ShortName", "Long and wordy description")`, but the description is thrown away - * The description type now must be a `const char*` or be implicitly convertible to it -* The `[!hide]` tag has been removed. - * Use `[.]` or `[.foo]` instead. -* Lvalues of composed matchers cannot be composed further -* Uses of `REGISTER_TEST_CASE` macro need to be followed by a semicolon - * This does not change `TEST_CASE` and friends in any way -* `IStreamingReporter::IsMulti` member function was removed - * This is _very_ unlikely to actually affect anyone, as it was default-implemented in the interface, and only used internally -* Various classes not designed for user-extension have been made final - * `ListeningReporter` is now `final` - * Concrete Matchers (e.g. `UnorderedEquals` vector matcher) are now `final` - * All Generators are now `final` -* Matcher namespacing has been redone - * Matcher types are no longer in deeply nested namespaces - * Matcher factory functions are no longer brought into `Catch` namespace - * This means that all public-facing matcher-related functionality is now in `Catch::Matchers` namespace -* Defining `CATCH_CONFIG_MAIN` will no longer create main in that TU. - * Link with `libCatch2Main.a`, or the proper CMake/pkg-config target - * If you want to write custom main, include `catch2/catch_session.hpp` -* `CATCH_CONFIG_EXTERNAL_INTERFACES` has been removed. - * You should instead include the appropriate headers as needed. -* `CATCH_CONFIG_IMPL` has been removed. - * The implementation is now compiled into a static library. -* Event Listener interface has changed - * `TestEventListenerBase` was renamed to `EventListenerBase` - * `EventListenerBase` now directly derives from `IStreamingReporter`, instead of deriving from `StreamingReporterBase` -* `GENERATE` decays its arguments (#2012, #2040) - * This means that `str` in `auto str = GENERATE("aa", "bb", "cc");` is inferred to `char const*` rather than `const char[2]`. -* `--list-*` flags write their output to file specified by the `-o` flag -* Many changes to reporter interfaces - * With the exception of the XmlReporter, the outputs of first party reporters should remain the same - * New pair of events were added - * One obsolete event was removed - * The base class has been renamed - * The built-in reporter class hierarchy has been redone -* Catch2 generates a random seed if one hasn't been specified by the user -* The short flag for `--list-tests`, `-l`, has been removed. - * This is not a commonly used flag and does not need to use up valuable single-letter space. -* The short flag for `--list-tags`, `-t`, has been removed. - * This is not a commonly used flag and does not need to use up valuable single-letter space. -* The `--colour` option has been replaced with `--colour-mode` option - - -### Improvements -* Matchers have been extended with the ability to use different signatures of `match` (#1307, #1553, #1554, #1843) - * This includes having templated `match` member function - * See the [rewritten Matchers documentation](matchers.md#top) for details - * Catch2 currently provides _some_ generic matchers, but there should be more before final release of v3 - * `IsEmpty`, `SizeIs` which check that the range has specific properties - * `Contains`, which checks whether a range contains a specific element - * `AllMatch`, `AnyMatch`, `NoneMatch` range matchers, which apply matchers over a range of elements -* Significant compilation time improvements - * including `catch_test_macros.hpp` is 80% cheaper than including `catch.hpp` -* Some runtime performance optimizations - * In all tested cases the v3 branch was faster, so the table below shows the speedup of v3 to v2 at the same task -<a id="v3-runtime-optimization-table"></a> - -| task | debug build | release build | -|:------------------------------------------- | ------------:| -------------:| -| Run 1M `REQUIRE(true)` | 1.10 ± 0.01 | 1.02 ± 0.06 | -| Run 100 tests, 3^3 sections, 1 REQUIRE each | 1.27 ± 0.01 | 1.04 ± 0.01 | -| Run 3k tests, no names, no tags | 1.29 ± 0.01 | 1.05 ± 0.01 | -| Run 3k tests, names, tags | 1.49 ± 0.01 | 1.22 ± 0.01 | -| Run 1 out of 3k tests no names, no tags | 1.68 ± 0.02 | 1.19 ± 0.22 | -| Run 1 out of 3k tests, names, tags | 1.79 ± 0.02 | 2.06 ± 0.23 | - - -* POSIX platforms use `gmtime_r`, rather than `gmtime` when constructing a date string (#2008, #2165) -* `--list-*` flags write their output to file specified by the `-o` flag (#2061, #2163) -* `Approx::operator()` is now properly `const` -* Catch2's internal helper variables no longer use reserved identifiers (#578) -* `--rng-seed` now accepts string `"random-device"` to generate random seed using `std::random_device` -* Catch2 now supports test sharding (#2257) - * You can ask for the tests to be split into N groups and only run one of them. - * This greatly simplifies parallelization of tests in a binary through external runner. -* The embedded CLI parser now supports repeatedly callable lambdas - * A lambda-based option parser can opt into being repeatedly specifiable. -* Added `STATIC_CHECK` macro, similar to `STATIC_REQUIRE` (#2318) - * When deferred tu runtime, it behaves like `CHECK`, and not like `REQUIRE`. -* You can have multiple tests with the same name, as long as other parts of the test identity differ (#1915, #1999, #2175) - * Test identity includes test's name, test's tags and test's class name if applicable. -* Added new warning, `UnmatchedTestSpec`, to error on test specs with no matching tests -* The `-w`, `--warn` warning flags can now be provided multiple times to enable multiple warnings -* The case-insensitive handling of tags is now more reliable and takes up less memory -* Test case and assertion counting can no longer reasonably overflow on 32 bit systems - * The count is now kept in `uint64_t` on all platforms, instead of using `size_t` type. -* The `-o`, `--out` output destination specifiers recognize `-` as stdout - * You have to provide it as `--out=-` to avoid CLI error about missing option - * The new reporter specification also recognizes `-` as stdout -* Multiple reporters can now run at the same time and write to different files (#1712, #2183) - * To support this, the `-r`, `--reporter` flag now also accepts optional output destination - * For full overview of the semantics of using multiple reporters, look into the reporter documentation - * To enable the new syntax, reporter names can no longer contain `::`. -* Console colour support has been rewritten and significantly improved - * The colour implementation based on ANSI colour codes is always available - * Colour implementations respect their associated stream - * previously e.g. Win32 impl would change console colour even if Catch2 was writing to a file - * The colour API is resilient against changing evaluation order of expressions - * The associated CLI flag and compile-time configuration options have changed - * For details see the docs for command-line and compile-time Catch2 configuration -* Added a support for Bazel integration with `XML_OUTPUT_FILE` env var (#2399) - * This has to be enabled during compilation. -* Added `--skip-benchmarks` flag to run tests without any `BENCHMARK`s (#2392, #2408) -* Added option to list all listeners in the binary via `--list-listeners` - - -### Fixes -* The `INFO` macro no longer contains superfluous semicolon (#1456) -* The `--list*` family of command line flags now return 0 on success (#1410, #1146) -* Various ways of failing a benchmark are now counted and reporter properly -* The ULP matcher now handles comparing numbers with different signs properly (#2152) -* Universal ADL-found operators should no longer break decomposition (#2121) -* Reporter selection is properly case-insensitive - * Previously it forced lower cased name, which would fail for reporters with upper case characters in name -* The cumulative reporter base stores benchmark results alongside assertion results -* Catch2's SE handling should no longer interferes with ASan on Windows (#2334) -* Fixed Windows console colour handling for tests that redirect stdout (#2345) -* Fixed issue with the `random` generators returning the same value over and over again - - -### Other changes -* `CATCH_CONFIG_DISABLE_MATCHERS` no longer exists. - * If you do not want to use Matchers in a TU, do not include their header. -* `CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER` no longer exists. - * `StringMaker` specializations for `<chrono>` are always provided -* Catch2's CMake now provides 2 targets, `Catch2` and `Catch2WithMain`. - * `Catch2` is the statically compiled implementation by itself - * `Catch2WithMain` also links in the default main -* Catch2's pkg-config integration also provides 2 packages - * `catch2` is the statically compiled implementation by itself - * `catch2-with-main` also links in the default main -* Passing invalid test specifications passed to Catch2 are now reported before tests are run, and are a hard error. -* Running 0 tests (e.g. due to empty binary, or test spec not matching anything) returns non-0 exit code - * Flag `--allow-running-no-tests` overrides this behaviour. - * `NoTests` warning has been removed because it is fully subsumed by this change. -* Catch2's compile-time configuration options (`CATCH_CONFIG_FOO`) can be set through CMake options of the same name - * They use the same semantics as C++ defines, including the `CATCH_CONFIG_NO_FOO` overrides, - * `-DCATCH_CONFIG_DEFAULT_REPORTER=compact` changes default reporter to "compact" - * `-DCATCH_CONFIG_NO_ANDROID_LOGWRITE=ON` forces android logwrite to off - * `-DCATCH_CONFIG_ANDROID_LOGWRITE=OFF` does nothing (the define will not exist) - - - -## 2.13.7 - -### Fixes -* Added missing `<iterator>` include in benchmarking. (#2231) -* Fixed noexcept build with benchmarking enabled (#2235) -* Fixed build for compilers with C++17 support but without C++17 library support (#2195) -* JUnit only uses 3 decimal places when reporting durations (#2221) -* `!mayfail` tagged tests are now marked as `skipped` in JUnit reporter output (#2116) - - -## 2.13.6 - -### Fixes -* Disabling all signal handlers no longer breaks compilation (#2212, #2213) - -### Miscellaneous -* `catch_discover_tests` should handle escaped semicolon (`;`) better (#2214, #2215) - - -## 2.13.5 - -### Improvements -* Detection of MAC and IPHONE platforms has been improved (#2140, #2157) -* Added workaround for bug in XLC 16.1.0.1 (#2155) -* Add detection for LCC when it is masquerading as GCC (#2199) -* Modified posix signal handling so it supports newer libcs (#2178) - * `MINSIGSTKSZ` was no longer usable in constexpr context. - -### Fixes -* Fixed compilation of benchmarking when `min` and `max` macros are defined (#2159) - * Including `windows.h` without `NOMINMAX` remains a really bad idea, don't do it - -### Miscellaneous -* The check whether Catch2 is being built as a subproject is now more reliable (#2202, #2204) - * The problem was that if the variable name used internally was defined the project including Catch2 as subproject, it would not be properly overwritten for Catch2's CMake. - - -## 2.13.4 - -### Improvements -* Improved the hashing algorithm used for shuffling test cases (#2070) - * `TEST_CASE`s that differ only in the last character should be properly shuffled - * Note that this means that v2.13.4 gives you a different order of test cases than 2.13.3, even given the same seed. - -### Miscellaneous -* Deprecated `ParseAndAddCatchTests` CMake integration (#2092) - * It is impossible to implement it properly for all the different test case variants Catch2 provides, and there are better options provided. - * Use `catch_discover_tests` instead, which uses runtime information about available tests. -* Fixed bug in `catch_discover_tests` that would cause it to fail when used in specific project structures (#2119) -* Added Bazel build file -* Added an experimental static library target to CMake - - -## 2.13.3 - -### Fixes -* Fixed possible infinite loop when combining generators with section filter (`-c` option) (#2025) - -### Miscellaneous -* Fixed `ParseAndAddCatchTests` not finding `TEST_CASE`s without tags (#2055, #2056) -* `ParseAndAddCatchTests` supports `CMP0110` policy for changing behaviour of `add_test` (#2057) - * This was the shortlived change in CMake 3.18.0 that temporarily broke `ParseAndAddCatchTests` - - -## 2.13.2 - -### Improvements -* Implemented workaround for AppleClang shadowing bug (#2030) -* Implemented workaround for NVCC ICE (#2005, #2027) - -### Fixes -* Fixed detection of `std::uncaught_exceptions` support under non-msvc platforms (#2021) -* Fixed the experimental stdout/stderr capture under Windows (#2013) - -### Miscellaneous -* `catch_discover_tests` has been improved significantly (#2023, #2039) - * You can now specify which reporter should be used - * You can now modify where the output will be written - * `WORKING_DIRECTORY` setting is respected -* `ParseAndAddCatchTests` now supports `TEMPLATE_TEST_CASE` macros (#2031) -* Various documentation fixes and improvements (#2022, #2028, #2034) - - -## 2.13.1 - -### Improvements -* `ParseAndAddCatchTests` handles CMake v3.18.0 correctly (#1984) -* Improved autodetection of `std::byte` (#1992) -* Simplified implementation of templated test cases (#2007) - * This should have a tiny positive effect on its compilation throughput - -### Fixes -* Automatic stringification of ranges handles sentinel ranges properly (#2004) - - -## 2.13.0 - -### Improvements -* `GENERATE` can now follow a `SECTION` at the same level of nesting (#1938) - * The `SECTION`(s) before the `GENERATE` will not be run multiple times, the following ones will. -* Added `-D`/`--min-duration` command line flag (#1910) - * If a test takes longer to finish than the provided value, its name and duration will be printed. - * This flag is overridden by setting `-d`/`--duration`. - -### Fixes -* `TAPReporter` no longer skips successful assertions (#1983) - - -## 2.12.4 - -### Improvements -* Added support for MacOS on ARM (#1971) - - -## 2.12.3 - -### Fixes -* `GENERATE` nested in a for loop no longer creates multiple generators (#1913) -* Fixed copy paste error breaking `TEMPLATE_TEST_CASE_SIG` for 6 or more arguments (#1954) -* Fixed potential UB when handling non-ASCII characters in CLI args (#1943) - -### Improvements -* There can be multiple calls to `GENERATE` on a single line -* Improved `fno-except` support for platforms that do not provide shims for exception-related std functions (#1950) - * E.g. the Green Hills C++ compiler -* XmlReporter now also reports test-case-level statistics (#1958) - * This is done via a new element, `OverallResultsCases` - -### Miscellaneous -* Added `.clang-format` file to the repo (#1182, #1920) -* Rewrote contributing docs - * They should explain the different levels of testing and so on much better - - -## 2.12.2 - -### Fixes -* Fixed compilation failure if `is_range` ADL found deleted function (#1929) -* Fixed potential UB in `CAPTURE` if the expression contained non-ASCII characters (#1925) - -### Improvements -* `std::result_of` is not used if `std::invoke_result` is available (#1934) -* JUnit reporter writes out `status` attribute for tests (#1899) -* Suppressed clang-tidy's `hicpp-vararg` warning (#1921) - * Catch2 was already suppressing the `cppcoreguidelines-pro-type-vararg` alias of the warning - - -## 2.12.1 - -### Fixes -* Vector matchers now support initializer list literals better - -### Improvements -* Added support for `^` (bitwise xor) to `CHECK` and `REQUIRE` - - - -## 2.12.0 - -### Improvements -* Running tests in random order (`--order rand`) has been reworked significantly (#1908) - * Given same seed, all platforms now produce the same order - * Given same seed, the relative order of tests does not change if you select only a subset of them -* Vector matchers support custom allocators (#1909) -* `|` and `&` (bitwise or and bitwise and) are now supported in `CHECK` and `REQUIRE` - * The resulting type must be convertible to `bool` - -### Fixes -* Fixed computation of benchmarking column widths in ConsoleReporter (#1885, #1886) -* Suppressed clang-tidy's `cppcoreguidelines-pro-type-vararg` in assertions (#1901) - * It was a false positive triggered by the new warning support workaround -* Fixed bug in test specification parser handling of OR'd patterns using escaping (#1905) - -### Miscellaneous -* Worked around IBM XL's codegen bug (#1907) - * It would emit code for _destructors_ of temporaries in an unevaluated context -* Improved detection of stdlib's support for `std::uncaught_exceptions` (#1911) - - - -## 2.11.3 - -### Fixes -* Fixed compilation error caused by lambdas in assertions under MSVC - - -## 2.11.2 - -### Improvements -* GCC and Clang now issue warnings for suspicious code in assertions (#1880) - * E.g. `REQUIRE( int != unsigned int )` will now issue mixed signedness comparison warning - * This has always worked on MSVC, but it now also works for GCC and current Clang versions -* Colorization of "Test filters" output should be more robust now -* `--wait-for-keypress` now also accepts `never` as an option (#1866) -* Reporters no longer round-off nanoseconds when reporting benchmarking results (#1876) -* Catch2's debug break now supports iOS while using Thumb instruction set (#1862) -* It is now possible to customize benchmark's warm-up time when running the test binary (#1844) - * `--benchmark-warmup-time {ms}` -* User can now specify how Catch2 should break into debugger (#1846) - -### Fixes -* Fixes missing `<random>` include in benchmarking (#1831) -* Fixed missing `<iterator>` include in benchmarking (#1874) -* Hidden test cases are now also tagged with `[!hide]` as per documentation (#1847) -* Detection of whether libc provides `std::nextafter` has been improved (#1854) -* Detection of `wmain` no longer incorrectly looks for `WIN32` macro (#1849) - * Now it just detects Windows platform -* Composing already-composed matchers no longer modifies the partially-composed matcher expression - * This bug has been present for the last ~2 years and nobody reported it - - - -## 2.11.1 - -### Improvements -* Breaking into debugger is supported on iOS (#1817) -* `google-build-using-namespace` clang-tidy warning is suppressed (#1799) - -### Fixes -* Clang on Windows is no longer assumed to implement MSVC's traditional preprocessor (#1806) -* `ObjectStorage` now behaves properly in `const` contexts (#1820) -* `GENERATE_COPY(a, b)` now compiles properly (#1809, #1815) -* Some more cleanups in the benchmarking support - - - -## 2.11.0 - -### Improvements -* JUnit reporter output now contains more details in case of failure (#1347, #1719) -* Added SonarQube Test Data reporter (#1738) - * It is in a separate header, just like the TAP, Automake, and TeamCity reporters -* `range` generator now allows floating point numbers (#1776) -* Reworked part of internals to increase throughput - - -### Fixes -* The single header version should contain full benchmarking support (#1800) -* `[.foo]` is now properly parsed as `[.][foo]` when used on the command line (#1798) -* Fixed compilation of benchmarking on platforms where `steady_clock::period` is not `std::nano` (#1794) - - - -## 2.10.2 - -### Improvements -* Catch2 will now compile on platform where `INFINITY` is double (#1782) - - -### Fixes -* Warning suppressed during listener registration will no longer leak - - - -## 2.10.1 - -### Improvements -* Catch2 now guards itself against `min` and `max` macros from `windows.h` (#1772) -* Templated tests will now compile with ICC (#1748) -* `WithinULP` matcher now uses scientific notation for stringification (#1760) - - -### Fixes -* Templated tests no longer trigger `-Wunused-templates` (#1762) -* Suppressed clang-analyzer false positive in context getter (#1230, #1735) - - -### Miscellaneous -* CMake no longer prohibits in-tree build when Catch2 is used as a subproject (#1773, #1774) - - - -## 2.10.0 - -### Fixes -* `TEMPLATE_LIST_TEST_CASE` now properly handles non-copyable and non-movable types (#1729) -* Fixed compilation error on Solaris caused by a system header defining macro `TT` (#1722, #1723) -* `REGISTER_ENUM` will now fail at compilation time if the registered enum is too large -* Removed use of `std::is_same_v` in C++17 mode (#1757) -* Fixed parsing of escaped special characters when reading test specs from a file (#1767, #1769) - - -### Improvements -* Trailing and leading whitespace in test/section specs are now ignored. -* Writing to Android debug log now uses `__android_log_write` instead of `__android_log_print` -* Android logging support can now be turned on/off at compile time (#1743) - * The toggle is `CATCH_CONFIG_ANDROID_LOGWRITE` -* Added a generator that returns elements of a range - * Use via `from_range(from, to)` or `from_range(container)` -* Added support for CRTs that do not provide `std::nextafter` (#1739) - * They must still provide global `nextafter{f,l,}` - * Enabled via `CATCH_CONFIG_GLOBAL_NEXTAFTER` -* Special cased `Approx(inf)` not to match non-infinite values - * Very strictly speaking this might be a breaking change, but it should match user expectations better -* The output of benchmarking through the Console reporter when `--benchmark-no-analysis` is set is now much simpler (#1768) -* Added a matcher that can be used for checking an exceptions message (#1649, #1728) - * The matcher helper function is called `Message` - * The exception must publicly derive from `std::exception` - * The matching is done exactly, including case and whitespace -* Added a matcher that can be used for checking relative equality of floating point numbers (#1746) - * Unlike `Approx`, it considers both sides when determining the allowed margin - * Special cases `NaN` and `INFINITY` to match user expectations - * The matcher helper function is called `WithinRel` -* The ULP matcher now allows for any possible distance between the two numbers -* The random number generators now use Catch-global instance of RNG (#1734, #1736) - * This means that nested random number generators actually generate different numbers - - -### Miscellaneous -* In-repo PNGs have been optimized to lower overhead of using Catch2 via git clone -* Catch2 now uses its own implementation of the URBG concept - * In the future we also plan to use our own implementation of the distributions from `<random>` to provide cross-platform repeatability of random results - - - -## 2.9.2 - -### Fixes -* `ChunkGenerator` can now be used with chunks of size 0 (#1671) -* Nested subsections are now run properly when specific section is run via the `-c` argument (#1670, #1673) -* Catch2 now consistently uses `_WIN32` to detect Windows platform (#1676) -* `TEMPLATE_LIST_TEST_CASE` now support non-default constructible type lists (#1697) -* Fixed a crash in the XMLReporter when a benchmark throws exception during warmup (#1706) -* Fixed a possible infinite loop in CompactReporter (#1715) -* Fixed `-w NoTests` returning 0 even when no tests were matched (#1449, #1683, #1684) -* Fixed matcher compilation under Obj-C++ (#1661) - -### Improvements -* `RepeatGenerator` and `FixedValuesGenerator` now fail to compile when used with `bool` (#1692) - * Previously they would fail at runtime. -* Catch2 now supports Android's debug logging for its debug output (#1710) -* Catch2 now detects and configures itself for the RTX platform (#1693) - * You still need to pass `--benchmark-no-analysis` if you are using benchmarking under RTX -* Removed a "storage class is not first" warning when compiling Catch2 with PGI compiler (#1717) - -### Miscellaneous -* Documentation now contains indication when a specific feature was introduced (#1695) - * These start with Catch2 v2.3.0, (a bit over a year ago). - * `docs/contributing.md` has been updated to provide contributors guidance on how to add these to newly written documentation -* Various other documentation improvements - * ToC fixes - * Documented `--order` and `--rng-seed` command line options - * Benchmarking documentation now clearly states that it requires opt-in - * Documented `CATCH_CONFIG_CPP17_OPTIONAL` and `CATCH_CONFIG_CPP17_BYTE` macros - * Properly documented built-in vector matchers - * Improved `*_THROWS_MATCHES` documentation a bit -* CMake config file is now arch-independent even if `CMAKE_SIZEOF_VOID_P` is in CMake cache (#1660) -* `CatchAddTests` now properly escapes `[` and `]` in test names (#1634, #1698) -* Reverted `CatchAddTests` adding tags as CTest labels (#1658) - * The script broke when test names were too long - * Overwriting `LABELS` caused trouble for users who set them manually - * CMake does not let users append to `LABELS` if the test name has spaces - - -## 2.9.1 - -### Fixes -* Fix benchmarking compilation failure in files without `CATCH_CONFIG_EXTERNAL_INTERFACES` (or implementation) - - -## 2.9.0 - -### Improvements -* The experimental benchmarking support has been replaced by integrating Nonius code (#1616) - * This provides a much more featurefull micro-benchmarking support. - * Due to the compilation cost, it is disabled by default. See the documentation for details. - * As far as backwards compatibility is concerned, this feature is still considered experimental in that we might change the interface based on user feedback. -* `WithinULP` matcher now shows the acceptable range (#1581) -* Template test cases now support type lists (#1627) - - -## 2.8.0 - -### Improvements -* Templated test cases no longer check whether the provided types are unique (#1628) - * This allows you to e.g. test over `uint32_t`, `uint64_t`, and `size_t` without compilation failing -* The precision of floating point stringification can be modified by user (#1612, #1614) -* We now provide `REGISTER_ENUM` convenience macro for generating `StringMaker` specializations for enums - * See the "String conversion" documentation for details -* Added new set of macros for template test cases that enables the use of NTTPs (#1531, #1609) - * See "Test cases and sections" documentation for details - -### Fixes -* `UNSCOPED_INFO` macro now has a prefixed/disabled/prefixed+disabled versions (#1611) -* Reporting errors at startup should no longer cause a segfault under certain circumstances (#1626) - - -### Miscellaneous -* CMake will now prevent you from attempting in-tree build (#1636, #1638) - * Previously it would break with an obscure error message during the build step - - -## 2.7.2 - -### Improvements -* Added an approximate vector matcher (#1499) - -### Fixes -* Filters will no longer be shown if there were none -* Fixed compilation error when using Homebrew GCC on OS X (#1588, #1589) -* Fixed the console reporter not showing messages that start with a newline (#1455, #1470) -* Modified JUnit reporter's output so that rng seed and filters are reported according to the JUnit schema (#1598) -* Fixed some obscure warnings and static analysis passes - -### Miscellaneous -* Various improvements to `ParseAndAddCatchTests` (#1559, #1601) - * When a target is parsed, it receives `ParseAndAddCatchTests_TESTS` property which summarizes found tests - * Fixed problem with tests not being found if the `OptionalCatchTestLauncher` variables is used - * Including the script will no longer forcefully modify `CMAKE_MINIMUM_REQUIRED_VERSION` - * CMake object libraries are ignored when parsing to avoid needless warnings -* `CatchAddTests` now adds test's tags to their CTest labels (#1600) -* Added basic CPack support to our build - -## 2.7.1 - -### Improvements -* Reporters now print out the filters applied to test cases (#1550, #1585) -* Added `GENERATE_COPY` and `GENERATE_REF` macros that can use variables inside the generator expression - * Because of the significant danger of lifetime issues, the default `GENERATE` macro still does not allow variables -* The `map` generator helper now deduces the mapped return type (#1576) - -### Fixes -* Fixed ObjC++ compilation (#1571) -* Fixed test tag parsing so that `[.foo]` is now parsed as `[.][foo]`. -* Suppressed warning caused by the Windows headers defining SE codes in different manners (#1575) - -## 2.7.0 - -### Improvements -* `TEMPLATE_PRODUCT_TEST_CASE` now uses the resulting type in the name, instead of the serial number (#1544) -* Catch2's single header is now strictly ASCII (#1542) -* Added generator for random integral/floating point types - * The types are inferred within the `random` helper -* Added back RangeGenerator (#1526) - * RangeGenerator returns elements within a certain range -* Added ChunkGenerator generic transform (#1538) - * A ChunkGenerator returns the elements from different generator in chunks of n elements -* Added `UNSCOPED_INFO` (#415, #983, #1522) - * This is a variant of `INFO` that lives until next assertion/end of the test case. - - -### Fixes -* All calls to C stdlib functions are now `std::` qualified (#1541) - * Code brought in from Clara was also updated. -* Running tests will no longer open the specified output file twice (#1545) - * This would cause trouble when the file was not a file, but rather a named pipe - * Fixes the CLion/Resharper integration with Catch -* Fixed `-Wunreachable-code` occurring with (old) ccache+cmake+clang combination (#1540) -* Fixed `-Wdefaulted-function-deleted` warning with Clang 8 (#1537) -* Catch2's type traits and helpers are now properly namespaced inside `Catch::` (#1548) -* Fixed std{out,err} redirection for failing test (#1514, #1525) - * Somehow, this bug has been present for well over a year before it was reported - - -### Contrib -* `ParseAndAddCatchTests` now properly escapes commas in the test name - - - -## 2.6.1 - -### Improvements -* The JUnit reporter now also reports random seed (#1520, #1521) - -### Fixes -* The TAP reporter now formats comments with test name properly (#1529) -* `CATCH_REQUIRE_THROWS`'s internals were unified with `REQUIRE_THROWS` (#1536) - * This fixes a potential `-Wunused-value` warning when used -* Fixed a potential segfault when using any of the `--list-*` options (#1533, #1534) - - -## 2.6.0 - -**With this release the data generator feature is now fully supported.** - - -### Improvements -* Added `TEMPLATE_PRODUCT_TEST_CASE` (#1454, #1468) - * This allows you to easily test various type combinations, see documentation for details -* The error message for `&&` and `||` inside assertions has been improved (#1273, #1480) -* The error message for chained comparisons inside assertions has been improved (#1481) -* Added `StringMaker` specialization for `std::optional` (#1510) -* The generator interface has been redone once again (#1516) - * It is no longer considered experimental and is fully supported - * The new interface supports "Input" generators - * The generator documentation has been fully updated - * We also added 2 generator examples - - -### Fixes -* Fixed `-Wredundant-move` on newer Clang (#1474) -* Removed unreachable mentions `std::current_exception`, `std::rethrow_exception` in no-exceptions mode (#1462) - * This should fix compilation with IAR -* Fixed missing `<type_traits>` include (#1494) -* Fixed various static analysis warnings - * Unrestored stream state in `XmlWriter` (#1489) - * Potential division by zero in `estimateClockResolution` (#1490) - * Uninitialized member in `RunContext` (#1491) - * `SourceLineInfo` move ops are now marked `noexcept` - * `CATCH_BREAK_INTO_DEBUGGER` is now always a function -* Fix double run of a test case if user asks for a specific section (#1394, #1492) -* ANSI colour code output now respects `-o` flag and writes to the file as well (#1502) -* Fixed detection of `std::variant` support for compilers other than Clang (#1511) - - -### Contrib -* `ParseAndAddCatchTests` has learned how to use `DISABLED` CTest property (#1452) -* `ParseAndAddCatchTests` now works when there is a whitespace before the test name (#1493) - - -### Miscellaneous -* We added new issue templates for reporting issues on GitHub -* `contributing.md` has been updated to reflect the current test status (#1484) - - - -## 2.5.0 - -### Improvements -* Added support for templated tests via `TEMPLATE_TEST_CASE` (#1437) - - -### Fixes -* Fixed compilation of `PredicateMatcher<const char*>` by removing partial specialization of `MatcherMethod<T*>` -* Listeners now implicitly support any verbosity (#1426) -* Fixed compilation with Embarcadero builder by introducing `Catch::isnan` polyfill (#1438) -* Fixed `CAPTURE` asserting for non-trivial captures (#1436, #1448) - - -### Miscellaneous -* We should now be providing first party Conan support via https://bintray.com/catchorg/Catch2 (#1443) -* Added new section "deprecations and planned changes" to the documentation - * It contains summary of what is deprecated and might change with next major version -* From this release forward, the released headers should be pgp signed (#430) - * KeyID `E29C 46F3 B8A7 5028 6079 3B7D ECC9 C20E 314B 2360` - * or https://codingnest.com/files/horenmar-publickey.asc - - -## 2.4.2 - -### Improvements -* XmlReporter now also outputs the RNG seed that was used in a run (#1404) -* `Catch::Session::applyCommandLine` now also accepts `wchar_t` arguments. - * However, Catch2 still does not support unicode. -* Added `STATIC_REQUIRE` macro (#1356, #1362) -* Catch2's singleton's are now cleaned up even if tests are run (#1411) - * This is mostly useful as a FP prevention for users who define their own main. -* Specifying an invalid reporter via `-r` is now reported sooner (#1351, #1422) - - -### Fixes -* Stringification no longer assumes that `char` is signed (#1399, #1407) - * This caused a `Wtautological-compare` warning. -* SFINAE for `operator<<` no longer sees different overload set than the actual insertion (#1403) - - -### Contrib -* `catch_discover_tests` correctly adds tests with comma in name (#1327, #1409) -* Added a new customization point in how the tests are launched to `catch_discover_tests` - - -## 2.4.1 - -### Improvements -* Added a StringMaker for `std::(w)string_view` (#1375, #1376) -* Added a StringMaker for `std::variant` (#1380) - * This one is disabled by default to avoid increased compile-time drag -* Added detection for cygwin environment without `std::to_string` (#1396, #1397) - -### Fixes -* `UnorderedEqualsMatcher` will no longer accept erroneously accept -vectors that share suffix, but are not permutation of the desired vector -* Abort after (`-x N`) can no longer be overshot by nested `REQUIRES` and -subsequently ignored (#1391, #1392) - - -## 2.4.0 - -**This release brings two new experimental features, generator support -and a `-fno-exceptions` support. Being experimental means that they -will not be subject to the usual stability guarantees provided by semver.** - -### Improvements -* Various small runtime performance improvements -* `CAPTURE` macro is now variadic -* Added `AND_GIVEN` macro (#1360) -* Added experimental support for data generators - * See [their documentation](generators.md) for details -* Added support for compiling and running Catch without exceptions - * Doing so limits the functionality somewhat - * Look [into the documentation](configuration.md#disablingexceptions) for details - -### Fixes -* Suppressed `-Wnon-virtual-dtor` warnings in Matchers (#1357) -* Suppressed `-Wunreachable-code` warnings in floating point matchers (#1350) - -### CMake -* It is now possible to override which Python is used to run Catch's tests (#1365) -* Catch now provides infrastructure for adding tests that check compile-time configuration -* Catch no longer tries to install itself when used as a subproject (#1373) -* Catch2ConfigVersion.cmake is now generated as arch-independent (#1368) - * This means that installing Catch from 32-bit machine and copying it to 64-bit one works - * This fixes conan installation of Catch - - -## 2.3.0 - -**This release changes the include paths provided by our CMake and -pkg-config integration. The proper include path for the single-header -when using one of the above is now `<catch2/catch.hpp>`. This change -also necessitated changes to paths inside the repository, so that the -single-header version is now at `single_include/catch2/catch.hpp`, rather -than `single_include/catch.hpp`.** - - - -### Fixes -* Fixed Objective-C++ build -* `-Wunused-variable` suppression no longer leaks from Catch's header under Clang -* Implementation of the experimental new output capture can now be disabled (#1335) - * This allows building Catch2 on platforms that do not provide things like `dup` or `tmpfile`. -* The JUnit and XML reporters will no longer skip over successful tests when running without `-s` (#1264, #1267, #1310) - * See improvements for more details - -### Improvements -* pkg-config and CMake integration has been rewritten - * If you use them, the new include path is `#include <catch2/catch.hpp>` - * CMake installation now also installs scripts from `contrib/` - * For details see the [new documentation](cmake-integration.md#top) -* Reporters now have a new customization point, `ReporterPreferences::shouldReportAllAssertions` - * When this is set to `false` and the tests are run without `-s`, passing assertions are not sent to the reporter. - * Defaults to `false`. -* Added `DYNAMIC_SECTION`, a section variant that constructs its name using stream - * This means that you can do `DYNAMIC_SECTION("For X := " << x)`. - - -## 2.2.3 - -**To fix some of the bugs, some behavior had to change in potentially breaking manner.** -**This means that even though this is a patch release, it might not be a drop-in replacement.** - -### Fixes -* Listeners are now called before reporter - * This was always documented to be the case, now it actually works that way -* Catch's commandline will no longer accept multiple reporters - * This was done because multiple reporters never worked properly and broke things in non-obvious ways - * **This has potential to be a breaking change** -* MinGW is now detected as Windows platform w/o SEH support (#1257) - * This means that Catch2 no longer tries to use POSIX signal handling when compiled with MinGW -* Fixed potential UB in parsing tags using non-ASCII characters (#1266) - * Note that Catch2 still supports only ASCII test names/tags/etc -* `TEST_CASE_METHOD` can now be used on classnames containing commas (#1245) - * You have to enclose the classname in extra set of parentheses -* Fixed insufficient alt stack size for POSIX signal handling (#1225) -* Fixed compilation error on Android due to missing `std::to_string` in C++11 mode (#1280) -* Fixed the order of user-provided `FALLBACK_STRINGIFIER` in stringification machinery (#1024) - * It was intended to be replacement for built-in fallbacks, but it was used _after_ them. - * **This has potential to be a breaking change** -* Fixed compilation error when a type has an `operator<<` with templated lhs (#1285, #1306) - -### Improvements -* Added a new, experimental, output capture (#1243) - * This capture can also redirect output written via C apis, e.g. `printf` - * To opt-in, define `CATCH_CONFIG_EXPERIMENTAL_REDIRECT` in the implementation file -* Added a new fallback stringifier for classes derived from `std::exception` - * Both `StringMaker` specialization and `operator<<` overload are given priority - -### Miscellaneous -* `contrib/` now contains dbg scripts that skip over Catch's internals (#904, #1283) - * `gdbinit` for gdb `lldbinit` for lldb -* `CatchAddTests.cmake` no longer strips whitespace from tests (#1265, #1281) -* Online documentation now describes `--use-colour` option (#1263) - - -## 2.2.2 - -### Fixes -* Fixed bug in `WithinAbs::match()` failing spuriously (#1228) -* Fixed clang-tidy diagnostic about virtual call in destructor (#1226) -* Reduced the number of GCC warnings suppression leaking out of the header (#1090, #1091) - * Only `-Wparentheses` should be leaking now -* Added upper bound on the time benchmark timer calibration is allowed to take (#1237) - * On platforms where `std::chrono::high_resolution_clock`'s resolution is low, the calibration would appear stuck -* Fixed compilation error when stringifying static arrays of `unsigned char`s (#1238) - -### Improvements -* XML encoder now hex-encodes invalid UTF-8 sequences (#1207) - * This affects xml and junit reporters - * Some invalid UTF-8 parts are left as is, e.g. surrogate pairs. This is because certain extensions of UTF-8 allow them, such as WTF-8. -* CLR objects (`T^`) can now be stringified (#1216) - * This affects code compiled as C++/CLI -* Added `PredicateMatcher`, a matcher that takes an arbitrary predicate function (#1236) - * See [documentation for details](https://github.com/catchorg/Catch2/blob/devel/docs/matchers.md) - -### Others -* Modified CMake-installed pkg-config to allow `#include <catch.hpp>`(#1239) - * The plans to standardize on `#include <catch2/catch.hpp>` are still in effect - - -## 2.2.1 - -### Fixes -* Fixed compilation error when compiling Catch2 with `std=c++17` against libc++ (#1214) - * Clara (Catch2's CLI parsing library) used `std::optional` without including it explicitly -* Fixed Catch2 return code always being 0 (#1215) - * In the words of STL, "We feel superbad about letting this in" - - -## 2.2.0 - -### Fixes -* Hidden tests are not listed by default when listing tests (#1175) - * This makes `catch_discover_tests` CMake script work better -* Fixed regression that meant `<windows.h>` could potentially not be included properly (#1197) -* Fixed installing `Catch2ConfigVersion.cmake` when Catch2 is a subproject. - -### Improvements -* Added an option to warn (+ exit with error) when no tests were ran (#1158) - * Use as `-w NoTests` -* Added provisional support for Emscripten (#1114) -* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/devel/docs/configuration.md#fallback-stringifier) (#1024) - * This allows project's own stringification machinery to be easily reused for Catch -* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178) - * The embedded version of Clara was bumped to v1.1.3 -* Various minor performance improvements -* Added support for DJGPP DOS crosscompiler (#1206) - - -## 2.1.2 - -### Fixes -* Fixed compilation error with `-fno-rtti` (#1165) -* Fixed NoAssertion warnings -* `operator<<` is used before range-based stringification (#1172) -* Fixed `-Wpedantic` warnings (extra semicolons and binary literals) (#1173) - - -### Improvements -* Added `CATCH_VERSION_{MAJOR,MINOR,PATCH}` macros (#1131) -* Added `BrightYellow` colour for use in reporters (#979) - * It is also used by ConsoleReporter for reconstructed expressions - -### Other changes -* Catch is now exported as a CMake package and linkable target (#1170) - -## 2.1.1 - -### Improvements -* Static arrays are now properly stringified like ranges across MSVC/GCC/Clang -* Embedded newer version of Clara -- v1.1.1 - * This should fix some warnings dragged in from Clara -* MSVC's CLR exceptions are supported - - -### Fixes -* Fixed compilation when comparison operators do not return bool (#1147) -* Fixed CLR exceptions blowing up the executable during translation (#1138) - - -### Other changes -* Many CMake changes - * `NO_SELFTEST` option is deprecated, use `BUILD_TESTING` instead. - * Catch specific CMake options were prefixed with `CATCH_` for namespacing purposes - * Other changes to simplify Catch2's packaging - - - -## 2.1.0 - -### Improvements -* Various performance improvements - * On top of the performance regression fixes -* Experimental support for PCH was added (#1061) -* `CATCH_CONFIG_EXTERNAL_INTERFACES` now brings in declarations of Console, Compact, XML and JUnit reporters -* `MatcherBase` no longer has a pointless second template argument -* Reduced the number of warning suppressions that leak into user's code - * Bugs in g++ 4.x and 5.x mean that some of them have to be left in - - -### Fixes -* Fixed performance regression from Catch classic - * One of the performance improvement patches for Catch classic was not applied to Catch2 -* Fixed platform detection for iOS (#1084) -* Fixed compilation when `g++` is used together with `libc++` (#1110) -* Fixed TeamCity reporter compilation with the single header version - * To fix the underlying issue we will be versioning reporters in single_include folder per release -* The XML reporter will now report `WARN` messages even when not used with `-s` -* Fixed compilation when `VectorContains` matcher was combined using `&&` (#1092) -* Fixed test duration overflowing after 10 seconds (#1125, #1129) -* Fixed `std::uncaught_exception` deprecation warning (#1124) - +# Release notes -### New features -* New Matchers - * Regex matcher for strings, `Matches`. - * Set-equal matcher for vectors, `UnorderedEquals` - * Floating point matchers, `WithinAbs` and `WithinULP`. -* Stringification now attempts to decompose all containers (#606) - * Containers are objects that respond to ADL `begin(T)` and `end(T)`. +These are the releases of Progmasoft Catch3. Its compatibility engine is +based on Catch2 3.16.1; Catch2's own history is in +[its release notes](https://github.com/catchorg/Catch2/blob/devel/docs/release-notes.md). +**Contents**<br> +[0.3.0 (unreleased)](#030-unreleased)<br> +[0.2.0](#020)<br> +[0.1.0](#010)<br> -### Other changes -* Reporters will now be versioned in the `single_include` folder to ensure their compatibility with the last released version +## 0.3.0 (unreleased) +### The Catch3 runner +Catch3 keeps Catch2's API for writing tests and replaces its session, command +line and reporters with [a runner of its own](progmasoft-runner.md#top): -## 2.0.1 +* Tests run in parallel worker processes; a crash, an exit or a hang ends one + test, not the run. +* Failures are retried alone to tell deterministic, flaky and order-dependent + failures apart; the test that leaves state behind is found by bisection. +* A history of verdicts and durations drives quarantine, learned time limits, + predictive ordering, incremental runs, replay and analytics. +* Tests are selected by change, by past failure or by prediction, and sharded + by a stable hash or by recorded duration. +* Tags declare serial and isolated tests, shared resources, dependencies, + time limits and retries. +* Every failure gets a category, a signature, an analysis and a replay command. +* Reports are console, JUnit XML, JSON and a Chrome trace; `--list=json` is a + versioned discovery format. +* Every test gets a temporary directory of its own. ### Breaking changes -* Removed C++98 support -* Removed legacy reporter support -* Removed legacy generator support - * Generator support will come back later, reworked -* Removed `Catch::toString` support - * The new stringification machinery uses `Catch::StringMaker` specializations first and `operator<<` overloads second. -* Removed legacy `SCOPED_MSG` and `SCOPED_INFO` macros -* Removed `INTERNAL_CATCH_REGISTER_REPORTER` - * `CATCH_REGISTER_REPORTER` should be used to register reporters -* Removed legacy `[hide]` tag - * `[.]`, `[.foo]` and `[!hide]` are still supported -* Output into debugger is now colourized -* `*_THROWS_AS(expr, exception_type)` now unconditionally appends `const&` to the exception type. -* `CATCH_CONFIG_FAST_COMPILE` now affects the `CHECK_` family of assertions as well as `REQUIRE_` family of assertions - * This is most noticeable in `CHECK(throws())`, which would previously report failure, properly stringify the exception and continue. Now it will report failure and stop executing current section. -* Removed deprecated matcher utility functions `Not`, `AllOf` and `AnyOf`. - * They are superseded by operators `!`, `&&` and `||`, which are natural and do not have limited arity -* Removed support for non-const comparison operators - * Non-const comparison operators are an abomination that should not exist - * They were breaking support for comparing function to function pointer -* `std::pair` and `std::tuple` are no longer stringified by default - * This is done to avoid dragging in `<tuple>` and `<utility>` headers in common path - * Their stringification can be enabled per-file via new configuration macros -* `Approx` is subtly different and hopefully behaves more as users would expect - * `Approx::scale` defaults to `0.0` - * `Approx::epsilon` no longer applies to the larger of the two compared values, but only to the `Approx`'s value - * `INFINITY == Approx(INFINITY)` returns true - - -### Improvements -* Reporters and Listeners can be defined in files different from the main file - * The file has to define `CATCH_CONFIG_EXTERNAL_INTERFACES` before including catch.hpp. -* Errors that happen during set up before main are now caught and properly reported once main is entered - * If you are providing your own main, you can access and use these as well. -* New assertion macros, *_THROWS_MATCHES(expr, exception_type, matcher) are provided - * As the arguments suggest, these allow you to assert that an expression throws desired type of exception and pass the exception to a matcher. -* JUnit reporter no longer has significantly different output for test cases with and without sections -* Most assertions now support expressions containing commas (ie `REQUIRE(foo() == std::vector<int>{1, 2, 3});`) -* Catch now contains experimental micro benchmarking support - * See `projects/SelfTest/Benchmark.tests.cpp` for examples - * The support being experiment means that it can be changed without prior notice -* Catch uses new CLI parsing library (Clara) - * Users can now easily add new command line options to the final executable - * This also leads to some changes in `Catch::Session` interface -* All parts of matchers can be removed from a TU by defining `CATCH_CONFIG_DISABLE_MATCHERS` - * This can be used to somewhat speed up compilation times -* An experimental implementation of `CATCH_CONFIG_DISABLE` has been added - * Inspired by Doctest's `DOCTEST_CONFIG_DISABLE` - * Useful for implementing tests in source files - * ie for functions in anonymous namespaces - * Removes all assertions - * Prevents `TEST_CASE` registrations - * Exception translators are not registered - * Reporters are not registered - * Listeners are not registered -* Reporters/Listeners are now notified of fatal errors - * This means specific signals or structured exceptions - * The Reporter/Listener interface provides default, empty, implementation to preserve backward compatibility -* Stringification of `std::chrono::duration` and `std::chrono::time_point` is now supported - * Needs to be enabled by a per-file compile time configuration option -* Add `pkg-config` support to CMake install command +* Catch2's command line, reporters, `CATCH_REGISTER_REPORTER` and listing + were removed; see [the command line](command-line.md#top) and + [reports](reporters.md#top). Listeners keep working. +* The Catch2 library is compiled as C++20; code that includes only its + headers still needs C++14. +* The results model in `Progmasoft/Catch3/Results.hpp` was rewritten around + tests and attempts. +* Conan packaging was dropped. ### Fixes -* Don't use console colour if running in XCode -* Explicit constructor in reporter base class -* Swept out `-Wweak-vtables`, `-Wexit-time-destructors`, `-Wglobal-constructors` warnings -* Compilation for Universal Windows Platform (UWP) is supported - * SEH handling and colorized output are disabled when compiling for UWP -* Implemented a workaround for `std::uncaught_exception` issues in libcxxrt - * These issues caused incorrect section traversals - * The workaround is only partial, user's test can still trigger the issue by using `throw;` to rethrow an exception -* Suppressed C4061 warning under MSVC - - -### Internal changes -* The development version now uses .cpp files instead of header files containing implementation. - * This makes partial rebuilds much faster during development -* The expression decomposition layer has been rewritten -* The evaluation layer has been rewritten -* New library (TextFlow) is used for formatting text to output - - -## Older versions - -### 1.12.x - -#### 1.12.2 -##### Fixes -* Fixed missing <cassert> include - -#### 1.12.1 - -##### Fixes -* Fixed deprecation warning in `ScopedMessage::~ScopedMessage` -* All uses of `min` or `max` identifiers are now wrapped in parentheses - * This avoids problems when Windows headers define `min` and `max` macros - -#### 1.12.0 - -##### Fixes -* Fixed compilation for strict C++98 mode (ie not gnu++98) and older compilers (#1103) -* `INFO` messages are included in the `xml` reporter output even without `-s` specified. - - -### 1.11.x - -#### 1.11.0 - -##### Fixes -* The original expression in `REQUIRE_FALSE( expr )` is now reporter properly as `!( expr )` (#1051) - * Previously the parentheses were missing and `x != y` would be expanded as `!x != x` -* `Approx::Margin` is now inclusive (#952) - * Previously it was meant and documented as inclusive, but the check itself wasn't - * This means that `REQUIRE( 0.25f == Approx( 0.0f ).margin( 0.25f ) )` passes, instead of fails -* `RandomNumberGenerator::result_type` is now unsigned (#1050) - -##### Improvements -* `__JETBRAINS_IDE__` macro handling is now CLion version specific (#1017) - * When CLion 2017.3 or newer is detected, `__COUNTER__` is used instead of -* TeamCity reporter now explicitly flushes output stream after each report (#1057) - * On some platforms, output from redirected streams would show up only after the tests finished running -* `ParseAndAddCatchTests` now can add test files as dependency to CMake configuration - * This means you do not have to manually rerun CMake configuration step to detect new tests - -### 1.10.x - -#### 1.10.0 - -##### Fixes -* Evaluation layer has been rewritten (backported from Catch 2) - * The new layer is much simpler and fixes some issues (#981) -* Implemented workaround for VS 2017 raw string literal stringification bug (#995) -* Fixed interaction between `[!shouldfail]` and `[!mayfail]` tags and sections - * Previously sections with failing assertions would be marked as failed, not failed-but-ok - -##### Improvements -* Added [libidentify](https://github.com/janwilmans/LibIdentify) support -* Added "wait-for-keypress" option - -### 1.9.x - -#### 1.9.6 - -##### Improvements -* Catch's runtime overhead has been significantly decreased (#937, #939) -* Added `--list-extra-info` cli option (#934). - * It lists all tests together with extra information, ie filename, line number and description. - - - -#### 1.9.5 - -##### Fixes -* Truthy expressions are now reconstructed properly, not as booleans (#914) -* Various warnings are no longer erroneously suppressed in test files (files that include `catch.hpp`, but do not define `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`) (#871) -* Catch no longer fails to link when main is compiled as C++, but linked against Objective-C (#855) -* Fixed incorrect gcc version detection when deciding to use `__COUNTER__` (#928) - * Previously any GCC with minor version less than 3 would be incorrectly classified as not supporting `__COUNTER__`. -* Suppressed C4996 warning caused by upcoming updated to MSVC 2017, marking `std::uncaught_exception` as deprecated. (#927) - -##### Improvements -* CMake integration script now incorporates debug messages and registers tests in an improved way (#911) -* Various documentation improvements - - - -#### 1.9.4 - -##### Fixes -* `CATCH_FAIL` macro no longer causes compilation error without variadic macro support -* `INFO` messages are no longer cleared after being reported once - -##### Improvements and minor changes -* Catch now uses `wmain` when compiled under Windows and `UNICODE` is defined. - * Note that Catch still officially supports only ASCII - -#### 1.9.3 - -##### Fixes -* Completed the fix for (lack of) uint64_t in earlier Visual Studios - -#### 1.9.2 - -##### Improvements and minor changes -* All of `Approx`'s member functions now accept strong typedefs in C++11 mode (#888) - * Previously `Approx::scale`, `Approx::epsilon`, `Approx::margin` and `Approx::operator()` didn't. - - -##### Fixes -* POSIX signals are now disabled by default under QNX (#889) - * QNX does not support current enough (2001) POSIX specification -* JUnit no longer counts exceptions as failures if given test case is marked as ok to fail. -* `Catch::Option` should now have its storage properly aligned. -* Catch no longer attempts to define `uint64_t` on windows (#862) - * This was causing trouble when compiled under Cygwin - -##### Other -* Catch is now compiled under MSVC 2017 using `std:c++latest` (C++17 mode) in CI -* We now provide cmake script that autoregisters Catch tests into ctest. - * See `contrib` folder. - - -#### 1.9.1 - -##### Fixes -* Unexpected exceptions are no longer ignored by default (#885, #887) - - -#### 1.9.0 - - -##### Improvements and minor changes -* Catch no longer attempts to ensure the exception type passed by user in `REQUIRE_THROWS_AS` is a constant reference. - * It was causing trouble when `REQUIRE_THROWS_AS` was used inside templated functions - * This actually reverts changes made in v1.7.2 -* Catch's `Version` struct should no longer be double freed when multiple instances of Catch tests are loaded into single program (#858) - * It is now a static variable in an inline function instead of being an `extern`ed struct. -* Attempt to register invalid tag or tag alias now throws instead of calling `exit()`. - * Because this happen before entering main, it still aborts execution - * Further improvements to this are coming -* `CATCH_CONFIG_FAST_COMPILE` now speeds-up compilation of `REQUIRE*` assertions by further ~15%. - * The trade-off is disabling translation of unexpected exceptions into text. -* When Catch is compiled using C++11, `Approx` is now constructible with anything that can be explicitly converted to `double`. -* Captured messages are now printed on unexpected exceptions - -##### Fixes: -* Clang's `-Wexit-time-destructors` should be suppressed for Catch's internals -* GCC's `-Wparentheses` is now suppressed for all TU's that include `catch.hpp`. - * This is functionally a revert of changes made in 1.8.0, where we tried using `_Pragma` based suppression. This should have kept the suppression local to Catch's assertions, but bugs in GCC's handling of `_Pragma`s in C++ mode meant that it did not always work. -* You can now tell Catch to use C++11-based check when checking whether a type can be streamed to output. - * This fixes cases when an unstreamable type has streamable private base (#877) - * [Details can be found in documentation](configuration.md#catch_config_cpp11_stream_insertable_check) - - -##### Other notes: -* We have added VS 2017 to our CI -* Work on Catch 2 should start soon - - - -### 1.8.x - -#### 1.8.2 - - -##### Improvements and minor changes -* TAP reporter now behaves as if `-s` was always set - * This should be more consistent with the protocol desired behaviour. -* Compact reporter now obeys `-d yes` argument (#780) - * The format is "XXX.123 s: <section-name>" (3 decimal places are always present). - * Before it did not report the durations at all. -* XML reporter now behaves the same way as Console reporter in regards to `INFO` - * This means it reports `INFO` messages on success, if output on success (`-s`) is enabled. - * Previously it only reported `INFO` messages on failure. -* `CAPTURE(expr)` now stringifies `expr` in the same way assertion macros do (#639) -* Listeners are now finally [documented](event-listeners.md#top). - * Listeners provide a way to hook into events generated by running your tests, including start and end of run, every test case, every section and every assertion. - - -##### Fixes: -* Catch no longer attempts to reconstruct expression that led to a fatal error (#810) - * This fixes possible signal/SEH loop when processing expressions, where the signal was triggered by expression decomposition. -* Fixed (C4265) missing virtual destructor warning in Matchers (#844) -* `std::string`s are now taken by `const&` everywhere (#842). - * Previously some places were taking them by-value. -* Catch should no longer change errno (#835). - * This was caused by libstdc++ bug that we now work around. -* Catch now provides `FAIL_CHECK( ... )` macro (#765). - * Same as `FAIL( ... )`, but does not abort the test. -* Functions like `fabs`, `tolower`, `memset`, `isalnum` are now used with `std::` qualification (#543). -* Clara no longer assumes first argument (binary name) is always present (#729) - * If it is missing, empty string is used as default. -* Clara no longer reads 1 character past argument string (#830) -* Regression in Objective-C bindings (Matchers) fixed (#854) - - -##### Other notes: -* We have added VS 2013 and 2015 to our CI -* Catch Classic (1.x.x) now contains its own, forked, version of Clara (the argument parser). - - - -#### 1.8.1 - -##### Fixes - -Cygwin issue with `gettimeofday` - `#define` was not early enough - -#### 1.8.0 - -##### New features/ minor changes - -* Matchers have new, simpler (and documented) interface. - * Catch provides string and vector matchers. - * For details see [Matchers documentation](matchers.md#top). -* Changed console reporter test duration reporting format (#322) - * Old format: `Some simple comparisons between doubles completed in 0.000123s` - * New format: `xxx.123s: Some simple comparisons between doubles` _(There will always be exactly 3 decimal places)_ -* Added opt-in leak detection under MSVC + Windows (#439) - * Enable it by compiling Catch's main with `CATCH_CONFIG_WINDOWS_CRTDBG` -* Introduced new compile-time flag, `CATCH_CONFIG_FAST_COMPILE`, trading features for compilation speed. - * Moves debug breaks out of tests and into implementation, speeding up test compilation time (~10% on linux). - * _More changes are coming_ -* Added [TAP (Test Anything Protocol)](https://testanything.org/) and [Automake](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html#Log-files-generation-and-test-results-recording) reporters. - * These are not present in the default single-include header and need to be downloaded from GitHub separately. - * For the current fork, see [tooling integration](ci-and-misc.md#top). -* XML reporter now reports filename as part of the `Section` and `TestCase` tags. -* `Approx` now supports an optional margin of absolute error - * It has also received [new documentation](assertions.md#top). - -##### Fixes -* Silenced C4312 ("conversion from int to 'ClassName *") warnings in the evaluate layer. -* Fixed C4512 ("assignment operator could not be generated") warnings under VS2013. -* Cygwin compatibility fixes - * Signal handling is no longer compiled by default. - * Usage of `gettimeofday` inside Catch should no longer cause compilation errors. -* Improved `-Wparentheses` suppression for gcc (#674) - * When compiled with gcc 4.8 or newer, the suppression is localized to assertions only - * Otherwise it is suppressed for the whole TU -* Fixed test spec parser issue (with escapes in multiple names) - -##### Other -* Various documentation fixes and improvements - - -### 1.7.x - -#### 1.7.2 - -##### Fixes and minor improvements -Xml: - -(technically the first two are breaking changes but are also fixes and arguably break few if any people) -* C-escape control characters instead of XML encoding them (which requires XML 1.1) -* Revert XML output to XML 1.0 -* Can provide stylesheet references by extending the XML reporter -* Added description and tags attributes to XML Reporter -* Tags are closed and the stream flushed more eagerly to avoid stdout interpolation - - -Other: -* `REQUIRE_THROWS_AS` now catches exception by `const&` and reports expected type -* In `SECTION`s the file/ line is now of the `SECTION`. not the `TEST_CASE` -* Added std:: qualification to some functions from C stdlib -* Removed use of RTTI (`dynamic_cast`) that had crept back in -* Silenced a few more warnings in different circumstances -* Travis improvements - -#### 1.7.1 - -##### Fixes: -* Fixed inconsistency in defining `NOMINMAX` and `WIN32_LEAN_AND_MEAN` inside `catch.hpp`. -* Fixed SEH-related compilation error under older MinGW compilers, by making Windows SEH handling opt-in for compilers other than MSVC. - * For specifics, look into the [documentation](configuration.md#top). -* Fixed compilation error under MinGW caused by improper compiler detection. -* Fixed XML reporter sometimes leaving an empty output file when a test ends with signal/structured exception. -* Fixed XML reporter not reporting captured stdout/stderr. -* Fixed possible infinite recursion in Windows SEH. -* Fixed possible compilation error caused by Catch's operator overloads being ambiguous in regards to user-defined templated operators. - -#### 1.7.0 - -##### Features/ Changes: -* Catch now runs significantly faster for passing tests - * Microbenchmark focused on Catch's overhead went from ~3.4s to ~0.7s. - * Real world test using [JSON for Modern C++](https://github.com/nlohmann/json)'s test suite went from ~6m 25s to ~4m 14s. -* Catch can now run specific sections within test cases. - * For now the support is only basic (no wildcards or tags), for details see the [documentation](command-line.md#top). -* Catch now supports SEH on Windows as well as signals on Linux. - * After receiving a signal, Catch reports failing assertion and then passes the signal onto the previous handler. -* Approx can be used to compare values against strong typedefs (available in C++11 mode only). - * Strong typedefs mean types that are explicitly convertible to double. -* CHECK macro no longer stops executing section if an exception happens. -* Certain characters (space, tab, etc) are now pretty printed. - * This means that a `char c = ' '; REQUIRE(c == '\t');` would be printed as `' ' == '\t'`, instead of ` == 9`. - -##### Fixes: -* Text formatting no longer attempts to access out-of-bounds characters under certain conditions. -* THROW family of assertions no longer trigger `-Wunused-value` on expressions containing explicit cast. -* Breaking into debugger under OS X works again and no longer required `DEBUG` to be defined. -* Compilation no longer breaks under certain compiler if a lambda is used inside assertion macro. - -##### Other: -* Catch's CMakeLists now defines install command. -* Catch's CMakeLists now generates projects with warnings enabled. - - -### 1.6.x - -#### 1.6.1 - -##### Features/ Changes: -* Catch now supports breaking into debugger on Linux - -##### Fixes: -* Generators no longer leak memory (generators are still unsupported in general) -* JUnit reporter now reports UTC timestamps, instead of "tbd" -* `CHECK_THAT` macro is now properly defined as `CATCH_CHECK_THAT` when using `CATCH_` prefixed macros -##### Other: -* Types with overloaded `&&` operator are no longer evaluated twice when used in an assertion macro. -* The use of `__COUNTER__` is suppressed when Catch is parsed by CLion - * This change is not active when compiling a binary -* Approval tests can now be run on Windows -* CMake will now warn if a file is present in the `include` folder but not is not enumerated as part of the project -* Catch now defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` before including `windows.h` - * This can be disabled if needed, see [documentation](configuration.md#top) for details. +* The property engine's example database can be written by several + processes at once. -#### 1.6.0 +## 0.2.0 -##### Cmake/ projects: -* Moved CMakeLists.txt to root, made it friendlier for CLion and generating XCode and VS projects, and removed the manually maintained XCode and VS projects. +Released 2026-09-24. -##### Features/ Changes: -* Approx now supports `>=` and `<=` -* Can now use `\` to escape chars in test names on command line -* Standardize C++11 feature toggles +* Snapshot comparison and update APIs. +* Framework-neutral test result summaries and deterministic JUnit XML. +* The Progmasoft additions are a static library in every supported build + system. -##### Fixes: -* Blue shell colour -* Missing argument to `CATCH_CHECK_THROWS` -* Don't encode extended ASCII in XML -* use `std::shuffle` on more compilers (fixes deprecation warning/error) -* Use `__COUNTER__` more consistently (where available) -##### Other: -* Tweaks and changes to scripts - particularly for Approval test - to make them more portable +## 0.1.0 +Released 2026-09-24. -## Even Older versions -Release notes were not maintained prior to v1.6.0, but you should be able to work them out from the Git history +* The first release: a deterministic property-testing API next to the + Catch2-compatible engine. +* Bazel module metadata, and CMake, Meson, Xmake and Premake builds. --- diff --git a/docs/release-process.md b/docs/release-process.md deleted file mode 100644 index 5ae35cd0..00000000 --- a/docs/release-process.md +++ /dev/null @@ -1,69 +0,0 @@ -<a id="top"></a> - -> **Upstream history:** This page is retained from Catch2 for provenance and compatibility. It does not describe Catch3 release policy or Progmasoft support. See [Catch3 documentation](Readme.md#top) for current guidance. - -# How to release - -When enough changes have accumulated, it is time to release new version of Catch. This document describes the process in doing so, that no steps are forgotten. Note that all referenced scripts can be found in the `tools/scripts/` directory. - -## Necessary steps - -These steps are necessary and have to be performed before each new release. They serve to make sure that the new release is correct and linked-to from the standard places. - - -### Testing - -All of the tests are currently run in our CI setup based on TravisCI and -AppVeyor. As long as the last commit tested green, the release can -proceed. - - -### Incrementing version number - -Catch uses a variant of [semantic versioning](http://semver.org/), with breaking API changes (and thus major version increments) being very rare. Thus, the release will usually increment the patch version, when it only contains couple of bugfixes, or minor version, when it contains new functionality, or larger changes in implementation of current functionality. - -After deciding which part of version number should be incremented, you can use one of the `*Release.py` scripts to perform the required changes to Catch. - -This will take care of generating the single include header, updating -version numbers everywhere and pushing the new version to Wandbox. - - -### Release notes - -Once a release is ready, release notes need to be written. They should summarize changes done since last release. For rough idea of expected notes see previous releases. Once written, release notes should be added to `docs/release-notes.md`. - - -### Commit and push update to GitHub - -After version number is incremented, single-include header is regenerated and release notes are updated, changes should be committed and pushed to GitHub. - - -### Release on GitHub - -After pushing changes to GitHub, GitHub release *needs* to be created. -Tag version and release title should be same as the new version, -description should contain the release notes for the current release. -We also attach the two amalgamated files as "binaries". - -Since 2.5.0, the release tag and the "binaries" (amalgamated files) 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 amalgamated files - -This will create ASCII-armored signatures for the two amalgamated files -that are uploaded to the GitHub release: - -``` -gpg --armor --output extras/catch_amalgamated.hpp.asc --detach-sig extras/catch_amalgamated.hpp -gpg --armor --output extras/catch_amalgamated.cpp.asc --detach-sig extras/catch_amalgamated.cpp -``` - -_GPG does not support signing multiple files in single invocation._ diff --git a/docs/why-catch.md b/docs/why-catch.md deleted file mode 100644 index d427cf72..00000000 --- a/docs/why-catch.md +++ /dev/null @@ -1,62 +0,0 @@ -<a id="top"></a> - -> **Catch3 compatibility reference:** This page describes the bundled Catch2-compatible API. Names such as `Catch2`, `catch2/`, and `Catch2::Catch2WithMain` remain where they are actual compatibility interfaces. See [Catch3 additions](progmasoft-catch3.md) for Progmasoft APIs. - -# Why do we need yet another C++ test framework? - -Good question. For C++ there are quite a number of established frameworks, -including (but not limited to), -[Google Test](http://code.google.com/p/googletest/), -[Boost.Test](http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/index.html), -[CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page), -[Cute](http://www.cute-test.com), and -[many, many more](http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B). - -So what does Catch2 bring to the party that differentiates it from these? Apart from the catchy name, of course. - - -## Key Features - -* Quick and easy to get started. Just download two files, add them into your project and you're away. -* No external dependencies. As long as you can compile C++14 and have the C++ standard library available. -* Write test cases as, self-registering, functions (or methods, if you prefer). -* Divide test cases into sections, each of which is run in isolation (eliminates the need for fixtures). -* Use BDD-style Given-When-Then sections as well as traditional unit test cases. -* Only one core assertion macro for comparisons. Standard C/C++ operators are used for the comparison - yet the full expression is decomposed and lhs and rhs values are logged. -* Tests are named using free-form strings - no more couching names in legal identifiers. - - -## Other core features - -* Tests can be tagged for easily running ad-hoc groups of tests. -* Failures can (optionally) break into the debugger on common platforms. -* Output is through modular reporter objects. Basic textual and XML reporters are included. Custom reporters can easily be added. -* JUnit xml output is supported for integration with third-party tools, such as CI servers. -* A default main() function is provided, but you can supply your own for complete control (e.g. integration into your own test runner GUI). -* A command line parser is provided and can still be used if you choose to provide your own main() function. -* Alternative assertion macro(s) report failures but don't abort the test case -* Good set of facilities for floating point comparisons (`Catch::Approx` and full set of matchers) -* Internal and friendly macros are isolated so name clashes can be managed -* Data generators (data driven test support) -* Hamcrest-style Matchers for testing complex properties -* Microbenchmarking support - - -## Who else is using Catch2? - -A whole lot of people. According to [the 2022 JetBrains C++ ecosystem survey](https://www.jetbrains.com/lp/devecosystem-2022/cpp/#Which-unit-testing-frameworks-do-you-regularly-use), -about 12% of C++ programmers use Catch2 for unit testing, making it the -second most popular unit testing framework. - -You can also take a look at the (incomplete) list of [open source projects](opensource-users.md#top) -or the (very incomplete) list of [commercial users of Catch2](commercial-users.md#top) -for some idea on who else also uses Catch2. - ---- - -See the [tutorial](tutorial.md#top) to get more of a taste of using -Catch2 in practice. - ---- - -[Home](Readme.md#top) diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 217abac4..f5a8b781 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6,8 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.16.1 -// Generated: 2026-10-24 17:43:09.597581 +// Catch3 v0.3.0, on the Catch2 v3.16.1 engine +// Generated: 2026-10-24 19:06:40.031209 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. diff --git a/extras/catch_amalgamated.hpp b/extras/catch_amalgamated.hpp index b031e418..cc07790d 100644 --- a/extras/catch_amalgamated.hpp +++ b/extras/catch_amalgamated.hpp @@ -6,8 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.16.1 -// Generated: 2026-10-24 17:43:09.504941 +// Catch3 v0.3.0, on the Catch2 v3.16.1 engine +// Generated: 2026-10-24 19:06:39.919114 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt deleted file mode 100644 index 39e816a1..00000000 --- a/tools/misc/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(CatchCoverageHelper LANGUAGES CXX) - -add_executable(CoverageHelper coverage-helper.cpp) -target_compile_features(CoverageHelper PRIVATE cxx_std_11) -if(MSVC) - target_compile_options(CoverageHelper PRIVATE /W4 /w44265 /WX /w44061 /w44062) -endif() diff --git a/tools/misc/appveyorBuildConfigurationScript.bat b/tools/misc/appveyorBuildConfigurationScript.bat deleted file mode 100644 index 75b39550..00000000 --- a/tools/misc/appveyorBuildConfigurationScript.bat +++ /dev/null @@ -1,21 +0,0 @@ -SETLOCAL EnableDelayedExpansion - -@REM # Possibilities: -@REM # Debug build + coverage -@REM # Debug build + examples -@REM # Debug build + --- -@REM # Release build -if "%CONFIGURATION%"=="Debug" ( - if "%coverage%"=="1" ( - @REM # coverage needs to build the special helper as well as the main - cmake -Stools/misc -Bbuild-misc -A%PLATFORM% || exit /b !ERRORLEVEL! - cmake --build build-misc || exit /b !ERRORLEVEL! - cmake -S. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! - ) else ( - @REM # We know that coverage is 0 - cmake -S. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_BUILD_SURROGATES=%surrogates% -DCATCH_DEVELOPMENT_BUILD=ON -DCATCH_ENABLE_CONFIGURE_TESTS=%configure_tests% || exit /b !ERRORLEVEL! - ) -) -if "%CONFIGURATION%"=="Release" ( - cmake -S. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! -) diff --git a/tools/misc/appveyorMergeCoverageScript.py b/tools/misc/appveyorMergeCoverageScript.py deleted file mode 100644 index 5b71f6e1..00000000 --- a/tools/misc/appveyorMergeCoverageScript.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import glob -import subprocess - -if __name__ == '__main__': - cov_files = list(glob.glob('tests/cov-report*.bin')) - base_cmd = ['OpenCppCoverage', '--quiet', '--export_type=cobertura:cobertura.xml'] + ['--input_coverage={}'.format(f) for f in cov_files] - subprocess.check_call(base_cmd) diff --git a/tools/misc/appveyorTestRunScript.bat b/tools/misc/appveyorTestRunScript.bat deleted file mode 100644 index 661bae24..00000000 --- a/tools/misc/appveyorTestRunScript.bat +++ /dev/null @@ -1,17 +0,0 @@ -SETLOCAL EnableDelayedExpansion - -rem Disable launching the JIT debugger for ctest.exe -reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusionList" /v "ctest.ext" /t REG_DWORD /d 1 -cd Build -if "%CONFIGURATION%"=="Debug" ( - if "%coverage%"=="1" ( - ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck -LE uses-signals || exit /b !ERRORLEVEL! - python ..\tools\misc\appveyorMergeCoverageScript.py || exit /b !ERRORLEVEL! - codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN% || exit /b !ERRORLEVEL! - ) else ( - ctest -j 2 -C %CONFIGURATION% || exit /b !ERRORLEVEL! - ) -) -if "%CONFIGURATION%"=="Release" ( - ctest -j 2 -C %CONFIGURATION% || exit /b !ERRORLEVEL! -) diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp deleted file mode 100644 index 9e7a8ca4..00000000 --- a/tools/misc/coverage-helper.cpp +++ /dev/null @@ -1,142 +0,0 @@ -#include <algorithm> -#include <array> -#include <cassert> -#include <fstream> -#include <iostream> -#include <memory> -#include <numeric> -#include <regex> -#include <string> -#include <vector> - -std::string escape_arg(const std::string& arg) { - if (arg.empty() == false && - arg.find_first_of(" \t\n\v\"") == arg.npos) { - return arg; - } - - std::string escaped; - escaped.push_back('"'); - for (auto it = arg.begin(); ; ++it) { - int num_backslashes = 0; - - while (it != arg.end() && *it == '\\') { - ++it; - ++num_backslashes; - } - - if (it == arg.end()) { - escaped.append(num_backslashes * 2, '\\'); - break; - } else if (*it == '"') { - escaped.append((num_backslashes + 1) * 2, '\\'); - escaped.push_back('"'); - escaped.push_back(*it); - } else { - escaped.append(num_backslashes, '\\'); - escaped.push_back(*it); - } - } - escaped.push_back('"'); - - return escaped; -} - - -void create_empty_file(std::string const& path) { - std::ofstream ofs(path); - ofs << '\n'; -} - -const std::string separator = "--sep--"; -const std::string logfile_prefix = "--log-file="; - -bool starts_with(std::string const& str, std::string const& pref) { - return str.find(pref) == 0; -} - -int parse_log_file_arg(std::string const& arg) { - assert(starts_with(arg, logfile_prefix) && "Attempting to parse incorrect arg!"); - auto fname = arg.substr(logfile_prefix.size()); - create_empty_file(fname); - std::regex regex("MemoryChecker\\.(\\d+)\\.log", std::regex::icase); - std::smatch match; - if (std::regex_search(fname, match, regex)) { - return std::stoi(match[1]); - } else { - throw std::domain_error("Couldn't find desired expression in string: " + fname); - } -} - -std::string catch_path(std::string path) { - auto start = path.find("catch"); - // try capitalized instead - if (start == std::string::npos) { - start = path.find("Catch"); - } - if (start == std::string::npos) { - throw std::domain_error("Couldn't find Catch's base path"); - } - auto end = path.find_first_of("\\/", start); - return path.substr(0, end); -} - -std::string windowsify_path(std::string path) { - for (auto& c : path) { - if (c == '/') { - c = '\\'; - } - } - return path; -} - -int exec_cmd(std::string const& cmd, int log_num, std::string const& path) { - std::array<char, 128> buffer; - - // cmd has already been escaped outside this function. - auto real_cmd = "OpenCppCoverage --export_type binary:cov-report" + std::to_string(log_num) - + ".bin --quiet " + "--sources " + escape_arg(path) + "\\src" + " --cover_children -- " + cmd; - std::cout << "=== Marker ===: Cmd: " << real_cmd << '\n'; - auto pipe = _popen(real_cmd.c_str(), "r"); - - if (!pipe) { - throw std::runtime_error("popen() failed!"); - } - while (!feof(pipe)) { - if (fgets(buffer.data(), 128, pipe) != nullptr) { - std::cout << buffer.data(); - } - } - - auto ret = _pclose(pipe); - if (ret == -1) { - throw std::runtime_error("underlying error in pclose()"); - } - - return ret; -} - -// argv should be: -// [0]: our path -// [1]: "--log-file=<path>" -// [2]: "--sep--" -// [3]+: the actual command - -int main(int argc, char** argv) { - std::vector<std::string> args(argv, argv + argc); - auto sep = std::find(begin(args), end(args), separator); - assert(sep - begin(args) == 2 && "Structure differs from expected!"); - - auto num = parse_log_file_arg(args[1]); - - auto cmdline = std::accumulate(++sep, end(args), std::string{}, [] (const std::string& lhs, const std::string& rhs) { - return lhs + ' ' + escape_arg(rhs); - }); - - try { - return exec_cmd(cmdline, num, windowsify_path(catch_path(args[0]))); - } catch (std::exception const& ex) { - std::cerr << "Helper failed with: '" << ex.what() << "'\n"; - return 12; - } -} diff --git a/tools/misc/installOpenCppCoverage.ps1 b/tools/misc/installOpenCppCoverage.ps1 deleted file mode 100644 index 795b7c8e..00000000 --- a/tools/misc/installOpenCppCoverage.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -# Downloads are done from the official github release page links -$downloadUrl = "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.9.0/OpenCppCoverageSetup-x64-0.9.9.0.exe" -$installerPath = [System.IO.Path]::Combine($Env:USERPROFILE, "Downloads", "OpenCppCoverageSetup.exe") - -if(-Not (Test-Path $installerPath)) { - Write-Host -ForegroundColor White ("Downloading OpenCppCoverage from: " + $downloadUrl) - Start-BitsTransfer $downloadUrl -Destination $installerPath -} - -Write-Host -ForegroundColor White "About to install OpenCppCoverage..." - -$installProcess = (Start-Process $installerPath -ArgumentList '/VERYSILENT' -PassThru -Wait) -if($installProcess.ExitCode -ne 0) { - throw [System.String]::Format("Failed to install OpenCppCoverage, ExitCode: {0}.", $installProcess.ExitCode) -} - -# Assume standard, boring, installation path of ".../Program Files/OpenCppCoverage" -$installPath = [System.IO.Path]::Combine(${Env:ProgramFiles}, "OpenCppCoverage") -$env:Path="$env:Path;$installPath" diff --git a/tools/scripts/developBuild.py b/tools/scripts/developBuild.py deleted file mode 100755 index 8837770c..00000000 --- a/tools/scripts/developBuild.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import releaseCommon - -v = releaseCommon.Version() -v.incrementBuildNumber() -releaseCommon.performUpdates(v) - -print( "Updated files to v{0}".format( v.getVersionString() ) ) diff --git a/tools/scripts/extractFeaturesFromReleaseNotes.py b/tools/scripts/extractFeaturesFromReleaseNotes.py deleted file mode 100644 index d8be0437..00000000 --- a/tools/scripts/extractFeaturesFromReleaseNotes.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python3 - -# -# extractFeaturesFromReleaseNotes.py -# -# Read the release notes - docs/release-notes.md - and generate text -# for pasting in to individual documentation pages, to indicate which -# versions recent features were released in. -# -# Using the output of the file is easier than manually constructing -# the text to paste in to documentation pages. -# -# One way to use this: -# - run this script, saving the output to some temporary file -# - diff this output with the actual release notes page -# - the differences are Markdown text that can be pasted in to the -# appropriate documentation pages in the docs/ directory. -# - each release also has a github link to show which documentation files -# were changed in it. -# This can be helpful to see which documentation pages -# to add the 'Introduced in Catch ...' snippets to the relevant pages. -# - -import re - - -def create_introduced_in_text(version, bug_number = None): - """Generate text to paste in to documentation file""" - if bug_number: - return '> [Introduced](https://github.com/catchorg/Catch2/issues/%s) in Catch %s.' % (bug_number, version) - else: - # Use this text for changes that don't have issue numbers - return '> Introduced in Catch %s.' % version - - -def link_to_changes_in_release(release, releases): - """ - Markdown text for a hyperlink showing all edits in a release, or empty string - - :param release: A release version, as a string - :param releases: A container of releases, in descending order - newest to oldest - :return: Markdown text for a hyperlink showing the differences between the give release and the prior one, - or empty string, if the previous release is not known - """ - - if release == releases[-1]: - # This is the earliest release we know about - return '' - index = releases.index(release) - previous_release = releases[index + 1] - return '\n[Changes in %s](https://github.com/catchorg/Catch2/compare/v%s...v%s)' % (release, previous_release, release) - - -def write_recent_release_notes_with_introduced_text(): - current_version = None - release_toc_regex = r'\[(\d.\d.\d)\]\(#\d+\)<br>' - issue_number_regex = r'#[0-9]+' - releases = [] - with open('../docs/release-notes.md') as release_notes: - for line in release_notes: - line = line[:-1] - print(line) - - # Extract version number from table of contents - match = re.search(release_toc_regex, line) - if match: - release_name = match.group(1) - releases.append(release_name) - - if line.startswith('## '): - # It's a section with version number - current_version = line.replace('## ', '') - - # We decided not to add released-date info for older versions - if current_version == 'Older versions': - break - - print(create_introduced_in_text(current_version)) - print(link_to_changes_in_release(current_version, releases)) - - # Not yet found a version number, so to avoid picking up hyperlinks to - # version numbers in the index, keep going - if not current_version: - continue - - for bug_link in re.findall(issue_number_regex, line): - bug_number = bug_link.replace('#', '') - print(create_introduced_in_text(current_version, bug_number)) - - -if __name__ == '__main__': - write_recent_release_notes_with_introduced_text() diff --git a/tools/scripts/generateAmalgamatedFiles.py b/tools/scripts/generateAmalgamatedFiles.py index 5fed3358..2d40bcb4 100755 --- a/tools/scripts/generateAmalgamatedFiles.py +++ b/tools/scripts/generateAmalgamatedFiles.py @@ -39,7 +39,7 @@ file_header = '''\ // SPDX-License-Identifier: BSL-1.0 -// Catch v{version_string} +// Catch3 v{catch3_version}, on the Catch2 v{version_string} engine // Generated: {generation_time} // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. @@ -54,8 +54,17 @@ file_header = '''\ # REUSE-IgnoreEnd # Returns file header with proper version string and generation time +def catch3_version(): + version_file = os.path.join(root_path, 'Progmasoft', 'Catch3', 'Version.hpp') + with open(version_file, mode='r', encoding='utf-8') as input: + match = re.search(r'kVersion = "([^"]+)"', input.read()) + if not match: + raise RuntimeError('no kVersion in ' + version_file) + return match.group(1) + def formatted_file_header(version): return file_header.format(version_string=version.getVersionString(), + catch3_version=catch3_version(), generation_time=datetime.datetime.now()) # Which headers were already concatenated (and thus should not be diff --git a/tools/scripts/majorRelease.py b/tools/scripts/majorRelease.py deleted file mode 100755 index eb712b46..00000000 --- a/tools/scripts/majorRelease.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import releaseCommon - -v = releaseCommon.Version() -v.incrementMajorVersion() -releaseCommon.performUpdates(v) - -print( "Updated files to v{0}".format( v.getVersionString() ) ) diff --git a/tools/scripts/minorRelease.py b/tools/scripts/minorRelease.py deleted file mode 100755 index 0992c8fb..00000000 --- a/tools/scripts/minorRelease.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import releaseCommon - -v = releaseCommon.Version() -v.incrementMinorVersion() -releaseCommon.performUpdates(v) - -print( "Updated files to v{0}".format( v.getVersionString() ) ) diff --git a/tools/scripts/patchRelease.py b/tools/scripts/patchRelease.py deleted file mode 100755 index 48256c15..00000000 --- a/tools/scripts/patchRelease.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import releaseCommon - -v = releaseCommon.Version() -v.incrementPatchNumber() -releaseCommon.performUpdates(v) - -print( "Updated files to v{0}".format( v.getVersionString() ) ) diff --git a/tools/scripts/releaseCommon.py b/tools/scripts/releaseCommon.py index 920fb98c..cbdd92e1 100644 --- a/tools/scripts/releaseCommon.py +++ b/tools/scripts/releaseCommon.py @@ -1,19 +1,14 @@ import os import re -import string -import fnmatch from scriptCommon import catchPath versionParser = re.compile( r'(\s*static\sVersion\sversion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' ) rootPath = os.path.join( catchPath, 'src/catch2' ) versionPath = os.path.join( rootPath, "catch_version.cpp" ) -definePath = os.path.join(rootPath, 'catch_version_macros.hpp') -readmePath = os.path.join( catchPath, "README.md" ) -cmakePath = os.path.join(catchPath, 'CMakeLists.txt') -mesonPath = os.path.join(catchPath, 'meson.build') class Version: + """The version of the Catch2 compatibility engine, from catch_version.cpp.""" def __init__(self): f = open( versionPath, 'r' ) for line in f: @@ -27,117 +22,8 @@ class Version: self.buildNumber = int(m.group(6)) f.close() - def nonDevelopRelease(self): - if self.branchName != "": - self.branchName = "" - self.buildNumber = 0 - def developBuild(self): - if self.branchName == "": - self.branchName = "develop" - self.buildNumber = 0 - - def incrementBuildNumber(self): - self.developBuild() - self.buildNumber = self.buildNumber+1 - - def incrementPatchNumber(self): - self.nonDevelopRelease() - self.patchNumber = self.patchNumber+1 - - def incrementMinorVersion(self): - self.nonDevelopRelease() - self.patchNumber = 0 - self.minorVersion = self.minorVersion+1 - - def incrementMajorVersion(self): - self.nonDevelopRelease() - self.patchNumber = 0 - self.minorVersion = 0 - self.majorVersion = self.majorVersion+1 - def getVersionString(self): versionString = '{0}.{1}.{2}'.format( self.majorVersion, self.minorVersion, self.patchNumber ) if self.branchName != "": versionString = versionString + '-{0}.{1}'.format( self.branchName, self.buildNumber ) return versionString - - def updateVersionFile(self): - f = open( versionPath, 'r' ) - lines = [] - for line in f: - m = versionParser.match( line ) - if m: - lines.append( '{0}( {1}, {2}, {3}, "{4}", {5} );'.format( self.variableDecl, self.majorVersion, self.minorVersion, self.patchNumber, self.branchName, self.buildNumber ) ) - else: - lines.append( line.rstrip() ) - f.close() - f = open( versionPath, 'w' ) - for line in lines: - f.write( line + "\n" ) - - -def updateCmakeFile(version): - with open(cmakePath, 'rb') as file: - lines = file.readlines() - replacementRegex = re.compile(b'''VERSION (\\d+.\\d+.\\d+) # CML version placeholder, don't delete''') - replacement = '''VERSION {0} # CML version placeholder, don't delete'''.format(version.getVersionString()).encode('ascii') - with open(cmakePath, 'wb') as file: - for line in lines: - file.write(replacementRegex.sub(replacement, line)) - - -def updateMesonFile(version): - with open(mesonPath, 'rb') as file: - lines = file.readlines() - replacementRegex = re.compile(b'''version\\s*:\\s*'(\\d+.\\d+.\\d+)', # CML version placeholder, don't delete''') - replacement = '''version: '{0}', # CML version placeholder, don't delete'''.format(version.getVersionString()).encode('ascii') - with open(mesonPath, 'wb') as file: - for line in lines: - file.write(replacementRegex.sub(replacement, line)) - - -def updateVersionDefine(version): - # First member of the tuple is the compiled regex object, the second is replacement if it matches - replacementRegexes = [(re.compile(b'#define CATCH_VERSION_MAJOR \\d+'),'#define CATCH_VERSION_MAJOR {}'.format(version.majorVersion).encode('ascii')), - (re.compile(b'#define CATCH_VERSION_MINOR \\d+'),'#define CATCH_VERSION_MINOR {}'.format(version.minorVersion).encode('ascii')), - (re.compile(b'#define CATCH_VERSION_PATCH \\d+'),'#define CATCH_VERSION_PATCH {}'.format(version.patchNumber).encode('ascii')), - ] - with open(definePath, 'rb') as file: - lines = file.readlines() - with open(definePath, 'wb') as file: - for line in lines: - for replacement in replacementRegexes: - line = replacement[0].sub(replacement[1], line) - file.write(line) - - -def updateVersionPlaceholder(filename, version): - with open(filename, 'rb') as file: - lines = file.readlines() - placeholderRegex = re.compile(b'Catch[0-9]? v?X.Y.Z') - replacement = 'Catch2 {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii') - with open(filename, 'wb') as file: - for line in lines: - file.write(placeholderRegex.sub(replacement, line)) - - -def updateDocumentationVersionPlaceholders(version): - print('Updating version placeholder in documentation') - docsPath = os.path.join(catchPath, 'docs/') - for basePath, _, files in os.walk(docsPath): - for file in files: - if fnmatch.fnmatch(file, "*.md") and "contributing.md" != file: - updateVersionPlaceholder(os.path.join(basePath, file), version) - - -def performUpdates(version): - version.updateVersionFile() - updateVersionDefine(version) - - import generateAmalgamatedFiles - generateAmalgamatedFiles.generate_header() - generateAmalgamatedFiles.generate_cpp() - - updateCmakeFile(version) - updateMesonFile(version) - updateDocumentationVersionPlaceholders(version)