diff options
Diffstat (limited to 'test_harness')
-rw-r--r-- | test_harness/fake_env.c | 1 | ||||
-rw-r--r-- | test_harness/test_harness.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test_harness/fake_env.c b/test_harness/fake_env.c index 7ac0d9b..fbe85ce 100644 --- a/test_harness/fake_env.c +++ b/test_harness/fake_env.c @@ -2,6 +2,7 @@ #include <assert.h> #include <stdlib.h> +#include <stdio.h> struct fakeenv_memseg { const char* name; diff --git a/test_harness/test_harness.c b/test_harness/test_harness.c index fda623f..2bd6194 100644 --- a/test_harness/test_harness.c +++ b/test_harness/test_harness.c @@ -7,6 +7,7 @@ #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> +#include <stdarg.h> #include "fake_env.h" @@ -117,6 +118,17 @@ static void nofork_reset() memcpy(&__data_start, saved_data, saved_data_size); } +void panic(const char* fmt, ...) +{ + va_list l; + va_start(l, fmt); + + fprintf(stderr, "Kernel panic detected."); + vfprintf(stderr, fmt, l); + + ASSERT_TRUE(0); +} + static int execute_test(test_t* test) { char fullname[512]; |