From 89418faafd87cbbf0b36bc8bf916904a170073f6 Mon Sep 17 00:00:00 2001 From: nodist Date: Fri, 12 Jun 2026 15:22:19 -0400 Subject: use gnu23 --- docs/application/testing.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'docs/application/testing.md') 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 +``` -- cgit v1.2.3