lkml.org 
[lkml]   [2017]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] selftests/ftrace: Introduce exit_pass and exit_fail
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>

\
 
 \ /
  Last update: 2017-11-03 21:22    [W:0.029 / U:1.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site