An open API service indexing awesome lists of open source software.

https://github.com/an-prata/scrutiny

A simple, easy to use, and lightweight unit testing framework written in and for C.
https://github.com/an-prata/scrutiny

benchmarking c unit-testing

Last synced: about 1 month ago
JSON representation

A simple, easy to use, and lightweight unit testing framework written in and for C.

Awesome Lists containing this project

README

          

# scrutiny
A simple, easy to use, and lightweight unit testing framework written in and for C. Just make test functions that take `void` parameters and return `void`. Add their pointers to an array of `scrutiny_unit_test_t`s (these are `typedef`s of `void (*func)(void)`) and terminate the array with a NULL pointer, pass this array into `scrutiny_run_tests()` as the only argument and you get instant test feedback. Examples can be found in `examples/`.

To add scrutiny to your own projects just include the single header file and compile with the single `scrutiny.c` cource file. To run tests it may be benificial to use an `#ifdef` or similar switch out the `main()` function. Alternitavely you could create a seperate source directoy containing your tests, and include the code you want to test in that.