Skip to content
Snippets Groups Projects
Commit 44d95271 authored by Avi Kivity's avatar Avi Kivity
Browse files

testrunner: report completion status when all tests end

parent 5c5b95fe
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
extern void dlclose_by_path_np(const char* filename); extern void dlclose_by_path_np(const char* filename);
static unsigned nr_tests, nr_failures;
void load_test(char *path, char *argv0) void load_test(char *path, char *argv0)
{ {
void *handle; void *handle;
...@@ -20,11 +22,14 @@ void load_test(char *path, char *argv0) ...@@ -20,11 +22,14 @@ void load_test(char *path, char *argv0)
handle = dlopen(path, 0); handle = dlopen(path, 0);
test_main = dlsym(handle, "main"); test_main = dlsym(handle, "main");
++nr_tests;
ret = test_main(1, &argv0); ret = test_main(1, &argv0);
if (ret) if (ret) {
++nr_failures;
printf("failed.\n"); printf("failed.\n");
else } else {
printf("ok.\n"); printf("ok.\n");
}
dlclose_by_path_np(path); dlclose_by_path_np(path);
} }
...@@ -64,6 +69,7 @@ int osv_main(int argc, char **argv) ...@@ -64,6 +69,7 @@ int osv_main(int argc, char **argv)
perror("failed to close testdir"); perror("failed to close testdir");
return EXIT_FAILURE; return EXIT_FAILURE;
} }
printf("All tests complete - %d/%d failures", nr_failures, nr_tests);
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment