summaryrefslogtreecommitdiff
path: root/src/user/app/tests/tests.c
diff options
context:
space:
mode:
authordzwdz2022-10-18 18:39:14 +0200
committerdzwdz2022-10-18 18:39:14 +0200
commit6bb22b0a144646788f8c14bce1bde147693da780 (patch)
tree8c498167dcf9aeeab7552d7780dcf47d233672b6 /src/user/app/tests/tests.c
parentb3f0606f7d206f355647f5c266aadea137e93429 (diff)
user/tests: more info when a test crashes
Diffstat (limited to 'src/user/app/tests/tests.c')
-rw-r--r--src/user/app/tests/tests.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/user/app/tests/tests.c b/src/user/app/tests/tests.c
index 14225ac..e4b4d37 100644
--- a/src/user/app/tests/tests.c
+++ b/src/user/app/tests/tests.c
@@ -2,6 +2,9 @@
#include <camellia/syscalls.h>
#include <unistd.h>
+__attribute__((visibility("hidden")))
+extern char _image_base[];
+
FILE *fail_trig;
void run_test(void (*fn)()) {
@@ -10,7 +13,9 @@ void run_test(void (*fn)()) {
exit(0);
} else {
/* successful tests must return 0 */
- if (_syscall_await() != 0) test_fail();
+ if (_syscall_await() != 0) {
+ test_failf("0x%x, base 0x%x", (void*)fn - (void*)_image_base, _image_base);
+ }
}
}