All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: Shuah Khan <shuahkh@osg.samsung.com>
Cc: akpm@linux-foundation.org, gregkh@linuxfoundation.org,
	colin.king@canonical.com, ebiederm@xmission.com,
	serge.hallyn@ubuntu.com, thierry@linux.vnet.ibm.com,
	felipensp@gmail.com, linux-api@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] selftests: add header file for test exit code defines
Date: Tue, 16 Sep 2014 18:04:01 +0200	[thread overview]
Message-ID: <1410883441.4630.9.camel@linux-t7sj.site> (raw)
In-Reply-To: <1410820442-8774-2-git-send-email-shuahkh@osg.samsung.com>

On Mon, 2014-09-15 at 16:33 -0600, Shuah Khan wrote:
> Add a new header file that defines exit codes for individual
> tests to use to communicate test results. These defines are
> intended to provide a common and uniform way for selftests
> to report results. pass/fail/xfail/xpass/skip/unsupported
> are defined.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  tools/testing/selftests/kselftest.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 tools/testing/selftests/kselftest.h
> 
> diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
> new file mode 100644
> index 0000000..1b1c9cb
> --- /dev/null
> +++ b/tools/testing/selftests/kselftest.h
> @@ -0,0 +1,20 @@
> +/*
> + * kselftest.h - kselftest framework return codes to include from
> + *		 selftests.
> + *
> + * Copyright (c) 2014 Shuah Khan <shuahkh@osg.samsung.com>
> + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
> + *
> + * This file is released under the GPLv2.
> + */
> +#ifndef __KSELFTEST_H
> +#define __KSELFTEST_H
> +
> +#define	EXIT_PASS		0
> +#define	EXIT_FAIL		1
> +#define	EXIT_XFAIL		2
> +#define	EXIT_XPASS		3
> +#define	EXIT_SKIP		4
> +#define	EXIT_UNSUPPORTED	EXIT_SKIP

Looks to me like a potential name clashes here.

What's the difference between XFAIL/XPASS and regular FAIL/PASS (I don't
see the former used in patchset either, only PASS/FAIL)? What's the
purpose of EXIT_SKIP? I think overall these should be commented.

Also, in the bigger picture, I'm guessing you have a reason for not
recycling errno and inventing your own exit codes... How do you plan on
using these? In addition I'm seeing things like:

-       exit(EXIT_FAILURE);
+       exit(EXIT_FAIL);

which isn't a very good idea in general.


WARNING: multiple messages have this Message-ID (diff)
From: Davidlohr Bueso <dave-h16yJtLeMjHk1uMJSBkQmQ@public.gmane.org>
To: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org,
	serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org,
	thierry-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org,
	felipensp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/7] selftests: add header file for test exit code defines
Date: Tue, 16 Sep 2014 18:04:01 +0200	[thread overview]
Message-ID: <1410883441.4630.9.camel@linux-t7sj.site> (raw)
In-Reply-To: <1410820442-8774-2-git-send-email-shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>

On Mon, 2014-09-15 at 16:33 -0600, Shuah Khan wrote:
> Add a new header file that defines exit codes for individual
> tests to use to communicate test results. These defines are
> intended to provide a common and uniform way for selftests
> to report results. pass/fail/xfail/xpass/skip/unsupported
> are defined.
> 
> Signed-off-by: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> ---
>  tools/testing/selftests/kselftest.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 tools/testing/selftests/kselftest.h
> 
> diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
> new file mode 100644
> index 0000000..1b1c9cb
> --- /dev/null
> +++ b/tools/testing/selftests/kselftest.h
> @@ -0,0 +1,20 @@
> +/*
> + * kselftest.h - kselftest framework return codes to include from
> + *		 selftests.
> + *
> + * Copyright (c) 2014 Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
> + *
> + * This file is released under the GPLv2.
> + */
> +#ifndef __KSELFTEST_H
> +#define __KSELFTEST_H
> +
> +#define	EXIT_PASS		0
> +#define	EXIT_FAIL		1
> +#define	EXIT_XFAIL		2
> +#define	EXIT_XPASS		3
> +#define	EXIT_SKIP		4
> +#define	EXIT_UNSUPPORTED	EXIT_SKIP

Looks to me like a potential name clashes here.

What's the difference between XFAIL/XPASS and regular FAIL/PASS (I don't
see the former used in patchset either, only PASS/FAIL)? What's the
purpose of EXIT_SKIP? I think overall these should be commented.

Also, in the bigger picture, I'm guessing you have a reason for not
recycling errno and inventing your own exit codes... How do you plan on
using these? In addition I'm seeing things like:

-       exit(EXIT_FAILURE);
+       exit(EXIT_FAIL);

which isn't a very good idea in general.

  reply	other threads:[~2014-09-16  7:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 22:33 [PATCH 0/7] kselftest new exit codes and test changes to use them Shuah Khan
2014-09-15 22:33 ` [PATCH 1/7] selftests: add header file for test exit code defines Shuah Khan
2014-09-16 16:04   ` Davidlohr Bueso [this message]
2014-09-16 16:04     ` Davidlohr Bueso
2014-09-16 17:31     ` Shuah Khan
2014-09-16 17:31       ` Shuah Khan
2014-09-16 17:40       ` Andy Lutomirski
2014-09-16 17:40         ` Andy Lutomirski
2014-09-16 17:47         ` Shuah Khan
2014-09-16 17:47           ` Shuah Khan
2014-09-15 22:33 ` [PATCH 2/7] selftests/breakpoints: change breakpoints test to use kselftest exit codes Shuah Khan
2014-09-15 22:33 ` [PATCH 3/7] selftests/ipc: change ipc " Shuah Khan
2014-09-15 22:33   ` Shuah Khan
2014-09-15 22:33 ` [PATCH 4/7] selftests/kcmp: change kcmp " Shuah Khan
2014-09-15 22:34 ` [PATCH 5/7] selftests/mount: change mount " Shuah Khan
2014-09-15 22:34 ` [PATCH 6/7] selftests/ptrace: change ptrace " Shuah Khan
2014-09-15 22:34 ` [PATCH 7/7] selftests/timers: change timers " Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410883441.4630.9.camel@linux-t7sj.site \
    --to=dave@stgolabs.net \
    --cc=akpm@linux-foundation.org \
    --cc=colin.king@canonical.com \
    --cc=ebiederm@xmission.com \
    --cc=felipensp@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=serge.hallyn@ubuntu.com \
    --cc=shuahkh@osg.samsung.com \
    --cc=thierry@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.