silentbicycle/greatest
FreeA C testing library in 1 file. No dependencies, no dynamic allocation. ISC licensed.
FreeFree tier
About silentbicycle/greatest
greatest is a lightweight C testing system distributed as a single header file. It is written in ANSI C89, has no external dependencies, and performs no dynamic memory allocation. The library is designed to be minimal, portable, and un-opinionated, allowing it to be used as a standalone test runner or integrated into other programs. Tests can be grouped into suites, share common setup, and be compiled in separate modules. Specific tests or suites can be run by name for rapid iteration. greatest also supports C99 parametric testing when compiled with a newer language standard and is usable from C++. It is released under the permissive ISC License.
Key Features
Single header file – just #include 'greatest.h'
No dependencies beyond ANSI C89
No dynamic allocation
ISC License – permissive for commercial use
Very little boilerplate code required
Un-opinionated: can run standalone or as part of other programs
Modular: tests grouped into suites, shared setup, separate compilation units
Low friction: run specific tests or suites by name, fast startup
Supports C99 parametric testing
Can be used from C++
Pros & Cons
Pros
- Single-file integration – no build system or package manager needed
- No external dependencies, minimal footprint
- Permissive ISC license allows use in proprietary projects
- Very low startup latency, ideal for rapid test‑driven development
- Supports suites and shared setup for organizing tests across modules
- Can run specific tests by name for focused iteration
- Portable across ANSI C89 compilers
Cons
- Limited to C and C++ languages only
- Lacks built-in mocking, advanced assertions, or fixtures
- Smaller community and ecosystem compared to frameworks like Unity or CMocka
Best For
Unit testing in CIntegration testing in CParametric testing with argumentsProperty-based testing (with companion project theft)Testing C++ code
FAQ
What is greatest?
greatest is a C testing system contained in a single header file. It provides macros for assertions, test cases, suites, and a command-line test runner.
How do I install greatest?
Download the 'greatest.h' header file from the GitHub repository and #include it in your C or C++ source files. No installation or build system configuration is required.
What license does greatest use?
greatest is released under the ISC License, which is a permissive license allowing free use, modification, and distribution, even for commercial purposes.
Can I use greatest with C++?
Yes. While greatest was designed with C in mind, it attempts to be usable from C++. The examples include a C++ file (example_cpp.cpp).
Does greatest require dynamic memory allocation?
No. greatest performs no dynamic allocation, making it suitable for embedded or memory-constrained environments.