Pronounced: /ˈvɛrɪk/ (like "ver-ik")
Veric is a simple and lightweight testing framework for C projects. With just a handful of intuitive APIs, you can organize your tests into suites, run them with a single command, and get clear feedback on your test results.
- Well-documented - Detailed tutorial, many examples, and API reference.
- Lightweight - Only one
.cand one.hfile, no dependencies. - User-friendly - Minimal, easy-to-use API for effortless test management.
- Zero maintenance - Automatic suite and test registration.
- Logging - Save test results to a file.
- Output capturing - Verify
stdoutandstderrduring tests. - DIY assertions - Build your own custom checks.
- Memory flexibility - Supports both static and dynamic memory policies.
Ready to VERIfy your C code? Here’s how easy it is:
#include "veric.h"
VRC_SUITE(suite_name)
VRC_TEST(test_name)
{
// Replace with your actual test logic
int result = 1 + 1;
int expected = 2;
vrc_check(result == expected);
}
int main(void)
{
return vrc_start();
}Build and run minimal example with:
make run_minimal_exampleSample output:
[ 1 ] - suite_name
[ 1.1 ] - [ PASS ]
[ 1 ] - [ PASS ]
==============================
Suite stats:
Total: 1
Pass: 1 (100.00%)
Fail: 0
Fatal: 0
Skip: 0
Not run: 0
Test stats:
Total: 1
Pass: 1 (100.00%)
Fail: 0
Fatal: 0
Skip: 0
Not run: 0
Session status: [ PASS ]
Want to try more? Run any example with:
make run_<example_name>All you need is a C compiler that supports attribute constructor.
Not sure? Check with:
make test_constructorVeric is written in the C99 standard and has been tested with GCC and Clang compilers.
- CLI parameters for test control
- Colorized output
- Time tracking for tests and suites
- Tags for grouping and selective execution
- TAP support
- Your ideas? Open an issue or PR!
MIT License. See LICENSE for details.
✨ Happy testing!