A C++20 single-header, macro-free μ(micro)/unit testing framework focused on fast compilation and modern C++ features.
UT (μt) is a C++20 unit testing framework designed as a single-header, macro-free library. It provides a modern, lightweight alternative to traditional testing frameworks like GoogleTest and Boost.Test, focusing on fast compilation times, clean syntax, and support for testing methodologies like BDD and TDD.
C++ developers and teams working with C++20 or later who need a fast, modern testing framework without macros or complex dependencies, especially those practicing TDD/BDD.
UT offers a unique combination of macro-free design, single-header simplicity, and support for modern C++ features, resulting in faster compilation and a more intuitive API compared to established frameworks.
C++20 μ(micro)/Unit Testing framework
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Just include boost/ut.hpp or import the module with no external dependencies, making integration trivial as shown in the Quick Start section.
Uses C++20 features like user-defined literals and lambdas instead of preprocessor macros, resulting in cleaner code and better debugging, demonstrated throughout the tutorial.
Optimized for speed with minimal overhead through techniques like type-name erasure, making it suitable for large projects, as highlighted in the benchmarks section.
Supports multiple methodologies including BDD (given/when/then), Gherkin, and Spec notation, allowing teams to adopt their preferred workflow, detailed in the examples.
Requires C++20 or later, excluding projects using older standards, which limits adoption in legacy codebases, as stated in the overview's compiler requirements.
Lacks integrated mocking support; the FAQ explicitly recommends third-party frameworks like GMock, adding complexity for test doubles.
Advanced features like custom runners and reporters involve low-level event handling, making customization more complex compared to drop-in solutions, as seen in the config examples.
μt is an open-source alternative to the following products:
Boost.Test is a C++ unit testing framework that provides tools for writing test cases, test suites, and executing them with various output formats.
GoogleTest is Google's C++ testing framework that supports test discovery, assertions, death tests, and various options for running tests.
Catch2 is a C++ testing framework focused on simplicity and flexibility, supporting both unit testing and behavior-driven development (BDD) with a modern syntax.