diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 23:40:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 23:40:51 -0500 |
commit | f74ea36848ad49cb011aae55f56b0475702ffb79 (patch) | |
tree | ba40acee8a0e55bf7181c94539a409bd3102f727 | |
parent | 350e4f4985472e29091b899bc227d75d2a66fb4c (diff) | |
parent | 17150fef4ab1f48d838008657cdaa168453a9fa6 (diff) |
Merge tag 'ktest-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
Pull ktest changes from Steven Rostedt:
"The following ktest updates were done:
- Fix handling the make kernelrelease change
- Fix make_min_config that was broken by new bisect_config changes
- Allow tests to undefine default options (not just being able to
override them)
- Print name of test (if defined) to start of test output"
* tag 'ktest-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
ktest: Add back "tail -1" to kernelrelease make
ktest: Add name to running title
ktest: Allow tests to undefine default options
ktest: Fix make_min_config to handle new assign_configs call
ktest: Use make -s kernelrelease
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index bf1398180785..b9cd036f0442 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -684,11 +684,8 @@ sub set_value { | |||
684 | } | 684 | } |
685 | ${$overrides}{$lvalue} = $prvalue; | 685 | ${$overrides}{$lvalue} = $prvalue; |
686 | } | 686 | } |
687 | if ($rvalue =~ /^\s*$/) { | 687 | |
688 | delete $opt{$lvalue}; | 688 | $opt{$lvalue} = $prvalue; |
689 | } else { | ||
690 | $opt{$lvalue} = $prvalue; | ||
691 | } | ||
692 | } | 689 | } |
693 | 690 | ||
694 | sub set_eval { | 691 | sub set_eval { |
@@ -2005,7 +2002,7 @@ sub get_version { | |||
2005 | # get the release name | 2002 | # get the release name |
2006 | return if ($have_version); | 2003 | return if ($have_version); |
2007 | doprint "$make kernelrelease ... "; | 2004 | doprint "$make kernelrelease ... "; |
2008 | $version = `$make kernelrelease | tail -1`; | 2005 | $version = `$make -s kernelrelease | tail -1`; |
2009 | chomp($version); | 2006 | chomp($version); |
2010 | doprint "$version\n"; | 2007 | doprint "$version\n"; |
2011 | $have_version = 1; | 2008 | $have_version = 1; |
@@ -3571,7 +3568,9 @@ sub test_this_config { | |||
3571 | undef %configs; | 3568 | undef %configs; |
3572 | assign_configs \%configs, $output_config; | 3569 | assign_configs \%configs, $output_config; |
3573 | 3570 | ||
3574 | return $config if (!defined($configs{$config})); | 3571 | if (!defined($configs{$config}) || $configs{$config} =~ /^#/) { |
3572 | return $config; | ||
3573 | } | ||
3575 | 3574 | ||
3576 | doprint "disabling config $config did not change .config\n"; | 3575 | doprint "disabling config $config did not change .config\n"; |
3577 | 3576 | ||
@@ -3945,12 +3944,22 @@ for (my $i = 0, my $repeat = 1; $i <= $opt{"NUM_TESTS"}; $i += $repeat) { | |||
3945 | } | 3944 | } |
3946 | } | 3945 | } |
3947 | 3946 | ||
3947 | sub option_defined { | ||
3948 | my ($option) = @_; | ||
3949 | |||
3950 | if (defined($opt{$option}) && $opt{$option} !~ /^\s*$/) { | ||
3951 | return 1; | ||
3952 | } | ||
3953 | |||
3954 | return 0; | ||
3955 | } | ||
3956 | |||
3948 | sub __set_test_option { | 3957 | sub __set_test_option { |
3949 | my ($name, $i) = @_; | 3958 | my ($name, $i) = @_; |
3950 | 3959 | ||
3951 | my $option = "$name\[$i\]"; | 3960 | my $option = "$name\[$i\]"; |
3952 | 3961 | ||
3953 | if (defined($opt{$option})) { | 3962 | if (option_defined($option)) { |
3954 | return $opt{$option}; | 3963 | return $opt{$option}; |
3955 | } | 3964 | } |
3956 | 3965 | ||
@@ -3958,13 +3967,13 @@ sub __set_test_option { | |||
3958 | if ($i >= $test && | 3967 | if ($i >= $test && |
3959 | $i < $test + $repeat_tests{$test}) { | 3968 | $i < $test + $repeat_tests{$test}) { |
3960 | $option = "$name\[$test\]"; | 3969 | $option = "$name\[$test\]"; |
3961 | if (defined($opt{$option})) { | 3970 | if (option_defined($option)) { |
3962 | return $opt{$option}; | 3971 | return $opt{$option}; |
3963 | } | 3972 | } |
3964 | } | 3973 | } |
3965 | } | 3974 | } |
3966 | 3975 | ||
3967 | if (defined($opt{$name})) { | 3976 | if (option_defined($name)) { |
3968 | return $opt{$name}; | 3977 | return $opt{$name}; |
3969 | } | 3978 | } |
3970 | 3979 | ||
@@ -4077,8 +4086,14 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
4077 | my $installme = ""; | 4086 | my $installme = ""; |
4078 | $installme = " no_install" if ($no_install); | 4087 | $installme = " no_install" if ($no_install); |
4079 | 4088 | ||
4089 | my $name = ""; | ||
4090 | |||
4091 | if (defined($test_name)) { | ||
4092 | $name = " ($test_name)"; | ||
4093 | } | ||
4094 | |||
4080 | doprint "\n\n"; | 4095 | doprint "\n\n"; |
4081 | doprint "RUNNING TEST $i of $opt{NUM_TESTS} with option $test_type $run_type$installme\n\n"; | 4096 | doprint "RUNNING TEST $i of $opt{NUM_TESTS}$name with option $test_type $run_type$installme\n\n"; |
4082 | 4097 | ||
4083 | if (defined($pre_test)) { | 4098 | if (defined($pre_test)) { |
4084 | run_command $pre_test; | 4099 | run_command $pre_test; |