diff options
Diffstat (limited to 'docs/application/testing.md')
| -rw-r--r-- | docs/application/testing.md | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/docs/application/testing.md b/docs/application/testing.md index 8657bf0..bbc7028 100644 --- a/docs/application/testing.md +++ b/docs/application/testing.md @@ -9,9 +9,33 @@ TEST(NAME) { // TEST BODY } -ASSERT(CONDITION) +ASSERT(CONDITION, FAIL_STRING) -FAIL() +FAIL(FAIL_STRING) ``` ## Object Definitions + +```c +typedef struct { + const char *name; + // TODO ERROR +} kpl_test; + +// TODO STORE ERRORS FOR PRINT AT END + +#define _TEST_FN(NAME) static void kpl_test_fn_##NAME([[gnu::constructor]] kpl_test *_test) + +#define TEST(NAME) \ + [[gnu::constructor]] _TEST_FN(NAME); + static void _kpl_test_constructor_##NAME(void) { \ + kpl_test _test = { .name = #NAME; /* TODO ERROR */ }; \ + kpl_test_fn_##NAME(&test); \ + / * TODO CHECK FOR ERROR */ \ + } \ + _TEST_FN(NAME) + +// TODO ASSERT + +// TODO FAIL +``` |
