lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] selftests/kcmp: exit with non-zero code in a fail case
From
Date
On Fri, 2015-03-13 at 12:27 +0300, Andrey Vagin wrote:
> diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
> index 572c888..a0ec8b8 100644
> --- a/tools/testing/selftests/kselftest.h
> +++ b/tools/testing/selftests/kselftest.h
> @@ -58,5 +58,17 @@ static inline int ksft_exit_skip(void)
> {
> exit(4);
> }
> +static inline int ksft_exit(void)
> +{
> + if (ksft_cnt.ksft_fail)
> + return ksft_exit_fail();
> + if (ksft_cnt.ksft_xpass)
> + return ksft_exit_xpass();
> + if (ksft_cnt.ksft_xskip)
> + return ksft_exit_skip();
> + if (ksft_cnt.ksft_xfail)
> + return ksft_exit_xfail();
> + ksft_exit_pass();
> +}

This function claims to return 'int', but doesn't. So do all the others.

It could be as simple as:

static inline void ksft_exit(void)
{
if (ksft_cnt.ksft_fail)
exit(1);

if (ksft_cnt.ksft_xpass)
exit(3);

if (ksft_cnt.ksft_xskip)
exit(4);

if (ksft_cnt.ksft_xfail)
exit(2);

exit(0);
}

cheers





\
 
 \ /
  Last update: 2015-03-13 11:41    [W:0.054 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site