https://github.com/superzazu/uunit
micro unit testing library in C99 distributed under the zlib license
https://github.com/superzazu/uunit
tdd test testing unittest
Last synced: over 1 year ago
JSON representation
micro unit testing library in C99 distributed under the zlib license
- Host: GitHub
- URL: https://github.com/superzazu/uunit
- Owner: superzazu
- License: zlib
- Created: 2019-06-21T10:44:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-21T10:54:52.000Z (about 7 years ago)
- Last Synced: 2025-01-27T12:49:36.659Z (over 1 year ago)
- Topics: tdd, test, testing, unittest
- Language: C
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uunit
micro unit testing library in C99 distributed under the zlib license.
Example:
```c
#include
#define UUNIT_COLORS 1 // to enable colored output
// #define UUNIT_FAILFAST 1 // to stop on first fail
#include "uunit.h"
add_test(test_one) {
assert_true(3 == 3);
}
add_test(test_two) {
assert_eq(10, 16);
}
add_test(test_three) {
assert_gt(42, 1);
}
int main(void) {
run_test(test_one);
run_test(test_two);
run_test(test_three);
print_report();
return uunit_nb_tests_failed != 0;
}
```
Outputs:
```
[PASS] test_one
example.c:12:test_two: error: assertion failed: (10) == (16)
[FAIL] test_two
[PASS] test_three
REPORT: executed 3 tests, 1 failed (0 skipped).
```