diff options
author | Rabin Vincent <rabin@rab.in> | 2011-11-18 06:35:30 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-11-18 11:07:24 -0500 |
commit | f9dfb65b055c56678afa03e13e942761459ea53d (patch) | |
tree | 17f3769ab7942b702ea2e2aed088ca149a5d37d5 /tools/testing/ktest | |
parent | cfcfc9eca2bcbd26a8e206baeb005b055dbf8e37 (diff) |
ktest: Check parent options for iterated tests
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.
Link: http://lkml.kernel.org/r/1321616131-21352-2-git-send-email-rabin@rab.in
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-x | 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 30e2befd6f2a..8b4c2535b266 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -747,6 +747,18 @@ sub __eval_option { | |||
747 | # Add space to evaluate the character before $ | 747 | # Add space to evaluate the character before $ |
748 | $option = " $option"; | 748 | $option = " $option"; |
749 | my $retval = ""; | 749 | my $retval = ""; |
750 | my $repeated = 0; | ||
751 | my $parent = 0; | ||
752 | |||
753 | foreach my $test (keys %repeat_tests) { | ||
754 | if ($i >= $test && | ||
755 | $i < $test + $repeat_tests{$test}) { | ||
756 | |||
757 | $repeated = 1; | ||
758 | $parent = $test; | ||
759 | last; | ||
760 | } | ||
761 | } | ||
750 | 762 | ||
751 | while ($option =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) { | 763 | while ($option =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) { |
752 | my $start = $1; | 764 | my $start = $1; |
@@ -760,10 +772,14 @@ sub __eval_option { | |||
760 | # otherwise see if the default OPT (without [$i]) exists. | 772 | # otherwise see if the default OPT (without [$i]) exists. |
761 | 773 | ||
762 | my $o = "$var\[$i\]"; | 774 | my $o = "$var\[$i\]"; |
775 | my $parento = "$var\[$parent\]"; | ||
763 | 776 | ||
764 | if (defined($opt{$o})) { | 777 | if (defined($opt{$o})) { |
765 | $o = $opt{$o}; | 778 | $o = $opt{$o}; |
766 | $retval = "$retval$o"; | 779 | $retval = "$retval$o"; |
780 | } elsif ($repeated && defined($opt{$parento})) { | ||
781 | $o = $opt{$parento}; | ||
782 | $retval = "$retval$o"; | ||
767 | } elsif (defined($opt{$var})) { | 783 | } elsif (defined($opt{$var})) { |
768 | $o = $opt{$var}; | 784 | $o = $opt{$var}; |
769 | $retval = "$retval$o"; | 785 | $retval = "$retval$o"; |