Skip to content

Commit 76f91cc

Browse files
committed
Reverted unwise tidy. I blame ack -f --perl :)
1 parent c746551 commit 76f91cc

File tree

9 files changed

+475
-572
lines changed

9 files changed

+475
-572
lines changed

reference/Test-Harness-2.64/bin/prove

+41-49
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,50 @@ use File::Spec;
1212
use vars qw( $VERSION );
1313
$VERSION = '2.64';
1414

15-
my $shuffle = 0;
16-
my $dry = 0;
17-
my $blib = 0;
18-
my $lib = 0;
19-
my $recurse = 0;
15+
my $shuffle = 0;
16+
my $dry = 0;
17+
my $blib = 0;
18+
my $lib = 0;
19+
my $recurse = 0;
2020
my @includes = ();
2121
my @switches = ();
2222

2323
# Allow cuddling the paths with the -I
24-
@ARGV = map { /^(-I)(.+)/ ? ( $1, $2 ) : $_ } @ARGV;
24+
@ARGV = map { /^(-I)(.+)/ ? ($1,$2) : $_ } @ARGV;
2525

2626
# Stick any default switches at the beginning, so they can be overridden
2727
# by the command line switches.
28-
unshift @ARGV, split( ' ', $ENV{PROVE_SWITCHES} )
29-
if defined $ENV{PROVE_SWITCHES};
28+
unshift @ARGV, split( ' ', $ENV{PROVE_SWITCHES} ) if defined $ENV{PROVE_SWITCHES};
3029

31-
Getopt::Long::Configure('no_ignore_case');
32-
Getopt::Long::Configure('bundling');
30+
Getopt::Long::Configure( 'no_ignore_case' );
31+
Getopt::Long::Configure( 'bundling' );
3332
GetOptions(
34-
'b|blib' => \$blib,
35-
'd|debug' => \$Test::Harness::debug,
36-
'D|dry' => \$dry,
37-
'h|help|?' => sub { pod2usage( { -verbose => 1 } ); exit },
38-
'H|man' => sub { pod2usage( { -verbose => 2 } ); exit },
39-
'I=s@' => \@includes,
40-
'l|lib' => \$lib,
41-
'perl=s' => \$ENV{HARNESS_PERL},
42-
'r|recurse' => \$recurse,
43-
's|shuffle' => \$shuffle,
44-
't' => sub { unshift @switches, '-t' }, # Always want -t up front
45-
'T' => sub { unshift @switches, '-T' }, # Always want -T up front
46-
'w' => sub { push @switches, '-w' },
47-
'W' => sub { push @switches, '-W' },
48-
'strap=s' => \$ENV{HARNESS_STRAP_CLASS},
49-
'timer' => \$Test::Harness::Timer,
50-
'v|verbose' => \$Test::Harness::verbose,
51-
'V|version' => sub { print_version(); exit; },
52-
) or
53-
exit 1;
33+
'b|blib' => \$blib,
34+
'd|debug' => \$Test::Harness::debug,
35+
'D|dry' => \$dry,
36+
'h|help|?' => sub {pod2usage({-verbose => 1}); exit},
37+
'H|man' => sub {pod2usage({-verbose => 2}); exit},
38+
'I=s@' => \@includes,
39+
'l|lib' => \$lib,
40+
'perl=s' => \$ENV{HARNESS_PERL},
41+
'r|recurse' => \$recurse,
42+
's|shuffle' => \$shuffle,
43+
't' => sub { unshift @switches, '-t' }, # Always want -t up front
44+
'T' => sub { unshift @switches, '-T' }, # Always want -T up front
45+
'w' => sub { push @switches, '-w' },
46+
'W' => sub { push @switches, '-W' },
47+
'strap=s' => \$ENV{HARNESS_STRAP_CLASS},
48+
'timer' => \$Test::Harness::Timer,
49+
'v|verbose' => \$Test::Harness::verbose,
50+
'V|version' => sub { print_version(); exit; },
51+
) or exit 1;
5452

5553
$ENV{TEST_VERBOSE} = 1 if $Test::Harness::verbose;
5654

5755
# Handle blib includes
58-
if ($blib) {
56+
if ( $blib ) {
5957
my @blibdirs = blibdirs();
60-
if (@blibdirs) {
58+
if ( @blibdirs ) {
6159
unshift @includes, @blibdirs;
6260
}
6361
else {
@@ -66,16 +64,14 @@ if ($blib) {
6664
}
6765

6866
# Handle lib includes
69-
if ($lib) {
67+
if ( $lib ) {
7068
unshift @includes, 'lib';
7169
}
7270

7371
# Build up TH switches
74-
push( @switches,
75-
map { /\s/ && !/^".*"$/ ? qq["-I$_"] : "-I$_" } @includes );
72+
push( @switches, map { /\s/ && !/^".*"$/ ? qq["-I$_"] : "-I$_" } @includes );
7673
$Test::Harness::Switches = join( ' ', @switches );
77-
print "# \$Test::Harness::Switches: $Test::Harness::Switches\n"
78-
if $Test::Harness::debug;
74+
print "# \$Test::Harness::Switches: $Test::Harness::Switches\n" if $Test::Harness::debug;
7975

8076
@ARGV = File::Spec->curdir unless @ARGV;
8177
my @argv_globbed;
@@ -85,31 +81,27 @@ if ( $] >= 5.006001 ) {
8581
@argv_globbed = map { File::Glob::bsd_glob($_) } @ARGV;
8682
}
8783
else {
88-
@argv_globbed = map {glob} @ARGV;
84+
@argv_globbed = map { glob } @ARGV;
8985
}
9086

91-
for (@argv_globbed) {
92-
push( @tests,
93-
-d $_ ? all_in( { recurse => $recurse, start => $_ } ) : $_ );
87+
for ( @argv_globbed ) {
88+
push( @tests, -d $_ ? all_in( { recurse => $recurse, start => $_ } ) : $_ )
9489
}
9590

96-
if (@tests) {
91+
if ( @tests ) {
9792
shuffle(@tests) if $shuffle;
98-
if ($dry) {
93+
if ( $dry ) {
9994
print join( "\n", @tests, '' );
10095
}
10196
else {
102-
print "# ", scalar @tests, " tests to run\n"
103-
if $Test::Harness::debug;
97+
print "# ", scalar @tests, " tests to run\n" if $Test::Harness::debug;
10498
runtests(@tests);
10599
}
106100
}
107101

108102
sub print_version {
109-
printf(
110-
"prove v%s, using Test::Harness v%s and Perl v%vd\n",
111-
$VERSION, $Test::Harness::VERSION, $^V
112-
);
103+
printf( "prove v%s, using Test::Harness v%s and Perl v%vd\n",
104+
$VERSION, $Test::Harness::VERSION, $^V );
113105
}
114106

115107
__END__

0 commit comments

Comments
 (0)