History

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

Steven Rostedt committed 14 years ago

Commit 0e7a22d1 parent 600bbf01 file · +17 −2Browse files

Unified · Split

tools/testing/ktest/ktest.pl+17−2
@@ -158,11 +158,15 @@ EOF · 157 unmodified lines
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.
161EOF163EOF
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.
166EOF170EOF
167 ;171 ;
168$config_help{"BUILD_TARGET"} = << "EOF"172$config_help{"BUILD_TARGET"} = << "EOF"
@@ -282,7 +286,7 @@ sub get_ktest_config { · 113 unmodified lines
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) { · 2723 unmodified lines
3012 print OUT << "EOF"3016 print OUT << "EOF"
3013# Generated by ktest.pl3017# 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#
3028THIS_DIR := $variable{"PWD"}
3029
3015# Define each test with TEST_START3030# Define each test with TEST_START
3016# The config options below it will override the defaults3031# The config options below it will override the defaults
3017TEST_START3032TEST_START
@@ -3034,7 +3049,7 @@ if ($#new_configs >= 0) { · 16 unmodified lines
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