1 #include <testing/basic.h>
2 #include <testing/memchk.h>
5 struct test_context* __test_ctx;
8 main(int argc, const char* argv[])
10 __test_ctx = calloc(sizeof(*__test_ctx), 1);
17 "All test done: %d passed, %d failed\n\n",
18 __test_ctx->stats.total_passed,
19 __test_ctx->stats.total_failed
24 printf("\n************\n\n");
26 exit(__test_ctx->stats.total_failed > 0);
30 begin_testcase(const char* name)
32 if (__test_ctx->name) {
33 printf("previous test case: '%s' is still actuive\n", name);
37 __test_ctx->name = name;
38 __test_ctx->stats.countings[0] = 0;
39 __test_ctx->stats.countings[1] = 0;
47 printf("..... passed: %d, failed: %d\n\n",
48 __test_ctx->stats.passed, __test_ctx->stats.failed);
50 __test_ctx->stats.total_passed += __test_ctx->stats.passed;
51 __test_ctx->stats.total_failed += __test_ctx->stats.failed;
52 __test_ctx->name = NULL;