Added a README

This commit is contained in:
Adwaith-Rajesh 2025-09-28 17:51:10 +05:30
parent 285c736b6c
commit 0c6f39c956
Signed by: Adwaith-Rajesh
GPG Key ID: 98CC7C030DF895A0

76
README.md Normal file
View File

@ -0,0 +1,76 @@
# test.h
A simple header file to get test statistics.
> Currently under development things might change without notice
## Usage
Here is a simple simple example for `test.h`
```c
// sample_test.c
#include "test.h"
TEST(sample1, {
ASSERT(1 == 1, "");
})
TEST_INIT({})
```
You can compile and rum this test file, and will get an output like this.
```console
=========================================================================
TEST doc.c
test_sample1
(1/1) passed (0) failed
PASSED - (1/1) passed (0) failed
=========================================================================
```
An example with two tests.
```c
#include "test.h"
TEST(sample1, {
ASSERT(1 == 1, "");
})
TEST(sample2, {
ASSERT(1 == 1, "");
ASSERT(1 == 0, "This assertion will fail");
})
TEST_INIT({})
```
```console
=========================================================================
TEST doc.c
test_sample1
(1/1) passed (0) failed
test_sample2
assertion failed (l.no - 9) [1 == 0] - This assertion will fail
(1/2) passed (1) failed
FAILED - (1/2) passed (1) failed
=========================================================================
```
To know about all the macros that you can use, check the [examples](./examples/) folder.
---
If you have any issues or want to discuss, [Join my Discord](https://discord.gg/BxMbWzZe2Z)
## Bye....