diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-11-21 20:39:33 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-11-23 15:55:41 -0500 |
commit | 0e7a22de25212cfcaa0ba2c957e4e60eaa70fb9d (patch) | |
tree | 8220e09d8ffe28897877c324d359d3135f35585a /tools/testing/ktest | |
parent | 600bbf0aa2229390ba1c4ca4c5666c593ff9ef56 (diff) |
ktest: When creating new config, allow the use of ${THIS_DIR}
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
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 05f429d68857..77b464980de1 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -158,11 +158,15 @@ EOF | |||
158 | ; | 158 | ; |
159 | $config_help{"BUILD_DIR"} = << "EOF" | 159 | $config_help{"BUILD_DIR"} = << "EOF" |
160 | The directory that contains the Linux source code (full path). | 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 | EOF | 163 | EOF |
162 | ; | 164 | ; |
163 | $config_help{"OUTPUT_DIR"} = << "EOF" | 165 | $config_help{"OUTPUT_DIR"} = << "EOF" |
164 | The directory that the objects will be built (full path). | 166 | The directory that the objects will be built (full path). |
165 | (can not be same as BUILD_DIR) | 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 | EOF | 170 | EOF |
167 | ; | 171 | ; |
168 | $config_help{"BUILD_TARGET"} = << "EOF" | 172 | $config_help{"BUILD_TARGET"} = << "EOF" |
@@ -282,7 +286,7 @@ sub get_ktest_config { | |||
282 | next; | 286 | next; |
283 | } | 287 | } |
284 | } | 288 | } |
285 | $entered_configs{$config} = process_variables($ans); | 289 | $entered_configs{$config} = ${ans}; |
286 | last; | 290 | last; |
287 | } | 291 | } |
288 | } | 292 | } |
@@ -3012,6 +3016,17 @@ if (! -f $ktest_config) { | |||
3012 | print OUT << "EOF" | 3016 | print OUT << "EOF" |
3013 | # Generated by ktest.pl | 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 | # Define each test with TEST_START | 3030 | # Define each test with TEST_START |
3016 | # The config options below it will override the defaults | 3031 | # The config options below it will override the defaults |
3017 | TEST_START | 3032 | TEST_START |
@@ -3034,7 +3049,7 @@ if ($#new_configs >= 0) { | |||
3034 | open(OUT, ">>$ktest_config") or die "Can not append to $ktest_config"; | 3049 | open(OUT, ">>$ktest_config") or die "Can not append to $ktest_config"; |
3035 | foreach my $config (@new_configs) { | 3050 | foreach my $config (@new_configs) { |
3036 | print OUT "$config = $entered_configs{$config}\n"; | 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 | ||