mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kselftest@vger.kernel.org, shuah@kernel.org,
	linux-kernel@vger.kernel.org,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Rajvi Jingar <rajvi.jingar@intel.com>
Subject: Re: [PATCH v2] selftests/ftrace: Introduce exit_pass and exit_fail
Date: Sat, 4 Nov 2017 05:21:25 +0900	[thread overview]
Message-ID: <20171104052125.ef2662cf9366b3e131649281@kernel.org> (raw)
In-Reply-To: <20171103161109.7848f3c3@vmware.local.home>

On Fri, 3 Nov 2017 16:11:09 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Sat,  4 Nov 2017 04:38:41 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > --- a/tools/testing/selftests/ftrace/ftracetest
> > +++ b/tools/testing/selftests/ftrace/ftracetest
> > @@ -222,7 +222,14 @@ SIG_RESULT=
> >  SIG_BASE=36	# Use realtime signals
> >  SIG_PID=$$
> >  
> > +exit_pass () {
> > +  exit 0
> > +}
> > +
> >  SIG_FAIL=$((SIG_BASE + FAIL))
> > +exit_fail () {
> > +  exit 1
> 
> Sorry, I should have caught this before. But can you use $PASS and
> $FAIL in the functions? In case we want to override them in the future?

No, as I've said, those are ftracetest internal vars :(

And also you can not override it because each testcase script can
exit with error code of executed command in failure case. IOW,
the error code propagates caller's exit code. So we can not
controll it. This means you can just expect the exit code
0 or !0.

Thank you,

> 
> exit_pass() {
> 	exit $PASS
> }
> 
> exit_fail() {
> 	exit $FAIL
> }
> 
> -- Steve


-- 
Masami Hiramatsu <mhiramat@kernel.org>

      reply	other threads:[~2017-11-03 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 19:38 Masami Hiramatsu
2017-11-03 20:11 ` Steven Rostedt
2017-11-03 20:21   ` Masami Hiramatsu [this message]

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=20171104052125.ef2662cf9366b3e131649281@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rajvi.jingar@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=tom.zanussi@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome