A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)

Overview

Catch2 logo

Github Releases Build Status Build Status Code Coverage Try online Join the chat in Discord: https://discord.gg/4CWS9zD

Catch2 v3 is being developed!

You are on the devel branch, where the next major version, v3, of Catch2 is being developed. As it is a significant rework, you will find that parts of this documentation are likely still stuck on v2.

For stable (and documentation-matching) version of Catch2, go to the v2.x branch.

For migrating from the v2 releases to v3, you should look at our documentation. It provides a simple guidelines on getting started, and collects most common migration problems.

What's the Catch2?

Catch2 is mainly a unit testing framework for C++, but it also provides basic micro-benchmarking features, and simple BDD macros.

Catch2's main advantage is that using it is both simple and natural. Tests autoregister themselves and do not have to be named with valid identifiers, assertions look like normal C++ code, and sections provide a nice way to share set-up and tear-down code in tests.

How to use it

This documentation comprises these three parts:

More

Comments
  • CATCH needs a more searchable name

    CATCH needs a more searchable name

    This is not the first time I run into this and I always just shrugged it off before, but after completely failing to find anything about the issue I was interested in (whether anybody has already done something to help with migrating the existing tests using CppUnit to CATCH) I have to say that this is a real problem: it's just impossible to find anything about CATCH using web search.

    It needs to use some unique name or at least not a word so prevalent when speaking about unit testing in C++ (because I'm not interested in finding about how to catch exceptions in CppUnit, damn it).

    It can be anything you like, I don't know if you prefer obvious but dull names (CppCatch, CatchUTF, ...), some other abbreviation (C++ Automated Tests Now Are Possible) or stupid puns (Notry, Dogch, ...) or hopefully something better I can't find, but it needs to be something you could enter into your search engine and actually find something related to CATCH.

    Discussion 
    opened by vadz 87
  • Xcode/XCTest Runner Integration

    Xcode/XCTest Runner Integration

    This patch adds support for XCTest integration by inverting the usual Catch behavior; rather than using Catch as the test runner, we dynamically register XCTestCase classes with the Objective-C runtime to allow Xcode's test runner to execute (and report on) Catch-defined test cases.

    To use this implementation, a project need only include "XCTestRunner.mm" in their unit test build -- the +[XCTestCaseCatchRegistry load] method will insert an XCTestRegistryHub instance that automatically registers XCTestCase classes for any Catch test cases defined within the image.

    +load methods by definition will run prior to C++ static initializers in the same image, ensuring that we insert our registry prior to any TestCase instances registering themselves.

    Currently, our granularity is limited to test cases -- we can't report on section execution without first registering the section as a test instance in the XCTestCase, and this would require static access to the list of sections/subsections defined within a TestCase or Section.

    This approach is based on the XCTest registration code I wrote for XSmallTest: https://github.com/landonf/XSmallTest

    opened by landonf 44
  • Never-ending loop wjhen the test case Failed

    Never-ending loop wjhen the test case Failed

    If I use this piece of code:

    #define CATCH_CONFIG_MAIN
    #include "catch.hpp"
    
    #include "TCACAVAUtilities.h"
    
    TEST_CASE( "TCACAVAUtilities::CreateColorFromRGB", "[CreateColorFromRGB]" ) {
        REQUIRE( TCACAVAUtilities::CreateColorFromRGB(0, 0, 0) == 255 );
    }
    

    The result is:

    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\win_b64\code\bin>TCACAVACreateBaseCatalog.exe
    All tests passed (1 assertion in 1 test case)
    

    But If I use this code:

    #define CATCH_CONFIG_MAIN
    #include "catch.hpp"
    
    #include "TCACAVAUtilities.h"
    
    TEST_CASE( "TCACAVAUtilities::CreateColorFromRGB", "[CreateColorFromRGB]" ) {
        REQUIRE( TCACAVAUtilities::CreateColorFromRGB(1, 0, 0) == 255 );
        REQUIRE( TCACAVAUtilities::CreateColorFromRGB(0, 0, 0) == 255 );
    }
    

    The result is:

    -------------------------------------------------------------------------------
    TCACAVAUtilities::CreateColorFromRGB
    -------------------------------------------------------------------------------
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(6)
    ...............................................................................
    
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(7): FAILED:
      REQUIRE( TCACAVAUtilities::CreateColorFromRGB(1, 0, 0) == 255 )
    with expansion:
      0x10000ff == 255
    
    -------------------------------------------------------------------------------
    TCACAVAUtilities::CreateColorFromRGB
    -------------------------------------------------------------------------------
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(6)
    ...............................................................................
    
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(7): FAILED:
      REQUIRE( TCACAVAUtilities::CreateColorFromRGB(1, 0, 0) == 255 )
    with expansion:
      0x10000ff == 255
    
    -------------------------------------------------------------------------------
    TCACAVAUtilities::CreateColorFromRGB
    -------------------------------------------------------------------------------
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(6)
    ...............................................................................
    
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(7): FAILED:
      REQUIRE( TCACAVAUtilities::CreateColorFromRGB(1, 0, 0) == 255 )
    with expansion:
      0x10000ff == 255
    
    -------------------------------------------------------------------------------
    TCACAVAUtilities::CreateColorFromRGB
    -------------------------------------------------------------------------------
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(6)
    ...............................................................................
    
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACAVACreateBaseCatalog.cpp(7): FAILED:
      REQUIRE( TCACAVAUtilities::CreateColorFromRGB(1, 0, 0) == 255 )
    with expansion:
      0x10000ff == 255
    
    -------------------------------------------------------------------------------
    TCACAVAUtilities::CreateColorFromRGB
    -------------------------------------------------------------------------------
    C:\SourceCode\CVS_ROOT\CAVA\develop_clean\TCACAVACatalog\TCACAVACreateBaseCatalo
    g.m\src\TCACforrtl: error (200): program aborting due to control-C event
    Image              PC                Routine            Line        Source
    
    libifcoremd.dll    00000000100BAB14  Unknown               Unknown  Unknown
    libifcoremd.dll    00000000100B46B9  Unknown               Unknown  Unknown
    libifcoremd.dll    00000000100A1017  Unknown               Unknown  Unknown
    libifcoremd.dll    0000000010021BF8  Unknown               Unknown  Unknown
    libifcoremd.dll    000000001002DDC8  Unknown               Unknown  Unknown
    kernel32.dll       00000000774F4803  Unknown               Unknown  Unknown
    kernel32.dll       00000000774B652D  Unknown               Unknown  Unknown
    ntdll.dll          00000000776EC541  Unknown               Unknown  Unknown
    

    The never-ending loop which should I stop with CTRL+C.

    Where is the problem ? Do I something wrong ?

    opened by dsamek 44
  • Add Catch::toString support for containers

    Add Catch::toString support for containers

    In order to enhance REQUIRE and CHECK error message when testing standard containers, add overloads of Catch::toString for:

    • std::pair
    • ~~std::deque~~
    • ~~std::list~~
    • ~~std::array (c++11)~~
    • ~~std::forward_list (c++11)~~
    • ~~(more types upcoming)~~
    • any type that has a container api (no need to add support for each container individually)

    Those types were printed as "{?}" (default toString implementation for unsupported class). This was contradictory with the documentation:

    "Most [...] std types are supported out of the box"

    when in fact only string, vector and tupple were supported.

    Detail:

    • Renamed the toStringVector.cpp test file to toStringContainers.cpp and type parametrized the vector tests to run them also for deque and list.
    • ~~The overhead of including all the standard container headers is negligable.~~ => No longer needed, types are treated as containers if they fulfill (some) of the container concept constraints.
    • Types are consider containers if they contain value_type and const_iterator members and have begin and end support (members or ADL findable) returning a const_iterator. const_iterator::operator* must also return a const value_type &
    • Beware that a trying to printing a type fulfilling those requirements but returning invalid iterators will results in undefined behaviour. In such case specialize the Catch::IsContainer trait to contain static const bool value = false in order revert to the default behaviour (printing "{?}").
    opened by mat-tso 36
  • #include <catch2/catch.hpp> vs #include

    #include vs #include "catch.hpp"

    Just wondering: It seems more ideomatic to me to include the library name as part of the include name instead of just using the header file name alone. On the other hand, for a single header library there is of course not a big need/difference for it unless the header name is likely to clash with a different file name.

    So I was wondering whether your preference of

    #include "catch.hpp"
    

    over

    #include <catch2/catch.hpp>
    

    was deliberate or more like "for historic reasons" / "didn't care".

    Discussion 
    opened by MikeGitb 32
  • Tests sorted according to random index instead of random hash

    Tests sorted according to random index instead of random hash

    Description

    Use a random number instead of a hash to sort the tests.

    Motivation

    In v2.x, test cases with names differing only in the last character are almost always run one after the other. For example, for 4 tests called "a1", "a2", "b1" and "b2", only 8 combinations out of the possible 24 were observed in 1000 runs with different seeds.

    Tweak request 
    opened by loximann 27
  • memory leaks detected by MSVCRT debugging facilities

    memory leaks detected by MSVCRT debugging facilities

    Extra information

    Environment: Windows 10 Compiler: Microsoft (R) Compiler Version 19.11.25547 for x64 (VS2017 15.4.4) Compiler options: -sdl -guard:cf -Zc:inline -Zc:rvalueCast -Zc:referenceBinding -Zc:strictStrings -std:c++latest Version of Catch: Current master git source

    Description

    I've just started with Catch and I created a test project following code as described in the Catch2/docs/tutorial.md. I added the #define CATCH_CONFIG_RUNNER and implemented my own wmain, basically a copy of the default. I also added the _CrtDumpMemoryLeaks() diagnostics in the end of wmain. I get the following output:

    Detected memory leaks!
    Dumping objects ->
    {223} normal block at 0x0000013DA7B8EC30, 16 bytes long.
     Data: < ZQ             > B8 5A 51 F6 F7 7F 00 00 00 00 00 00 00 00 00 00 
    Object dump complete.
    

    Is it possible this could be a false indication of memory allocated by Catch waiting to be released at program exit? If so, is it by design?

    Steps to reproduce

    Compile the source file catch_tutorial.cpp.txt

    Possible bug 
    opened by BeErikk 27
  • Build error in Visual Studio 2013

    Build error in Visual Studio 2013

    I tried to compile the following program using the single-header of the master branch.

    #define CATCH_CONFIG_MAIN
    #include "catch.hpp"
    

    In Visual Studio 2013 Preview, the first error is:

    catch.hpp(1980): error C2694: 'Catch::StreamBufBase::~StreamBufBase(void)': overriding virtual function has less restrictive exception specification than base class virtual member function 'std::basic_streambuf<char,std::char_traits<char>>::~basic_streambuf(void) throw()'
    1>          H:\petter\catch\single_include\catch.hpp(1980) : see declaration of 'Catch::StreamBufBase::~StreamBufBase'
    1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\streambuf(78) : see declaration of 'std::basic_streambuf<char,std::char_traits<char>>::~basic_streambuf'
    
    opened by PetterS 27
  • testing getting skipped

    testing getting skipped

    It seems when sections are nested within an iteration, only the first iteration gets run. I do this kind of testing a lot and it would be nice if you could have sections within iterations.

    Ideally I would like to be able to do all the permutations of three or four variables, which is currently not possible. At the moment I find myself repeating code quite a lot with testing, and I'd like to have some more functional tests.

    TEST_CASE( (char*)"Cyclohexane", (char*)"[cyclohexane],[validation]" ) 
        {
            Fluid *CHEX = get_fluid(get_Fluid_index("Cyclohexane"));
            double mm = CHEX->params.molemass;
            validator_element data[] = {
                validator_element("T",300.0,"D",9.4*mm,"P",24.173705*1e6),
                validator_element("T",300.0,"D",9.4*mm,"O",115.28612/mm),
                validator_element("T",300.0,"D",9.4*mm,"C",154.76968/mm),
                validator_element("T",300.0,"D",9.4*mm,"A",1383.3876),
                validator_element("T",500.0,"D",6.5*mm,"P",3.9246630*1e6),
                validator_element("T",500.0,"D",6.5*mm,"O",192.52079/mm),
                validator_element("T",500.0,"D",6.5*mm,"C",255.57110/mm),
                validator_element("T",500.0,"D",6.5*mm,"A",434.13058),
                validator_element("T",500.0,"D",0.7*mm,"P",1.9981172*1e6),
                validator_element("T",500.0,"D",0.7*mm,"O",191.96468/mm),
                validator_element("T",500.0,"D",0.7*mm,"C",235.52304/mm),
                validator_element("T",500.0,"D",0.7*mm,"A",155.34798),
                validator_element("T",600.0,"D",3.5*mm,"P",6.8225506*1e6),  
                validator_element("T",600.0,"D",3.5*mm,"O",232.79249/mm),
                validator_element("T",600.0,"D",3.5*mm,"C",388.55212/mm),
                validator_element("T",600.0,"D",3.5*mm,"A",150.53314),
                validator_element("T",553.6,"D",3.3*mm,"P",4.0805433*1e6),
                validator_element("T",553.6,"D",3.3*mm,"O",224.19580/mm), 
                validator_element("T",553.6,"D",3.3*mm,"C",199224.62/mm), 
                validator_element("T",553.6,"D",3.3*mm,"A",87.913862)
            };
    
            //Now actually construct the vector
            std::vector<validator_element> elements(data, data + sizeof(data) / sizeof(validator_element));     
    
            for (std::vector<validator_element>::iterator it = elements.begin(); it != elements.end(); it++)
            {
                validator_element &el = *it;
                SECTION((char*)"validate")
                {
                    double eos = PropsSI((char*)el.in5.c_str(), (char*)el.in1.c_str(), el.in2, (char*)el.in3.c_str(), el.in4, "Cyclohexane")+1000;
                    double valid = el.in6;
                    CHECK(valid == eos);
                }
            }
        }
    
    opened by ibell 26
  • support for multi-threaded test-cases?

    support for multi-threaded test-cases?

    Hey Phil,

    do you have plans for supporting test-cases which internally spawn several threads to check correct behavior under multi-threaded conditions? This is not about executing several test cases in parallel.

    At least the Junit reporter does not support that very well and crashes; the Console reporter doesn't seem to have that issue for the same tests (at the moment) but the absence of any sync'ing mechanisms let me worry about that this could change anytime soon...

    For me it was enough to create a ThreadSafeJunitReporter by deriving from JunitReporter and adding a mutex/lock to the method assertionEnded() just like this:

    class ThreadSafeJunitReporter : public Catch::JunitReporter {
    public:
        ThreadSafeJunitReporter(Catch::ReporterConfig const& _config) :
            Catch::JunitReporter(_config) { }
    
        static std::string getDescription() {
            return "Reports test results in an XML format that looks like Ant's junitreport target.\n"
                "\tThis reporter can be used in a multi-threaded environment";
        }
    
        virtual bool assertionEnded(Catch::AssertionStats const& assertionStats) override {
            std::lock_guard<std::mutex> lock(m_mutex);
            return Catch::JunitReporter::assertionEnded(assertionStats);
        }
    
    private:
        std::mutex m_mutex;
    };
    
    INTERNAL_CATCH_REGISTER_REPORTER("junit-thread-safe", ThreadSafeJunitReporter);
    

    And using the command line option -r junit-thread-safe to get stable test runs again.


    BTW: could you change this impl:

            void ReporterRegistry::registerReporter( std::string const& name, IReporterFactory* factory ) {
                m_factories.insert( std::make_pair( name, factory ) );
            }
    

    into this one:

            void ReporterRegistry::registerReporter( std::string const& name, IReporterFactory* factory ) {
                m_factories[name] = factory;
            }
    

    This would allow someone to replace an existing reporter with an own implementation. The insert() call above just inserts the given factory iff there is no factory with name registered yet. The operator[] call will insert or update m_factories in any case.

    Revisit 
    opened by Kosta-Github 26
  • Logging macros scoped to test case instead of current scope

    Logging macros scoped to test case instead of current scope

    So I'm familiar with the INFO macro for logging. However, these logs get lost once the enclosing scope ends. I'd instead like logs to be scoped to a TEST_CASE or SECTION. I have a logging system (basically a singleton) that I can register logging sinks to. For only catch tests, I override the logger to sink all logs to INFO. My hope was, that for failed test cases, it would dump logs that occurred within its own test case across our whole code base (since they all use this logger). But this doesn't work since it's nested so deep, outside of actual test case scope (but still inside; just not explicitly).

    Is there some way I can make all logs in the code base funnel into Catch? Maybe an INFO_WITHIN_TESTCASE macro could be added or something? It would basically keep a list of all logs created, until the test case or section ends and then it is erased.

    ideas?

    Feature Request 
    opened by rcdailey 24
  • Assert that the code does not compile

    Assert that the code does not compile

    Description Testing unhappy paths is as important as testing happy paths, so Catch2 has quite a few useful assertions like REQUIRE_THROWS, REQUIRE_THROWS_AS etc. However, those are run time, and these days a lot of things is happening at compile time. Especially with introduction of constraints and concepts in C++20.

    It is logical to check that your custom constraint works as expected, i.e. not only accepts valid types, but rejects invalid ones. Validating the happy path is trivial ("it compiles"), the unhappy one - not so much (for obvious reasons). Luckily, C++20 introduced the requires expression, that allows to turn a hard compilation error into a constexpr false.

    It would be nice to have an out-of-the-box assertion for this.

    Additional context A new assertion could piggyback on the existing STATIC_REQUIRE_FALSE and should be trivial to implement:

    #define STATIC_REQUIRE_ERROR(Type, ...) \
        { \
            constexpr auto Result = []<typename TestType>() \
            { \
                return requires { __VA_ARGS__; }; \
            }.template operator()<Type>(); \
            STATIC_REQUIRE_FALSE(Result); \
        }
    
    TEST_CASE("test")
    {
        // std::common_type_t<int, void> should not compile
        STATIC_REQUIRE_ERROR(int, typename std::common_type_t<TestType, void>);
    }
    

    Compiler Explorer demo: https://godbolt.org/z/hc9WoMrKf

    opened by alabuzhev 0
  • The RegressionCheck-1670 fails

    The RegressionCheck-1670 fails

    Describe the bug

    30/68 Test #30: RegressionCheck-1670 .........................................***Failed  Required regular expression not found. Regex=[All tests passed \(2 assertions in 1 test case\)
    ]  0.01 sec
    Filters: "#1670 regression check"
    RNG seed: 806764605
    All tests passed (2 assertions in 1 test case)
    
    
    
    

    Platform information:

    • OS: FreeBSD 13.1
    • Compiler+version: clang-14
    • Catch version: 3.2.1
    opened by yurivict 0
  • unresolved external symbol when using a string_view inside a REQUIRE

    unresolved external symbol when using a string_view inside a REQUIRE

    Describe the bug If I try to link my tests that contain a REQUIRE clause with a string_view, I got this linker error:

    LNK2019	unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Catch::StringMaker<class std::basic_string_view<char,struct std::char_traits<char> >,void>::convert(class std::basic_string_view<char,struct std::char_traits<char> >)" ([email protected][email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@@[email protected]@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Catch::Detail::stringify<class std::basic_string_view<char,struct std::char_traits<char> > >(class std::basic_string_view<char,struct std::char_traits<char> > const &)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@@[email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@@[email protected]@Z)
    

    Expected behavior I expect to link without problems.

    Reproduction steps

    std::string_view view = "test";
    std::string string = "test";
    REQUIRE(view == string);
    

    Platform information:

    • OS: Windows 10 Pro 19045.2364
    • Compiler+version: Microsoft Visual Studio Professional 2022 (64-bit) - LTSC 17.2 Version 17.2.10 MSCV 19.32.31335
    • Catch version: v3.2.1 (via Conan Center)

    Additional context I don't know if it's Conan or something that happened to Catch, but my tests didn't have this problem months ago. Now that I've migrated from vcpkg to Conan, this problem showed up. At the moment I don't have time to provide a minimum example nor to check a previous version of Catch. I'll try in my free time after work, but it means a lot of hours :P

    opened by famastefano 2
  • Macro redefinition on windows with CUDA

    Macro redefinition on windows with CUDA

    Describe the bug

    Building my project on MSVC + CUDA, I have some CUDA tests (e.g. test_foo.cu) that are compiled with nvcc. Compilation of these files fail with this error:

    [build] catch2/internal/catch_compiler_capabilities.hpp(184): error C2220: the following warning is treated as an error
    [build] catch2/internal/catch_compiler_capabilities.hpp(184): warning C4005: 'CATCH_INTERNAL_START_WARNINGS_SUPPRESSION': macro redefinition
    [build] catch2/internal/catch_compiler_capabilities.hpp(64): note: see previous definition of 'CATCH_INTERNAL_START_WARNINGS_SUPPRESSION'
    [build] catch2/internal/catch_compiler_capabilities.hpp(185): warning C4005: 'CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION': macro redefinition
    [build] catch2/internal/catch_compiler_capabilities.hpp(65): note: see previous definition of 'CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION'
    

    The problem is indeed that both _MSC_VER and __CUDACC__ are defined for these files.

    Platform information:

    • OS: Windows 10
    • Compiler+version: Visual Studio 2019 + CUDA 11.3
    • Catch version: v3.2.1

    Relates to: https://github.com/catchorg/Catch2/issues/2307

    opened by orgonth 1
  • Info collection is incapacitatingly slow

    Info collection is incapacitatingly slow

    Describe the bug When running many tests, then even when the test code itself is minimal and fast, info collection for Catch2's test output seems to be taking way too long, making it effectively unusable.

    Expected behavior Test should finish way more quickly, probably by skipping the collection of so much successful-assertion data, at least when --success is not specified.

    Reproduction steps

    TEST_CASE("test scenario", "[bla_bla]") {
      for (auto i = 1; i < 10'000'000; i++) {
        CHECK(i >= 1);
      }
    }
    

    This code (incrementing a counter to 10 million) runs on my machine in 25ms without Catch2, but takes about 10 seconds under Catch2 => a 400x slowdown.

    Platform information:

    • OS: Ubuntu 20.04
    • Compiler+version: GCC v9.4.0
    • Catch version: v3.1.1

    Additional context When testing templated data structures and algorithms, it's often useful and important to test many, many different types and values in different usage patterns, to discover edge-cases. The current long run times make this a practical impossibility.

    opened by ymarcov 0
  • Poor windows users has no

    Poor windows users has no "Hello world" guide

    Hello. Im stuck with Catch2 installation, it successfully installed in C:\Programm Files(x86)\Catch2

    And now, as bad cmake user i dont know what to do. Test project's CMake config still fail on find_package();

    I must copy some files from install dir? I must somehow specify search dir? I have istall it in wrong directory?

    Please, can you provide end-to-end guide for this.

    opened by AlxrMironovOldAcc 1
