Catch
A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch) (by catchorg)
benchmark
A microbenchmark support library (by google)
Catch | benchmark | |
---|---|---|
58 | 21 | |
18,924 | 9,201 | |
0.8% | 1.6% | |
8.6 | 8.6 | |
16 days ago | 8 days ago | |
C++ | C++ | |
gtkbook License | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Catch
Posts with mentions or reviews of Catch.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2025-01-04.
-
Five Advanced Techniques to Improve Automated Testing by 50%
Identification: Use tools like pytest-rerunfailures, TestNg, and Catch2 to automatically rerun failed tests.
-
Unit Tests as Documentation
This is one area where a BDD style framework like catch2[0] really shines, IMO. The way tests are written in this style naturally lends itself to self-documenting each branch
[0]: https://github.com/catchorg/Catch2
-
Comparing C++ range libraries for filter+reverse case with non-trivial lambda
The code uses catch2 to test for correctness and performance. Catch2 is a unit testing framework for C++, but it also provides basic micro-benchmarking features. Unfortunately, it doesn't provide any way to visualise the results, so I created a script and submitted PR adding plotting capabilities to Catch.
- C++ Comparison Operator Craziness
-
How can I check the execution time of a program rendered in SFML?
https://github.com/catchorg/Catch2 (for unit testing, need to do timing yourself)
- Semi crise existentielle de développeur
-
`DestroyJavaVM()` failing on OpenJ9?
```c++ // https://github.com/catchorg/Catch2/tree/Catch1.x // https://github.com/philsquared/Catch/releases/download/v1.12.2/catch.hpp
-
How do you use the Catch testing library?
Include(FetchContent) FetchContent_Declare(Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_TAG v3.3.2 ) FetchContent_MakeAvailable(Catch2)
- Tracking the Fake GitHub Star Black Market
- The Little Things: Why you should always have benchmarks ready
benchmark
Posts with mentions or reviews of benchmark.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-09-27.
-
std::array in C++ isn't slower than array in C
As with the assembly code analysis, let's look at two types of operations: sequentially filling an array with random numbers, and randomly accessing arbitrary array elements when we pass it to a function. To compile the code, we used GCC and Clang. We checked both debug (with the -DDEBUG flag) and release builds (with the -O3 level optimizations and the -DNDEBUG flag). And of course, we used Google Benchmark to run the tests.
-
Open Source C++ Stack
''' Uchen core - ML framework ''' module(name = "uchen-core", version = "0.1", compatibility_level = 1) bazel_dep(name = "abseil-cpp", version = "20240116.2") bazel_dep(name = "googletest", version = "1.14.0") git_override( module_name = "googletest", remote = "https://github.com/google/googletest.git", commit = "1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2", ) bazel_dep(name = "google_benchmark", version = "1.8.3") git_override( module_name = "google_benchmark", remote = "https://github.com/google/benchmark.git", commit = "447752540c71f34d5d71046e08192db181e9b02b", ) # Dev dependencies bazel_dep(name = "hedron_compile_commands", dev_dependency = True) git_override( module_name = "hedron_compile_commands", remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git", commit = "a14ad3a64e7bf398ab48105aaa0348e032ac87f8", )
- How can I check the execution time of a program rendered in SFML?
- How to Perf profile functions?
-
how do you properly benchmark?
I'm aware of one by Google that I used a couple times, but IMO it's better to capture real runtime data from a fully-operational process than to carve out the benchmarkable bits and test them in isolation, so I track information during program testing and print it all to a log instead of using things like that.
-
Benchmarking my data structure
If you just want to do some quick benchmarks, you can just use std::chrono::high_resolution_clock::now(). Call it before the code that you are benchmarking and then immediately after. Take them away and you have your duration. If you want to use a proper benchmarking tool then I can totally recommend Google Benchmark. Fantastic benchmarking tool. Honourable mention would be Quick Bench which is an online tool that uses Google Benchmark.
-
Google benchmark : No rule to make Target***
I tried to install google benchmark(https://github.com/google/benchmark) in my ubuntu machine by :
- Best accurate way to measure/compare elapsed time in C++
-
Don’t Be Scared Of Functional Programming
We don't know if it's a lie until we verify it and that's not difficult, you have a quicksort implementation in a couple of languages, you'll need to pass the necessary parameters to show the time needed by a function call to execute to the compiler or interpreter or you may use use a library(like benchmark for C++) and you're good to go.
-
How to identify inefficient method calls?
If you are uncertain about the performance characteristics of a function you should ALWAYS benchmark it. Googles Benchmark library is wonderful for quick micro benchmarks. For more complex things, perhaps look into profiling and then look at invocation counts of copy constructors.
What are some alternatives?
When comparing Catch and benchmark you can also consider the following projects:
Google Test - GoogleTest - Google Testing and Mocking Framework
Nonius - A C++ micro-benchmarking framework
doctest - The fastest feature-rich C++11/14/17/20/23 single-header testing framework
Celero - C++ Benchmark Authoring Library/Framework
Boost.Test - The reference C++ unit testing framework (TDD, xUnit, C++03/11/14/17)
hayai - C++ benchmarking framework
CppUnit - C++ port of JUnit
Google Mock
CppUTest - CppUTest unit testing and mocking framework for C/C++
easy_profiler - Lightweight profiler library for c++