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>
This commit is contained in:
parent
cfcfc9eca2
commit
f9dfb65b05
1 changed files with 16 additions and 0 deletions
|
@ -747,6 +747,18 @@ sub __eval_option {
|
||||||
# Add space to evaluate the character before $
|
# Add space to evaluate the character before $
|
||||||
$option = " $option";
|
$option = " $option";
|
||||||
my $retval = "";
|
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 =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) {
|
while ($option =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) {
|
||||||
my $start = $1;
|
my $start = $1;
|
||||||
|
@ -760,10 +772,14 @@ sub __eval_option {
|
||||||
# otherwise see if the default OPT (without [$i]) exists.
|
# otherwise see if the default OPT (without [$i]) exists.
|
||||||
|
|
||||||
my $o = "$var\[$i\]";
|
my $o = "$var\[$i\]";
|
||||||
|
my $parento = "$var\[$parent\]";
|
||||||
|
|
||||||
if (defined($opt{$o})) {
|
if (defined($opt{$o})) {
|
||||||
$o = $opt{$o};
|
$o = $opt{$o};
|
||||||
$retval = "$retval$o";
|
$retval = "$retval$o";
|
||||||
|
} elsif ($repeated && defined($opt{$parento})) {
|
||||||
|
$o = $opt{$parento};
|
||||||
|
$retval = "$retval$o";
|
||||||
} elsif (defined($opt{$var})) {
|
} elsif (defined($opt{$var})) {
|
||||||
$o = $opt{$var};
|
$o = $opt{$var};
|
||||||
$retval = "$retval$o";
|
$retval = "$retval$o";
|
||||||
|
|
Loading…
Reference in a new issue