Releases: catchorg/Catch2
Release list
v3.1.0
Improvements
- Improved suppression of
-Wparenthesesfor older GCCs- Turns out that even GCC 9 does not properly handle
_Pragmas in the C++ frontend.
- Turns out that even GCC 9 does not properly handle
- Added type constraints onto
randomgenerator (#2433)- These constraints copy what the standard says for the underlying
std::uniform_int_distribution
- These constraints copy what the standard says for the underlying
- 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_TESTenvironment variable (#2459)- The
CATCH_CONFIG_BAZEL_SUPPORTconfiguration option is also still supported.
- The
- 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_testsnow 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
- Compared to
- 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.
v3.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,
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.hppheader.
- 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
- Why the big breaking change caused by replacing
catch.hppwithcatch_all.hpp?- The convenience header
catch_all.hppexists 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.
- The convenience header
(Potentially) Breaking changes
- Catch2 now uses statically compiled library as its distribution model
- Including
catch.hppno longer works
- Including
- Catch2 now uses C++14 as the minimum support language version
ANON_TEST_CASEhas been removed, useTEST_CASEwith no arguments instead (#1220)--list*commands no longer have non-zero return code (#1410)--list-test-names-onlyhas been removed (#1190)- You should use verbosity-modifiers for
--list-testsinstead
- You should use verbosity-modifiers for
--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_CASEdescription 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].
- Previously, a
PredicateMatcheris no longer type erased.- This means that the type of the provided predicate is part of the
PredicateMatcher's type
- This means that the type of the provided predicate is part of the
SectionInfono 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
- You can still write
- The
[!hide]tag has been removed.- Use
[.]or[.foo]instead.
- Use
- Lvalues of composed matchers cannot be composed further
- Uses of
REGISTER_TEST_CASEmacro need to be followed by a semicolon- This does not change
TEST_CASEand friends in any way
- This does not change
IStreamingReporter::IsMultimember 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
ListeningReporteris nowfinal- Concrete Matchers (e.g.
UnorderedEqualsvector matcher) are nowfinal - 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
Catchnamespace - This means that all public-facing matcher-related functionality is now in
Catch::Matchersnamespace
- Defining
CATCH_CONFIG_MAINwill 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
- Link with
CATCH_CONFIG_EXTERNAL_INTERFACEShas been removed.- You should instead include the appropriate headers as needed.
CATCH_CONFIG_IMPLhas been removed.- The implementation is now compiled into a static library.
- Event Listener interface has changed
TestEventListenerBasewas renamed toEventListenerBaseEventListenerBasenow directly derives fromIStreamingReporter, instead of deriving fromStreamingReporterBase
GENERATEdecays its arguments (#2012, #2040)- This means that
strinauto str = GENERATE("aa", "bb", "cc");is inferred tochar const*rather thanconst char[2].
- This means that
--list-*flags write their output to file specified by the-oflag- 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
--colouroption has been replaced with--colour-modeoption
Improvements
- Matchers have been extended with the ability to use different signatures of
match(#1307, #1553, #1554, #1843)- This includes having templated
matchmember function - See the rewritten Matchers documentation for details
- Catch2 currently provides some generic matchers, but there should be more before final release of v3
IsEmpty,SizeIswhich check that the range has specific propertiesContains, which checks whether a range contains a specific elementAllMatch,AnyMatch,NoneMatchrange matchers, which apply matchers over a range of elements
- This includes having templated
- Significant compilation time improvements
- including
catch_test_macros.hppis 80% cheaper than includingcatch.hpp
- including
- Some runtime performance optimizations
| 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 thangmtimewhen constructing a date string (#2008, #2165) --list-*flags write their output to file specified by the-oflag (#2061, #2163)Approx::operator()is now properlyconst- Catch2's internal helper variables no longer use reserved identifiers (#578)
--rng-seednow accepts string"random-device"to generate random seed usingstd::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_CHECKmacro, similar toSTATIC_REQUIRE(#2318)- When deferred tu runtime, it behaves like
CHECK, and not likeREQUIRE.
- When deferred tu runtime, it behaves like
- You can have multiple tests with the same name, as long as other parts of the test identity differ (#1915, #1999, #2175)
- Test identity includes test's name, test's tags and and test's class name if applicable.
- Added new warning,
UnmatchedTestSpec, to error on test specs with no matching tests - The
-w,--warnwarning 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_ton all platforms, instead of usingsize_ttype.
- The count is now kept in
- The
-o,--outoutput 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
- You have to provide it as
- Multiple reporters can now run at the same time and write to different files (#1712, #2183)
- To support this, the
-r,--reporterflag 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
::.
- To support this, the
- 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 wou...
v3.0.0-preview5
This is intended to be the last preview before full release. All API-breaking changes should be accounted for.
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,
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.hppheader.
- 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
- Why the big breaking change caused by replacing
catch.hppwithcatch_all.hpp?- The convenience header
catch_all.hppexists 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.
- The convenience header
(Potentially) Breaking changes
- Catch2 now uses statically compiled library as its distribution model
- Including
catch.hppno longer works
- Including
- Catch2 now uses C++14 as the minimum support language version
ANON_TEST_CASEhas been removed, useTEST_CASEwith no arguments instead (#1220)--list*commands no longer have non-zero return code (#1410)--list-test-names-onlyhas been removed (#1190)- You should use verbosity-modifiers for
--list-testsinstead
- You should use verbosity-modifiers for
--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_CASEdescription 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].
- Previously, a
PredicateMatcheris no longer type erased.- This means that the type of the provided predicate is part of the
PredicateMatcher's type
- This means that the type of the provided predicate is part of the
SectionInfono 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
- You can still write
- The
[!hide]tag has been removed.- Use
[.]or[.foo]instead.
- Use
- Lvalues of composed matchers cannot be composed further
- Uses of
REGISTER_TEST_CASEmacro need to be followed by a semicolon- This does not change
TEST_CASEand friends in any way
- This does not change
IStreamingReporter::IsMultimember 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
ListeningReporteris nowfinal- Concrete Matchers (e.g.
UnorderedEqualsvector matcher) are nowfinal - 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
Catchnamespace - This means that all public-facing matcher-related functionality is now in
Catch::Matchersnamespace
- Defining
CATCH_CONFIG_MAINwill 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
- Link with
CATCH_CONFIG_EXTERNAL_INTERFACEShas been removed.- You should instead include the appropriate headers as needed.
CATCH_CONFIG_IMPLhas been removed.- The implementation is now compiled into a static library.
- Event Listener interface has changed
TestEventListenerBasewas renamed toEventListenerBaseEventListenerBasenow directly derives fromIStreamingReporter, instead of deriving fromStreamingReporterBase
GENERATEdecays its arguments (#2012, #2040)- This means that
strinauto str = GENERATE("aa", "bb", "cc");is inferred tochar const*rather thanconst char[2].
- This means that
--list-*flags write their output to file specified by the-oflag- 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
--colouroption has been replaced with--colour-modeoption
Improvements
- Matchers have been extended with the ability to use different signatures of
match(#1307, #1553, #1554, #1843)- This includes having templated
matchmember function - See the rewritten Matchers documentation for details
- Catch2 currently provides some generic matchers, but there should be more before final release of v3
IsEmpty,SizeIswhich check that the range has specific propertiesContains, which checks whether a range contains a specific elementAllMatch,AnyMatch,NoneMatchrange matchers, which apply matchers over a range of elements
- This includes having templated
- Significant compilation time improvements
- including
catch_test_macros.hppis 80% cheaper than includingcatch.hpp
- including
- Some runtime performance optimizations
| 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 thangmtimewhen constructing a date string (#2008, #2165) --list-*flags write their output to file specified by the-oflag (#2061, #2163)Approx::operator()is now properlyconst- Catch2's internal helper variables no longer use reserved identifiers (#578)
--rng-seednow accepts string"random-device"to generate random seed usingstd::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_CHECKmacro, similar toSTATIC_REQUIRE(#2318)- When deferred tu runtime, it behaves like
CHECK, and not likeREQUIRE.
- When deferred tu runtime, it behaves like
- You can have multiple tests with the same name, as long as other parts of the test identity differ (#1915, #1999, #2175)
- Test identity includes test's name, test's tags and and test's class name if applicable.
- Added new warning,
UnmatchedTestSpec, to error on test specs with no matching tests - The
-w,--warnwarning 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_ton all platforms, instead of usingsize_ttype.
- The count is now kept in
- The
-o,--outoutput 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
- You have to provide it as
- Multiple reporters can now run at the same time and write to different files (#1712, #2183)
- To support this, the
-r,--reporterflag 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
::.
- To support this, the
- Console colour support has been rewritten and significantly improved
- The colour implementation ...
v2.13.9
v3.0.0-preview4
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
- 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.hppheader.
- 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
- Why the big breaking change caused by replacing
catch.hppwithcatch_all.hpp?- The convenience header
catch_all.hppexists 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.
- The convenience header
(Potentially) Breaking changes
- Catch2 now uses statically compiled library as its distribution model
- Including
catch.hppno longer works
- Including
- Catch2 now uses C++14 as the minimum support language version
ANON_TEST_CASEhas been removed, useTEST_CASEwith no arguments instead (#1220)--list*commands no longer have non-zero return code (#1410)--list-test-names-onlyhas been removed (#1190)- You should use verbosity-modifiers for
--list-testsinstead
- You should use verbosity-modifiers for
--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_CASEdescription 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].
- Previously, a
PredicateMatcheris no longer type erased.- This means that the type of the provided predicate is part of the
PredicateMatcher's type
- This means that the type of the provided predicate is part of the
SectionInfono 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
- You can still write
- The
[!hide]tag has been removed.- Use
[.]or[.foo]instead.
- Use
- Lvalues of composed matchers cannot be composed further
- Uses of
REGISTER_TEST_CASEmacro need to be followed by a semicolon- This does not change
TEST_CASEand friends in any way
- This does not change
IStreamingReporter::IsMultimember 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
ListeningReporteris nowfinal- Concrete Matchers (e.g.
UnorderedEqualsvector matcher) are nowfinal - 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
Catchnamespace - This means that all public-facing matcher-related functionality is now in
Catch::Matchersnamespace
- Defining
CATCH_CONFIG_MAINwill 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
- Link with
CATCH_CONFIG_EXTERNAL_INTERFACEShas been removed.- You should instead include the appropriate headers as needed.
CATCH_CONFIG_IMPLhas been removed.- The implementation is now compiled into a static library.
- Event Listener interface has changed
TestEventListenerBasewas renamed toEventListenerBaseEventListenerBasenow directly derives fromIStreamingReporter, instead of deriving fromStreamingReporterBase
GENERATEdecays its arguments (#2012, #2040)- This means that
strinauto str = GENERATE("aa", "bb", "cc");is inferred tochar const*rather thanconst char[2].
- This means that
--list-*flags write their output to file specified by the-oflag- 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
- 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.
Improvements
- Matchers have been extended with the ability to use different signatures of
match(#1307, #1553, #1554, #1843)- This includes having templated
matchmember function - See the rewritten Matchers documentation for details
- Catch2 currently provides some generic matchers, but there should be more before final release of v3
IsEmpty,SizeIswhich check that the range has specific propertiesContains, which checks whether a range contains a specific elementAllMatch,AnyMatch,NoneMatchrange matchers, which apply matchers over a range of elements
- This includes having templated
- Significant compilation time improvements
- including
catch_test_macros.hppis 80% cheaper than includingcatch.hpp
- including
- Some runtime performance optimizations
| 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 thangmtimewhen constructing a date string (#2008, #2165) --list-*flags write their output to file specified by the-oflag (#2061, #2163)Approx::operator()is now properlyconst- Catch2's internal helper variables no longer use reserved identifiers (#578)
--rng-seednow accepts string"random-device"to generate random seed usingstd::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_CHECKmacro, similar toSTATIC_REQUIRE(#2318)- When deferred tu runtime, it behaves like
CHECK, and not likeREQUIRE.
- When deferred tu runtime, it behaves like
- You can have multiple tests with the same name, as long as other parts of the test identity differ (#1915, #1999, #2175)
- Test identity includes test's name, test's tags and and test's class name if applicable.
- Added new warning,
UnmatchedTestSpec, to error on test specs with no matching tests - The
-w,--warnwarning 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_ton all platforms, instead of usingsize_ttype.
- The count is now kept in
- The
-o,--outoutput 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
- You have to provide it as
- Multiple reporters can now run at the same time and write to different files (#1712, #2183)
- To support this, the
-r,--reporterflag now also accepts optional output destination - For full overview of the sem...
- To support this, the
v2.13.8
Fixes
- Made
Approx::operator()const (#2288) - Improved pkg-config files (#2284)
- Fixed warning suppression leaking out of Catch2 when compiled with clang.exe (#2280)
- The macro-generated names for things like
TEST_CASEno longer create reserved identifiers (#2336)
Improvements
- Clang-tidy should no longer warn about missing virtual dispatch in
FilterGenerator's constructor (#2314)
v2.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)
!mayfailtagged tests are now marked asskippedin JUnit reporter output (#2116)
v2.13.6
v2.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)
MINSIGSTKSZwas no longer usable in constexpr context.
Fixes
- Fixed compilation of benchmarking when
minandmaxmacros are defined (#2159)- Including
windows.hwithoutNOMINMAXremains a really bad idea, don't do it
- Including
Miscellaneous
Catch2WithMaintarget (static library) is no longer built by default (#2142)- Building it by default was at best unnecessary overhead for people not using it, and at worst it caused trouble with install paths
- To have it built, set CMake option
CATCH_BUILD_STATIC_LIBRARYtoON
- 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.
v2.13.4
Improvements
- Improved the hashing algorithm used for shuffling test cases (#2070)
TEST_CASEs 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
ParseAndAddCatchTestsCMake 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_testsinstead, which uses runtime information about available tests.
- Fixed bug in
catch_discover_teststhat would cause it to fail when used in specific project structures (#2119) - Added Bazel build file
- Added an experimental static library target to CMake