summaryrefslogtreecommitdiff
path: root/docs/application
diff options
context:
space:
mode:
Diffstat (limited to 'docs/application')
-rw-r--r--docs/application/testing.md13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/application/testing.md b/docs/application/testing.md
index bbc7028..5d7b277 100644
--- a/docs/application/testing.md
+++ b/docs/application/testing.md
@@ -19,7 +19,7 @@ FAIL(FAIL_STRING)
```c
typedef struct {
const char *name;
- // TODO ERROR
+ kpl_error error;
} kpl_test;
// TODO STORE ERRORS FOR PRINT AT END
@@ -27,11 +27,14 @@ typedef struct {
#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 */ }; \
+ _TEST_FN(NAME); \
+ [[gnu::constructor]] static void _kpl_test_constructor_##NAME(void) { \
+ kpl_test _test = { .name = #NAME; .error = nullptr }; \
kpl_test_fn_##NAME(&test); \
- / * TODO CHECK FOR ERROR */ \
+ if (_test.error) { \
+ /* TODO STORE ERROR */ \
+ } \
+ /* TODO PRINT STATUS */ \
} \
_TEST_FN(NAME)