diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-06-12 15:26:52 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-06-12 15:26:52 -0400 |
| commit | 59e9416150b9f0ac01b57e7fe30c893f247bc8f6 (patch) | |
| tree | 2e2f2a5a29540f988016ef0aef71a2a2ed521f5f /docs | |
| parent | 89418faafd87cbbf0b36bc8bf916904a170073f6 (diff) | |
fix testing macro
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/application/testing.md | 13 |
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) |
