diff --git a/checker/2-uart-checker/_test/test.c b/checker/2-uart-checker/_test/test.c index 7c5cef14c34ab8ac94357b8bd885f6559730a4d8..6e87f7055daac8f8750c8a7c301bcf8c4f4d148e 100644 --- a/checker/2-uart-checker/_test/test.c +++ b/checker/2-uart-checker/_test/test.c @@ -43,12 +43,13 @@ exit(EXIT_FAILURE); \ } while (0) + #define test(d, v, e, p) do_test((d), (v), (e), 0, 0, (p)) #define not_test(d, v, e, p) do_test((d), (v), (e), 1, 0, (p)) #define fatal_test(d, v, e,p) do_test((d), (v), (e), 0, 1, (p)) #define GENERIC_TEST_TIMEOUT 3 - +const int total = 92; void sig_handler(int signum) { fprintf(stderr, "Child process pid=%d of checker (that issues read/write syscalls to the driver) got killed after TIMEOUT=%ds\n", getpid(), GENERIC_TEST_TIMEOUT); @@ -68,23 +69,26 @@ do_test(const char *description, int value, int expected, int negate, int fatal, num_chars = printf("%s", description); for (; num_chars < PAD_CHARS - strlen("passed"); num_chars++) putchar('.'); - fflush(stdout); if (!negate) { if (value == expected) { - printf("passed %.1f\n", points); + printf("passed [%.1f/%d]\n", points, total); + fflush(stdout); return 0; } else { - printf("failed 0\n"); + printf("failed [0/%d]\n", total); + fflush(stdout); if (fatal) exit(EXIT_FAILURE); } } else { if (value != expected) { - printf("passed %.1f\n", points); + printf("passed [%.1f/%d]\n", points, total); + fflush(stdout); return 0; } else { - printf("failed 0\n"); + printf("failed [0/%d]\n", total); + fflush(stdout); if (fatal) exit(EXIT_FAILURE); } @@ -563,7 +567,6 @@ int main(void) { float num_passed = 0; - const int total = 92; signal(SIGTERM, sig_handler); srand(time(NULL));