Simplify test framework and improve test script

This commit is contained in:
2024-10-24 15:59:56 +01:00
parent 29deffdce9
commit 810feee55e
3 changed files with 13 additions and 40 deletions

View File

@@ -2,20 +2,9 @@
#include <stdio.h>
test_run_t test_run;
int fail_count;
void testing_fail_msg(const char *func, const char *file, int line)
{
printf("%s: failed assert @ %s:%d\n", func, file, line);
}
void testing_end_msg(void)
{
const double success_rate
= 1 - (double)test_run.fail_count / (double)test_run.test_count;
printf(
"%d tests ran (%d assertions), "
"%0.2f%% successful (%d failures)\n",
test_run.test_count, test_run.assertion_count, 100 * success_rate,
test_run.fail_count);
}