Skip to content

Commit 9d42a4d

Browse files
Vasily Gorbikhcahca
authored andcommitted
s390/test_unwind: add WARN if tests failed
Trigger a warning if any of unwinder tests fail. This should help to prevent quiet ignoring of test results when panic_on_warn is enabled. Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent f169f42 commit 9d42a4d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

arch/s390/lib/test_unwind.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,18 @@ static int test_unwind_flags(int flags)
296296

297297
static int test_unwind_init(void)
298298
{
299-
int ret = 0;
299+
int failed = 0;
300+
int total = 0;
300301

301302
#define TEST(flags) \
302303
do { \
303304
pr_info("[ RUN ] " #flags "\n"); \
305+
total++; \
304306
if (!test_unwind_flags((flags))) { \
305307
pr_info("[ OK ] " #flags "\n"); \
306308
} else { \
307309
pr_err("[ FAILED ] " #flags "\n"); \
308-
ret = -EINVAL; \
310+
failed++; \
309311
} \
310312
} while (0)
311313

@@ -336,7 +338,8 @@ do { \
336338
#endif
337339
#undef TEST
338340

339-
return ret;
341+
WARN(failed, "%d of %d unwinder tests failed", failed, total);
342+
return failed ? -EINVAL : 0;
340343
}
341344

342345
static void test_unwind_exit(void)

0 commit comments

Comments
 (0)