public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Rabin Vincent <rabin@rab.in>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] ktest: check parent options for a repeated test
Date: Fri, 18 Nov 2011 10:38:57 -0500	[thread overview]
Message-ID: <1321630737.3533.49.camel@frodo> (raw)
In-Reply-To: <1321616131-21352-2-git-send-email-rabin@rab.in>

On Fri, 2011-11-18 at 17:05 +0530, Rabin Vincent wrote:
> Let's say we have "OUTPUT_DIR = build/${TEST_NAME}", and we're iterating
> a test.  In the second iteration of a test, the TEST_NAME of the test
> we're repeating is not used.  Instead, ${TEST_NAME} appears literally:
> 
>    touch /home/rabin/kernel/test/build/${TEST_NAME}/.config ... SUCCESS
> 
> Fix this by making __eval_option() check the parent test options
> for a repeated test.

Nice catch! I missed this. I'll give it a test run, and if all is fine,
I'll pull it in. Thanks.

This looks like a bug fix, so I may even push this to Linus now.

Thanks!

-- Steve

> Signed-off-by: Rabin Vincent <rabin@rab.in>
> ---
>  tools/testing/ktest/ktest.pl |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
> index 3185e0a..e93c21c 100755
> --- a/tools/testing/ktest/ktest.pl
> +++ b/tools/testing/ktest/ktest.pl
> @@ -748,6 +748,18 @@ sub __eval_option {
>      # Add space to evaluate the character before $
>      $option = " $option";
>      my $retval = "";
> +    my $repeated = 0;
> +    my $parent = 0;
> +
> +    foreach my $test (keys %repeat_tests) {
> +	if ($i >= $test &&
> +	    $i < $test + $repeat_tests{$test}) {
> +
> +	    $repeated = 1;
> +	    $parent = $test;
> +	    last;
> +	}
> +    }
>  
>      while ($option =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) {
>  	my $start = $1;
> @@ -761,10 +773,14 @@ sub __eval_option {
>  	# otherwise see if the default OPT (without [$i]) exists.
>  
>  	my $o = "$var\[$i\]";
> +	my $parento = "$var\[$parent\]";
>  
>  	if (defined($opt{$o})) {
>  	    $o = $opt{$o};
>  	    $retval = "$retval$o";
> +	} elsif ($repeated && defined($opt{$parento})) {
> +	    $o = $opt{$parento};
> +	    $retval = "$retval$o";
>  	} elsif (defined($opt{$var})) {
>  	    $o = $opt{$var};
>  	    $retval = "$retval$o";



  reply	other threads:[~2011-11-18 15:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 11:35 [PATCH 1/3] ktest: save test output Rabin Vincent
2011-11-18 11:35 ` [PATCH 2/3] ktest: check parent options for a repeated test Rabin Vincent
2011-11-18 15:38   ` Steven Rostedt [this message]
2011-11-18 11:35 ` [PATCH 3/3] ktest: allow success logs to be stored Rabin Vincent
2011-11-18 15:40   ` Steven Rostedt
2011-11-18 17:06   ` Steven Rostedt
2011-11-18 15:36 ` [PATCH 1/3] ktest: save test output Steven Rostedt

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=1321630737.3533.49.camel@frodo \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin@rab.in \
    /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