[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140827155456.GH10937@hercules>
Date: Wed, 27 Aug 2014 16:54:56 +0100
From: Luis Henriques <luis.henriques@...onical.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Shuah Khan <shuah.kh@...sung.com>,
Tom Zanussi <tom.zanussi@...ux.intel.com>,
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>,
Oleg Nesterov <oleg@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Namhyung Kim <namhyung@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2 1/4] ftracetest: Initial commit for ftracetest
Hi,
Not really a complete review, but just 2 comments on this script:
On Tue, Aug 26, 2014 at 11:15:18AM +0000, Masami Hiramatsu wrote:
...
> +prlog() { # messages
> + echo $@ | tee -a $LOG_FILE
> +}
> +catlog() { #file
> + cat $1 | tee -a $LOG_FILE
> +}
> +
> +# Testcase management
> +PASSED_CASES=
> +FAILED_CASES=
> +CASENO=0
> +testcase() { # testfile
> + CASENO=$((CASENO+1))
> + prlog -n "[$CASENO]"`grep "^#[ \t]*description:" $1 | cut -f2 -d:`
> +}
> +failed() {
> + prlog -e "\t[FAIL]"
> + FAILED_CASES="$FAILED_CASES $CASENO"
> +}
> +passed() {
> + prlog -e "\t[PASS]"
> + PASSED_CASES="$PASSED_CASES $CASENO"
> +}
What I see here is a '-e' being echo'ed and not really a '-e' switch
being used to 'echo'. (Also, I'm not sure if this is a standard
switch...).
This applies to all the other 'prlog -e'.
> +
> +
> +# Run one test case
> +run_test() { # testfile
> + local testname=`basename $1`
> + local testlog=`mktemp --tmpdir=$LOG_DIR ${testname}-XXXXXX.log`
> + testcase $1
> + echo "execute: "$1 > $testlog
> + (cd $TRACING_DIR; set -x ; source $t) >> $testlog 2>&1
> + ret=$?
I believe the usage of 'source' is a bashism, and '.' should be used
instead. In my environment, 'source' results in ret=127. Replacing
it by '.' fixes it.
Cheers,
--
Luís
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists