catch2

[full]

Catch2 is a multi-paradigm test framework for C++. which also supports Objective-C (and maybe C). It is primarily distributed as a single header file, although certain extensions may require additional headers.

Catch2 logo

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

What is 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. Test names do not have to be valid identifiers, assertions look like normal C++ boolean expressions, and sections provide a nice and local way to share set-up and tear-down code in tests.

Example unit test

#include <catch2/catch_test_macros.hpp>

#include <cstdint>

uint32_t factorial( uint32_t number ) {
    return number <= 1 ? number : factorial(number-1) * number;
}

TEST_CASE( "Factorials are computed", "[factorial]" ) {
    REQUIRE( factorial( 1) == 1 );
    REQUIRE( factorial( 2) == 2 );
    REQUIRE( factorial( 3) == 6 );
    REQUIRE( factorial(10) == 3'628'800 );
}
... More
license BSL-1.0
project catch2
url github.com/catchorg/Catch2
7 Versions
version 3.3.2
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; c++14
version 3.1.0
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; c++14
version 3.0.1
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; c++14
version 2.13.9+1
repository https://pkg.cppget.org/1/stable
depends 0
version 2.13.8
repository https://pkg.cppget.org/1/stable
depends 0
version 2.13.7
repository https://pkg.cppget.org/1/stable
depends 0
version 2.13.6+2
repository https://pkg.cppget.org/1/stable
depends 0