summaryrefslogtreecommitdiff
path: root/docs/application/testing.md
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-06-12 15:22:19 -0400
committernodist <kevin.comas.git@gmail.com>2026-06-12 15:22:19 -0400
commit89418faafd87cbbf0b36bc8bf916904a170073f6 (patch)
treeea5b619a973ad83715de82a432565fba988a535f /docs/application/testing.md
parent20a19f433956f063d8048f032aaf5dcce1d61e7c (diff)
use gnu23
Diffstat (limited to 'docs/application/testing.md')
-rw-r--r--docs/application/testing.md28
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
+```