From: Emil Velikov Date: Wed, 13 Nov 2024 12:58:00 +0000 (+0000) Subject: testsuite: run all tests, don't exit on first failure X-Git-Tag: v34~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb575e4c0f797c319a8e6409f8ae07d75d2a7c60;p=thirdparty%2Fkmod.git testsuite: run all tests, don't exit on first failure Instead of exiting on the first failing test execute all tests and report overall failure as needed. This gives us a better overview - which do we have single failure or multiple instances need work - and more consistent results numbers. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/246 Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/testsuite.h b/testsuite/testsuite.h index 59d29c13..adcb0538 100644 --- a/testsuite/testsuite.h +++ b/testsuite/testsuite.h @@ -143,7 +143,7 @@ int test_run(const struct test *t); int main(int argc, char *argv[]) \ { \ const struct test *t; \ - int arg; \ + int arg, ret = EXIT_SUCCESS; \ \ arg = test_init(__start_kmod_tests, __stop_kmod_tests, argc, argv); \ if (arg == 0) \ @@ -163,8 +163,8 @@ int test_run(const struct test *t); \ for (t = __start_kmod_tests; t < __stop_kmod_tests; t++) { \ if (test_run(t) != 0) \ - exit(EXIT_FAILURE); \ + ret = EXIT_FAILURE; \ } \ \ - exit(EXIT_SUCCESS); \ + exit(ret); \ }