libcheck/check
FreeA unit testing framework for C
FreeFree tier
About libcheck/check
Check is a unit testing framework for C that provides a simple interface for defining unit tests. Tests run in a separate address space, enabling it to catch assertion failures and code errors that cause segmentation faults or other signals. Test output can be integrated into source code editors and IDEs. The framework is open source under the LGPL-2.1 license and is available packaged for multiple operating systems. It supports build systems like autoconf and cmake.
Key Features
Simple interface for defining unit tests
Tests run in a separate address space for crash isolation
Catches assertion failures, segmentation faults, and other signals
Test output usable within source code editors and IDEs
Open source under LGPL-2.1 license
Packaged for multiple operating systems
Pros & Cons
Pros
- Catches segmentation faults and signals that would otherwise crash the test runner
- Simple and minimal API that puts little in the way of the developer
- Tests run in isolated address space, preventing test failures from affecting others
- Output can be parsed by editors and IDEs for inline test results
- Mature project with stable releases and wide packaging
Cons
- Uses variadic macros which cause warnings with strict C90 compilation (gcc -Wno-variadic-macros needed)
- Latest stable release (0.15.2) is from August 2020, indicating potentially slow development cadence
- Limited to C language; no built-in support for C++ or other languages
Best For
Unit testing C programsAutomated testing in CI/CD pipelinesTest-driven development in CIntegration with IDEs for visual test resultsRegression testing for C libraries and applications
FAQ
What is Check?
Check is a unit testing framework for C that provides a simple interface for defining tests, with tests run in a separate address space to catch crashes and signals.
How does Check catch segmentation faults?
Tests are executed in a separate address space (forked process), so segmentation faults, assertion failures, and other signals can be caught and reported gracefully.
What dependencies are needed to build Check?
Check requires autoconf, automake, libtool, pkg-config, and texinfo (for documentation). It can be built using either autoconf/automake or cmake.
What license does Check use?
Check is released under the LGPL-2.1 license.
Is Check available for my operating system?
Check is packaged for several operating systems (exact list not shown on page). Installation from source is supported via autoconf or cmake build systems.