mirror of https://github.com/openssl/openssl.git
util/perl/OpenSSL/Test.pm: consistently use 4 spaces for indentation
While the majority of the file uses 4 spaces for indentation, some parts contain 8-wide tabs. Use the spaces for indentation consistently throughout the file. Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> (Merged from https://github.com/openssl/openssl/pull/28162)
This commit is contained in:
parent
dc044f616e
commit
8778245052
|
|
@ -203,7 +203,7 @@ sub indir {
|
|||
|
||||
my $reverse = __cwd($subdir,%opts);
|
||||
BAIL_OUT("FAILURE: indir, \"$subdir\" wasn't possible to move into")
|
||||
unless $reverse;
|
||||
unless $reverse;
|
||||
|
||||
$codeblock->();
|
||||
|
||||
|
|
@ -435,8 +435,8 @@ sub run {
|
|||
return () if !$cmd;
|
||||
|
||||
my $prefix = "";
|
||||
if ( $^O eq "VMS" ) { # VMS
|
||||
$prefix = "pipe ";
|
||||
if ( $^O eq "VMS" ) { # VMS
|
||||
$prefix = "pipe ";
|
||||
}
|
||||
|
||||
my @r = ();
|
||||
|
|
@ -513,9 +513,9 @@ sub run {
|
|||
$? = 0;
|
||||
|
||||
if ($opts{capture}) {
|
||||
return @r;
|
||||
return @r;
|
||||
} else {
|
||||
return $r;
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ END {
|
|||
my $tb = Test::More->builder;
|
||||
my $failure = scalar(grep { $_ == 0; } $tb->summary);
|
||||
if ($failure && $end_with_bailout) {
|
||||
BAIL_OUT("Stoptest!");
|
||||
BAIL_OUT("Stoptest!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -556,8 +556,8 @@ operating system.
|
|||
=cut
|
||||
|
||||
sub bldtop_dir {
|
||||
my $d = __bldtop_dir(@_); # This caters for operating systems that have
|
||||
# a very distinct syntax for directories.
|
||||
my $d = __bldtop_dir(@_); # This caters for operating systems that have
|
||||
# a very distinct syntax for directories.
|
||||
|
||||
croak "$d isn't a directory" if -e $d && ! -d $d;
|
||||
return $d;
|
||||
|
|
@ -599,8 +599,8 @@ operating system.
|
|||
=cut
|
||||
|
||||
sub srctop_dir {
|
||||
my $d = __srctop_dir(@_); # This caters for operating systems that have
|
||||
# a very distinct syntax for directories.
|
||||
my $d = __srctop_dir(@_); # This caters for operating systems that have
|
||||
# a very distinct syntax for directories.
|
||||
|
||||
croak "$d isn't a directory" if -e $d && ! -d $d;
|
||||
return $d;
|
||||
|
|
@ -727,25 +727,25 @@ to be passed to C<run> for execution.
|
|||
sub pipe {
|
||||
my @cmds = @_;
|
||||
return
|
||||
sub {
|
||||
my @cs = ();
|
||||
my @dcs = ();
|
||||
my @els = ();
|
||||
my $counter = 0;
|
||||
foreach (@cmds) {
|
||||
my ($c, $dc, @el) = $_->(++$counter);
|
||||
sub {
|
||||
my @cs = ();
|
||||
my @dcs = ();
|
||||
my @els = ();
|
||||
my $counter = 0;
|
||||
foreach (@cmds) {
|
||||
my ($c, $dc, @el) = $_->(++$counter);
|
||||
|
||||
return () if !$c;
|
||||
return () if !$c;
|
||||
|
||||
push @cs, $c;
|
||||
push @dcs, $dc;
|
||||
push @els, @el;
|
||||
}
|
||||
return (
|
||||
join(" | ", @cs),
|
||||
join(" | ", @dcs),
|
||||
@els
|
||||
);
|
||||
push @cs, $c;
|
||||
push @dcs, $dc;
|
||||
push @els, @el;
|
||||
}
|
||||
return (
|
||||
join(" | ", @cs),
|
||||
join(" | ", @dcs),
|
||||
@els
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -781,14 +781,14 @@ sub with {
|
|||
my %saved_hooks = ();
|
||||
|
||||
foreach (keys %opts) {
|
||||
$saved_hooks{$_} = $hooks{$_} if exists($hooks{$_});
|
||||
$hooks{$_} = $opts{$_};
|
||||
$saved_hooks{$_} = $hooks{$_} if exists($hooks{$_});
|
||||
$hooks{$_} = $opts{$_};
|
||||
}
|
||||
|
||||
$codeblock->();
|
||||
|
||||
foreach (keys %saved_hooks) {
|
||||
$hooks{$_} = $saved_hooks{$_};
|
||||
$hooks{$_} = $saved_hooks{$_};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1029,10 +1029,10 @@ sub __bldtop_dir {
|
|||
# if that one is defined.
|
||||
sub __exeext {
|
||||
my $ext = "";
|
||||
if ($^O eq "VMS" ) { # VMS
|
||||
$ext = ".exe";
|
||||
if ($^O eq "VMS" ) { # VMS
|
||||
$ext = ".exe";
|
||||
} elsif ($^O eq "MSWin32") { # Windows
|
||||
$ext = ".exe";
|
||||
$ext = ".exe";
|
||||
}
|
||||
return $ENV{"EXE_EXT"} || $ext;
|
||||
}
|
||||
|
|
@ -1110,7 +1110,7 @@ sub __cwd {
|
|||
# abs_path().
|
||||
$dir = canonpath($dir);
|
||||
if ($opts{create}) {
|
||||
mkpath($dir);
|
||||
mkpath($dir);
|
||||
}
|
||||
|
||||
my $abscurdir = abs_path(curdir());
|
||||
|
|
@ -1119,12 +1119,12 @@ sub __cwd {
|
|||
|
||||
# PARANOIA: if we're not moving anywhere, we do nothing more
|
||||
if ($abscurdir eq $absdir) {
|
||||
return $reverse;
|
||||
return $reverse;
|
||||
}
|
||||
|
||||
# Do not support a move to a different volume for now. Maybe later.
|
||||
BAIL_OUT("FAILURE: \"$dir\" moves to a different volume, not supported")
|
||||
if $reverse eq $abscurdir;
|
||||
if $reverse eq $abscurdir;
|
||||
|
||||
# If someone happened to give a directory that leads back to the current,
|
||||
# it's extremely silly to do anything more, so just simulate that we did
|
||||
|
|
@ -1142,32 +1142,32 @@ sub __cwd {
|
|||
# they don't change!)
|
||||
my @dirtags = sort keys %directories;
|
||||
foreach (@dirtags) {
|
||||
if (!file_name_is_absolute($directories{$_})) {
|
||||
my $oldpath = abs_path($directories{$_});
|
||||
my $newpath = abs2rel($oldpath, $absdir);
|
||||
if ($debug) {
|
||||
print STDERR "DEBUG: [dir $_] old path: $oldpath\n";
|
||||
print STDERR "DEBUG: [dir $_] new base: $absdir\n";
|
||||
print STDERR "DEBUG: [dir $_] resulting new path: $newpath\n";
|
||||
}
|
||||
$tmp_directories{$_} = $newpath;
|
||||
}
|
||||
if (!file_name_is_absolute($directories{$_})) {
|
||||
my $oldpath = abs_path($directories{$_});
|
||||
my $newpath = abs2rel($oldpath, $absdir);
|
||||
if ($debug) {
|
||||
print STDERR "DEBUG: [dir $_] old path: $oldpath\n";
|
||||
print STDERR "DEBUG: [dir $_] new base: $absdir\n";
|
||||
print STDERR "DEBUG: [dir $_] resulting new path: $newpath\n";
|
||||
}
|
||||
$tmp_directories{$_} = $newpath;
|
||||
}
|
||||
}
|
||||
|
||||
# Treat each environment variable that was used to get us the values in
|
||||
# %directories the same was as the paths in %directories, so any sub
|
||||
# process can use their values properly as well
|
||||
foreach (@direnv) {
|
||||
if (!file_name_is_absolute($ENV{$_})) {
|
||||
my $oldpath = abs_path($ENV{$_});
|
||||
my $newpath = abs2rel($oldpath, $absdir);
|
||||
if ($debug) {
|
||||
print STDERR "DEBUG: [env $_] old path: $oldpath\n";
|
||||
print STDERR "DEBUG: [env $_] new base: $absdir\n";
|
||||
print STDERR "DEBUG: [env $_] resulting new path: $newpath\n";
|
||||
}
|
||||
$tmp_ENV{$_} = $newpath;
|
||||
}
|
||||
if (!file_name_is_absolute($ENV{$_})) {
|
||||
my $oldpath = abs_path($ENV{$_});
|
||||
my $newpath = abs2rel($oldpath, $absdir);
|
||||
if ($debug) {
|
||||
print STDERR "DEBUG: [env $_] old path: $oldpath\n";
|
||||
print STDERR "DEBUG: [env $_] new base: $absdir\n";
|
||||
print STDERR "DEBUG: [env $_] resulting new path: $newpath\n";
|
||||
}
|
||||
$tmp_ENV{$_} = $newpath;
|
||||
}
|
||||
}
|
||||
|
||||
# Should we just bail out here as well? I'm unsure.
|
||||
|
|
@ -1184,21 +1184,21 @@ sub __cwd {
|
|||
}
|
||||
|
||||
if ($debug) {
|
||||
print STDERR "DEBUG: __cwd(), directories and files:\n";
|
||||
print STDERR " Moving from $abscurdir\n";
|
||||
print STDERR " Moving to $absdir\n";
|
||||
print STDERR "\n";
|
||||
print STDERR " \$directories{BLDTEST} = \"$directories{BLDTEST}\"\n";
|
||||
print STDERR " \$directories{SRCTEST} = \"$directories{SRCTEST}\"\n";
|
||||
print STDERR " \$directories{SRCDATA} = \"$directories{SRCDATA}\"\n"
|
||||
print STDERR "DEBUG: __cwd(), directories and files:\n";
|
||||
print STDERR " Moving from $abscurdir\n";
|
||||
print STDERR " Moving to $absdir\n";
|
||||
print STDERR "\n";
|
||||
print STDERR " \$directories{BLDTEST} = \"$directories{BLDTEST}\"\n";
|
||||
print STDERR " \$directories{SRCTEST} = \"$directories{SRCTEST}\"\n";
|
||||
print STDERR " \$directories{SRCDATA} = \"$directories{SRCDATA}\"\n"
|
||||
if exists $directories{SRCDATA};
|
||||
print STDERR " \$directories{RESULTS} = \"$directories{RESULTS}\"\n";
|
||||
print STDERR " \$directories{BLDAPPS} = \"$directories{BLDAPPS}\"\n";
|
||||
print STDERR " \$directories{SRCAPPS} = \"$directories{SRCAPPS}\"\n";
|
||||
print STDERR " \$directories{SRCTOP} = \"$directories{SRCTOP}\"\n";
|
||||
print STDERR " \$directories{BLDTOP} = \"$directories{BLDTOP}\"\n";
|
||||
print STDERR "\n";
|
||||
print STDERR " the way back is \"$reverse\"\n";
|
||||
print STDERR " \$directories{RESULTS} = \"$directories{RESULTS}\"\n";
|
||||
print STDERR " \$directories{BLDAPPS} = \"$directories{BLDAPPS}\"\n";
|
||||
print STDERR " \$directories{SRCAPPS} = \"$directories{SRCAPPS}\"\n";
|
||||
print STDERR " \$directories{SRCTOP} = \"$directories{SRCTOP}\"\n";
|
||||
print STDERR " \$directories{BLDTOP} = \"$directories{BLDTOP}\"\n";
|
||||
print STDERR "\n";
|
||||
print STDERR " the way back is \"$reverse\"\n";
|
||||
}
|
||||
|
||||
return $reverse;
|
||||
|
|
@ -1295,8 +1295,8 @@ sub __decorate_cmd {
|
|||
$cmdstr .= "$stdin$stdout$stderr";
|
||||
|
||||
if ($debug) {
|
||||
print STDERR "DEBUG[__decorate_cmd]: \$cmdstr = \"$cmdstr\"\n";
|
||||
print STDERR "DEBUG[__decorate_cmd]: \$display_cmd = \"$display_cmd\"\n";
|
||||
print STDERR "DEBUG[__decorate_cmd]: \$cmdstr = \"$cmdstr\"\n";
|
||||
print STDERR "DEBUG[__decorate_cmd]: \$display_cmd = \"$display_cmd\"\n";
|
||||
}
|
||||
|
||||
return ($cmdstr, $display_cmd);
|
||||
|
|
|
|||
Loading…
Reference in New Issue