aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-06-14 20:51:37 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-06-14 20:51:37 -0400
commit0df213ca31f43faf0b1d6c7108e190ff198b42d3 (patch)
tree5e73134920125d2ac0a95733de9cc24238a56eb5 /tools/testing
parentddf607e5f853ae172e81e6051e1e12e24ea8a3c6 (diff)
ktest: Require one TEST_START in config file
There has been too many times that I put in one too many SKIP TEST_STARTs and start the test with the default randconfig by accident that I added this to have ktest ask the user for which test they want to run if no TEST_START is specified. Now if I accidently start the test with all TEST_STARTs skipped, ktest asks what test do I want to run, and I now have a chance to kill it before it does a make mrproper on my build directory. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/ktest/ktest.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 099ceeed4144..6166f3a0f2ea 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -345,6 +345,7 @@ sub read_config {
345 my $num_tests_set = 0; 345 my $num_tests_set = 0;
346 my $skip = 0; 346 my $skip = 0;
347 my $rest; 347 my $rest;
348 my $test_case = 0;
348 349
349 while (<IN>) { 350 while (<IN>) {
350 351
@@ -370,6 +371,7 @@ sub read_config {
370 $rest = $1; 371 $rest = $1;
371 $skip = 1; 372 $skip = 1;
372 } else { 373 } else {
374 $test_case = 1;
373 $skip = 0; 375 $skip = 0;
374 } 376 }
375 377
@@ -474,6 +476,15 @@ sub read_config {
474 # make sure we have all mandatory configs 476 # make sure we have all mandatory configs
475 get_ktest_configs; 477 get_ktest_configs;
476 478
479 # was a test specified?
480 if (!$test_case) {
481 print "No test case specified.\n";
482 print "What test case would you like to run?\n";
483 my $ans = <STDIN>;
484 chomp $ans;
485 $default{"TEST_TYPE"} = $ans;
486 }
487
477 # set any defaults 488 # set any defaults
478 489
479 foreach my $default (keys %default) { 490 foreach my $default (keys %default) {