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.
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.
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.
How to use it
This documentation comprises these three parts:
More
Requires (1)
Tests
Examples
Builds
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.6-O2 |
timestamp |
2024-03-27 10:26:30 UTC (01 00:00:01 days ago) |
result |
warning (configure) | warning (update) | warning (test) | warning (install) | error (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.6-static_O2 |
timestamp |
2024-03-26 22:55:50 UTC (01 11:30:41 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_12.2_mingw_w64 |
timestamp |
2024-03-26 15:53:41 UTC (01 18:32:50 days ago) |
result |
warning (test) | error (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16_libc++ |
timestamp |
2024-03-26 14:50:19 UTC (01 19:36:12 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16_libc++-O3 |
timestamp |
2024-03-26 14:28:41 UTC (01 19:57:49 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16 |
timestamp |
2024-03-26 14:27:24 UTC (01 19:59:07 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16_libc++-static_O3 |
timestamp |
2024-03-26 14:26:18 UTC (01 20:00:13 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16-O3 |
timestamp |
2024-03-26 14:26:08 UTC (01 20:00:23 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16-static_O3 |
timestamp |
2024-03-26 14:24:25 UTC (01 20:02:05 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_11-gcc_12 |
timestamp |
2024-03-26 14:19:34 UTC (01 20:06:56 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_16.0_llvm_msvc_17.6-static_O2 |
timestamp |
2024-03-26 13:28:21 UTC (01 20:58:10 days ago) |
result |
warning (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_15.0-static_O3 |
timestamp |
2024-03-26 13:26:17 UTC (01 21:00:14 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_15.0-O3 |
timestamp |
2024-03-26 13:24:47 UTC (01 21:01:43 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_15.0 |
timestamp |
2024-03-26 13:23:05 UTC (01 21:03:25 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_fedora_37-gcc_12.2-bindist |
timestamp |
2024-03-26 13:21:16 UTC (01 21:05:15 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_12.2_mingw_w64-O2 |
timestamp |
2024-03-26 13:08:11 UTC (01 21:18:19 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_12.2_mingw_w64-static_O2 |
timestamp |
2024-03-26 12:57:57 UTC (01 21:28:34 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd13.2 |
tgt config |
freebsd_13-clang_14.0-static_O3 |
timestamp |
2024-03-26 12:13:42 UTC (01 22:12:49 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd13.2 |
tgt config |
freebsd_13-clang_14.0-O3 |
timestamp |
2024-03-26 12:07:02 UTC (01 22:19:29 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd13.2 |
tgt config |
freebsd_13-clang_14.0 |
timestamp |
2024-03-26 12:05:19 UTC (01 22:21:12 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_12-bindist |
timestamp |
2024-03-26 12:01:46 UTC (01 22:24:44 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_14.0-static_O3 |
timestamp |
2024-03-26 11:49:47 UTC (01 22:36:43 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_14.0-O3 |
timestamp |
2024-03-26 11:48:27 UTC (01 22:38:03 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_14.0 |
timestamp |
2024-03-26 11:47:01 UTC (01 22:39:29 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13-static_O3 |
timestamp |
2024-03-26 11:44:30 UTC (01 22:42:01 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13-ndebug_O3 |
timestamp |
2024-03-26 11:41:43 UTC (01 22:44:48 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13 |
timestamp |
2024-03-26 11:40:47 UTC (01 22:45:43 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_11-gcc_12.1 |
timestamp |
2024-03-26 11:38:55 UTC (01 22:47:36 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd12.4 |
tgt config |
freebsd_12-clang_13.0 |
timestamp |
2024-03-26 11:37:16 UTC (01 22:49:14 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13-O3 |
timestamp |
2024-03-26 11:35:16 UTC (01 22:51:14 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_15_libc++ |
timestamp |
2024-03-26 11:22:34 UTC (01 23:03:57 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_15 |
timestamp |
2024-03-26 11:07:44 UTC (01 23:18:47 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_fedora_38-gcc_13-bindist |
timestamp |
2024-03-26 10:58:45 UTC (01 23:27:46 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-gcc_13_homebrew-static_O3 |
timestamp |
2024-03-26 10:53:03 UTC (01 23:33:28 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0_libc++-O3 |
timestamp |
2024-03-26 10:52:58 UTC (01 23:33:33 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-gcc_13_homebrew-O3 |
timestamp |
2024-03-26 10:52:03 UTC (01 23:34:27 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-gcc_13_homebrew |
timestamp |
2024-03-26 10:50:53 UTC (01 23:35:38 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_16.0_llvm_msvc_17.6-O2 |
timestamp |
2024-03-26 10:50:10 UTC (01 23:36:20 days ago) |
result |
warning (configure) | warning (update) | warning (test) | warning (install) | error (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_16.0_llvm_msvc_17.6 |
timestamp |
2024-03-26 10:48:23 UTC (01 23:38:07 days ago) |
result |
warning (configure) | warning (update) | warning (test) | warning (install) | error (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0_libc++-static_O3 |
timestamp |
2024-03-26 10:48:12 UTC (01 23:38:19 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0-O3 |
timestamp |
2024-03-26 10:45:57 UTC (01 23:40:33 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0_libc++ |
timestamp |
2024-03-26 10:45:01 UTC (01 23:41:30 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.6 |
timestamp |
2024-03-26 10:42:30 UTC (01 23:44:00 days ago) |
result |
warning (configure) | warning (update) | warning (test) | warning (install) | error (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0-static_O3 |
timestamp |
2024-03-26 10:41:57 UTC (01 23:44:33 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0 |
timestamp |
2024-03-26 10:41:12 UTC (01 23:45:19 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_15.0_msvc_msvc_17.6 |
timestamp |
2024-03-26 10:37:10 UTC (01 23:49:20 days ago) |
result |
warning (configure) | warning (update) | warning (test) | warning (install) | error (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.5 |
timestamp |
2024-03-26 10:35:08 UTC (01 23:51:23 days ago) |
result |
warning (configure) | warning (update) | warning (test) | warning (install) | error (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1 |
timestamp |
2024-03-26 10:30:29 UTC (01 23:56:01 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1-O3 |
timestamp |
2024-03-26 10:29:25 UTC (01 23:57:05 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_15.0_libc++ |
timestamp |
2024-03-26 10:28:34 UTC (01 23:57:56 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1-ndebug_O3 |
timestamp |
2024-03-26 10:27:19 UTC (01 23:59:11 days ago) |
result |
error (update) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_15.0 |
timestamp |
2024-03-26 10:26:06 UTC (02 00:00:24 days ago) |
result |
warning (update) | error (test) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1-static_O3 |
timestamp |
2024-03-26 10:25:30 UTC (02 00:01:00 days ago) |
result |
error (update) | log | rebuild |