Skip to content

Releases: catchorg/Catch2

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"

v2.2.0

07 Mar 10:09
Compare
Choose a tag to compare

Important notice

There has been a long debate about the proper way of including the catch.hpp single include.
While we still think that the preferred way is to vendor the single include header, we have decided to use #include <catch2/catch.hpp> through our documentation and CMake scripts. To participate in the discussion, visit #1202 or our Discord.

This change has not yet taken place, but should happen during the next couple of minor releases.

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. (#1181)

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

v1.12.1

02 Mar 21:23
Compare
Choose a tag to compare

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

v2.1.2

09 Feb 16:11
Compare
Choose a tag to compare

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)

v2.1.1

26 Jan 15:09
Compare
Choose a tag to compare

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

v1.12.0

12 Jan 08:59
Compare
Choose a tag to compare

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.

v2.1.0

10 Jan 12:58
Compare
Choose a tag to compare

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)

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

Other changes

  • Reporters will now be versioned in the single_include folder to ensure their compatibility with the last released version

v2.0.1

05 Nov 09:27
Compare
Choose a tag to compare

This is the first full release of Catch2. There may be some minor breaking changes for some people. Please see the details below before moving to this release. If you need to stay on Catch "Classic", because you do not have a fully C++11 aware compiler, for example, then please see the Catch1.x branch.

The following list is changes compared to Catch 1.x:

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

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

v1.11.0

31 Oct 13:00
Compare
Choose a tag to compare

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

V2.0.0-develop.6

31 Oct 14:19
Compare
Choose a tag to compare
V2.0.0-develop.6 Pre-release
Pre-release

Improvements

  • Add pkg-config support to CMake install

Fixes

  • More usages of min and max are enclosed in parentheses to solve MFC macro issues (#1034)
  • Bitfield capture now compiles (#1027)
  • Expansion of *_FALSE now properly parenthesises original expression
  • Removed mismatch between pragma warning(push) and pragma warning(pop) in single include
  • Suppressed C4601 inside Catch
  • We now check if WINAPI_FAMILY is defined before using it to detect UWP build
  • Paths prefixed with '/' are parsed properly