$ show sheredom/utest.h
utest.h is a single-header unit testing framework for C and C++ that provides automatic test registration via constructor attributes, sophisticated assertion macros with expression tracking, and cross-platform support. The framework supports basic tests, fixture-based tests, and indexed/parameterized tests. It outputs results in both human-readable console format and machine-readable XML format. The implementation demonstrates high craftsmanship through its platform abstraction layer, memory-safe test registration system, and clever use of compiler-specific features to eliminate boilerplate. The core functionality is entirely self-contained within utest.h with no external dependencies beyond standard libraries.
The LLM identified 1 files worth highlighting for reuse:
The core unit testing framework that provides automatic test registration through compiler-specific constructor attributes, a sophisticated macro system for different test types (UTEST, UTEST_F, UTEST_I), cross-platform timing mechanisms, and rich assertion capabilities with expression tracking. It implements a complete testing solution in a single header file that can be trivially integrated into any C/C++ project by simply including the header. The framework handles test registration, sorting, execution, and reporting with minimal runtime overhead.