c-testing
https://github.com/standardloop/c-testing
About
Repo for testing library for C.
Example
Program
#include <standardloop/testing.h>
int main(void)
{
TestingInit();
TestCaseVerify(true, "will pass", 1 == 1);
TestCaseVerify(true, "will fail", 1 == 0);
TestCaseVerify(false, "will not run", 1 == 0);
TestingTearDown();
}
Output
[2026-09-18 22:59:23] Starting test run.....
Test: "will fail" Failed! (1 == 0) in testing.test.c at line 7
Test: "will not run" Skipped! (1 == 0) in testing.test.c at line 8
--------results--------
passed: 1
failed: 1
skipped: 1
-----------------------
[2026-09-18 22:59:23] Done!
Running
This repo uses task.
Please run the default task to see all the avaiable tasks
Available Tasks
task: Available tasks for this project:
* default
* dependencies
* release
* test:build
* test:run
* test:build-sanitize
* test:run-sanitize
* clean
* fmt
* docs
* test:leaks Run macOS leaks on the test program.
Building
Dependencies
Using mise
$ mise install
$ eval "$(mise activate bash)"
# when done
$ mise deactivate
$ mise prune
$ mise cache clean
Using brew and npm
Releasing
Releases are handled via GitHub Actions.
Docs
Docs are generated a first generated with doxygen as xml and then moxygen reads the xml to output markdown in the docs/ folder.
This repo uses reusable tasks from https://github.com/standardloop/taskfiles/
Precommit
This repo uses prek.
Please run prek install.