cbase 1.46.11
C/C++ Static Template
Loading...
Searching...
No Matches
main.c
1#include "test_base.c"
2#include "test_harness.h"
3#include "test_log.c"
4#include "test_memory.c"
5#include <stdio.h>
6
7int
8main(void)
9{
10 printf(" ccDB TEST SUITE \n");
11
12 // Run Base Tests
13 RUN_TEST(macros_math);
14 RUN_TEST(macros_linked_list);
15 RUN_TEST(strings_operations);
16 RUN_TEST(logging_system);
17
18 // Run Memory Tests
19 RUN_TEST(arena_allocation);
20
21 printf("\n========================================\n");
22 if (tests_failed == 0) {
23 printf(" SUCCESS! All %d tests passed.\n", tests_run);
24 } else {
25 printf(" FAILURE: %d out of %d tests failed.\n", tests_failed, tests_run);
26 }
27 printf("========================================\n");
28
29 return (tests_failed == 0) ? 0 : 1;
30}
A lightweight, dependency-free unit testing harness.
#define RUN_TEST(name)
Runs a test case and prints its execution status.
static int tests_run
Global counter tracking the total number of tests executed.
static int tests_failed
Global counter tracking the total number of tests that failed.