Skip to content

Releases: catchorg/Catch2

v2.6.0

31 Jan 21:53
v2.6.0
d75e9b3
Compare
Choose a tag to compare

With this release the data generator feature is now fully supported.

Improvements

  • Added TEMPLATE_PRODUCT_TEST_CASE (#1454, #1468)
    • This allows you to easily test various type combinations, see documentation for details
  • The error message for && and || inside assertions has been improved (#1273, #1480)
  • The error message for chained comparisons inside assertions has been improved (#1481)
  • Added StringMaker specialization for std::optional (#1510)
  • The generator interface has been redone once again (#1516)
    • It is no longer considered experimental and is fully supported
    • The new interface supports "Input" generators
    • The generator documentation has been fully updated
    • We also added 2 generator examples

Fixes

  • Fixed -Wredundant-move on newer Clang (#1474)
  • Removed unreachable mentions std::current_exception, std::rethrow_exception in no-exceptions mode (#1462)
    • This should fix compilation with IAR
  • Fixed missing <type_traits> include (#1494)
  • Fixed various static analysis warnings
    • Unrestored stream state in XmlWriter (#1489)
    • Potential division by zero in estimateClockResolution (#1490)
    • Uninitialized member in RunContext (#1491)
    • SourceLineInfo move ops are now marked noexcept
    • CATCH_BREAK_INTO_DEBUGGER is now always a function
  • Fix double run of a test case if user asks for a specific section (#1394, #1492)
  • ANSI colour code output now respects -o flag and writes to the file as well (#1502)
  • Fixed detection of std::variant support for compilers other than Clang (#1511)

Contrib

  • ParseAndAddCatchTests has learned how to use DISABLED CTest property (#1452)
  • ParseAndAddCatchTests now works when there is a whitspace before the test name (#1493)

Miscellaneous

  • We added new issue templates for reporting issues on GitHub
  • contributing.md has been updated to reflect the current test status (#1484)

v2.5.0

26 Nov 20:00
v2.5.0
6ccd467
Compare
Choose a tag to compare

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

v2.4.2

26 Oct 19:16
Compare
Choose a tag to compare

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 (#1412)

v2.4.1

28 Sep 13:54
Compare
Choose a tag to compare

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)

v2.4.0

04 Sep 10:06
Compare
Choose a tag to compare

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
  • Added support for compiling and running Catch without exceptions

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 is what e.g. conan does)

v2.3.0

23 Jul 08:18
Compare
Choose a tag to compare

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
  • 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).

v2.2.3

06 Jun 21:20
Compare
Choose a tag to compare

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)

v1.12.2

14 May 13:23
Compare
Choose a tag to compare

Fixes

  • Fixed missing include

v2.2.2

06 Apr 10:12
Compare
Choose a tag to compare

Note: If you haven't, please read release notes of v2.2.0

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 chars (#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)

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

v2.2.1

11 Mar 11:05
Compare
Choose a tag to compare

Note: Please read release notes of v2.2.0

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"