ktest: Further consistency cleanups
This cleans up some additional whitespace pieces that to be more consistent, as well as moving a curly brace around, and some 'or' statements to match the rest of the file (usually or goes at the end of the line vs. at the beginning) Signed-off-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
12d4cddda2
commit
c043ccbfc6
@ -863,7 +863,6 @@ sub value_defined {
|
||||
defined($opt{$2});
|
||||
}
|
||||
|
||||
my $d = 0;
|
||||
sub process_expression {
|
||||
my ($name, $val) = @_;
|
||||
|
||||
@ -978,7 +977,6 @@ sub __read_config {
|
||||
$override = 0;
|
||||
|
||||
if ($type eq "TEST_START") {
|
||||
|
||||
if ($num_tests_set) {
|
||||
die "$name: $.: Can not specify both NUM_TESTS and TEST_START\n";
|
||||
}
|
||||
@ -1048,7 +1046,6 @@ sub __read_config {
|
||||
$test_num = $old_test_num;
|
||||
$repeat = $old_repeat;
|
||||
}
|
||||
|
||||
} elsif (/^\s*ELSE\b(.*)$/) {
|
||||
if (!$if) {
|
||||
die "$name: $.: ELSE found with out matching IF section\n$_";
|
||||
@ -1471,7 +1468,6 @@ sub get_test_name() {
|
||||
}
|
||||
|
||||
sub dodie {
|
||||
|
||||
# avoid recursion
|
||||
return if ($in_die);
|
||||
$in_die = 1;
|
||||
@ -1481,10 +1477,8 @@ sub dodie {
|
||||
doprint "CRITICAL FAILURE... [TEST $i] ", @_, "\n";
|
||||
|
||||
if ($reboot_on_error && !do_not_reboot) {
|
||||
|
||||
doprint "REBOOTING\n";
|
||||
reboot_to_good;
|
||||
|
||||
} elsif ($poweroff_on_error && defined($power_off)) {
|
||||
doprint "POWERING OFF\n";
|
||||
`$power_off`;
|
||||
@ -1519,6 +1513,7 @@ sub dodie {
|
||||
close O;
|
||||
close L;
|
||||
}
|
||||
|
||||
send_email("KTEST: critical failure for test $i [$name]",
|
||||
"Your test started at $script_start_time has failed with:\n@_\n", $log_file);
|
||||
}
|
||||
@ -1924,8 +1919,8 @@ sub _get_grub_index {
|
||||
my $ssh_grub = $ssh_exec;
|
||||
$ssh_grub =~ s,\$SSH_COMMAND,$command,g;
|
||||
|
||||
open(IN, "$ssh_grub |")
|
||||
or dodie "unable to execute $command";
|
||||
open(IN, "$ssh_grub |") or
|
||||
dodie "unable to execute $command";
|
||||
|
||||
my $found = 0;
|
||||
|
||||
@ -1979,8 +1974,7 @@ sub get_grub_index {
|
||||
_get_grub_index($command, $target, $skip);
|
||||
}
|
||||
|
||||
sub wait_for_input
|
||||
{
|
||||
sub wait_for_input {
|
||||
my ($fp, $time) = @_;
|
||||
my $start_time;
|
||||
my $rin;
|
||||
@ -2096,7 +2090,6 @@ sub monitor {
|
||||
my $version_found = 0;
|
||||
|
||||
while (!$done) {
|
||||
|
||||
if ($bug && defined($stop_after_failure) &&
|
||||
$stop_after_failure >= 0) {
|
||||
my $time = $stop_after_failure - (time - $failure_start);
|
||||
@ -2571,7 +2564,6 @@ sub build {
|
||||
run_command "mv $outputdir/config_temp $output_config" or
|
||||
dodie "moving config_temp";
|
||||
}
|
||||
|
||||
} elsif (!$noclean) {
|
||||
unlink "$output_config";
|
||||
run_command "$make mrproper" or
|
||||
@ -2652,7 +2644,8 @@ sub success {
|
||||
|
||||
print_times;
|
||||
|
||||
doprint "\n\n*******************************************\n";
|
||||
doprint "\n\n";
|
||||
doprint "*******************************************\n";
|
||||
doprint "*******************************************\n";
|
||||
doprint "KTEST RESULT: TEST $i$name SUCCESS!!!! **\n";
|
||||
doprint "*******************************************\n";
|
||||
@ -3034,7 +3027,6 @@ sub bisect {
|
||||
}
|
||||
|
||||
if ($do_check) {
|
||||
|
||||
# get current HEAD
|
||||
my $head = get_sha1("HEAD");
|
||||
|
||||
@ -3074,13 +3066,11 @@ sub bisect {
|
||||
run_command "git bisect replay $replay" or
|
||||
dodie "failed to run replay";
|
||||
} else {
|
||||
|
||||
run_command "git bisect good $good" or
|
||||
dodie "could not set bisect good to $good";
|
||||
|
||||
run_git_bisect "git bisect bad $bad" or
|
||||
dodie "could not set bisect bad to $bad";
|
||||
|
||||
}
|
||||
|
||||
if (defined($start)) {
|
||||
@ -3133,8 +3123,8 @@ sub assign_configs {
|
||||
|
||||
doprint "Reading configs from $config\n";
|
||||
|
||||
open (IN, $config)
|
||||
or dodie "Failed to read $config";
|
||||
open (IN, $config) or
|
||||
dodie "Failed to read $config";
|
||||
|
||||
while (<IN>) {
|
||||
chomp;
|
||||
@ -3287,7 +3277,8 @@ sub config_bisect {
|
||||
|
||||
if (!defined($config_bisect_exec)) {
|
||||
# First check the location that ktest.pl ran
|
||||
my @locations = ( "$pwd/config-bisect.pl",
|
||||
my @locations = (
|
||||
"$pwd/config-bisect.pl",
|
||||
"$dirname/config-bisect.pl",
|
||||
"$builddir/tools/testing/ktest/config-bisect.pl",
|
||||
undef );
|
||||
@ -3632,8 +3623,8 @@ sub read_kconfig {
|
||||
|
||||
sub read_depends {
|
||||
# find out which arch this is by the kconfig file
|
||||
open (IN, $output_config)
|
||||
or dodie "Failed to read $output_config";
|
||||
open (IN, $output_config) or
|
||||
dodie "Failed to read $output_config";
|
||||
my $arch;
|
||||
while (<IN>) {
|
||||
if (m,Linux/(\S+)\s+\S+\s+Kernel Configuration,) {
|
||||
@ -3708,7 +3699,6 @@ sub get_depends {
|
||||
my @configs;
|
||||
|
||||
while ($dep =~ /[$valid]/) {
|
||||
|
||||
if ($dep =~ /^[^$valid]*([$valid]+)/) {
|
||||
my $conf = "CONFIG_" . $1;
|
||||
|
||||
@ -3889,7 +3879,6 @@ sub make_min_config {
|
||||
my $take_two = 0;
|
||||
|
||||
while (!$done) {
|
||||
|
||||
my $config;
|
||||
my $found;
|
||||
|
||||
@ -3976,8 +3965,8 @@ sub make_min_config {
|
||||
|
||||
# update new ignore configs
|
||||
if (defined($ignore_config)) {
|
||||
open (OUT, ">$temp_config")
|
||||
or dodie "Can't write to $temp_config";
|
||||
open (OUT, ">$temp_config") or
|
||||
dodie "Can't write to $temp_config";
|
||||
foreach my $config (keys %save_configs) {
|
||||
print OUT "$save_configs{$config}\n";
|
||||
}
|
||||
@ -4004,8 +3993,8 @@ sub make_min_config {
|
||||
}
|
||||
|
||||
# Save off all the current mandatory configs
|
||||
open (OUT, ">$temp_config")
|
||||
or dodie "Can't write to $temp_config";
|
||||
open (OUT, ">$temp_config") or
|
||||
dodie "Can't write to $temp_config";
|
||||
foreach my $config (keys %keep_configs) {
|
||||
print OUT "$keep_configs{$config}\n";
|
||||
}
|
||||
@ -4043,7 +4032,6 @@ sub make_warnings_file {
|
||||
|
||||
open(IN, $buildlog) or dodie "Can't open $buildlog";
|
||||
while (<IN>) {
|
||||
|
||||
# Some compilers use UTF-8 extended for quotes
|
||||
# for distcc heterogeneous systems, this causes issues
|
||||
s/$utf8_quote/'/g;
|
||||
@ -4263,7 +4251,6 @@ sub do_send_mail {
|
||||
}
|
||||
|
||||
sub send_email {
|
||||
|
||||
if (defined($mailto)) {
|
||||
if (!defined($mailer)) {
|
||||
doprint "No email sent: email or mailer not specified in config.\n";
|
||||
|
Loading…
Reference in New Issue
Block a user