Permalink
Browse files

Reverted unwise tidy. I blame ack -f --perl :)

  • Loading branch information...
1 parent c746551 commit 76f91cc8b8b4854e7d654798123207d1ef554aff @AndyA AndyA committed Sep 24, 2007
@@ -12,52 +12,50 @@ use File::Spec;
use vars qw( $VERSION );
$VERSION = '2.64';
-my $shuffle = 0;
-my $dry = 0;
-my $blib = 0;
-my $lib = 0;
-my $recurse = 0;
+my $shuffle = 0;
+my $dry = 0;
+my $blib = 0;
+my $lib = 0;
+my $recurse = 0;
my @includes = ();
my @switches = ();
# Allow cuddling the paths with the -I
-@ARGV = map { /^(-I)(.+)/ ? ( $1, $2 ) : $_ } @ARGV;
+@ARGV = map { /^(-I)(.+)/ ? ($1,$2) : $_ } @ARGV;
# Stick any default switches at the beginning, so they can be overridden
# by the command line switches.
-unshift @ARGV, split( ' ', $ENV{PROVE_SWITCHES} )
- if defined $ENV{PROVE_SWITCHES};
+unshift @ARGV, split( ' ', $ENV{PROVE_SWITCHES} ) if defined $ENV{PROVE_SWITCHES};
-Getopt::Long::Configure('no_ignore_case');
-Getopt::Long::Configure('bundling');
+Getopt::Long::Configure( 'no_ignore_case' );
+Getopt::Long::Configure( 'bundling' );
GetOptions(
- 'b|blib' => \$blib,
- 'd|debug' => \$Test::Harness::debug,
- 'D|dry' => \$dry,
- 'h|help|?' => sub { pod2usage( { -verbose => 1 } ); exit },
- 'H|man' => sub { pod2usage( { -verbose => 2 } ); exit },
- 'I=s@' => \@includes,
- 'l|lib' => \$lib,
- 'perl=s' => \$ENV{HARNESS_PERL},
- 'r|recurse' => \$recurse,
- 's|shuffle' => \$shuffle,
- 't' => sub { unshift @switches, '-t' }, # Always want -t up front
- 'T' => sub { unshift @switches, '-T' }, # Always want -T up front
- 'w' => sub { push @switches, '-w' },
- 'W' => sub { push @switches, '-W' },
- 'strap=s' => \$ENV{HARNESS_STRAP_CLASS},
- 'timer' => \$Test::Harness::Timer,
- 'v|verbose' => \$Test::Harness::verbose,
- 'V|version' => sub { print_version(); exit; },
- ) or
- exit 1;
+ 'b|blib' => \$blib,
+ 'd|debug' => \$Test::Harness::debug,
+ 'D|dry' => \$dry,
+ 'h|help|?' => sub {pod2usage({-verbose => 1}); exit},
+ 'H|man' => sub {pod2usage({-verbose => 2}); exit},
+ 'I=s@' => \@includes,
+ 'l|lib' => \$lib,
+ 'perl=s' => \$ENV{HARNESS_PERL},
+ 'r|recurse' => \$recurse,
+ 's|shuffle' => \$shuffle,
+ 't' => sub { unshift @switches, '-t' }, # Always want -t up front
+ 'T' => sub { unshift @switches, '-T' }, # Always want -T up front
+ 'w' => sub { push @switches, '-w' },
+ 'W' => sub { push @switches, '-W' },
+ 'strap=s' => \$ENV{HARNESS_STRAP_CLASS},
+ 'timer' => \$Test::Harness::Timer,
+ 'v|verbose' => \$Test::Harness::verbose,
+ 'V|version' => sub { print_version(); exit; },
+) or exit 1;
$ENV{TEST_VERBOSE} = 1 if $Test::Harness::verbose;
# Handle blib includes
-if ($blib) {
+if ( $blib ) {
my @blibdirs = blibdirs();
- if (@blibdirs) {
+ if ( @blibdirs ) {
unshift @includes, @blibdirs;
}
else {
@@ -66,16 +64,14 @@ if ($blib) {
}
# Handle lib includes
-if ($lib) {
+if ( $lib ) {
unshift @includes, 'lib';
}
# Build up TH switches
-push( @switches,
- map { /\s/ && !/^".*"$/ ? qq["-I$_"] : "-I$_" } @includes );
+push( @switches, map { /\s/ && !/^".*"$/ ? qq["-I$_"] : "-I$_" } @includes );
$Test::Harness::Switches = join( ' ', @switches );
-print "# \$Test::Harness::Switches: $Test::Harness::Switches\n"
- if $Test::Harness::debug;
+print "# \$Test::Harness::Switches: $Test::Harness::Switches\n" if $Test::Harness::debug;
@ARGV = File::Spec->curdir unless @ARGV;
my @argv_globbed;
@@ -85,31 +81,27 @@ if ( $] >= 5.006001 ) {
@argv_globbed = map { File::Glob::bsd_glob($_) } @ARGV;
}
else {
- @argv_globbed = map {glob} @ARGV;
+ @argv_globbed = map { glob } @ARGV;
}
-for (@argv_globbed) {
- push( @tests,
- -d $_ ? all_in( { recurse => $recurse, start => $_ } ) : $_ );
+for ( @argv_globbed ) {
+ push( @tests, -d $_ ? all_in( { recurse => $recurse, start => $_ } ) : $_ )
}
-if (@tests) {
+if ( @tests ) {
shuffle(@tests) if $shuffle;
- if ($dry) {
+ if ( $dry ) {
print join( "\n", @tests, '' );
}
else {
- print "# ", scalar @tests, " tests to run\n"
- if $Test::Harness::debug;
+ print "# ", scalar @tests, " tests to run\n" if $Test::Harness::debug;
runtests(@tests);
}
}
sub print_version {
- printf(
- "prove v%s, using Test::Harness v%s and Perl v%vd\n",
- $VERSION, $Test::Harness::VERSION, $^V
- );
+ printf( "prove v%s, using Test::Harness v%s and Perl v%vd\n",
+ $VERSION, $Test::Harness::VERSION, $^V );
}
__END__
Oops, something went wrong.

0 comments on commit 76f91cc

Please sign in to comment.