diff options
author | Petr Mladek <pmladek@suse.com> | 2021-02-22 13:43:26 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2021-02-22 13:43:26 +0100 |
commit | 2a8c3a6410f042e89e36df20b465845852aa3d9f (patch) | |
tree | 19e545ea1afa98744817d63426e7217e03322eea /tools | |
parent | 8a8109f303e25a27f92c1d8edd67d7cbbc60a4eb (diff) | |
parent | 5ead723a20e0447bc7db33dc3070b420e5f80aa6 (diff) | |
download | linux-2a8c3a6410f042e89e36df20b465845852aa3d9f.tar.bz2 |
Merge branch 'for-5.12-no_hash_pointers' into for-linus
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/kselftest_module.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/testing/selftests/kselftest_module.h b/tools/testing/selftests/kselftest_module.h index e8eafaf0941a..e2ea41de3f35 100644 --- a/tools/testing/selftests/kselftest_module.h +++ b/tools/testing/selftests/kselftest_module.h @@ -11,7 +11,8 @@ #define KSTM_MODULE_GLOBALS() \ static unsigned int total_tests __initdata; \ -static unsigned int failed_tests __initdata +static unsigned int failed_tests __initdata; \ +static unsigned int skipped_tests __initdata #define KSTM_CHECK_ZERO(x) do { \ total_tests++; \ @@ -21,11 +22,16 @@ static unsigned int failed_tests __initdata } \ } while (0) -static inline int kstm_report(unsigned int total_tests, unsigned int failed_tests) +static inline int kstm_report(unsigned int total_tests, unsigned int failed_tests, + unsigned int skipped_tests) { - if (failed_tests == 0) - pr_info("all %u tests passed\n", total_tests); - else + if (failed_tests == 0) { + if (skipped_tests) { + pr_info("skipped %u tests\n", skipped_tests); + pr_info("remaining %u tests passed\n", total_tests); + } else + pr_info("all %u tests passed\n", total_tests); + } else pr_warn("failed %u out of %u tests\n", failed_tests, total_tests); return failed_tests ? -EINVAL : 0; @@ -36,7 +42,7 @@ static int __init __module##_init(void) \ { \ pr_info("loaded.\n"); \ selftest(); \ - return kstm_report(total_tests, failed_tests); \ + return kstm_report(total_tests, failed_tests, skipped_tests); \ } \ static void __exit __module##_exit(void) \ { \ |