Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdsouza/ctest
Simple testing library for C.
https://github.com/pdsouza/ctest
Last synced: 7 days ago
JSON representation
Simple testing library for C.
- Host: GitHub
- URL: https://github.com/pdsouza/ctest
- Owner: pdsouza
- License: apache-2.0
- Created: 2016-12-30T18:11:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-30T19:37:27.000Z (about 8 years ago)
- Last Synced: 2024-11-07T09:47:40.539Z (about 2 months ago)
- Language: C
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ctest
[![Build Status](https://travis-ci.org/pdsouza/ctest.svg?branch=master)](https://travis-ci.org/pdsouza/ctest)Simple testing library for C.
## Examples
simple.c:
```C
#include "ctest.h"static int test_success() {
ASSERT_EQ(0, 0);
}static int test_failure() {
ASSERT_EQ(0, 1);
}int main () {
struct TestRunner r = { 0 };
TestRunner_init(&r);r.add(&r, test_success);
r.add(&r, test_failure);return r.run(&r);
}
```Output:
```
$ ./simple
test_success [ PASS ]
test_failure [ FAIL ] (0 != 1)1 of 2 test cases passed.
```See [examples](examples) for more.