https://github.com/bakerface/jasmine
A port of the Jasmine test framework to ANSI C
https://github.com/bakerface/jasmine
Last synced: 9 months ago
JSON representation
A port of the Jasmine test framework to ANSI C
- Host: GitHub
- URL: https://github.com/bakerface/jasmine
- Owner: bakerface
- Created: 2013-05-28T11:12:28.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2014-12-19T17:43:54.000Z (over 11 years ago)
- Last Synced: 2025-07-02T14:06:55.315Z (10 months ago)
- Language: C
- Size: 168 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jasmine
A port of the Jasmine test framework to ANSI C.
This test framework is intended to be a minimalistic, bare-bones framework.
In fact, the framework only consists of a single header file that contains a few macros.
A simple example for how to use the framework is below.
~~~ c
#include "jasmine.h"
int main(void) {
describe("a test") {
int i;
/* optional: called before each 'it' */
before {
i = 0;
}
/* optional: called after each 'it' */
after {
i++;
}
it("should be able to pass") {
expect(i == 0);
}
it("should be able to fail") {
expect(i == 1);
}
it("should be able to ignore") {
}
}
return 0;
}
~~~
Running the example will output each test with a pass, fail, or ignore.
```
a test
[+] should be able to pass
[-] should be able to fail, expected: i == 1
[ ] should be able to ignore
```