提交 f74ea368 编写于 作者: L Linus Torvalds

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
...@@ -684,11 +684,8 @@ sub set_value { ...@@ -684,11 +684,8 @@ sub set_value {
} }
${$overrides}{$lvalue} = $prvalue; ${$overrides}{$lvalue} = $prvalue;
} }
if ($rvalue =~ /^\s*$/) {
delete $opt{$lvalue}; $opt{$lvalue} = $prvalue;
} else {
$opt{$lvalue} = $prvalue;
}
} }
sub set_eval { sub set_eval {
...@@ -2005,7 +2002,7 @@ sub get_version { ...@@ -2005,7 +2002,7 @@ sub get_version {
# get the release name # get the release name
return if ($have_version); return if ($have_version);
doprint "$make kernelrelease ... "; doprint "$make kernelrelease ... ";
$version = `$make kernelrelease | tail -1`; $version = `$make -s kernelrelease | tail -1`;
chomp($version); chomp($version);
doprint "$version\n"; doprint "$version\n";
$have_version = 1; $have_version = 1;
...@@ -3571,7 +3568,9 @@ sub test_this_config { ...@@ -3571,7 +3568,9 @@ sub test_this_config {
undef %configs; undef %configs;
assign_configs \%configs, $output_config; assign_configs \%configs, $output_config;
return $config if (!defined($configs{$config})); if (!defined($configs{$config}) || $configs{$config} =~ /^#/) {
return $config;
}
doprint "disabling config $config did not change .config\n"; doprint "disabling config $config did not change .config\n";
...@@ -3945,12 +3944,22 @@ for (my $i = 0, my $repeat = 1; $i <= $opt{"NUM_TESTS"}; $i += $repeat) { ...@@ -3945,12 +3944,22 @@ for (my $i = 0, my $repeat = 1; $i <= $opt{"NUM_TESTS"}; $i += $repeat) {
} }
} }
sub option_defined {
my ($option) = @_;
if (defined($opt{$option}) && $opt{$option} !~ /^\s*$/) {
return 1;
}
return 0;
}
sub __set_test_option { sub __set_test_option {
my ($name, $i) = @_; my ($name, $i) = @_;
my $option = "$name\[$i\]"; my $option = "$name\[$i\]";
if (defined($opt{$option})) { if (option_defined($option)) {
return $opt{$option}; return $opt{$option};
} }
...@@ -3958,13 +3967,13 @@ sub __set_test_option { ...@@ -3958,13 +3967,13 @@ sub __set_test_option {
if ($i >= $test && if ($i >= $test &&
$i < $test + $repeat_tests{$test}) { $i < $test + $repeat_tests{$test}) {
$option = "$name\[$test\]"; $option = "$name\[$test\]";
if (defined($opt{$option})) { if (option_defined($option)) {
return $opt{$option}; return $opt{$option};
} }
} }
} }
if (defined($opt{$name})) { if (option_defined($name)) {
return $opt{$name}; return $opt{$name};
} }
...@@ -4077,8 +4086,14 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { ...@@ -4077,8 +4086,14 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
my $installme = ""; my $installme = "";
$installme = " no_install" if ($no_install); $installme = " no_install" if ($no_install);
my $name = "";
if (defined($test_name)) {
$name = " ($test_name)";
}
doprint "\n\n"; doprint "\n\n";
doprint "RUNNING TEST $i of $opt{NUM_TESTS} with option $test_type $run_type$installme\n\n"; doprint "RUNNING TEST $i of $opt{NUM_TESTS}$name with option $test_type $run_type$installme\n\n";
if (defined($pre_test)) { if (defined($pre_test)) {
run_command $pre_test; run_command $pre_test;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册