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.
- Host: GitHub
- URL: https://github.com/an-prata/scrutiny
- Owner: an-prata
- License: mit
- Created: 2022-12-30T18:32:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-10T21:31:31.000Z (almost 3 years ago)
- Last Synced: 2023-07-10T22:28:34.762Z (almost 3 years ago)
- Topics: benchmarking, c, unit-testing
- Language: C
- Homepage:
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.