diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-12-22 11:32:52 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-12-22 21:59:36 -0500 |
commit | cad9666980c1c1a76345f36a68e96fda3d78d857 (patch) | |
tree | 4bdf4b26e5769a91807f64a604dbef1782ca96d0 /tools/testing/ktest | |
parent | 2b29b2f8f869847d437b525d4cf027c09dc38286 (diff) |
ktest: Evaluate options before processing them
All options can take variables "${var}". Before doing any processing
or decision making on the content of an option, evaluate it incase
there are variables that may change the outcome.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 59738aa6ca73..04a7bb573daa 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -416,10 +416,12 @@ sub process_variables { | |||
416 | sub set_value { | 416 | sub set_value { |
417 | my ($lvalue, $rvalue, $override, $overrides, $name) = @_; | 417 | my ($lvalue, $rvalue, $override, $overrides, $name) = @_; |
418 | 418 | ||
419 | if ($buildonly && $lvalue =~ /^TEST_TYPE(\[.*\])?$/ && $rvalue ne "build") { | 419 | my $prvalue = process_variables($rvalue); |
420 | |||
421 | if ($buildonly && $lvalue =~ /^TEST_TYPE(\[.*\])?$/ && $prvalue ne "build") { | ||
420 | # Note if a test is something other than build, then we | 422 | # Note if a test is something other than build, then we |
421 | # will need other manditory options. | 423 | # will need other manditory options. |
422 | if ($rvalue ne "install") { | 424 | if ($prvalue ne "install") { |
423 | $buildonly = 0; | 425 | $buildonly = 0; |
424 | } else { | 426 | } else { |
425 | # install still limits some manditory options. | 427 | # install still limits some manditory options. |
@@ -435,13 +437,12 @@ sub set_value { | |||
435 | } | 437 | } |
436 | die "$name: $.: Option $lvalue defined more than once!\n$extra"; | 438 | die "$name: $.: Option $lvalue defined more than once!\n$extra"; |
437 | } | 439 | } |
438 | ${$overrides}{$lvalue} = $rvalue; | 440 | ${$overrides}{$lvalue} = $prvalue; |
439 | } | 441 | } |
440 | if ($rvalue =~ /^\s*$/) { | 442 | if ($rvalue =~ /^\s*$/) { |
441 | delete $opt{$lvalue}; | 443 | delete $opt{$lvalue}; |
442 | } else { | 444 | } else { |
443 | $rvalue = process_variables($rvalue); | 445 | $opt{$lvalue} = $prvalue; |
444 | $opt{$lvalue} = $rvalue; | ||
445 | } | 446 | } |
446 | } | 447 | } |
447 | 448 | ||