Skip to content

Commit 999647d

Browse files
committed
Readme update
1 parent ba86059 commit 999647d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Readme.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,23 @@ Different examples are placed in the [example](./example) folder.
4747

4848
### Test macros
4949

50-
`YT_TEST` & `YT_TESTP` macros are used to define a single non-parameterised test and a parameterised
50+
51+
`YT_TEST` & `YT_TESTP` macros are used to create a non-parameterised test and a parameterised
5152
test respectively. Tests functions are identified by their name, that is the 2nd argument in these
5253
macros. These tests functions need to be called in the `main()` function explicitly. Arguments for
5354
parameterised tests are given when calling them in the `main()`, non-parameterised tests do not take
5455
any argument.
5556

5657
Each test function must end with `YT_END()` macro. If omitted will result in compilation errors.
5758

59+
| Macro name | Purpose |
60+
|--------------------------------|-------------------------------------------------------------------------------------------------------------------------|
61+
| `YT_TEST(g, tn)` | Creates a new non-parameterised test `tn` under group `g`. Group name is not yet used for any purpose. |
62+
| `YT_TESTP(g, tn, t1, t2, ...)` | Creates a new parameterised test `tn` under group `g`. `t1`, `t2` etc are types of parameters to be passed to the test. |
63+
| `YT_END()` | Ends a test function. It must exist at the very end of each test function. |
64+
| `YT_INIT()` | Initializes yukti test internals. Must be called from `main` before test functions are run. |
65+
| `YT_RETURN_WITH_REPORT()` | Returns from `main` after printing a summary. |
66+
5867
See [Parameterised test](./example/add_parameterised_test.c) example
5968

6069
### Assertion macros
@@ -92,6 +101,7 @@ in what order and which what parameters.
92101
| `YT_MUST_CALL_ANY_ORDER(f, ...)` | Function `f` is called with the given arguments at least once in no particular order |
93102
| `YT_MUST_CALL_ANY_ORDER_ATLEAST_TIMES(n, f, ...)` | Function `f` is called with the given arguments at least `n` times in no particular order |
94103
| `YT_MUST_NEVER_CALL(f, ...)` | Function `f` with the given arguments is never called |
104+
| `YT_IN_SEQUENCE(n)` | Repeats expectations `n` number of times. Used to put expectations for a loop. |
95105

96106
See these examples
97107
* [printer_fail](./example/sensor_test.c) example

0 commit comments

Comments
 (0)