Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshb/jabtest
A very small, easy-to-use library for writing unit tests in C.
https://github.com/joshb/jabtest
Last synced: about 1 month ago
JSON representation
A very small, easy-to-use library for writing unit tests in C.
- Host: GitHub
- URL: https://github.com/joshb/jabtest
- Owner: joshb
- License: other
- Created: 2015-01-01T06:49:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-01T18:25:53.000Z (almost 10 years ago)
- Last Synced: 2023-04-15T11:17:50.319Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 602 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
jabtest
=======jabtest is a very small, easy-to-use library for writing simple unit tests in C.
All of its code is contained in two files (one C [source file](jabtest.c)
and one [header file](jabtest.h)) that can easily be added to an existing project.Here's an [example program](jabtest_example.c) that uses it:
```c
#include "jabtest.h"static TestResult test1() { ASSERT(1 + 1 == 2); return SUCCESS; } /* will succeed */
static TestResult test2() { ASSERT(1 + 1 == 3); return SUCCESS; } /* will fail */
static TestResult test3() { ASSERT(1 + 2 == 3); return SUCCESS; } /* will succeed */
int main(int argc, const char *argv[])
{
run_test(test1); run_test(test2); run_test(test3);
print_test_summary();
return 0;
}
```![Screenshot](jabtest_example.png)
The output includes green dots representing tests that finished successfully, and
red exclamation marks representing tests that failed. A summary is then printed,
including information about the assertions that failed and the number of tests
that passed/failed.License
=======jabtest is open source software available under a [BSD-style license](LICENSE.md).