diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-10-07 16:44:38 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-10-07 16:44:38 -0400 |
| commit | cbf7d62712c44d2b3bbb066e6840041b89cfb6d9 (patch) | |
| tree | b45f9328250c8f0e1d5037a471f76ee938edbbc7 /test/test.c | |
| parent | 7bd050ccf74222e1b659f2fd6826a86e6afbcc94 (diff) | |
tree impl
Diffstat (limited to 'test/test.c')
| -rw-r--r-- | test/test.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/test.c b/test/test.c index 6cede92..02a8730 100644 --- a/test/test.c +++ b/test/test.c @@ -67,7 +67,22 @@ static int32_t kpl_test_run_all(void) { int32_t main(int32_t argc, char *argv[]) { if (argc < 2) return kpl_test_run_all(); - // TODO run by name + kpl_test find = {}; + for (int32_t arg_index = 1; arg_index < argc; arg_index++) { + find.name = argv[arg_index]; + kpl_test *found = kpl_tree_find(&test_tree, &find); + if (!found) { + printf(KPL_COLOR2(BOLD, RED) "TEST: " KPL_COLOR(RESET) KPL_COLOR2(BOLD, WHITE) "%s " KPL_COLOR(RESET) + KPL_COLOR2(BOLD, RED) "NOT FOUND\n" KPL_COLOR(RESET), find.name); + return KPL_EXIT_CODE_ERROR; + } + kpl_test *duplicates = found->tree_duplicates; + while (duplicates) { + kpl_test_run_one(duplicates); + duplicates = duplicates->tree_duplicates; + } + kpl_test_run_one(found); + } return kpl_test_report_error(); } |
