Skip to content

Releases

v3.16.1

Choose a tag to compare

@horenmar horenmar released this 08 Oct 12:53
v3.16.1
0809213

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 \0xFFs 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.

v3.16.0

Choose a tag to compare

@horenmar horenmar released this 25 Aug 07:43
v3.16.0
317ac1e

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)

v3.15.3

Choose a tag to compare

@horenmar horenmar released this 26 Jul 20:21
v3.15.3
8b08d4d

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

v3.15.2

Choose a tag to compare

@horenmar horenmar released this 07 Jul 19:01
v3.15.2
191fa38

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)

v3.15.1

Choose a tag to compare

@horenmar horenmar released this 14 Jun 09:02
v3.15.1
bcfb10e

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)

v3.15.0

Choose a tag to compare

@horenmar horenmar released this 12 May 11:19
v3.15.0
6ee0826

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.

v3.14.0

Choose a tag to compare

@horenmar horenmar released this 05 Apr 13:08
v3.14.0
b670de4

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.

v3.13.0

Choose a tag to compare

@horenmar horenmar released this 15 Feb 21:58
v3.13.0
29c9844

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

v3.12.0

Choose a tag to compare

@horenmar horenmar released this 28 Dec 21:47
v3.12.0
88abf9b

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.

v3.11.0

Choose a tag to compare

@horenmar horenmar released this 30 Sep 08:59
v3.11.0
b3fb4b9

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