aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest/ktest.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/ktest/ktest.pl')
-rwxr-xr-xtools/testing/ktest/ktest.pl16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index cc9925a68f2a..3d19ee445249 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1074,7 +1074,7 @@ sub read_config {
1074} 1074}
1075 1075
1076sub __eval_option { 1076sub __eval_option {
1077 my ($option, $i) = @_; 1077 my ($name, $option, $i) = @_;
1078 1078
1079 # Add space to evaluate the character before $ 1079 # Add space to evaluate the character before $
1080 $option = " $option"; 1080 $option = " $option";
@@ -1106,7 +1106,11 @@ sub __eval_option {
1106 my $o = "$var\[$i\]"; 1106 my $o = "$var\[$i\]";
1107 my $parento = "$var\[$parent\]"; 1107 my $parento = "$var\[$parent\]";
1108 1108
1109 if (defined($opt{$o})) { 1109 # If a variable contains itself, use the default var
1110 if (($var eq $name) && defined($opt{$var})) {
1111 $o = $opt{$var};
1112 $retval = "$retval$o";
1113 } elsif (defined($opt{$o})) {
1110 $o = $opt{$o}; 1114 $o = $opt{$o};
1111 $retval = "$retval$o"; 1115 $retval = "$retval$o";
1112 } elsif ($repeated && defined($opt{$parento})) { 1116 } elsif ($repeated && defined($opt{$parento})) {
@@ -1130,7 +1134,7 @@ sub __eval_option {
1130} 1134}
1131 1135
1132sub eval_option { 1136sub eval_option {
1133 my ($option, $i) = @_; 1137 my ($name, $option, $i) = @_;
1134 1138
1135 my $prev = ""; 1139 my $prev = "";
1136 1140
@@ -1146,7 +1150,7 @@ sub eval_option {
1146 "Check for recursive variables\n"; 1150 "Check for recursive variables\n";
1147 } 1151 }
1148 $prev = $option; 1152 $prev = $option;
1149 $option = __eval_option($option, $i); 1153 $option = __eval_option($name, $option, $i);
1150 } 1154 }
1151 1155
1152 return $option; 1156 return $option;
@@ -3683,7 +3687,7 @@ EOF
3683read_config $ktest_config; 3687read_config $ktest_config;
3684 3688
3685if (defined($opt{"LOG_FILE"})) { 3689if (defined($opt{"LOG_FILE"})) {
3686 $opt{"LOG_FILE"} = eval_option($opt{"LOG_FILE"}, -1); 3690 $opt{"LOG_FILE"} = eval_option("LOG_FILE", $opt{"LOG_FILE"}, -1);
3687} 3691}
3688 3692
3689# Append any configs entered in manually to the config file. 3693# Append any configs entered in manually to the config file.
@@ -3760,7 +3764,7 @@ sub set_test_option {
3760 my $option = __set_test_option($name, $i); 3764 my $option = __set_test_option($name, $i);
3761 return $option if (!defined($option)); 3765 return $option if (!defined($option));
3762 3766
3763 return eval_option($option, $i); 3767 return eval_option($name, $option, $i);
3764} 3768}
3765 3769
3766# First we need to do is the builds 3770# First we need to do is the builds