Releases(v3.2.1)
  • v3.2.1(Dec 9, 2022)

  • v3.2.0(Nov 16, 2022)

    3.2.0

    Improvements

    • Catch2 now compiles on PlayStation (#2562)
    • Added CATCH_CONFIG_GETENV compile-time toggle (#2562)
      • This toggle guards whether Catch2 calls std::getenv when reading env variables
    • Added support for more Bazel test environment variables
      • TESTBRIDGE_TEST_ONLY is now supported (#2490)
      • Sharding variables, TEST_SHARD_INDEX, TEST_TOTAL_SHARDS, TEST_SHARD_STATUS_FILE, are now all supported (#2491)
    • Bunch of small tweaks and improvements in reporters
      • The TAP and SonarQube reporters output the used test filters
      • The XML reporter now also reports the version of its output format
      • The compact reporter now uses the same summary output as the console reporter (#878, #2554)
    • Added support for asserting on types that can only be compared with literal 0 (#2555)
      • A canonical example is C++20's std::*_ordering types, which cannot be compared with an int variable, only 0
      • The support extends to any type with this property, not just the ones in stdlib
      • This change imposes 2-3% slowdown on compiling files that are heavy on REQUIRE and friends
      • This required significant rewrite of decomposition, there might be bugs
    • Simplified internals of matcher related macros
      • This provides about ~2% speed up compiling files that are heavy on REQUIRE_THAT and friends

    Fixes

    • Cleaned out some warnings and static analysis issues
      • Suppressed -Wcomma warning rarely occuring in templated test cases (#2543)
      • Constified implementation details in INFO (#2564)
      • Made MatcherGenericBase copy constructor const (#2566)
    • Fixed serialization of test filters so the output roundtrips
      • This means that e.g. ./tests/SelfTest "aaa bbb", [approx] outputs Filters: "aaa bbb",[approx]

    Miscellaneous

    • Catch2's build no longer leaks -ffile-prefix-map setting to dependees (#2533)
    Source code(tar.gz)
    Source code(zip)
    catch_amalgamated.cpp(359.74 KB)
    catch_amalgamated.cpp.asc(833 bytes)
    catch_amalgamated.hpp(453.03 KB)
    catch_amalgamated.hpp.asc(833 bytes)
  • v3.1.1(Oct 19, 2022)

    Improvements

    • Added Catch::getSeed function that user code can call to retrieve current rng-seed
    • Better detection of compiler support for -ffile-prefix-map (#2517)
    • Catch2's shared libraries now have SOVERSION set (#2516)
    • catch2/catch_all.hpp convenience header no longer transitively includes windows.h (#2432, #2526)

    Fixes

    • Fixed compilation on Universal Windows Platform
    • Fixed compilation on VxWorks (#2515)
    • Fixed compilation on Cygwin (#2540)
    • Remove unused variable in reporter registration (#2538)
    • Fixed some symbol visibility issues with dynamic library on Windows (#2527)
    • Suppressed -Wuseless-cast warnings in REQUIRE_THROWS* macros (#2520, #2521)
      • This was triggered when the potentially throwing expression evaluates to void
    • Fixed "warning: storage class is not first" with nvc++ (#2533)
    • Fixed handling of DL_PATHS argument to catch_discover_tests on MacOS (#2483)
    • Suppressed *-avoid-c-arrays clang-tidy warning in TEMPLATE_TEST_CASE (#2095, #2536)

    Miscellaneous

    • Fixed CMake install step for Catch2 build as dynamic library (#2485)
    • Raised minimum CMake version to 3.10 (#2523)
      • Expect the minimum CMake version to increase once more in next few releases.
    • Whole bunch of doc updates and fixes
      • #1444, #2497, #2547, #2549, and more
    • Added support for building Catch2 with Meson (#2530, #2539)
    Source code(tar.gz)
    Source code(zip)
    catch_amalgamated.cpp(356.80 KB)
    catch_amalgamated.cpp.asc(833 bytes)
    catch_amalgamated.hpp(441.62 KB)
    catch_amalgamated.hpp.asc(833 bytes)
  • v2.13.10(Oct 16, 2022)

    Fixes

    • Fixed issue with catch_discover_tests when there is multiple of 256 tests (#2401, #2503)
    • Catch2-provided main and wmain are explicitly marked as __cdecl when compiled with MSVC (#2486, #2487)
    • Improved break-into-debugger behaviour for ARM Macs. It should now be possible to step execution after the break (#2422)
    • Replaced deprecated std::aligned_storage (#2419, #2420)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(642.00 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v3.1.0(Jul 17, 2022)

    Improvements

    • Improved suppression of -Wparentheses for older GCCs
      • Turns out that even GCC 9 does not properly handle _Pragmas in the C++ frontend.
    • Added type constraints onto random generator (#2433)
      • These constraints copy what the standard says for the underlying std::uniform_int_distribution
    • 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_TEST environment variable (#2459)
      • The CATCH_CONFIG_BAZEL_SUPPORT configuration option is also still supported.
    • 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_tests now 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
    • 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.
    Source code(tar.gz)
    Source code(zip)
    catch_amalgamated.cpp(356.10 KB)
    catch_amalgamated.cpp.asc(833 bytes)
    catch_amalgamated.hpp(440.09 KB)
    catch_amalgamated.hpp.asc(833 bytes)
  • v3.0.1(May 17, 2022)

    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.hpp header.
    • Why the big breaking change caused by replacing catch.hpp with catch_all.hpp?
      • The convenience header catch_all.hpp exists 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.

    (Potentially) Breaking changes

    • Catch2 now uses statically compiled library as its distribution model
      • Including catch.hpp no longer works
    • Catch2 now uses C++14 as the minimum support language version
    • ANON_TEST_CASE has been removed, use TEST_CASE with no arguments instead (#1220)
    • --list* commands no longer have non-zero return code (#1410)
    • --list-test-names-only has been removed (#1190)
      • You should use verbosity-modifiers for --list-tests instead
    • --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_CASE description 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].
    • PredicateMatcher is no longer type erased.
      • This means that the type of the provided predicate is part of the PredicateMatcher's type
    • SectionInfo no 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
    • The [!hide] tag has been removed.
      • Use [.] or [.foo] instead.
    • Lvalues of composed matchers cannot be composed further
    • Uses of REGISTER_TEST_CASE macro need to be followed by a semicolon
      • This does not change TEST_CASE and friends in any way
    • IStreamingReporter::IsMulti member 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
      • ListeningReporter is now final
      • Concrete Matchers (e.g. UnorderedEquals vector matcher) are now final
      • 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 Catch namespace
      • This means that all public-facing matcher-related functionality is now in Catch::Matchers namespace
    • Defining CATCH_CONFIG_MAIN will 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
    • CATCH_CONFIG_EXTERNAL_INTERFACES has been removed.
      • You should instead include the appropriate headers as needed.
    • CATCH_CONFIG_IMPL has been removed.
      • The implementation is now compiled into a static library.
    • Event Listener interface has changed
      • TestEventListenerBase was renamed to EventListenerBase
      • EventListenerBase now directly derives from IStreamingReporter, instead of deriving from StreamingReporterBase
    • GENERATE decays its arguments (#2012, #2040)
      • This means that str in auto str = GENERATE("aa", "bb", "cc"); is inferred to char const* rather than const char[2].
    • --list-* flags write their output to file specified by the -o flag
    • 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 --colour option has been replaced with --colour-mode option

    Improvements

    • Matchers have been extended with the ability to use different signatures of match (#1307, #1553, #1554, #1843)
      • This includes having templated match member 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, SizeIs which check that the range has specific properties
        • Contains, which checks whether a range contains a specific element
        • AllMatch, AnyMatch, NoneMatch range matchers, which apply matchers over a range of elements
    • Significant compilation time improvements
      • including catch_test_macros.hpp is 80% cheaper than including catch.hpp
    • Some runtime performance optimizations
      • In all tested cases the v3 branch was faster, so the table below shows the speedup of v3 to v2 at the same task

    | 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 than gmtime when constructing a date string (#2008, #2165)
    • --list-* flags write their output to file specified by the -o flag (#2061, #2163)
    • Approx::operator() is now properly const
    • Catch2's internal helper variables no longer use reserved identifiers (#578)
    • --rng-seed now accepts string "random-device" to generate random seed using std::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_CHECK macro, similar to STATIC_REQUIRE (#2318)
      • When deferred tu runtime, it behaves like CHECK, and not like REQUIRE.
    • 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, --warn warning 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_t on all platforms, instead of using size_t type.
    • The -o, --out output 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
    • Multiple reporters can now run at the same time and write to different files (#1712, #2183)
      • To support this, the -r, --reporter flag 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 ::.
    • 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 would change console colour even if Catch2 was writing to a file
      • The colour API is resilient against changing evaluation order of expressions
      • The associated CLI flag and compile-time configuration options have changed
        • For details see the docs for command-line and compile-time Catch2 configuration
    • Added a support for Bazel integration with XML_OUTPUT_FILE env var (#2399)
      • This has to be enabled during compilation.
    • Added --skip-benchmarks flag to run tests without any BENCHMARKs (#2392, #2408)
    • Added option to list all listeners in the binary via --list-listeners

    Fixes

    • The INFO macro no longer contains superfluous semicolon (#1456)
    • The --list* family of command line flags now return 0 on success (#1410, #1146)
    • Various ways of failing a benchmark are now counted and reporter properly
    • The ULP matcher now handles comparing numbers with different signs properly (#2152)
    • Universal ADL-found operators should no longer break decomposition (#2121)
    • Reporter selection is properly case-insensitive
      • Previously it forced lower cased name, which would fail for reporters with upper case characters in name
    • The cumulative reporter base stores benchmark results alongside assertion results
    • Catch2's SE handling should no longer interferes with ASan on Windows (#2334)
    • Fixed Windows console colour handling for tests that redirect stdout (#2345)
    • Fixed issue with the random generators returning the same value over and over again

    Other changes

    • CATCH_CONFIG_DISABLE_MATCHERS no longer exists.
      • If you do not want to use Matchers in a TU, do not include their header.
    • CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER no longer exists.
      • StringMaker specializations for <chrono> are always provided
    • Catch2's CMake now provides 2 targets, Catch2 and Catch2WithMain.
      • Catch2 is the statically compiled implementation by itself
      • Catch2WithMain also links in the default main
    • Catch2's pkg-config integration also provides 2 packages
      • catch2 is the statically compiled implementation by itself
      • catch2-with-main also links in the default main
    • Passing invalid test specifications passed to Catch2 are now reported before tests are run, and are a hard error.
    • Running 0 tests (e.g. due to empty binary, or test spec not matching anything) returns non-0 exit code
      • Flag --allow-running-no-tests overrides this behaviour.
      • NoTests warning has been removed because it is fully subsumed by this change.
    • Catch2's compile-time configuration options (CATCH_CONFIG_FOO) can be set through CMake options of the same name
      • They use the same semantics as C++ defines, including the CATCH_CONFIG_NO_FOO overrides,
        • -DCATCH_CONFIG_DEFAULT_REPORTER=compact changes default reporter to "compact"
        • -DCATCH_CONFIG_NO_ANDROID_LOGWRITE=ON forces android logwrite to off
        • -DCATCH_CONFIG_ANDROID_LOGWRITE=OFF does nothing (the define will not exist)
    Source code(tar.gz)
    Source code(zip)
    catch_amalgamated.cpp(370.91 KB)
    catch_amalgamated.cpp.asc(833 bytes)
    catch_amalgamated.hpp(448.50 KB)
    catch_amalgamated.hpp.asc(833 bytes)
  • v3.0.0-preview5(Apr 20, 2022)

    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.hpp header.
    • Why the big breaking change caused by replacing catch.hpp with catch_all.hpp?
      • The convenience header catch_all.hpp exists 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.

    (Potentially) Breaking changes

    • Catch2 now uses statically compiled library as its distribution model
      • Including catch.hpp no longer works
    • Catch2 now uses C++14 as the minimum support language version
    • ANON_TEST_CASE has been removed, use TEST_CASE with no arguments instead (#1220)
    • --list* commands no longer have non-zero return code (#1410)
    • --list-test-names-only has been removed (#1190)
      • You should use verbosity-modifiers for --list-tests instead
    • --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_CASE description 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].
    • PredicateMatcher is no longer type erased.
      • This means that the type of the provided predicate is part of the PredicateMatcher's type
    • SectionInfo no 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
    • The [!hide] tag has been removed.
      • Use [.] or [.foo] instead.
    • Lvalues of composed matchers cannot be composed further
    • Uses of REGISTER_TEST_CASE macro need to be followed by a semicolon
      • This does not change TEST_CASE and friends in any way
    • IStreamingReporter::IsMulti member 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
      • ListeningReporter is now final
      • Concrete Matchers (e.g. UnorderedEquals vector matcher) are now final
      • 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 Catch namespace
      • This means that all public-facing matcher-related functionality is now in Catch::Matchers namespace
    • Defining CATCH_CONFIG_MAIN will 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
    • CATCH_CONFIG_EXTERNAL_INTERFACES has been removed.
      • You should instead include the appropriate headers as needed.
    • CATCH_CONFIG_IMPL has been removed.
      • The implementation is now compiled into a static library.
    • Event Listener interface has changed
      • TestEventListenerBase was renamed to EventListenerBase
      • EventListenerBase now directly derives from IStreamingReporter, instead of deriving from StreamingReporterBase
    • GENERATE decays its arguments (#2012, #2040)
      • This means that str in auto str = GENERATE("aa", "bb", "cc"); is inferred to char const* rather than const char[2].
    • --list-* flags write their output to file specified by the -o flag
    • 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 --colour option has been replaced with --colour-mode option

    Improvements

    • Matchers have been extended with the ability to use different signatures of match (#1307, #1553, #1554, #1843)
      • This includes having templated match member 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, SizeIs which check that the range has specific properties
        • Contains, which checks whether a range contains a specific element
        • AllMatch, AnyMatch, NoneMatch range matchers, which apply matchers over a range of elements
    • Significant compilation time improvements
      • including catch_test_macros.hpp is 80% cheaper than including catch.hpp
    • Some runtime performance optimizations
      • In all tested cases the v3 branch was faster, so the table below shows the speedup of v3 to v2 at the same task

    | 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 than gmtime when constructing a date string (#2008, #2165)
    • --list-* flags write their output to file specified by the -o flag (#2061, #2163)
    • Approx::operator() is now properly const
    • Catch2's internal helper variables no longer use reserved identifiers (#578)
    • --rng-seed now accepts string "random-device" to generate random seed using std::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_CHECK macro, similar to STATIC_REQUIRE (#2318)
      • When deferred tu runtime, it behaves like CHECK, and not like REQUIRE.
    • 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, --warn warning 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_t on all platforms, instead of using size_t type.
    • The -o, --out output 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
    • Multiple reporters can now run at the same time and write to different files (#1712, #2183)
      • To support this, the -r, --reporter flag 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 ::.
    • 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 would change console colour even if Catch2 was writing to a file
      • The colour API is resilient against changing evaluation order of expressions
      • The associated CLI flag and compile-time configuration options have changed
        • For details see the docs for command-line and compile-time Catch2 configuration
    • Added a support for Bazel integration with XML_OUTPUT_FILE env var (#2399)
      • This has to be enabled during compilation.

    Fixes

    • The INFO macro no longer contains superfluous semicolon (#1456)
    • The --list* family of command line flags now return 0 on success (#1410, #1146)
    • Various ways of failing a benchmark are now counted and reporter properly
    • The ULP matcher now handles comparing numbers with different signs properly (#2152)
    • Universal ADL-found operators should no longer break decomposition (#2121)
    • Reporter selection is properly case-insensitive
      • Previously it forced lower cased name, which would fail for reporters with upper case characters in name
    • The cumulative reporter base stores benchmark results alongside assertion results
    • Catch2's SE handling should no longer interferes with ASan on Windows (#2334)
    • Fixed Windows console colour handling for tests that redirect stdout (#2345)

    Other changes

    • CATCH_CONFIG_DISABLE_MATCHERS no longer exists.
      • If you do not want to use Matchers in a TU, do not include their header.
    • CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER no longer exists.
      • StringMaker specializations for <chrono> are always provided
    • Catch2's CMake now provides 2 targets, Catch2 and Catch2WithMain.
      • Catch2 is the statically compiled implementation by itself
      • Catch2WithMain also links in the default main
    • Catch2's pkg-config integration also provides 2 packages
      • catch2 is the statically compiled implementation by itself
      • catch2-with-main also links in the default main
    • Passing invalid test specifications passed to Catch2 are now reported before tests are run, and are a hard error.
    • Running 0 tests (e.g. due to empty binary, or test spec not matching anything) returns non-0 exit code
      • Flag --allow-running-no-tests overrides this behaviour.
      • NoTests warning has been removed because it is fully subsumed by this change.
    • Catch2's compile-time configuration options (CATCH_CONFIG_FOO) can be set through CMake options of the same name
      • They use the same semantics as C++ defines, including the CATCH_CONFIG_NO_FOO overrides,
        • -DCATCH_CONFIG_DEFAULT_REPORTER=compact changes default reporter to "compact"
        • -DCATCH_CONFIG_NO_ANDROID_LOGWRITE=ON forces android logwrite to off
        • -DCATCH_CONFIG_ANDROID_LOGWRITE=OFF does nothing (the define will not exist)
    Source code(tar.gz)
    Source code(zip)
    catch_amalgamated.cpp(354.06 KB)
    catch_amalgamated.cpp.asc(833 bytes)
    catch_amalgamated.hpp(430.55 KB)
    catch_amalgamated.hpp.asc(833 bytes)
  • v3.0.0-preview4(Jan 3, 2022)

    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.hpp header.
    • Why the big breaking change caused by replacing catch.hpp with catch_all.hpp?
      • The convenience header catch_all.hpp exists 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.

    (Potentially) Breaking changes

    • Catch2 now uses statically compiled library as its distribution model
      • Including catch.hpp no longer works
    • Catch2 now uses C++14 as the minimum support language version
    • ANON_TEST_CASE has been removed, use TEST_CASE with no arguments instead (#1220)
    • --list* commands no longer have non-zero return code (#1410)
    • --list-test-names-only has been removed (#1190)
      • You should use verbosity-modifiers for --list-tests instead
    • --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_CASE description 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].
    • PredicateMatcher is no longer type erased.
      • This means that the type of the provided predicate is part of the PredicateMatcher's type
    • SectionInfo no 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
    • The [!hide] tag has been removed.
      • Use [.] or [.foo] instead.
    • Lvalues of composed matchers cannot be composed further
    • Uses of REGISTER_TEST_CASE macro need to be followed by a semicolon
      • This does not change TEST_CASE and friends in any way
    • IStreamingReporter::IsMulti member 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
      • ListeningReporter is now final
      • Concrete Matchers (e.g. UnorderedEquals vector matcher) are now final
      • 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 Catch namespace
      • This means that all public-facing matcher-related functionality is now in Catch::Matchers namespace
    • Defining CATCH_CONFIG_MAIN will 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
    • CATCH_CONFIG_EXTERNAL_INTERFACES has been removed.
      • You should instead include the appropriate headers as needed.
    • CATCH_CONFIG_IMPL has been removed.
      • The implementation is now compiled into a static library.
    • Event Listener interface has changed
      • TestEventListenerBase was renamed to EventListenerBase
      • EventListenerBase now directly derives from IStreamingReporter, instead of deriving from StreamingReporterBase
    • GENERATE decays its arguments (#2012, #2040)
      • This means that str in auto str = GENERATE("aa", "bb", "cc"); is inferred to char const* rather than const char[2].
    • --list-* flags write their output to file specified by the -o flag
    • 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 match member 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, SizeIs which check that the range has specific properties
        • Contains, which checks whether a range contains a specific element
        • AllMatch, AnyMatch, NoneMatch range matchers, which apply matchers over a range of elements
    • Significant compilation time improvements
      • including catch_test_macros.hpp is 80% cheaper than including catch.hpp
    • Some runtime performance optimizations
      • In all tested cases the v3 branch was faster, so the table below shows the speedup of v3 to v2 at the same task

    | 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 than gmtime when constructing a date string (#2008, #2165)
    • --list-* flags write their output to file specified by the -o flag (#2061, #2163)
    • Approx::operator() is now properly const
    • Catch2's internal helper variables no longer use reserved identifiers (#578)
    • --rng-seed now accepts string "random-device" to generate random seed using std::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_CHECK macro, similar to STATIC_REQUIRE (#2318)
      • When deferred tu runtime, it behaves like CHECK, and not like REQUIRE.
    • 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, --warn warning 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_t on all platforms, instead of using size_t type.
    • The -o, --out output 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
    • Multiple reporters can now run at the same time and write to different files (#1712, #2183)
      • To support this, the -r, --reporter flag now also accepts optional output destination
      • For full overview of the semantics of using multiple reporters, look into the reporter documentation

    Fixes

    • The INFO macro no longer contains superfluous semicolon (#1456)
    • The --list* family of command line flags now return 0 on success (#1410, #1146)
    • Various ways of failing a benchmark are now counted and reporter properly
    • The ULP matcher now handles comparing numbers with different signs properly (#2152)
    • Universal ADL-found operators should no longer break decomposition (#2121)
    • Reporter selection is properly case-insensitive
      • Previously it forced lower cased name, which would fail for reporters with upper case characters in name
    • The cumulative reporter base stores benchmark results alongside assertion results
    • Catch2's SE handling should no longer interferes with ASan on Windows (#2334)

    Other changes

    • CATCH_CONFIG_DISABLE_MATCHERS no longer exists.
      • If you do not want to use Matchers in a TU, do not include their header.
    • CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER no longer exists.
      • StringMaker specializations for <chrono> are always provided
    • Catch2's CMake now provides 2 targets, Catch2 and Catch2WithMain.
      • Catch2 is the statically compiled implementation by itself
      • Catch2WithMain also links in the default main
    • Catch2's pkg-config integration also provides 2 packages
      • catch2 is the statically compiled implementation by itself
      • catch2-with-main also links in the default main
    • Passing invalid test specifications passed to Catch2 are now reported before tests are run, and are a hard error.
    • Running 0 tests (e.g. due to empty binary, or test spec not matching anything) returns non-0 exit code
      • Flag --allow-running-no-tests overrides this behaviour.
      • NoTests warning has been removed because it is fully subsumed by this change.
    Source code(tar.gz)
    Source code(zip)
    catch_amalgamated.cpp(342.36 KB)
    catch_amalgamated.cpp.asc(833 bytes)
    catch_amalgamated.hpp(420.80 KB)
    catch_amalgamated.hpp.asc(833 bytes)
  • v2.13.8(Jan 3, 2022)

    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_CASE no longer create reserved identifiers (#2336)

    Improvements

    • Clang-tidy should no longer warn about missing virtual dispatch in FilterGenerator's constructor (#2314)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(641.77 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.13.7(Jul 28, 2021)

    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)
    • !mayfail tagged tests are now marked as skipped in JUnit reporter output (#2116)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(642.47 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.13.5(Apr 10, 2021)

    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)
      • MINSIGSTKSZ was no longer usable in constexpr context.

    Fixes

    • Fixed compilation of benchmarking when min and max macros are defined (#2159)
      • Including windows.h without NOMINMAX remains a really bad idea, don't do it

    Miscellaneous

    • Catch2WithMain target (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_LIBRARY to ON
    • 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.
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(641.48 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.13.4(Dec 29, 2020)

    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 ParseAndAddCatchTests CMake 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_tests instead, which uses runtime information about available tests.
    • Fixed bug in catch_discover_tests that would cause it to fail when used in specific project structures (#2119)
    • Added Bazel build file
    • Added an experimental static library target to CMake
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(638.03 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.13.3(Oct 31, 2020)

    Fixes

    • Fixed possible infinite loop when combining generators with section filter (-c option) (#2025)

    Miscellaneous

    • Fixed ParseAndAddCatchTests not finding TEST_CASEs without tags (#2055, #2056)
    • ParseAndAddCatchTests supports CMP0110 policy for changing behaviour of add_test (#2057)
      • This was the shortlived change in CMake 3.18.0 that temporarily broke ParseAndAddCatchTests
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(637.81 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v3.0.0-preview3(Oct 8, 2020)

    Changes compared to preview 2

    • Incorporated v2 changes up to v2.13.2
    • Some runtime performance improvements
    • The static library compiles 20-30% faster
    • The overhead of including catch_test_macros.hpp is 25-30% smaller
    • Amalgamated, 1 .hpp + 1 .cpp, distribution is provided
    • Reporter interface has slightly changed
    • Listener base renamed
    • Rewritten contributing documentation
      • Primary development is now on devel branch
      • v3 is now the primary development version

    Changes compared to v2 releases

    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 documentation has not yet been updated to account for the new design.

    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.hpp header.
    • Why the big breaking change caused by replacing catch.hpp with catch_all.hpp?
      • The convenience header catch_all.hpp exists 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 concious decision by the user, not something they can just stumble into unknowingly.

    (Potentially) Breaking changes

    • Catch2 now uses statically compiled library as its distribution model
      • Including catch.hpp no longer works
    • ANON_TEST_CASE has been removed, use TEST_CASE with no arguments instead (#1220)
    • --list* commands no longer have non-zero return code (#1410)
    • --list-test-names-only has been removed (#1190)
      • You should use verbosity-modifiers for --list-tests instead
    • --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_CASE description 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].
    • PredicateMatcher is no longer type erased.
      • This means that the type of the provided predicate is part of the PredicateMatcher's type
    • SectionInfo no 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
    • The [!hide] tag has been removed.
      • Use [.] or [.foo] instead.
    • Lvalues of composed matchers cannot be composed further
    • Uses of REGISTER_TEST_CASE macro need to be followed by a semicolon
      • This does not change TEST_CASE and friends in any way
    • IStreamingReporter::IsMulti member 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
      • ListeningReporter is now final
      • Concrete Matchers (e.g. UnorderedEquals vector matcher) are now final
      • 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 Catch namespace
      • This means that all public-facing matcher-related functionality is now in Catch::Matchers namespace
    • Defining CATCH_CONFIG_MAIN will 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
    • CATCH_CONFIG_EXTERNAL_INTERFACES has been removed.
      • You should instead include the appropriate headers as needed.
    • CATCH_CONFIG_IMPL has been removed.
      • The implementation is now compiled into a static library.
    • Event Listener interface has changed
      • TestEventListenerBase was renamed to EventListenerBase
      • EventListenerBase now directly derives from IStreamingReporter, instead of deriving from StreamingReporterBase

    Improvements

    • Matchers have been extended with the ability to use different signatures of match (#1307, #1553, #1554, #1843)
      • This includes having templated match member function
      • See the rewritten Matchers documentation for details
      • Catch2 currently provides some generic matchers, but there should be more before final release of v3
        • So far, IsEmpty, SizeIs, and Contains are provided.
        • At least ElementsAre and UnorderedElementsAre are planned.
    • Some runtime performance improvements
    • Significant compilation time improvements
      • including catch_test_macros.hpp is 80% cheaper than including catch.hpp

    Fixes

    • The INFO macro no longer contains superfluous semicolon (#1456)
    • The --list* family of command line flags now return 0 on success (#1410, #1146)

    Other changes

    • CATCH_CONFIG_DISABLE_MATCHERS no longer exists.
      • If you do not want to use Matchers in a TU, do not include their header.
    • CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER no longer exists.
      • StringMaker specializations for <chrono> are always provided
    • Catch2's CMake now provides 2 targets, Catch2 and Catch2WithMain.
      • Catch2 is the statically compiled implementation by itself
      • Catch2WithMain also links in the default main
    • Catch2's pkg-config integration also provides 2 packages
      • catch2 is the statically compiled implementation by itself
      • catch2-with-main also links in the default main
    Source code(tar.gz)
    Source code(zip)
  • v2.13.2(Oct 7, 2020)

    There are two things of importance here. The first is that after this release, I am making the v3 branch the main development branch, and will instead branch off a maintenance branch for v2.

    The other is that you should watch this video by my friend, JeanHeyd Meneide, on his experiences with the C++ community.

    Improvements

    • Implemented workaround for AppleClang shadowing bug (#2030)
    • Implemented workaround for NVCC ICE (#2005, #2027)

    Fixes

    • Fixed detection of std::uncaught_exceptions support under non-msvc platforms (#2021)
    • Fixed the experimental stdout/stderr capture under Windows (#2013)

    Miscellaneous

    • catch_discover_tests has been improved significantly (#2023, #2039)
      • You can now specify which reporter should be used
      • You can now modify where the output will be written
      • WORKING_DIRECTORY setting is respected
    • ParseAndAddCatchTests now supports TEMPLATE_TEST_CASE macros (#2031)
    • Various documentation fixes and improvements (#2022, #2028, #2034)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(635.55 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.15 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(6.92 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.35 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.48 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.13.1(Sep 7, 2020)

    Improvements

    • ParseAndAddCatchTests handles CMake v3.18.0 correctly (#1984)
    • Improved autodetection of std::byte (#1992)
    • Simplified implementation of templated test cases (#2007)
      • This should have a tiny positive effect on its compilation throughput

    Fixes

    • Automatic stringification of ranges handles sentinel ranges properly (#2004)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(634.85 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.13.0(Jul 12, 2020)

    Improvements

    • GENERATE can now follow a SECTION at the same level of nesting (#1938)
      • The SECTION(s) before the GENERATE will not be run multiple times, the following ones will.
    • Added -D/--min-duration command line flag (#1910)
      • If a test takes longer to finish than the provided value, its name and duration will be printed.
      • This flag is overriden by setting -d/--duration.

    Fixes

    • TAPReporter no longer skips successful assertions (#1983)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(634.77 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.12.3(Jun 29, 2020)

    Fixes

    • GENERATE nested in a for loop no longer creates multiple generators (#1913)
    • Fixed copy paste error breaking TEMPLATE_TEST_CASE_SIG for 6 or more arguments (#1954)
    • Fixed potential UB when handling non-ASCII characters in CLI args (#1943)

    Improvements

    • There can be multiple calls to GENERATE on a single line
    • Improved fno-except support for platforms that do not provide shims for exception-related std functions (#1950)
      • E.g. the Green Hills C++ compiler
    • XmlReporter now also reports test-case-level statistics (#1958)
      • This is done via a new element, OverallResultsCases

    Miscellaneous

    • Added .clang-format file to the repo (#1182, #1920)
    • Rewrote contributing docs
      • They should explain the different levels of testing and so on much better
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(632.69 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
  • v2.12.2(May 25, 2020)

    Fixes

    • Fixed compilation failure if is_range ADL found deleted function (#1929)
    • Fixed potential UB in CAPTURE if the expression contained non-ASCII characters (#1925)

    Improvements

    • std::result_of is not used if std::invoke_result is available (#1934)
    • JUnit reporter writes out status attribute for tests (#1899)
    • Suppresed clang-tidy's hicpp-vararg warning (#1921)
      • Catch2 was already suppressing the cppcoreguidelines-pro-type-vararg alias of the warning
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(629.93 KB)
    catch.hpp.asc(819 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(819 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(819 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(819 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(819 bytes)
  • v3.0.0-preview2(May 14, 2020)

    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 documentation has not yet been updated to account for the new design.

    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 I intend to provide sqlite-style distribution option, with 1 header and 1 "unity" .cpp file. Do note that the header will have similar problem to the catch_all.hpp header.
    • Why the big breaking change caused by replacing catch.hpp with catch_all.hpp?
      • The convenience header catch_all.hpp exists 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 concious decision by the user, not something they can just stumble into unknowingly.
    • Why does CMake/pkg-config/etc report version 3.0.0?
      • Lot of tooling does not handle preview versions too well, so we have to use proper new major version. The final release will use version 3.0.1 to avoid conflicts with these preview versions.

    (Potentially) Breaking changes

    • Catch2 now uses statically compiled library as its distribution model
      • Including catch.hpp no longer works
    • ANON_TEST_CASE has been removed, use TEST_CASE with no arguments instead (#1220)
    • --list* commands no longer have non-zero return code (#1410)
    • --list-test-names-only has been removed (#1190)
      • You should use verbosity-modifiers for --list-tests instead
    • --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_CASE description 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].
    • PredicateMatcher is no longer type erased.
      • This means that the type of the provided predicate is part of the PredicateMatcher's type
    • SectionInfo no 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
    • The [!hide] tag has been removed.
      • Use [.] or [.foo] instead.
    • Lvalues of composed matchers cannot be composed further
    • Uses of REGISTER_TEST_CASE macro need to be followed by a semicolon
      • This does not change TEST_CASE and friends in any way
    • IStreamingReporter::IsMulti member 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
      • ListeningReporter is now final
      • Concrete Matchers (e.g. UnorderedEquals vector matcher) are now final
      • 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 Catch namespace
      • This means that all public-facing matcher-related functionality is now in Catch::Matchers namespace
    • Defining CATCH_CONFIG_MAIN will 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
    • CATCH_CONFIG_EXTERNAL_INTERFACES has been removed.
      • You should instead include the appropriate headers as needed.
    • CATCH_CONFIG_IMPL has been removed.
      • The implementation is now compiled into a static library.

    Improvements

    • Matchers have been extended with the ability to use different signatures of match (#1307, #1553, #1554, #1843)
      • This includes having templated match member function
      • See the rewritten Matchers documentation for details
      • Catch2 currently provides some generic matchers, but there should be more before final release of v3
        • So far, IsEmpty, SizeIs, and Contains are provided.
        • At least ElementsAre and UnorderedElementsAre are planned.

    Fixes

    • The INFO macro no longer contains superfluous semicolon (#1456)
    • The --list* family of command line flags now return 0 on success (#1410, #1146)

    Other changes

    • CATCH_CONFIG_DISABLE_MATCHERS no longer exists.
      • If you do not want to use Matchers in a TU, do not include their header.
    • CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER no longer exists.
      • StringMaker specializations for <chrono> are always provided
    • Catch2's CMake now provides 2 targets, Catch2 and Catch2WithMain.
      • Catch2 is the statically compiled implementation by itself
      • Catch2WithMain also links in the default main
    • Catch2's pkg-config integration also provides 2 packages
      • catch2 is the statically compiled implementation by itself
      • catch2-with-main also links in the default main
    Source code(tar.gz)
    Source code(zip)
  • v2.12.0(Apr 21, 2020)

    Improvements

    • Running tests in random order (--order rand) has been reworked significantly (#1908)
      • Given same seed, all platforms now produce the same order
      • Given same seed, the relative order of tests does not change if you select only a subset of them
    • Vector matchers support custom allocators (#1909)
    • | and & (bitwise or and bitwise and) are now supported in CHECK and REQUIRE
      • The resulting type must be convertible to bool

    Fixes

    • Fixed computation of benchmarking column widths in ConsoleReporter (#1885, #1886)
    • Suppressed clang-tidy's cppcoreguidelines-pro-type-vararg in assertions (#1901)
      • It was a false positive trigered by the new warning support workaround
    • Fixed bug in test specification parser handling of OR'd patterns using escaping (#1905)

    Miscellaneous

    • Worked around IBM XL's codegen bug (#1907)
      • It would emit code for destructors of temporaries in an unevaluated context
    • Improved detection of stdlib's support for std::uncaught_exceptions (#1911)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(629.53 KB)
    catch.hpp.asc(819 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(819 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(819 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(819 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(819 bytes)
  • v2.11.2(Mar 19, 2020)

    Improvements

    • GCC and Clang now issue warnings for suspicious code in assertions (#1880)
      • E.g. REQUIRE( int != unsigned int ) will now issue mixed signedness comparison warning
      • This has always worked on MSVC, but it now also works for GCC and current Clang versions
    • Colorization of "Test filters" output should be more robust now
    • --wait-for-keypress now also accepts never as an option (#1866)
    • Reporters no longer round-off nanoseconds when reporting benchmarking results (#1876)
    • Catch2's debug break now supports iOS while using Thumb instruction set (#1862)
    • It is now possible to customize benchmark's warm-up time when running the test binary (#1844)
      • --benchmark-warmup-time {ms}
    • User can now specify how Catch2 should break into debugger (#1846)

    Fixes

    • Fixes missing <random> include in benchmarking (#1831)
    • Fixed missing <iterator> include in benchmarking (#1874)
    • Hidden test cases are now also tagged with [!hide] as per documentation (#1847)
    • Detection of whether libc provides std::nextafter has been improved (#1854)
    • Detection of wmain no longer incorrectly looks for WIN32 macro (#1849)
      • Now it just detects Windows platform
    • Composing already-composed matchers no longer modifies the partially-composed matcher expression
      • This bug has been present for the last ~2 years and nobody reported it
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(625.96 KB)
    catch.hpp.asc(819 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(819 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(819 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(819 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(819 bytes)
  • v2.11.1(Dec 28, 2019)

    Improvements

    • Breaking into debugger is supported on iOS (#1817)
    • google-build-using-namespace clang-tidy warning is suppressed (#1799)

    Fixes

    • Clang on Windows is no longer assumed to implement MSVC's traditional preprocessor (#1806)
    • ObjectStorage now behaves properly in const contexts (#1820)
    • GENERATE_COPY(a, b) now compiles properly (#1809, #1815)
    • Some more cleanups in the benchmarking support
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(625.26 KB)
    catch.hpp.asc(819 bytes)
    catch_reporter_automake.hpp(2.21 KB)
    catch_reporter_automake.hpp.asc(819 bytes)
    catch_reporter_sonarqube.hpp(7.09 KB)
    catch_reporter_sonarqube.hpp.asc(819 bytes)
    catch_reporter_tap.hpp(9.60 KB)
    catch_reporter_tap.hpp.asc(819 bytes)
    catch_reporter_teamcity.hpp(8.70 KB)
    catch_reporter_teamcity.hpp.asc(819 bytes)
  • v3.0.0-preview1(Dec 28, 2019)

    This is a preview release for the changes in the next (v3) major version. The biggest change is that Catch2 is now primarily provided as a static library. Use Catch2Main or Catch2 CMake targets to link against it.

    (Potentially) Breaking changes

    • ANON_TEST_CASE has been removed, use TEST_CASE with no arguments instead (#1220)
    • --list* commands no longer have non-zero return code (#1410)
    • --list-test-names-only has been removed (#1190)
      • You should use verbosity-modifiers for --list-tests instead
    • --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_CASE description 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].
    • PredicateMatcher is no longer type erased.
      • This means that the type of the provided predicate is part of the PredicateMatcher's type
    • SectionInfo no 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 implicitly convertible to it

    Fixes

    • The INFO macro no longer contains superfluous semicolon (#1456)
    • The --list* family of command line flags now return 0 on success (#1410, #1146)
    Source code(tar.gz)
    Source code(zip)
  • v2.11.0(Nov 15, 2019)

    Improvements

    • JUnit reporter output now contains more details in case of failure (#1347, #1719)
    • Added SonarQube Test Data reporter (#1738)
      • It is in a separate header, just like the TAP, Automake, and TeamCity reporters
    • range generator now allows floating point numbers (#1776)
    • Reworked part of internals to increase throughput

    Fixes

    • The single header version should contain full benchmarking support (#1800)
    • [.foo] is now properly parsed as [.][foo] when used on the command line (#1798)
    • Fixed compilation of benchmarking on platforms where steady_clock::period is not std::nano (#1794)
    Source code(tar.gz)
    Source code(zip)
    catch.hpp(624.34 KB)
    catch.hpp.asc(833 bytes)
    catch_reporter_automake.hpp(2.15 KB)
    catch_reporter_automake.hpp.asc(833 bytes)
    catch_reporter_sonarqube.hpp(6.92 KB)
    catch_reporter_sonarqube.hpp.asc(833 bytes)
    catch_reporter_tap.hpp(9.35 KB)
    catch_reporter_tap.hpp.asc(833 bytes)
    catch_reporter_teamcity.hpp(8.48 KB)
    catch_reporter_teamcity.hpp.asc(833 bytes)
Owner
Catch Org
Organisation account for Catch repositories
Catch Org
🧪 single header unit testing framework for C and C++

?? utest.h A simple one header solution to unit testing for C/C++. Usage Just #include "utest.h" in your code! The current supported platforms are Lin

Neil Henning 560 Jan 1, 2023
CppUTest unit testing and mocking framework for C/C++

CppUTest CppUTest unit testing and mocking framework for C/C++ More information on the project page Slack channel: Join if link not expired Getting St

CppUTest 1.1k Dec 26, 2022
A unit testing framework for C

Check Table of Contents About Installing Linking Packaging About Check is a unit testing framework for C. It features a simple interface for defining

null 926 Jan 2, 2023
Minimal unit testing framework for C

MinUnit Minunit is a minimal unit testing framework for C/C++ self-contained in a single header file. It provides a way to define and configure test s

David Siñuela Pastor 455 Dec 19, 2022
A lightweight unit testing framework for C++

Maintenance of UnitTest++, recently sporadic, is officially on hiatus until 26 November 2020. Subscribe to https://github.com/unittest-cpp/unittest-cp

UnitTest++ 510 Jan 1, 2023
UT: C++20 μ(micro)/Unit Testing Framework

"If you liked it then you "should have put a"_test on it", Beyonce rule [Boost::ext].UT / μt | Motivation | Quick Start | Overview | Tutorial | Exampl

boost::ext 950 Dec 29, 2022
Palanteer is a set of high performance visual profiler, debugger, tests enabler for C++ and Python

Palanteer is a set of lean and efficient tools to improve the general software quality, for C++ and Python programs.

Damien Feneyrou 1.9k Dec 29, 2022
Write tests in C

NAME libtap - Write tests in C SYNOPSIS #include <tap.h> int main () { plan(5); int bronze = 1, silver = 2, gold = 3; ok(bronze < silver,

Jacob Gelbman 231 Jan 2, 2023
Execute Input/Output tests on a software

IO-Tester The goal of this software is to take files as parameter that contains lists of inputs and expected ouputs and to tell the user if the tests

Martin 31 Dec 11, 2022
A testing micro framework for creating function test doubles

Fake Function Framework (fff) A Fake Function Framework for C Hello Fake World! Capturing Arguments Return Values Resetting a Fake Call History Defaul

Mike Long 551 Dec 29, 2022
test framework

Photesthesis This is a small, experimental parameterized-testing tool. It is intended to be used in concert with another unit-testing framework (eg. C

Graydon Hoare 11 Jun 2, 2021
DotX64Dbg aims to provide a seamless way to write and test plugins for X64Dbg using .Net 5.0 and C#.

DotX64Dbg (EARLY ALPHA) Plugins and Scripting with C# for x64Dbg. Create Plugins for X64Dbg with ease DotX64Dbg aims to provide a seamless way to writ

ζeh Matt 7 Oct 16, 2022
Simple Unit Testing for C

Unity Test Copyright (c) 2007 - 2021 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams Welcome to the Unity Test Project, one of the

Throw The Switch 2.8k Jan 5, 2023
Implementations of FizzBuzz test, with different optimisations

fizzbuzz Optimisation of classic FizzBuzz test. supernaive The least efficient implementation, with 3 ifs and two printfs per number. It is so ineffic

Ilya Caramishev 123 Oct 25, 2022
The fastest feature-rich C++11/14/17/20 single-header testing framework

master branch Windows All dev branch Windows All doctest is a new C++ testing framework but is by far the fastest both in compile times (by orders of

Viktor Kirilov 4.5k Jan 5, 2023
Windows-only Remote Access Tool (RAT) with anti-debugging and anti-sandbox checks

RATwurst Windows-only Remote Access Tool (RAT) with anti-debugging and anti-sandbox checks. For educational purposes only. The reason behind this proj

AccidentalRebel 35 Dec 5, 2022
🍦IceCream-Cpp is a little (single header) library to help with the print debugging on C++11 and forward.

??IceCream-Cpp is a little (single header) library to help with the print debugging on C++11 and forward.

Renato Garcia 422 Dec 28, 2022
Googletest - Google Testing and Mocking Framework

GoogleTest OSS Builds Status Announcements Release 1.10.x Release 1.10.x is now available. Coming Soon Post 1.10.x googletest will follow Abseil Live

Google 28.7k Jan 7, 2023
C++ Benchmark Authoring Library/Framework

Celero C++ Benchmarking Library Copyright 2017-2019 John Farrier Apache 2.0 License Community Support A Special Thanks to the following corporations f

John Farrier 728 Jan 6, 2023