aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-17 14:49:58 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-18 18:39:00 +0200
commit425087774df5ed003b2d65e8e696ebbfb590f367 (patch)
treec304b2aa4d34835c87cc9545cef53d0e1de9e898
parentblake2s: spacing (diff)
downloadwireguard-monolithic-historical-425087774df5ed003b2d65e8e696ebbfb590f367.tar.xz
wireguard-monolithic-historical-425087774df5ed003b2d65e8e696ebbfb590f367.zip
qemu: show signal when failing
-rw-r--r--src/tests/qemu/init.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/tests/qemu/init.c b/src/tests/qemu/init.c
index 0c3f843..51e5dde 100644
--- a/src/tests/qemu/init.c
+++ b/src/tests/qemu/init.c
@@ -158,7 +158,7 @@ static void kmod_selftests(void)
}
fclose(file);
if (!success) {
- puts("\x1b[31m\x1b[1m[-] Tests failed! :-(\x1b[0m");
+ puts("\x1b[31m\x1b[1m[-] Tests failed! \u2639\x1b[0m");
poweroff();
}
}
@@ -203,8 +203,19 @@ static void launch_tests(void)
if (write(fd, "success\n", 8) != 8)
panic("write(success_dev)");
close(fd);
- } else
- puts("\x1b[31m\x1b[1m[-] Tests failed! :-(\x1b[0m");
+ } else {
+ const char *why = "unknown cause";
+ int what = -1;
+
+ if (WIFEXITED(status)) {
+ why = "exit code";
+ what = WEXITSTATUS(status);
+ } else if (WIFSIGNALED(status)) {
+ why = "signal";
+ what = WTERMSIG(status);
+ }
+ printf("\x1b[31m\x1b[1m[-] Tests failed with %s %d! \u2639\x1b[0m\n", why, what);
+ }
}
static void ensure_console(void)