Our great sponsors
-
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)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
https://github.com/catchorg/Catch2 is simple, but powerful testing framework. I'm using it in my projects.
doctest is my favorite framework. Really simple to use, header only, supports compile-time tests, lots of features and it works well with cmake.
If you just want a simple guide on how to run unit tests: 1. Get a unit test library (I like googletest https://github.com/google/googletest) 2. Use cmake to link against it (I expect you know how to use cmake, if you dont, hit me up and I can give you great resources on it, its really important when working with c++) 3. Use the basic googletest syntax for testing your c++ code, its pretty simple (https://www.youtube.com/watch?v=YiBepqOvL8E&t=56s)
Same, I use doctest and it integrates well with meson (which I prefer over CMake).