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, %d skipped\n\n",
18 __test_ctx->stats.total_passed,
19 __test_ctx->stats.total_failed,
20 __test_ctx->stats.total_skipped
25 printf("\n************\n\n");
27 exit(__test_ctx->stats.total_failed > 0);
31 begin_testcase(const char* name)
33 if (__test_ctx->name) {
34 printf("previous test case: '%s' is still actuive\n", name);
38 __test_ctx->name = name;
39 __test_ctx->stats.countings[0] = 0;
40 __test_ctx->stats.countings[1] = 0;
41 __test_ctx->stats.countings[2] = 0;
49 printf("..... passed: %d, failed: %d, %d skipped\n\n",
50 __test_ctx->stats.passed,
51 __test_ctx->stats.failed,
52 __test_ctx->stats.skipped);
54 __test_ctx->stats.total_passed += __test_ctx->stats.passed;
55 __test_ctx->stats.total_failed += __test_ctx->stats.failed;
56 __test_ctx->stats.total_skipped += __test_ctx->stats.skipped;
57 __test_ctx->name = NULL;