diff options
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 2ffb67c3c49d..f50b44fa8a03 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -752,6 +752,15 @@ sub __read_config { | |||
752 | return $test_case; | 752 | return $test_case; |
753 | } | 753 | } |
754 | 754 | ||
755 | sub get_test_case { | ||
756 | print "What test case would you like to run?\n"; | ||
757 | print " (build, install or boot)\n"; | ||
758 | print " Other tests are available but require editing the config file\n"; | ||
759 | my $ans = <STDIN>; | ||
760 | chomp $ans; | ||
761 | $default{"TEST_TYPE"} = $ans; | ||
762 | } | ||
763 | |||
755 | sub read_config { | 764 | sub read_config { |
756 | my ($config) = @_; | 765 | my ($config) = @_; |
757 | 766 | ||
@@ -766,10 +775,7 @@ sub read_config { | |||
766 | # was a test specified? | 775 | # was a test specified? |
767 | if (!$test_case) { | 776 | if (!$test_case) { |
768 | print "No test case specified.\n"; | 777 | print "No test case specified.\n"; |
769 | print "What test case would you like to run?\n"; | 778 | get_test_case; |
770 | my $ans = <STDIN>; | ||
771 | chomp $ans; | ||
772 | $default{"TEST_TYPE"} = $ans; | ||
773 | } | 779 | } |
774 | 780 | ||
775 | # set any defaults | 781 | # set any defaults |
@@ -3070,6 +3076,7 @@ if ($#ARGV == 0) { | |||
3070 | } | 3076 | } |
3071 | 3077 | ||
3072 | if (! -f $ktest_config) { | 3078 | if (! -f $ktest_config) { |
3079 | get_test_case; | ||
3073 | open(OUT, ">$ktest_config") or die "Can not create $ktest_config"; | 3080 | open(OUT, ">$ktest_config") or die "Can not create $ktest_config"; |
3074 | print OUT << "EOF" | 3081 | print OUT << "EOF" |
3075 | # Generated by ktest.pl | 3082 | # Generated by ktest.pl |
@@ -3088,6 +3095,7 @@ THIS_DIR := $variable{"PWD"} | |||
3088 | # Define each test with TEST_START | 3095 | # Define each test with TEST_START |
3089 | # The config options below it will override the defaults | 3096 | # The config options below it will override the defaults |
3090 | TEST_START | 3097 | TEST_START |
3098 | TEST_TYPE = $default{"TEST_TYPE"} | ||
3091 | 3099 | ||
3092 | DEFAULTS | 3100 | DEFAULTS |
3093 | EOF | 3101 | EOF |