MyGit

v3.0.0-preview4

catchorg/Catch2

版本发布时间: 2022-01-04 06:26:34

catchorg/Catch2最新发布版本:v3.7.1(2024-09-17 16:50:49)

Catch2 now uses statically compiled library as its distribution model. This also means that to get all of Catch2's functionality in a test file, you have to include multiple headers.

For quick'n'dirty migration, you can replace the old #include <catch2/catch.hpp> with #include <catch2/catch_all.hpp>. This is a (one of) convenience header(s) that brings in all of headers in Catch2. By doing this, you should be able to migrate instantly, but at the cost of (significantly) increased compilation times. You should prefer piecemeal including headers that are actually required by your test code.

The basic set of functionality (TEST_CASE, SECTION, REQUIRE) is in catch2/catch_test_macros.hpp. Matchers are in matchers subfolder, generators in generators subfolder, and so on.

Note that while most documentation has been updated to the new design, it is still a work in progress.

FAQ

(Potentially) Breaking changes

Improvements

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

Fixes

Other changes

相关地址:原始地址 下载(tar) 下载(zip)

1、 catch_amalgamated.cpp 342.37KB

2、 catch_amalgamated.cpp.asc 833B

3、 catch_amalgamated.hpp 420.8KB

4、 catch_amalgamated.hpp.asc 833B

查看:2022-01-04发行的版本