Typing in a full path when you know that the path exists within the directory your are running is tedious and unnecessary. Allow the user to use ${PWD} if they want a dynamic path name which will be the path that ktest.pl is executed from or use ${THIS_DIR} which is a variable assigned `pwd` and the the variable will exist within the config, allowing the user to change it and affect all other paths using this variable as well
Unified · Split
| @@ -158,11 +158,15 @@ EOF · 157 unmodified lines | ||
| 158 | 158 | ; |
| 159 | 159 | $config_help{"BUILD_DIR"} = << "EOF" |
| 160 | 160 | The directory that contains the Linux source code (full path). |
| 161 | + You can use \${PWD} that will be the path where ktest.pl is run, or use | |
| 162 | + \${THIS_DIR} which is assigned \${PWD} but may be changed later. | |
| 161 | 163 | EOF |
| 162 | 164 | ; |
| 163 | 165 | $config_help{"OUTPUT_DIR"} = << "EOF" |
| 164 | 166 | The directory that the objects will be built (full path). |
| 165 | 167 | (can not be same as BUILD_DIR) |
| 168 | + You can use \${PWD} that will be the path where ktest.pl is run, or use | |
| 169 | + \${THIS_DIR} which is assigned \${PWD} but may be changed later. | |
| 166 | 170 | EOF |
| 167 | 171 | ; |
| 168 | 172 | $config_help{"BUILD_TARGET"} = << "EOF" |
| @@ -282,7 +286,7 @@ sub get_ktest_config { · 113 unmodified lines | ||
| 282 | 286 | next; |
| 283 | 287 | } |
| 284 | 288 | } |
| 285 | − $entered_configs{$config} = process_variables($ans); | |
| 289 | + $entered_configs{$config} = ${ans}; | |
| 286 | 290 | last; |
| 287 | 291 | } |
| 288 | 292 | } |
| @@ -3012,6 +3016,17 @@ if (! -f $ktest_config) { · 2723 unmodified lines | ||
| 3012 | 3016 | print OUT << "EOF" |
| 3013 | 3017 | # Generated by ktest.pl |
| 3014 | 3018 | # |
| 3019 | + | |
| 3020 | +# PWD is a ktest.pl variable that will result in the process working | |
| 3021 | +# directory that ktest.pl is executed in. | |
| 3022 | + | |
| 3023 | +# THIS_DIR is automatically assigned the PWD of the path that generated | |
| 3024 | +# the config file. It is best to use this variable when assigning other | |
| 3025 | +# directory paths within this directory. This allows you to easily | |
| 3026 | +# move the test cases to other locations or to other machines. | |
| 3027 | +# | |
| 3028 | +THIS_DIR := $variable{"PWD"} | |
| 3029 | + | |
| 3015 | 3030 | # Define each test with TEST_START |
| 3016 | 3031 | # The config options below it will override the defaults |
| 3017 | 3032 | TEST_START |
| @@ -3034,7 +3049,7 @@ if ($#new_configs >= 0) { · 16 unmodified lines | ||
| 3034 | 3049 | open(OUT, ">>$ktest_config") or die "Can not append to $ktest_config"; |
| 3035 | 3050 | foreach my $config (@new_configs) { |
| 3036 | 3051 | print OUT "$config = $entered_configs{$config}\n"; |
| 3037 | − $opt{$config} = $entered_configs{$config}; | |
| 3052 | + $opt{$config} = process_variables($entered_configs{$config}); | |
| 3038 | 3053 | } |
| 3039 | 3054 | } |
| 3040 | 3055 | |