]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: run all tests, don't exit on first failure
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 13 Nov 2024 12:58:00 +0000 (12:58 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 21 Nov 2024 04:27:37 +0000 (22:27 -0600)
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 <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/246
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/testsuite.h

index 59d29c132882283bb3daf47d8586f7bf621a4590..adcb0538c859470da50dfb01eddc179ba57d02c6 100644 (file)
@@ -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);                                                               \
        }