Attractor is a personal project that I made open source. It’s a single-function unit test framework for C projects.
You can find it here: https://github.com/zaerl/attractor
I wanted to create something:
- Simple
- Small
I wasn’t happy with all the unit test libraries I found online so I created one that uses the magic behind C11 _Generic selection.
The library consists of two files: attractor.h and attractor.c.
Usage
Using Attractor is very simple. It consists of the macro:
It is a generic macro and accepts every core C type, see the repository for the complete list.
You can add all the tests you want and then check if all tests went well. Quick example:
See the repository for complete examples.
Why? There are multiple C unit test frameworks
Why not?