1 #include <testing/basic.h>
4 struct test_context* __test_ctx;
7 main(int argc, const char* argv[])
9 __test_ctx = calloc(sizeof(*__test_ctx), 1);
16 "All test done: %d passed, %d failed\n",
17 __test_ctx->stats.total_passed,
18 __test_ctx->stats.total_failed
20 printf("************\n\n");
22 exit(__test_ctx->stats.total_failed > 0);
26 begin_testcase(const char* name)
28 if (__test_ctx->name) {
29 printf("previous test case: '%s' is still actuive\n", name);
33 __test_ctx->name = name;
34 __test_ctx->stats.countings[0] = 0;
35 __test_ctx->stats.countings[1] = 0;
43 printf("..... passed: %d, failed: %d\n\n",
44 __test_ctx->stats.passed, __test_ctx->stats.failed);
46 __test_ctx->stats.total_passed += __test_ctx->stats.passed;
47 __test_ctx->stats.total_failed += __test_ctx->stats.failed;
48 __test_ctx->name = NULL;